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

/* ─── Variables ─────────────────────────────────────────────── */
:root {
  --bg: #f0f2f8;
  --surface: #ffffff;
  --surface2: #f5f7fc;
  --border: #e2e6f0;
  --accent: #4f7ef8;
  --accent-hover: #3a6aee;
  --green: #16a34a;
  --green-light: #22c55e;
  --red: #dc2626;
  --red-light: #ef4444;
  --yellow: #d97706;
  --yellow-light: #f59e0b;
  --purple: #7c3aed;
  --purple-light: #8b5cf6;
  --text: #111827;
  --text2: #4b5563;
  --text3: #9ca3af;
  --font: 'Inter', sans-serif;
  --mono: 'JetBrains Mono', monospace;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 4px 24px rgba(0,0,0,.07);
  --shadow-md: 0 8px 32px rgba(0,0,0,.12);
  --sidebar-bg: #ffffff;
  --sidebar-w: 256px;
  --hover-bg: #f0f2f8;
  --transition: all .18s ease;
}

body.dark {
  --bg: #0c0e18;
  --surface: #161929;
  --surface2: #1e2235;
  --border: #272d45;
  --accent: #5b8aff;
  --green: #22c55e;
  --red: #ef4444;
  --yellow: #f59e0b;
  --purple-light: #a78bfa;
  --text: #e5e9f7;
  --text2: #8b91af;
  --text3: #4e5474;
  --shadow: 0 4px 28px rgba(0,0,0,.5);
  --shadow-md: 0 8px 40px rgba(0,0,0,.6);
  --sidebar-bg: #161929;
  --hover-bg: #1e2235;
}

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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  transition: background .2s, color .2s;
  font-size: 14px;
  line-height: 1.5;
}

/* ─── Auth ──────────────────────────────────────────────────── */
#auth-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #0b0821, #1a1060, #0d1f3c);
}

.auth-bg-shapes { position: absolute; inset: 0; overflow: hidden; z-index: 0; }
.auth-bg-shapes span {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: .3;
  animation: floatShape 9s ease-in-out infinite alternate;
}
.auth-bg-shapes span:nth-child(1) { width: 540px; height: 540px; background: #4f7ef8; top: -120px; left: -120px; }
.auth-bg-shapes span:nth-child(2) { width: 420px; height: 420px; background: #7c3aed; bottom: -80px; right: -80px; animation-delay: 2s; }
.auth-bg-shapes span:nth-child(3) { width: 320px; height: 320px; background: #16a34a; top: 35%; left: 38%; animation-delay: 4.5s; }

@keyframes floatShape {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(28px, 18px) scale(1.08); }
}

.auth-card {
  position: relative;
  z-index: 1;
  background: rgba(255,255,255,.07);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 24px;
  padding: 44px 40px;
  width: 420px;
  box-shadow: 0 24px 80px rgba(0,0,0,.55);
}

.auth-logo { text-align: center; margin-bottom: 28px; }
.auth-logo .logo-ring {
  width: 80px; height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4f7ef8, #7c3aed);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 14px;
  font-size: 34px; color: #fff;
  box-shadow: 0 8px 36px rgba(79,126,248,.55);
  animation: pulseLogo 3s ease-in-out infinite;
}
@keyframes pulseLogo {
  0%,100% { box-shadow: 0 8px 36px rgba(79,126,248,.5); }
  50%      { box-shadow: 0 8px 52px rgba(79,126,248,.8); }
}
.auth-logo h1 { font-size: 22px; font-weight: 700; color: #fff; margin-bottom: 4px; }
.auth-logo p  { font-size: 13px; color: rgba(255,255,255,.55); }

.auth-features {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 24px;
}
.auth-feature {
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 10px;
  padding: 12px;
  text-align: center;
}
.auth-feature .f-icon { font-size: 20px; color: rgba(255,255,255,.75); margin-bottom: 5px; }
.auth-feature .f-text { font-size: 11px; color: rgba(255,255,255,.45); }

.auth-divider {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 20px;
}
.auth-divider::before,
.auth-divider::after { content: ''; flex: 1; height: 1px; background: rgba(255,255,255,.15); }
.auth-divider span { font-size: 11px; color: rgba(255,255,255,.35); letter-spacing: .06em; }

.auth-form .form-group { margin-bottom: 16px; }
.auth-form label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: rgba(255,255,255,.65);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.auth-form label i { margin-right: 5px; }
.auth-form input {
  width: 100%;
  padding: 12px 16px;
  background: rgba(255,255,255,.09);
  border: 1px solid rgba(255,255,255,.18);
  border-radius: var(--radius);
  color: #fff;
  font-family: var(--font);
  font-size: 14px;
  outline: none;
  transition: var(--transition);
}
.auth-form input::placeholder { color: rgba(255,255,255,.35); }
.auth-form input:focus {
  border-color: rgba(79,126,248,.8);
  background: rgba(255,255,255,.14);
  box-shadow: 0 0 0 3px rgba(79,126,248,.22);
}

.auth-btn {
  width: 100%;
  padding: 13px;
  background: linear-gradient(135deg, #4f7ef8, #7c3aed);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  margin-top: 6px;
  box-shadow: 0 4px 20px rgba(79,126,248,.4);
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.auth-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 32px rgba(79,126,248,.6); }

.auth-error {
  color: #ff7b7b;
  font-size: 13px;
  text-align: center;
  margin-top: 12px;
  min-height: 20px;
}

/* ─── Sidebar ───────────────────────────────────────────────── */
#app { display: none; min-height: 100vh; }

.sidebar {
  position: fixed;
  left: 0; top: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: background .2s, border-color .2s;
}

.sidebar-logo {
  padding: 20px 18px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
}
.sidebar-logo .logo-icon {
  width: 38px; height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--purple-light));
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; color: #fff;
  flex-shrink: 0;
}
.sidebar-logo h2 { font-size: 14px; font-weight: 700; }
.sidebar-logo p  { font-size: 11px; color: var(--text3); }

nav { flex: 1; padding: 10px 0; overflow-y: auto; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  color: var(--text2);
  cursor: pointer;
  transition: var(--transition);
  font-size: 13.5px;
  font-weight: 500;
  margin: 2px 8px;
  border-radius: var(--radius-sm);
  border-left: 3px solid transparent;
}
.nav-item:hover { background: var(--hover-bg); color: var(--text); }
.nav-item.active {
  background: rgba(79,126,248,.1);
  color: var(--accent);
  border-left-color: var(--accent);
  font-weight: 600;
}
.nav-item .icon { font-size: 15px; width: 20px; text-align: center; flex-shrink: 0; }

.sidebar-footer {
  padding: 14px 16px;
  border-top: 1px solid var(--border);
}
.user-badge { display: flex; align-items: center; gap: 10px; }
.user-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--purple-light));
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: #fff;
  flex-shrink: 0;
}
.user-info { flex: 1; min-width: 0; }
.user-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 11px; color: var(--text3); }
.logout-btn {
  background: none; border: none;
  cursor: pointer; color: var(--text3);
  font-size: 16px; padding: 6px;
  border-radius: 6px; transition: var(--transition);
}
.logout-btn:hover { color: var(--red); background: rgba(220,38,38,.1); }

/* ─── Main layout ───────────────────────────────────────────── */
.main {
  margin-left: var(--sidebar-w);
  padding: 24px 28px;
  min-height: 100vh;
}

.topbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 20px;
}

.theme-toggle {
  display: flex;
  align-items: center;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 30px;
  padding: 4px;
  cursor: pointer;
}
.theme-option {
  padding: 5px 14px;
  border-radius: 24px;
  font-size: 12px;
  font-weight: 500;
  transition: var(--transition);
  color: var(--text2);
  display: flex; align-items: center; gap: 5px;
}
.theme-option.active { background: var(--accent); color: #fff; }

.page { display: none; }
.page.active { display: block; }

.page-header {
  margin-bottom: 24px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.page-header h1 { font-size: 22px; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.page-header h1 i { color: var(--accent); }
.page-header p { font-size: 13px; color: var(--text2); margin-top: 4px; }
.header-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ─── Buttons ───────────────────────────────────────────────── */
.btn {
  padding: 9px 18px;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.btn-primary   { background: var(--accent);  color: #fff; }
.btn-primary:hover { background: var(--accent-hover); transform: translateY(-1px); }
.btn-secondary { background: var(--surface2); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--border); }
.btn-success   { background: var(--green);  color: #fff; }
.btn-success:hover { background: #15803d; }
.btn-danger    { background: var(--red);    color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.btn-warn      { background: var(--yellow); color: #fff; }
.btn-warn:hover { background: #b45309; }
.btn-outline   { background: transparent; border: 1px solid var(--border); color: var(--text2); }
.btn-outline:hover { background: var(--surface2); color: var(--text); }
.btn-purple    { background: var(--purple); color: #fff; }
.btn-purple:hover { background: #6d28d9; }
.btn-sm { padding: 5px 11px; font-size: 12px; border-radius: 6px; }

/* ─── Stats grid ────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: transform .2s, box-shadow .2s;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}
.stat-card::after {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 56px; height: 56px;
  border-radius: 0 var(--radius) 0 56px;
  opacity: .1;
}
.stat-card.blue::after   { background: var(--accent); }
.stat-card.green::after  { background: var(--green); }
.stat-card.yellow::after { background: var(--yellow); }
.stat-card.red::after    { background: var(--red); }
.stat-card.purple::after { background: var(--purple); }
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.stat-card .stat-icon {
  font-size: 24px;
  margin-bottom: 12px;
  width: 46px; height: 46px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 10px;
}
.stat-card.blue   .stat-icon { background: rgba(79,126,248,.12); color: var(--accent); }
.stat-card.green  .stat-icon { background: rgba(22,163,74,.12);   color: var(--green); }
.stat-card.yellow .stat-icon { background: rgba(217,119,6,.12);   color: var(--yellow); }
.stat-card.red    .stat-icon { background: rgba(220,38,38,.12);   color: var(--red); }
.stat-card.purple .stat-icon { background: rgba(124,58,237,.12);  color: var(--purple); }
.stat-card .stat-value {
  font-size: 30px; font-weight: 700;
  font-family: var(--mono);
  line-height: 1;
}
.stat-card.blue   .stat-value { color: var(--accent); }
.stat-card.green  .stat-value { color: var(--green); }
.stat-card.yellow .stat-value { color: var(--yellow); }
.stat-card.red    .stat-value { color: var(--red); }
.stat-card.purple .stat-value { color: var(--purple-light); }
.stat-card .stat-label { font-size: 12px; color: var(--text2); margin-top: 6px; }
.stat-card .stat-hint  { font-size: 10px; color: var(--text3); margin-top: 3px; }

/* ─── Toolbar / search ──────────────────────────────────────── */
.toolbar {
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
  flex-wrap: wrap;
  align-items: center;
}
.search-box { flex: 1; min-width: 220px; position: relative; }
.search-box input {
  width: 100%;
  padding: 10px 12px 10px 38px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font);
  font-size: 13px;
  outline: none;
  transition: var(--transition);
}
.search-box input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(79,126,248,.15); }
.search-icon {
  position: absolute; left: 12px; top: 50%;
  transform: translateY(-50%);
  color: var(--text3); font-size: 13px; pointer-events: none;
}
select.filter-select {
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font);
  font-size: 13px;
  outline: none;
  cursor: pointer;
  min-width: 130px;
  transition: var(--transition);
}
select.filter-select:focus { border-color: var(--accent); }

/* ─── Table ─────────────────────────────────────────────────── */
.table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow-x: auto;
}
table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 580px; }
thead { background: var(--surface2); }
th {
  padding: 11px 14px;
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text3);
  font-weight: 600;
  white-space: nowrap;
}
td {
  padding: 10px 14px;
  border-top: 1px solid var(--border);
  color: var(--text);
  vertical-align: middle;
}
tr:hover td { background: rgba(79,126,248,.03); }

.inv-badge {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--accent);
  background: rgba(79,126,248,.1);
  padding: 3px 8px;
  border-radius: 6px;
}
.status-badge {
  font-size: 11px; font-weight: 600;
  padding: 3px 10px; border-radius: 20px;
  white-space: nowrap;
  display: inline-flex; align-items: center; gap: 4px;
}
.status-free   { background: rgba(22,163,74,.12);  color: var(--green); }
.status-issued { background: rgba(217,119,6,.12);  color: var(--yellow); }
.status-repair { background: rgba(220,38,38,.12);  color: var(--red); }
.category-badge {
  font-size: 11px; padding: 3px 9px;
  border-radius: 12px;
  background: var(--surface2);
  color: var(--text2);
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 4px;
  transition: var(--transition);
}
.category-badge:hover { background: rgba(79,126,248,.1); color: var(--accent); }
.action-btns { display: flex; gap: 5px; flex-wrap: wrap; }
.equip-name { max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ─── Modals ─────────────────────────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.65);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(3px);
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 24px 80px rgba(0,0,0,.35);
}
.modal-wide { max-width: 700px; }
.modal-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; background: var(--surface); z-index: 1;
}
.modal-header h3 { font-size: 17px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.modal-header h3 i { color: var(--accent); }
.modal-close {
  background: none; border: none;
  color: var(--text2); cursor: pointer;
  font-size: 18px; padding: 6px;
  border-radius: 6px; transition: var(--transition);
}
.modal-close:hover { background: var(--surface2); color: var(--text); }
.modal-body { padding: 20px 24px; }
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end; gap: 10px;
  position: sticky; bottom: 0; background: var(--surface);
}

/* ─── Forms ─────────────────────────────────────────────────── */
.form-group { margin-bottom: 14px; }
.form-group label {
  display: block;
  font-size: 12px;
  color: var(--text2);
  margin-bottom: 6px;
  font-weight: 600;
}
.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 10px 13px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font);
  font-size: 13px;
  outline: none;
  transition: var(--transition);
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(79,126,248,.15); }
.form-group textarea { resize: vertical; min-height: 70px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ─── Alert ─────────────────────────────────────────────────── */
.alert-danger {
  background: rgba(220,38,38,.08);
  border: 1px solid rgba(220,38,38,.25);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  color: var(--red);
  font-size: 13px;
  font-weight: 500;
  display: flex; align-items: flex-start; gap: 8px;
}

/* ─── Pagination ─────────────────────────────────────────────── */
.pagination {
  display: flex; align-items: center; gap: 6px;
  justify-content: center; margin-top: 18px; flex-wrap: wrap;
}
.page-btn {
  padding: 6px 11px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 7px;
  cursor: pointer;
  color: var(--text2);
  font-size: 13px;
  transition: var(--transition);
}
.page-btn:hover, .page-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.page-btn:disabled { opacity: .4; cursor: not-allowed; }
.page-info { font-size: 12px; color: var(--text3); padding: 0 4px; }

/* ─── History ─────────────────────────────────────────────────── */
.history-item {
  display: flex; gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.history-item:last-child { border-bottom: none; }
.h-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; margin-top: 5px; }
.h-dot.issued   { background: var(--yellow-light); }
.h-dot.returned { background: var(--green-light); }
.h-dot.imported { background: var(--accent); }
.h-dot.repair   { background: var(--red-light); }
.h-date { font-size: 11px; color: var(--text3); font-family: var(--mono); }
.h-text { font-size: 13px; }

/* ─── Detail section ─────────────────────────────────────────── */
.detail-section { margin-bottom: 20px; }
.detail-section h4 {
  font-size: 11px; text-transform: uppercase;
  letter-spacing: .05em; color: var(--text3);
  margin-bottom: 12px;
}
.detail-row {
  display: flex; justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.detail-row:last-child { border-bottom: none; }
.detail-row .key { color: var(--text2); }
.detail-row .val { color: var(--text); font-weight: 500; text-align: right; }

/* ─── Drop zone ──────────────────────────────────────────────── */
.drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 48px 32px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
}
.drop-zone:hover, .drop-zone.drag {
  border-color: var(--accent);
  background: rgba(79,126,248,.04);
}
.drop-zone .dz-icon { font-size: 48px; color: var(--text3); margin-bottom: 14px; }
.drop-zone p { font-size: 15px; color: var(--text2); margin-bottom: 6px; }
.import-hint {
  margin-top: 20px;
  padding: 14px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px; color: var(--text2);
  display: flex; align-items: flex-start; gap: 8px;
}
.import-hint i { color: var(--accent); flex-shrink: 0; margin-top: 2px; }

/* ─── Issued page ────────────────────────────────────────────── */
.issued-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 16px;
}
.issued-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  transition: box-shadow .2s;
}
.issued-card:hover { box-shadow: var(--shadow-md); }
.issued-card-header {
  display: flex; justify-content: space-between;
  align-items: flex-start; margin-bottom: 10px;
}
.issued-card-name { font-size: 14px; font-weight: 600; line-height: 1.4; flex: 1; margin-right: 10px; }
.issued-card-meta {
  font-size: 12px; color: var(--text2);
  display: flex; flex-direction: column; gap: 5px;
  margin-bottom: 14px;
}
.issued-card-meta span { display: flex; align-items: center; gap: 7px; }
.issued-card-meta i { color: var(--accent); width: 13px; text-align: center; }
.issued-card-footer {
  display: flex; justify-content: space-between; align-items: center;
  padding-top: 12px; border-top: 1px solid var(--border);
}
.issued-days { font-size: 11px; color: var(--text3); font-family: var(--mono); }
.issued-tabs {
  display: flex; gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}
.issued-tab {
  padding: 10px 18px;
  cursor: pointer;
  font-size: 13px; font-weight: 500;
  color: var(--text2);
  border-bottom: 2px solid transparent;
  transition: var(--transition);
  display: flex; align-items: center; gap: 6px;
}
.issued-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.issued-tab:hover { color: var(--text); }

/* ─── Stat detail ─────────────────────────────────────────────── */
.stat-detail-header { display: flex; align-items: center; gap: 14px; margin-bottom: 24px; }
.stat-detail-back {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 14px;
  cursor: pointer;
  font-size: 13px; font-weight: 600;
  display: flex; align-items: center; gap: 6px;
  transition: var(--transition);
}
.stat-detail-back:hover { background: var(--border); }
.cat-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px; margin-bottom: 24px;
}
.cat-stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex; align-items: center; gap: 14px;
}
.cat-stat-icon { font-size: 28px; }
.cat-stat-count { font-size: 24px; font-weight: 700; font-family: var(--mono); color: var(--accent); }
.cat-stat-name  { font-size: 13px; color: var(--text2); }

/* ─── Passport ───────────────────────────────────────────────── */
.passport-toolbar { display: flex; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; align-items: center; }
.passport-report {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
}
.passport-title { text-align: center; margin-bottom: 24px; }
.passport-title h2 { font-size: 20px; font-weight: 700; }
.passport-title p { color: var(--text2); font-size: 13px; margin-top: 4px; }
.passport-section { margin-bottom: 28px; }
.passport-section h3 {
  font-size: 15px; font-weight: 700;
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--accent);
  display: flex; align-items: center; gap: 8px;
}
.passport-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px; margin-bottom: 16px;
}
.passport-summary-card {
  background: var(--surface2);
  border-radius: var(--radius-sm);
  padding: 16px; text-align: center;
}
.passport-summary-card .ps-val {
  font-size: 26px; font-weight: 700;
  font-family: var(--mono); color: var(--accent);
}
.passport-summary-card .ps-label { font-size: 11px; color: var(--text2); margin-top: 4px; }

/* ─── Misc ───────────────────────────────────────────────────── */
.empty {
  text-align: center; padding: 56px 20px; color: var(--text2);
}
.empty .e-icon { font-size: 44px; margin-bottom: 12px; opacity: .4; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.section-title {
  font-size: 14px; font-weight: 600;
  margin-bottom: 14px; color: var(--text2);
  display: flex; align-items: center; gap: 7px;
}
.section-title i { color: var(--accent); }
.badge { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 20px; }
.badge-blue { background: rgba(79,126,248,.12); color: var(--accent); }

/* ─── Toast ──────────────────────────────────────────────────── */
#toast {
  position: fixed; bottom: 24px; right: 24px;
  z-index: 9999;
  display: flex; flex-direction: column; gap: 8px;
  pointer-events: none;
}
.toast-item {
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 500;
  color: #fff;
  animation: slideIn .3s ease;
  box-shadow: var(--shadow-md);
  max-width: 340px;
  display: flex; align-items: center; gap: 8px;
  pointer-events: auto;
}
.toast-success { background: #15803d; }
.toast-error   { background: #b91c1c; }
.toast-info    { background: var(--accent); }
@keyframes slideIn {
  from { transform: translateX(110%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

/* ─── Print ──────────────────────────────────────────────────── */
@media print {
  .sidebar, .theme-toggle, .topbar, .page-header .header-actions,
  .passport-toolbar, .issued-tabs, .toolbar { display: none !important; }
  .main { margin-left: 0; padding: 0; }
}

/* ─── Responsive ─────────────────────────────────────────────── */
@media (max-width: 1100px) { .two-col { grid-template-columns: 1fr; } }
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .main { margin-left: 0; padding: 16px; }
  .form-row { grid-template-columns: 1fr; }
}
