/* ============================================================
   IT Tracker — Application styles
   Design language: restrained corporate dashboard
   Typography: Manrope (UI) + JetBrains Mono (code/numbers)
   ============================================================ */

/* ---------- Design tokens ---------- */
:root {
  --font-sans: 'Manrope', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', Consolas, monospace;

  /* Light theme */
  --bg:           #f7f8fb;
  --surface:      #ffffff;
  --surface-2:    #f1f3f8;
  --surface-3:    #e7eaf2;
  --border:       #e4e7ef;
  --border-strong:#cfd4e0;

  --text:         #0f172a;
  --text-muted:   #64748b;
  --text-soft:    #94a3b8;

  --primary:      #1d4ed8;
  --primary-600:  #1d4ed8;
  --primary-700:  #1e40af;
  --primary-50:   #eff4ff;

  --success: #059669; --success-50: #ecfdf5;
  --warning: #d97706; --warning-50: #fffbeb;
  --danger:  #dc2626; --danger-50:  #fef2f2;
  --info:    #0891b2; --info-50:    #ecfeff;
  --purple:  #7c3aed; --purple-50:  #f5f3ff;

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06);
  --shadow:    0 4px 12px rgba(15, 23, 42, .06), 0 2px 4px rgba(15, 23, 42, .04);
  --shadow-lg: 0 12px 28px rgba(15, 23, 42, .08);

  --radius:    10px;
  --radius-lg: 14px;

  --sidebar-w: 248px;
}

[data-theme="dark"] {
  --bg:           #0b0f17;
  --surface:      #111827;
  --surface-2:    #0f172a;
  --surface-3:    #1e293b;
  --border:       #1f2937;
  --border-strong:#334155;

  --text:         #e2e8f0;
  --text-muted:   #94a3b8;
  --text-soft:    #64748b;

  --primary:      #60a5fa;
  --primary-600:  #3b82f6;
  --primary-700:  #2563eb;
  --primary-50:   rgba(59, 130, 246, .12);

  --success-50: rgba(5, 150, 105, .15);
  --warning-50: rgba(217, 119, 6, .15);
  --danger-50:  rgba(220, 38, 38, .15);
  --info-50:    rgba(8, 145, 178, .15);
  --purple-50:  rgba(124, 58, 237, .15);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow:    0 4px 12px rgba(0, 0, 0, .35);
  --shadow-lg: 0 12px 28px rgba(0, 0, 0, .45);
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -0.01em; color: var(--text); }
h1 { font-size: 26px; line-height: 1.15; }
h2 { font-size: 20px; }
h3 { font-size: 16px; }
h4 { font-size: 14px; }
p  { margin: 0; }
a  { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
code, .mono { font-family: var(--font-mono); font-size: 0.92em; }

.muted { color: var(--text-muted); }
.text-right { text-align: right; }
.nowrap { white-space: nowrap; }
.d-none { display: none !important; }
.d-inline { display: inline-block; }
.mb-0 { margin-bottom: 0; }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }

/* ---------- Shell ---------- */
.app-shell { display: flex; min-height: 100vh; }
.app-main  { flex: 1; min-width: 0; margin-left: var(--sidebar-w); display: flex; flex-direction: column; }
.app-content { flex: 1; padding: 28px 36px 48px; max-width: 1600px; width: 100%; }

/* ---------- Sidebar ---------- */
.sidebar {
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  position: fixed; inset: 0 auto 0 0;
  display: flex; flex-direction: column;
  z-index: 50;
}
.sidebar-brand {
  padding: 20px 20px 18px;
  display: flex; align-items: center; gap: 12px;
  border-bottom: 1px solid var(--border);
}
.brand-mark {
  width: 40px; height: 40px; border-radius: 10px;
  background: linear-gradient(135deg, var(--primary-600), var(--primary-700));
  color: #fff; display: grid; place-items: center;
  font-size: 20px; box-shadow: var(--shadow);
}
.brand-text { display: flex; flex-direction: column; }
.brand-name { font-weight: 800; font-size: 15px; letter-spacing: -0.01em; }
.brand-sub  { font-size: 11px; color: var(--text-muted); letter-spacing: 0.06em; text-transform: uppercase; }

.sidebar-nav { flex: 1; overflow-y: auto; padding: 12px 12px 16px; }
.nav-section {
  padding: 14px 12px 6px;
  font-size: 10px; font-weight: 700;
  color: var(--text-soft);
  text-transform: uppercase; letter-spacing: 0.08em;
}
.nav-link {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; margin: 2px 0;
  border-radius: 8px;
  color: var(--text-muted);
  font-weight: 500;
  position: relative;
  transition: background .15s, color .15s, transform .15s;
}
.nav-link:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav-link.active {
  background: var(--primary-50);
  color: var(--primary);
  font-weight: 600;
}
.nav-link.active::before {
  content: ''; position: absolute; left: -12px; top: 8px; bottom: 8px;
  width: 3px; background: var(--primary); border-radius: 0 3px 3px 0;
}
.nav-link i { font-size: 16px; width: 18px; text-align: center; }
.notif-badge {
  margin-left: auto; background: var(--danger); color: #fff;
  font-size: 10px; padding: 2px 6px; border-radius: 999px; font-weight: 700;
}

.sidebar-footer {
  padding: 12px; border-top: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px;
}
.user-pill { flex: 1; display: flex; align-items: center; gap: 10px; min-width: 0; }
.user-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, var(--purple), var(--primary));
  color: #fff; font-weight: 700; display: grid; place-items: center;
}
.user-meta { display: flex; flex-direction: column; min-width: 0; }
.user-name { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 11px; color: var(--text-muted); }
.logout-form { margin: 0; }
.logout-btn {
  background: var(--surface-2); border: 1px solid var(--border);
  width: 36px; height: 36px; border-radius: 8px;
  color: var(--text-muted); cursor: pointer;
  display: grid; place-items: center;
  transition: all .15s;
}
.logout-btn:hover { background: var(--danger-50); color: var(--danger); border-color: var(--danger); }

/* ---------- Topbar ---------- */
.topbar {
  height: 64px;
  padding: 0 36px;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  position: sticky; top: 0; z-index: 20;
}
.topbar-left { display: flex; align-items: center; gap: 14px; }
.topbar-title { font-weight: 700; font-size: 15px; color: var(--text-muted); }
.topbar-right { display: flex; align-items: center; gap: 8px; }
.sidebar-toggle {
  display: none;
  background: none; border: none; color: var(--text); font-size: 20px; cursor: pointer;
}

.icon-btn {
  background: transparent; border: 1px solid transparent;
  color: var(--text-muted);
  width: 36px; height: 36px; border-radius: 8px;
  display: inline-grid; place-items: center; cursor: pointer;
  position: relative;
  transition: all .15s;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn.danger:hover { background: var(--danger-50); color: var(--danger); }
.notif-dot {
  position: absolute; top: 7px; right: 8px;
  width: 8px; height: 8px; background: var(--danger);
  border-radius: 50%; border: 2px solid var(--surface);
}

[data-theme="light"] .theme-icon-dark  { display: none; }
[data-theme="dark"]  .theme-icon-light { display: none; }

/* ---------- Page header ---------- */
.page-header {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 24px; margin-bottom: 24px; flex-wrap: wrap;
}
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.kicker {
  font-size: 11px; font-weight: 700; letter-spacing: 0.1em;
  color: var(--primary); text-transform: uppercase; display: block; margin-bottom: 6px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 16px;
  border-radius: 8px; border: 1px solid transparent;
  font-family: inherit; font-size: 13px; font-weight: 600;
  cursor: pointer; line-height: 1;
  transition: transform .05s, background .15s, border-color .15s, color .15s;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-primary {
  background: var(--primary); color: #fff;
  box-shadow: 0 1px 2px rgba(29, 78, 216, .25);
}
.btn-primary:hover { background: var(--primary-700); color: #fff; }
.btn-ghost {
  background: var(--surface); color: var(--text); border-color: var(--border);
}
.btn-ghost:hover { background: var(--surface-2); }
.btn-dark {
  background: var(--text); color: var(--surface); border-color: var(--text);
}
.btn-dark:hover { opacity: 0.92; color: var(--surface); }
.btn-primary-lg {
  width: 100%; background: var(--primary); color: #fff; border: none;
  padding: 14px 18px; border-radius: 10px; font-weight: 700; font-size: 14px;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  cursor: pointer; transition: all .15s;
}
.btn-primary-lg:hover { background: var(--primary-700); }

/* Dropdown */
.dropdown { position: relative; }
.dropdown-toggle::after { content: ' ▾'; font-size: 10px; }
.dropdown-menu {
  position: absolute; right: 0; top: calc(100% + 4px);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; box-shadow: var(--shadow-lg);
  min-width: 200px; padding: 6px; z-index: 30;
  display: none;
}
.dropdown.open .dropdown-menu { display: block; }
.dropdown-menu a {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 6px;
  color: var(--text); font-size: 13px;
}
.dropdown-menu a:hover { background: var(--surface-2); text-decoration: none; }

/* ---------- Panels / cards ---------- */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
  overflow: hidden;
}
.panel-header {
  padding: 18px 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  border-bottom: 1px solid var(--border);
}
.panel-header h3 { margin: 0; font-size: 15px; }
.panel-header p  { font-size: 12px; margin-top: 2px; }
.panel-body { padding: 18px 20px; }
.panel-lg { grid-column: span 2; }

/* ---------- KPI grid ---------- */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}
.kpi-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 18px;
  display: flex; align-items: flex-start; gap: 14px;
  position: relative; overflow: hidden;
  transition: transform .15s, box-shadow .15s;
  color: var(--text);
  text-decoration: none;
}
.kpi-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); text-decoration: none; }
.kpi-card::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(135deg, var(--_accent, var(--primary-50)) 0%, transparent 55%);
  opacity: .55; pointer-events: none;
}
.kpi-icon {
  width: 44px; height: 44px; border-radius: 10px;
  background: var(--_accent-solid, var(--primary));
  color: #fff; display: grid; place-items: center; font-size: 20px;
  flex-shrink: 0; z-index: 1;
}
.kpi-body { z-index: 1; display: flex; flex-direction: column; min-width: 0; }
.kpi-label { font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); }
.kpi-value { font-size: 28px; font-weight: 800; line-height: 1.1; margin: 2px 0 4px; font-family: var(--font-mono); }
.kpi-delta { font-size: 12px; color: var(--text-muted); }

.accent-indigo { --_accent: var(--primary-50);  --_accent-solid: var(--primary); }
.accent-amber  { --_accent: var(--warning-50);  --_accent-solid: var(--warning); }
.accent-green  { --_accent: var(--success-50);  --_accent-solid: var(--success); }
.accent-rose   { --_accent: var(--danger-50);   --_accent-solid: var(--danger);  }
.accent-purple { --_accent: var(--purple-50);   --_accent-solid: var(--purple);  }
.accent-teal   { --_accent: var(--info-50);     --_accent-solid: var(--info);    }
.accent-blue   { --_accent: var(--primary-50);  --_accent-solid: var(--primary); }
.accent-orange { --_accent: var(--warning-50);  --_accent-solid: var(--warning); }

/* ---------- Chart grid ---------- */
.chart-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 18px;
}
.chart-grid .panel-lg { grid-column: span 2; }
@media (max-width: 1100px) { .chart-grid .panel-lg { grid-column: span 1; } }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
.data-table {
  width: 100%; border-collapse: separate; border-spacing: 0;
  font-size: 13px;
}
.data-table thead th {
  text-align: left; font-weight: 700; font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-muted);
  padding: 12px 16px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.data-table tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.data-table tbody tr:hover td { background: var(--surface-2); }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table .desc { max-width: 320px; overflow: hidden; text-overflow: ellipsis; }
.sort-link { color: inherit; display: inline-flex; align-items: center; gap: 2px; }
.sort-link:hover { color: var(--primary); text-decoration: none; }
.sort-arrow { color: var(--primary); }
.link-strong { font-weight: 600; }

.user-row { display: inline-flex; align-items: center; gap: 10px; }
.avatar-sm {
  width: 28px; height: 28px; border-radius: 50%;
  background: linear-gradient(135deg, var(--purple), var(--primary));
  color: #fff; font-weight: 700; font-size: 11px;
  display: grid; place-items: center;
}

.empty-state {
  text-align: center; padding: 48px 20px; color: var(--text-muted);
}
.empty-state i { font-size: 40px; opacity: .45; display: block; margin-bottom: 8px; }

/* ---------- Badges / chips ---------- */
.status-badge, .priority-badge, .chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.04em;
  border: 1px solid transparent;
}
.chip { background: var(--surface-2); color: var(--text-muted); border-color: var(--border); text-transform: none; letter-spacing: 0; font-weight: 500; }
.chip-ok     { background: var(--success-50); color: var(--success); }
.chip-warn   { background: var(--warning-50); color: var(--warning); }
.chip-danger { background: var(--danger-50);  color: var(--danger);  }
.chip-muted  { background: var(--surface-3);  color: var(--text-soft); }

.badge-open       { background: var(--warning-50); color: var(--warning); }
.badge-progress   { background: var(--info-50);    color: var(--info); }
.badge-escalated  { background: var(--danger-50);  color: var(--danger); }
.badge-resolved   { background: var(--success-50); color: var(--success); }
.badge-closed     { background: var(--surface-3);  color: var(--text-muted); }

.prio-low       { background: var(--surface-3);  color: var(--text-muted); }
.prio-medium    { background: var(--info-50);    color: var(--info); }
.prio-high      { background: var(--warning-50); color: var(--warning); }
.prio-critical  { background: var(--danger-50);  color: var(--danger); }

/* ---------- Filter bar ---------- */
.filter-bar {
  display: grid;
  grid-template-columns: 2fr repeat(5, 1fr) auto auto;
  gap: 10px;
  padding: 14px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 18px;
  align-items: center;
}
@media (max-width: 1200px) { .filter-bar { grid-template-columns: 1fr 1fr; } }
.filter-search, .filter-search.inline {
  position: relative;
  display: flex; align-items: center;
}
.filter-search i { position: absolute; left: 12px; color: var(--text-soft); font-size: 14px; }
.filter-search input {
  width: 100%;
  padding: 10px 12px 10px 36px;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--bg); color: var(--text);
  font-family: inherit; font-size: 13px;
}
.filter-select, .filter-input {
  padding: 10px 12px;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--bg); color: var(--text);
  font-family: inherit; font-size: 13px;
}
.filter-bar select, .filter-bar input:focus,
.filter-search input:focus { outline: 2px solid var(--primary-50); border-color: var(--primary); }

/* ---------- Forms ---------- */
.form-grid { padding: 22px 24px; }
.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.field .label {
  font-size: 12px; font-weight: 600; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.04em;
}
.field .label em { color: var(--danger); font-style: normal; margin-left: 2px; }
.field input, .field select, .field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--bg); color: var(--text);
  font-family: inherit; font-size: 14px;
  transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-50);
}
.field textarea { resize: vertical; min-height: 80px; }

.form-section {
  font-size: 13px; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-muted); margin: 18px 0 8px;
  padding-bottom: 6px; border-bottom: 1px solid var(--border);
}
.form-actions {
  display: flex; justify-content: flex-end; gap: 10px;
  margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--border);
}
.chk { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text); cursor: pointer; }
.chk input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--primary); }

/* ---------- Flash messages ---------- */
.flash {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 16px; margin-bottom: 16px;
  border-radius: var(--radius);
  border: 1px solid;
  font-size: 13px;
}
.flash i { font-size: 16px; margin-top: 1px; }
.flash-success { background: var(--success-50); border-color: var(--success); color: var(--success); }
.flash-error   { background: var(--danger-50);  border-color: var(--danger);  color: var(--danger);  }

/* ---------- Pagination ---------- */
.pagination {
  display: flex; justify-content: center; gap: 4px;
  padding: 16px; border-top: 1px solid var(--border);
}
.page-link {
  padding: 7px 12px; border-radius: 8px;
  font-size: 13px; font-weight: 600;
  color: var(--text-muted);
  border: 1px solid var(--border);
  background: var(--surface);
}
.page-link:hover { background: var(--surface-2); text-decoration: none; color: var(--text); }
.page-link.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.page-link.disabled { opacity: .4; pointer-events: none; }

/* ---------- Incident detail ---------- */
.incident-layout {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 20px;
}
@media (max-width: 980px) { .incident-layout { grid-template-columns: 1fr; } }
.defs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  padding: 10px 20px 18px;
}
.defs > div {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 3px;
}
.defs dt { font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); font-weight: 600; }
.defs dd { margin: 0; font-weight: 600; font-size: 14px; }

.incident-section { padding: 16px 20px; border-top: 1px solid var(--border); }
.incident-section h4 { margin-bottom: 6px; color: var(--text-muted); text-transform: uppercase; font-size: 11px; letter-spacing: 0.06em; }

.comment-list { list-style: none; margin: 0; padding: 0; }
.comment {
  padding: 16px 20px; display: flex; gap: 12px;
  border-bottom: 1px solid var(--border);
}
.comment.internal { background: var(--warning-50); }
.comment-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, var(--purple), var(--primary));
  color: #fff; display: grid; place-items: center;
  font-weight: 700; flex-shrink: 0;
}
.comment-body { flex: 1; }
.comment-meta { display: flex; gap: 10px; align-items: center; font-size: 13px; margin-bottom: 4px; }
.comment-form { padding: 16px 20px; border-top: 1px solid var(--border); }
.comment-form textarea {
  width: 100%; padding: 10px 12px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--bg); color: var(--text);
  font-family: inherit; font-size: 13px; resize: vertical; min-height: 70px;
}
.comment-form-actions {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 10px;
}

/* ---------- Login ---------- */
.login-body {
  margin: 0; min-height: 100vh;
  background: radial-gradient(1200px 600px at 85% -10%, rgba(59,130,246,.12), transparent 55%),
              radial-gradient(900px 500px at -10% 110%, rgba(124,58,237,.12), transparent 60%),
              var(--bg);
  display: flex; align-items: center; justify-content: center;
}
.login-layout {
  width: 100%; max-width: 1100px;
  display: grid; grid-template-columns: 1.1fr 1fr; gap: 48px;
  padding: 40px;
}
@media (max-width: 900px) {
  .login-layout { grid-template-columns: 1fr; }
  .login-brand { display: none; }
}
.login-brand { display: flex; flex-direction: column; justify-content: space-between; padding: 20px 0; }
.brand-block .brand-logo {
  width: 64px; height: 64px; border-radius: 16px;
  background: linear-gradient(135deg, var(--primary-600), var(--purple));
  color: #fff; display: grid; place-items: center;
  font-size: 28px; box-shadow: var(--shadow-lg); margin-bottom: 28px;
}
.brand-title { font-size: 36px; letter-spacing: -0.02em; margin-bottom: 10px; }
.brand-tag { font-size: 16px; color: var(--text-muted); max-width: 420px; line-height: 1.55; }
.brand-features { list-style: none; padding: 0; margin: 36px 0; display: flex; flex-direction: column; gap: 14px; }
.brand-features li {
  display: flex; align-items: center; gap: 12px;
  color: var(--text); font-size: 14px; font-weight: 500;
}
.brand-features i {
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--primary-50); color: var(--primary);
  display: grid; place-items: center;
}
.brand-footer { font-size: 12px; color: var(--text-soft); }

.login-panel { display: flex; align-items: center; justify-content: center; }
.login-card {
  width: 100%; max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 36px;
  box-shadow: var(--shadow-lg);
}
.login-card-header { text-align: left; margin-bottom: 26px; }
.login-card-header h2 { font-size: 22px; margin: 6px 0 6px; }
.login-card-header .sub { color: var(--text-muted); font-size: 13px; }
.login-form .field { margin-bottom: 16px; }
.input-wrap {
  position: relative; display: flex; align-items: center;
}
.input-wrap > i { position: absolute; left: 14px; color: var(--text-soft); font-size: 15px; }
.input-wrap input {
  width: 100%; padding: 13px 42px 13px 42px;
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--bg); color: var(--text); font-size: 14px;
}
.input-wrap input:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-50);
}
.reveal {
  position: absolute; right: 8px;
  background: transparent; border: none; color: var(--text-muted);
  width: 32px; height: 32px; border-radius: 6px; cursor: pointer;
}
.reveal:hover { background: var(--surface-2); color: var(--text); }
.login-hints { margin-top: 24px; font-size: 12px; color: var(--text-muted); }
.login-hints details summary { cursor: pointer; font-weight: 600; }
.login-hints ul { margin: 8px 0 4px 16px; padding: 0; }
.login-hints code { background: var(--surface-2); padding: 2px 6px; border-radius: 4px; }

/* ---------- Import dropzone ---------- */
.grid-2 { display: grid; grid-template-columns: 1.3fr 1fr; gap: 20px; margin-bottom: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; margin-bottom: 20px; }
@media (max-width: 900px) { .grid-2 { grid-template-columns: 1fr; } }

.upload-panel { padding: 20px; }
.drop-zone {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 48px 24px; min-height: 260px;
  border: 2px dashed var(--border-strong); border-radius: var(--radius-lg);
  background: var(--surface-2);
  cursor: pointer; text-align: center;
  transition: all .15s;
}
.drop-zone.dragover { border-color: var(--primary); background: var(--primary-50); }
.drop-zone input[type="file"] { display: none; }
.drop-icon { font-size: 44px; color: var(--primary); margin-bottom: 10px; }
.drop-headline { font-size: 18px; font-weight: 700; }
.drop-sub { color: var(--text-muted); margin-top: 4px; font-size: 13px; }
.drop-file { margin-top: 12px; font-family: var(--font-mono); color: var(--primary); font-weight: 600; }

.col-list { list-style: none; padding: 0 20px 20px; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.col-list li { padding: 8px 12px; background: var(--surface-2); border-radius: 6px; }

.map-grid { padding: 16px 20px; display: flex; flex-wrap: wrap; gap: 8px; }
.map-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 12px; border-radius: 999px;
  background: var(--surface-2); font-size: 12px;
  border: 1px solid var(--border);
}
.map-chip.ok { background: var(--success-50); border-color: var(--success); color: var(--success); }
.map-chip.warn { background: var(--warning-50); border-color: var(--warning); color: var(--warning); }
.map-chip .src { font-family: var(--font-mono); font-weight: 600; }
.map-chip .dst { font-family: var(--font-mono); font-weight: 700; }

.commit-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  margin-bottom: 20px;
}

.export-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 24px;
  display: flex; flex-direction: column; gap: 10px;
  color: var(--text); text-decoration: none;
  transition: all .15s;
}
.export-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); text-decoration: none; }
.export-icon {
  width: 48px; height: 48px; border-radius: 12px;
  background: var(--primary-50); color: var(--primary);
  font-size: 24px; display: grid; place-items: center;
}
.export-card h3 { margin: 0; }
.export-card p { color: var(--text-muted); font-size: 13px; margin: 0; }

/* ---------- Notifications list ---------- */
.notif-list { list-style: none; margin: 0; padding: 0; }
.notif-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.notif-item:last-child { border-bottom: none; }
.notif-item.unread { background: var(--primary-50); }
.notif-dotmark { width: 8px; height: 8px; border-radius: 50%; background: var(--border-strong); flex-shrink: 0; margin-top: 6px; }
.notif-item.unread .notif-dotmark { background: var(--primary); }
.notif-body { flex: 1; min-width: 0; }
.notif-title { font-weight: 700; }
.notif-msg   { color: var(--text-muted); font-size: 13px; margin: 2px 0; }
.notif-meta  { display: flex; gap: 8px; align-items: center; font-size: 12px; color: var(--text-soft); }

/* ---------- Error page ---------- */
.error-body {
  min-height: 100vh; margin: 0; display: grid; place-items: center;
  background: var(--bg); font-family: var(--font-sans);
}
.error-card {
  text-align: center; padding: 48px 32px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow);
  max-width: 420px;
}
.error-code {
  font-family: var(--font-mono);
  font-size: 72px; font-weight: 800; line-height: 1;
  background: linear-gradient(135deg, var(--primary), var(--purple));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  margin-bottom: 10px;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform .25s;
  }
  .sidebar.open { transform: translateX(0); }
  .app-main { margin-left: 0; }
  .app-content { padding: 20px; }
  .topbar { padding: 0 20px; }
  .sidebar-toggle { display: inline-grid; place-items: center; width: 36px; height: 36px; }
  .page-header { flex-direction: column; align-items: flex-start; gap: 12px; }
  .defs { grid-template-columns: 1fr; }
}

/* Fade-in animation */
.app-content > * { animation: fadeUp .3s ease-out; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
