/* ══════════════════════════════════════════════════════
   Simple CRM — Futuristic Glassmorphic Design System
   ══════════════════════════════════════════════════════ */

/* ── CSS Variables (Dark Theme = Default) ────────────── */
:root {
  --bg-primary: #0a0a1a;
  --bg-secondary: #111128;
  --bg-gradient: linear-gradient(135deg, #0f0c29 0%, #302b63 50%, #24243e 100%);
  --bg-mesh: radial-gradient(at 20% 80%, rgba(102,126,234,0.08) 0%, transparent 50%),
             radial-gradient(at 80% 20%, rgba(118,75,162,0.06) 0%, transparent 50%),
             radial-gradient(at 50% 50%, rgba(240,147,251,0.04) 0%, transparent 50%);
  --glass-bg: rgba(255, 255, 255, 0.04);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  --glass-shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.6);
  --text-primary: #eaeaf0;
  --text-secondary: #b0b0c8;
  --text-muted: #666688;
  --accent: #8b9cf7;
  --accent-hover: #a0aff9;
  --accent-rgb: 139, 156, 247;
  --accent-light: rgba(139, 156, 247, 0.12);
  --accent-glow: 0 0 30px rgba(139, 156, 247, 0.25);
  --accent-gradient: linear-gradient(135deg, #667eea 0%, #9b59b6 100%);
  --danger: #ef5350;
  --danger-hover: #d32f2f;
  --success: #4caf50;
  --success-glow: rgba(76,175,80,0.3);
  --warning: #ff9800;
  --info: #42a5f5;
  --card-radius: 20px;
  --input-bg: rgba(255,255,255,0.06);
  --input-border: rgba(255,255,255,0.1);
  --option-bg: #1a1a2e;
  --sidebar-bg: rgba(255, 255, 255, 0.03);
  --sidebar-active: rgba(139, 156, 247, 0.15);
  --table-hover: rgba(139, 156, 247, 0.08);
  --glow-soft: 0 0 60px rgba(139, 156, 247, 0.06);
  --transition-smooth: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="light"] {
  --bg-primary: #e8ecf4;
  --bg-secondary: #f0f2f8;
  --bg-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
  --bg-mesh: radial-gradient(at 20% 80%, rgba(102,126,234,0.15) 0%, transparent 50%),
             radial-gradient(at 80% 20%, rgba(118,75,162,0.12) 0%, transparent 50%),
             radial-gradient(at 50% 50%, rgba(240,147,251,0.08) 0%, transparent 50%);
  --glass-bg: rgba(255, 255, 255, 0.42);
  --glass-border: rgba(255, 255, 255, 0.55);
  --glass-shadow: 0 8px 32px rgba(31, 38, 135, 0.12);
  --glass-shadow-lg: 0 16px 48px rgba(31, 38, 135, 0.18);
  --text-primary: #1a1a2e;
  --text-secondary: #3d3d5c;
  --text-muted: #8888aa;
  --accent: #667eea;
  --accent-hover: #5a6fd6;
  --accent-rgb: 102, 126, 234;
  --accent-light: rgba(102, 126, 234, 0.12);
  --accent-glow: 0 0 20px rgba(102, 126, 234, 0.3);
  --accent-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --input-bg: rgba(255,255,255,0.55);
  --input-border: rgba(0,0,0,0.08);
  --option-bg: #f0f2f8;
  --sidebar-bg: rgba(255, 255, 255, 0.25);
  --sidebar-active: rgba(102, 126, 234, 0.15);
  --table-hover: rgba(102, 126, 234, 0.06);
  --glow-soft: 0 0 40px rgba(102, 126, 234, 0.08);
}

/* ── Reset & Base ────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  transition: background 0.5s ease, color 0.5s ease;
  overflow-x: hidden;
}

/* Animated mesh background */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg-mesh);
  z-index: -1;
  animation: meshFloat 20s ease-in-out infinite alternate;
}

@keyframes meshFloat {
  0% { opacity: 0.7; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.05); }
  100% { opacity: 0.8; transform: scale(1); }
}

a { color: var(--accent); text-decoration: none; transition: color 0.2s ease; }
a:hover { color: var(--accent-hover); }

/* ── Glassmorphic Card ───────────────────────────────── */
.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--glass-border);
  border-radius: var(--card-radius);
  box-shadow: var(--glass-shadow);
  transition: var(--transition-smooth);
}

.glass:hover {
  box-shadow: var(--glass-shadow-lg);
}

/* ── Layout ──────────────────────────────────────────── */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ─────────────────────────────────────────── */
.sidebar {
  width: 260px;
  background: var(--sidebar-bg);
  backdrop-filter: blur(30px) saturate(180%);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  border-right: 1px solid var(--glass-border);
  padding: 0;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-brand {
  padding: 24px 28px 20px;
  font-size: 1.3rem;
  font-weight: 800;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.5px;
  position: relative;
}

.sidebar-brand::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 28px;
  right: 28px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--glass-border), transparent);
}

.sidebar-brand .brand-icon {
  display: inline-block;
  margin-right: 4px;
  filter: drop-shadow(0 0 8px rgba(var(--accent-rgb), 0.5));
  animation: brandGlow 3s ease-in-out infinite;
}

@keyframes brandGlow {
  0%, 100% { filter: drop-shadow(0 0 8px rgba(var(--accent-rgb), 0.5)); }
  50% { filter: drop-shadow(0 0 16px rgba(var(--accent-rgb), 0.8)); }
}

.sidebar-brand small {
  display: block;
  font-size: 0.68rem;
  font-weight: 500;
  -webkit-text-fill-color: var(--text-muted);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-top: 4px;
}

/* Overdue badge */
.overdue-badge {
  background: linear-gradient(135deg, #ef5350, #d32f2f);
  color: white;
  border-radius: 10px;
  padding: 1px 7px;
  font-size: 0.68rem;
  margin-left: 4px;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(239, 83, 80, 0.4);
  animation: badgePulse 2s ease-in-out infinite;
}

@keyframes badgePulse {
  0%, 100% { box-shadow: 0 2px 8px rgba(239, 83, 80, 0.4); }
  50% { box-shadow: 0 2px 16px rgba(239, 83, 80, 0.7); }
}

.sidebar-nav {
  flex: 1;
  padding: 8px 0;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(var(--accent-rgb), 0.15) transparent;
}

.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(var(--accent-rgb), 0.15); border-radius: 4px; }

/* Section labels */
.nav-section-label {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  padding: 16px 28px 6px;
  margin-top: 4px;
  position: relative;
}

.nav-section-label::before {
  content: '';
  position: absolute;
  top: 8px;
  left: 28px;
  right: 28px;
  height: 1px;
  background: linear-gradient(90deg, var(--glass-border), transparent);
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 28px;
  color: var(--text-secondary);
  font-size: 0.84rem;
  font-weight: 500;
  transition: var(--transition-smooth);
  border-left: 3px solid transparent;
  position: relative;
}

.sidebar-nav a:hover {
  background: var(--sidebar-active);
  color: var(--accent);
  border-left-color: rgba(var(--accent-rgb), 0.4);
}

.sidebar-nav a.active {
  background: var(--sidebar-active);
  color: var(--accent);
  border-left-color: var(--accent);
  font-weight: 600;
}

.sidebar-nav a.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 60%;
  background: var(--accent-gradient);
  border-radius: 0 4px 4px 0;
  box-shadow: var(--accent-glow);
}

/* nav-icon class kept for backwards compat, SVG icons handle styling */
.sidebar-nav .nav-icon {
  width: 22px;
  text-align: center;
  font-size: 1.15rem;
  filter: drop-shadow(0 0 4px rgba(var(--accent-rgb), 0.1));
}

.sidebar-footer {
  padding: 18px 24px;
  border-top: 1px solid var(--glass-border);
  background: rgba(var(--accent-rgb), 0.03);
}

.sidebar-footer .user-info {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.user-avatar {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--accent-gradient);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  box-shadow: 0 4px 12px rgba(var(--accent-rgb), 0.3);
}

.user-meta { font-size: 0.8rem; }
.user-meta .name { font-weight: 600; color: var(--text-primary); }
.user-meta .role { color: var(--text-muted); font-size: 0.7rem; margin-top: 1px; }

/* ── Main Content ────────────────────────────────────── */
.main-content {
  flex: 1;
  margin-left: 260px;
  padding: 36px 40px;
  min-height: 100vh;
}

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

.page-header h1 {
  font-size: 1.65rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}

/* ── Buttons ─────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border: none;
  border-radius: 12px;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
  text-decoration: none;
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.15), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.btn:hover::after { opacity: 1; }

.btn-primary {
  background: var(--accent-gradient);
  color: white;
  box-shadow: 0 4px 15px rgba(var(--accent-rgb), 0.35);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(var(--accent-rgb), 0.45);
  color: white;
}

.btn-danger {
  background: linear-gradient(135deg, #ef5350, #d32f2f);
  color: white;
  box-shadow: 0 4px 15px rgba(239,83,80,0.3);
}
.btn-danger:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(239,83,80,0.4);
  color: white;
}

.btn-ghost {
  background: var(--glass-bg);
  color: var(--text-secondary);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(10px);
}
.btn-ghost:hover {
  background: var(--accent-light);
  color: var(--accent);
  border-color: rgba(var(--accent-rgb), 0.3);
  transform: translateY(-1px);
}

.btn-sm {
  padding: 7px 14px;
  font-size: 0.76rem;
  border-radius: 10px;
}

/* ── Stat Cards ──────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  padding: 24px 20px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--accent-gradient);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.stat-card:hover::before { opacity: 1; }

.stat-card .stat-icon {
  font-size: 1.6rem;
  margin-bottom: 10px;
  opacity: 0.5;
  filter: drop-shadow(0 0 6px rgba(var(--accent-rgb), 0.15));
}

.stat-card .stat-value {
  font-size: 2.2rem;
  font-weight: 800;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.1;
}

.stat-card .stat-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 8px;
  font-weight: 600;
}

/* Staggered stat card animation */
.stat-card {
  animation: statReveal 0.5s cubic-bezier(0.4, 0, 0.2, 1) backwards;
  animation-delay: var(--stat-delay, 0s);
}

@keyframes statReveal {
  from { opacity: 0; transform: translateY(16px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── Tables ──────────────────────────────────────────── */
.table-wrapper {
  overflow-x: auto;
  padding: 0;
}

table {
  width: 100%;
  border-collapse: collapse;
}

table th {
  text-align: left;
  padding: 14px 18px;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--glass-border);
  font-weight: 700;
}

table td {
  padding: 14px 18px;
  font-size: 0.87rem;
  border-bottom: 1px solid rgba(var(--accent-rgb), 0.05);
  color: var(--text-secondary);
  transition: background 0.2s ease;
}

table tr {
  transition: var(--transition-smooth);
}

table tr:hover td {
  background: var(--table-hover);
}

table tr:last-child td { border-bottom: none; }

td.actions {
  white-space: nowrap;
}

/* ── Forms ────────────────────────────────────────────── */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-control {
  width: 100%;
  padding: 12px 16px;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 12px;
  color: var(--text-primary);
  font-size: 0.9rem;
  transition: var(--transition-smooth);
  font-family: inherit;
  backdrop-filter: blur(10px);
}

.form-control:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(var(--accent-rgb), 0.12), var(--accent-glow);
  background: var(--input-bg);
}

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
  cursor: pointer;
}

select.form-control option {
  background: #1a1a2e;
  color: #eaeaf0;
  padding: 8px 12px;
  border: none;
}

select.form-control option:checked,
select.form-control option:hover {
  background: #667eea;
  color: #fff;
}

select.form-control optgroup {
  background: #1a1a2e;
  color: #b0b0c8;
}

[data-theme="light"] select.form-control option {
  background: #f0f2f8;
  color: #1a1a2e;
}

[data-theme="light"] select.form-control option:checked,
[data-theme="light"] select.form-control option:hover {
  background: #667eea;
  color: #fff;
}

[data-theme="light"] select.form-control optgroup {
  background: #f0f2f8;
  color: #3d3d5c;
}

textarea.form-control { resize: vertical; min-height: 90px; }

/* ── Badges ──────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  backdrop-filter: blur(4px);
}

.badge-qualified { background: rgba(66,165,245,0.15); color: #42a5f5; }
.badge-proposal { background: rgba(255,152,0,0.15); color: #ff9800; }
.badge-lost { background: rgba(239,83,80,0.15); color: #ef5350; }

.badge-active { background: rgba(76,175,80,0.15); color: #4caf50; border: 1px solid rgba(76,175,80,0.2); }
.badge-inactive { background: rgba(239,83,80,0.15); color: #ef5350; border: 1px solid rgba(239,83,80,0.2); }
.badge-interaction { background: rgba(var(--accent-rgb),0.12); color: var(--accent); border: 1px solid rgba(var(--accent-rgb),0.2); }

.tag-badge { display:inline-block; padding:2px 10px; border-radius:12px; font-size:0.8rem; font-weight:500; }

/* ── Flash Messages ──────────────────────────────────── */
.flash-messages {
  margin-bottom: 24px;
}

.alert {
  padding: 14px 20px;
  border-radius: 14px;
  font-size: 0.87rem;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  backdrop-filter: blur(12px);
  animation: slideDown 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-12px); }
  to { opacity: 1; transform: translateY(0); }
}

.alert-success { background: rgba(76,175,80,0.12); color: #4caf50; border: 1px solid rgba(76,175,80,0.25); }
.alert-danger  { background: rgba(239,83,80,0.12); color: #ef5350; border: 1px solid rgba(239,83,80,0.25); }
.alert-warning { background: rgba(255,152,0,0.12); color: #ff9800; border: 1px solid rgba(255,152,0,0.25); }
.alert-info    { background: rgba(66,165,245,0.12); color: #42a5f5; border: 1px solid rgba(66,165,245,0.25); }

.alert-close {
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  font-size: 1.2rem;
  opacity: 0.6;
  transition: opacity 0.2s;
}
.alert-close:hover { opacity: 1; }

/* ── Theme Toggle ────────────────────────────────────── */
.theme-toggle {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.1rem;
  color: var(--text-secondary);
  transition: var(--transition-smooth);
  backdrop-filter: blur(10px);
}

.theme-toggle:hover {
  background: var(--accent-light);
  color: var(--accent);
  transform: rotate(20deg);
  box-shadow: var(--accent-glow);
}

/* ── Search Bar ──────────────────────────────────────── */
.search-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 24px;
  align-items: center;
}

.search-bar .form-control {
  max-width: 320px;
}

/* ── Detail Page ─────────────────────────────────────── */
.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
}

.detail-item {
  position: relative;
}

.detail-item label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  display: block;
  margin-bottom: 6px;
  font-weight: 700;
}

.detail-item .value {
  font-size: 0.95rem;
  color: var(--text-primary);
  font-weight: 500;
}

/* ── Login Page — Split Layout ─────────────────────────── */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  position: relative;
  overflow: hidden;
  background: var(--bg-primary);
}

.login-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  pointer-events: none;
}

.login-orb-1 {
  width: 500px; height: 500px;
  background: var(--accent-gradient);
  opacity: 0.3;
  top: -120px; right: -80px;
  animation: loginOrb1 8s ease-in-out infinite alternate;
}

.login-orb-2 {
  width: 400px; height: 400px;
  background: linear-gradient(135deg, #f093fb, #f5576c);
  opacity: 0.2;
  bottom: -100px; left: -80px;
  animation: loginOrb2 10s ease-in-out infinite alternate;
}

.login-orb-3 {
  width: 300px; height: 300px;
  background: linear-gradient(135deg, #43e97b, #38f9d7);
  opacity: 0.12;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  animation: loginOrb3 12s ease-in-out infinite alternate;
}

@keyframes loginOrb1 {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(-60px, 60px) scale(1.15); }
}
@keyframes loginOrb2 {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(40px, -50px) scale(1.1); }
}
@keyframes loginOrb3 {
  0% { transform: translate(-50%, -50%) scale(1); opacity: 0.12; }
  50% { transform: translate(-40%, -60%) scale(1.2); opacity: 0.18; }
  100% { transform: translate(-60%, -40%) scale(0.9); opacity: 0.1; }
}

/* Split container */
.login-split {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 40px;
  max-width: 1100px;
  width: 100%;
  padding: 40px;
  position: relative;
  z-index: 1;
  align-items: center;
}

/* Left hero */
.login-hero { padding: 20px 10px 20px 0; }

.login-hero-inner {
  animation: heroSlideIn 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}
@keyframes heroSlideIn {
  from { opacity: 0; transform: translateX(-30px); }
  to { opacity: 1; transform: translateX(0); }
}

.login-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent-light);
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 6px 14px;
  border-radius: 100px;
  border: 1px solid rgba(var(--accent-rgb), 0.2);
  margin-bottom: 20px;
}

.login-hero-title {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.2;
  color: var(--text-primary);
  margin-bottom: 16px;
}

.login-hero-accent {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.login-hero-subtitle {
  font-size: 0.92rem;
  line-height: 1.65;
  color: var(--text-muted);
  margin-bottom: 28px;
  max-width: 460px;
}

/* Feature list */
.login-features {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 28px;
}

.login-feature {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 11px 14px;
  border-radius: 14px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  transition: var(--transition-smooth);
  animation: featSlideIn 0.5s cubic-bezier(0.4, 0, 0.2, 1) backwards;
  animation-delay: var(--feat-delay, 0s);
}

@keyframes featSlideIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.login-feature:hover {
  background: var(--accent-light);
  border-color: rgba(var(--accent-rgb), 0.25);
  transform: translateX(4px);
}

.login-feature-icon {
  flex-shrink: 0;
  width: 36px; height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: var(--accent-gradient);
  color: #fff;
  box-shadow: 0 4px 12px rgba(var(--accent-rgb), 0.25);
}

.login-feature-icon svg { color: #fff; }

.login-feature-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.login-feature-desc {
  font-size: 0.74rem;
  color: var(--text-muted);
  line-height: 1.45;
}

/* Stats bar */
.login-hero-stats {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  border-radius: 14px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
}

.login-hero-stat { flex: 1; text-align: center; }

.login-hero-stat-value {
  display: block;
  font-size: 1.15rem;
  font-weight: 800;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.login-hero-stat-label {
  display: block;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  font-weight: 600;
  margin-top: 2px;
}

.login-hero-stat-divider {
  width: 1px;
  height: 32px;
  background: var(--glass-border);
  flex-shrink: 0;
}

/* Right form panel */
.login-form-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-card {
  width: 100%;
  max-width: 420px;
  padding: 48px 40px;
  position: relative;
  z-index: 1;
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow-lg), var(--glow-soft);
  animation: cardFloat 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes cardFloat {
  from { opacity: 0; transform: translateY(30px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.login-logo {
  text-align: center;
  font-size: 2.5rem;
  margin-bottom: 8px;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 12px rgba(var(--accent-rgb), 0.4));
  animation: logoPulse 3s ease-in-out infinite;
}

@keyframes logoPulse {
  0%, 100% { filter: drop-shadow(0 0 12px rgba(var(--accent-rgb), 0.4)); }
  50% { filter: drop-shadow(0 0 24px rgba(var(--accent-rgb), 0.6)); }
}

.login-card h1 {
  text-align: center;
  font-size: 1.7rem;
  font-weight: 800;
  margin-bottom: 6px;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.login-card .subtitle {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 36px;
}

.login-card .btn-primary {
  width: 100%;
  padding: 14px;
  font-size: 0.95rem;
  justify-content: center;
  border-radius: 14px;
  margin-top: 8px;
}

.login-card-footer {
  text-align: center;
  margin-top: 24px;
}

.btn-glow { position: relative; }

.btn-glow::before {
  content: '';
  position: absolute;
  inset: -2px;
  background: var(--accent-gradient);
  border-radius: inherit;
  z-index: -1;
  opacity: 0;
  filter: blur(12px);
  transition: opacity 0.4s ease;
}

.btn-glow:hover::before { opacity: 0.6; }

.remember-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* Custom checkbox */
.remember-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  border-radius: 4px;
}

/* ── Actions row ─────────────────────────────────────── */
.actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

/* ── Form Card ───────────────────────────────────────── */
.form-card {
  padding: 32px;
  max-width: 640px;
  box-shadow: var(--glass-shadow-lg);
}

@media (max-width: 640px) {
  .form-card { padding: 18px; }
  .form-actions { flex-direction: column; }
  .form-actions .btn { width: 100%; }
}

.form-actions {
  display: flex;
  gap: 12px;
  margin-top: 28px;
}

/* ── Section title ───────────────────────────────────── */
.section-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title::before {
  content: '';
  width: 4px;
  height: 18px;
  background: var(--accent-gradient);
  border-radius: 2px;
  display: inline-block;
}

/* ── Settings Page ───────────────────────────────────── */
.settings-section {
  padding: 28px;
  margin-bottom: 24px;
}

.settings-section h3 {
  font-size: 1.05rem;
  margin-bottom: 18px;
  color: var(--text-primary);
  font-weight: 700;
}

.db-type-selector {
  display: flex;
  gap: 14px;
  margin-bottom: 24px;
}

.db-type-option {
  flex: 1;
  padding: 20px;
  border-radius: 16px;
  border: 2px solid var(--input-border);
  cursor: pointer;
  text-align: center;
  transition: var(--transition-smooth);
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
}

.db-type-option:hover {
  border-color: rgba(var(--accent-rgb), 0.3);
  transform: translateY(-2px);
}

.db-type-option.selected {
  border-color: var(--accent);
  background: var(--accent-light);
  box-shadow: var(--accent-glow);
}

.db-type-option .db-icon { font-size: 1.6rem; margin-bottom: 8px; }
.db-type-option .db-name { font-weight: 700; font-size: 0.9rem; }

.pg-fields { display: none; }
.pg-fields.visible { display: block; }

/* ── Empty State ─────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 64px 24px;
  color: var(--text-muted);
}

.empty-state .empty-icon {
  font-size: 3.5rem;
  margin-bottom: 16px;
  filter: grayscale(0.3);
}

.empty-state p { font-size: 0.95rem; line-height: 1.6; }

/* ── Mobile hamburger ────────────────────────────────── */
.mobile-toggle {
  display: none;
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 200;
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 10px 14px;
  cursor: pointer;
  font-size: 1.2rem;
  color: var(--text-primary);
  box-shadow: var(--glass-shadow);
  transition: var(--transition-smooth);
}

.mobile-toggle:hover {
  background: var(--accent-light);
  color: var(--accent);
}

/* ── Help Page — Tab Navigation ──────────────────────── */
.docs-tab-nav {
  display: flex;
  gap: 6px;
  padding: 6px;
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  margin-bottom: 28px;
  overflow-x: auto;
}

.docs-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border: none;
  border-radius: 12px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
  background: transparent;
  color: var(--text-muted);
  white-space: nowrap;
  position: relative;
}

.docs-tab-btn:hover {
  color: var(--accent);
  background: var(--accent-light);
}

.docs-tab-btn.active {
  background: var(--accent-gradient);
  color: white;
  box-shadow: 0 4px 15px rgba(var(--accent-rgb), 0.35);
}

.docs-tab-btn .icon { width: 16px; height: 16px; }
.docs-tab-btn.active .icon { filter: brightness(10); }

.docs-tab-panel {
  display: none;
  animation: docsFadeIn 0.4s ease-out;
}

.docs-tab-panel.active { display: block; }

@keyframes docsFadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Help Page — Manual Cards ────────────────────────── */
.manual-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.manual-card {
  padding: 24px;
  border-radius: 16px;
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  transition: var(--transition-smooth);
  position: relative;
  overflow: hidden;
  animation: manualCardIn 0.4s ease-out both;
  animation-delay: var(--card-delay, 0s);
}

.manual-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--accent-gradient);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.manual-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--glass-shadow-lg);
  border-color: rgba(var(--accent-rgb), 0.2);
}

.manual-card:hover::before { opacity: 1; }

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

.manual-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.manual-card-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--accent-light);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  flex-shrink: 0;
  transition: var(--transition-smooth);
}

.manual-card:hover .manual-card-icon {
  background: var(--accent-gradient);
  color: white;
  box-shadow: 0 4px 12px rgba(var(--accent-rgb), 0.3);
}

.manual-card-icon .icon { width: 20px; height: 20px; }

.manual-card h4 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.manual-card p, .manual-card li {
  font-size: 0.84rem;
  color: var(--text-secondary);
  line-height: 1.75;
}

.manual-card ul, .manual-card ol {
  padding-left: 18px;
  margin-top: 8px;
}

.manual-card li {
  margin-bottom: 4px;
  position: relative;
}

.manual-card ul li::marker {
  color: var(--accent);
}

.manual-card ol li::marker {
  color: var(--accent);
  font-weight: 700;
}

/* ── Help Page — Feature Intro Banner ────────────────── */
.docs-hero {
  padding: 32px;
  border-radius: var(--card-radius);
  background: var(--accent-gradient);
  color: white;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}

.docs-hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  animation: heroFloat 6s ease-in-out infinite alternate;
}

.docs-hero::after {
  content: '';
  position: absolute;
  bottom: -30%;
  left: -10%;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: rgba(255,255,255,0.05);
  animation: heroFloat 8s ease-in-out infinite alternate-reverse;
}

@keyframes heroFloat {
  from { transform: translate(0, 0); }
  to { transform: translate(20px, -20px); }
}

.docs-hero h2 {
  font-size: 1.4rem;
  font-weight: 800;
  margin-bottom: 8px;
  position: relative;
  z-index: 1;
}

.docs-hero p {
  font-size: 0.9rem;
  opacity: 0.9;
  line-height: 1.7;
  position: relative;
  z-index: 1;
  max-width: 600px;
}

/* ── Help Page — FAQ Accordion ───────────────────────── */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.faq-item {
  border-radius: 14px;
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  overflow: hidden;
  transition: var(--transition-smooth);
}

.faq-item:hover {
  border-color: rgba(var(--accent-rgb), 0.2);
}

.faq-item.open {
  border-color: rgba(var(--accent-rgb), 0.3);
  box-shadow: 0 4px 20px rgba(var(--accent-rgb), 0.1);
}

.faq-question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 18px 22px;
  border: none;
  background: transparent;
  cursor: pointer;
  text-align: left;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  font-family: inherit;
  transition: color 0.2s ease;
}

.faq-question:hover { color: var(--accent); }

.faq-question .faq-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--accent-light);
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 700;
  flex-shrink: 0;
}

.faq-item.open .faq-num {
  background: var(--accent-gradient);
  color: white;
}

.faq-chevron {
  flex-shrink: 0;
  transition: transform 0.3s ease;
  color: var(--text-muted);
}

.faq-item.open .faq-chevron {
  transform: rotate(180deg);
  color: var(--accent);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1), padding 0.35s ease;
  padding: 0 22px;
}

.faq-item.open .faq-answer {
  max-height: 500px;
  padding: 0 22px 18px;
}

.faq-answer p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.8;
  margin: 0;
  padding-left: 38px;
}

.faq-answer code {
  background: var(--accent-light);
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
}

/* ── Help Page — Tips Cards ──────────────────────────── */
.tips-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.tip-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 18px;
  border-radius: 14px;
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  transition: var(--transition-smooth);
  animation: manualCardIn 0.35s ease-out both;
  animation-delay: var(--card-delay, 0s);
}

.tip-card:hover {
  transform: translateY(-2px);
  border-color: rgba(var(--accent-rgb), 0.2);
  box-shadow: var(--glass-shadow);
}

.tip-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--accent-light);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--accent);
}

.tip-icon .icon { width: 18px; height: 18px; }

.tip-content label {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.tip-content .value {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ── Help Page — Roles Table ─────────────────────────── */
.roles-table-wrap {
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--glass-border);
}

.roles-table-wrap table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
}

.roles-table-wrap thead {
  background: var(--accent-gradient);
}

.roles-table-wrap thead th {
  padding: 14px 16px;
  font-weight: 600;
  color: white;
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 1px;
  text-align: center;
  border: none;
}

.roles-table-wrap thead th:first-child {
  text-align: left;
}

.roles-table-wrap tbody tr {
  border-bottom: 1px solid var(--glass-border);
  transition: background 0.2s ease;
}

.roles-table-wrap tbody tr:last-child { border-bottom: none; }

.roles-table-wrap tbody tr:hover {
  background: var(--table-hover);
}

.roles-table-wrap tbody td {
  padding: 14px 16px;
  text-align: center;
  border: none;
}

.roles-table-wrap tbody td:first-child {
  text-align: left;
  font-weight: 700;
}

.perm-full {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  background: rgba(76,175,80,0.12);
  color: var(--success);
  font-weight: 600;
  font-size: 0.76rem;
}

.perm-view {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  background: rgba(66,165,245,0.12);
  color: var(--info);
  font-weight: 600;
  font-size: 0.76rem;
}

.perm-none {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  background: rgba(136,136,170,0.08);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.76rem;
}

/* ── Roadmap Page ────────────────────────────────────── */
.roadmap-hero {
  padding: 28px 32px;
  border-radius: var(--card-radius);
  background: var(--accent-gradient);
  color: white;
  margin-bottom: 28px;
  position: relative;
  overflow: hidden;
}

.roadmap-hero::before {
  content: '';
  position: absolute;
  top: -40%;
  right: -15%;
  width: 350px;
  height: 350px;
  border-radius: 50%;
  background: rgba(255,255,255,0.07);
}

.roadmap-hero h3 {
  font-size: 1.25rem;
  font-weight: 800;
  margin-bottom: 6px;
  position: relative;
  z-index: 1;
}

.roadmap-hero p {
  font-size: 0.85rem;
  opacity: 0.9;
  position: relative;
  z-index: 1;
}

.roadmap-stats {
  display: flex;
  gap: 24px;
  margin-top: 16px;
  position: relative;
  z-index: 1;
}

.roadmap-stat {
  text-align: center;
}

.roadmap-stat-value {
  font-size: 1.6rem;
  font-weight: 800;
  display: block;
}

.roadmap-stat-label {
  font-size: 0.7rem;
  opacity: 0.8;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.roadmap-version {
  margin-bottom: 28px;
}

.roadmap-version-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid rgba(var(--accent-rgb), 0.15);
}

.version-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.version-badge-complete {
  background: rgba(76,175,80,0.12);
  color: var(--success);
  border: 1px solid rgba(76,175,80,0.25);
}

.version-badge-planned {
  background: var(--accent-light);
  color: var(--accent);
  border: 1px solid rgba(var(--accent-rgb), 0.25);
}

.roadmap-version-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
}

.roadmap-section {
  margin-bottom: 20px;
}

.roadmap-section-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 10px;
  padding-left: 4px;
}

.roadmap-items {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 8px;
}

.roadmap-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 0.84rem;
  transition: var(--transition-smooth);
  color: var(--text-secondary);
}

.roadmap-item:hover {
  background: var(--glass-bg);
}

.roadmap-check {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.roadmap-check-done {
  background: rgba(76,175,80,0.15);
  color: var(--success);
}

.roadmap-check-pending {
  background: rgba(var(--accent-rgb), 0.1);
  color: var(--text-muted);
  border: 1.5px dashed var(--text-muted);
}

.roadmap-check .icon { width: 14px; height: 14px; }

.roadmap-item-done { color: var(--text-secondary); }
.roadmap-item-pending { color: var(--text-muted); }

.roadmap-sub-item {
  padding: 5px 14px 5px 46px;
  font-size: 0.8rem;
  color: var(--text-muted);
  position: relative;
}

.roadmap-sub-item::before {
  content: '';
  position: absolute;
  left: 24px;
  top: 50%;
  width: 12px;
  height: 1.5px;
  background: rgba(var(--accent-rgb), 0.2);
}

/* Roadmap architecture section */
.roadmap-arch {
  margin-top: 32px;
  padding: 24px;
  border-radius: 16px;
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
}

.roadmap-arch h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 12px;
}

.roadmap-arch p {
  font-size: 0.84rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 8px;
}

.roadmap-arch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.roadmap-arch-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 12px;
  background: rgba(var(--accent-rgb), 0.04);
  border: 1px solid var(--glass-border);
  font-size: 0.82rem;
  color: var(--text-secondary);
  transition: var(--transition-smooth);
}

.roadmap-arch-item:hover {
  border-color: rgba(var(--accent-rgb), 0.2);
  transform: translateY(-1px);
}

.roadmap-arch-item .icon {
  color: var(--accent);
  flex-shrink: 0;
}

.roadmap-data-model {
  margin-top: 16px;
  padding: 20px;
  border-radius: 12px;
  background: rgba(0,0,0,0.03);
  border: 1px solid var(--glass-border);
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  font-size: 0.78rem;
  line-height: 1.8;
  color: var(--text-secondary);
  overflow-x: auto;
  white-space: pre;
}

[data-theme="dark"] .roadmap-data-model {
  background: rgba(255,255,255,0.03);
}

/* ── Settings Tabs ───────────────────────────────────── */
.settings-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
}

.settings-tabs .btn {
  border-radius: 12px;
}

/* ── SVG Icon system ─────────────────────────────────── */
.icon {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}

.sidebar-nav .icon {
  width: 20px;
  height: 20px;
  opacity: 0.7;
  transition: opacity 0.2s ease;
}

.sidebar-nav a:hover .icon,
.sidebar-nav a.active .icon {
  opacity: 1;
  filter: drop-shadow(0 0 4px rgba(var(--accent-rgb), 0.3));
}

.empty-state .icon {
  width: 56px;
  height: 56px;
  opacity: 0.35;
  margin-bottom: 12px;
}

.icon-success { color: var(--success); }

.stat-card .stat-icon .icon {
  width: 28px;
  height: 28px;
}

/* ── White-label settings ────────────────────────────── */
.logo-icon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 10px;
}

.icon-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 8px;
  border-radius: 14px;
  border: 2px solid var(--input-border);
  cursor: pointer;
  transition: var(--transition-smooth);
  background: var(--glass-bg);
  text-align: center;
}

.icon-option input[type="radio"] { display: none; }

.icon-option:hover {
  border-color: rgba(var(--accent-rgb), 0.3);
  transform: translateY(-2px);
}

.icon-option.selected {
  border-color: var(--accent);
  background: var(--accent-light);
  box-shadow: var(--accent-glow);
}

.icon-option .icon-preview {
  color: var(--accent);
  line-height: 1;
}

.icon-option span {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-weight: 600;
}

.color-preset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 10px;
}

.color-preset {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 12px 8px;
  border-radius: 14px;
  border: 2px solid var(--input-border);
  cursor: pointer;
  transition: var(--transition-smooth);
  background: var(--glass-bg);
  text-align: center;
}

.color-preset input[type="radio"] { display: none; }

.color-preset:hover {
  border-color: rgba(var(--accent-rgb), 0.3);
  transform: translateY(-2px);
}

.color-preset.selected {
  border-color: var(--accent);
  background: var(--accent-light);
  box-shadow: var(--accent-glow);
}

.color-swatch {
  width: 48px;
  height: 28px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.color-preset span {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* ── Pagination ──────────────────────────────────────── */
.pagination-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  flex-wrap: wrap;
  gap: 12px;
}

.pagination-info {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 4px;
}

.pagination-ellipsis {
  padding: 0 6px;
  color: var(--text-muted);
  opacity: 0.4;
}

.pagination-controls .disabled {
  opacity: 0.35;
  pointer-events: none;
}

.pagination-current {
  pointer-events: none;
}

/* ── Activity Timeline ──────────────────────────────── */
.activity-timeline {
  position: relative;
  padding-left: 32px;
  margin-bottom: 24px;
}

.activity-timeline::before {
  content: '';
  position: absolute;
  left: 15px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, rgba(var(--accent-rgb), 0.3), rgba(var(--accent-rgb), 0.05));
  border-radius: 1px;
}

.timeline-item {
  position: relative;
  margin-bottom: 16px;
  padding: 16px 20px;
  border-radius: 12px;
  animation: fadeSlideIn 0.3s ease-out var(--item-delay, 0s) both;
}

.timeline-marker {
  position: absolute;
  left: -32px;
  top: 18px;
}

.timeline-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--bg-primary);
  border: 2px solid rgba(var(--accent-rgb), 0.3);
  color: var(--accent);
}

.timeline-icon-interaction { border-color: rgba(var(--accent-rgb), 0.4); color: var(--accent); }
.timeline-icon-schedule { border-color: rgba(76,175,80,0.4); color: #4caf50; }
.timeline-icon-company { border-color: rgba(66,165,245,0.4); color: #42a5f5; }
.timeline-icon-contact { border-color: rgba(171,71,188,0.4); color: #ab47bc; }

.timeline-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.timeline-date {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-left: auto;
}

.timeline-description {
  margin: 0 0 8px;
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.timeline-content { flex:1; min-width:0; }

.timeline-links {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Scrollbar ───────────────────────────────────────── */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

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

::-webkit-scrollbar-thumb {
  background: rgba(var(--accent-rgb), 0.2);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(var(--accent-rgb), 0.35);
}

/* ── Selection ───────────────────────────────────────── */
::selection {
  background: rgba(var(--accent-rgb), 0.25);
  color: var(--text-primary);
}

/* ── Page entry animation ────────────────────────────── */
.main-content {
  animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Calendar View ──────────────────────────────────── */
.calendar-container {
  padding: 24px;
  overflow-x: auto;
}

.calendar-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-bottom: 20px;
}

.calendar-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-primary);
  min-width: 200px;
  text-align: center;
}

.calendar-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.calendar-table thead th {
  padding: 10px 4px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  text-align: center;
  border-bottom: 1px solid var(--glass-border);
}

.calendar-day {
  vertical-align: top;
  padding: 6px;
  min-height: 90px;
  height: 100px;
  border: 1px solid var(--glass-border);
  transition: background 0.2s ease;
}

.calendar-day:hover {
  background: var(--table-hover);
}

.calendar-empty {
  background: rgba(0,0,0,0.02);
}

[data-theme="dark"] .calendar-empty {
  background: rgba(255,255,255,0.01);
}

.calendar-today {
  background: var(--accent-light) !important;
  border-color: rgba(var(--accent-rgb), 0.3) !important;
}

.calendar-day-number {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 4px;
  padding: 2px 6px;
}

.calendar-today .calendar-day-number {
  color: var(--accent);
  font-weight: 700;
}

.calendar-day-items {
  display: flex;
  flex-direction: column;
  gap: 3px;
  overflow-y: auto;
  max-height: 68px;
}

.calendar-item {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 0.68rem;
  font-weight: 500;
  text-decoration: none;
  transition: var(--transition-smooth);
  white-space: nowrap;
  overflow: hidden;
}

.calendar-item-schedule {
  background: var(--accent-light);
  color: var(--accent);
  border: 1px solid rgba(var(--accent-rgb), 0.2);
}

.calendar-item-followup {
  background: rgba(76,175,80,0.12);
  color: var(--success);
  border: 1px solid rgba(76,175,80,0.2);
}

.calendar-item-overdue {
  background: rgba(239,83,80,0.12) !important;
  color: var(--danger) !important;
  border-color: rgba(239,83,80,0.3) !important;
  font-weight: 600;
}

.calendar-item:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.calendar-item-text {
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Notifications ──────────────────────────────────── */
.notification-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.notification-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 22px;
  transition: var(--transition-smooth);
}

.notification-card:hover {
  transform: translateY(-1px);
}

.notification-unread {
  border-left: 3px solid var(--accent);
  background: rgba(var(--accent-rgb), 0.06);
}

.notification-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}

.notification-unread .notification-icon {
  background: var(--accent-light);
  color: var(--accent);
}

.notification-body {
  flex: 1;
  min-width: 0;
}

.notification-message {
  font-size: 0.88rem;
  color: var(--text-primary);
  line-height: 1.5;
  margin: 0;
}

.notification-unread .notification-message {
  font-weight: 600;
}

.notification-time {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 4px;
  display: block;
}

.notification-actions {
  flex-shrink: 0;
}

/* ── Responsive ──────────────────────────────────────── */
@media (max-width: 768px) {
  .mobile-toggle { display: block; }
  .sidebar { transform: translateX(-100%); width: 280px; }
  .sidebar.open { transform: translateX(0); box-shadow: 20px 0 60px rgba(0,0,0,0.3); }
  .main-content { margin-left: 0; padding: 70px 16px 24px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .page-header { flex-direction: column; align-items: flex-start; gap: 12px; }
  .page-header h1 { font-size: 1.3rem; }
  .search-bar { flex-direction: column; }
  .search-bar .form-control { max-width: 100%; }
  .detail-grid { grid-template-columns: 1fr; }
  .calendar-day { min-height: 60px; height: auto; padding: 4px; }
  .calendar-day-items { max-height: 50px; }
  .calendar-item { font-size: 0.62rem; }
  .calendar-title { font-size: 1rem; min-width: auto; }
  .notification-card { flex-direction: column; align-items: flex-start; gap: 10px; }
  .manual-grid { grid-template-columns: 1fr; }
  .tips-grid { grid-template-columns: 1fr; }
  .roadmap-items { grid-template-columns: 1fr; }
  .roadmap-arch-grid { grid-template-columns: 1fr; }
  .docs-hero { padding: 24px 20px; }
  .docs-hero h2 { font-size: 1.15rem; }
  .roadmap-stats { gap: 16px; flex-wrap: wrap; }
  .docs-tab-nav { gap: 4px; padding: 4px; }
  .docs-tab-btn { padding: 8px 14px; font-size: 0.76rem; }
}

@media (max-width: 640px) {
  .form-card [style*="grid-template-columns"],
  .settings-section [style*="grid-template-columns"],
  .detail-grid { grid-template-columns: 1fr !important; }
  .kanban-board { grid-template-columns: 1fr; }
}

/* ══════════════════════════════════════════════════════
   v2.6 — Collaboration & UX Styles
   ══════════════════════════════════════════════════════ */

/* ── Global Search Bar ───────────────────────────────── */
.global-search {
  position: relative;
  margin-bottom: 0;
}

.global-search-input {
  width: 100%;
  padding: 8px 14px 8px 36px;
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  color: var(--text-primary);
  font-size: 0.82rem;
  font-family: inherit;
  transition: var(--transition-smooth);
  outline: none;
}

.global-search-input::placeholder { color: var(--text-muted); }

.global-search-input:focus {
  border-color: rgba(var(--accent-rgb), 0.4);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.1);
}

.global-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

/* ── Notes / Comments Section ────────────────────────── */
.notes-section {
  margin-top: 24px;
}

.notes-section h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  font-size: 0.95rem;
}

.note-form {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  align-items: flex-start;
}

.note-form textarea {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--input-border);
  border-radius: 12px;
  background: var(--input-bg);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.85rem;
  resize: vertical;
  min-height: 60px;
  outline: none;
  transition: var(--transition-smooth);
}

.note-form textarea:focus {
  border-color: rgba(var(--accent-rgb), 0.4);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.1);
}

.note-form textarea::placeholder { color: var(--text-muted); }

.notes-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.note-card {
  padding: 14px 18px;
  border-radius: 14px;
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  transition: var(--transition-smooth);
  position: relative;
}

.note-card:hover {
  border-color: rgba(var(--accent-rgb), 0.15);
}

.note-card.pinned {
  border-left: 3px solid var(--accent);
  background: rgba(var(--accent-rgb), 0.04);
}

.note-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.note-author {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
}

.note-author-avatar {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--accent-gradient);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  font-weight: 700;
}

.note-time {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.note-content {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
}

.note-content .mention {
  color: var(--accent);
  font-weight: 600;
  cursor: pointer;
}

.note-actions {
  display: flex;
  gap: 4px;
  align-items: center;
}

.note-actions form { display: inline; }

.note-pin-badge {
  font-size: 0.68rem;
  color: var(--accent);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ── Kanban Board ────────────────────────────────────── */
.kanban-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  min-height: 400px;
}

.kanban-col {
  border-radius: 16px;
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  min-height: 300px;
}

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

.kanban-col-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 700;
}

.kanban-col-danger .kanban-col-title { color: var(--danger); }
.kanban-col-warning .kanban-col-title { color: var(--warning); }
.kanban-col-success .kanban-col-title { color: var(--success); }
.kanban-col-muted .kanban-col-title { color: var(--text-muted); }

.kanban-col-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 6px;
  border-radius: 12px;
  font-size: 0.72rem;
  font-weight: 700;
  background: var(--accent-light);
  color: var(--accent);
}

.kanban-col-danger .kanban-col-count { background: rgba(239,83,80,0.12); color: var(--danger); }
.kanban-col-warning .kanban-col-count { background: rgba(255,152,0,0.12); color: var(--warning); }
.kanban-col-success .kanban-col-count { background: rgba(76,175,80,0.12); color: var(--success); }

.kanban-col-body {
  flex: 1;
  padding: 12px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.kanban-card {
  padding: 14px 16px;
  border-radius: 12px;
  transition: var(--transition-smooth);
}

.kanban-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--glass-shadow);
}

.kanban-card-type {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--accent);
  margin-bottom: 6px;
}

.kanban-card-company {
  display: block;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
  text-decoration: none;
}

.kanban-card-company:hover { color: var(--accent); }

.kanban-card-contact {
  font-size: 0.78rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 8px;
}

.kanban-card-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.74rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.kanban-card-meta span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.kanban-card-actions {
  display: flex;
  gap: 6px;
}

.kanban-empty {
  text-align: center;
  padding: 20px;
  font-size: 0.82rem;
  color: var(--text-muted);
  opacity: 0.6;
}

/* ── Keyboard Shortcut Overlay ───────────────────────── */
.kbd-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(8px);
  align-items: center;
  justify-content: center;
}

.kbd-overlay.active { display: flex; }

.kbd-modal {
  background: var(--glass-bg);
  backdrop-filter: blur(24px);
  border: 1px solid var(--glass-border);
  border-radius: var(--card-radius);
  padding: 28px 32px;
  max-width: 500px;
  width: 90%;
  box-shadow: var(--glass-shadow-lg);
}

.kbd-modal h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.kbd-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.kbd-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--glass-border);
  font-size: 0.85rem;
}

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

kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  padding: 0 8px;
  border-radius: 6px;
  background: rgba(var(--accent-rgb), 0.1);
  border: 1px solid rgba(var(--accent-rgb), 0.2);
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 700;
  font-family: inherit;
}

/* ── Saved Filters ───────────────────────────────────── */
.saved-filters-bar {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 12px;
}

.saved-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.76rem;
  font-weight: 600;
  background: var(--accent-light);
  color: var(--accent);
  border: 1px solid rgba(var(--accent-rgb), 0.2);
  text-decoration: none;
  transition: var(--transition-smooth);
}

.saved-filter-chip:hover {
  background: rgba(var(--accent-rgb), 0.2);
  transform: translateY(-1px);
  color: var(--accent);
}

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

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .main-content { padding: 70px 12px 20px; }
  .login-card { padding: 36px 24px; margin: 0 16px; }
  .login-split { grid-template-columns: 1fr; padding: 20px; gap: 24px; }
  .login-hero { padding: 0; }
  .login-hero-title { font-size: 1.5rem; }
  .login-hero-subtitle { font-size: 0.84rem; }
  .login-features { gap: 8px; }
  .login-feature { padding: 9px 12px; }
  .login-feature-icon { width: 30px; height: 30px; }
  .login-hero-stats { padding: 12px 10px; }
  .login-hero-stat-value { font-size: 0.95rem; }
}

/* ══════════════════════════════════════════════════════
   v3.0 — UI/UX Polish & Visual Enhancements
   ══════════════════════════════════════════════════════ */

/* ── Enhanced Stat Cards with Gradient Icons ─────────── */
.stat-card {
  text-align: left;
  display: flex;
  align-items: center;
  gap: 16px;
}

.stat-card .stat-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-gradient);
  color: white;
  font-size: 1.2rem;
  opacity: 1;
  margin-bottom: 0;
  flex-shrink: 0;
  box-shadow: 0 4px 16px rgba(var(--accent-rgb), 0.3);
  filter: none;
}

.stat-card .stat-info {
  flex: 1;
  min-width: 0;
}

.stat-card .stat-value {
  font-size: 1.85rem;
  line-height: 1.15;
}

.stat-card .stat-label {
  margin-top: 2px;
}

.stat-card:hover {
  transform: translateY(-3px);
}

.stat-card:nth-child(2) .stat-icon { background: linear-gradient(135deg, #4facfe, #00f2fe); box-shadow: 0 4px 16px rgba(79,172,254,0.3); }
.stat-card:nth-child(3) .stat-icon { background: linear-gradient(135deg, #43e97b, #38f9d7); box-shadow: 0 4px 16px rgba(67,233,123,0.3); }
.stat-card:nth-child(4) .stat-icon { background: linear-gradient(135deg, #fa709a, #fee140); box-shadow: 0 4px 16px rgba(250,112,154,0.3); }
.stat-card:nth-child(5) .stat-icon { background: linear-gradient(135deg, #a18cd1, #fbc2eb); box-shadow: 0 4px 16px rgba(161,140,209,0.3); }
.stat-card:nth-child(6) .stat-icon { background: linear-gradient(135deg, #f6d365, #fda085); box-shadow: 0 4px 16px rgba(246,211,101,0.3); }

/* ── Section Titles with Accent Bar ──────────────────── */
.section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 14px;
  margin-top: 8px;
}

.section-title::before {
  content: '';
  width: 4px;
  height: 20px;
  border-radius: 4px;
  background: var(--accent-gradient);
  box-shadow: 0 0 8px rgba(var(--accent-rgb), 0.3);
}

/* ── Breadcrumb Navigation ───────────────────────────── */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.breadcrumb a {
  color: var(--text-muted);
  transition: color 0.2s ease;
}

.breadcrumb a:hover {
  color: var(--accent);
}

.breadcrumb .breadcrumb-sep {
  opacity: 0.4;
}

.breadcrumb .breadcrumb-current {
  color: var(--text-secondary);
  font-weight: 600;
}

/* ── Enhanced Table Row Styling ──────────────────────── */
table tbody tr {
  position: relative;
}

table tbody tr::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 2px;
  background: var(--accent-gradient);
  transition: width 0.3s ease;
  border-radius: 2px;
}

table tbody tr:hover::after {
  width: 100%;
}

table tbody tr:hover td:first-child {
  color: var(--accent);
}

/* ── Form Submit Button Loading State ────────────────── */
.btn-loading {
  pointer-events: none;
  opacity: 0.7;
}

.btn-loading::before {
  content: '';
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: btnSpin 0.6s linear infinite;
  margin-right: 6px;
}

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

/* ── Enhanced Notification Cards ─────────────────────── */
.notification-card {
  backdrop-filter: blur(10px);
  transition: var(--transition-smooth);
}

.notification-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}

.notification-unread {
  border-left: 3px solid var(--accent);
  background: rgba(var(--accent-rgb), 0.04);
}

.notification-unread .notification-icon {
  box-shadow: 0 0 12px rgba(var(--accent-rgb), 0.25);
}

/* ── Enhanced Focus States ───────────────────────────── */
.form-control:focus {
  box-shadow: 0 0 0 4px rgba(var(--accent-rgb), 0.18), 0 0 20px rgba(var(--accent-rgb), 0.08);
}

.btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(var(--accent-rgb), 0.15);
}

/* ── Enhanced Scrollbar ──────────────────────────────── */
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(var(--accent-rgb), 0.25), rgba(var(--accent-rgb), 0.15));
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(var(--accent-rgb), 0.4), rgba(var(--accent-rgb), 0.25));
}

/* ── Page Header Enhanced ────────────────────────────── */
.page-header h1 {
  display: flex;
  align-items: center;
  gap: 10px;
}

.page-header h1 .icon {
  opacity: 0.7;
  filter: drop-shadow(0 0 4px rgba(var(--accent-rgb), 0.2));
}

/* ── Card Hover Glow ─────────────────────────────────── */
.glass:hover {
  border-color: rgba(var(--accent-rgb), 0.15);
}

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

.empty-state .empty-icon {
  margin-bottom: 16px;
  opacity: 0.3;
  filter: drop-shadow(0 0 10px rgba(var(--accent-rgb), 0.2));
}

.empty-state h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.empty-state p {
  color: var(--text-muted);
  max-width: 380px;
  margin: 0 auto;
}

/* ── Badge Enhancements ──────────────────────────────── */
.badge-success { background: rgba(76,175,80,0.15); color: #4caf50; border: 1px solid rgba(76,175,80,0.2); }
.badge-danger  { background: rgba(239,83,80,0.15); color: #ef5350; border: 1px solid rgba(239,83,80,0.2); }
.badge-warning { background: rgba(255,152,0,0.15); color: #ff9800; border: 1px solid rgba(255,152,0,0.2); }
.badge-info    { background: rgba(66,165,245,0.15); color: #42a5f5; border: 1px solid rgba(66,165,245,0.2); }

/* ── Calendar Empty Cell Fix ─────────────────────────── */
.calendar-empty {
  background: rgba(var(--accent-rgb), 0.02);
}

[data-theme="light"] .calendar-empty {
  background: rgba(0,0,0,0.02);
}

/* ── Subtle Entrance Animations ──────────────────────── */
.glass, .card {
  animation: cardEnter 0.4s cubic-bezier(0.4, 0, 0.2, 1) backwards;
}

@keyframes cardEnter {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Stagger children in grids */
.grid > *:nth-child(1) { animation-delay: 0s; }
.grid > *:nth-child(2) { animation-delay: 0.04s; }
.grid > *:nth-child(3) { animation-delay: 0.08s; }
.grid > *:nth-child(4) { animation-delay: 0.12s; }
.grid > *:nth-child(5) { animation-delay: 0.16s; }
.grid > *:nth-child(6) { animation-delay: 0.2s; }
.grid > *:nth-child(7) { animation-delay: 0.24s; }
.grid > *:nth-child(8) { animation-delay: 0.28s; }

/* ── Detail Page Hero Card ───────────────────────────── */
.detail-hero {
  position: relative;
  overflow: hidden;
}

.detail-hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(var(--accent-rgb), 0.08), transparent 70%);
  pointer-events: none;
}

/* ── Sidebar Nav Hover Enhancement ───────────────────── */
.sidebar-nav a:hover .icon {
  filter: drop-shadow(0 0 6px rgba(var(--accent-rgb), 0.4));
}

/* ── Toggle Label Styling ────────────────────────────── */
.toggle-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  cursor: pointer;
  color: var(--text-secondary);
  transition: color 0.2s ease;
}

.toggle-label:hover {
  color: var(--text-primary);
}

.toggle-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  cursor: pointer;
}

/* ── Pulse Animation for Live Indicators ─────────────── */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.pulse {
  animation: pulse 2s ease-in-out infinite;
}

/* ═══════════════════════════════════════════════════════
   QUICK ACTION CARDS
   ═══════════════════════════════════════════════════════ */

.quick-actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 12px;
}

.quick-action-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  text-decoration: none;
  color: var(--text-primary);
  border-radius: 14px;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  cursor: pointer;
}

.quick-action-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  border-color: rgba(var(--accent-rgb), 0.25);
}

.quick-action-card:active {
  transform: translateY(-1px);
}

.qa-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.qa-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.qa-label {
  font-weight: 600;
  font-size: 0.88rem;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.qa-desc {
  font-size: 0.73rem;
  color: var(--text-muted);
  line-height: 1.3;
}

/* Stagger entrance for quick action cards */
.quick-actions-grid > *:nth-child(1)  { animation-delay: 0s; }
.quick-actions-grid > *:nth-child(2)  { animation-delay: 0.03s; }
.quick-actions-grid > *:nth-child(3)  { animation-delay: 0.06s; }
.quick-actions-grid > *:nth-child(4)  { animation-delay: 0.09s; }
.quick-actions-grid > *:nth-child(5)  { animation-delay: 0.12s; }
.quick-actions-grid > *:nth-child(6)  { animation-delay: 0.15s; }
.quick-actions-grid > *:nth-child(7)  { animation-delay: 0.18s; }
.quick-actions-grid > *:nth-child(8)  { animation-delay: 0.21s; }
.quick-actions-grid > *:nth-child(9)  { animation-delay: 0.24s; }
.quick-actions-grid > *:nth-child(10) { animation-delay: 0.27s; }
.quick-actions-grid > *:nth-child(11) { animation-delay: 0.30s; }
.quick-actions-grid > *:nth-child(12) { animation-delay: 0.33s; }

@media (max-width: 480px) {
  .quick-actions-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .quick-action-card { padding: 10px 12px; gap: 10px; }
  .qa-icon { width: 32px; height: 32px; border-radius: 8px; }
  .qa-label { font-size: 0.8rem; }
  .qa-desc { font-size: 0.68rem; }
}

/* ═══════════════════════════════════════════════════════
   PAGE GUIDE SYSTEM
   ═══════════════════════════════════════════════════════ */

/* Guide trigger button */
.page-guide-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--accent-gradient);
  border: none;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(var(--accent-rgb), 0.4), 0 0 40px rgba(var(--accent-rgb), 0.15);
  transition: var(--transition-smooth);
  animation: guideFloat 3s ease-in-out infinite;
}

.page-guide-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 28px rgba(var(--accent-rgb), 0.5), 0 0 50px rgba(var(--accent-rgb), 0.2);
}

.page-guide-btn.active {
  background: var(--danger);
  animation: none;
  box-shadow: 0 4px 20px rgba(239,83,80,0.4);
}

@keyframes guideFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

/* Overlay background */
.guide-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  pointer-events: none;
}

.guide-overlay-bg {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(2px);
  pointer-events: all;
  transition: clip-path 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Highlight ring around current element */
.guide-ring {
  position: absolute;
  z-index: 10001;
  border: 2px solid var(--accent);
  border-radius: var(--card-radius);
  box-shadow: 0 0 0 4px rgba(var(--accent-rgb), 0.2), 0 0 30px rgba(var(--accent-rgb), 0.15);
  pointer-events: none;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  animation: ringPulse 2s ease-in-out infinite;
}

@keyframes ringPulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(var(--accent-rgb), 0.2), 0 0 30px rgba(var(--accent-rgb), 0.15); }
  50% { box-shadow: 0 0 0 6px rgba(var(--accent-rgb), 0.3), 0 0 40px rgba(var(--accent-rgb), 0.25); }
}

/* Tooltip */
.guide-tooltip {
  position: absolute;
  z-index: 10002;
  background: var(--glass-bg);
  backdrop-filter: blur(24px);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 0;
  box-shadow: var(--glass-shadow-lg), 0 0 40px rgba(var(--accent-rgb), 0.1);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  overflow: hidden;
}

.guide-tooltip-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px 10px;
  border-bottom: 1px solid var(--glass-border);
}

.guide-step-badge {
  background: var(--accent-gradient);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  white-space: nowrap;
  letter-spacing: 0.02em;
}

.guide-tooltip-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-primary);
  flex: 1;
}

.guide-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  transition: color 0.2s ease;
}

.guide-close:hover {
  color: var(--danger);
}

.guide-tooltip-body {
  padding: 12px 18px;
  font-size: 0.84rem;
  line-height: 1.6;
  color: var(--text-secondary);
}

.guide-tooltip-footer {
  display: flex;
  justify-content: space-between;
  padding: 10px 18px 14px;
  border-top: 1px solid var(--glass-border);
  gap: 8px;
}

.guide-tooltip-footer .btn { font-size: 0.78rem; }
.guide-tooltip-footer .guide-prev:disabled { opacity: 0.3; cursor: not-allowed; }

/* ═══════════════════════════════════════════════════════
   IMPROVED SIDEBAR — Collapsible Sections
   ═══════════════════════════════════════════════════════ */

/* Section wrapper */
.nav-section {
  overflow: hidden;
}

.nav-section-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: none;
  border: none;
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  padding: 16px 28px 6px;
  margin-top: 4px;
  position: relative;
  cursor: pointer;
  transition: color 0.2s ease;
}

.nav-section-toggle:hover {
  color: var(--accent);
}

.nav-section-toggle::before {
  content: '';
  position: absolute;
  top: 8px;
  left: 28px;
  right: 28px;
  height: 1px;
  background: linear-gradient(90deg, var(--glass-border), transparent);
}

.nav-section-toggle .section-chevron {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 0.5;
}

.nav-section-toggle:hover .section-chevron {
  opacity: 1;
}

.nav-section .nav-section-links {
  max-height: 500px;
  overflow: hidden;
  transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease;
  opacity: 1;
}

.nav-section.collapsed .nav-section-links {
  max-height: 0;
  opacity: 0;
}

.nav-section.collapsed .section-chevron {
  transform: rotate(-90deg);
}

/* Active section indicator — dot on section toggle */
.nav-section-toggle .section-active-dot {
  display: none;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px rgba(var(--accent-rgb), 0.5);
  margin-left: 6px;
}

.nav-section.has-active .nav-section-toggle .section-active-dot {
  display: inline-block;
}

/* Link count badges in sidebar */
.sidebar-nav .nav-count {
  margin-left: auto;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-muted);
  background: rgba(var(--accent-rgb), 0.08);
  padding: 1px 7px;
  border-radius: 10px;
  min-width: 20px;
  text-align: center;
  transition: var(--transition-smooth);
}

.sidebar-nav a:hover .nav-count,
.sidebar-nav a.active .nav-count {
  background: rgba(var(--accent-rgb), 0.18);
  color: var(--accent);
}

/* ── Responsive Enhancements ─────────────────────────── */
@media (max-width: 480px) {
  .stat-card { gap: 12px; padding: 16px; }
  .stat-card .stat-icon { width: 42px; height: 42px; border-radius: 10px; }
  .stat-card .stat-value { font-size: 1.5rem; }
  .breadcrumb { font-size: 0.72rem; }
  table { font-size: 0.82rem; }
  table th, table td { padding: 10px 12px; }
  .page-guide-btn { bottom: 16px; right: 16px; width: 40px; height: 40px; }
  .guide-tooltip { max-width: calc(100vw - 32px); }
}

/* ── Trader mobile audit — rollout polish ────────────── */
@media (max-width: 768px) {
  /* Make table wrappers scroll horizontally with a visible affordance */
  .table-wrapper { -webkit-overflow-scrolling: touch; }
  .table-wrapper table { min-width: 520px; }
  /* Stack page header actions beneath the title on narrow screens so
     long action rows don't force a horizontal scroll on the entire page. */
  .page-header .actions { flex-wrap: wrap; gap: 6px; width: 100%; }
  .page-header .actions .btn { flex: 1 1 auto; min-height: 40px; }
  /* Prevent iOS from zooming when focusing any form field */
  input, select, textarea, .form-control { font-size: 16px !important; }
  /* Minimum 40px touch targets on buttons */
  .btn { min-height: 40px; }
  .btn-sm { min-height: 36px; }
  /* Quick actions grid collapses to two columns, then one */
  .quick-actions-grid { grid-template-columns: repeat(2, 1fr) !important; }
  /* Filter row wraps cleanly */
  .search-bar { gap: 8px; }
  .search-bar select, .search-bar input { width: 100% !important; max-width: 100% !important; }
  /* Share-link row on survey detail wraps cleanly */
  td > div[style*="display:flex"] { flex-wrap: wrap; gap: 4px; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr !important; }
  .quick-actions-grid { grid-template-columns: 1fr !important; }
  .page-header h1 { font-size: 1.15rem; }
  /* Make management health signals column wrap */
  .table-wrapper td[style*="white-space:nowrap"] { white-space: normal !important; }
}

/* ── Mobile touch targets: ensure 44px+ on small screens (a11y) ── */
@media (max-width: 640px) {
  .btn,
  .btn-ghost,
  .btn-primary,
  .btn-danger,
  .btn-success,
  .btn-warning,
  .form-control,
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="number"],
  input[type="date"],
  input[type="datetime-local"],
  select,
  .nav-section-toggle,
  .docs-tab-btn {
    min-height: 44px;
  }
  .btn-sm {
    min-height: 44px;
    padding: 8px 14px;
  }
  /* Action icons in tables/cards remain tappable */
  .btn-icon,
  .btn-ghost.btn-sm {
    min-width: 44px;
    min-height: 44px;
  }
  /* CVR form 2-col grid collapses to single column */
  .cvr-grid-2,
  .cvr-grid-3 {
    grid-template-columns: 1fr !important;
  }
}

/* ── Accessibility: keyboard focus ring on every interactive element ── */
button:focus-visible,
a:focus-visible,
.btn:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.nav-section-toggle:focus-visible,
.docs-tab-btn:focus-visible,
.theme-toggle:focus-visible,
.page-guide-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
[data-theme="light"] :focus-visible {
  outline-color: var(--accent);
}

/* Hide page guide button when JS disabled */
.no-js .page-guide-btn { display: none; }
