/* ============================================
   G-TRACKER ASSET MANAGEMENT — STYLES
   Aesthetic: Luxury Dark / Warm Gold / Editorial
============================================ */

:root {
  --bg-base: #0e0c0a;
  --bg-surface: #141210;
  --bg-card: #1a1714;
  --bg-elevated: #221f1b;
  --bg-hover: #2a2520;

  --gold-light: #e8c97a;
  --gold: #c9a96e;
  --gold-dark: #9e7d47;
  --gold-muted: #6b5535;
  --gold-faint: #2e2415;

  --text-primary: #f0e8d8;
  --text-secondary: #a89880;
  --text-muted: #6b5f52;
  --text-inverse: #0e0c0a;

  --status-available: #7eb894;
  --status-available-bg: #1a2e22;
  --status-in_use: #7aade8;
  --status-in_use-bg: #1a2540;
  --status-maintenance: #e8b47a;
  --status-maintenance-bg: #2e2010;
  --status-retired: #9090a0;
  --status-retired-bg: #202028;
  --status-lost: #e87a7a;
  --status-lost-bg: #2e1010;

  --border: #2a2520;
  --border-light: #3a3028;

  --sidebar-w: 260px;
  --topbar-h: 64px;
  --radius: 4px;
  --radius-lg: 8px;

  --font-display: 'Cormorant Garamond', serif;
  --font-body: 'Jost', sans-serif;
  --font-mono: 'DM Mono', monospace;

  --shadow: 0 4px 24px rgba(0,0,0,.5);
  --shadow-lg: 0 8px 48px rgba(0,0,0,.7);
  --glow: 0 0 20px rgba(201,169,110,.12);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 14px;
  line-height: 1.6;
  display: flex;
  min-height: 100vh;
  overflow-x: hidden;
}

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

.sidebar-logo {
  padding: 32px 24px 28px;
  border-bottom: 1px solid var(--border);
}
.logo-text {
  display: block;
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 300;
  letter-spacing: .3em;
  color: var(--gold-light);
  line-height: 1;
}
.logo-sub {
  display: block;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .2em;
  color: var(--text-muted);
  margin-top: 6px;
}

.sidebar-nav {
  flex: 1;
  padding: 20px 0;
  overflow-y: auto;
  min-height: 0;   /* critical: allows flex child to shrink below content size */
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 24px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13px;
  font-weight: 300;
  letter-spacing: .04em;
  transition: all .2s;
  position: relative;
}
.nav-item:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}
.nav-item.active {
  color: var(--gold-light);
  background: var(--gold-faint);
}
.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 2px;
  background: var(--gold);
}
.nav-icon { font-size: 16px; width: 20px; text-align: center; }

.nav-divider {
  padding: 16px 24px 8px;
}
.nav-divider span {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .2em;
  color: var(--text-muted);
  text-transform: uppercase;
}

.footer-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
}
.status-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--status-available);
  box-shadow: 0 0 6px var(--status-available);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%,100% { opacity: 1; }
  50% { opacity: .4; }
}

/* ─── MAIN ────────────────────────────────── */
.main {
  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;
  justify-content: space-between;
  padding: 0 32px;
  position: sticky;
  top: 0; z-index: 50;
}
.topbar-left { display: flex; align-items: center; gap: 16px; }
.topbar-right { display: flex; align-items: center; gap: 16px; }

.sidebar-toggle {
  display: none;
  background: none; border: none;
  color: var(--text-secondary);
  font-size: 20px;
  cursor: pointer;
  padding: 4px;
}

.breadcrumb {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 300;
  color: var(--text-primary);
  letter-spacing: .05em;
}

.search-wrap { position: relative; }
.search-input {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 36px 8px 14px;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 300;
  width: 240px;
  transition: border-color .2s, box-shadow .2s;
  outline: none;
}
.search-input:focus {
  border-color: var(--gold-muted);
  box-shadow: var(--glow);
}
.search-input::placeholder { color: var(--text-muted); }
.search-icon {
  position: absolute;
  right: 10px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 18px;
  pointer-events: none;
}

/* ─── BUTTONS ─────────────────────────────── */
.btn-primary {
  background: var(--gold);
  color: var(--text-inverse);
  border: none;
  border-radius: var(--radius);
  padding: 9px 20px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: .04em;
  cursor: pointer;
  transition: background .2s, transform .1s;
}
.btn-primary:hover { background: var(--gold-light); }
.btn-primary:active { transform: scale(.98); }

.btn-secondary {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 8px 18px;
  font-family: var(--font-body);
  font-size: 13px;
  cursor: pointer;
  transition: all .2s;
}
.btn-secondary:hover { border-color: var(--gold-muted); color: var(--text-primary); }

.btn-icon {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-secondary);
  padding: 6px 10px;
  cursor: pointer;
  font-size: 14px;
  transition: all .2s;
}
.btn-icon:hover { border-color: var(--gold-muted); color: var(--gold); }

.btn-danger {
  background: transparent;
  border: 1px solid #5a2020;
  color: var(--status-lost);
  border-radius: var(--radius);
  padding: 6px 14px;
  font-size: 12px;
  cursor: pointer;
  transition: all .2s;
}
.btn-danger:hover { background: var(--status-lost-bg); }

/* ─── VIEWS ───────────────────────────────── */
.view { padding: 32px; animation: fadeIn .3s ease; }
.hidden { display: none !important; }

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

/* ─── DASHBOARD ───────────────────────────── */
.dashboard-header {
  margin-bottom: 32px;
}
.dashboard-header h1 {
  font-family: var(--font-display);
  font-size: 42px;
  font-weight: 300;
  color: var(--text-primary);
  letter-spacing: .02em;
  line-height: 1.1;
}
.dashboard-header h1 em {
  font-style: italic;
  color: var(--gold);
}
.dashboard-header p {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .1em;
  margin-top: 8px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  position: relative;
  overflow: hidden;
  transition: border-color .2s, box-shadow .2s;
}
.stat-card:hover {
  border-color: var(--gold-muted);
  box-shadow: var(--glow);
}
.stat-card::after {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 60px; height: 60px;
  background: radial-gradient(circle at top right, var(--gold-faint), transparent);
}
.stat-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .15em;
  color: var(--text-muted);
  text-transform: uppercase;
}
.stat-value {
  font-family: var(--font-display);
  font-size: 40px;
  font-weight: 300;
  color: var(--gold-light);
  line-height: 1.1;
  margin: 8px 0 4px;
}
.stat-value.small { font-size: 28px; }
.stat-sub {
  font-size: 12px;
  color: var(--text-muted);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
}
.panel-title {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .2em;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.category-bars { display: flex; flex-direction: column; gap: 14px; }
.cat-bar-item { }
.cat-bar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.cat-bar-name { font-size: 13px; color: var(--text-primary); }
.cat-bar-count {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
}
.cat-bar-track {
  height: 3px;
  background: var(--bg-elevated);
  border-radius: 2px;
  overflow: hidden;
}
.cat-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold-dark), var(--gold));
  border-radius: 2px;
  transition: width .6s ease;
}

.status-pills { display: flex; flex-wrap: wrap; gap: 10px; }
.status-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  flex: 1;
  min-width: 120px;
}
.pill-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.pill-label { font-size: 12px; color: var(--text-secondary); }
.pill-count {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 300;
  margin-left: auto;
}

.recent-list { display: flex; flex-direction: column; gap: 10px; }
.recent-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--bg-elevated);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: border-color .2s;
}
.recent-item:hover { border-color: var(--gold-muted); }
.recent-icon { font-size: 20px; }
.recent-info { flex: 1; min-width: 0; }
.recent-name {
  font-size: 13px;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.recent-meta {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ─── ASSETS TABLE ────────────────────────── */
.assets-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
}
.assets-header h2 {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 300;
  letter-spacing: .02em;
}
.assets-filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.filter-select {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-secondary);
  padding: 8px 14px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 300;
  cursor: pointer;
  outline: none;
  transition: border-color .2s;
}
.filter-select:focus { border-color: var(--gold-muted); }
option { background: var(--bg-card); }

.table-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
table {
  width: 100%;
  border-collapse: collapse;
}
thead {
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
}
th {
  padding: 12px 16px;
  text-align: left;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .15em;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 400;
}
tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background .15s;
  cursor: pointer;
}
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--bg-hover); }
td {
  padding: 14px 16px;
  font-size: 13px;
  color: var(--text-secondary);
  vertical-align: middle;
}
td.asset-name {
  color: var(--text-primary);
  font-weight: 400;
}
td.asset-id {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 400;
  border: 1px solid transparent;
}
.badge-available { background: var(--status-available-bg); color: var(--status-available); border-color: #2a4a36; }
.badge-in_use { background: var(--status-in_use-bg); color: var(--status-in_use); border-color: #1e3558; }
.badge-maintenance { background: var(--status-maintenance-bg); color: var(--status-maintenance); border-color: #4a3518; }
.badge-retired { background: var(--status-retired-bg); color: var(--status-retired); border-color: #303038; }
.badge-lost { background: var(--status-lost-bg); color: var(--status-lost); border-color: #4a1818; }

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

.empty-state {
  text-align: center;
  padding: 64px 32px;
  color: var(--text-muted);
}
.empty-state .empty-icon {
  font-size: 48px;
  display: block;
  margin-bottom: 16px;
  opacity: .4;
}
.empty-state p { font-size: 14px; }

/* ─── MODAL ───────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.7);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn .2s ease;
}
.modal {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  width: 560px;
  max-width: 95vw;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: slideUp .25s ease;
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 28px 20px;
  border-bottom: 1px solid var(--border);
}
.modal-title {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 300;
  color: var(--text-primary);
}
.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
  padding: 4px;
  transition: color .2s;
}
.modal-close:hover { color: var(--text-primary); }
.modal-body { padding: 24px 28px 28px; }

/* ─── FORM ────────────────────────────────── */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group.full { grid-column: 1 / -1; }
.form-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .15em;
  color: var(--text-muted);
  text-transform: uppercase;
}
.form-input, .form-select, .form-textarea {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  padding: 10px 14px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 300;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--gold-muted);
  box-shadow: var(--glow);
}
.form-input::placeholder { color: var(--text-muted); }
.form-textarea { resize: vertical; min-height: 80px; }
.form-select option { background: var(--bg-card); }

.form-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

/* ─── DETAIL VIEW ─────────────────────────── */
.asset-detail { }
.detail-header {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}
.detail-icon { font-size: 40px; }
.detail-meta { flex: 1; }
.detail-name {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 300;
  color: var(--text-primary);
  margin-bottom: 6px;
}
.detail-id {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
}
.detail-actions { display: flex; gap: 8px; align-items: flex-start; }

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.detail-field { }
.detail-field-label {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .15em;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 4px;
}
.detail-field-value {
  font-size: 14px;
  color: var(--text-primary);
}
.detail-notes {
  grid-column: 1 / -1;
  padding: 14px;
  background: var(--bg-elevated);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* ─── TOAST ───────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 24px; right: 24px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.toast {
  background: var(--bg-elevated);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 12px 18px;
  font-size: 13px;
  color: var(--text-primary);
  box-shadow: var(--shadow);
  animation: toastIn .3s ease;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 240px;
}
.toast.success { border-left: 3px solid var(--status-available); }
.toast.error { border-left: 3px solid var(--status-lost); }
.toast.info { border-left: 3px solid var(--gold); }
@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ─── LOADING ─────────────────────────────── */
.loading {
  text-align: center;
  padding: 48px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .1em;
}
.loading::after {
  content: '';
  display: block;
  width: 32px; height: 32px;
  border: 2px solid var(--border);
  border-top-color: var(--gold);
  border-radius: 50%;
  margin: 16px auto 0;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── RESPONSIVE ──────────────────────────── */
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  .sidebar-toggle { display: block; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .stats-grid { grid-template-columns: 1fr; }
  .view { padding: 16px; }
  .topbar { padding: 0 16px; }
  .search-input { width: 160px; }
}

/* ─── LOGIN SCREEN ────────────────────────────────────────────────────── */
.login-screen {
  position: fixed; inset: 0;
  background: var(--bg-base);
  display: flex; align-items: center; justify-content: center;
  z-index: 500;
}
.login-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  width: 400px; max-width: 95vw;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.login-logo {
  padding: 36px 36px 28px;
  border-bottom: 1px solid var(--border);
  text-align: center;
  background: linear-gradient(135deg, var(--bg-elevated), var(--bg-card));
}
.login-body { padding: 32px 36px 24px; display: flex; flex-direction: column; gap: 16px; }
.login-error {
  background: var(--status-lost-bg);
  border: 1px solid #4a1818;
  color: var(--status-lost);
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 13px;
}
.btn-full { width: 100%; justify-content: center; padding: 12px; font-size: 14px; margin-top: 4px; }
.login-footer {
  padding: 16px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
}

/* ─── SIDEBAR FOOTER WITH USER ────────────────────────────────────────── */
.sidebar-footer {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 20px;
  border-top: 1px solid var(--border);
}
.current-user-info { flex: 1; min-width: 0; }
.cu-name { font-size: 13px; color: var(--text-primary); font-weight: 400; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cu-role {
  font-family: var(--font-mono); font-size: 9px; letter-spacing: .15em;
  color: var(--gold-muted); text-transform: uppercase; margin-top: 2px;
}
.btn-logout {
  background: none; border: 1px solid var(--border);
  color: var(--text-muted); border-radius: var(--radius);
  padding: 6px 9px; cursor: pointer; font-size: 14px;
  transition: all .2s; flex-shrink: 0;
}
.btn-logout:hover { border-color: var(--status-lost); color: var(--status-lost); }

/* ─── USERS VIEW ──────────────────────────────────────────────────────── */
.role-badge {
  display: inline-block; padding: 2px 10px; border-radius: 20px;
  font-size: 11px; font-family: var(--font-mono); letter-spacing: .05em;
}
.role-admin   { background: #2a1a40; color: #c07aff; border: 1px solid #4a2a6a; }
.role-editor  { background: var(--status-in_use-bg); color: var(--status-in_use); border: 1px solid #1e3558; }
.role-viewer  { background: var(--bg-elevated); color: var(--text-muted); border: 1px solid var(--border); }
.user-inactive { opacity: .45; }

/* ─── DEPARTMENT TABLE ────────────────────────────────────────────────── */
.dept-table { width: 100%; border-collapse: collapse; }
.dept-table th {
  padding: 8px 12px;
  text-align: left;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .15em;
  color: var(--text-muted);
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
}
.dept-table td {
  padding: 10px 12px;
  font-size: 12px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
}
.dept-table tr:last-child td { border-bottom: none; }
.dept-table tr:hover td { background: var(--bg-hover); }
.dept-table td.dept-name { color: var(--text-primary); font-size: 13px; }
.dept-table td.dept-num  { font-family: var(--font-mono); font-size: 11px; text-align: right; }
.book-value-note {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text-muted);
  letter-spacing: .1em;
  margin-top: 4px;
}

/* ─── LOGO IN SIDEBAR ─────────────────────────────────────────────────── */
.logo-img-wrap {
  position: relative;
  display: inline-block;
  margin-bottom: 10px;
}
.logo-img-wrap img, .login-logo-img-wrap img {
  height: 52px;
  max-width: 180px;
  object-fit: contain;
  border-radius: 4px;
  display: block;
  margin: 0 auto 8px;
}
.logo-upload-btn {
  position: absolute;
  bottom: -4px; right: -4px;
  background: var(--gold-dark);
  color: var(--text-inverse);
  border-radius: 50%;
  width: 20px; height: 20px;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px;
  cursor: pointer;
  opacity: 0;
  transition: opacity .2s;
}
.logo-img-wrap:hover .logo-upload-btn { opacity: 1; }

/* ─── NAV BADGE ───────────────────────────────────────────────────────── */
.nav-badge {
  margin-left: auto;
  background: var(--status-lost);
  color: #fff;
  border-radius: 10px;
  padding: 1px 7px;
  font-size: 10px;
  font-family: var(--font-mono);
  font-weight: 400;
}

/* ─── INCIDENT PAGE ───────────────────────────────────────────────────── */
.incident-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}
.incident-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  cursor: pointer;
  transition: border-color .2s, box-shadow .2s;
  position: relative;
}
.incident-card:hover { border-color: var(--gold-muted); box-shadow: var(--glow); }
.incident-card-header { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 8px; }
.incident-card-title { font-size: 14px; color: var(--text-primary); font-weight: 400; flex: 1; }
.incident-card-meta { font-size: 11px; color: var(--text-muted); font-family: var(--font-mono); }
.incident-card-asset { font-size: 12px; color: var(--gold-muted); margin-top: 4px; }

.sev-badge {
  display: inline-block; padding: 2px 9px;
  border-radius: 20px; font-size: 10px;
  font-family: var(--font-mono); letter-spacing: .05em; flex-shrink: 0;
}
.sev-low      { background: #1a2e22; color: #7eb894; border: 1px solid #2a4a36; }
.sev-medium   { background: #2e2010; color: #e8b47a; border: 1px solid #4a3518; }
.sev-high     { background: #2a1800; color: #ff9940; border: 1px solid #5a3000; }
.sev-critical { background: var(--status-lost-bg); color: var(--status-lost); border: 1px solid #4a1818; }

.inc-status-badge {
  display: inline-block; padding: 2px 9px;
  border-radius: 20px; font-size: 10px;
  font-family: var(--font-mono); letter-spacing: .05em;
}
.inc-open        { background: #1a2540; color: #7aade8; border: 1px solid #1e3558; }
.inc-in_progress { background: #2e2010; color: #e8b47a; border: 1px solid #4a3518; }
.inc-resolved    { background: #1a2e22; color: #7eb894; border: 1px solid #2a4a36; }
.inc-closed      { background: var(--bg-elevated); color: var(--text-muted); border: 1px solid var(--border); }

/* Incident detail panel */
.incident-detail { }
.inc-detail-header { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 20px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.inc-detail-meta { flex: 1; }
.inc-detail-title { font-family: var(--font-display); font-size: 22px; font-weight: 300; color: var(--text-primary); margin-bottom: 6px; }
.inc-detail-badges { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }

.comments-section { margin-top: 24px; }
.comments-title { font-family: var(--font-mono); font-size: 10px; letter-spacing: .15em; color: var(--text-muted); text-transform: uppercase; margin-bottom: 14px; }
.comment-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.comment-item {
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 14px;
}
.comment-author { font-size: 12px; font-weight: 400; color: var(--gold); margin-bottom: 2px; }
.comment-time { font-family: var(--font-mono); font-size: 9px; color: var(--text-muted); display: inline; margin-left: 8px; }
.comment-body { font-size: 13px; color: var(--text-secondary); line-height: 1.6; margin-top: 6px; }
.comment-input-wrap { display: flex; gap: 10px; margin-top: 4px; }
.comment-input-wrap textarea { flex: 1; min-height: 60px; }

@media (max-width: 700px) {
  .incident-grid { grid-template-columns: 1fr; }
}

/* ─── DOCUMENTS PAGE ──────────────────────────────────────────────────── */
.doc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 8px;
}
.doc-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color .2s, box-shadow .2s;
}
.doc-card:hover { border-color: var(--gold-muted); box-shadow: var(--glow); }
.doc-card-icon { font-size: 32px; line-height: 1; }
.doc-card-name {
  font-size: 15px;
  font-weight: 400;
  color: var(--text-primary);
  line-height: 1.4;
}
.doc-card-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.6;
  flex: 1;
}
.doc-card-meta {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}
.doc-card-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}
.btn-download {
  flex: 1;
  background: var(--gold-faint);
  border: 1px solid var(--gold-muted);
  color: var(--gold-light);
  border-radius: var(--radius);
  padding: 8px 14px;
  font-family: var(--font-body);
  font-size: 13px;
  cursor: pointer;
  transition: all .2s;
  text-align: center;
}
.btn-download:hover { background: var(--gold-dark); color: var(--text-inverse); }

/* Upload drop zone */
.upload-zone {
  border: 2px dashed var(--border-light);
  border-radius: var(--radius-lg);
  padding: 40px;
  text-align: center;
  cursor: pointer;
  transition: border-color .2s, background .2s;
  background: var(--bg-card);
}
.upload-zone:hover, .upload-zone.drag-over {
  border-color: var(--gold-muted);
  background: var(--gold-faint);
}
.upload-zone-icon { font-size: 40px; display: block; margin-bottom: 12px; opacity: .5; }
.upload-zone-text { font-size: 14px; color: var(--text-secondary); }
.upload-zone-hint { font-size: 12px; color: var(--text-muted); margin-top: 6px; }

/* ─── CHANGE PASSWORD HINT IN SIDEBAR FOOTER ──────────────────────────── */
.cu-role {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
}
.cu-change-pw {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--gold-muted);
  letter-spacing: .05em;
  opacity: 0;
  transition: opacity .2s;
  white-space: nowrap;
}
.current-user-info:hover .cu-change-pw { opacity: 1; }

/* ─── PER-COLUMN FILTER ROW ───────────────────────────────────────────── */
.filter-row th {
  padding: 6px 8px;
  background: var(--bg-surface);
  border-bottom: 2px solid var(--gold-muted);
}
.col-filter {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  padding: 5px 8px;
  font-family: var(--font-body);
  font-size: 11px;
  outline: none;
  transition: border-color .2s;
  box-sizing: border-box;
}
.col-filter:focus { border-color: var(--gold-muted); }
.col-filter::placeholder { color: var(--text-muted); font-size: 10px; }
