/* ============================================================
   Digital 520 Platform — Enterprise Design System v2.0
   Modeled after HubSpot / ActiveCampaign / Salesforce
   ============================================================ */

/* ── Variables ────────────────────────────────────────────── */
:root {
  --teal:      #00b8b8;
  --teal-lt:   #00d4d4;
  --teal-dk:   #007a7a;
  --teal-glow: rgba(0,184,184,0.15);
  --navy:      #060d1c;
  --navy2:     #0d1f35;
  --navy3:     #0f2440;
  --text:      #0d1f35;
  --text-lt:   #5a6678;
  --text-muted:#8a94a6;
  --bg:        #f5f7fa;
  --bg-hover:  #f0f3f8;
  --bg-card:   #ffffff;
  --border:    #e2e8f0;
  --border-lt: #f0f4f8;
  --danger:    #dc2626;
  --danger-lt: #fef2f2;
  --warning:   #d97706;
  --warning-lt:#fffbeb;
  --success:   #16a34a;
  --success-lt:#f0fdf4;
  --purple:    #7c3aed;
  --purple-lt: #ede9fe;
  --blue:      #2563eb;
  --blue-lt:   #eff6ff;
  --sidebar-w: 260px;
  --topbar-h:  64px;
  --radius:    8px;
  --radius-sm: 6px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.06), 0 2px 4px rgba(0,0,0,0.04);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.1), 0 4px 12px rgba(0,0,0,0.06);
  --shadow-xl: 0 24px 64px rgba(0,0,0,0.14), 0 8px 20px rgba(0,0,0,0.08);
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Reset ────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body { font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; color: var(--text); background: var(--bg); line-height: 1.6; }
a { color: var(--teal); text-decoration: none; transition: color var(--transition-fast); }
a:hover { color: var(--teal-dk); }
img { max-width: 100%; display: block; }
input, textarea, select, button { font-family: inherit; font-size: 14px; }
ul { list-style: none; }
::selection { background: rgba(0,184,184,0.2); color: var(--navy); }

/* ── Scrollbar ───────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.12); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.2); }

/* ── Auth pages ───────────────────────────────────────────── */
.auth-page {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy2) 50%, #0a2540 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  position: relative;
  overflow: hidden;
}
.auth-page::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -30%;
  width: 80%;
  height: 200%;
  background: radial-gradient(ellipse, rgba(0,184,184,0.06) 0%, transparent 70%);
  pointer-events: none;
}
.auth-container { width: 100%; max-width: 440px; position: relative; z-index: 1; }
.auth-card {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 44px 40px;
  box-shadow: var(--shadow-xl);
  border: 1px solid rgba(255,255,255,0.1);
}
.auth-logo { text-align: center; margin-bottom: 32px; }
.auth-logo img { margin: 0 auto; }
.auth-title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 28px;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 6px;
  text-align: center;
}
.auth-subtitle {
  text-align: center;
  color: var(--text-lt);
  font-size: 14px;
  margin-bottom: 28px;
  line-height: 1.5;
}
.auth-footer {
  text-align: center;
  color: rgba(255,255,255,0.25);
  font-size: 12px;
  margin-top: 24px;
}
.auth-success { text-align: center; padding: 20px 0; }
.success-icon {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--teal), var(--teal-lt));
  color: #fff;
  font-size: 28px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 20px;
  box-shadow: 0 8px 24px rgba(0,184,184,0.3);
}

/* ── Sidebar layout ───────────────────────────────────────── */
.portal-layout, .staff-layout {
  display: flex;
  min-height: 100vh;
}
.sidebar {
  width: var(--sidebar-w);
  background: linear-gradient(180deg, var(--navy2) 0%, #081829 100%);
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border-right: 1px solid rgba(255,255,255,0.04);
}
.sidebar-dark { background: linear-gradient(180deg, var(--navy) 0%, #040a16 100%); }
.sidebar-logo {
  padding: 22px 24px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.sidebar-nav {
  flex: 1;
  padding: 8px 0;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.1) transparent;
}
.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }
.nav-group { margin-bottom: 4px; }
.nav-group-label {
  display: block;
  padding: 16px 24px 6px;
  font-family: 'Space Mono', monospace;
  font-size: 10px;
  letter-spacing: 1.5px;
  color: rgba(255,255,255,0.25);
  text-transform: uppercase;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 24px;
  color: rgba(255,255,255,0.55);
  font-size: 13.5px;
  font-weight: 400;
  transition: all var(--transition-fast);
  position: relative;
  margin: 1px 8px;
  border-radius: var(--radius-sm);
}
.nav-item:hover {
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.9);
}
.nav-item.active {
  background: rgba(0,184,184,0.12);
  color: var(--teal-lt);
  font-weight: 500;
}
.nav-item.active::before {
  content: '';
  position: absolute;
  left: -8px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 20px;
  background: var(--teal);
  border-radius: 0 2px 2px 0;
}
.nav-icon {
  width: 18px; height: 18px;
  stroke: currentColor; fill: none;
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
  flex-shrink: 0;
  opacity: 0.75;
}
.nav-item.active .nav-icon { opacity: 1; }
.nav-badge {
  background: var(--teal);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
  margin-left: auto;
  line-height: 1.2;
}
.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,0.06);
  background: rgba(0,0,0,0.15);
}
.sidebar-user { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.user-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--teal-dk), var(--teal));
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0,184,184,0.3);
}
.user-name { color: #fff; font-size: 13px; font-weight: 500; }
.user-role { color: rgba(255,255,255,0.35); font-size: 11px; margin-top: 1px; }
.logout-link {
  display: block;
  font-size: 12px;
  color: rgba(255,255,255,0.3);
  transition: color var(--transition-fast);
}
.logout-link:hover { color: rgba(255,255,255,0.6); }
.contact-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 8px;
  transition: all var(--transition-fast);
}
.contact-btn svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 2; flex-shrink:0; }
.contact-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,0.2); }
.contact-btn-book { background: linear-gradient(135deg, var(--teal), var(--teal-lt)); color: #fff; }
.contact-btn-email { background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.75); border: 1px solid rgba(255,255,255,0.1); }

/* ── Main area ────────────────────────────────────────────── */
.main-wrapper {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.topbar {
  height: var(--topbar-h);
  background: #fff;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 32px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(12px);
  background: rgba(255,255,255,0.95);
}
.sidebar-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  transition: background var(--transition-fast);
}
.sidebar-toggle:hover { background: var(--bg); }
.sidebar-toggle span { display: block; width: 20px; height: 2px; background: var(--text); border-radius: 2px; transition: all var(--transition-fast); }
.topbar-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 24px;
  font-weight: 600;
  color: var(--navy);
  margin: 0;
}
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.topbar-company { color: var(--text-lt); font-size: 13px; }

/* ── Global Search ───────────────────────────────────────── */
.topbar-search {
  position: relative;
  flex: 0 1 360px;
  margin: 0 8px;
}
.topbar-search input {
  width: 100%;
  padding: 7px 40px 7px 34px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  color: var(--text);
  background: var(--bg);
  transition: all var(--transition-fast);
  box-sizing: border-box;
}
.topbar-search input::placeholder { color: var(--text-muted); }
.topbar-search input:focus {
  background: #fff;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px var(--teal-glow);
  outline: none;
}
.topbar-search .search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 15px;
  height: 15px;
  stroke: var(--text-muted);
  fill: none;
  stroke-width: 2;
  pointer-events: none;
}
.topbar-search .search-shortcut {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 10px;
  color: var(--text-muted);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
  line-height: 1.4;
  pointer-events: none;
}
/* Search results dropdown */
.search-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0; right: 0;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.12);
  max-height: 420px;
  overflow-y: auto;
  z-index: 999;
  display: none;
}
.search-results.active { display: block; }
.search-results-group { padding: 6px 0; }
.search-results-group + .search-results-group { border-top: 1px solid var(--border-lt); }
.search-group-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  padding: 6px 14px 4px;
}
.search-result-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  transition: background 0.1s;
}
.search-result-item:hover, .search-result-item.highlighted {
  background: var(--bg-hover, #f3f4f6);
}
.search-result-icon {
  width: 30px; height: 30px;
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-size: 13px;
}
.search-result-icon.contact { background: #e0f2fe; color: #0284c7; }
.search-result-icon.company { background: #fce7f3; color: #db2777; }
.search-result-icon.deal { background: #d1fae5; color: #059669; }
.search-result-icon.invoice { background: #fef3c7; color: #d97706; }
.search-result-text { min-width: 0; }
.search-result-text .sr-label { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-result-text .sr-sub { font-size: 11px; color: var(--text-lt); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-empty { padding: 20px; text-align: center; color: var(--text-muted); font-size: 13px; }

/* ── Notification Bell ───────────────────────────────────── */
.topbar-notifications {
  position: relative;
  cursor: pointer;
  padding: 6px;
  border-radius: 50%;
  transition: background var(--transition-fast);
}
.topbar-notifications:hover { background: var(--bg); }
.topbar-notifications > svg { width: 20px; height: 20px; stroke: var(--text-lt); fill: none; stroke-width: 2; }
.notif-badge {
  position: absolute;
  top: 0;
  right: -2px;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  padding: 0 5px;
  border: 2px solid #fff;
  pointer-events: none;
  animation: notifBadgePop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes notifBadgePop {
  0% { transform: scale(0); }
  100% { transform: scale(1); }
}

/* Dropdown panel */
.notif-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: -80px;
  width: 400px;
  max-height: 540px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.12), 0 4px 16px rgba(0,0,0,0.06);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px) scale(0.98);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
}
.notif-dropdown.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}
.notif-dropdown::before {
  content: '';
  position: absolute;
  top: -6px;
  right: 92px;
  width: 12px;
  height: 12px;
  background: #fff;
  border: 1px solid var(--border);
  border-right: none;
  border-bottom: none;
  transform: rotate(45deg);
  z-index: 1;
}
.notif-dropdown-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--border-lt);
}
.notif-dropdown-header h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--navy);
  margin: 0;
  letter-spacing: -0.01em;
}
.notif-mark-all {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: none;
  border: none;
  color: var(--teal);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: background 0.15s, color 0.15s;
}
.notif-mark-all:hover {
  background: rgba(0,184,184,0.08);
}

/* Tabs */
.notif-tabs {
  display: flex;
  gap: 2px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--border-lt);
  overflow-x: auto;
}
.notif-tab {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  padding: 5px 10px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-muted);
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}
.notif-tab:hover {
  background: var(--bg);
  color: var(--text);
}
.notif-tab.active {
  background: var(--teal);
  color: #fff;
}
.notif-tab.active svg { stroke: #fff; }

/* Notification list */
.notif-list {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  max-height: 400px;
}
.notif-list::-webkit-scrollbar { width: 4px; }
.notif-list::-webkit-scrollbar-track { background: transparent; }
.notif-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.notif-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  color: var(--text-muted);
  font-size: 13px;
  gap: 12px;
}
.notif-spinner {
  width: 24px;
  height: 24px;
  border: 2.5px solid var(--border);
  border-top-color: var(--teal);
  border-radius: 50%;
  animation: notifSpin 0.7s linear infinite;
}
@keyframes notifSpin { to { transform: rotate(360deg); } }

.notif-empty {
  padding: 48px 20px;
  text-align: center;
  color: var(--text-muted);
}
.notif-empty-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 12px;
  background: var(--bg);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.notif-empty-icon svg {
  width: 24px;
  height: 24px;
  stroke: var(--text-muted);
  fill: none;
  stroke-width: 1.5;
}
.notif-empty-text { font-size: 13px; font-weight: 500; }

/* Individual notification item */
.notif-item {
  display: flex;
  gap: 12px;
  padding: 12px 20px;
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid var(--border-lt);
  transition: background 0.15s;
  position: relative;
  animation: notifSlideIn 0.25s ease both;
}
.notif-item:hover { background: var(--bg); }
.notif-item.unread { background: rgba(0,184,184,0.03); }
.notif-item.unread::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--teal);
}
@keyframes notifSlideIn {
  from { opacity: 0; transform: translateX(-8px); }
  to { opacity: 1; transform: translateX(0); }
}

.notif-icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.notif-icon svg { width: 18px; height: 18px; stroke-width: 1.8; fill: none; }
.notif-icon.ticket  { background: #fef3c7; }
.notif-icon.ticket svg  { stroke: #d97706; }
.notif-icon.invoice { background: #d1fae5; }
.notif-icon.invoice svg { stroke: #059669; }
.notif-icon.deal    { background: #dbeafe; }
.notif-icon.deal svg    { stroke: #2563eb; }
.notif-icon.email   { background: #ede9fe; }
.notif-icon.email svg   { stroke: #7c3aed; }
.notif-icon.system  { background: #f1f5f9; }
.notif-icon.system svg  { stroke: #64748b; }

.notif-content { flex: 1; min-width: 0; }
.notif-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--navy);
  line-height: 1.3;
  margin-bottom: 2px;
}
.notif-body {
  font-size: 12px;
  color: var(--text-lt);
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.notif-time {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 3px;
}

.notif-dismiss {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  border: none;
  background: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.15s, background 0.15s;
  align-self: center;
}
.notif-item:hover .notif-dismiss { opacity: 1; }
.notif-dismiss:hover { background: var(--border-lt); }
.notif-dismiss svg { width: 14px; height: 14px; stroke: var(--text-muted); fill: none; stroke-width: 2; }

/* Category group headers */
.notif-group-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  padding: 10px 20px 4px;
  background: var(--bg);
  border-bottom: 1px solid var(--border-lt);
  position: sticky;
  top: 0;
  z-index: 1;
}

@media (max-width: 480px) {
  .notif-dropdown {
    width: calc(100vw - 24px);
    right: -60px;
    border-radius: 10px;
  }
  .notif-dropdown::before { display: none; }
}

.main-content { padding: 32px; flex: 1; max-width: 1440px; }
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 99;
  backdrop-filter: blur(4px);
}

/* ── Page header ──────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  flex-wrap: wrap;
  gap: 12px;
}
.page-heading {
  font-family: 'Cormorant Garamond', serif;
  font-size: 30px;
  font-weight: 600;
  color: var(--navy);
  line-height: 1.2;
}
.page-subheading { color: var(--text-lt); font-size: 14px; margin-top: 4px; }
.page-actions { display: flex; gap: 8px; align-items: center; }
.breadcrumb { font-size: 13px; color: var(--text-lt); display: flex; align-items: center; gap: 6px; }
.breadcrumb a { color: var(--teal); }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb-sep { color: var(--text-muted); }

/* ── Cards ────────────────────────────────────────────────── */
.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: visible;
  transition: box-shadow var(--transition);
}
.card:hover { box-shadow: var(--shadow-md); }
.card > table:first-child thead tr:first-child th:first-child { border-top-left-radius: var(--radius); }
.card > table:first-child thead tr:first-child th:last-child { border-top-right-radius: var(--radius); }
.card > .card-body:first-child { border-radius: var(--radius) var(--radius) 0 0; }
.card > .card-body:last-child { border-radius: 0 0 var(--radius) var(--radius); }
.card > .card-body:only-child { border-radius: var(--radius); }
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-lt);
}
.card-title { font-size: 15px; font-weight: 600; color: var(--navy); margin: 0; }
.card-subtitle { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.card-link { font-size: 13px; color: var(--teal); font-weight: 500; }
.card-link:hover { color: var(--teal-dk); }
.card-body { padding: 24px; }

/* Card accent variants */
.card-accent-teal { border-top: 3px solid var(--teal); }
.card-accent-blue { border-top: 3px solid var(--blue); }
.card-accent-purple { border-top: 3px solid var(--purple); }
.card-accent-danger { border-top: 3px solid var(--danger); }

/* ── Stat grid ────────────────────────────────────────────── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 28px;
}
.stat-grid-3 { grid-template-columns: repeat(3, 1fr); }
.stat-grid-5 { grid-template-columns: repeat(5, 1fr); }
.stat-grid-2 { grid-template-columns: repeat(2, 1fr); }
.stat-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  text-decoration: none;
  color: inherit;
  transition: all var(--transition);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: transparent;
  transition: background var(--transition);
}
.stat-card:hover {
  border-color: var(--teal);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.stat-card:hover::before { background: var(--teal); }
.stat-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--text-lt);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.stat-icon {
  width: 16px;
  height: 16px;
  stroke: var(--teal);
  fill: none;
  stroke-width: 2;
}
.stat-value {
  font-family: 'Cormorant Garamond', serif;
  font-size: 34px;
  font-weight: 700;
  color: var(--navy);
  line-height: 1;
  margin-bottom: 6px;
}
.stat-sub { font-size: 12px; color: var(--text-muted); display: flex; align-items: center; gap: 4px; }
.stat-trend { font-weight: 600; }
.stat-trend-up { color: var(--success); }
.stat-trend-down { color: var(--danger); }
.stat-card-warn { border-color: #fbbf24; background: linear-gradient(135deg, #fffbeb, #fff); }
.stat-card-warn .stat-value { color: var(--warning); }
.stat-card-warn::before { background: var(--warning); }
.stat-card-teal { border-color: var(--teal); background: linear-gradient(135deg, #f0fdfd, #fff); }
.stat-card-teal .stat-value { color: var(--teal-dk); }
.stat-card-teal::before { background: var(--teal); }
.stat-card-danger { border-color: var(--danger); background: linear-gradient(135deg, #fef2f2, #fff); }
.stat-card-danger .stat-value { color: var(--danger); }
.stat-card-danger::before { background: var(--danger); }
.stat-card-success { border-color: var(--success); background: linear-gradient(135deg, #f0fdf4, #fff); }
.stat-card-success .stat-value { color: var(--success); }
.stat-card-success::before { background: var(--success); }

/* Stat sparkline (mini inline chart) */
.stat-sparkline {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 24px;
  margin-top: 8px;
}
.stat-sparkline-bar {
  flex: 1;
  background: var(--teal-glow);
  border-radius: 2px;
  transition: height 0.3s ease;
  min-height: 3px;
}

/* ── Dash grid ────────────────────────────────────────────── */
.dash-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.dash-grid-3 { grid-template-columns: 1fr 1fr 1fr; }

/* ── Tables ───────────────────────────────────────────────── */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
  padding: 12px 20px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--text-lt);
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}
.table td {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-lt);
  color: var(--text);
  vertical-align: middle;
}
.table tbody tr { transition: background var(--transition-fast); }
.table tbody tr:hover { background: var(--bg-hover); }
.table tbody tr:last-child td { border-bottom: none; }
.table-hover tbody tr:hover { background: var(--bg-hover); }
.table-compact td, .table-compact th { padding: 10px 14px; }

/* Sortable table headers */
.table th.sortable { cursor: pointer; user-select: none; }
.table th.sortable:hover { color: var(--teal); }
.table th.sortable::after { content: '↕'; margin-left: 4px; font-size: 10px; opacity: 0.4; }
.table th.sorted-asc::after { content: '↑'; opacity: 1; color: var(--teal); }
.table th.sorted-desc::after { content: '↓'; opacity: 1; color: var(--teal); }

/* Checkbox column */
.table .col-check { width: 40px; text-align: center; }
.table .col-check input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--teal); cursor: pointer; }

/* ── Badges ───────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
  gap: 4px;
}
.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.badge-gray   { background: #f0f2f5; color: var(--text-lt); }
.badge-gray .badge-dot { background: var(--text-lt); }
.badge-blue   { background: #dbeafe; color: #1d4ed8; }
.badge-blue .badge-dot { background: #1d4ed8; }
.badge-teal   { background: #ccfafa; color: var(--teal-dk); }
.badge-teal .badge-dot { background: var(--teal-dk); }
.badge-green  { background: #dcfce7; color: #15803d; }
.badge-green .badge-dot { background: #15803d; }
.badge-red    { background: #fee2e2; color: #dc2626; }
.badge-red .badge-dot { background: #dc2626; }
.badge-orange { background: #fed7aa; color: #c2410c; }
.badge-orange .badge-dot { background: #c2410c; }
.badge-purple { background: #ede9fe; color: #7c3aed; }
.badge-purple .badge-dot { background: #7c3aed; }
.badge-clickable { cursor: pointer; border: none; font-family: inherit; transition: all var(--transition-fast); }
.badge-clickable:hover { opacity: 0.8; transform: scale(1.05); }

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--transition-fast);
  text-decoration: none;
  white-space: nowrap;
  background: none;
  position: relative;
  overflow: hidden;
}
.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0);
  transition: background var(--transition-fast);
}
.btn:active::after { background: rgba(0,0,0,0.05); }
.btn svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; flex-shrink: 0; }
.btn-primary {
  background: linear-gradient(135deg, var(--teal), var(--teal-dk));
  color: #fff;
  border-color: var(--teal);
  box-shadow: 0 2px 8px rgba(0,184,184,0.25);
}
.btn-primary:hover {
  background: linear-gradient(135deg, var(--teal-lt), var(--teal));
  border-color: var(--teal-lt);
  color: #fff;
  box-shadow: 0 4px 16px rgba(0,184,184,0.35);
  transform: translateY(-1px);
}
.btn-outline { border-color: var(--border); color: var(--text); background: #fff; box-shadow: var(--shadow-sm); }
.btn-outline:hover { border-color: var(--teal); color: var(--teal); box-shadow: var(--shadow-md); }
.btn-ghost { color: var(--text-lt); }
.btn-ghost:hover { background: var(--bg); color: var(--text); }
.btn-teal { background: #f0fdfd; color: var(--teal-dk); border-color: var(--teal); }
.btn-teal:hover { background: var(--teal); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; border-color: var(--danger); box-shadow: 0 2px 8px rgba(220,38,38,0.25); }
.btn-danger:hover { background: #b91c1c; border-color: #b91c1c; transform: translateY(-1px); }
.btn-success { background: var(--success); color: #fff; border-color: var(--success); }
.btn-success:hover { background: #15803d; border-color: #15803d; }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-xs { padding: 3px 10px; font-size: 12px; }
.btn-lg { padding: 12px 28px; font-size: 15px; }
.btn-block { width: 100%; justify-content: center; }
.btn-icon { padding: 8px; border-radius: var(--radius-sm); }
.btn-icon:hover { background: var(--bg); }

/* Button group */
.btn-group { display: inline-flex; gap: 0; }
.btn-group .btn { border-radius: 0; margin-left: -1px; }
.btn-group .btn:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); margin-left: 0; }
.btn-group .btn:last-child { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }

/* ── Forms ────────────────────────────────────────────────── */
.form-group { margin-bottom: 20px; }
.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}
.form-label-sub { font-weight: 400; color: var(--text-muted); font-size: 12px; }
.form-label-link { float: right; font-weight: 400; color: var(--teal); font-size: 12px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row-3 { grid-template-columns: 1fr 1fr 1fr; }
.form-hint { font-size: 12px; color: var(--text-muted); margin-top: 4px; line-height: 1.4; }
.form-actions { display: flex; gap: 10px; margin-top: 12px; }
.req { color: var(--danger); }

input[type="text"], input[type="email"], input[type="password"],
input[type="tel"], input[type="url"], input[type="number"],
input[type="date"], input[type="datetime-local"],
textarea, select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--text);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  outline: none;
  font-size: 14px;
}
input:focus, textarea:focus, select:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px var(--teal-glow);
}
input::placeholder, textarea::placeholder { color: var(--text-muted); }
textarea { resize: vertical; min-height: 80px; }
.input-disabled { background: var(--bg); color: var(--text-muted); cursor: default; }
.input-full { width: 100%; }
.input-search { min-width: 260px; }
.input-select { min-width: 140px; }

/* Input with icon */
.input-icon-wrapper { position: relative; }
.input-icon-wrapper input { padding-left: 38px; }
.input-icon-wrapper .input-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  stroke: var(--text-muted);
  fill: none;
  stroke-width: 2;
  pointer-events: none;
}

/* Toggle switch */
.toggle-switch {
  position: relative;
  width: 44px;
  height: 24px;
  display: inline-block;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-switch .toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: var(--border);
  border-radius: 12px;
  transition: all var(--transition-fast);
}
.toggle-switch .toggle-slider::before {
  content: '';
  position: absolute;
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: transform var(--transition-fast);
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
.toggle-switch input:checked + .toggle-slider { background: var(--teal); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(20px); }

/* ── Filter bar ───────────────────────────────────────────── */
.filter-bar { margin-bottom: 20px; }
.filter-form { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.filter-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background: var(--teal-glow);
  color: var(--teal-dk);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}
.filter-tag-remove {
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  opacity: 0.7;
}
.filter-tag-remove:hover { opacity: 1; }

/* ── Tabs ─────────────────────────────────────────────────── */
.tab-bar {
  display: flex;
  gap: 0;
  margin-bottom: 20px;
  border-bottom: 2px solid var(--border);
  overflow-x: auto;
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.tab-bar::-webkit-scrollbar { display: none; }
.tab {
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-lt);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  white-space: nowrap;
  transition: all var(--transition-fast);
  position: relative;
}
.tab:hover { color: var(--text); background: var(--bg-hover); }
.tab.active { color: var(--teal); border-bottom-color: var(--teal); font-weight: 600; }
.tab-count {
  background: var(--bg);
  color: var(--text-lt);
  border-radius: 10px;
  padding: 2px 8px;
  font-size: 11px;
  margin-left: 6px;
  font-weight: 600;
}
.tab.active .tab-count { background: var(--teal-glow); color: var(--teal-dk); }

/* ── Flash messages ───────────────────────────────────────── */
.flash {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  border-radius: var(--radius);
  margin-bottom: 24px;
  font-size: 14px;
  font-weight: 500;
  animation: flashSlideIn 0.3s ease;
}
@keyframes flashSlideIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}
.flash-icon { font-weight: 700; flex-shrink: 0; font-size: 16px; }
.flash-success { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.flash-error   { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.flash-warning { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.flash-info    { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }

/* ── Modals ───────────────────────────────────────────────── */
.modal { display: none; position: fixed; inset: 0; z-index: 200; align-items: center; justify-content: center; padding: 24px; }
.modal.open { display: flex; }
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(6,13,28,0.65);
  backdrop-filter: blur(4px);
  animation: fadeIn 0.2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalSlideIn {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.modal-box {
  background: #fff;
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  z-index: 1;
  box-shadow: var(--shadow-xl);
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 28px;
  border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: 18px; font-weight: 600; margin: 0; }
.modal-close {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 20px;
  color: var(--text-lt);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}
.modal-close:hover { color: var(--text); background: var(--bg); }
.modal-body { padding: 28px; }
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 20px 28px;
  border-top: 1px solid var(--border);
  background: var(--bg);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}
/* Aliases */
.modal-overlay { position: absolute; inset: 0; background: rgba(6,13,28,0.65); backdrop-filter: blur(4px); }
.modal-container {
  background: #fff;
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  z-index: 1;
  box-shadow: var(--shadow-xl);
}

/* ── Files ────────────────────────────────────────────────── */
.file-list { padding: 0; }
.file-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-lt);
  transition: background var(--transition-fast);
}
.file-item:last-child { border-bottom: none; }
.file-item:hover { background: var(--bg-hover); margin: 0 -24px; padding: 12px 24px; border-radius: var(--radius-sm); }
.file-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
  background: var(--bg);
}
.file-meta { flex: 1; min-width: 0; }
.file-name { display: block; font-size: 14px; font-weight: 500; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-date { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.file-dl {
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text-lt);
  font-size: 13px;
  transition: all var(--transition-fast);
  font-weight: 500;
}
.file-dl:hover { background: var(--teal); color: #fff; }
.file-row-name { display: flex; align-items: center; gap: 10px; }

/* ── Reports grid ─────────────────────────────────────────── */
.report-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.report-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  border-top: 4px solid var(--teal);
  display: flex;
  flex-direction: column;
  transition: all var(--transition);
  box-shadow: var(--shadow-sm);
}
.report-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-4px); }
.report-card-body { padding: 24px; flex: 1; }
.report-title { font-family: 'Cormorant Garamond', serif; font-size: 19px; font-weight: 600; color: var(--navy); margin: 12px 0 10px; }
.report-excerpt { font-size: 14px; color: var(--text-lt); margin-bottom: 14px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.5; }
.report-meta { font-size: 12px; color: var(--text-muted); }
.report-card-footer { padding: 14px 24px 18px; border-top: 1px solid var(--border-lt); }

/* ── Pipeline board ───────────────────────────────────────── */
.pipeline-board {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 20px;
  align-items: flex-start;
}
.pipeline-col {
  min-width: 240px;
  max-width: 280px;
  flex-shrink: 0;
  background: var(--bg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.pipeline-col-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-top: 4px solid;
  border-bottom: 1px solid var(--border);
  border-radius: var(--radius) var(--radius) 0 0;
}
.pipeline-col-title { font-size: 13px; font-weight: 600; color: var(--text); }
.pipeline-col-count { background: #fff; color: var(--text-lt); border-radius: 10px; font-size: 11px; padding: 2px 8px; font-weight: 600; }
.pipeline-cards { padding: 12px; display: flex; flex-direction: column; gap: 10px; min-height: 60px; }
.deal-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-sm);
}
.deal-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); border-color: var(--teal); }
.deal-card-title { font-size: 14px; font-weight: 600; color: var(--navy); margin-bottom: 6px; }
.deal-card-contact { font-size: 12px; color: var(--text-lt); margin-bottom: 6px; }
.deal-card-value { font-size: 14px; font-weight: 700; color: var(--teal-dk); margin-bottom: 6px; }
.deal-card-close { font-size: 12px; color: var(--text-muted); margin-bottom: 10px; }
.deal-card-actions { display: flex; gap: 6px; }
.deal-card-btn { background: none; border: none; cursor: pointer; font-size: 12px; color: var(--text-lt); padding: 4px 10px; border-radius: var(--radius-sm); transition: all var(--transition-fast); }
.deal-card-btn:hover { background: var(--bg); color: var(--text); }
.deal-card-btn-won { color: var(--success); }
.deal-card-btn-won:hover { background: #f0fdf4; }
.deal-card-btn-lost { color: var(--danger); }
.deal-card-btn-lost:hover { background: #fef2f2; }

/* ── CRM overview ─────────────────────────────────────────── */
.pipeline-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border-lt); }
.pipeline-row:last-child { border-bottom: none; }
.pipeline-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.pipeline-stage-name { flex: 1; font-size: 14px; }
.pipeline-count { font-size: 12px; color: var(--text-lt); font-weight: 500; }
.pipeline-value { font-size: 14px; font-weight: 600; color: var(--text); min-width: 80px; text-align: right; }
.task-item { display: flex; justify-content: space-between; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--border-lt); gap: 12px; }
.task-item:last-child { border-bottom: none; }
.task-info { flex: 1; min-width: 0; }
.task-subject { display: block; font-size: 14px; font-weight: 500; }
.task-contact { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.task-due { font-size: 12px; color: var(--text-lt); white-space: nowrap; }
.task-due.overdue { color: var(--danger); font-weight: 600; }

/* ── Activity feed ────────────────────────────────────────── */
.activity-feed { padding: 0; }
.feed-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-lt);
  transition: background var(--transition-fast);
}
.feed-item:last-child { border-bottom: none; }
.feed-item:hover { background: var(--bg-hover); margin: 0 -24px; padding: 12px 24px; border-radius: var(--radius-sm); }
.feed-type {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; flex-shrink: 0;
  background: var(--bg); color: var(--text-lt);
}
.feed-type-note    { background: #e0f2fe; color: #0369a1; }
.feed-type-call    { background: #dcfce7; color: #15803d; }
.feed-type-email   { background: #ede9fe; color: #6d28d9; }
.feed-type-meeting { background: #fef9c3; color: #a16207; }
.feed-type-task    { background: #fee2e2; color: #b91c1c; }
.feed-type-file    { background: #dbeafe; color: #1d4ed8; }
.feed-body { flex: 1; min-width: 0; }
.feed-subject { font-size: 14px; font-weight: 500; }
.feed-contact { font-size: 12px; color: var(--text-lt); margin-top: 2px; }
.feed-note { font-size: 13px; color: var(--text-lt); margin-top: 4px; line-height: 1.5; }
.feed-time { font-size: 11px; color: var(--text-muted); text-align: right; white-space: nowrap; }
.feed-item-pending { background: var(--warning-lt); }
.completed-label { font-size: 11px; color: var(--success); font-weight: 600; }
.task-due-label { font-size: 11px; color: var(--text-lt); margin-right: 8px; }
.task-due-label.overdue { color: var(--danger); }
.activity-note-preview { font-size: 12px; color: var(--text-muted); }

/* ── Deals ────────────────────────────────────────────────── */
.deal-item { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border-lt); }
.deal-item:last-child { border-bottom: none; }
.deal-stage-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.deal-info { flex: 1; }
.deal-title { font-size: 14px; font-weight: 500; color: var(--text); }
.deal-stage { font-size: 12px; color: var(--text-muted); display: block; margin-top: 2px; }
.deal-value { font-size: 14px; font-weight: 700; color: var(--teal-dk); }

/* ── Contact layout ───────────────────────────────────────── */
.contact-layout { display: grid; grid-template-columns: 1fr; }
.contact-sidebar { }
.contact-main { }

/* Contact header card */
.contact-hero {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 24px;
}
.contact-hero-avatar {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--teal), var(--teal-dk));
  color: #fff;
  font-size: 24px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 16px rgba(0,184,184,0.3);
}

/* ── Invoice totals ───────────────────────────────────────── */
.invoice-totals { max-width: 340px; margin-left: auto; margin-top: 20px; }
.total-row { display: flex; justify-content: space-between; padding: 6px 0; font-size: 14px; }
.total-row span:first-child { color: var(--text-lt); }
.total-row-grand { font-weight: 700; font-size: 17px; padding-top: 12px; margin-top: 8px; border-top: 2px solid var(--teal); }
.total-row-grand span:last-child { color: var(--teal-dk); }
.table-items td { padding: 8px 10px; }

/* ── Builder layout ───────────────────────────────────────── */
.builder-layout { display: grid; grid-template-columns: 1fr 300px; gap: 24px; align-items: start; }
.builder-sidebar .card { position: sticky; top: calc(var(--topbar-h) + 24px); }
.builder-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
#reportContent { font-family: 'Space Mono', monospace; font-size: 13px; line-height: 1.7; }

/* ── Settings ─────────────────────────────────────────────── */
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }

/* ── Clients ──────────────────────────────────────────────── */
.client-name-cell strong { display: block; font-size: 14px; }
.client-name-cell small { color: var(--text-muted); font-size: 12px; }
.toggle-btn {
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid;
  background: none;
  font-family: inherit;
  transition: all var(--transition-fast);
}
.toggle-btn.on  { color: var(--success); border-color: #bbf7d0; background: #f0fdf4; }
.toggle-btn.off { color: var(--text-lt); border-color: var(--border); }
.toggle-btn:hover { transform: scale(1.05); }

/* ── Pagination ───────────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 20px;
  border-top: 1px solid var(--border-lt);
}
.pagination .btn { min-width: 36px; justify-content: center; }
.page-info { font-size: 13px; color: var(--text-lt); margin: 0 8px; }

/* ── Dropdown menus ───────────────────────────────────────── */
.action-menu { position: relative; }
.dropdown-menu {
  display: none;
  position: absolute;
  right: 0; top: 100%;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  min-width: 200px;
  z-index: 20;
  overflow: hidden;
  animation: dropdownIn 0.15s ease;
}
@keyframes dropdownIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}
.dropdown-menu.open { display: block; }
.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  transition: background var(--transition-fast);
}
.dropdown-item:hover { background: var(--bg-hover); }
.dropdown-item svg { width: 16px; height: 16px; stroke: var(--text-lt); fill: none; stroke-width: 2; flex-shrink: 0; }
.dropdown-divider { height: 1px; background: var(--border-lt); margin: 4px 0; }
.dropdown-item-form { width: 100%; text-align: left; background: none; border: none; font-family: inherit; }
.dropdown-item-danger { color: var(--danger); }
.dropdown-item-danger:hover { background: var(--danger-lt); }

/* ── Empty states ─────────────────────────────────────────── */
.empty-state { color: var(--text-muted); font-size: 14px; text-align: center; padding: 16px 0; }
.empty-block {
  padding: 64px 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 15px;
}
.empty-block-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}
.empty-block-icon svg { width: 24px; height: 24px; stroke: var(--text-muted); fill: none; stroke-width: 2; }

/* ── Misc ─────────────────────────────────────────────────── */
.text-danger  { color: var(--danger); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-muted   { color: var(--text-muted); }
.text-teal    { color: var(--teal); }
.row-overdue  { background: var(--warning-lt); }
.ext-link     { font-size: 11px; color: var(--text-muted); }
.payment-info { }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; }
.gap-sm { gap: 8px; }
.gap-md { gap: 16px; }
.gap-lg { gap: 24px; }
.mt-sm { margin-top: 8px; }
.mt-md { margin-top: 16px; }
.mt-lg { margin-top: 24px; }
.mb-sm { margin-bottom: 8px; }
.mb-md { margin-bottom: 16px; }
.mb-lg { margin-bottom: 24px; }

/* ── Finance ──────────────────────────────────────────────── */
.bar-chart { display: flex; flex-direction: column; gap: 12px; }
.bar-row { display: flex; align-items: center; gap: 14px; }
.bar-label { font-size: 13px; color: var(--text-lt); min-width: 110px; text-align: right; white-space: nowrap; }
.bar-track { flex: 1; height: 24px; background: var(--bg); border-radius: var(--radius-sm); overflow: hidden; position: relative; }
.bar-fill { height: 100%; border-radius: var(--radius-sm); transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1); min-width: 3px; }
.bar-fill-revenue { background: linear-gradient(90deg, var(--teal), var(--teal-lt)); }
.bar-fill-expense { background: linear-gradient(90deg, #ef4444, #f87171); }
.bar-fill-blue { background: linear-gradient(90deg, #3b82f6, #60a5fa); }
.bar-amount { font-size: 13px; font-weight: 600; color: var(--text); min-width: 90px; }

.report-table { width: 100%; border-collapse: collapse; }
.report-table th { text-align: left; font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--text-muted); letter-spacing: 0.06em; padding: 10px 14px; border-bottom: 2px solid var(--border); }
.report-table td { padding: 8px 14px; font-size: 14px; border-bottom: 1px solid var(--border-lt); }
.report-table .indent { padding-left: 36px; }
.report-table .total-row td { font-weight: 700; border-top: 2px solid var(--border); border-bottom: 2px solid var(--border); background: var(--bg); }
.report-table .grand-total td { font-weight: 700; font-size: 16px; border-top: 3px solid var(--teal); background: #f0fdfd; }
.report-table .amount { text-align: right; font-family: 'Space Mono', monospace; font-size: 13px; }
.report-table .section-header td { font-weight: 700; font-size: 14px; color: var(--text); background: var(--bg); padding: 12px 14px; text-transform: uppercase; letter-spacing: 0.04em; }

.color-swatch { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: middle; margin-right: 8px; }

.txn-list { list-style: none; }
.txn-item { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--border-lt); }
.txn-item:last-child { border-bottom: none; }
.txn-icon { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 16px; flex-shrink: 0; }
.txn-icon-in { background: #dcfce7; color: #15803d; }
.txn-icon-out { background: #fee2e2; color: #b91c1c; }
.txn-info { flex: 1; min-width: 0; }
.txn-desc { font-size: 14px; font-weight: 500; display: block; }
.txn-meta { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.txn-amount { font-size: 14px; font-weight: 700; white-space: nowrap; }
.txn-amount-in { color: var(--success); }
.txn-amount-out { color: var(--danger); }

.table-actions { white-space: nowrap; }
.table-actions form { display: inline; }

/* ── Proposal Builder ─────────────────────────────────────── */
.proposal-section { margin-bottom: 32px; }
.proposal-section .section-title { font-size: 13px; font-weight: 600; color: var(--teal); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 10px; }
.proposal-section .section-body { font-size: 15px; line-height: 1.7; color: var(--text-lt); white-space: pre-wrap; }

/* ── Tag Badges ──────────────────────────────────────────── */
.tag-badge { display: inline-block; padding: 3px 12px; border-radius: 999px; font-size: 11px; font-weight: 600; margin: 2px 4px 2px 0; transition: all var(--transition-fast); }
.tag-badge:hover { transform: scale(1.05); }

/* ── Autocomplete ────────────────────────────────────────── */
.autocomplete-dropdown {
  position: absolute; top: 100%; left: 0; right: 0; z-index: 50;
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); max-height: 280px; overflow-y: auto;
  animation: dropdownIn 0.15s ease;
}

/* ── Progress Bars ────────────────────────────────────────── */
.progress-bar-sm { height: 6px; background: var(--border-lt); border-radius: 3px; overflow: hidden; width: 80px; display: inline-block; vertical-align: middle; }
.progress-bar-md { height: 8px; background: var(--border-lt); border-radius: 4px; overflow: hidden; }
.progress-bar-lg { height: 10px; background: var(--border-lt); border-radius: 5px; overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--teal), var(--teal-lt)); border-radius: inherit; transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1); }
.progress-fill-danger { background: linear-gradient(90deg, var(--danger), #f87171); }
.progress-fill-success { background: linear-gradient(90deg, var(--success), #4ade80); }
.progress-fill-warning { background: linear-gradient(90deg, var(--warning), #fbbf24); }
.progress-label { font-size: 12px; font-weight: 600; color: var(--text-lt); margin-top: 4px; }

/* ── Milestone Timeline ──────────────────────────────────── */
.milestone-timeline { padding: 16px 24px; }
.milestone-item {
  display: flex;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border-lt);
  position: relative;
}
.milestone-item:last-child { border-bottom: none; }
.milestone-marker {
  width: 14px; height: 14px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: #fff;
  margin-top: 4px;
  flex-shrink: 0;
  transition: all var(--transition-fast);
}
.milestone-item.completed .milestone-marker { background: var(--teal); border-color: var(--teal); box-shadow: 0 0 0 4px var(--teal-glow); }
.milestone-item.in-progress .milestone-marker { border-color: var(--teal); animation: pulse 2s infinite; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 var(--teal-glow); } 50% { box-shadow: 0 0 0 6px rgba(0,184,184,0); } }
.milestone-content { flex: 1; }
.milestone-header { display: flex; align-items: center; gap: 8px; }

/* ── Milestone Checklist (client portal) ─────────────────── */
.milestone-check { display: flex; align-items: center; gap: 10px; padding: 8px 0; font-size: 14px; }
.milestone-check.done { opacity: 0.5; }
.milestone-check.done .milestone-check-text { text-decoration: line-through; }
.milestone-check-icon { width: 20px; text-align: center; font-size: 16px; color: var(--teal); }
.milestone-check-text { flex: 1; }
.milestone-check-date { font-size: 12px; color: var(--text-muted); }

/* ── Project Grid (client portal) ────────────────────────── */
.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 24px; }
.project-card { transition: all var(--transition); }
.project-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

/* ── Messaging Layout ────────────────────────────────────── */
.messaging-layout {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  min-height: 560px;
  background: #fff;
  box-shadow: var(--shadow-md);
}
.thread-list-panel { border-right: 1px solid var(--border); overflow-y: auto; max-height: 640px; }
.thread-list-header { padding: 16px; border-bottom: 1px solid var(--border); display: flex; gap: 8px; }
.thread-item {
  display: block;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-lt);
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  transition: all var(--transition-fast);
}
.thread-item:hover { background: var(--bg-hover); }
.thread-item.active { background: rgba(0,184,184,0.06); border-left: 3px solid var(--teal); }
.thread-item-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.thread-item-subject { font-size: 14px; font-weight: 500; margin-bottom: 4px; }
.thread-item-preview { font-size: 13px; color: var(--text-lt); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thread-item-time { font-size: 11px; color: var(--text-muted); margin-top: 6px; }
.thread-unread { background: var(--teal); color: #fff; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.conversation-panel { display: flex; flex-direction: column; max-height: 640px; }
.conversation-header { padding: 16px 24px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.conversation-header h3 { margin: 0; font-size: 16px; }
.message-list { flex: 1; overflow-y: auto; padding: 24px; }
.message-bubble { margin-bottom: 20px; max-width: 80%; }
.message-bubble.staff { margin-left: auto; }
.message-bubble.client { margin-right: auto; }
.message-sender { font-size: 12px; font-weight: 600; color: var(--text-lt); margin-bottom: 6px; }
.message-body {
  background: var(--bg);
  padding: 14px 18px;
  border-radius: 16px 16px 16px 4px;
  font-size: 14px;
  line-height: 1.6;
}
.message-bubble.staff .message-body {
  background: rgba(0,184,184,0.08);
  border-radius: 16px 16px 4px 16px;
}
.message-time { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.reply-form { padding: 20px 24px; border-top: 1px solid var(--border); background: var(--bg); }

/* ── Skeleton Loading ────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, var(--border-lt) 25%, var(--bg) 50%, var(--border-lt) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.skeleton-text { height: 14px; margin-bottom: 8px; }
.skeleton-text-sm { height: 10px; width: 60%; }
.skeleton-circle { border-radius: 50%; }

/* ── Tooltip ─────────────────────────────────────────────── */
[data-tooltip] { position: relative; }
[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  padding: 6px 12px;
  background: var(--navy);
  color: #fff;
  font-size: 12px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--transition-fast);
  z-index: 100;
}
[data-tooltip]:hover::after { opacity: 1; }

/* ── Status Indicators ───────────────────────────────────── */
.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
}
.status-dot-active { background: var(--success); box-shadow: 0 0 0 3px rgba(22,163,74,0.2); }
.status-dot-inactive { background: var(--text-muted); }
.status-dot-pending { background: var(--warning); box-shadow: 0 0 0 3px rgba(217,119,6,0.2); }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 1280px) {
  .stat-grid-5 { grid-template-columns: repeat(3, 1fr); }
  .dash-grid-3 { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 1024px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .stat-grid-5 { grid-template-columns: repeat(2, 1fr); }
  .report-grid { grid-template-columns: repeat(2, 1fr); }
  .builder-layout { grid-template-columns: 1fr; }
  .builder-sidebar .card { position: static; }
  .settings-grid { grid-template-columns: 1fr; }
  .topbar-search { flex: 0 1 260px; }
}

@media (max-width: 768px) {
  :root { --sidebar-w: 0px; }
  .sidebar { transform: translateX(-260px); width: 260px; }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay.open { display: block; }
  .main-wrapper { margin-left: 0; }
  .sidebar-toggle { display: flex; }
  .main-content { padding: 20px 16px; }
  .dash-grid { grid-template-columns: 1fr; }
  .dash-grid-3 { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .report-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .form-row-3 { grid-template-columns: 1fr; }
  .pipeline-board { padding-bottom: 16px; }
  .page-header { flex-direction: column; align-items: flex-start; }
  .topbar { padding: 0 16px; }
  .topbar-search { display: none; }
  .messaging-layout { grid-template-columns: 1fr; }
  .thread-list-panel { max-height: 300px; border-right: none; border-bottom: 1px solid var(--border); }
}

@media (max-width: 480px) {
  .stat-grid { grid-template-columns: 1fr; }
  .auth-card { padding: 28px 20px; }
  .project-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   Toast Notification System
   ============================================================ */
.toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 9999;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  padding-right: 44px;
  min-width: 320px;
  max-width: 480px;
  border-radius: var(--radius-lg);
  background: #fff;
  box-shadow: 0 12px 40px rgba(0,0,0,0.12), 0 4px 12px rgba(0,0,0,0.08);
  border-left: 4px solid var(--teal);
  position: relative;
  overflow: hidden;
  animation: toastSlideIn 0.4s cubic-bezier(0.21, 1.02, 0.73, 1) forwards;
}
.toast-exit {
  animation: toastSlideOut 0.3s cubic-bezier(0.4, 0, 1, 1) forwards;
}
@keyframes toastSlideIn {
  from { opacity: 0; transform: translateX(100%) translateY(-8px); }
  to   { opacity: 1; transform: translateX(0) translateY(0); }
}
@keyframes toastSlideOut {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(100%); }
}
.toast-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.toast-msg {
  flex: 1;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.4;
}
.toast-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 18px;
  color: var(--text-muted);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  line-height: 1;
}
.toast-close:hover {
  color: var(--text);
  background: var(--bg);
}
.toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(0,0,0,0.04);
}
.toast-progress-bar {
  height: 100%;
  border-radius: 0 3px 3px 0;
  animation: toastCountdown 5s linear forwards;
}
@keyframes toastCountdown {
  from { width: 100%; }
  to   { width: 0%; }
}

/* Toast type variants */
.toast-success { border-left-color: var(--success); }
.toast-success .toast-icon { background: var(--success-lt); color: var(--success); }
.toast-success .toast-progress-bar { background: var(--success); }

.toast-error { border-left-color: var(--danger); }
.toast-error .toast-icon { background: var(--danger-lt); color: var(--danger); }
.toast-error .toast-progress-bar { background: var(--danger); }

.toast-warning { border-left-color: var(--warning); }
.toast-warning .toast-icon { background: var(--warning-lt); color: var(--warning); }
.toast-warning .toast-progress-bar { background: var(--warning); }

.toast-info { border-left-color: var(--blue); }
.toast-info .toast-icon { background: var(--blue-lt); color: var(--blue); }
.toast-info .toast-progress-bar { background: var(--blue); }

/* ============================================================
   Micro-Interactions & Premium Polish
   ============================================================ */

/* ── a) Card hover lift ──────────────────────────────────── */
.card {
  transition: box-shadow var(--transition), transform var(--transition);
}
.card:hover {
  transform: translateY(-2px);
}

/* ── b) Stat card entrance animation ─────────────────────── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
.stat-card {
  animation: fadeInUp 0.5s cubic-bezier(0.22, 1, 0.36, 1) backwards;
}
.stat-card:nth-child(1) { animation-delay: 0.05s; }
.stat-card:nth-child(2) { animation-delay: 0.1s; }
.stat-card:nth-child(3) { animation-delay: 0.15s; }
.stat-card:nth-child(4) { animation-delay: 0.2s; }
.stat-card:nth-child(5) { animation-delay: 0.25s; }

.stat-value {
  animation: fadeInUp 0.6s cubic-bezier(0.22, 1, 0.36, 1) 0.2s backwards;
}

/* ── c) Table row hover ──────────────────────────────────── */
.table tbody tr {
  transition: background var(--transition), box-shadow var(--transition-fast);
}
.table tbody tr:hover {
  background: var(--bg-hover);
  box-shadow: inset 3px 0 0 var(--teal);
}

/* ── d) Button press effect ──────────────────────────────── */
.btn {
  transition: all var(--transition-fast), transform 0.1s ease;
}
.btn:active {
  transform: scale(0.97) !important;
}

/* ── e) Modal transition polish ──────────────────────────── */
.modal {
  visibility: hidden;
  opacity: 0;
  transition: visibility 0s 0.3s, opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.modal.open {
  visibility: visible;
  opacity: 1;
  transition: visibility 0s 0s, opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.modal-box,
.modal-container {
  transform: translateY(20px) scale(0.97);
  opacity: 0;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.3s ease;
}
.modal.open .modal-box,
.modal.open .modal-container {
  transform: translateY(0) scale(1);
  opacity: 1;
}

/* ── f) Nav badge pulse ──────────────────────────────────── */
@keyframes badgePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(0,184,184,0.4); }
  50%      { box-shadow: 0 0 0 5px rgba(0,184,184,0); }
}
.nav-badge {
  animation: badgePulse 2.5s ease-in-out infinite;
}
@keyframes notificationPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(220,38,38,0.4); }
  50%      { box-shadow: 0 0 0 4px rgba(220,38,38,0); }
}
.notification-dot {
  animation: notificationPulse 2s ease-in-out infinite;
}

/* ── g) Skeleton loading shimmer (enhance existing) ──────── */
.skeleton {
  position: relative;
  overflow: hidden;
  color: transparent !important;
}
.skeleton * { visibility: hidden; }
.skeleton::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.6), transparent);
  animation: skeletonSweep 1.8s ease-in-out infinite;
}
@keyframes skeletonSweep {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* ── h) Page content entrance ────────────────────────────── */
@keyframes contentFadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.main-content {
  animation: contentFadeIn 0.4s cubic-bezier(0.22, 1, 0.36, 1) backwards;
  animation-delay: 0.05s;
}

/* ── i) Scrollbar on-hover reveal ────────────────────────── */
::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.06);
  transition: background 0.2s;
}
*:hover > ::-webkit-scrollbar-thumb,
:hover::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.15);
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(0,0,0,0.25) !important;
}

/* ── j) Link underline hover animation ───────────────────── */
.main-content a:not(.btn):not(.nav-item):not(.badge):not(.card):not(.deal-card):not(.thread-item):not(.search-result-item) {
  position: relative;
  text-decoration: none;
}
.main-content a:not(.btn):not(.nav-item):not(.badge):not(.card):not(.deal-card):not(.thread-item):not(.search-result-item)::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 0;
  height: 1.5px;
  background: currentColor;
  transition: width 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}
.main-content a:not(.btn):not(.nav-item):not(.badge):not(.card):not(.deal-card):not(.thread-item):not(.search-result-item):hover::after {
  width: 100%;
}

/* ── k) Branded loading spinner ──────────────────────────── */
@keyframes spinnerRotate {
  to { transform: rotate(360deg); }
}
@keyframes spinnerPulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.4; }
}
.loading-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(0,184,184,0.15);
  border-top-color: var(--teal);
  border-radius: 50%;
  animation: spinnerRotate 0.8s linear infinite, spinnerPulse 1.6s ease-in-out infinite;
  display: inline-block;
}
.loading-spinner-sm {
  width: 20px;
  height: 20px;
  border-width: 2px;
}
.loading-spinner-lg {
  width: 48px;
  height: 48px;
  border-width: 4px;
}

/* ── Reduced motion preference ───────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
