/* ===============================================================
   LinkPilot Platform v3.0 — Design System 2026 SaaS Premium
   Dark Mode + Light Mode | Clean | Minimal | Professional
   =============================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,300;0,14..32,400;0,14..32,500;0,14..32,600;0,14..32,700;0,14..32,800;1,14..32,400&family=JetBrains+Mono:wght@400;500;600&display=swap');

/* ============================================================
   DESIGN TOKENS — DARK MODE (DEFAULT)
   ============================================================ */
:root {
  --bg-base:         #0D1117;
  --bg-surface:      #161B22;
  --bg-elevated:     #1C2128;
  --bg-hover:        rgba(255,255,255,0.04);
  --bg-active:       rgba(255,255,255,0.06);
  --bg-card:         #161B22;
  --bg-input:        rgba(255,255,255,0.04);
  --bg-modal:        #1C2128;

  --accent-primary:  #6366F1;
  --accent-hover:    #4F46E5;
  --accent-muted:    rgba(99,102,241,0.12);
  --accent-border:   rgba(99,102,241,0.3);
  --accent-glow:     0 0 24px rgba(99,102,241,0.25);
  --accent-light:    #818CF8;

  --success:         #22C55E;
  --success-muted:   rgba(34,197,94,0.12);
  --success-border:  rgba(34,197,94,0.25);
  --warning:         #F59E0B;
  --warning-muted:   rgba(245,158,11,0.12);
  --warning-border:  rgba(245,158,11,0.25);
  --danger:          #EF4444;
  --danger-muted:    rgba(239,68,68,0.12);
  --danger-border:   rgba(239,68,68,0.25);
  --info:            #3B82F6;
  --info-muted:      rgba(59,130,246,0.12);

  --text-primary:    #E6EDF3;
  --text-secondary:  #8B949E;
  --text-muted:      #6E7681;
  --text-disabled:   #484F58;
  --text-accent:     #818CF8;

  --border-subtle:   rgba(255,255,255,0.06);
  --border-default:  rgba(255,255,255,0.10);
  --border-emphasis: rgba(255,255,255,0.16);
  --border-accent:   rgba(99,102,241,0.35);

  --font-sans:  'Inter', system-ui, -apple-system, sans-serif;
  --font-mono:  'JetBrains Mono', 'Fira Code', monospace;

  --space-1:4px; --space-2:8px; --space-3:12px; --space-4:16px;
  --space-5:20px; --space-6:24px; --space-7:28px; --space-8:32px;
  --space-10:40px; --space-12:48px; --space-16:64px;

  --radius-sm:   6px;
  --radius-md:   10px;
  --radius-lg:   14px;
  --radius-xl:   18px;
  --radius-2xl:  24px;
  --radius-full: 9999px;

  --shadow-sm:   0 1px 3px rgba(0,0,0,0.4), 0 1px 2px rgba(0,0,0,0.3);
  --shadow-md:   0 4px 12px rgba(0,0,0,0.4), 0 2px 6px rgba(0,0,0,0.25);
  --shadow-lg:   0 10px 30px rgba(0,0,0,0.5), 0 4px 12px rgba(0,0,0,0.3);
  --shadow-xl:   0 20px 50px rgba(0,0,0,0.6), 0 8px 20px rgba(0,0,0,0.35);
  --shadow-card: 0 1px 3px rgba(0,0,0,0.4), 0 1px 2px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.04);

  --sidebar-width:     248px;
  --sidebar-collapsed: 68px;
  --topbar-height:     58px;

  --ease-out:   cubic-bezier(0.16,1,0.3,1);
  --ease-in:    cubic-bezier(0.4,0,1,1);
  --ease-inout: cubic-bezier(0.4,0,0.2,1);
  --dur-fast:  100ms;
  --dur-base:  180ms;
  --dur-slow:  280ms;
  --dur-slower:400ms;
}

/* LIGHT MODE */
[data-theme="light"] {
  --bg-base:         #F6F8FA;
  --bg-surface:      #FFFFFF;
  --bg-elevated:     #FFFFFF;
  --bg-hover:        rgba(0,0,0,0.03);
  --bg-active:       rgba(0,0,0,0.06);
  --bg-card:         #FFFFFF;
  --bg-input:        #F6F8FA;
  --bg-modal:        #FFFFFF;

  --accent-muted:    rgba(99,102,241,0.08);
  --accent-border:   rgba(99,102,241,0.25);
  --success-muted:   rgba(34,197,94,0.08);
  --warning-muted:   rgba(245,158,11,0.08);
  --danger-muted:    rgba(239,68,68,0.08);
  --info-muted:      rgba(59,130,246,0.08);

  --text-primary:    #1A1F2C;
  --text-secondary:  #57606A;
  --text-muted:      #8C959F;
  --text-disabled:   #B4BCC4;
  --text-accent:     #4F46E5;

  --border-subtle:   rgba(0,0,0,0.04);
  --border-default:  rgba(0,0,0,0.08);
  --border-emphasis: rgba(0,0,0,0.14);

  --shadow-sm:   0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md:   0 4px 12px rgba(0,0,0,0.1), 0 2px 6px rgba(0,0,0,0.06);
  --shadow-lg:   0 10px 30px rgba(0,0,0,0.12), 0 4px 12px rgba(0,0,0,0.08);
  --shadow-xl:   0 20px 50px rgba(0,0,0,0.15), 0 8px 20px rgba(0,0,0,0.1);
  --shadow-card: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.05), inset 0 1px 0 rgba(255,255,255,0.8);
}

/* ============================================================
   RESET
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  background: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color var(--dur-slow) var(--ease-inout), color var(--dur-slow) var(--ease-inout);
}
a { color: var(--accent-primary); text-decoration: none; transition: color var(--dur-fast); }
a:hover { color: var(--accent-light); }
button { font-family: var(--font-sans); cursor: pointer; border: none; background: none; }
input, select, textarea { font-family: var(--font-sans); }
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-emphasis); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }
::selection { background: var(--accent-muted); color: var(--text-primary); }

/* ============================================================
   APP LAYOUT
   ============================================================ */
#app { display: flex; min-height: 100vh; width: 100%; }

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-surface);
  border-right: 1px solid var(--border-default);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; bottom: 0; left: 0;
  z-index: 200;
  transition: width var(--dur-slow) var(--ease-out), transform var(--dur-slow) var(--ease-out);
  overflow: hidden;
}
.sidebar.collapsed { width: var(--sidebar-collapsed); }

.sidebar-logo {
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 0 var(--space-4);
  border-bottom: 1px solid var(--border-default);
  flex-shrink: 0;
  overflow: hidden;
}
.sidebar-logo-icon {
  width: 34px; height: 34px;
  background: var(--accent-primary);
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  flex-shrink: 0;
  box-shadow: var(--accent-glow);
  transition: box-shadow var(--dur-base);
}
.sidebar-logo-icon svg { width: 17px; height: 17px; stroke-width: 2.2; }

.sidebar-logo-text {
  font-size: 15px; font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.3px;
  white-space: nowrap;
  transition: opacity var(--dur-base), transform var(--dur-base);
}
.sidebar-logo-version {
  font-size: 10px; font-weight: 600;
  color: var(--accent-primary);
  background: var(--accent-muted);
  padding: 2px 6px;
  border-radius: var(--radius-full);
  white-space: nowrap;
  letter-spacing: 0.3px;
  transition: opacity var(--dur-base);
  border: 1px solid var(--accent-border);
}
.sidebar.collapsed .sidebar-logo-text,
.sidebar.collapsed .sidebar-logo-version { opacity: 0; pointer-events: none; transform: translateX(-8px); }

.sidebar-menu {
  padding: var(--space-3) var(--space-2);
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
}

.menu-section-label {
  font-size: 10px; font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: var(--space-3) var(--space-3) var(--space-2);
  margin-top: var(--space-2);
  white-space: nowrap;
  overflow: hidden;
  transition: opacity var(--dur-base);
}
.sidebar.collapsed .menu-section-label { opacity: 0; }

.menu-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 9px var(--space-3);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  cursor: pointer;
  position: relative;
  white-space: nowrap;
  overflow: hidden;
  transition: all var(--dur-fast) var(--ease-out);
  user-select: none;
}
.menu-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.menu-item.active { background: var(--accent-muted); color: var(--accent-primary); font-weight: 600; }
.menu-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 20px;
  background: var(--accent-primary);
  border-radius: 0 var(--radius-full) var(--radius-full) 0;
}
.menu-item svg { width: 17px; height: 17px; flex-shrink: 0; stroke-width: 1.8; }
.menu-title {
  font-size: 13px; font-weight: 500;
  transition: opacity var(--dur-base), transform var(--dur-base);
  flex: 1; overflow: hidden;
}
.sidebar.collapsed .menu-title { opacity: 0; transform: translateX(-6px); }

.menu-badge {
  font-size: 10px; font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  background: var(--accent-muted);
  color: var(--accent-primary);
  border: 1px solid var(--accent-border);
  min-width: 22px; text-align: center;
  letter-spacing: 0.2px;
  transition: opacity var(--dur-base);
}
.sidebar.collapsed .menu-badge { opacity: 0; }

/* Tooltip for collapsed state */
.menu-item[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  left: calc(100% + 12px); top: 50%;
  transform: translateY(-50%) translateX(-4px);
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  color: var(--text-primary);
  font-size: 12px; font-weight: 500;
  padding: 6px 10px;
  border-radius: var(--radius-md);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  box-shadow: var(--shadow-lg);
  transition: opacity var(--dur-fast), transform var(--dur-fast);
  z-index: 999;
}
.sidebar.collapsed .menu-item:hover[data-tooltip]::after {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

.sidebar-footer {
  padding: var(--space-3) var(--space-2);
  border-top: 1px solid var(--border-default);
  flex-shrink: 0;
}
.sidebar-user {
  display: flex; align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-2);
  border-radius: var(--radius-md);
  cursor: pointer; overflow: hidden;
  transition: background var(--dur-fast);
}
.sidebar-user:hover { background: var(--bg-hover); }
.sidebar-user-avatar {
  width: 32px; height: 32px;
  border-radius: var(--radius-full);
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid var(--border-default);
}
.sidebar-user-info { overflow: hidden; transition: opacity var(--dur-base); }
.sidebar-user-name { font-size: 12px; font-weight: 600; color: var(--text-primary); white-space: nowrap; }
.sidebar-user-role { font-size: 10px; color: var(--text-muted); white-space: nowrap; }
.sidebar.collapsed .sidebar-user-info { opacity: 0; }

/* ============================================================
   MAIN WRAPPER & TOPBAR
   ============================================================ */
.main-wrapper {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: margin-left var(--dur-slow) var(--ease-out);
  min-width: 0;
}
.main-wrapper.collapsed { margin-left: var(--sidebar-collapsed); }

.topbar {
  height: var(--topbar-height);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-default);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-6);
  position: sticky; top: 0;
  z-index: 100;
  gap: var(--space-4);
  backdrop-filter: blur(12px);
}
.topbar-left { display: flex; align-items: center; gap: var(--space-4); flex: 1; min-width: 0; }
.topbar-right { display: flex; align-items: center; gap: var(--space-3); flex-shrink: 0; }

.sidebar-toggle {
  width: 34px; height: 34px;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text-secondary);
  display: flex; align-items: center; justify-content: center;
  transition: all var(--dur-fast);
  flex-shrink: 0;
}
.sidebar-toggle:hover { background: var(--bg-hover); color: var(--text-primary); }
.sidebar-toggle svg { width: 18px; height: 18px; stroke-width: 1.8; }

.page-breadcrumb { display: flex; align-items: center; gap: var(--space-2); font-size: 13px; color: var(--text-muted); }
.page-breadcrumb-current { font-size: 14px; font-weight: 600; color: var(--text-primary); }

.search-trigger {
  display: flex; align-items: center;
  gap: var(--space-2);
  background: var(--bg-input);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 7px 12px;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 13px;
  transition: all var(--dur-fast);
  max-width: 260px; width: 100%;
}
.search-trigger:hover { border-color: var(--border-emphasis); background: var(--bg-hover); color: var(--text-secondary); }
.search-trigger svg { width: 14px; height: 14px; flex-shrink: 0; }

.kbd-shortcut {
  font-size: 10px; font-weight: 600;
  font-family: var(--font-mono);
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  flex-shrink: 0;
}

.theme-toggle {
  width: 34px; height: 34px;
  border-radius: var(--radius-md);
  background: var(--bg-input);
  border: 1px solid var(--border-default);
  color: var(--text-secondary);
  display: flex; align-items: center; justify-content: center;
  transition: all var(--dur-fast);
}
.theme-toggle:hover { background: var(--bg-hover); color: var(--text-primary); border-color: var(--border-emphasis); }
.theme-toggle svg { width: 16px; height: 16px; }

.notif-bell {
  width: 34px; height: 34px;
  border-radius: var(--radius-md);
  background: var(--bg-input);
  border: 1px solid var(--border-default);
  color: var(--text-secondary);
  display: flex; align-items: center; justify-content: center;
  position: relative;
  transition: all var(--dur-fast);
}
.notif-bell:hover { background: var(--bg-hover); color: var(--text-primary); border-color: var(--border-emphasis); }
.notif-bell svg { width: 16px; height: 16px; }
.notif-badge {
  position: absolute; top: -4px; right: -4px;
  width: 17px; height: 17px;
  background: var(--danger);
  border-radius: var(--radius-full);
  font-size: 9px; font-weight: 700; color: #fff;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--bg-surface);
  animation: badge-pulse 2.5s ease-in-out infinite;
}
@keyframes badge-pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.15); } }

.user-profile {
  display: flex; align-items: center;
  gap: var(--space-2);
  padding: 5px var(--space-3) 5px 5px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-default);
  background: var(--bg-input);
  cursor: pointer;
  transition: all var(--dur-fast);
}
.user-profile:hover { background: var(--bg-hover); border-color: var(--border-emphasis); }
.user-avatar { width: 28px; height: 28px; border-radius: var(--radius-full); object-fit: cover; }
.user-name {
  font-size: 12px; font-weight: 600;
  color: var(--text-primary);
  max-width: 120px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.user-dropdown-popover {
  position: absolute !important;
  top: calc(100% + 8px) !important; right: 0 !important;
  background: var(--bg-modal) !important;
  border: 1px solid var(--border-default) !important;
  border-radius: var(--radius-lg) !important;
  width: 220px !important;
  box-shadow: var(--shadow-xl) !important;
  z-index: 999 !important;
  overflow: hidden !important;
  animation: dropdown-in var(--dur-base) var(--ease-out) !important;
}
@keyframes dropdown-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }

/* ============================================================
   CONTENT
   ============================================================ */
.content-container { flex: 1; padding: var(--space-6); overflow-y: auto; overflow-x: hidden; }
.page-section { animation: page-enter var(--dur-slow) var(--ease-out); }
@keyframes page-enter { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.page-header { margin-bottom: var(--space-6); }
.page-header h1 { font-size: 22px; font-weight: 700; color: var(--text-primary); letter-spacing: -0.4px; margin-bottom: 4px; }
.page-header p { font-size: 13px; color: var(--text-secondary); line-height: 1.5; }
.page-header-flex { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-4); margin-bottom: var(--space-6); flex-wrap: wrap; }

/* ============================================================
   CARD
   ============================================================ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  box-shadow: var(--shadow-card);
  transition: border-color var(--dur-base), box-shadow var(--dur-base), background var(--dur-base);
}
.card:hover { border-color: var(--border-emphasis); }
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--space-4); gap: var(--space-3); }
.card-header-left { display: flex; align-items: center; gap: var(--space-2); }
.card-title { font-size: 13px; font-weight: 600; color: var(--text-primary); letter-spacing: -0.1px; }
.card-subtitle { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.card-value { font-size: 28px; font-weight: 800; color: var(--text-primary); line-height: 1.1; letter-spacing: -0.8px; margin: var(--space-2) 0; }
.card-footer { margin-top: var(--space-3); padding-top: var(--space-3); border-top: 1px solid var(--border-subtle); font-size: 11px; color: var(--text-muted); }

.span-2 { grid-column: span 2; }
.span-3 { grid-column: span 3; }
.span-4 { grid-column: span 4; }

/* ============================================================
   KPI CARDS
   ============================================================ */
.kpi-grid { display: grid; grid-template-columns: repeat(6,1fr); gap: var(--space-4); margin-bottom: var(--space-6); }

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-5);
  position: relative; overflow: hidden;
  transition: all var(--dur-base) var(--ease-out);
  cursor: default;
}
.kpi-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: var(--kpi-accent, var(--accent-primary));
  opacity: 0.7;
}
.kpi-card:hover { border-color: var(--border-emphasis); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.kpi-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--space-3); }
.kpi-title { font-size: 10px; font-weight: 700; letter-spacing: 0.6px; text-transform: uppercase; color: var(--text-muted); }
.kpi-icon-wrapper { width: 28px; height: 28px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; }
.kpi-icon-wrapper svg { width: 14px; height: 14px; }
.kpi-value { font-size: 26px; font-weight: 800; color: var(--text-primary); letter-spacing: -0.8px; line-height: 1; margin-bottom: var(--space-2); }
.kpi-footer { display: flex; align-items: center; gap: var(--space-2); margin-top: var(--space-2); }
.kpi-subtext { font-size: 11px; color: var(--text-muted); }
.kpi-delta { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; font-weight: 600; padding: 2px 6px; border-radius: var(--radius-full); }
.kpi-delta.up { color: var(--success); background: var(--success-muted); }
.kpi-delta.down { color: var(--danger); background: var(--danger-muted); }
.kpi-delta svg { width: 10px; height: 10px; }

/* ============================================================
   BENTO GRID
   ============================================================ */
.bento-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: var(--space-4); margin-bottom: var(--space-6); }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; gap: var(--space-2);
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-size: 13px; font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--dur-fast) var(--ease-out);
  white-space: nowrap; user-select: none;
  position: relative; overflow: hidden;
}
.btn:active { transform: scale(0.98); }
.btn svg { width: 14px; height: 14px; flex-shrink: 0; }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-sm svg { width: 13px; height: 13px; }
.btn-xs { padding: 4px 8px; font-size: 11px; }

.btn-primary { background: var(--accent-primary); color: #fff; border-color: var(--accent-primary); box-shadow: 0 1px 2px rgba(0,0,0,0.3); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); box-shadow: 0 4px 12px rgba(99,102,241,0.35); transform: translateY(-1px); }
.btn-secondary { background: var(--bg-input); color: var(--text-secondary); border-color: var(--border-default); }
.btn-secondary:hover { background: var(--bg-hover); color: var(--text-primary); border-color: var(--border-emphasis); }
.btn-success { background: var(--success-muted); color: var(--success); border-color: var(--success-border); }
.btn-success:hover { background: rgba(34,197,94,0.18); transform: translateY(-1px); }
.btn-danger { background: var(--danger-muted); color: var(--danger); border-color: var(--danger-border); }
.btn-danger:hover { background: rgba(239,68,68,0.18); transform: translateY(-1px); }
.btn-warning { background: var(--warning-muted); color: var(--warning); border-color: var(--warning-border); }
.btn-warning:hover { background: rgba(245,158,11,0.18); }
.btn-excel { background: var(--success-muted); color: var(--success); border-color: var(--success-border); }
.btn-excel:hover { background: rgba(34,197,94,0.18); }
.btn-pdf { background: var(--danger-muted); color: var(--danger); border-color: var(--danger-border); }
.btn-pdf:hover { background: rgba(239,68,68,0.18); }

/* ============================================================
   BADGES & CHIPS
   ============================================================ */
.badge {
  display: inline-flex; align-items: center; gap: var(--space-1);
  padding: 3px 8px; border-radius: var(--radius-full);
  font-size: 11px; font-weight: 600; letter-spacing: 0.1px;
  border: 1px solid transparent;
}
.badge-success { background: var(--success-muted); color: var(--success); border-color: var(--success-border); }
.badge-warning { background: var(--warning-muted); color: var(--warning); border-color: var(--warning-border); }
.badge-danger { background: var(--danger-muted); color: var(--danger); border-color: var(--danger-border); }
.badge-info { background: var(--info-muted); color: var(--info); }
.badge-active { background: var(--accent-muted); color: var(--accent-primary); border-color: var(--accent-border); }
.badge-muted { background: var(--bg-input); color: var(--text-muted); border-color: var(--border-default); }

.chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: var(--radius-full); font-size: 11px; font-weight: 600; border: 1px solid transparent; }
.chip-success { background: var(--success-muted); color: var(--success); border-color: var(--success-border); }
.chip-warning { background: var(--warning-muted); color: var(--warning); border-color: var(--warning-border); }
.chip-danger { background: var(--danger-muted); color: var(--danger); border-color: var(--danger-border); }
.chip-info { background: var(--info-muted); color: var(--info); }
.chip-accent { background: var(--accent-muted); color: var(--accent-primary); border-color: var(--accent-border); }
.chip-muted { background: var(--bg-input); color: var(--text-muted); border-color: var(--border-default); }
.chip svg { width: 10px; height: 10px; }

.status-dot { display: inline-block; width: 7px; height: 7px; border-radius: var(--radius-full); flex-shrink: 0; }
.status-dot.connected { background: var(--success); box-shadow: 0 0 0 2px var(--success-muted); animation: dot-pulse 2s ease-in-out infinite; }
.status-dot.pending { background: var(--warning); }
.status-dot.error { background: var(--danger); }
@keyframes dot-pulse { 0%,100% { box-shadow: 0 0 0 2px var(--success-muted); } 50% { box-shadow: 0 0 0 4px rgba(34,197,94,0.08); } }

/* ============================================================
   FORM ELEMENTS
   ============================================================ */
.input-text, .select-input, .select-dropdown {
  background: var(--bg-input);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 13px;
  padding: 8px 12px;
  transition: all var(--dur-fast);
  outline: none; width: 100%;
  appearance: none; -webkit-appearance: none;
}
.input-text::placeholder { color: var(--text-muted); }
.input-text:focus, .select-input:focus, .select-dropdown:focus { border-color: var(--accent-primary); background: var(--bg-card); box-shadow: 0 0 0 3px var(--accent-muted); }
.input-text:hover:not(:focus), .select-input:hover:not(:focus) { border-color: var(--border-emphasis); }
.select-input option, .select-dropdown option { background: var(--bg-elevated); color: var(--text-primary); }
textarea.input-text { min-height: 100px; resize: vertical; line-height: 1.5; }

.input-icon-wrapper { position: relative; display: flex; align-items: center; }
.input-icon-wrapper > svg { position: absolute; left: 12px; color: var(--text-muted); width: 15px; height: 15px; pointer-events: none; flex-shrink: 0; }
.input-icon-wrapper > .input-text { padding-left: 38px; }

.filter-bar { display: flex; align-items: center; gap: var(--space-3); margin-bottom: var(--space-4); flex-wrap: wrap; }
.filter-bar .input-text { flex: 1; min-width: 200px; max-width: 300px; }
.filter-bar .select-input { min-width: 140px; max-width: 200px; flex: 0 1 auto; }

.table-toolbar { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); margin-bottom: var(--space-4); flex-wrap: wrap; }
.toolbar-left { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; }
.toolbar-right { display: flex; align-items: center; gap: var(--space-3); }

/* ============================================================
   DATA TABLE
   ============================================================ */
.table-responsive { border: 1px solid var(--border-default); border-radius: var(--radius-lg); overflow: hidden; overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.data-table thead { background: var(--bg-elevated); border-bottom: 1px solid var(--border-default); }
.data-table thead th { padding: 11px 14px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); white-space: nowrap; text-align: left; cursor: default; user-select: none; border-right: 1px solid var(--border-subtle); }
.data-table thead th:last-child { border-right: none; }
.data-table thead th.sortable { cursor: pointer; }
.data-table thead th.sortable:hover { color: var(--text-primary); }
.data-table tbody tr { border-bottom: 1px solid var(--border-subtle); transition: background var(--dur-fast); }
.data-table tbody tr:last-child { border-bottom: none; }
.data-table tbody tr:hover { background: var(--bg-hover); }
.data-table tbody td { padding: 11px 14px; color: var(--text-secondary); vertical-align: middle; border-right: 1px solid var(--border-subtle); }
.data-table tbody td:last-child { border-right: none; }
.data-table tbody td.td-primary { color: var(--text-primary); font-weight: 500; }
.data-table .td-mono { font-family: var(--font-mono); font-size: 11.5px; color: var(--text-secondary); }

.excel-checkbox { width: 15px; height: 15px; accent-color: var(--accent-primary); cursor: pointer; }

.pagination { display: flex; align-items: center; justify-content: space-between; margin-top: var(--space-4); gap: var(--space-3); flex-wrap: wrap; }
.pagination-info { font-size: 12px; color: var(--text-muted); }
.pagination-controls { display: flex; gap: var(--space-1); }
.page-btn { width: 30px; height: 30px; border-radius: var(--radius-md); border: 1px solid var(--border-default); background: var(--bg-input); color: var(--text-secondary); font-size: 12px; font-weight: 600; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all var(--dur-fast); }
.page-btn:hover { border-color: var(--border-emphasis); color: var(--text-primary); background: var(--bg-hover); }
.page-btn.active { background: var(--accent-primary); border-color: var(--accent-primary); color: #fff; }

/* ============================================================
   PROGRESS
   ============================================================ */
.progress-track { height: 5px; background: var(--bg-elevated); border-radius: var(--radius-full); overflow: hidden; margin: var(--space-2) 0; }
.progress-fill { height: 100%; background: var(--accent-primary); border-radius: var(--radius-full); transition: width var(--dur-slow) var(--ease-out); }
.progress-fill.success { background: var(--success); }
.progress-fill.warning { background: var(--warning); }
.progress-fill.danger { background: var(--danger); }

.metric-row { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-3); }
.metric-label { font-size: 12px; color: var(--text-secondary); min-width: 100px; }
.metric-bar { flex: 1; }
.metric-value { font-size: 12px; font-weight: 700; color: var(--text-primary); min-width: 38px; text-align: right; }

/* ============================================================
   CIRCLE PROGRESS
   ============================================================ */
.circle-progress-container { position: relative; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.circle-progress-svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.circle-bg { fill: none; stroke: var(--bg-elevated); stroke-width: 8; }
.circle-fill { fill: none; stroke: var(--accent-primary); stroke-width: 8; stroke-linecap: round; stroke-dasharray: 283; transition: stroke-dashoffset var(--dur-slower) var(--ease-out); }
.circle-value { position: absolute; font-size: 18px; font-weight: 800; color: var(--text-primary); letter-spacing: -0.5px; }

/* ============================================================
   TERMINAL
   ============================================================ */
.terminal-box {
  background: #0A0D14;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1.8;
  overflow-y: auto;
  color: #8B949E;
}
[data-theme="light"] .terminal-box { background: #0D1117; }
.log-line { display: flex; gap: var(--space-3); }
.log-time { color: #484F58; flex-shrink: 0; }
.log-type { font-weight: 700; flex-shrink: 0; min-width: 50px; }
.log-type.info { color: #58A6FF; }
.log-type.success { color: #3FB950; }
.log-type.warn { color: #D29922; }
.log-type.error { color: #F85149; }
.log-msg { color: #8B949E; word-break: break-all; }
.log-msg.highlight { color: #C9D1D9; }

/* ============================================================
   MODALS
   ============================================================ */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.65);
  z-index: 500;
  display: none; align-items: center; justify-content: center;
  padding: var(--space-4);
  backdrop-filter: blur(4px);
}
.modal-overlay.active,
.modal-overlay.open {
  display: flex;
  animation: overlay-in var(--dur-base) var(--ease-out);
}
@keyframes overlay-in { from { opacity: 0; } to { opacity: 1; } }

.drawer-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 450;
  display: none;
  backdrop-filter: blur(2px);
}
.drawer-overlay.active,
.drawer-overlay.open {
  display: block;
}

.drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: 450px; max-width: 90vw;
  background: var(--bg-modal);
  border-left: 1px solid var(--border-default);
  z-index: 500;
  display: flex; flex-direction: column;
  transform: translateX(100%);
  transition: transform var(--dur-slow) var(--ease-out);
  box-shadow: var(--shadow-xl);
}
.drawer.open, .drawer.active {
  transform: translateX(0);
}

.modal-panel { background: var(--bg-modal); border: 1px solid var(--border-default); border-radius: var(--radius-xl); box-shadow: var(--shadow-xl); width: 100%; max-width: 560px; max-height: 90vh; overflow-y: auto; animation: modal-in var(--dur-slow) var(--ease-out); }
.modal-panel.modal-lg { max-width: 720px; }
.modal-panel.modal-xl { max-width: 900px; }
@keyframes modal-in { from { opacity: 0; transform: translateY(16px) scale(0.98); } to { opacity: 1; transform: translateY(0) scale(1); } }

.modal-header { display: flex; align-items: center; justify-content: space-between; padding: var(--space-5) var(--space-6); border-bottom: 1px solid var(--border-default); }
.modal-title { font-size: 16px; font-weight: 700; color: var(--text-primary); letter-spacing: -0.2px; }
.modal-close { width: 30px; height: 30px; border-radius: var(--radius-md); background: transparent; color: var(--text-muted); display: flex; align-items: center; justify-content: center; cursor: pointer; transition: all var(--dur-fast); }
.modal-close:hover { background: var(--bg-hover); color: var(--text-primary); }
.modal-close svg { width: 16px; height: 16px; }
.modal-body { padding: var(--space-6); }
.modal-footer { display: flex; align-items: center; justify-content: flex-end; gap: var(--space-3); padding: var(--space-4) var(--space-6); border-top: 1px solid var(--border-default); }

/* ============================================================
   SKELETON LOADING
   ============================================================ */
.skeleton {
  background: linear-gradient(90deg, var(--bg-elevated) 25%, var(--bg-hover) 50%, var(--bg-elevated) 75%);
  background-size: 200% 100%;
  animation: skeleton-wave 1.8s ease-in-out infinite;
  border-radius: var(--radius-sm);
  display: block;
}
@keyframes skeleton-wave { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.skeleton-text { height: 12px; border-radius: var(--radius-sm); margin-bottom: var(--space-2); }
.skeleton-text.sm { height: 10px; width: 60%; }
.skeleton-title { height: 20px; width: 40%; border-radius: var(--radius-sm); margin-bottom: var(--space-3); }
.skeleton-value { height: 32px; width: 55%; border-radius: var(--radius-sm); }
.skeleton-circle { border-radius: var(--radius-full); }
.skeleton-btn { height: 34px; border-radius: var(--radius-md); }

/* ============================================================
   TABS SEGMENTED
   ============================================================ */
.tabs-segmented { display: inline-flex; background: var(--bg-elevated); border: 1px solid var(--border-default); border-radius: var(--radius-md); padding: 3px; gap: 2px; margin-bottom: var(--space-5); }
.stab-btn { display: flex; align-items: center; gap: var(--space-2); padding: 7px 14px; border-radius: 8px; font-size: 12.5px; font-weight: 500; color: var(--text-muted); cursor: pointer; transition: all var(--dur-base) var(--ease-out); white-space: nowrap; }
.stab-btn:hover { color: var(--text-primary); }
.stab-btn.active { background: var(--bg-card); color: var(--text-primary); font-weight: 600; box-shadow: var(--shadow-sm); border: 1px solid var(--border-default); }
.stab-btn svg { width: 14px; height: 14px; }

/* ============================================================
   SETTINGS LAYOUT
   ============================================================ */
.settings-layout { display: grid; grid-template-columns: 1fr 340px; gap: var(--space-5); align-items: start; }
.settings-tab-panel { display: none; }
.settings-tab-panel.active { display: block; animation: page-enter var(--dur-base) var(--ease-out); }

.form-group { margin-bottom: var(--space-4); }
.form-label { display: block; font-size: 12px; font-weight: 600; color: var(--text-secondary); margin-bottom: var(--space-2); letter-spacing: 0.1px; }
.form-hint { font-size: 11px; color: var(--text-muted); margin-top: var(--space-1); line-height: 1.4; }

/* ============================================================
   BULK BAR
   ============================================================ */
.bulk-bar { background: var(--accent-primary); border-radius: var(--radius-md); padding: 12px 20px; display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); margin-bottom: var(--space-4); animation: slide-down var(--dur-base) var(--ease-out); box-shadow: var(--accent-glow); }
@keyframes slide-down { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
.bulk-bar span { color: #fff; font-weight: 600; font-size: 13px; }

/* ============================================================
   LANDING / LOGIN PAGE
   ============================================================ */
.landing-container { min-height: 100vh; background: var(--bg-base); display: flex; align-items: center; justify-content: center; padding: var(--space-8); position: relative; overflow: hidden; }
.landing-bg-glow { position: absolute; border-radius: var(--radius-full); filter: blur(80px); opacity: 0.08; pointer-events: none; }
.glow-1 { width: 600px; height: 600px; background: var(--accent-primary); top: -100px; right: -100px; }
.glow-2 { width: 400px; height: 400px; background: #22C55E; bottom: -80px; left: -80px; }
.landing-auth-wrapper { width: 100%; max-width: 420px; position: relative; z-index: 1; }
.landing-brand-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--space-8); }
.landing-brand-logo { display: flex; align-items: center; gap: var(--space-3); }
.landing-logo-icon { width: 38px; height: 38px; background: var(--accent-primary); border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; color: #fff; box-shadow: var(--accent-glow); }
.landing-logo-icon svg { width: 20px; height: 20px; }
.landing-logo-title { font-size: 18px; font-weight: 800; color: var(--text-primary); letter-spacing: -0.4px; }
.landing-card { background: var(--bg-card); border: 1px solid var(--border-default); border-radius: var(--radius-xl); padding: var(--space-8); box-shadow: var(--shadow-xl); }
.landing-card-title { font-size: 20px; font-weight: 700; color: var(--text-primary); margin-bottom: var(--space-1); letter-spacing: -0.3px; }
.landing-card-subtitle { font-size: 13px; color: var(--text-muted); margin-bottom: var(--space-6); }
.landing-features-pills { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-5); padding-top: var(--space-5); border-top: 1px solid var(--border-subtle); }
.pill-item { display: inline-flex; align-items: center; gap: var(--space-1); font-size: 11px; color: var(--text-muted); background: var(--bg-input); border: 1px solid var(--border-default); padding: 4px 10px; border-radius: var(--radius-full); }

/* ============================================================
   CMD+K SEARCH MODAL
   ============================================================ */
#cmd-k-modal { position: fixed; inset: 0; z-index: 900; display: none; align-items: flex-start; justify-content: center; padding-top: 10vh; background: rgba(0,0,0,0.5); backdrop-filter: blur(4px); }
#cmd-k-modal.open { display: flex; animation: overlay-in var(--dur-fast) var(--ease-out); }
.cmd-k-panel { background: var(--bg-modal); border: 1px solid var(--border-default); border-radius: var(--radius-xl); width: 100%; max-width: 560px; box-shadow: var(--shadow-xl); overflow: hidden; animation: modal-in var(--dur-base) var(--ease-out); }
.cmd-k-input-wrapper { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-4) var(--space-5); border-bottom: 1px solid var(--border-default); }
.cmd-k-input-wrapper svg { color: var(--text-muted); width: 18px; height: 18px; flex-shrink: 0; }
#cmd-k-input { flex: 1; background: none; border: none; font-size: 15px; color: var(--text-primary); outline: none; }
#cmd-k-input::placeholder { color: var(--text-muted); }
.cmd-k-results { padding: var(--space-2); max-height: 320px; overflow-y: auto; }
.cmd-k-result-item { display: flex; align-items: center; gap: var(--space-3); padding: 10px var(--space-3); border-radius: var(--radius-md); cursor: pointer; transition: background var(--dur-fast); font-size: 13px; color: var(--text-secondary); }
.cmd-k-result-item:hover, .cmd-k-result-item.selected { background: var(--bg-hover); color: var(--text-primary); }
.cmd-k-result-item svg { width: 16px; height: 16px; flex-shrink: 0; }
.cmd-k-footer { padding: var(--space-3) var(--space-5); border-top: 1px solid var(--border-subtle); display: flex; align-items: center; gap: var(--space-4); font-size: 11px; color: var(--text-muted); }

/* ============================================================
   NOTIFICATIONS DRAWER
   ============================================================ */
.notif-drawer { position: fixed; top: var(--topbar-height); right: 0; width: 360px; height: calc(100vh - var(--topbar-height)); background: var(--bg-modal); border-left: 1px solid var(--border-default); z-index: 150; display: flex; flex-direction: column; transform: translateX(100%); transition: transform var(--dur-slow) var(--ease-out); box-shadow: var(--shadow-xl); }
.notif-drawer.open { transform: translateX(0); }
.notif-drawer-header { display: flex; align-items: center; justify-content: space-between; padding: var(--space-5); border-bottom: 1px solid var(--border-default); }
.notif-drawer-title { font-size: 15px; font-weight: 700; color: var(--text-primary); }
.notif-list { flex: 1; overflow-y: auto; padding: var(--space-3); }
.notif-item { display: flex; gap: var(--space-3); padding: var(--space-3); border-radius: var(--radius-md); cursor: pointer; transition: background var(--dur-fast); margin-bottom: 2px; }
.notif-item:hover { background: var(--bg-hover); }
.notif-item.unread { background: var(--accent-muted); }
.notif-item-icon { width: 32px; height: 32px; border-radius: var(--radius-full); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.notif-item-icon svg { width: 15px; height: 15px; }
.notif-item-body { flex: 1; min-width: 0; }
.notif-item-title { font-size: 12.5px; font-weight: 600; color: var(--text-primary); margin-bottom: 2px; }
.notif-item-msg { font-size: 11.5px; color: var(--text-secondary); line-height: 1.4; }
.notif-item-time { font-size: 10px; color: var(--text-muted); margin-top: var(--space-1); }

/* ============================================================
   TOAST NOTIFICATIONS
   ============================================================ */
#toast-container { position: fixed; bottom: var(--space-6); right: var(--space-6); z-index: 9999; display: flex; flex-direction: column; gap: var(--space-3); pointer-events: none; }
.toast { display: flex; align-items: flex-start; gap: var(--space-3); background: var(--bg-modal); border: 1px solid var(--border-default); border-radius: var(--radius-lg); padding: 14px var(--space-4); min-width: 300px; max-width: 400px; box-shadow: var(--shadow-xl); pointer-events: auto; animation: toast-in var(--dur-base) var(--ease-out); border-left: 3px solid var(--toast-color, var(--accent-primary)); }
@keyframes toast-in { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: translateX(0); } }
.toast.toast-success { --toast-color: var(--success); }
.toast.toast-warning { --toast-color: var(--warning); }
.toast.toast-danger { --toast-color: var(--danger); }
.toast-icon { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; }
.toast-icon.success { color: var(--success); }
.toast-icon.warning { color: var(--warning); }
.toast-icon.error { color: var(--danger); }
.toast-body { flex: 1; min-width: 0; }
.toast-title { font-size: 13px; font-weight: 700; color: var(--text-primary); margin-bottom: 3px; }
.toast-msg { font-size: 12px; color: var(--text-secondary); line-height: 1.4; }
.toast-close { width: 20px; height: 20px; border-radius: var(--radius-sm); color: var(--text-muted); display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; transition: all var(--dur-fast); }
.toast-close:hover { background: var(--bg-hover); color: var(--text-primary); }
.toast-close svg { width: 14px; height: 14px; }

/* ============================================================
   STICKY BAR
   ============================================================ */
.sticky-bar { position: fixed; bottom: 0; left: var(--sidebar-width); right: 0; background: var(--bg-surface); border-top: 1px solid var(--border-default); padding: 12px var(--space-6); display: flex; align-items: center; justify-content: space-between; z-index: 80; transition: left var(--dur-slow) var(--ease-out); backdrop-filter: blur(8px); }
.sticky-bar.collapsed { left: var(--sidebar-collapsed); }
.sticky-bar-stats { display: flex; gap: var(--space-6); font-size: 12.5px; font-weight: 600; }
.sticky-bar-stat { display: flex; align-items: center; gap: var(--space-2); color: var(--text-secondary); }
.sticky-bar-stat strong { color: var(--text-primary); }
.sticky-bar-stat.success strong { color: var(--success); }
.sticky-bar-stat.danger strong { color: var(--danger); }
.sticky-bar-stat.warning strong { color: var(--warning); }

/* ============================================================
   ICON BUTTONS
   ============================================================ */
.icon-btn { width: 28px; height: 28px; border-radius: var(--radius-sm); background: transparent; color: var(--text-muted); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; transition: all var(--dur-fast); border: 1px solid transparent; }
.icon-btn:hover { background: var(--bg-hover); color: var(--text-primary); border-color: var(--border-default); }
.icon-btn svg { width: 14px; height: 14px; }
.icon-btn-danger:hover { background: var(--danger-muted); color: var(--danger); border-color: var(--danger-border); }
.icon-btn-success:hover { background: var(--success-muted); color: var(--success); border-color: var(--success-border); }
.icon-btn-accent:hover { background: var(--accent-muted); color: var(--accent-primary); border-color: var(--accent-border); }

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: var(--space-16) var(--space-8); color: var(--text-muted); text-align: center; }
.empty-state-icon { width: 52px; height: 52px; border-radius: var(--radius-xl); background: var(--bg-elevated); border: 1px solid var(--border-default); display: flex; align-items: center; justify-content: center; margin-bottom: var(--space-4); }
.empty-state-icon svg { width: 24px; height: 24px; color: var(--text-muted); }
.empty-state h4 { font-size: 15px; font-weight: 600; color: var(--text-secondary); margin-bottom: var(--space-2); }
.empty-state p { font-size: 13px; color: var(--text-muted); max-width: 280px; line-height: 1.5; }

/* ============================================================
   REPORT CARDS
   ============================================================ */
.report-card { background: var(--bg-card); border: 1px solid var(--border-default); border-radius: var(--radius-lg); padding: var(--space-5); transition: all var(--dur-base) var(--ease-out); display: flex; flex-direction: column; gap: var(--space-3); }
.report-card:hover { border-color: var(--border-emphasis); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.report-card-icon { width: 40px; height: 40px; border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; }
.report-card-icon svg { width: 20px; height: 20px; }
.report-card h4 { font-size: 14px; font-weight: 700; color: var(--text-primary); }
.report-card p { font-size: 12px; color: var(--text-muted); line-height: 1.5; flex: 1; }

/* ============================================================
   AUTO BACKLINK MODAL STYLES
   ============================================================ */
.ab-modal-panel { max-width: 820px; width: 100%; }
.ab-mode-card { background: var(--bg-elevated); border: 1.5px solid var(--border-default); border-radius: var(--radius-md); padding: var(--space-4); cursor: pointer; transition: all var(--dur-base) var(--ease-out); display: flex; align-items: flex-start; gap: var(--space-3); }
.ab-mode-card:hover { border-color: var(--border-emphasis); }
.ab-mode-card.selected { border-color: var(--accent-primary); background: var(--accent-muted); }
.ab-mode-card .mode-icon { width: 36px; height: 36px; border-radius: var(--radius-md); background: var(--bg-card); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.ab-mode-card .mode-icon svg { width: 18px; height: 18px; }
.ab-mode-card h4 { font-size: 13px; font-weight: 700; color: var(--text-primary); margin-bottom: 3px; }
.ab-mode-card p { font-size: 11.5px; color: var(--text-muted); line-height: 1.4; }

.step-indicator { display: flex; align-items: center; gap: var(--space-2); margin-bottom: var(--space-5); }
.step-dot { width: 8px; height: 8px; border-radius: var(--radius-full); background: var(--border-emphasis); transition: all var(--dur-base); }
.step-dot.active { background: var(--accent-primary); transform: scale(1.3); }
.step-dot.done { background: var(--success); }
.step-line { flex: 1; height: 1px; background: var(--border-default); }

/* CF Status Banner */
.cf-status-banner { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--space-4); background: var(--success-muted); border: 1px solid var(--success-border); border-radius: var(--radius-md); margin: var(--space-3) 0; }
.cf-status-banner svg { color: var(--success); width: 16px; height: 16px; flex-shrink: 0; }
.cf-status-banner span { font-size: 12.5px; font-weight: 600; color: var(--success); }

/* ============================================================
   TEXT UTILITIES
   ============================================================ */
.text-success { color: var(--success) !important; }
.text-warning { color: var(--warning) !important; }
.text-danger { color: var(--danger) !important; }
.text-accent { color: var(--accent-primary) !important; }
.text-muted { color: var(--text-muted) !important; }
.text-secondary { color: var(--text-secondary) !important; }
.font-mono { font-family: var(--font-mono) !important; }
.font-bold { font-weight: 700 !important; }
.font-semibold { font-weight: 600 !important; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

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

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.5; } }
.animate-pulse { animation: pulse 2s ease-in-out infinite; }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.animate-spin { animation: spin 1s linear infinite; }
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ============================================================
   USER DROPDOWN POPOVER (standalone styling)
   ============================================================ */
.user-dropdown-popover {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  width: 230px;
  box-shadow: var(--shadow-xl);
  z-index: 500;
  overflow: hidden;
  animation: slideDown var(--dur-base) var(--ease-out);
}

/* ============================================================
   RESPONSIVE — MOBILE FIRST
   ============================================================ */
@media (max-width: 1200px) {
  .kpi-grid { grid-template-columns: repeat(3,1fr); }
  .bento-grid { grid-template-columns: repeat(2,1fr); }
  .settings-layout { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  /* Mobile sidebar slides in from left */
  .sidebar {
    transform: translateX(-100%);
    z-index: 300;
    position: fixed;
    top: 0;
    left: 0;
    height: 100dvh;
  }
  .sidebar.open,
  .sidebar.mobile-open {
    transform: translateX(0);
    box-shadow: var(--shadow-xl);
  }
  .main-wrapper { margin-left: 0 !important; }
  .sticky-bar { left: 0 !important; }
  .mobile-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 250;
    display: none;
    backdrop-filter: blur(3px);
    animation: fadeIn 200ms ease;
  }
  .mobile-overlay.open { display: block; }
  .kpi-grid { grid-template-columns: repeat(2,1fr); }
  .bento-grid { grid-template-columns: 1fr; }
  .span-2, .span-3, .span-4 { grid-column: span 1; }
  .topbar { padding: 0 var(--space-4); }
  .content-container { padding: var(--space-4); }
  .search-trigger { display: none; }
  .page-breadcrumb { display: none; }
  .page-header-flex { flex-direction: column; }
  .filter-bar { flex-direction: column; align-items: stretch; }
  .filter-bar .input-text, .filter-bar .select-input { max-width: 100%; }
}

@media (max-width: 600px) {
  .kpi-grid { grid-template-columns: repeat(2,1fr); gap: var(--space-3); }
  .topbar-right .user-name { display: none; }
  .topbar-right .btn-primary span { display: none; }
  .table-toolbar { flex-direction: column; align-items: stretch; }
  .tabs-segmented { flex-wrap: wrap; }
}

@media print {
  .sidebar, .topbar, .sticky-bar, .modal-overlay, #toast-container { display: none !important; }
  .main-wrapper { margin-left: 0 !important; }
  .content-container { padding: 0; }
}

