/* ============================================================
   HelpDesk Pro — Dark Mode CSS
   Design: Deep charcoal surfaces, indigo+violet accent system,
   crisp typography, strong visual hierarchy.
   ============================================================ */

/* ── Custom properties ── */
:root {
  --bg-base:        #0d0f14;
  --bg-surface:     #13161e;
  --bg-elevated:    #1a1e28;
  --bg-hover:       #20253200;
  --bg-input:       #1a1e28;
  --bg-sidebar:     #0f1117;

  --accent:         #6366f1;   /* indigo */
  --accent-soft:    #4f52c9;
  --accent-glow:    rgba(99,102,241,0.15);
  --accent-2:       #8b5cf6;   /* violet */

  --text-primary:   #e8eaf0;
  --text-secondary: #8b90a0;
  --text-muted:     #4e5466;
  --text-accent:    #818cf8;

  --border:         rgba(255,255,255,0.06);
  --border-focus:   rgba(99,102,241,0.5);
  --border-hover:   rgba(255,255,255,0.12);

  --success:        #10b981;
  --success-bg:     rgba(16,185,129,0.1);
  --warning:        #f59e0b;
  --warning-bg:     rgba(245,158,11,0.1);
  --danger:         #ef4444;
  --danger-bg:      rgba(239,68,68,0.1);
  --info:           #3b82f6;
  --info-bg:        rgba(59,130,246,0.1);

  --sidebar-w:      240px;
  --topbar-h:       56px;
  --radius-sm:      6px;
  --radius-md:      10px;
  --radius-lg:      14px;
  --radius-xl:      18px;

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

  --shadow-sm:      0 1px 3px rgba(0,0,0,0.4);
  --shadow-md:      0 4px 16px rgba(0,0,0,0.5);
  --shadow-lg:      0 8px 32px rgba(0,0,0,0.6);

  --transition:     0.18s ease;
}

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

html { font-size: 15px; }

body {
  font-family: var(--font-sans);
  background: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

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

img { max-width: 100%; }

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

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

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

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}
.sidebar-brand-icon {
  width: 32px; height: 32px;
  background: var(--accent);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 700; color: #fff;
  flex-shrink: 0;
}
.sidebar-brand-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}
.sidebar-brand-name span {
  color: var(--text-accent);
}

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

.nav-section-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 12px 20px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 20px;
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 450;
  border-radius: 0;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  position: relative;
}
.nav-item:hover {
  background: rgba(255,255,255,0.04);
  color: var(--text-primary);
}
.nav-item.active {
  background: var(--accent-glow);
  color: var(--text-accent);
  font-weight: 500;
}
.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 4px; bottom: 4px;
  width: 3px;
  background: var(--accent);
  border-radius: 0 2px 2px 0;
}
.nav-item i { font-size: 17px; width: 20px; text-align: center; flex-shrink: 0; }
.nav-item .nav-badge {
  margin-left: auto;
  font-size: 10px;
  font-weight: 600;
  background: var(--accent);
  color: #fff;
  padding: 1px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}

.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
}
.sidebar-user {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  transition: background var(--transition);
  cursor: pointer;
}
.sidebar-user:hover { background: rgba(255,255,255,0.04); }
.user-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600; color: #fff;
  flex-shrink: 0;
  text-transform: uppercase;
}
.user-avatar.lg { width: 42px; height: 42px; font-size: 15px; }
.user-info { flex: 1; min-width: 0; }
.user-name { font-size: 0.8rem; font-weight: 500; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 0.7rem; color: var(--text-muted); }

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

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

.topbar-title {
  font-size: 1rem; font-weight: 600;
  color: var(--text-primary);
  flex: 1;
}
.topbar-title small {
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--text-secondary);
  margin-left: 8px;
}

.search-box {
  position: relative;
}
.search-box input {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  padding: 7px 12px 7px 34px;
  font-size: 0.8rem;
  width: 220px;
  transition: border-color var(--transition), width var(--transition);
  outline: none;
}
.search-box input:focus {
  border-color: var(--border-focus);
  width: 280px;
}
.search-box input::placeholder { color: var(--text-muted); }
.search-box i {
  position: absolute;
  left: 10px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 16px;
}

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

.icon-btn {
  width: 34px; height: 34px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
  font-size: 17px;
  position: relative;
}
.icon-btn:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border-color: var(--border-hover);
}
.icon-btn .badge {
  position: absolute; top: -4px; right: -4px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--danger);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--bg-surface);
}

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

/* ═══════════════════════════════════════════
   COMPONENTS
═══════════════════════════════════════════ */

/* ── KPI Cards ── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}
.kpi-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  display: flex; flex-direction: column; gap: 8px;
  transition: border-color var(--transition), transform var(--transition);
  cursor: default;
}
.kpi-card:hover { border-color: var(--border-hover); transform: translateY(-1px); }
.kpi-card.clickable { cursor: pointer; }
.kpi-label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.kpi-value {
  font-size: 1.9rem;
  font-weight: 700;
  line-height: 1;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}
.kpi-card .kpi-accent { color: var(--accent); }
.kpi-card .kpi-warning { color: var(--warning); }
.kpi-card .kpi-success { color: var(--success); }
.kpi-card .kpi-danger  { color: var(--danger); }
.kpi-card .kpi-info    { color: var(--info); }
.kpi-card .kpi-muted   { color: var(--text-secondary); }

/* ── Cards / Panels ── */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
}
.card-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
}
.card-body { padding: 20px; }

/* ── Table ── */
.hd-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.845rem;
}
.hd-table thead th {
  padding: 10px 14px;
  text-align: left;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.hd-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
  cursor: pointer;
}
.hd-table tbody tr:last-child { border-bottom: none; }
.hd-table tbody tr:hover { background: rgba(255,255,255,0.025); }
.hd-table td {
  padding: 12px 14px;
  vertical-align: middle;
  color: var(--text-primary);
}
.hd-table td.muted { color: var(--text-secondary); }

.ticket-title-cell {
  display: flex; flex-direction: column; gap: 3px;
}
.ticket-no {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
}
.ticket-title {
  font-weight: 500;
  color: var(--text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── Status & Priority badges ── */
.status-badge,
.priority-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  white-space: nowrap;
}
.priority-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

/* ── Dept tag chips ── */
.dept-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.68rem;
  font-weight: 600;
  background: rgba(99,102,241,0.15);
  color: var(--text-accent);
  border: 1px solid rgba(99,102,241,0.3);
  white-space: nowrap;
}

/* ── Tags ── */
.tag-chip {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.68rem;
  font-weight: 600;
  background: rgba(255,255,255,0.06);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  cursor: default;
}

/* ── Filter bar ── */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.filter-bar select,
.filter-bar input[type="text"],
.filter-bar input[type="date"] {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 7px 10px;
  font-size: 0.8rem;
  outline: none;
  transition: border-color var(--transition);
  min-width: 0;
}
.filter-bar select:focus,
.filter-bar input:focus { border-color: var(--border-focus); }
.filter-bar select option { background: var(--bg-elevated); }

.filter-bar .spacer { flex: 1; }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.845rem;
  font-weight: 500;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  text-decoration: none;
  line-height: 1;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.btn-primary:hover { background: var(--accent-soft); border-color: var(--accent-soft); color: #fff; }

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

.btn-danger {
  background: var(--danger-bg);
  color: var(--danger);
  border-color: rgba(239,68,68,0.3);
}
.btn-danger:hover { background: var(--danger); color: #fff; }

.btn-sm { padding: 5px 11px; font-size: 0.78rem; }
.btn-xs { padding: 3px 8px; font-size: 0.72rem; border-radius: 4px; }
.btn i { font-size: 16px; }

/* ── Forms ── */
.form-group { margin-bottom: 18px; }
.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.form-label span.req { color: var(--danger); margin-left: 2px; }

.form-control {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 9px 12px;
  font-size: 0.845rem;
  font-family: var(--font-sans);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
.form-control:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
}
.form-control::placeholder { color: var(--text-muted); }
.form-control option { background: var(--bg-elevated); }

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

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 30px;
}

/* Multi-select checkboxes for departments */
.dept-checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
}
.dept-checkbox-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
}
.dept-checkbox-item:hover { border-color: var(--border-hover); }
.dept-checkbox-item input[type="checkbox"] { accent-color: var(--accent); width: 14px; height: 14px; }
.dept-checkbox-item.checked {
  border-color: rgba(99,102,241,0.5);
  background: var(--accent-glow);
}
.dept-checkbox-item label { font-size: 0.8rem; color: var(--text-primary); cursor: pointer; }

/* ── File upload drop zone ── */
.file-drop {
  border: 2px dashed var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.84rem;
  transition: border-color var(--transition), background var(--transition);
  cursor: pointer;
}
.file-drop:hover, .file-drop.drag-over {
  border-color: rgba(99,102,241,0.5);
  background: var(--accent-glow);
  color: var(--text-accent);
}
.file-drop i { font-size: 28px; margin-bottom: 8px; display: block; }
.file-preview-list { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 8px; text-align: left; }
.file-preview-item {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  color: var(--text-secondary);
  max-width: 220px;
}
.file-preview-item i { color: var(--accent); font-size: 15px; flex-shrink: 0; }
.file-preview-item .fname { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-preview-item .fsize { color: var(--text-muted); white-space: nowrap; }
.file-preview-item .remove-file { margin-left: auto; color: var(--text-muted); cursor: pointer; flex-shrink: 0; }
.file-preview-item .remove-file:hover { color: var(--danger); }

/* ── Ticket detail ── */
.ticket-detail-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 20px;
  align-items: start;
}
.ticket-body-section { margin-bottom: 24px; }
.ticket-description {
  font-size: 0.9rem;
  line-height: 1.75;
  color: var(--text-secondary);
  background: var(--bg-elevated);
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

/* ── Comment / timeline ── */
.timeline { display: flex; flex-direction: column; gap: 0; }
.timeline-item {
  display: flex; gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.timeline-item:last-child { border-bottom: none; }
.timeline-avatar { flex-shrink: 0; padding-top: 2px; }
.timeline-content { flex: 1; min-width: 0; }
.timeline-meta {
  display: flex; align-items: baseline; gap: 8px;
  margin-bottom: 6px; flex-wrap: wrap;
}
.timeline-author { font-size: 0.84rem; font-weight: 600; color: var(--text-primary); }
.timeline-time   { font-size: 0.72rem; color: var(--text-muted); }
.timeline-type-badge {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 10px;
}
.type-internal  { background: rgba(245,158,11,0.15); color: var(--warning); }
.type-system    { background: rgba(99,102,241,0.1);  color: var(--text-accent); }
.type-public    { background: rgba(16,185,129,0.1);  color: var(--success); }

.timeline-body {
  font-size: 0.875rem;
  line-height: 1.7;
  color: var(--text-secondary);
}
.timeline-body strong { color: var(--text-primary); font-weight: 600; }

/* ── Sidebar meta panel (ticket detail) ── */
.meta-panel { display: flex; flex-direction: column; gap: 14px; }
.meta-item { display: flex; flex-direction: column; gap: 4px; }
.meta-label { font-size: 0.68rem; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-muted); }
.meta-value { font-size: 0.84rem; color: var(--text-primary); }
.meta-divider { border: none; border-top: 1px solid var(--border); }

/* ── Assignment card (per dept) ── */
.assignment-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 10px;
}
.assignment-card-header {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px;
}
.assignment-dept-name { font-size: 0.84rem; font-weight: 600; color: var(--text-primary); }

/* ── Comment form ── */
.comment-form-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-top: 16px;
}
.comment-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
}
.comment-tab {
  padding: 10px 16px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all var(--transition);
  background: none;
  border-top: none; border-left: none; border-right: none;
}
.comment-tab.active {
  color: var(--text-accent);
  border-bottom-color: var(--accent);
}
.comment-form-body { padding: 14px; }

/* ── Alerts / flash ── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.84rem;
  margin-bottom: 16px;
  display: flex; align-items: center; gap: 10px;
}
.alert-success { background: var(--success-bg); color: var(--success); border: 1px solid rgba(16,185,129,0.2); }
.alert-error   { background: var(--danger-bg);  color: var(--danger);  border: 1px solid rgba(239,68,68,0.2); }
.alert-warning { background: var(--warning-bg); color: var(--warning); border: 1px solid rgba(245,158,11,0.2); }
.alert-info    { background: var(--info-bg);    color: var(--info);    border: 1px solid rgba(59,130,246,0.2); }

/* ── Empty state ── */
.empty-state {
  text-align: center;
  padding: 60px 24px;
  color: var(--text-muted);
}
.empty-state i { font-size: 42px; margin-bottom: 14px; display: block; opacity: 0.4; }
.empty-state p { font-size: 0.9rem; margin-bottom: 16px; }

/* ── Pagination ── */
.pagination {
  display: flex; align-items: center; gap: 4px;
  justify-content: flex-end;
  padding: 14px 0 0;
}
.page-btn {
  width: 30px; height: 30px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.8rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
}
.page-btn:hover { background: var(--bg-elevated); color: var(--text-primary); }
.page-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.page-btn:disabled { opacity: 0.3; cursor: not-allowed; }

/* ── Modal ── */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.65);
  z-index: 200;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.modal {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 560px;
  box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column;
  max-height: 90vh;
  overflow: hidden;
}
.modal-header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-title { font-size: 1rem; font-weight: 600; }
.modal-body { padding: 22px; overflow-y: auto; flex: 1; }
.modal-footer {
  padding: 14px 22px;
  border-top: 1px solid var(--border);
  display: flex; gap: 10px; justify-content: flex-end;
}

/* ── Notification dropdown ── */
.notif-dropdown {
  position: absolute; top: calc(var(--topbar-h) - 4px); right: 24px;
  width: 340px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 300;
}
.notif-item {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 0.82rem;
  color: var(--text-secondary);
  display: flex; gap: 10px; align-items: flex-start;
  transition: background var(--transition);
  cursor: pointer;
}
.notif-item:hover { background: rgba(255,255,255,0.03); }
.notif-item.unread { background: rgba(99,102,241,0.05); }
.notif-item.unread::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  margin-top: 5px;
  flex-shrink: 0;
}
.notif-time { font-size: 0.7rem; color: var(--text-muted); margin-top: 2px; }

/* ── Login page ── */
.login-page {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-base);
  background-image: radial-gradient(ellipse at 30% 20%, rgba(99,102,241,0.07) 0%, transparent 60%),
                    radial-gradient(ellipse at 70% 80%, rgba(139,92,246,0.05) 0%, transparent 60%);
}
.login-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 40px;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow-lg);
}
.login-logo {
  text-align: center;
  margin-bottom: 28px;
}
.login-logo-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 52px; height: 52px;
  background: var(--accent);
  border-radius: var(--radius-md);
  font-size: 26px; font-weight: 800; color: #fff;
  margin-bottom: 12px;
}
.login-logo h1 { font-size: 1.1rem; font-weight: 600; color: var(--text-primary); }
.login-logo p  { font-size: 0.8rem; color: var(--text-muted); margin-top: 3px; }

/* ── Responsive ── */
.sidebar-toggle { display: none; }

@media (max-width: 900px) {
  :root { --sidebar-w: 0px; }
  .sidebar {
    transform: translateX(-240px);
    width: 240px;
  }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .sidebar-toggle { display: flex; }
  .ticket-detail-layout { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 560px) {
  .page-body { padding: 14px; }
  .filter-bar { flex-direction: column; align-items: stretch; }
  .topbar { padding: 0 14px; }
  .search-box input { width: 150px; }
  .search-box input:focus { width: 180px; }
}

/* ── Utility ── */
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8  { gap: 8px;  }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.mt-8   { margin-top: 8px; }
.mt-16  { margin-top: 16px; }
.mt-24  { margin-top: 24px; }
.mb-16  { margin-bottom: 16px; }
.mb-24  { margin-bottom: 24px; }
.text-muted   { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-danger  { color: var(--danger); }
.text-accent  { color: var(--text-accent); }
.fw-600  { font-weight: 600; }
.fs-sm   { font-size: 0.78rem; }
.text-right { text-align: right; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.w-100 { width: 100%; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
@media (max-width: 700px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }
