/* ================================================================
   main.css — Corporate Knowledge Base Design System
   Fonts: Inter (Google Fonts)
   No frameworks. Pure CSS custom properties.
   ================================================================ */

/* ── Variables ───────────────────────────────────────────────── */
:root {
  /* Colors */
  --c-bg:         #f0f2f5;
  --c-surface:    #ffffff;
  --c-surface-2:  #f8fafc;
  --c-border:     #e2e8f0;
  --c-border-light: #f1f5f9;

  --c-sidebar-bg:    #1a1d27;
  --c-sidebar-hover: rgba(255,255,255,0.07);
  --c-sidebar-active:#3d4166;
  --c-sidebar-text:  #c9cdd4;
  --c-sidebar-title: rgba(255,255,255,0.35);

  --c-header-bg:     #ffffff;
  --c-header-border: #e2e8f0;

  --c-primary:       #4f46e5;
  --c-primary-hover: #4338ca;
  --c-primary-light: #eef2ff;

  --c-success:       #10b981;
  --c-success-light: #ecfdf5;
  --c-warning:       #f59e0b;
  --c-warning-light: #fffbeb;
  --c-danger:        #ef4444;
  --c-danger-light:  #fef2f2;
  --c-info:          #3b82f6;
  --c-info-light:    #eff6ff;

  --c-text:          #1e293b;
  --c-text-2:        #64748b;
  --c-text-3:        #94a3b8;

  /* Dimensions */
  --sidebar-w:      260px;
  --header-h:       60px;

  /* Typography */
  --font:           'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --text-xs:        0.75rem;
  --text-sm:        0.875rem;
  --text-base:      1rem;
  --text-lg:        1.125rem;
  --text-xl:        1.25rem;
  --text-2xl:       1.5rem;
  --text-3xl:       1.875rem;
  --fw-normal:      400;
  --fw-medium:      500;
  --fw-semibold:    600;
  --fw-bold:        700;
  --lh-tight:       1.25;
  --lh-normal:      1.5;
  --lh-relaxed:     1.75;

  /* Radius */
  --r-sm:   6px;
  --r-md:   10px;
  --r-lg:   14px;
  --r-xl:   18px;
  --r-full: 9999px;

  /* Shadows */
  --shadow-sm:  0 1px 2px rgba(0,0,0,.05);
  --shadow-md:  0 4px 6px -1px rgba(0,0,0,.07), 0 2px 4px -2px rgba(0,0,0,.05);
  --shadow-lg:  0 10px 15px -3px rgba(0,0,0,.08), 0 4px 6px -4px rgba(0,0,0,.05);
  --shadow-xl:  0 20px 25px -5px rgba(0,0,0,.1),  0 8px 10px -6px rgba(0,0,0,.05);

  /* Transitions */
  --t-fast:   150ms ease;
  --t-normal: 250ms ease;
  --t-slow:   350ms ease;
}

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

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

body {
  font-family: var(--font);
  font-size: var(--text-base);
  line-height: var(--lh-normal);
  color: var(--c-text);
  background: var(--c-bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

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

img { max-width: 100%; height: auto; display: block; }

/* ── Layout ──────────────────────────────────────────────────── */
.app-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  background: var(--c-header-bg);
  border-bottom: 1px solid var(--c-header-border);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.app-layout {
  display: flex;
  margin-top: var(--header-h);
  min-height: calc(100vh - var(--header-h));
}

.app-sidebar {
  position: fixed;
  top: var(--header-h);
  left: 0;
  bottom: 0;
  width: var(--sidebar-w);
  background: var(--c-sidebar-bg);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 90;
  transition: transform var(--t-normal);
}

.app-main {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-width: 0;
  padding: 28px;
  transition: margin-left var(--t-normal);
}

.main-inner { max-width: 1280px; margin: 0 auto; }

/* ── Header Components ───────────────────────────────────────── */
.header-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}
.logo-img  { height: 36px; width: auto; border-radius: var(--r-sm); }
.logo-text { font-size: var(--text-lg); font-weight: var(--fw-bold); color: var(--c-text); white-space: nowrap; }
.header-spacer { flex: 1; }

/* Sidebar toggle (mobile) */
.sidebar-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 24px; height: 18px;
  background: none; border: none; cursor: pointer; padding: 0;
}
.sidebar-toggle span {
  display: block; height: 2px; border-radius: 2px;
  background: var(--c-text);
  transition: transform var(--t-fast), opacity var(--t-fast);
}

/* ── Dropdowns ───────────────────────────────────────────────── */
.lang-selector,
.user-menu { position: relative; }

.lang-btn,
.user-btn {
  display: flex; align-items: center; gap: 6px;
  background: none; border: 1px solid var(--c-border);
  border-radius: var(--r-full); padding: 6px 12px;
  font-family: var(--font); font-size: var(--text-sm); font-weight: var(--fw-medium);
  color: var(--c-text); cursor: pointer;
  transition: background var(--t-fast), border-color var(--t-fast);
}
.lang-btn:hover, .user-btn:hover { background: var(--c-surface-2); border-color: var(--c-primary); }

.chevron { width: 16px; height: 16px; fill: var(--c-text-2); transition: transform var(--t-fast); }
.chevron path { fill: currentColor; }

.dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 200px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-xl);
  z-index: 200;
  overflow: hidden;
  opacity: 0; pointer-events: none; transform: translateY(-4px);
  transition: opacity var(--t-fast), transform var(--t-fast);
}
.dropdown-menu.open { opacity: 1; pointer-events: auto; transform: translateY(0); }
.dropdown-right { left: auto; right: 0; }

.dropdown-header {
  padding: 12px 16px;
  display: flex; flex-direction: column; gap: 2px;
}
.dropdown-user-name  { font-size: var(--text-sm); font-weight: var(--fw-semibold); color: var(--c-text); }
.dropdown-user-email { font-size: var(--text-xs); color: var(--c-text-2); }

.dropdown-divider { height: 1px; background: var(--c-border); margin: 4px 0; }

.dropdown-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 16px;
  font-size: var(--text-sm); color: var(--c-text);
  text-decoration: none;
  transition: background var(--t-fast);
  cursor: pointer;
}
.dropdown-item svg { width: 16px; height: 16px; fill: var(--c-text-2); flex-shrink: 0; }
.dropdown-item:hover { background: var(--c-surface-2); }
.dropdown-item.active { color: var(--c-primary); font-weight: var(--fw-medium); }
.dropdown-item--danger { color: var(--c-danger); }
.dropdown-item--danger svg { fill: var(--c-danger); }
.dropdown-item--danger:hover { background: var(--c-danger-light); }

/* User avatar */
.user-avatar {
  width: 32px; height: 32px;
  background: linear-gradient(135deg, var(--c-primary), #7c3aed);
  border-radius: var(--r-full);
  display: flex; align-items: center; justify-content: center;
  font-size: var(--text-xs); font-weight: var(--fw-bold); color: #fff;
  flex-shrink: 0;
}
.user-avatar--sm { width: 28px; height: 28px; font-size: 11px; }
.user-name-header { font-size: var(--text-sm); font-weight: var(--fw-medium); }

/* Header logout button */
.header-logout-btn {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: var(--r-md);
  color: var(--c-text-2); text-decoration: none; flex-shrink: 0;
  transition: background var(--t-fast), color var(--t-fast);
}
.header-logout-btn:hover { background: var(--c-danger-light); color: var(--c-danger); text-decoration: none; }
.header-logout-btn svg { width: 18px; height: 18px; fill: currentColor; }

/* ── Sidebar ─────────────────────────────────────────────────── */
.sidebar-nav { flex: 1; padding: 16px 0; overflow-y: auto; }

.sidebar-section { padding: 0 0 8px; }

.sidebar-section-title {
  padding: 6px 16px;
  font-size: 11px; font-weight: var(--fw-semibold);
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--c-sidebar-title);
}

.sidebar-link {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 16px; margin: 1px 8px;
  border-radius: var(--r-md);
  font-size: var(--text-sm); font-weight: var(--fw-medium);
  color: var(--c-sidebar-text); text-decoration: none;
  transition: background var(--t-fast), color var(--t-fast);
  white-space: nowrap; overflow: hidden;
}
.sidebar-link:hover { background: var(--c-sidebar-hover); color: #fff; text-decoration: none; }
.sidebar-link.active { background: var(--c-sidebar-active); color: #fff; }
.sidebar-link--new {
  background: rgba(79,70,229,0.18);
  color: #a5b4fc;
  margin-bottom: 4px;
}
.sidebar-link--new:hover { background: rgba(79,70,229,0.3); color: #c7d2fe; }
.sidebar-link--collection { font-size: var(--text-xs); padding: 7px 16px; }

.nav-icon { width: 18px; height: 18px; fill: currentColor; flex-shrink: 0; }

.sidebar-footer {
  padding: 12px 8px; border-top: 1px solid rgba(255,255,255,0.08);
  display: flex; align-items: center; gap: 4px;
}
.sidebar-footer-link {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: var(--r-md);
  text-decoration: none;
  transition: background var(--t-fast);
  flex: 1; min-width: 0;
}
.sidebar-footer-link:hover { background: var(--c-sidebar-hover); text-decoration: none; }
.sidebar-footer-info { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.sidebar-footer-name  { font-size: var(--text-sm); font-weight: var(--fw-medium); color: #e2e8f0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-footer-role  { font-size: var(--text-xs); color: var(--c-sidebar-title); }
.sidebar-footer-logout {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: var(--r-md);
  color: rgba(255,255,255,0.35); text-decoration: none; flex-shrink: 0;
  transition: background var(--t-fast), color var(--t-fast);
}
.sidebar-footer-logout:hover { background: rgba(239,68,68,0.15); color: #ef4444; }

/* Overlay mobile */
.sidebar-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.4); z-index: 80;
  transition: opacity var(--t-normal);
}
.sidebar-overlay.show { display: block; }

/* ── Page Header ─────────────────────────────────────────────── */
.page-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; margin-bottom: 28px;
  flex-wrap: wrap;
}
.page-title {
  font-size: var(--text-2xl); font-weight: var(--fw-bold);
  color: var(--c-text); line-height: var(--lh-tight);
}
.page-subtitle { font-size: var(--text-sm); color: var(--c-text-2); margin-top: 4px; }
.page-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* ── Cards ───────────────────────────────────────────────────── */
.card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.card-header {
  padding: 18px 20px;
  border-bottom: 1px solid var(--c-border);
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
}
.card-title { font-size: var(--text-base); font-weight: var(--fw-semibold); color: var(--c-text); }
.card-body   { padding: 20px; }
.card-footer { padding: 14px 20px; border-top: 1px solid var(--c-border); background: var(--c-surface-2); }

/* Stat cards (dashboard) */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; margin-bottom: 28px; }

.stat-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: 20px;
  display: flex; flex-direction: column; gap: 8px;
  position: relative; overflow: hidden;
  transition: box-shadow var(--t-fast), transform var(--t-fast);
}
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.stat-card::before {
  content: ''; position: absolute;
  top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--c-primary), #7c3aed);
}
.stat-icon  { font-size: 1.5rem; line-height: 1; }
.stat-value { font-size: var(--text-3xl); font-weight: var(--fw-bold); color: var(--c-text); }
.stat-label { font-size: var(--text-sm); color: var(--c-text-2); font-weight: var(--fw-medium); }

/* ── Tables ──────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table.data-table {
  width: 100%; border-collapse: collapse;
  font-size: var(--text-sm);
}
.data-table th {
  padding: 10px 14px;
  text-align: left;
  background: var(--c-surface-2);
  border-bottom: 2px solid var(--c-border);
  font-size: var(--text-xs); font-weight: var(--fw-semibold);
  letter-spacing: 0.04em; text-transform: uppercase; color: var(--c-text-2);
  white-space: nowrap;
}
.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--c-border-light);
  color: var(--c-text); vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--c-surface-2); }
.data-table .actions { display: flex; gap: 6px; }
.table-empty { text-align: center; padding: 40px; color: var(--c-text-2); }

/* ── Buttons ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 16px;
  border-radius: var(--r-md); border: 1px solid transparent;
  font-family: var(--font); font-size: var(--text-sm); font-weight: var(--fw-medium);
  cursor: pointer; white-space: nowrap;
  transition: background var(--t-fast), border-color var(--t-fast), box-shadow var(--t-fast), transform 100ms;
  text-decoration: none;
  line-height: 1.4;
}
.btn:active { transform: scale(0.98); }
.btn svg { width: 16px; height: 16px; fill: currentColor; flex-shrink: 0; }
.btn-sm  { padding: 5px 10px; font-size: var(--text-xs); }
.btn-lg  { padding: 11px 22px; font-size: var(--text-base); }
.btn-icon { width: 34px; height: 34px; padding: 0; border-radius: var(--r-md); }

.btn-primary { background: var(--c-primary); color: #fff; border-color: var(--c-primary); }
.btn-primary:hover { background: var(--c-primary-hover); border-color: var(--c-primary-hover); box-shadow: 0 0 0 3px rgba(79,70,229,0.15); }

.btn-secondary { background: var(--c-surface); color: var(--c-text); border-color: var(--c-border); }
.btn-secondary:hover { background: var(--c-surface-2); border-color: var(--c-text-3); }

.btn-ghost { background: transparent; color: var(--c-text-2); border-color: transparent; }
.btn-ghost:hover { background: var(--c-surface-2); color: var(--c-text); }

.btn-danger { background: var(--c-danger); color: #fff; border-color: var(--c-danger); }
.btn-danger:hover { background: #dc2626; border-color: #dc2626; }

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

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

/* ── Forms ───────────────────────────────────────────────────── */
.form-group { margin-bottom: 18px; }
.form-label {
  display: block; margin-bottom: 6px;
  font-size: var(--text-sm); font-weight: var(--fw-medium); color: var(--c-text);
}
.form-label .required { color: var(--c-danger); margin-left: 2px; }
.form-hint { font-size: var(--text-xs); color: var(--c-text-2); margin-top: 4px; }

.form-control,
.form-select,
.form-textarea {
  display: block; width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  font-family: var(--font); font-size: var(--text-sm); color: var(--c-text);
  background: var(--c-surface);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
  appearance: none;
}
.form-control:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--c-primary);
  box-shadow: 0 0 0 3px rgba(79,70,229,0.12);
}
.form-control::placeholder { color: var(--c-text-3); }
.form-textarea { resize: vertical; min-height: 100px; }
.form-control.is-invalid,
.form-select.is-invalid { border-color: var(--c-danger); }
.form-error { font-size: var(--text-xs); color: var(--c-danger); margin-top: 4px; }

.form-check { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.form-check-input { width: 16px; height: 16px; cursor: pointer; accent-color: var(--c-primary); }
.form-check-label { font-size: var(--text-sm); cursor: pointer; }

/* Form row (inline groups) */
.form-row { display: flex; gap: 16px; flex-wrap: wrap; }
.form-row .form-group { flex: 1; min-width: 200px; }

/* ── Badges ──────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center;
  padding: 3px 8px; border-radius: var(--r-full);
  font-size: 11px; font-weight: var(--fw-semibold);
  letter-spacing: 0.03em;
}
.badge-primary { background: var(--c-primary-light); color: var(--c-primary); }
.badge-success { background: var(--c-success-light); color: #065f46; }
.badge-warning { background: var(--c-warning-light); color: #92400e; }
.badge-danger  { background: var(--c-danger-light);  color: #991b1b; }
.badge-info    { background: var(--c-info-light);    color: #1e40af; }
.badge-neutral { background: #f1f5f9; color: var(--c-text-2); }

/* ── Alerts ──────────────────────────────────────────────────── */
.alert {
  padding: 12px 16px; border-radius: var(--r-md); border-left: 4px solid;
  font-size: var(--text-sm); margin-bottom: 16px;
}
.alert-success { background: var(--c-success-light); border-color: var(--c-success); color: #065f46; }
.alert-warning { background: var(--c-warning-light); border-color: var(--c-warning); color: #92400e; }
.alert-danger  { background: var(--c-danger-light);  border-color: var(--c-danger);  color: #991b1b; }
.alert-info    { background: var(--c-info-light);    border-color: var(--c-info);    color: #1e40af; }

/* ── Modals ──────────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.45);
  display: flex; align-items: center; justify-content: center;
  z-index: 300; padding: 20px;
}
.modal-backdrop[hidden] { display: none; }
.modal {
  background: var(--c-surface); border-radius: var(--r-xl);
  box-shadow: var(--shadow-xl);
  width: 100%; max-width: 480px;
  animation: modalFadeIn 200ms ease;
}
.modal-lg { max-width: 700px; }
@keyframes modalFadeIn { from { opacity:0; transform:scale(.96); } to { opacity:1; transform:scale(1); } }
.modal-header { padding: 20px 24px 0; }
.modal-title  { font-size: var(--text-lg); font-weight: var(--fw-semibold); }
.modal-body   { padding: 16px 24px; }
.modal-footer { padding: 0 24px 20px; display: flex; justify-content: flex-end; gap: 10px; }

/* ── Toast Notifications ─────────────────────────────────────── */
.toast-container {
  position: fixed; bottom: 24px; right: 24px;
  display: flex; flex-direction: column; gap: 8px;
  z-index: 400;
}
.toast {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; border-radius: var(--r-md);
  font-size: var(--text-sm); font-weight: var(--fw-medium);
  box-shadow: var(--shadow-lg);
  animation: toastIn 250ms ease forwards;
  max-width: 340px;
}
.toast-success { background: #ecfdf5; border: 1px solid #6ee7b7; color: #064e3b; }
.toast-error   { background: #fef2f2; border: 1px solid #fca5a5; color: #7f1d1d; }
.toast-info    { background: #eff6ff; border: 1px solid #93c5fd; color: #1e3a5f; }
@keyframes toastIn { from { opacity:0; transform:translateX(20px); } to { opacity:1; transform:translateX(0); } }

/* ── Pagination ──────────────────────────────────────────────── */
.pagination { display: flex; gap: 4px; align-items: center; justify-content: center; padding: 20px 0 0; }
.page-link {
  display: flex; align-items: center; justify-content: center;
  min-width: 36px; height: 36px; padding: 0 8px;
  border-radius: var(--r-md); border: 1px solid var(--c-border);
  font-size: var(--text-sm); color: var(--c-text-2);
  transition: all var(--t-fast); text-decoration: none;
}
.page-link:hover { background: var(--c-surface-2); color: var(--c-primary); border-color: var(--c-primary); text-decoration: none; }
.page-link.active { background: var(--c-primary); color: #fff; border-color: var(--c-primary); }
.page-link.disabled { opacity: 0.4; pointer-events: none; }

/* ── Utility ─────────────────────────────────────────────────── */
.text-sm    { font-size: var(--text-sm); }
.text-xs    { font-size: var(--text-xs); }
.text-muted { color: var(--c-text-2); }
.text-danger{ color: var(--c-danger); }
.text-success{color: var(--c-success);}
.fw-medium  { font-weight: var(--fw-medium); }
.fw-semibold{ font-weight: var(--fw-semibold); }
.fw-bold    { font-weight: var(--fw-bold); }
.d-flex     { display: flex; }
.gap-2      { gap: 8px; }
.gap-3      { gap: 12px; }
.gap-4      { gap: 16px; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mb-5 { margin-bottom: 20px; }
.mb-6 { margin-bottom: 24px; }
.p-0  { padding: 0; }
.w-100 { width: 100%; }
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* Search / filter bar */
.filter-bar {
  display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; align-items: flex-end;
}
.filter-bar .form-control { max-width: 260px; }
.filter-bar .form-select  { max-width: 200px; }

/* Empty state */
.empty-state {
  text-align: center; padding: 60px 20px; color: var(--c-text-2);
}
.empty-state-icon { font-size: 3rem; margin-bottom: 12px; opacity: 0.4; }
.empty-state-title { font-size: var(--text-lg); font-weight: var(--fw-semibold); margin-bottom: 6px; color: var(--c-text); }
.empty-state-text  { font-size: var(--text-sm); }

/* Spinner */
.spinner {
  display: inline-block; width: 18px; height: 18px;
  border: 2px solid rgba(79,70,229,0.2);
  border-top-color: var(--c-primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.spinner-lg { width: 36px; height: 36px; border-width: 3px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Login Page ──────────────────────────────────────────────── */
.login-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #1a1d27 0%, #2d3655 50%, #1a1d27 100%);
  padding: 20px;
}
.login-box {
  background: var(--c-surface); border-radius: var(--r-xl);
  box-shadow: var(--shadow-xl);
  padding: 40px; width: 100%; max-width: 400px;
}
.login-logo {
  text-align: center; margin-bottom: 32px;
}
.login-logo img { height: 56px; margin: 0 auto 12px; }
.login-logo h1 {
  font-size: var(--text-xl); font-weight: var(--fw-bold); color: var(--c-text);
}
.login-logo p { font-size: var(--text-sm); color: var(--c-text-2); margin-top: 4px; }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar-toggle { display: flex; }

  .app-sidebar {
    transform: translateX(-100%);
  }
  .app-sidebar.open {
    transform: translateX(0);
    box-shadow: var(--shadow-xl);
  }

  .app-main { margin-left: 0; padding: 16px; }

  .logo-text { display: none; }
  .user-name-header { display: none; }

  .stat-grid { grid-template-columns: 1fr 1fr; }

  .page-header { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 480px) {
  .stat-grid { grid-template-columns: 1fr; }
  .form-row   { flex-direction: column; }
  .filter-bar { flex-direction: column; align-items: stretch; }
  .filter-bar .form-control,
  .filter-bar .form-select  { max-width: 100%; }
}
