/* ══════════════════════════════════════════════════════════════════
   SALES DASHBOARD — styles.css
   1.  CSS Variables & Reset
   2.  Typography
   3.  Screens (Login / Loading / Access Denied)
   4.  App Layout (Header, Sidebar, Main)
   5.  KPI Cards
   6.  Charts Section
   7.  Pairs vs Target Section
   8.  Data Table
   9.  Sidebar Filters
   10. Utility / Shared Components
   11. Animations
   12. Responsive / Mobile
══════════════════════════════════════════════════════════════════ */

/* ── 1. CSS VARIABLES & RESET ─────────────────────────────────── */

:root {
  /* Backgrounds */
  --bg-base:       #060b18;
  --bg-surface:    #0d1629;
  --bg-card:       #111d35;
  --bg-card-hover: #162040;
  --bg-input:      #0d1629;
  --bg-sidebar:    #080f1f;

  /* Borders */
  --border:        rgba(99,102,241,0.18);
  --border-subtle: rgba(255,255,255,0.06);

  /* Brand */
  --primary:       #6366f1;
  --primary-light: #818cf8;
  --primary-dark:  #4f46e5;
  --accent:        #8b5cf6;

  /* Semantic */
  --success:       #10b981;
  --warning:       #f59e0b;
  --danger:        #ef4444;
  --info:          #3b82f6;

  /* Text */
  --text:          #e2e8f0;
  --text-muted:    #94a3b8;
  --text-dim:      #64748b;

  /* Layout */
  --sidebar-w:     272px;
  --header-h:      60px;
  --radius:        14px;
  --radius-sm:     8px;
  --radius-xs:     5px;
  --shadow:        0 4px 28px rgba(0,0,0,0.45);
  --shadow-glow:   0 0 24px rgba(99,102,241,0.18);
  --transition:    0.2s ease;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg-base);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  overflow: hidden;
  height: 100vh;
}

/* ── 2. TYPOGRAPHY ────────────────────────────────────────────── */

h1 { font-size: 2rem;   font-weight: 800; line-height: 1.2; }
h2 { font-size: 1.15rem; font-weight: 700; }
h3 { font-size: 0.95rem; font-weight: 600; }

strong { font-weight: 600; }

/* ── 3. SCREENS ───────────────────────────────────────────────── */

.screen {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
  background: var(--bg-base);
}

.hidden { display: none !important; }

/* Login */
.login-bg {
  position: absolute; inset: 0; overflow: hidden; pointer-events: none;
}
.login-orb {
  position: absolute; border-radius: 50%;
  filter: blur(80px); opacity: 0.18;
  animation: orbFloat 8s ease-in-out infinite;
}
.orb-1 { width: 500px; height: 500px; background: #6366f1; top: -150px; left: -100px; animation-delay: 0s; }
.orb-2 { width: 400px; height: 400px; background: #8b5cf6; bottom: -100px; right: -100px; animation-delay: 3s; }
.orb-3 { width: 300px; height: 300px; background: #3b82f6; top: 40%; left: 50%; animation-delay: 6s; }

@keyframes orbFloat {
  0%, 100% { transform: translateY(0) scale(1); }
  50%       { transform: translateY(-30px) scale(1.05); }
}

.login-card {
  position: relative; z-index: 1;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 52px 48px;
  width: 420px;
  text-align: center;
  box-shadow: var(--shadow), var(--shadow-glow);
  animation: cardIn 0.6s cubic-bezier(0.16,1,0.3,1);
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(24px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0)    scale(1);    }
}

.login-logo {
  display: inline-flex; align-items: center; justify-content: center;
  margin-bottom: 24px;
}

.login-title {
  font-size: 1.8rem; font-weight: 800;
  background: linear-gradient(135deg, #e2e8f0 0%, #818cf8 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  margin-bottom: 10px;
}
.login-subtitle { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 32px; }

.btn-google {
  display: inline-flex; align-items: center; gap: 12px;
  background: white; color: #1e293b;
  border: none; border-radius: 10px;
  padding: 13px 28px; font-size: 0.95rem; font-weight: 600;
  cursor: pointer; width: 100%; justify-content: center;
  transition: transform var(--transition), box-shadow var(--transition);
  box-shadow: 0 2px 12px rgba(0,0,0,0.3);
}
.btn-google:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(0,0,0,0.35); }
.btn-google:active { transform: translateY(0); }

.login-note { margin-top: 16px; color: var(--text-dim); font-size: 0.8rem; }

/* Loading */
.loading-card {
  text-align: center;
  animation: cardIn 0.5s ease;
}
.loading-spinner {
  width: 52px; height: 52px;
  border: 3px solid var(--bg-card);
  border-top-color: var(--primary);
  border-radius: 50%;
  margin: 0 auto 24px;
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

#loading-title { font-weight: 700; margin-bottom: 8px; }
.loading-detail { color: var(--text-muted); font-size: 0.85rem; min-height: 1.2em; margin-bottom: 24px; }
.progress-track {
  width: 320px; height: 5px; background: var(--bg-card);
  border-radius: 10px; overflow: hidden; margin: 0 auto 8px;
}
.progress-fill {
  height: 100%; background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 10px; transition: width 0.4s ease;
}
.progress-label { color: var(--text-dim); font-size: 0.8rem; }

/* Access Denied */
.denied-card { text-align: center; max-width: 420px; }
.denied-icon { font-size: 3.5rem; margin-bottom: 16px; }
.denied-card h2 { font-size: 1.5rem; margin-bottom: 12px; }
.denied-card p { color: var(--text-muted); margin-bottom: 8px; }
.denied-hint { font-size: 0.85rem; color: var(--text-dim); margin-bottom: 28px; }

.btn-outline {
  display: inline-flex; align-items: center; gap: 8px;
  background: transparent; color: var(--primary);
  border: 1px solid var(--primary); border-radius: var(--radius-sm);
  padding: 10px 22px; font-size: 0.9rem; font-weight: 500;
  cursor: pointer; transition: background var(--transition), color var(--transition);
}
.btn-outline:hover { background: var(--primary); color: white; }

/* ── 4. APP LAYOUT ────────────────────────────────────────────── */

#app {
  display: flex; flex-direction: column;
  height: 100vh; overflow: hidden;
}

/* HEADER */
#header {
  height: var(--header-h);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px; gap: 16px;
  flex-shrink: 0; z-index: 100;
  backdrop-filter: blur(12px);
}

.header-left  { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.header-right { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }

.icon-btn {
  display: flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: var(--radius-xs);
  background: transparent; color: var(--text-muted);
  border: none; cursor: pointer;
  transition: background var(--transition), color var(--transition);
}
.icon-btn:hover { background: var(--bg-card); color: var(--text); }

.brand { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.brand-name { font-weight: 700; font-size: 1rem; color: var(--text); }

.filter-chips { display: flex; gap: 6px; flex-wrap: wrap; overflow: hidden; max-height: 28px; }
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  background: rgba(99,102,241,0.15); color: var(--primary-light);
  border: 1px solid rgba(99,102,241,0.3);
  border-radius: 20px; padding: 2px 10px; font-size: 0.75rem; font-weight: 500;
}
.chip button { background: none; border: none; cursor: pointer; color: inherit; font-size: 0.8rem; padding: 0; line-height: 1; }

/* Sync Status Pill */
.sync-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  padding: 4px 10px;
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
  user-select: none;
  transition: border-color var(--transition), background var(--transition);
}
.sync-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
  transition: background-color var(--transition);
}
.sync-dot.synced {
  background-color: #10b981;
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.4);
}
.sync-dot.syncing {
  background-color: #6366f1;
  box-shadow: 0 0 6px rgba(99, 102, 241, 0.5);
  animation: pulseDot 1.2s ease-in-out infinite;
}
.sync-dot.stale, .sync-dot.error {
  background-color: #f59e0b;
}

@keyframes pulseDot {
  0%, 100% { transform: scale(1); opacity: 0.8; }
  50% { transform: scale(1.35); opacity: 1; }
}

.last-updated { color: var(--text-dim); font-size: 0.75rem; white-space: nowrap; }

.btn-outline-sm {
  display: flex; align-items: center; gap: 6px;
  background: transparent; color: var(--text-muted);
  border: 1px solid var(--border-subtle); border-radius: var(--radius-xs);
  padding: 6px 12px; font-size: 0.8rem; font-weight: 500; cursor: pointer;
  transition: all var(--transition);
}
.btn-outline-sm:hover { border-color: var(--primary); color: var(--primary); }

.user-pill {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg-card); border: 1px solid var(--border-subtle);
  border-radius: 30px; padding: 5px 14px;
}
#user-name { font-size: 0.8rem; font-weight: 500; color: var(--text-muted); }

.btn-ghost-sm {
  background: none; border: none; cursor: pointer;
  color: var(--text-dim); font-size: 0.75rem;
  transition: color var(--transition);
}
.btn-ghost-sm:hover { color: var(--danger); }

/* APP BODY */
.app-body {
  display: flex; flex: 1; overflow: hidden;
}

/* SIDEBAR */
#sidebar {
  width: var(--sidebar-w); flex-shrink: 0;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-subtle);
  overflow-y: auto; overflow-x: hidden;
  transition: width 0.3s cubic-bezier(0.4,0,0.2,1),
              transform 0.3s cubic-bezier(0.4,0,0.2,1);
  scrollbar-width: thin; scrollbar-color: var(--bg-card) transparent;
}
#sidebar.collapsed { width: 0; overflow: hidden; }
#sidebar::-webkit-scrollbar { width: 4px; }
#sidebar::-webkit-scrollbar-thumb { background: var(--bg-card); border-radius: 10px; }

.sidebar-inner { padding: 16px 14px 24px; width: var(--sidebar-w); min-width: var(--sidebar-w); }

/* MAIN CONTENT */
#main-content {
  flex: 1; overflow-y: auto; overflow-x: hidden;
  padding: 20px; display: flex; flex-direction: column; gap: 20px;
  scrollbar-width: thin; scrollbar-color: var(--bg-card) transparent;
}
#main-content::-webkit-scrollbar { width: 5px; }
#main-content::-webkit-scrollbar-thumb { background: var(--bg-card); border-radius: 10px; }

/* ── 5. KPI CARDS ─────────────────────────────────────────────── */

.kpi-section { display: flex; flex-direction: column; gap: 10px; }

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 18px 20px;
  display: flex; align-items: flex-start; gap: 14px;
  position: relative; overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  cursor: default;
}
.kpi-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  border-radius: var(--radius) var(--radius) 0 0;
}
.kpi-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--border); }

.kpi-revenue::before  { background: linear-gradient(90deg, var(--primary), var(--accent)); }
.kpi-pairs::before    { background: linear-gradient(90deg, var(--info), #06b6d4); }
.kpi-deals::before    { background: linear-gradient(90deg, var(--success), #34d399); }
.kpi-avg::before      { background: linear-gradient(90deg, #ec4899, #f43f5e); }
.kpi-ongoing::before  { background: linear-gradient(90deg, var(--warning), #fb923c); }
.kpi-delayed::before  { background: linear-gradient(90deg, var(--danger), #f97316); }

.kpi-icon {
  font-size: 1.4rem; min-width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.04); border-radius: var(--radius-sm);
  flex-shrink: 0;
}
.kpi-body { flex: 1; min-width: 0; }
.kpi-label { font-size: 0.72rem; font-weight: 500; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 4px; }
.kpi-value { font-size: 1.35rem; font-weight: 800; color: var(--text); line-height: 1.1; }
.kpi-sub   { font-size: 0.75rem; color: var(--text-muted); margin-top: 4px; }

.cancelled-notice {
  background: rgba(239,68,68,0.08); border: 1px solid rgba(239,68,68,0.2);
  border-radius: var(--radius-sm); padding: 8px 16px;
  color: #fca5a5; font-size: 0.82rem; text-align: center;
}

/* ── 6. CHARTS SECTION ────────────────────────────────────────── */

.charts-section {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.chart-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 20px;
  transition: border-color var(--transition);
}
.chart-card:hover { border-color: var(--border); }

.chart-full { grid-column: 1 / -1; }
.chart-half { grid-column: span 1; }

.chart-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px; gap: 12px;
}
.chart-header h3 { color: var(--text); font-size: 0.9rem; }

.chart-body { position: relative; }

.chart-toggle { display: flex; gap: 4px; }
.chart-toggle button {
  background: transparent; color: var(--text-dim);
  border: 1px solid var(--border-subtle); border-radius: var(--radius-xs);
  padding: 4px 10px; font-size: 0.75rem; cursor: pointer;
  transition: all var(--transition);
}
.chart-toggle button.active,
.chart-toggle button:hover { background: var(--primary); color: white; border-color: var(--primary); }

.chart-badge {
  background: rgba(99,102,241,0.12); color: var(--primary-light);
  border-radius: 20px; padding: 2px 10px; font-size: 0.72rem; font-weight: 500;
}

/* ── 7. PAIRS vs TARGET ───────────────────────────────────────── */

.target-section {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 20px;
}

.section-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; margin-bottom: 18px; flex-wrap: wrap;
}
.section-header h2 { color: var(--text); }

.target-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.target-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  transition: border-color var(--transition);
}
.target-card:hover { border-color: var(--border); }

.target-card-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 10px; gap: 8px;
}
.target-client-name { font-size: 0.82rem; font-weight: 600; color: var(--text); line-height: 1.3; }
.target-pct { font-size: 0.8rem; font-weight: 700; }
.target-pct.over  { color: var(--success); }
.target-pct.near  { color: var(--warning); }
.target-pct.below { color: var(--text-dim); }

.target-bar-track {
  height: 6px; background: var(--bg-card);
  border-radius: 10px; overflow: hidden; margin-bottom: 8px;
}
.target-bar-fill {
  height: 100%; border-radius: 10px;
  transition: width 0.8s cubic-bezier(0.4,0,0.2,1);
}
.target-bar-fill.over  { background: linear-gradient(90deg, var(--success), #34d399); }
.target-bar-fill.near  { background: linear-gradient(90deg, var(--warning), #fb923c); }
.target-bar-fill.below { background: linear-gradient(90deg, var(--primary), var(--accent)); }

.target-numbers { display: flex; justify-content: space-between; }
.target-numbers span { font-size: 0.75rem; color: var(--text-dim); }
.target-numbers .tn-actual { color: var(--text-muted); font-weight: 500; }

.empty-state {
  color: var(--text-dim); text-align: center; padding: 48px 0; font-size: 0.9rem;
  grid-column: 1 / -1;
}

/* ── 8. DATA TABLE ────────────────────────────────────────────── */

.table-section {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 20px;
}

.table-controls { display: flex; align-items: center; gap: 12px; }
.table-count { color: var(--text-dim); font-size: 0.8rem; white-space: nowrap; }

.table-wrapper {
  overflow-x: auto; overflow-y: auto; max-height: 520px;
  border-radius: var(--radius-sm);
  scrollbar-width: thin; scrollbar-color: var(--bg-surface) transparent;
}
.table-wrapper::-webkit-scrollbar { height: 5px; width: 5px; }
.table-wrapper::-webkit-scrollbar-thumb { background: var(--bg-surface); border-radius: 10px; }

#orders-table {
  width: 100%; border-collapse: collapse; font-size: 0.82rem; min-width: 960px;
}

#orders-table thead {
  position: sticky; top: 0; z-index: 2;
  background: var(--bg-surface);
}

#orders-table th {
  padding: 10px 14px; text-align: left;
  color: var(--text-dim); font-size: 0.72rem;
  font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em;
  cursor: pointer; white-space: nowrap; user-select: none;
  border-bottom: 1px solid var(--border-subtle);
  transition: color var(--transition);
}
#orders-table th:hover { color: var(--text); }
#orders-table th.sorted { color: var(--primary-light); }

.sort-icon { opacity: 0.4; font-size: 0.7rem; }
th.sorted .sort-icon { opacity: 1; color: var(--primary-light); }

#orders-table td {
  padding: 9px 14px; color: var(--text-muted);
  border-bottom: 1px solid rgba(255,255,255,0.03);
  white-space: nowrap;
}
#orders-table tbody tr:hover td { background: rgba(99,102,241,0.04); color: var(--text); }
#orders-table tbody tr:last-child td { border-bottom: none; }

.table-empty { text-align: center; color: var(--text-dim); padding: 40px; }

/* Status badges */
.status-badge {
  display: inline-block;
  padding: 2px 9px; border-radius: 20px;
  font-size: 0.72rem; font-weight: 600;
}
.status-dispatched { background: rgba(16,185,129,0.12); color: #34d399; }
.status-in-stock   { background: rgba(59,130,246,0.12); color: #60a5fa; }
.status-in-progress{ background: rgba(245,158,11,0.12); color: #fbbf24; }
.status-cancelled  { background: rgba(239,68,68,0.12);  color: #f87171; }

/* Pagination */
.pagination {
  display: flex; align-items: center; justify-content: center;
  gap: 4px; margin-top: 16px; flex-wrap: wrap;
}
.page-btn {
  min-width: 32px; height: 32px; padding: 0 8px;
  background: var(--bg-surface); color: var(--text-muted);
  border: 1px solid var(--border-subtle); border-radius: var(--radius-xs);
  font-size: 0.8rem; cursor: pointer;
  transition: all var(--transition);
}
.page-btn:hover, .page-btn.active {
  background: var(--primary); color: white; border-color: var(--primary);
}
.page-btn:disabled { opacity: 0.35; pointer-events: none; }

/* ── 9. SIDEBAR FILTERS ───────────────────────────────────────── */

.filter-section { margin-bottom: 20px; }
.filter-section-label {
  font-size: 0.68rem; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--text-dim); margin-bottom: 8px;
}

.year-tabs { display: flex; flex-wrap: wrap; gap: 5px; }
.year-tab {
  background: var(--bg-card); color: var(--text-muted);
  border: 1px solid var(--border-subtle); border-radius: 20px;
  padding: 3px 11px; font-size: 0.78rem; cursor: pointer;
  transition: all var(--transition);
}
.year-tab:hover  { border-color: var(--primary); color: var(--primary-light); }
.year-tab.active { background: var(--primary); color: white; border-color: var(--primary); }

.quarter-btns { display: flex; gap: 5px; }
.q-btn {
  flex: 1; background: var(--bg-card); color: var(--text-muted);
  border: 1px solid var(--border-subtle); border-radius: var(--radius-xs);
  padding: 5px 0; font-size: 0.78rem; cursor: pointer;
  transition: all var(--transition); font-weight: 500;
}
.q-btn:hover  { border-color: var(--primary); color: var(--primary-light); }
.q-btn.active { background: var(--primary); color: white; border-color: var(--primary); }

.date-range-inputs { display: flex; align-items: center; gap: 6px; }
.date-input {
  flex: 1; background: var(--bg-input); color: var(--text);
  border: 1px solid var(--border-subtle); border-radius: var(--radius-xs);
  padding: 5px 8px; font-size: 0.75rem; width: 100%;
  transition: border-color var(--transition);
  color-scheme: dark;
}
.date-input:focus { outline: none; border-color: var(--primary); }
.date-sep { color: var(--text-dim); font-size: 0.75rem; }

.checkbox-list { display: flex; flex-direction: column; gap: 6px; }
.checkbox-list.scrollable { max-height: 180px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--bg-card) transparent; }
.checkbox-list.scrollable::-webkit-scrollbar { width: 3px; }
.checkbox-list.scrollable::-webkit-scrollbar-thumb { background: var(--bg-card); }

.checkbox-item {
  display: flex; align-items: center; gap: 8px;
  cursor: pointer; padding: 3px 2px;
  border-radius: var(--radius-xs);
  transition: background var(--transition);
}
.checkbox-item:hover { background: rgba(255,255,255,0.03); }
.checkbox-item input[type="checkbox"] { accent-color: var(--primary); width: 14px; height: 14px; cursor: pointer; flex-shrink: 0; }
.checkbox-item label { font-size: 0.82rem; color: var(--text-muted); cursor: pointer; flex: 1; }
.checkbox-count { font-size: 0.7rem; color: var(--text-dim); }

.search-input {
  width: 100%; background: var(--bg-input); color: var(--text);
  border: 1px solid var(--border-subtle); border-radius: var(--radius-xs);
  padding: 7px 10px; font-size: 0.8rem; margin-bottom: 8px;
  transition: border-color var(--transition);
}
.search-input:focus { outline: none; border-color: var(--primary); }
.search-input::placeholder { color: var(--text-dim); }

.btn-clear-filters {
  width: 100%; background: rgba(239,68,68,0.08); color: #f87171;
  border: 1px solid rgba(239,68,68,0.2); border-radius: var(--radius-sm);
  padding: 8px; font-size: 0.8rem; font-weight: 500; cursor: pointer;
  margin-top: 4px; transition: all var(--transition);
}
.btn-clear-filters:hover { background: rgba(239,68,68,0.15); }

/* ── 10. UTILITY ──────────────────────────────────────────────── */

.badge-material {
  display: inline-block; padding: 2px 8px; border-radius: 20px;
  font-size: 0.7rem; font-weight: 600; letter-spacing: 0.03em;
}

/* ── 11. TOAST NOTIFICATIONS ──────────────────────────────────── */

#toast-container {
  position: fixed; bottom: 24px; right: 24px;
  z-index: 9999; display: flex; flex-direction: column; gap: 8px;
  pointer-events: none;
}
.toast {
  background: var(--bg-card); color: var(--text);
  border: 1px solid var(--border-subtle); border-radius: var(--radius-sm);
  padding: 12px 18px; font-size: 0.85rem; max-width: 340px;
  box-shadow: var(--shadow); pointer-events: auto;
  animation: toastIn 0.35s cubic-bezier(0.16,1,0.3,1);
}
.toast.toast-error  { border-color: rgba(239,68,68,0.4); color: #fca5a5; }
.toast.toast-success{ border-color: rgba(16,185,129,0.4); color: #6ee7b7; }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ── 12. INACTIVE CLIENTS ─────────────────────────────────────── */

/* Greyed-out target card */
.target-card.inactive {
  opacity: 0.5;
  border-color: var(--border-subtle);
  background: var(--bg-card);
  pointer-events: none;
}
.target-card.inactive .target-client-name { color: var(--text-dim); }
.target-bar-fill.inactive { background: var(--text-dim) !important; }

/* Inactive / No-Sheet badges on the target card */
.inactive-badge {
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 9px;
  border-radius: 20px;
  background: rgba(100,116,139,0.12);
  color: var(--text-dim);
  border: 1px solid rgba(100,116,139,0.28);
  white-space: nowrap;
}
.inactive-badge.no-sheet {
  background: rgba(239,68,68,0.09);
  color: #f87171;
  border-color: rgba(239,68,68,0.28);
}

/* Full-width divider in the target grid */
.target-inactive-divider {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 0 6px;
  color: var(--text-dim);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
}
.target-inactive-divider::before,
.target-inactive-divider::after {
  content: ''; flex: 1; height: 1px;
  background: rgba(255,255,255,0.07);
}

/* ── Sidebar Inactive Section ── */
.inactive-section-header {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 6px 0;
  border-radius: var(--radius-xs);
  user-select: none;
  transition: opacity var(--transition);
}
.inactive-section-header:hover { opacity: 0.8; }

.inactive-count-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 20px;
  background: rgba(100,116,139,0.18);
  color: var(--text-dim);
  border: 1px solid rgba(100,116,139,0.28);
  line-height: 1.6;
}

.inactive-chevron {
  margin-left: auto;
  color: var(--text-dim);
  font-size: 0.75rem;
  transition: transform var(--transition);
}

/* Dimmed rows in sidebar inactive list */
.checkbox-item.inactive-client { opacity: 0.6; }
.checkbox-item.inactive-client span { color: var(--text-dim); }
.no-sheet-tag { font-size: 0.8em; margin-left: 2px; }

/* ── "Show Inactive" toggle button in target section header ── */
.btn-inactive-toggle {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 14px;
  border-radius: var(--radius-xs);
  border: 1px solid rgba(100,116,139,0.3);
  background: rgba(100,116,139,0.08);
  color: var(--text-dim);
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition);
}
.btn-inactive-toggle:hover {
  border-color: rgba(100,116,139,0.5);
  background: rgba(100,116,139,0.15);
  color: var(--text-muted);
}
.btn-inactive-toggle.active {
  border-color: rgba(99,102,241,0.5);
  background: rgba(99,102,241,0.12);
  color: var(--primary-light);
}
.inactive-toggle-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 20px;
  background: rgba(100,116,139,0.25);
  color: var(--text-dim);
}
.btn-inactive-toggle.active .inactive-toggle-badge {
  background: rgba(99,102,241,0.25);
  color: var(--primary-light);
}

/* ══════════════════════════════════════════════════════════════════
   12. PAYMENTS & BALANCES VIEW STYLES
══════════════════════════════════════════════════════════════════ */

/* Top View Switcher in Header */
.view-switch-nav {
  display: flex;
  align-items: center;
  background: rgba(13, 22, 41, 0.85);
  padding: 4px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  gap: 4px;
  margin-left: 12px;
}

.view-tab {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 14px;
  border-radius: var(--radius-xs);
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.view-tab:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.view-tab.active {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.25), rgba(139, 92, 246, 0.25));
  color: #ffffff;
  border: 1px solid rgba(99, 102, 241, 0.45);
  box-shadow: 0 0 16px rgba(99, 102, 241, 0.2);
}

.nav-alert-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 12px;
  background: rgba(239, 68, 68, 0.22);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.4);
  animation: pulseAlarm 2.5s infinite;
}

@keyframes pulseAlarm {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.05); opacity: 0.85; }
}

/* Payments KPI Grid Colors */
.text-danger { color: #f87171 !important; }
.text-alarm  { color: #fb7185 !important; }
.text-warning{ color: #fbbf24 !important; }
.text-success{ color: #34d399 !important; }

.kpi-outstanding { border-top: 3px solid #ef4444; }
.kpi-overdue     { border-top: 3px solid #f43f5e; background: linear-gradient(180deg, rgba(244, 63, 94, 0.06), var(--bg-card)); }
.kpi-received    { border-top: 3px solid #10b981; }
.kpi-discount    { border-top: 3px solid #f59e0b; }
.kpi-pending-orders { border-top: 3px solid #6366f1; }
.kpi-overdue-orders { border-top: 3px solid #ec4899; }

/* Reminder Cadence Control Hub */
.reminder-hub-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 22px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
}

.reminder-hub-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
}

.reminder-hub-title-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.hub-icon {
  font-size: 1.6rem;
  background: rgba(99, 102, 241, 0.12);
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(99, 102, 241, 0.25);
}

.hub-subtitle {
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-top: 2px;
}

.reminder-stages-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.reminder-stage-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: rgba(13, 22, 41, 0.7);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition);
}

.reminder-stage-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.15);
  color: var(--text);
}

.reminder-stage-btn.active {
  background: rgba(99, 102, 241, 0.18);
  border-color: var(--primary);
  color: #ffffff;
  box-shadow: 0 0 14px rgba(99, 102, 241, 0.22);
}

.btn-stage-overdue.active {
  background: rgba(239, 68, 68, 0.18);
  border-color: #ef4444;
  box-shadow: 0 0 14px rgba(239, 68, 68, 0.25);
}

.stage-bullet {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.bullet-r1 { background: #38bdf8; } /* 30d light blue */
.bullet-r2 { background: #fbbf24; } /* 40d amber */
.bullet-r3 { background: #f97316; } /* 50d orange */
.bullet-r4 { background: #fb7185; } /* 59d rose */
.bullet-r5 { background: #ef4444; } /* 90d red */
.bullet-overdue { background: #e11d48; box-shadow: 0 0 8px #e11d48; }
.bullet-paid { background: #10b981; }

.stage-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
}

.reminder-stage-btn.active .stage-badge {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

.badge-overdue {
  background: rgba(239, 68, 68, 0.25);
  color: #fca5a5;
}

/* Payments Sub-Navigation Tabs */
.payments-subnav {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 12px;
  overflow-x: auto;
}

.subtab-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--radius-xs);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition);
}

.subtab-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

.subtab-btn.active {
  background: var(--bg-card);
  border-color: var(--border);
  color: var(--primary-light);
}

.subtab-pill {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 12px;
  background: rgba(99, 102, 241, 0.18);
  color: var(--primary-light);
}

.subtab-pill.pill-danger {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
}

.payments-sub-section {
  animation: fadeIn 0.3s ease;
}

.section-subtitle {
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-top: 3px;
}

/* Client Reminders Cards Grid */
.client-reminders-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
  gap: 18px;
  margin-bottom: 24px;
}

.client-reminder-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: all var(--transition);
}

.client-reminder-card:hover {
  border-color: rgba(99, 102, 241, 0.4);
  transform: translateY(-2px);
  box-shadow: var(--shadow), 0 6px 20px rgba(0, 0, 0, 0.4);
}

.client-reminder-card.is-overdue {
  border-left: 4px solid #ef4444;
}

.card-header-flex {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.crc-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.3;
}

.crc-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.76rem;
  color: var(--text-muted);
  margin-top: 3px;
  flex-wrap: wrap;
}

.crc-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  white-space: nowrap;
}

.badge-overdue-alert {
  background: rgba(239, 68, 68, 0.18);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.35);
}

.badge-stage-pill {
  background: rgba(99, 102, 241, 0.15);
  color: var(--primary-light);
  border: 1px solid rgba(99, 102, 241, 0.3);
}

.crc-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  background: rgba(6, 11, 24, 0.5);
  padding: 12px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border-subtle);
}

.crc-metric-item {
  display: flex;
  flex-direction: column;
}

.crc-metric-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-dim);
  font-weight: 600;
}

.crc-metric-val {
  font-size: 0.98rem;
  font-weight: 700;
  margin-top: 2px;
}

.crc-contact-chips {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.contact-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.74rem;
  padding: 4px 9px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: all var(--transition);
}

.contact-chip:hover {
  background: rgba(99, 102, 241, 0.15);
  border-color: rgba(99, 102, 241, 0.3);
  color: #ffffff;
}

.crc-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--border-subtle);
}

.btn-chase {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-xs);
  font-size: 0.78rem;
  font-weight: 600;
  border: 1px solid rgba(16, 185, 129, 0.4);
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-chase:hover {
  background: rgba(16, 185, 129, 0.22);
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.2);
}

.btn-drawer-toggle {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
}

.btn-drawer-toggle:hover {
  color: var(--primary-light);
}

/* Expandable Drawer inside Client Card */
.crc-orders-drawer {
  background: rgba(6, 11, 24, 0.6);
  border-radius: var(--radius-xs);
  padding: 10px;
  border: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 220px;
  overflow-y: auto;
}

.drawer-order-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.76rem;
  padding: 6px 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.02);
  border-left: 3px solid var(--border);
}

.drawer-order-row.order-overdue {
  border-left-color: #ef4444;
  background: rgba(239, 68, 68, 0.04);
}

/* Chase Table Styling */
.chase-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.chase-table th {
  background: var(--bg-surface);
  color: var(--text-muted);
  font-weight: 600;
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

.chase-table th:hover {
  color: var(--text);
}

.chase-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text);
  white-space: nowrap;
}

.chase-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

.table-select-filter {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  color: var(--text);
  font-size: 0.8rem;
  padding: 6px 12px;
  outline: none;
  cursor: pointer;
}

/* Payment Status Badges */
.pay-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}

.pay-badge-paid {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.pay-badge-overdue {
  background: rgba(239, 68, 68, 0.18);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.4);
}

.pay-badge-reminder {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.pay-badge-pending {
  background: rgba(99, 102, 241, 0.15);
  color: var(--primary-light);
  border: 1px solid rgba(99, 102, 241, 0.3);
}

/* ── 13. RESPONSIVE ───────────────────────────────────────────── */

@media (max-width: 1400px) {
  .kpi-grid { grid-template-columns: repeat(3, 1fr); }
  .client-reminders-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 1100px) {
  .charts-section { grid-template-columns: 1fr; }
  .chart-half { grid-column: span 1; }
  .client-reminders-grid { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  :root { --sidebar-w: 240px; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .view-switch-nav { margin-left: 6px; }
  .view-tab span:not(.nav-alert-badge) { display: none; }
}

@media (max-width: 640px) {
  body { overflow: auto; }
  #app { height: auto; overflow: visible; }
  .app-body { flex-direction: column; overflow: visible; }
  #sidebar { width: 100%; overflow: visible; border-right: none; border-bottom: 1px solid var(--border-subtle); }
  #sidebar.collapsed { display: none; }
  #main-content { overflow: visible; padding: 12px; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .header-left .filter-chips { display: none; }
  .client-reminders-grid { grid-template-columns: 1fr; }
}

/* ── 14. LIVE DATA UPDATE BANNER & SYNC STATUS ─────────────────── */

.sync-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  padding: 4px 10px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.sync-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #64748b;
  display: inline-block;
  transition: var(--transition);
}

.sync-dot.synced {
  background: #10b981;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
}

.sync-dot.syncing {
  background: #f59e0b;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.6);
  animation: pulseSync 1.2s infinite ease-in-out;
}

.sync-dot.update-ready {
  background: #6366f1;
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.8);
  animation: pulseSync 1.5s infinite ease-in-out;
}

.sync-dot.error {
  background: #ef4444;
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.5);
}

@keyframes pulseSync {
  0% { transform: scale(0.9); opacity: 0.7; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.7; }
}

/* Floating Realtime Update Banner */
.data-update-banner {
  position: fixed;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  background: rgba(17, 29, 53, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(99, 102, 241, 0.4);
  border-radius: 30px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.5), 0 0 20px rgba(99, 102, 241, 0.25);
  animation: bannerSlideDown 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 6px 8px 6px 14px;
}

@keyframes bannerSlideDown {
  from {
    transform: translate(-50%, -30px);
    opacity: 0;
  }
  to {
    transform: translate(-50%, 0);
    opacity: 1;
  }
}

.banner-inner {
  display: flex;
  align-items: center;
  gap: 12px;
}

.banner-pulse {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #6366f1;
  box-shadow: 0 0 10px #6366f1;
  animation: pulseSync 1.2s infinite ease-in-out;
}

.banner-badge {
  font-size: 0.72rem;
  font-weight: 700;
  color: #818cf8;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.banner-text {
  font-size: 0.82rem;
  color: var(--text);
  font-weight: 500;
}

.banner-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-banner-update {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: white;
  border: none;
  border-radius: 18px;
  padding: 6px 14px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(99, 102, 241, 0.3);
  transition: var(--transition);
}

.btn-banner-update:hover {
  transform: scale(1.03);
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.5);
}

.btn-banner-dismiss {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.9rem;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.btn-banner-dismiss:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
}

/* ── 15. NOTIFICATION BELL & RECENT ACTIVITY POPOVER ──────────── */

.notif-bell-wrapper {
  position: relative;
  display: inline-block;
}

.notif-bell-btn {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.notif-bell-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--primary-light);
  transform: scale(1.05);
}

.notif-bell-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  background: linear-gradient(135deg, #ef4444, #f43f5e);
  color: white;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 2px 5px;
  border-radius: 10px;
  line-height: 1;
  min-width: 16px;
  text-align: center;
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.7);
  animation: pulseSync 2s infinite ease-in-out;
}

.notif-badge-nav {
  background: rgba(99, 102, 241, 0.2);
  color: #818cf8;
  border: 1px solid rgba(99, 102, 241, 0.4);
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 10px;
  margin-left: 4px;
}

/* Notification Popover Dropdown */
.notif-popover {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 380px;
  max-width: 90vw;
  background: rgba(13, 22, 41, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6), 0 0 20px rgba(99, 102, 241, 0.15);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: popoverFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes popoverFadeIn {
  from { opacity: 0; transform: translateY(-8px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.notif-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.02);
}

.notif-header-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  color: var(--text);
}

.notif-mark-read {
  background: transparent;
  border: none;
  color: var(--primary-light);
  font-size: 0.75rem;
  cursor: pointer;
  font-weight: 500;
}

.notif-mark-read:hover {
  text-decoration: underline;
}

.notif-body {
  max-height: 380px;
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.notif-item {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid transparent;
  transition: var(--transition);
  cursor: pointer;
}

.notif-item:hover {
  background: rgba(99, 102, 241, 0.08);
  border-color: rgba(99, 102, 241, 0.25);
  transform: translateX(2px);
}

.notif-item.is-unread {
  background: rgba(99, 102, 241, 0.12);
  border-color: rgba(99, 102, 241, 0.35);
}

.notif-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.notif-client-name {
  font-weight: 700;
  font-size: 0.84rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
}

.notif-rep-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: rgba(139, 92, 246, 0.15);
  color: #c4b5fd;
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 1px 6px;
}

.notif-item-mid {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.notif-item-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-dim);
}

.notif-footer {
  padding: 10px 14px;
  border-top: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.02);
  text-align: center;
}

.btn-notif-all {
  width: 100%;
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: var(--primary-light);
  font-weight: 600;
  font-size: 0.8rem;
  padding: 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}

.btn-notif-all:hover {
  background: var(--primary);
  color: white;
}

/* ── 16. RECENT ORDERS VIEW LAYOUT ────────────────────────────── */

.filter-toolbar {
  padding: 16px 20px;
}

.filter-toolbar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.period-pills-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.filter-toolbar-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

.period-pills {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-surface);
  padding: 3px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

.pill-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition);
}

.pill-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

.pill-btn.active {
  background: var(--primary);
  color: white;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4);
}

.search-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 260px;
}

.search-input-wrap svg {
  position: absolute;
  left: 12px;
  color: var(--text-dim);
  pointer-events: none;
}

.search-input-wrap .search-input {
  width: 100%;
  padding: 8px 12px 8px 36px;
  font-size: 0.82rem;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text);
  outline: none;
  transition: var(--transition);
}

.search-input-wrap .search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.filter-toolbar-dropdowns {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding-top: 10px;
  border-top: 1px solid var(--border-subtle);
}

.filter-dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-dropdown-item label {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
}

.filter-dropdown-item select {
  min-width: 140px;
}

.text-emerald {
  color: #10b981 !important;
}

.kpi-card-glow {
  position: relative;
  overflow: hidden;
}

.kpi-card-glow::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, #6366f1, #8b5cf6);
}

