/* ===== CSS Variables — Enterprise Deep Blue ===== */
:root {
  --bg: #060c1a;
  --bg2: #0a1228;
  --bg3: #0e1a38;
  --bg4: #132044;
  --border: #1a3060;
  --border-glow: rgba(59, 130, 246, 0.4);
  --text: #e0eaff;
  --text2: #7a9ac5;
  --text3: #3d5a8a;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --accent-light: rgba(59, 130, 246, 0.12);
  --accent-glow: rgba(59, 130, 246, 0.3);
  --cyan: #38bdf8;
  --cyan-light: rgba(56, 189, 248, 0.12);
  --green: #34d399;
  --green-light: rgba(52, 211, 153, 0.12);
  --red: #f87171;
  --red-light: rgba(248, 113, 113, 0.12);
  --yellow: #fbbf24;
  --yellow-light: rgba(251, 191, 36, 0.12);
  --orange: #fb923c;
  --sidebar-w: 240px;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.5), 0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow-float: 0 8px 32px rgba(0, 0, 0, 0.6), 0 2px 8px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(59, 130, 246, 0.08);
  --shadow-glow: 0 0 24px rgba(59, 130, 246, 0.15);
  --transition: 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  --glass-bg: rgba(10, 18, 40, 0.75);
  --glass-border: rgba(59, 130, 246, 0.2);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  height: 100vh;
  overflow: hidden;
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(37, 99, 235, 0.15) 0%, transparent 70%),
    linear-gradient(rgba(26, 48, 96, 0.25) 1px, transparent 1px),
    linear-gradient(90deg, rgba(26, 48, 96, 0.25) 1px, transparent 1px);
  background-size: 100% 100%, 40px 40px, 40px 40px;
}

/* ===== Layout ===== */
.app {
  display: flex;
  height: 100vh;
}

/* ===== Sidebar ===== */
.sidebar {
  width: var(--sidebar-w);
  background: rgba(10, 18, 40, 0.9);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  backdrop-filter: blur(20px);
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.4);
  position: relative;
  z-index: 10;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
}

.logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, #3b82f6, #60a5fa);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  box-shadow: 0 0 16px rgba(59, 130, 246, 0.4);
}

.logo-text {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.3px;
}

.sidebar-nav {
  flex: 1;
  padding: 12px 0;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  margin: 2px 8px;
  border-radius: var(--radius-sm);
  color: var(--text2);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all var(--transition);
  position: relative;
}

.nav-item:hover {
  background: rgba(59, 130, 246, 0.08);
  color: var(--text);
}

.nav-item.active {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.2);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 60%;
  background: #3b82f6;
  border-radius: 0 3px 3px 0;
  box-shadow: 0 0 8px rgba(59, 130, 246, 0.6);
}

.nav-item.active .nav-icon {
  filter: none;
}

.nav-icon {
  font-size: 16px;
  width: 20px;
  text-align: center;
}

.badge {
  margin-left: auto;
  background: var(--red);
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 20px;
  min-width: 18px;
  text-align: center;
}

.sidebar-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text3);
}

.status-dot {
  width: 8px;
  height: 8px;
  background: var(--green);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.5;
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}

@keyframes glowPulse {

  0%,
  100% {
    box-shadow: 0 0 12px rgba(59, 130, 246, 0.3);
  }

  50% {
    box-shadow: 0 0 24px rgba(59, 130, 246, 0.6);
  }
}

@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ===== Main ===== */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 28px;
  border-bottom: 1px solid var(--border);
  background: rgba(10, 18, 40, 0.8);
  backdrop-filter: blur(16px);
  flex-shrink: 0;
  position: relative;
  z-index: 5;
}

.page-title {
  font-size: 20px;
  font-weight: 700;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.current-time {
  font-size: 13px;
  color: var(--text2);
}

.content {
  flex: 1;
  overflow-y: auto;
  padding: 28px;
}

/* ===== Buttons ===== */
.btn {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-primary {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: white;
  box-shadow: 0 2px 12px rgba(59, 130, 246, 0.35);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #60a5fa, #3b82f6);
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(59, 130, 246, 0.5);
}

.btn-secondary {
  background: rgba(19, 32, 68, 0.8);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: rgba(26, 48, 96, 0.8);
  border-color: rgba(59, 130, 246, 0.3);
}

.btn-danger {
  background: var(--red-light);
  color: var(--red);
  border: 1px solid transparent;
}

.btn-danger:hover {
  background: var(--red);
  color: white;
  box-shadow: 0 2px 12px rgba(248, 113, 113, 0.4);
}

.btn-success {
  background: var(--green-light);
  color: var(--green);
  border: 1px solid transparent;
}

.btn-success:hover {
  background: var(--green);
  color: white;
  box-shadow: 0 2px 12px rgba(52, 211, 153, 0.4);
}

.btn-sm {
  padding: 4px 10px;
  font-size: 12px;
}

.btn-icon {
  padding: 6px;
  background: transparent;
  color: var(--text2);
}

.btn-icon:hover {
  color: var(--text);
  background: var(--bg4);
}

/* ===== Cards — Floating Glassmorphism ===== */
.card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 20px;
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow-float);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  animation: slideUp 0.3s ease-out;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-float), var(--shadow-glow);
  border-color: rgba(59, 130, 246, 0.3);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

/* ===== Stats Grid ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 20px;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow-float);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  animation: slideUp 0.3s ease-out;
}

.stat-card:hover {
  transform: translateY(-3px);
  border-color: rgba(59, 130, 246, 0.4);
  box-shadow: var(--shadow-float), 0 0 30px rgba(59, 130, 246, 0.12);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, #3b82f6, #38bdf8, #3b82f6);
  background-size: 200% 100%;
  animation: shimmer 3s ease infinite;
}

.stat-icon {
  font-size: 28px;
  margin-bottom: 10px;
}

.stat-value {
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 4px;
}

.stat-label {
  font-size: 12px;
  color: var(--text2);
}

.stat-change {
  font-size: 12px;
  margin-top: 8px;
  color: var(--green);
}

/* ===== Table ===== */
.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

thead th {
  text-align: left;
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border);
}

tbody tr {
  border-bottom: 1px solid rgba(26, 48, 96, 0.6);
  transition: background var(--transition), box-shadow var(--transition);
  cursor: pointer;
  position: relative;
}

tbody tr:hover {
  background: rgba(59, 130, 246, 0.06);
  box-shadow: inset 3px 0 0 rgba(59, 130, 246, 0.5);
}

tbody tr:last-child {
  border-bottom: none;
}

tbody td {
  padding: 12px 14px;
  vertical-align: middle;
}

/* ===== Forms ===== */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text2);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  background: rgba(14, 26, 56, 0.7);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
  backdrop-filter: blur(4px);
}

.form-control:focus {
  border-color: rgba(59, 130, 246, 0.6);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

select.form-control option,
select option {
  background: #1a2744;
  color: #e2e8f0;
}

select.form-control option:checked,
select option:checked {
  background: #2563eb;
  color: #ffffff;
}

select.form-control option:hover,
select option:hover {
  background: #1e3a8a;
  color: #ffffff;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

/* ===== Search / Filters ===== */
.toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.search-box {
  position: relative;
  flex: 1;
  max-width: 380px;
}

.search-box input {
  width: 100%;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px 8px 36px;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color var(--transition);
}

.search-box input:focus {
  border-color: var(--accent);
}

.search-icon {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text3);
  font-style: normal;
  font-size: 14px;
}

/* ===== Badges / Tags ===== */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}

.tag-active {
  background: var(--green-light);
  color: var(--green);
}

.tag-inactive {
  background: var(--bg4);
  color: var(--text3);
}

.tag-new {
  background: var(--cyan-light);
  color: var(--cyan);
}

.tag-negotiation {
  background: var(--accent-light);
  color: var(--accent);
}

.tag-proposal {
  background: var(--yellow-light);
  color: var(--yellow);
}

.tag-won {
  background: var(--green-light);
  color: var(--green);
}

.tag-lost {
  background: var(--red-light);
  color: var(--red);
}

.priority-high {
  color: var(--red);
}

.priority-medium {
  color: var(--yellow);
}

.priority-low {
  color: var(--green);
}

/* ===== Avatar ===== */
.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
  color: white;
}

.client-row-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ===== Modal — Floating Glass Window ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(3, 7, 18, 0.75);
  backdrop-filter: blur(8px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal {
  position: relative;
  z-index: 101;
  background: rgba(10, 18, 40, 0.92);
  border: 1px solid rgba(59, 130, 246, 0.25);
  border-radius: 16px;
  width: 560px;
  max-width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  opacity: 0;
  transform: scale(0.96);
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow:
    0 24px 64px rgba(0, 0, 0, 0.8),
    0 8px 24px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(59, 130, 246, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(24px);
}

.modal.active {
  opacity: 1;
  transform: scale(1);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid rgba(59, 130, 246, 0.12);
}

.modal-header h3 {
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
}

.modal-close {
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.15);
  color: var(--text2);
  cursor: pointer;
  font-size: 16px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: all var(--transition);
}

.modal-close:hover {
  color: var(--text);
  background: rgba(59, 130, 246, 0.2);
  border-color: rgba(59, 130, 246, 0.4);
}

.modal-body {
  padding: 20px 24px 24px;
}

/* ===== Kanban ===== */
.kanban-board {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
  height: calc(100vh - 160px);
}

.kanban-col {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.kanban-col-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.kanban-col-title {
  font-size: 13px;
  font-weight: 600;
}

.kanban-count {
  background: var(--bg4);
  color: var(--text2);
  padding: 2px 7px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}

.kanban-cards {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 60px;
}

.kanban-cards.drag-over {
  background: var(--accent-light);
  border-radius: var(--radius-sm);
}

.deal-card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  cursor: grab;
  transition: all var(--transition);
  user-select: none;
}

.deal-card:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.deal-card.dragging {
  opacity: 0.5;
  cursor: grabbing;
}

.deal-title {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
}

.deal-client {
  font-size: 11px;
  color: var(--text2);
  margin-bottom: 8px;
}

.deal-amount {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
}

.deal-actions {
  display: flex;
  gap: 4px;
  margin-top: 8px;
}

.kanban-add-btn {
  margin: 8px;
  background: none;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 8px;
  color: var(--text3);
  cursor: pointer;
  font-size: 13px;
  transition: all var(--transition);
  width: calc(100% - 16px);
}

.kanban-add-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-light);
}

/* ===== Tasks ===== */
.tasks-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.task-item {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: all var(--transition);
}

.task-item:hover {
  border-color: var(--accent);
}

.task-item.done {
  opacity: 0.5;
}

.task-check {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-radius: 50%;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.task-check:hover {
  border-color: var(--green);
}

.task-item.done .task-check {
  background: var(--green);
  border-color: var(--green);
}

.task-check-icon {
  color: white;
  font-size: 10px;
  display: none;
}

.task-item.done .task-check-icon {
  display: block;
}

.task-body {
  flex: 1;
}

.task-title {
  font-size: 14px;
  font-weight: 500;
}

.task-item.done .task-title {
  text-decoration: line-through;
  color: var(--text2);
}

.task-meta {
  font-size: 12px;
  color: var(--text2);
  margin-top: 3px;
}

.task-overdue {
  color: var(--red);
}

.task-actions {
  display: flex;
  gap: 4px;
}

/* ===== Client Detail ===== */
.client-detail-header {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 24px;
}

.client-avatar-lg {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}

.client-info-block h2 {
  font-size: 22px;
  font-weight: 700;
}

.client-info-block p {
  color: var(--text2);
  font-size: 14px;
  margin-top: 3px;
}

.client-action-btns {
  margin-left: auto;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.whatsapp-btn {
  background: #25d366;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.whatsapp-btn:hover {
  background: #20ba5a;
  transform: translateY(-1px);
}

.anydesk-btn {
  background: #ef4444;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.anydesk-btn:hover {
  background: #dc2626;
  transform: translateY(-1px);
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

.info-label {
  font-size: 11px;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.info-value {
  font-size: 14px;
  font-weight: 500;
}

/* ===== Notes ===== */
.notes-timeline {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.note-item {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  display: flex;
  gap: 12px;
}

.note-type-icon {
  font-size: 18px;
  flex-shrink: 0;
}

.note-body {
  flex: 1;
}

.note-content {
  font-size: 14px;
}

.note-date {
  font-size: 11px;
  color: var(--text3);
  margin-top: 4px;
}

.note-add-row {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

.note-add-row select {
  width: 130px;
  flex-shrink: 0;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  outline: none;
}

.note-add-row input {
  flex: 1;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color var(--transition);
}

.note-add-row input:focus {
  border-color: var(--accent);
}

/* ===== Charts ===== */
.charts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 24px;
}

.chart-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.chart-card h3 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 16px;
}

/* ===== Activity Feed ===== */
.activity-feed {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.activity-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.activity-item:last-child {
  border-bottom: none;
}

.activity-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

.activity-body {
  flex: 1;
}

.activity-text {
  font-size: 13px;
}

.activity-time {
  font-size: 11px;
  color: var(--text3);
  margin-top: 2px;
}

/* ===== Loading ===== */
.loading-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 300px;
  color: var(--text2);
  gap: 16px;
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ===== Toast ===== */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 200;
}

.toast {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 18px;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slide-in 0.3s ease;
  box-shadow: var(--shadow);
  max-width: 320px;
}

.toast-success {
  border-left: 3px solid var(--green);
}

.toast-error {
  border-left: 3px solid var(--red);
}

.toast-info {
  border-left: 3px solid var(--accent);
}

@keyframes slide-in {
  from {
    transform: translateX(100%);
    opacity: 0;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* ===== Misc ===== */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text2);
}

.empty-state-icon {
  font-size: 48px;
  margin-bottom: 12px;
  opacity: 0.5;
}

.empty-state h3 {
  font-size: 16px;
  margin-bottom: 6px;
  color: var(--text);
}

.empty-state p {
  font-size: 14px;
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text2);
  cursor: pointer;
  font-size: 14px;
  background: none;
  border: none;
  padding: 4px 0;
  margin-bottom: 20px;
  font-family: inherit;
  transition: color var(--transition);
}

.back-btn:hover {
  color: var(--text);
}

.divider {
  height: 1px;
  background: var(--border);
  margin: 20px 0;
}

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--bg4);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text3);
}

/* ===== Filters row ===== */
.filter-tabs {
  display: flex;
  gap: 4px;
}

.filter-tab {
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  cursor: pointer;
  border: 1px solid transparent;
  color: var(--text2);
  background: none;
  font-family: inherit;
  transition: all var(--transition);
}

.filter-tab:hover {
  background: var(--bg4);
  color: var(--text);
}

.filter-tab.active {
  background: var(--accent-light);
  color: var(--accent);
  border-color: var(--accent);
}

/* ===== Custom Tooltips ===== */
#crm-tooltip {
  position: fixed;
  z-index: 99999;
  pointer-events: none;
  padding: 6px 11px;
  background: #1a1f2e;
  color: #e6edf3;
  font-size: 12px;
  font-weight: 500;
  border-radius: 6px;
  border: 1px solid #30363d;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
  white-space: nowrap;
  max-width: 260px;
  white-space: normal;
  line-height: 1.4;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.15s ease, transform 0.15s ease;
  backdrop-filter: blur(8px);
}

#crm-tooltip.visible {
  opacity: 1;
  transform: translateY(0);
}

#crm-tooltip::before {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 50%;
  transform: translateX(-50%);
  width: 8px;
  height: 8px;
  background: #1a1f2e;
  border-right: 1px solid #30363d;
  border-bottom: 1px solid #30363d;
  transform: translateX(-50%) rotate(45deg);
}

/* ===== Settings Page ===== */
.settings-page {
  max-width: 900px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.settings-section {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.settings-section-header {
  padding: 24px 24px 20px;
  border-bottom: 1px solid var(--border);
}

.settings-section-header h2 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 6px;
}

.settings-desc {
  font-size: 13px;
  color: var(--text2);
  line-height: 1.5;
}

/* Backup action buttons */
.backup-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  padding: 20px 24px 24px;
}

.backup-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 16px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
  text-align: left;
  border: 1px solid var(--border);
  background: var(--bg3);
  color: var(--text);
}

.backup-btn:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(124, 58, 237, 0.2);
}

.backup-btn-icon {
  font-size: 28px;
  flex-shrink: 0;
}

.backup-btn-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 2px;
}

.backup-btn-desc {
  font-size: 11px;
  color: var(--text2);
}

.btn-warning {
  background: var(--bg3);
  border: 1px solid var(--orange);
}

.btn-warning:hover {
  background: rgba(240, 136, 62, 0.1);
  border-color: var(--orange);
}

/* Backups list table */
.backups-table {
  padding: 0;
}

.backups-header {
  display: grid;
  grid-template-columns: 1fr 100px 160px 100px;
  gap: 12px;
  padding: 12px 24px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border);
}

.backup-row {
  display: grid;
  grid-template-columns: 1fr 100px 160px 100px;
  gap: 12px;
  padding: 14px 24px;
  align-items: center;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}

.backup-row:last-child {
  border-bottom: none;
}

.backup-row:hover {
  background: var(--bg3);
}

.backup-filename {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-icon {
  font-size: 18px;
  flex-shrink: 0;
}

.backup-size {
  font-size: 13px;
  color: var(--text2);
}

.backup-date {
  font-size: 13px;
  color: var(--text2);
}

.backup-actions-cell {
  display: flex;
  gap: 4px;
}

.btn-icon {
  padding: 6px 8px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 16px;
  transition: all var(--transition);
}

.btn-restore:hover {
  background: var(--green-light);
}

.btn-delete:hover {
  background: var(--red-light);
}

/* Upload / Restore zone */
.restore-upload {
  text-align: center;
}

.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 40px 24px;
  cursor: pointer;
  transition: all var(--transition);
  background: var(--bg3);
}

.upload-zone:hover,
.upload-zone.dragover {
  border-color: var(--accent);
  background: var(--accent-light);
}

.upload-icon {
  font-size: 48px;
  margin-bottom: 12px;
}

.upload-text {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 6px;
}

.upload-hint {
  font-size: 12px;
  color: var(--text2);
}

.selected-file {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  text-align: left;
}

.file-name {
  font-size: 14px;
  font-weight: 600;
}

.file-size {
  font-size: 12px;
  color: var(--text2);
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 48px 24px;
}

.empty-icon {
  font-size: 48px;
  margin-bottom: 12px;
}

.empty-state p {
  font-size: 15px;
  font-weight: 500;
  color: var(--text2);
}

.empty-hint {
  font-size: 13px !important;
  color: var(--text3) !important;
  margin-top: 6px;
}

.error-state {
  padding: 24px;
  text-align: center;
  color: var(--red);
}

@media (max-width: 768px) {
  .backup-actions {
    grid-template-columns: 1fr;
  }

  .backups-header,
  .backup-row {
    grid-template-columns: 1fr 80px 80px;
  }

  .backup-date {
    display: none;
  }
}

/* ===== Dashboard animations ===== */
@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeOut {
  from {
    opacity: 1;
    transform: scale(1);
  }

  to {
    opacity: 0;
    transform: scale(0.95);
  }
}

/* stat-change subtitle on dashboard cards */
.stat-change {
  font-size: 11px;
  color: var(--text2);
  margin-top: 4px;
}