/* =========================================================
   ITSM Support Portal — Master Stylesheet
   Design System: Modern Corporate / Indigo + Slate
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ─── CSS Custom Properties ──────────────────────────────── */
:root {
  /* Brand Colors */
  --primary:          #4f46e5;
  --primary-hover:    #4338ca;
  --primary-light:    #eef2ff;
  --primary-50:       rgba(79, 70, 229, 0.08);
  --accent:           #06b6d4;
  --accent-light:     #ecfeff;
  --success:          #10b981;
  --success-light:    #d1fae5;
  --warning:          #f59e0b;
  --warning-light:    #fef3c7;
  --danger:           #ef4444;
  --danger-light:     #fee2e2;
  --info:             #3b82f6;
  --info-light:       #dbeafe;

  /* Sidebar */
  --sidebar-bg:       #0f172a;
  --sidebar-width:    260px;
  --sidebar-collapsed:72px;
  --sidebar-text:     #94a3b8;
  --sidebar-text-hover:#e2e8f0;
  --sidebar-active-bg:rgba(79, 70, 229, 0.15);
  --sidebar-active:   #818cf8;
  --sidebar-border:   rgba(255,255,255,0.06);
  --sidebar-group:    #475569;

  /* Surface & Background */
  --bg-body:          #f1f5f9;
  --bg-card:          #ffffff;
  --bg-card-hover:    #f8fafc;
  --bg-topbar:        #ffffff;
  --bg-input:         #f8fafc;

  /* Text */
  --text-primary:     #0f172a;
  --text-secondary:   #475569;
  --text-muted:       #94a3b8;
  --text-inverse:     #ffffff;

  /* Borders */
  --border:           #e2e8f0;
  --border-focus:     #4f46e5;
  --radius-sm:        6px;
  --radius:           10px;
  --radius-lg:        14px;
  --radius-xl:        20px;
  --radius-pill:      999px;

  /* Shadows */
  --shadow-sm:        0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow:           0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg:        0 10px 30px rgba(0,0,0,0.12);
  --shadow-primary:   0 4px 16px rgba(79,70,229,0.25);

  /* Topbar */
  --topbar-h:         64px;

  /* Transitions */
  --transition:       all 0.2s ease;
  --transition-slow:  all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark Mode Variables */
[data-theme="dark"] {
  --bg-body:          #0b0f1a;
  --bg-card:          #111827;
  --bg-card-hover:    #1a2235;
  --bg-topbar:        #111827;
  --bg-input:         #1a2235;
  --text-primary:     #f1f5f9;
  --text-secondary:   #94a3b8;
  --text-muted:       #64748b;
  --border:           #1e2d3d;
  --primary-light:    rgba(79, 70, 229, 0.12);
  --primary-50:       rgba(79, 70, 229, 0.1);
  --success-light:    rgba(16, 185, 129, 0.12);
  --warning-light:    rgba(245, 158, 11, 0.12);
  --danger-light:     rgba(239, 68, 68, 0.12);
  --info-light:       rgba(59, 130, 246, 0.12);
  --shadow-sm:        0 1px 3px rgba(0,0,0,0.3);
  --shadow:           0 4px 12px rgba(0,0,0,0.4);
  --shadow-lg:        0 10px 30px rgba(0,0,0,0.5);
}

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

html { font-size: 14px; scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg-body);
  color: var(--text-primary);
  line-height: 1.6;
  transition: background 0.3s ease, color 0.3s ease;
  overflow-x: hidden;
}

a { color: var(--primary); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--primary-hover); }

/* ─── Scrollbar ──────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

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

/* ─── Sidebar ────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-width);
  min-height: 100vh;
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  z-index: 1050;
  transition: var(--transition-slow);
  overflow: hidden;
  border-right: 1px solid var(--sidebar-border);
}

.sidebar.collapsed { width: var(--sidebar-collapsed); }

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 18px;
  border-bottom: 1px solid var(--sidebar-border);
  min-height: var(--topbar-h);
  text-decoration: none;
}

.sidebar-logo-icon {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(79,70,229,0.4);
}

.sidebar-logo-icon svg { width: 20px; height: 20px; color: #fff; }

.sidebar-logo-text {
  display: flex;
  flex-direction: column;
  white-space: nowrap;
  overflow: hidden;
}

.sidebar-logo-text .brand-name {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.3px;
}

.sidebar-logo-text .brand-sub {
  font-size: 10px;
  font-weight: 500;
  color: var(--sidebar-text);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.sidebar-nav {
  flex: 1;
  padding: 14px 0;
  overflow-y: auto;
  overflow-x: hidden;
}

.nav-group-label {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--sidebar-group);
  padding: 16px 18px 6px;
  white-space: nowrap;
  overflow: hidden;
  transition: opacity 0.2s;
}

.sidebar.collapsed .nav-group-label { opacity: 0; }

.nav-item {
  position: relative;
  margin: 1px 8px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 10px;
  border-radius: var(--radius);
  color: var(--sidebar-text);
  font-size: 13.5px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}

.nav-link:hover {
  background: var(--sidebar-active-bg);
  color: var(--sidebar-text-hover);
  text-decoration: none;
}

.nav-link.active {
  background: var(--sidebar-active-bg);
  color: var(--sidebar-active);
  font-weight: 600;
}

.nav-link.active::before {
  content: '';
  position: absolute;
  left: 0; top: 4px; bottom: 4px;
  width: 3px;
  background: var(--sidebar-active);
  border-radius: 0 3px 3px 0;
}

.nav-link .nav-icon {
  width: 20px; height: 20px;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}

.nav-link .nav-badge {
  margin-left: auto;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: var(--radius-pill);
  min-width: 18px;
  text-align: center;
  white-space: nowrap;
}

.nav-link .nav-arrow {
  margin-left: auto;
  transition: transform 0.2s;
  opacity: 0.5;
}

.nav-link[aria-expanded="true"] .nav-arrow { transform: rotate(180deg); }

.sidebar.collapsed .nav-link .nav-text,
.sidebar.collapsed .nav-link .nav-badge,
.sidebar.collapsed .nav-link .nav-arrow { display: none; }

.sidebar.collapsed .nav-link { justify-content: center; }

.nav-submenu {
  padding: 2px 0;
}

.nav-submenu .nav-link {
  padding-left: 42px;
  font-size: 13px;
  margin: 0 8px;
}

.sidebar.collapsed .nav-submenu { display: none !important; }

.sidebar-footer {
  padding: 14px;
  border-top: 1px solid var(--sidebar-border);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
}

.sidebar-user:hover { background: var(--sidebar-active-bg); }

.sidebar-user .avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.sidebar-user .user-info { overflow: hidden; }
.sidebar-user .user-name {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--sidebar-text-hover);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user .user-role {
  font-size: 11px;
  color: var(--sidebar-text);
  white-space: nowrap;
}

.sidebar.collapsed .sidebar-user .user-info { display: none; }

/* ─── Main Content ───────────────────────────────────────── */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: var(--transition-slow);
}

.main-content.expanded { margin-left: var(--sidebar-collapsed); }

/* ─── Topbar ─────────────────────────────────────────────── */
.topbar {
  height: var(--topbar-h);
  background: var(--bg-topbar);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 900;
  transition: background 0.3s;
}

.topbar-toggle {
  width: 36px; height: 36px;
  border: none;
  background: transparent;
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  transition: var(--transition);
  flex-shrink: 0;
}

.topbar-toggle:hover { background: var(--bg-body); color: var(--text-primary); }

.topbar-search {
  flex: 1;
  max-width: 420px;
  position: relative;
}

.topbar-search input {
  width: 100%;
  height: 36px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--bg-input);
  color: var(--text-primary);
  padding: 0 16px 0 40px;
  font-size: 13px;
  font-family: inherit;
  transition: var(--transition);
  outline: none;
}

.topbar-search input:focus {
  border-color: var(--primary);
  background: var(--bg-card);
  box-shadow: 0 0 0 3px var(--primary-50);
}

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

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

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.topbar-btn {
  width: 36px; height: 36px;
  border: none;
  background: transparent;
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  transition: var(--transition);
  position: relative;
}

.topbar-btn:hover { background: var(--bg-body); color: var(--text-primary); }

.topbar-btn .dot {
  position: absolute;
  top: 6px; right: 6px;
  width: 8px; height: 8px;
  background: var(--danger);
  border-radius: 50%;
  border: 2px solid var(--bg-topbar);
}

.topbar-btn .badge-count {
  position: absolute;
  top: 4px; right: 3px;
  background: var(--danger);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 3px;
  border: 1.5px solid var(--bg-topbar);
}

.topbar-divider {
  width: 1px;
  height: 24px;
  background: var(--border);
  margin: 0 4px;
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 4px 8px 4px 4px;
  border-radius: var(--radius-pill);
  transition: var(--transition);
}

.topbar-user:hover { background: var(--bg-body); }

.topbar-user .avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--primary-light);
}

.topbar-user .user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.topbar-user .user-role-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: var(--radius-pill);
  background: var(--primary-light);
  color: var(--primary);
}

/* ─── Page Content ───────────────────────────────────────── */
.page-content {
  padding: 24px;
  flex: 1;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.page-title-wrap { display: flex; flex-direction: column; gap: 4px; }

.page-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}

.page-subtitle {
  font-size: 13px;
  color: var(--text-muted);
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb-sep { opacity: 0.4; }
.breadcrumb-current { color: var(--text-primary); font-weight: 500; }

/* ─── Cards ──────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  gap: 12px;
}

.card-title {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-title-icon {
  width: 28px; height: 28px;
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
}

.card-body { padding: 20px; }
.card-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  background: var(--bg-body);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* ─── Stat Cards ─────────────────────────────────────────── */
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
  cursor: default;
}

.stat-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.stat-card.indigo::before { background: linear-gradient(90deg, #4f46e5, #818cf8); }
.stat-card.cyan::before   { background: linear-gradient(90deg, #06b6d4, #67e8f9); }
.stat-card.green::before  { background: linear-gradient(90deg, #10b981, #6ee7b7); }
.stat-card.amber::before  { background: linear-gradient(90deg, #f59e0b, #fcd34d); }
.stat-card.red::before    { background: linear-gradient(90deg, #ef4444, #fca5a5); }
.stat-card.violet::before { background: linear-gradient(90deg, #7c3aed, #a78bfa); }
.stat-card.rose::before   { background: linear-gradient(90deg, #f43f5e, #fda4af); }
.stat-card.sky::before    { background: linear-gradient(90deg, #0ea5e9, #7dd3fc); }
.stat-card.orange::before { background: linear-gradient(90deg, #f97316, #fdba74); }

.stat-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.stat-icon {
  width: 42px; height: 42px;
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
}

.stat-icon.indigo { background: var(--primary-light); color: var(--primary); }
.stat-icon.cyan   { background: var(--accent-light);  color: var(--accent); }
.stat-icon.green  { background: var(--success-light); color: var(--success); }
.stat-icon.amber  { background: var(--warning-light); color: var(--warning); }
.stat-icon.red    { background: var(--danger-light);  color: var(--danger); }
.stat-icon.violet { background: #ede9fe;              color: #7c3aed; }
.stat-icon.rose   { background: #ffe4e6;              color: #f43f5e; }
.stat-icon.sky    { background: #e0f2fe;              color: #0ea5e9; }
.stat-icon.orange { background: #fff7ed;              color: #f97316; }

[data-theme="dark"] .stat-icon.violet { background: rgba(124,58,237,0.15); }
[data-theme="dark"] .stat-icon.rose   { background: rgba(244,63,94,0.15);  }
[data-theme="dark"] .stat-icon.sky    { background: rgba(14,165,233,0.15); }
[data-theme="dark"] .stat-icon.orange { background: rgba(249,115,22,0.15); }

.stat-trend {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
}

.stat-trend.up   { color: var(--success); background: var(--success-light); }
.stat-trend.down { color: var(--danger);  background: var(--danger-light);  }
.stat-trend.flat { color: var(--text-muted); background: var(--bg-body); }

.stat-value {
  font-size: 30px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -1px;
  line-height: 1;
}

.stat-label {
  font-size: 12.5px;
  color: var(--text-muted);
  font-weight: 500;
}

.stat-footer {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ─── Ticket Status Summary Strip ────────────────────────── */
.status-strip {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 10px;
  margin-bottom: 24px;
}

.status-pill {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
}

.status-pill:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.status-pill.active { border-color: var(--primary); background: var(--primary-light); }

.status-pill .sp-count {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.status-pill .sp-label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ─── Buttons ────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  padding: 8px 18px;
  border-radius: var(--radius);
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
  line-height: 1.3;
}

.btn:disabled { opacity: 0.5; cursor: not-allowed; pointer-events: none; }

.btn-primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: var(--shadow-primary);
}

.btn-primary:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
  box-shadow: 0 6px 20px rgba(79,70,229,0.35);
  color: #fff;
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--border);
}

.btn-outline:hover {
  background: var(--bg-body);
  border-color: var(--text-muted);
  color: var(--text-primary);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: transparent;
}

.btn-ghost:hover { background: var(--bg-body); color: var(--text-primary); }

.btn-danger  { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-success { background: var(--success); color: #fff; border-color: var(--success); }
.btn-warning { background: var(--warning); color: #fff; border-color: var(--warning); }

.btn-sm { padding: 5px 12px; font-size: 12.5px; }
.btn-lg { padding: 11px 24px; font-size: 15px; }
.btn-icon { padding: 7px; border-radius: var(--radius); }

.btn-group {
  display: flex;
  gap: 6px;
}

/* ─── Badges & Pills ─────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}

/* Status Badges */
.badge-new          { background: #e0e7ff; color: #3730a3; }
.badge-open         { background: #dbeafe; color: #1d4ed8; }
.badge-assigned     { background: #e0f2fe; color: #0369a1; }
.badge-in-progress  { background: #fef3c7; color: #b45309; }
.badge-waiting-user { background: #f3e8ff; color: #7e22ce; }
.badge-waiting-vendor{ background: #ede9fe; color: #5b21b6; }
.badge-on-hold      { background: #f1f5f9; color: #475569; }
.badge-resolved     { background: #d1fae5; color: #065f46; }
.badge-closed       { background: #f8fafc; color: #64748b; border: 1px solid var(--border); }
.badge-cancelled    { background: #fee2e2; color: #991b1b; }
.badge-reopened     { background: #fef9c3; color: #713f12; }
.badge-pending      { background: #fff7ed; color: #9a3412; }

[data-theme="dark"] .badge-new           { background: rgba(55,48,163,0.25); color: #a5b4fc; }
[data-theme="dark"] .badge-open          { background: rgba(29,78,216,0.2);  color: #93c5fd; }
[data-theme="dark"] .badge-assigned      { background: rgba(3,105,161,0.2);  color: #7dd3fc; }
[data-theme="dark"] .badge-in-progress   { background: rgba(180,83,9,0.2);   color: #fcd34d; }
[data-theme="dark"] .badge-resolved      { background: rgba(6,95,70,0.2);    color: #6ee7b7; }
[data-theme="dark"] .badge-closed        { background: rgba(100,116,139,0.15); color: #94a3b8; }
[data-theme="dark"] .badge-cancelled     { background: rgba(153,27,27,0.2);  color: #fca5a5; }
[data-theme="dark"] .badge-on-hold       { background: rgba(71,85,105,0.2);  color: #94a3b8; }
[data-theme="dark"] .badge-waiting-user  { background: rgba(126,34,206,0.2); color: #c4b5fd; }
[data-theme="dark"] .badge-waiting-vendor{ background: rgba(91,33,182,0.2);  color: #a78bfa; }

/* Priority Badges */
.badge-low      { background: #d1fae5; color: #065f46; }
.badge-medium   { background: #dbeafe; color: #1d4ed8; }
.badge-high     { background: #fef3c7; color: #b45309; }
.badge-critical { background: #fee2e2; color: #991b1b; }

[data-theme="dark"] .badge-low      { background: rgba(6,95,70,0.2);    color: #6ee7b7; }
[data-theme="dark"] .badge-medium   { background: rgba(29,78,216,0.2);  color: #93c5fd; }
[data-theme="dark"] .badge-high     { background: rgba(180,83,9,0.2);   color: #fcd34d; }
[data-theme="dark"] .badge-critical { background: rgba(153,27,27,0.2);  color: #fca5a5; }

/* Priority dot indicator */
.priority-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.priority-dot.low      { background: var(--success); }
.priority-dot.medium   { background: var(--info); }
.priority-dot.high     { background: var(--warning); }
.priority-dot.critical { background: var(--danger); box-shadow: 0 0 0 2px rgba(239,68,68,0.2); }

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

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

.form-label .required { color: var(--danger); margin-left: 2px; }

.form-control {
  width: 100%;
  padding: 9px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: 13.5px;
  font-family: inherit;
  transition: var(--transition);
  outline: none;
}

.form-control:focus {
  border-color: var(--primary);
  background: var(--bg-card);
  box-shadow: 0 0 0 3px var(--primary-50);
}

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

select.form-control { cursor: pointer; 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='%2394a3b8' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

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

.form-hint { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.form-error { font-size: 12px; color: var(--danger); margin-top: 4px; }

/* Tag input */
.tag-input-wrapper {
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-input);
  padding: 6px 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  cursor: text;
  min-height: 42px;
  align-items: center;
  transition: var(--transition);
}

.tag-input-wrapper:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-50);
  background: var(--bg-card);
}

.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 12px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
}

.tag-chip .remove-tag { cursor: pointer; opacity: 0.6; font-size: 14px; line-height: 1; }
.tag-chip .remove-tag:hover { opacity: 1; }

/* ─── Dropzone ───────────────────────────────────────────── */
.dropzone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 20px;
  text-align: center;
  background: var(--bg-input);
  cursor: pointer;
  transition: var(--transition);
}

.dropzone:hover, .dropzone.drag-over {
  border-color: var(--primary);
  background: var(--primary-50);
}

.dropzone-icon { font-size: 36px; margin-bottom: 10px; opacity: 0.5; }
.dropzone-text { font-size: 14px; color: var(--text-secondary); }
.dropzone-hint { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

.file-list { margin-top: 12px; display: flex; flex-direction: column; gap: 6px; }

.file-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
}

.file-icon { font-size: 20px; }
.file-info { flex: 1; overflow: hidden; }
.file-name { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-size { font-size: 11px; color: var(--text-muted); }
.file-remove { cursor: pointer; color: var(--text-muted); transition: var(--transition); }
.file-remove:hover { color: var(--danger); }

/* ─── Tables ─────────────────────────────────────────────── */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-lg);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.data-table thead th {
  padding: 12px 16px;
  text-align: left;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--text-muted);
  background: var(--bg-body);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.data-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: var(--transition);
}

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

.data-table tbody tr:hover { background: var(--bg-card-hover); }

.data-table td {
  padding: 12px 16px;
  color: var(--text-primary);
  vertical-align: middle;
}

.table-ticket-id {
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
  font-family: 'Courier New', monospace;
}

.table-subject {
  font-weight: 500;
  max-width: 280px;
}

.table-subject a {
  color: var(--text-primary);
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.table-subject a:hover { color: var(--primary); }

.table-subject .sub-text {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.avatar-sm {
  width: 28px; height: 28px;
  border-radius: 50%;
  object-fit: cover;
}

.avatar-initial {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.assignee-cell {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sla-bar {
  width: 70px;
  height: 5px;
  border-radius: var(--radius-pill);
  background: var(--border);
  overflow: hidden;
}

.sla-bar-fill {
  height: 100%;
  border-radius: var(--radius-pill);
  background: var(--success);
}

.sla-bar-fill.warning { background: var(--warning); }
.sla-bar-fill.danger  { background: var(--danger);  }

/* ─── Ticket Conversation ────────────────────────────────── */
.conversation-thread { display: flex; flex-direction: column; gap: 0; }

.conv-item {
  display: flex;
  gap: 14px;
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
  position: relative;
}

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

.conv-avatar-col { flex-shrink: 0; }

.conv-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.conv-avatar.employee { background: linear-gradient(135deg, #4f46e5, #818cf8); }
.conv-avatar.engineer { background: linear-gradient(135deg, #06b6d4, #67e8f9); color: #0f172a; }
.conv-avatar.system   { background: linear-gradient(135deg, #475569, #94a3b8); }
.conv-avatar.internal { background: linear-gradient(135deg, #f59e0b, #fcd34d); color: #0f172a; }

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

.conv-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.conv-name { font-size: 13.5px; font-weight: 700; color: var(--text-primary); }
.conv-time { font-size: 12px; color: var(--text-muted); }

.conv-type-badge {
  font-size: 10.5px;
  font-weight: 700;
  padding: 1px 8px;
  border-radius: var(--radius-pill);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.conv-type-badge.public   { background: var(--primary-light); color: var(--primary); }
.conv-type-badge.internal { background: var(--warning-light); color: #b45309; border: 1px dashed var(--warning); }
.conv-type-badge.system   { background: var(--bg-body); color: var(--text-muted); }
.conv-type-badge.resolved { background: var(--success-light); color: var(--success); }

.conv-content {
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.7;
}

.conv-content p { margin-bottom: 8px; }
.conv-content p:last-child { margin-bottom: 0; }

.conv-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.conv-attachment {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 12.5px;
  color: var(--text-secondary);
  background: var(--bg-input);
  cursor: pointer;
  transition: var(--transition);
}

.conv-attachment:hover { border-color: var(--primary); color: var(--primary); }

.system-event {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--bg-body);
  border-radius: var(--radius);
  margin: 8px 0;
}

.system-event .event-icon {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
  flex-shrink: 0;
}

.system-event .event-text { font-size: 13px; color: var(--text-secondary); }
.system-event .event-time { font-size: 11px; color: var(--text-muted); margin-left: auto; }

/* Reply box */
.reply-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.reply-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  background: var(--bg-body);
}

.reply-tab {
  padding: 12px 20px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 6px;
}

.reply-tab:hover { color: var(--text-primary); }
.reply-tab.active { color: var(--primary); border-bottom-color: var(--primary); background: var(--bg-card); }


.reply-tab.internal.active { color: #b45309; border-bottom-color: var(--warning); }

.reply-editor-wrap { padding: 0; }

.ql-container { border: none !important; font-family: 'Inter', sans-serif !important; }
.ql-toolbar { border: none !important; border-bottom: 1px solid var(--border) !important; background: var(--bg-body); }
.ql-editor { min-height: 120px; font-size: 13.5px; }

[data-theme="dark"] .ql-toolbar { background: var(--bg-body); }
[data-theme="dark"] .ql-toolbar .ql-stroke { stroke: var(--text-muted); }
[data-theme="dark"] .ql-toolbar .ql-fill  { fill: var(--text-muted); }
[data-theme="dark"] .ql-toolbar button:hover .ql-stroke { stroke: var(--text-primary); }
[data-theme="dark"] .ql-editor { color: var(--text-primary); }

.reply-footer {
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--border);
  background: var(--bg-body);
  flex-wrap: wrap;
}

/* ─── Ticket Detail Sidebar ──────────────────────────────── */
.ticket-sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.detail-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.detail-panel-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 12.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.detail-panel-body { padding: 14px 16px; }

.detail-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.detail-row:last-child { border-bottom: none; padding-bottom: 0; }
.detail-row:first-child { padding-top: 0; }

.detail-key {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
  flex-shrink: 0;
  min-width: 90px;
}

.detail-val {
  font-size: 13px;
  color: var(--text-primary);
  font-weight: 500;
  text-align: right;
}

/* SLA indicator */
.sla-indicator {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sla-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
}

.sla-progress {
  height: 6px;
  background: var(--border);
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.sla-progress-bar {
  height: 100%;
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, var(--success), #34d399);
  transition: width 0.5s ease;
}

.sla-progress-bar.warn { background: linear-gradient(90deg, var(--warning), #fcd34d); }
.sla-progress-bar.crit { background: linear-gradient(90deg, var(--danger), #f87171); }

/* ─── Notification Panel ─────────────────────────────────── */
.notif-overlay {
  position: fixed;
  inset: 0;
  z-index: 1040;
  background: rgba(0,0,0,0.2);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.notif-overlay.open { opacity: 1; pointer-events: all; }

.notif-panel {
  position: fixed;
  top: 0; right: 0;
  width: 380px;
  max-width: 100vw;
  height: 100vh;
  background: var(--bg-card);
  border-left: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  z-index: 1045;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.notif-panel.open { transform: translateX(0); }

.notif-header {
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.notif-title { font-size: 15px; font-weight: 700; }
.notif-close { cursor: pointer; color: var(--text-muted); transition: var(--transition); }
.notif-close:hover { color: var(--text-primary); }

.notif-list { flex: 1; overflow-y: auto; }

.notif-item {
  display: flex;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}

.notif-item:hover { background: var(--bg-body); }
.notif-item.unread { background: var(--primary-50); }
.notif-item.unread::before {
  content: '';
  position: absolute;
  left: 0; top: 16px;
  width: 3px; height: calc(100% - 32px);
  background: var(--primary);
  border-radius: 0 2px 2px 0;
}

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

.notif-body { flex: 1; min-width: 0; }
.notif-text { font-size: 13px; color: var(--text-primary); line-height: 1.5; }
.notif-text strong { font-weight: 600; }
.notif-time { font-size: 11.5px; color: var(--text-muted); margin-top: 3px; }

/* ─── Charts ─────────────────────────────────────────────── */
.chart-container {
  position: relative;
  width: 100%;
}

/* ─── Knowledge Base ─────────────────────────────────────── */
.kb-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.kb-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); border-color: var(--primary); }

/* ─── Filters Bar ────────────────────────────────────────── */
.filters-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 14px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 16px;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-pill);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
  background: var(--bg-card);
}

.filter-chip:hover { border-color: var(--primary); color: var(--primary); }
.filter-chip.active { border-color: var(--primary); background: var(--primary-light); color: var(--primary); }

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

.empty-icon { font-size: 52px; margin-bottom: 14px; opacity: 0.4; }
.empty-title { font-size: 16px; font-weight: 700; color: var(--text-secondary); margin-bottom: 6px; }
.empty-text { font-size: 13.5px; }

/* ─── DataTables Overrides ───────────────────────────────── */
.dataTables_wrapper .dataTables_filter input {
  border: 1.5px solid var(--border) !important;
  border-radius: var(--radius-pill) !important;
  background: var(--bg-input) !important;
  color: var(--text-primary) !important;
  padding: 6px 14px !important;
  font-family: inherit;
  font-size: 13px;
  outline: none;
}

.dataTables_wrapper .dataTables_filter input:focus {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px var(--primary-50) !important;
}

.dataTables_wrapper .dataTables_length select {
  border: 1.5px solid var(--border) !important;
  border-radius: var(--radius) !important;
  background: var(--bg-input) !important;
  color: var(--text-primary) !important;
  padding: 5px 10px !important;
  font-family: inherit;
  font-size: 13px;
}

.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate .paginate_button {
  font-size: 12.5px !important;
  color: var(--text-muted) !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
  background: var(--primary) !important;
  border: none !important;
  color: #fff !important;
  border-radius: var(--radius) !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
  background: var(--bg-body) !important;
  border: none !important;
  color: var(--text-primary) !important;
  border-radius: var(--radius) !important;
}

/* ─── Quill Overrides ────────────────────────────────────── */
.ql-editor.ql-blank::before {
  color: var(--text-muted) !important;
  font-style: normal !important;
  font-size: 13.5px;
}

/* ─── Modal ──────────────────────────────────────────────── */
.modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
}

.modal-header {
  border-bottom: 1px solid var(--border);
  padding: 18px 22px;
}

.modal-title { font-size: 16px; font-weight: 700; color: var(--text-primary); }

.modal-footer {
  border-top: 1px solid var(--border);
  padding: 14px 22px;
}

.modal-backdrop { backdrop-filter: blur(4px); }

/* ─── Dropdown ───────────────────────────────────────────── */
.dropdown-menu {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  min-width: 180px;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius);
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
}

.dropdown-item:hover { background: var(--bg-body); color: var(--text-primary); }
.dropdown-item.danger { color: var(--danger); }
.dropdown-item.danger:hover { background: var(--danger-light); }

.dropdown-divider { border-color: var(--border); margin: 4px 0; }

/* ─── Role Switcher (Demo) ───────────────────────────────── */
.role-demo-bar {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--sidebar-bg);
  border: 1px solid var(--sidebar-border);
  border-radius: var(--radius-pill);
  padding: 6px 10px;
  display: flex;
  align-items: center;
  gap: 6px;
  z-index: 9999;
  box-shadow: var(--shadow-lg);
}

.role-demo-label {
  font-size: 11px;
  color: var(--sidebar-text);
  padding: 0 6px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.role-demo-btn {
  padding: 5px 14px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  background: transparent;
  color: var(--sidebar-text);
  transition: var(--transition);
}

.role-demo-btn:hover { background: var(--sidebar-active-bg); color: var(--sidebar-text-hover); }
.role-demo-btn.active { background: var(--primary); color: #fff; }

/* ─── Tooltip ────────────────────────────────────────────── */
[data-tooltip] {
  position: relative;
}

[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--sidebar-bg);
  color: #fff;
  font-size: 11.5px;
  padding: 4px 10px;
  border-radius: var(--radius);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 9999;
}

[data-tooltip]:hover::after { opacity: 1; }

/* ─── Responsive ─────────────────────────────────────────── */
@media (max-width: 1200px) {
  .ticket-detail-grid { grid-template-columns: 1fr !important; }
  .ticket-sidebar { flex-direction: row; flex-wrap: wrap; }
  .detail-panel { flex: 1; min-width: 280px; }
}

@media (max-width: 992px) {
  .stat-grid-4 { grid-template-columns: repeat(2, 1fr) !important; }
  .chart-grid-2 { grid-template-columns: 1fr !important; }
}

@media (max-width: 768px) {
  :root { --sidebar-width: 0px; }
  .sidebar {
    transform: translateX(-100%);
    width: 260px;
    box-shadow: var(--shadow-lg);
  }
  .sidebar.mobile-open {
    transform: translateX(0);
    width: 260px;
  }
  .main-content { margin-left: 0 !important; }
  .page-content { padding: 16px; }
  .topbar { padding: 0 16px; }
  .stat-grid-4 { grid-template-columns: repeat(2, 1fr) !important; }
  .status-strip { grid-template-columns: repeat(3, 1fr); }
  .page-header { flex-direction: column; }
  .topbar-user .user-name, .topbar-user .user-role-badge { display: none; }
  .notif-panel { width: 100vw; }
  .role-demo-bar { width: calc(100% - 32px); justify-content: center; flex-wrap: wrap; }
}

@media (max-width: 480px) {
  .stat-grid-4 { grid-template-columns: 1fr !important; }
  .status-strip { grid-template-columns: repeat(2, 1fr); }
}

/* ─── Utilities ──────────────────────────────────────────── */
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted) !important; }
.text-primary-color { color: var(--primary) !important; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.fs-12 { font-size: 12px; }
.fs-13 { font-size: 13px; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.w-100 { width: 100%; }
.overflow-hidden { overflow: hidden; }
.rounded { border-radius: var(--radius); }
.rounded-pill { border-radius: var(--radius-pill); }

.grid { display: grid; }
.stat-grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.chart-grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.chart-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }

/* Animations */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

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

.fade-in-up { animation: fadeInUp 0.3s ease forwards; }
.animate-pulse { animation: pulse 2s infinite; }
.spin { animation: spin 0.8s linear infinite; }

/* Stagger animation for cards */
.stat-card:nth-child(1) { animation-delay: 0.05s; }
.stat-card:nth-child(2) { animation-delay: 0.1s; }
.stat-card:nth-child(3) { animation-delay: 0.15s; }
.stat-card:nth-child(4) { animation-delay: 0.2s; }
