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

/* ════════════════════════════════════════════════════════════
   DESIGN TOKENS
════════════════════════════════════════════════════════════ */
:root {
  --bg:           #06060d;
  --bg-2:         #0b0b15;
  --bg-3:         #101020;
  --surface:      rgba(255,255,255,0.04);
  --surface-h:    rgba(255,255,255,0.07);
  --surface-a:    rgba(99,102,241,0.12);
  --border:       rgba(255,255,255,0.07);
  --border-s:     rgba(255,255,255,0.14);

  --accent:       #6366f1;
  --accent-2:     #8b5cf6;
  --accent-3:     #a78bfa;
  --grad:         linear-gradient(135deg, #6366f1, #8b5cf6);
  --grad-glow:    rgba(99,102,241,0.25);

  --text:         #f1f5f9;
  --text-2:       #94a3b8;
  --text-3:       #475569;

  --green:        #22c55e;
  --green-bg:     rgba(34,197,94,0.12);
  --yellow:       #f59e0b;
  --yellow-bg:    rgba(245,158,11,0.12);
  --red:          #ef4444;
  --red-bg:       rgba(239,68,68,0.12);
  --blue:         #3b82f6;
  --blue-bg:      rgba(59,130,246,0.12);

  --radius-s:     6px;
  --radius:       10px;
  --radius-l:     14px;
  --radius-xl:    20px;

  --sidebar-w:    240px;
  --hdr-h:        60px;

  --shadow-s:     0 2px 8px rgba(0,0,0,0.3);
  --shadow:       0 4px 20px rgba(0,0,0,0.5);
  --shadow-l:     0 8px 40px rgba(0,0,0,0.7);
  --shadow-glow:  0 0 30px var(--grad-glow);

  --dur:          200ms;
  --ease:         cubic-bezier(0.4,0,0.2,1);
}

/* ════════════════════════════════════════════════════════════
   RESET & BASE
════════════════════════════════════════════════════════════ */
*,*::before,*::after { box-sizing:border-box; margin:0; padding:0; }

html { scroll-behavior: smooth; overflow-x: hidden; width: 100vw; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: hidden;
  width: 100vw;
}

/* Background animated gradient */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 20% 10%, rgba(99,102,241,0.06) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 80% 80%, rgba(139,92,246,0.05) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

/* ════════════════════════════════════════════════════════════
   LAYOUT — AUTH
════════════════════════════════════════════════════════════ */
.auth-shell {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
  position: relative;
  z-index: 1;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-2);
  border: 1px solid var(--border-s);
  border-radius: var(--radius-xl);
  padding: 40px;
  box-shadow: var(--shadow-l), var(--shadow-glow);
}

.auth-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 32px;
}

.auth-logo-icon {
  width: 36px;
  height: 36px;
  background: var(--grad);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  box-shadow: var(--shadow-glow);
}

.auth-logo-text {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.auth-title  { font-size: 22px; font-weight: 700; margin-bottom: 6px; }
.auth-sub    { color: var(--text-2); font-size: 13px; margin-bottom: 28px; }

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 3px;
  margin-bottom: 24px;
}

.auth-tab {
  background: none;
  border: none;
  color: var(--text-2);
  padding: 8px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--dur) var(--ease);
}

.auth-tab.active {
  background: var(--grad);
  color: #fff;
  box-shadow: var(--shadow-s);
}

/* ════════════════════════════════════════════════════════════
   LAYOUT — APP
════════════════════════════════════════════════════════════ */
.app-shell {
  display: flex;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* ─── Sidebar ───────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: rgba(6,6,14,0.85);
  backdrop-filter: blur(20px);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  transition: transform var(--dur) var(--ease);
}

.sidebar-brand {
  height: var(--hdr-h);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.brand-icon {
  width: 30px;
  height: 30px;
  background: var(--grad);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  box-shadow: 0 0 16px var(--grad-glow);
  flex-shrink: 0;
}

.brand-name {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.nav-section {
  margin-bottom: 16px;
}

.nav-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-3);
  padding: 0 10px;
  margin-bottom: 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius);
  color: var(--text-2);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  transition: all var(--dur) var(--ease);
  position: relative;
  text-decoration: none;
}

.nav-item:hover {
  background: var(--surface-h);
  color: var(--text);
}

.nav-item.active {
  background: var(--surface-a);
  color: var(--accent-3);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 4px;
  bottom: 4px;
  width: 3px;
  background: var(--grad);
  border-radius: 0 2px 2px 0;
}

.nav-icon { font-size: 16px; width: 20px; text-align: center; flex-shrink: 0; }

.sidebar-footer {
  padding: 12px 10px;
  border-top: 1px solid var(--border);
}

.user-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius);
  background: var(--surface);
}

.user-avatar {
  width: 28px;
  height: 28px;
  background: var(--grad);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}

.user-info { flex: 1; min-width: 0; }
.user-name  { font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role  { font-size: 10px; color: var(--text-2); text-transform: capitalize; }

.logout-btn {
  background: none;
  border: none;
  color: var(--text-3);
  cursor: pointer;
  font-size: 16px;
  padding: 4px;
  border-radius: 4px;
  transition: color var(--dur);
  flex-shrink: 0;
}
.logout-btn:hover { color: var(--red); }

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

.topbar {
  height: var(--hdr-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  border-bottom: 1px solid var(--border);
  background: rgba(6,6,14,0.6);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-title {
  font-size: 16px;
  font-weight: 600;
}

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

.live-dot {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-2);
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-3);
}

.dot.green  { background: var(--green); box-shadow: 0 0 8px var(--green); animation: pulse 2s infinite; }
.dot.red    { background: var(--red); }
.dot.yellow { background: var(--yellow); }

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.7; transform: scale(0.85); }
}

.page { padding: 28px; flex: 1; min-width: 0; }

.user-access-shell .sidebar,
.user-access-shell .topbar {
  display: none;
}

.user-access-shell .main {
  margin-left: 0;
}

.user-access-shell .page {
  width: min(920px, 100%);
  margin: 0 auto;
  padding: 32px 20px;
}

/* ════════════════════════════════════════════════════════════
   COMPONENTS — COMMON
════════════════════════════════════════════════════════════ */

/* Cards / Panels */
.card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-l);
  overflow: hidden;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}

.card-title  { font-size: 14px; font-weight: 600; }
.card-sub    { font-size: 12px; color: var(--text-2); margin-top: 2px; }
.card-body   { padding: 20px; }

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-l);
  padding: 20px;
  position: relative;
  overflow: hidden;
  transition: border-color var(--dur);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--grad);
}

.stat-card:hover { border-color: var(--border-s); }

.stat-icon {
  font-size: 22px;
  margin-bottom: 12px;
  display: block;
}

.stat-value {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -1px;
  line-height: 1;
  margin-bottom: 4px;
  background: var(--grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-label { font-size: 12px; color: var(--text-2); font-weight: 500; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all var(--dur) var(--ease);
  white-space: nowrap;
  font-family: inherit;
}

.btn-primary {
  background: var(--grad);
  color: #fff;
  box-shadow: 0 2px 12px var(--grad-glow);
}
.btn-primary:hover { opacity: 0.9; transform: translateY(-1px); box-shadow: 0 4px 20px var(--grad-glow); }
.btn-primary:active { transform: translateY(0); }

.btn-ghost {
  background: var(--surface);
  color: var(--text-2);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--surface-h); color: var(--text); border-color: var(--border-s); }

.btn-danger {
  background: var(--red-bg);
  color: var(--red);
  border: 1px solid rgba(239,68,68,0.2);
}
.btn-danger:hover { background: rgba(239,68,68,0.2); }

.btn-success {
  background: var(--green-bg);
  color: var(--green);
  border: 1px solid rgba(34,197,94,0.2);
}
.btn-success:hover { background: rgba(34,197,94,0.2); }

.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-icon { padding: 7px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }

/* Forms */
.form-grid {
  display: grid;
  gap: 16px;
}

.form-grid-2 { grid-template-columns: 1fr 1fr; }
.form-grid-3 { grid-template-columns: 1fr 1fr 1fr; }

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-2);
}

.field-input,
.field-select,
.field-textarea {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  padding: 9px 12px;
  transition: border-color var(--dur), box-shadow var(--dur);
  width: 100%;
  outline: none;
}

.field-input:focus,
.field-select:focus,
.field-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
}

.field-input::placeholder { color: var(--text-3); }

.field-select option { background: var(--bg-3); }

.field-textarea { resize: vertical; min-height: 80px; }

.field-hint { font-size: 11px; color: var(--text-3); }

/* Checkboxes day-selector */
.days-selector {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.day-toggle {
  display: none;
}

.day-toggle + label {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-2);
  transition: all var(--dur);
  user-select: none;
}

.day-toggle:checked + label {
  background: var(--grad);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 0 12px var(--grad-glow);
}

/* Tables */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-l);
}

table {
  width: 100%;
  border-collapse: collapse;
}

th {
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-3);
  padding: 10px 16px;
  background: var(--bg-3);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

td {
  padding: 12px 16px;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

tr:last-child td { border-bottom: none; }

tr:hover td { background: var(--surface); }

.td-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.badge-green  { background: var(--green-bg);  color: var(--green); }
.badge-red    { background: var(--red-bg);    color: var(--red); }
.badge-yellow { background: var(--yellow-bg); color: var(--yellow); }
.badge-blue   { background: var(--blue-bg);   color: var(--blue); }
.badge-gray   { background: var(--surface);   color: var(--text-2); border: 1px solid var(--border); }

/* Online status indicator */
.online-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
}

/* Code / copy */
.code-block {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 12px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--accent-3);
  overflow: hidden;
}

.code-block span {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ════════════════════════════════════════════════════════════
   MODALS
════════════════════════════════════════════════════════════ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: fadeIn 150ms var(--ease);
}

.modal {
  background: var(--bg-2);
  border: 1px solid var(--border-s);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 520px;
  box-shadow: var(--shadow-l), var(--shadow-glow);
  animation: slideUp 200ms var(--ease);
  max-height: 90vh;
  overflow-y: auto;
}

.modal-lg { max-width: 800px; }
.modal-xl { max-width: 1100px; }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}

.modal-title { font-size: 16px; font-weight: 600; }

.modal-close {
  background: none;
  border: none;
  color: var(--text-2);
  cursor: pointer;
  font-size: 20px;
  padding: 4px;
  line-height: 1;
  border-radius: var(--radius-s);
  transition: color var(--dur);
}
.modal-close:hover { color: var(--text); }

.modal-body    { padding: 24px; }
.modal-footer  {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
}

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

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ════════════════════════════════════════════════════════════
   TOASTS
════════════════════════════════════════════════════════════ */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius);
  background: var(--bg-2);
  border: 1px solid var(--border-s);
  box-shadow: var(--shadow);
  font-size: 13px;
  font-weight: 500;
  pointer-events: all;
  animation: toastIn 300ms var(--ease);
  min-width: 260px;
  max-width: 380px;
  word-break: break-word;
}

.toast.success { border-left: 3px solid var(--green); }
.toast.error   { border-left: 3px solid var(--red); }
.toast.info    { border-left: 3px solid var(--accent); }
.toast.warning { border-left: 3px solid var(--yellow); }

.toast-icon { font-size: 16px; flex-shrink: 0; }
.toast-msg  { flex: 1; color: var(--text); }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ════════════════════════════════════════════════════════════
   DISEÑO PREMIUM TICKET (ENTRADAS)
════════════════════════════════════════════════════════════ */
.ticket-card {
  background: var(--bg-2);
  border-radius: var(--radius-l);
  border: 1px solid var(--border);
  overflow: hidden;
  position: relative;
  box-shadow: var(--shadow-l);
  display: flex;
  flex-direction: column;
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
  margin-bottom: 24px;
}
.ticket-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}
.ticket-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: var(--grad);
}
.ticket-card.expired::before { background: var(--text-muted); }
.ticket-card.pending::before { background: var(--yellow); }

.ticket-header {
  padding: 20px 24px 16px;
  border-bottom: 2px dashed var(--border);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  position: relative;
}
.ticket-header::after, .ticket-header::before {
  content: '';
  position: absolute;
  bottom: -10px;
  width: 20px;
  height: 20px;
  background: var(--bg);
  border-radius: 50%;
  border: 1px solid var(--border);
}
.ticket-header::before { left: -11px; }
.ticket-header::after  { right: -11px; }

.ticket-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}
.ticket-icon {
  width: 44px;
  height: 44px;
  background: var(--surface);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  border: 1px solid var(--border-s);
}
.ticket-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}
.ticket-subtitle {
  font-size: 12px;
  color: var(--text-2);
  display: flex;
  align-items: center;
  gap: 4px;
}

.ticket-body {
  padding: 24px;
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}
.ticket-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 200px;
}
.ticket-row {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}
.ticket-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.ticket-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-3);
  font-weight: 600;
}
.ticket-value {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}
.ticket-value.time {
  font-feature-settings: "tnum";
  font-family: monospace;
  font-size: 16px;
  color: var(--accent-3);
}

.ticket-qr {
  width: 80px;
  height: 80px;
  background: var(--surface);
  border: 1px solid var(--border-s);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  flex-shrink: 0;
  opacity: 0.8;
}

.ticket-footer {
  padding: 16px 24px 20px;
  background: var(--surface-a);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.ticket-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.ticket-btn {
  flex: 1;
  min-width: 120px;
  justify-content: center;
}

/* ════════════════════════════════════════════════════════════
   DEVICE CARDS (connected devices on dashboard)
════════════════════════════════════════════════════════════ */
.device-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.device-card {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-l);
  padding: 16px;
  transition: border-color var(--dur);
}

.device-card.online  { border-left: 3px solid var(--green); }
.device-card.offline { border-left: 3px solid var(--text-3); opacity: 0.6; }

.device-card-name  { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.device-card-meta  { font-size: 12px; color: var(--text-2); display: flex; flex-direction: column; gap: 3px; }

.device-card-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

/* ════════════════════════════════════════════════════════════
   SETTINGS PAGE
════════════════════════════════════════════════════════════ */
.settings-group {
  margin-bottom: 28px;
}

.settings-group-title {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--accent-3);
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}

.setting-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.setting-row:last-child { border-bottom: none; }

.setting-info { flex: 1; min-width: 0; }
.setting-key  { font-size: 11px; color: var(--text-3); font-family: 'JetBrains Mono', monospace; margin-bottom: 2px; }
.setting-label { font-size: 13px; font-weight: 500; }

.setting-value {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1.5;
  min-width: 0;
}

.setting-input {
  flex: 1;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  padding: 7px 10px;
  outline: none;
  min-width: 0;
}

.setting-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(99,102,241,0.15);
}

.enc-badge {
  font-size: 10px;
  font-family: 'JetBrains Mono', monospace;
  background: var(--yellow-bg);
  color: var(--yellow);
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ════════════════════════════════════════════════════════════
   FILTER BAR (access log)
════════════════════════════════════════════════════════════ */
.filter-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: flex-end;
  margin-bottom: 16px;
}

.filter-bar .field { min-width: 160px; }

/* ════════════════════════════════════════════════════════════
   EMPTY STATE
════════════════════════════════════════════════════════════ */
.empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-2);
}

.empty-icon { font-size: 48px; margin-bottom: 12px; opacity: 0.5; }
.empty-title { font-size: 16px; font-weight: 600; margin-bottom: 6px; }
.empty-sub   { font-size: 13px; color: var(--text-3); }

/* ════════════════════════════════════════════════════════════
   PAGE HEADER
════════════════════════════════════════════════════════════ */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
  flex-wrap: wrap;
}

.page-title { font-size: 20px; font-weight: 700; letter-spacing: -0.3px; }
.page-sub   { font-size: 13px; color: var(--text-2); margin-top: 3px; }

/* ════════════════════════════════════════════════════════════
   UTILITIES
════════════════════════════════════════════════════════════ */
.hidden { display: none !important; }

.mono { font-family: 'JetBrains Mono', monospace; font-size: 12px; color: var(--accent-3); }

.text-muted { color: var(--text-2); }
.text-sm    { font-size: 12px; }

.flex       { display: flex; }
.flex-col   { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.mb-3  { margin-bottom: 12px; }
.mb-4  { margin-bottom: 16px; }
.mb-6  { margin-bottom: 24px; }
.mt-4  { margin-top: 16px; }

.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,0.2);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ════════════════════════════════════════════════════════════
   RESPONSIVE
════════════════════════════════════════════════════════════ */
.hamburger {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  font-size: 20px;
  cursor: pointer;
  padding: 6px;
}

@media (max-width: 768px) {
  :root { --sidebar-w: 240px; }

  .hamburger { display: flex; }

  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: var(--shadow-l);
  }

  .main { margin-left: 0; }

  .page { padding: 16px; }

  .form-grid-2,
  .form-grid-3 { grid-template-columns: 1fr; }

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

  .setting-row { flex-direction: column; align-items: flex-start; }
  .setting-value { width: 100%; }

  .toast-container {
    left: 20px;
    right: 20px;
    align-items: stretch;
  }
  .toast {
    min-width: 0;
    max-width: 100%;
  }
}
