/* app.css — Auntysue Tutorial Center dashboard */

/* ── Tokens ──────────────────────────────────────────────────────────────── */
:root {
  --bg:             #F4F5F9;
  --surface:        #FFFFFF;
  --surface-raised: #EEF0F6;
  --border:         #E2E4ED;
  --text:           #13131F;
  --muted:          #6B6B8A;
  --faint:          #A0A0B8;
  --primary:        #0EA5C9;
  --primary-hover:  #0993B5;
  --primary-soft:   #E0F5FA;
  --on-primary:     #FFFFFF;
  --amber:          #D97706;
  --amber-soft:     #FEF3C7;
  --green:          #059669;
  --green-soft:     #D1FAE5;
  --red:            #DC2626;
  --red-soft:       #FEE2E2;
  --radius:         10px;
  --radius-lg:      16px;
  --sidebar-w:      260px;
  --topbar-h:       56px;
  --right-panel-w:  300px;
}

[data-theme="dark"] {
  --bg:             #13131F;
  --surface:        #1E1E2E;
  --surface-raised: #252538;
  --border:         rgba(255,255,255,0.08);
  --text:           #E8E8F4;
  --muted:          #8888AA;
  --faint:          #55557A;
  --primary:        #17C1E8;
  --primary-hover:  #2DCFEF;
  --primary-soft:   rgba(23,193,232,0.12);
  --on-primary:     #0A1628;
  --amber:          #F6C90E;
  --amber-soft:     rgba(246,201,14,0.12);
  --green:          #4CAF50;
  --green-soft:     rgba(76,175,80,0.12);
  --red:            #F87171;
  --red-soft:       rgba(248,113,113,0.12);
}

/* ── Reset ───────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 14px;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.2s, color 0.2s;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; -webkit-appearance: none; appearance: none; }

/* ── Shell ───────────────────────────────────────────────────────────────── */
.shell {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ── Sidebar ─────────────────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: background 0.2s, border-color 0.2s, width 0.2s, transform 0.2s;
  z-index: 40;
}

.sidebar-logo {
  height: 64px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.sidebar-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--primary-soft);
  border: 1px solid var(--primary);
  color: var(--primary);
  font-size: 18px;
  font-weight: 700;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  letter-spacing: -1px;
}
.sidebar-name {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  line-height: 1.25;
}
.sidebar-role-label {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 500;
  margin-top: 1px;
}

.sidebar-nav {
  flex: 1;
  padding: 12px 10px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.nav-group-label {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--faint);
  padding: 12px 8px 4px;
}
.nav-link {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 12px;
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  transition: background 0.12s, color 0.12s;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}
.nav-link:hover { background: var(--surface-raised); color: var(--text); }
.nav-link.active {
  background: var(--primary);
  color: var(--on-primary);
}
.nav-link.active svg { stroke: var(--on-primary); }
.nav-link svg { flex-shrink: 0; opacity: 0.8; }
.nav-link.active svg { opacity: 1; }

.sidebar-footer {
  padding: 12px 10px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius);
  margin-bottom: 4px;
}
.sidebar-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary-soft);
  border: 1px solid var(--primary);
  color: var(--primary);
  font-size: 13px;
  font-weight: 700;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.sidebar-user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-user-email {
  font-size: 11.5px;
  color: var(--faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Shell body ──────────────────────────────────────────────────────────── */
.shell-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

/* ── Topbar ──────────────────────────────────────────────────────────────── */
.topbar {
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 12px;
  flex-shrink: 0;
  transition: background 0.2s, border-color 0.2s;
}
.topbar-menu-btn {
  display: none;
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  border: none;
  background: none;
  color: var(--muted);
  place-items: center;
  transition: background 0.12s, color 0.12s;
}
.topbar-menu-btn:hover { background: var(--surface-raised); color: var(--text); }

.topbar-search {
  flex: 1;
  max-width: 440px;
  margin: 0;            /* reset default <form> margin so it stays centred in the topbar */
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0 12px;
  height: 36px;
  box-sizing: border-box;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.topbar-search:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}
.topbar-search svg { color: var(--faint); flex-shrink: 0; }
.topbar-search input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font: 14px 'Inter', sans-serif;
  color: var(--text);
}
.topbar-search input::placeholder { color: var(--faint); }

.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}
.topbar-icon-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  display: grid;
  place-items: center;
  transition: border-color 0.15s, color 0.15s;
  position: relative;
}
.topbar-icon-btn:hover { border-color: var(--primary); color: var(--primary); }

.notif-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 16px;
  height: 16px;
  background: var(--red);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 2px solid var(--surface);
}

.topbar-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--primary-soft);
  border: 1px solid var(--primary);
  color: var(--primary);
  font-size: 13px;
  font-weight: 700;
  display: grid;
  place-items: center;
  cursor: pointer;
}

/* ── Shell content ───────────────────────────────────────────────────────── */
.shell-content {
  flex: 1;
  display: flex;
  overflow: hidden;
}
.page-main {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  min-width: 0;
}
.right-panel {
  width: var(--right-panel-w);
  flex-shrink: 0;
  border-left: 1px solid var(--border);
  overflow-y: auto;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  background: var(--surface);
}

/* ── Cards ───────────────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  transition: background 0.2s, border-color 0.2s;
}
[data-theme="dark"] .card { box-shadow: none; }

/* ── Hero card ───────────────────────────────────────────────────────────── */
.hero-card {
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}
.hero-card.amber {
  background: linear-gradient(135deg, #D97706 0%, #F59E0B 100%);
  color: #fff;
}
.hero-card.primary {
  background: linear-gradient(135deg, #0993B5 0%, #17C1E8 100%);
  color: #fff;
}
.hero-card.green {
  background: linear-gradient(135deg, #047857 0%, #059669 100%);
  color: #fff;
}
.hero-card::after {
  content: '';
  position: absolute;
  right: -40px;
  top: -40px;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  pointer-events: none;
}
.hero-eyebrow {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  opacity: 0.75;
  margin: 0 0 10px;
}
.hero-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 0 0 8px;
  line-height: 1.2;
}
.hero-sub {
  font-size: 14px;
  opacity: 0.82;
  margin: 0 0 20px;
  max-width: 48ch;
  line-height: 1.55;
}
.hero-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  background: rgba(255,255,255,0.22);
  border: 1px solid rgba(255,255,255,0.35);
  border-radius: var(--radius);
  color: #fff;
  font: 600 13.5px 'Inter', sans-serif;
  transition: background 0.15s;
  text-decoration: none;
}
.hero-btn:hover { background: rgba(255,255,255,0.32); }

/* ── Stat cards ──────────────────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  transition: background 0.2s, border-color 0.2s;
}
[data-theme="dark"] .stat-card { box-shadow: none; }
.stat-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.stat-icon.cyan   { background: var(--primary-soft); color: var(--primary); }
.stat-icon.amber  { background: var(--amber-soft);   color: var(--amber);   }
.stat-icon.green  { background: var(--green-soft);   color: var(--green);   }
.stat-icon.red    { background: var(--red-soft);     color: var(--red);     }
.stat-body { flex: 1; min-width: 0; }
.stat-value {
  font-size: 26px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  margin-bottom: 4px;
}
.stat-label { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.stat-delta {
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 3px;
  margin-top: 6px;
}
.stat-delta.up   { color: var(--green); }
.stat-delta.down { color: var(--red);   }

/* ── Section header ──────────────────────────────────────────────────────── */
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.section-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}
.section-action {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 3px;
  transition: color 0.15s;
}
.section-action:hover { color: var(--primary-hover); }

/* ── Dashboard content grid ──────────────────────────────────────────────── */
.dash-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}
.dash-grid.single { grid-template-columns: 1fr; }
.dash-grid.thirds { grid-template-columns: repeat(3, 1fr); }

/* ── Empty state ─────────────────────────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 36px 24px;
  color: var(--muted);
}
.empty-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--surface-raised);
  display: grid;
  place-items: center;
  margin-bottom: 14px;
  color: var(--faint);
}
.empty-title { font-size: 14px; font-weight: 600; color: var(--text); margin: 0 0 6px; }
.empty-desc  { font-size: 13px; color: var(--muted); line-height: 1.55; max-width: 28ch; margin: 0; }

/* ── Badges ──────────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
}
.badge-primary { background: var(--primary-soft); color: var(--primary); }
.badge-amber   { background: var(--amber-soft);   color: var(--amber);   }
.badge-green   { background: var(--green-soft);   color: var(--green);   }
.badge-red     { background: var(--red-soft);     color: var(--red);     }

/* ── Progress bar ────────────────────────────────────────────────────────── */
.progress-track {
  height: 6px;
  background: var(--surface-raised);
  border-radius: 99px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: 99px;
  background: var(--green);
  transition: width 0.4s ease;
}
.progress-fill.primary { background: var(--primary); }

/* ── Quick action buttons (admin) ────────────────────────────────────────── */
.quick-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}
.quick-action {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  text-align: center;
  transition: border-color 0.15s, background 0.15s, transform 0.15s;
  text-decoration: none;
}
.quick-action:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
  transform: translateY(-2px);
}
.quick-action-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--surface-raised);
  display: grid;
  place-items: center;
  color: var(--primary);
  transition: background 0.15s;
}
.quick-action:hover .quick-action-icon { background: var(--primary); color: var(--on-primary); }

/* ── Right panel components ──────────────────────────────────────────────── */
.panel-section-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
  margin-bottom: 12px;
}

/* ── Sidebar overlay (mobile) ────────────────────────────────────────────── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 30;
  pointer-events: none;
}
.sidebar-overlay.active {
  display: block;
  pointer-events: auto;
}

/* ── Responsive grid utilities ───────────────────────────────────────────── */
/* Use these classes on form/content grids instead of inline grid-template-columns */
.rg-2 { display: grid; grid-template-columns: 1fr 1fr;         gap: 14px; }
.rg-3 { display: grid; grid-template-columns: 1fr 1fr 1fr;     gap: 14px; }
.rg-2-1 { display: grid; grid-template-columns: 2fr 1fr;       gap: 14px; }
.rg-filter { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }

/* Scrollable table wrapper */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-wrap table { min-width: 500px; }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 1280px) {
  .right-panel { display: none; }
}
@media (max-width: 1024px) {
  .stats-grid   { grid-template-columns: repeat(2, 1fr); }
  .quick-actions { grid-template-columns: repeat(2, 1fr); }
}

/* ─ Tablet / large mobile (768px) ─────────────────────────────────────── */
@media (max-width: 768px) {
  /* Sidebar off-canvas */
  .sidebar {
    position: fixed;
    inset-y: 0;
    left: 0;
    transform: translateX(-100%);
    z-index: 40;
    box-shadow: 4px 0 24px rgba(0,0,0,0.15);
  }
  .sidebar.open { transform: translateX(0); }
  .topbar-menu-btn { display: grid; }

  /* Right panel moves below main content */
  .shell-content {
    flex-direction: column;
    overflow-y: auto;
  }
  .page-main {
    overflow: visible;
    padding: 16px;
  }
  .right-panel {
    display: block;
    width: 100%;
    border-left: none;
    border-top: 1px solid var(--border);
    overflow: visible;
    padding: 16px;
  }

  /* Grids */
  .dash-grid              { grid-template-columns: 1fr; }
  .stats-grid             { grid-template-columns: repeat(2, 1fr); }
  .rg-2, .rg-3, .rg-2-1  { grid-template-columns: 1fr; }

  /* Cards */
  .card                   { padding: 16px; }
  .hero-card              { padding: 20px; }
  .hero-title             { font-size: 18px; }

  /* Topbar search shrinks */
  .topbar-search          { max-width: 180px; }

  /* Attendance marking row stacks */
  .att-row {
    display: flex !important;
    flex-direction: column;
    gap: 8px !important;
    padding: 12px 16px !important;
  }
  .att-row .att-name      { font-size: 14px; font-weight: 700; }
  .att-row .att-status    { display: flex; flex-wrap: wrap; gap: 4px; }
  .att-row .att-notes     { width: 100%; }
}

/* ─ Small mobile (480px) ───────────────────────────────────────────────── */
@media (max-width: 480px) {
  .stats-grid             { grid-template-columns: 1fr; }
  .quick-actions          { grid-template-columns: repeat(2, 1fr); }
  .topbar-search          { display: none; }
  .page-main              { padding: 12px; }
  .card                   { padding: 14px; border-radius: var(--radius); }
}

/* ── Notification + User dropdowns ──────────────────────────────────────── */
/* position:fixed escapes overflow:hidden parents (shell-body clips position:absolute) */

.notif-wrap,
.user-wrap   { position: relative; }

.notif-drop,
.user-drop {
  display: none;
  position: fixed;   /* ← fixed, not absolute — avoids overflow:hidden clipping */
  width: 340px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 32px rgba(0,0,0,0.14);
  z-index: 999;
  overflow: hidden;
}
.notif-drop.open,
.user-drop.open { display: block; }

.user-drop { width: 240px; }

.notif-drop-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.notif-mark-all {
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}
.notif-mark-all:hover { color: var(--primary-hover); }

.notif-drop-body {
  max-height: 360px;
  overflow-y: auto;
}

.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 11px 16px;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
  transition: background 0.12s;
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: var(--surface-raised); }
.notif-item.unread { background: var(--primary-soft); }
.notif-item.unread:hover { background: var(--primary-soft); filter: brightness(0.97); }

.notif-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  margin-top: 1px;
}
.notif-text { flex: 1; min-width: 0; }
.notif-title {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 2px;
  color: var(--text);
}
.notif-body {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.notif-time {
  font-size: 11px;
  color: var(--faint);
  margin-top: 4px;
}

/* ── User dropdown ───────────────────────────────────────────────────────── */
.user-drop-info {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}
.user-drop-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--primary-soft);
  border: 2px solid var(--primary);
  color: var(--primary);
  font-size: 14px;
  font-weight: 700;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.user-drop-name  { font-size: 13.5px; font-weight: 700; color: var(--text); line-height: 1.2; }
.user-drop-email { font-size: 11.5px; color: var(--faint); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 160px; }
.user-drop-role  { display: inline-block; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--primary); background: var(--primary-soft); padding: 2px 7px; border-radius: 20px; margin-top: 3px; }

.user-drop-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
  transition: background 0.12s;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}
.user-drop-item:hover { background: var(--surface-raised); }
.user-drop-item.danger { color: var(--red); }
.user-drop-item.danger:hover { background: var(--red-soft); }
.user-drop-divider { height: 1px; background: var(--border); margin: 4px 0; }

/* Topbar avatar gets a hover ring */
.topbar-avatar { transition: box-shadow 0.15s; }
.topbar-avatar:hover { box-shadow: 0 0 0 3px var(--primary-soft); }

@media (max-width: 480px) {
  .notif-drop,
  .user-drop  { width: calc(100vw - 24px); }
}

/* ── Global form element defaults ───────────────────────────────────────── */
/* Any input/select/textarea outside a .field-input wrapper still looks nice */
input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]),
select,
textarea {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 9px 12px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  width: 100%;
}
input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]):focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}
input::placeholder, textarea::placeholder { color: var(--faint); font-weight: 400; }
select { cursor: pointer; }
textarea { resize: vertical; line-height: 1.55; }

/* ── Button utilities ────────────────────────────────────────────────────── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 20px;
  background: var(--primary);
  color: var(--on-primary);
  border: none;
  border-radius: var(--radius);
  font: 600 14px 'Inter', sans-serif;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 2px 8px rgba(14,165,201,0.25);
  white-space: nowrap;
}
.btn-primary:hover  { background: var(--primary-hover); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 16px;
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font: 600 13.5px 'Inter', sans-serif;
  cursor: pointer;
  text-decoration: none;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
  white-space: nowrap;
}
.btn-secondary:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }

.btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 16px;
  background: transparent;
  color: var(--red);
  border: 1px solid var(--red);
  border-radius: var(--radius);
  font: 600 13.5px 'Inter', sans-serif;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s;
  white-space: nowrap;
}
.btn-danger:hover { background: var(--red-soft); }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 12px;
  background: transparent;
  color: var(--muted);
  border: none;
  border-radius: var(--radius);
  font: 600 13px 'Inter', sans-serif;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.btn-ghost:hover { background: var(--surface-raised); color: var(--text); }

/* Size modifiers */
.btn-sm { padding: 6px 12px; font-size: 12.5px; gap: 5px; }
.btn-xs { padding: 4px 9px;  font-size: 12px;   gap: 4px; }

/* ── Form fields (shared with app pages) ────────────────────────────────── */
.field { margin-bottom: 14px; }
.field-label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 6px;
  letter-spacing: 0.01em;
}
.field-hint {
  display: block;
  font-size: 12px;
  color: var(--faint);
  margin-top: 5px;
}
.field-input {
  display: flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
  overflow: hidden;
}
.field-input:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
  background: var(--surface);
}
.field-input.has-error { border-color: var(--red); }
.field-input.has-error:focus-within { box-shadow: 0 0 0 3px var(--red-soft); }
/* Icon directly inside field-input (no wrapper span) */
.field-input > svg {
  flex-shrink: 0;
  color: var(--faint);
  margin-left: 13px;
  transition: color 0.15s;
}
.field-input:focus-within > svg { color: var(--primary); }
.field-input input,
.field-input select,
.field-input textarea {
  flex: 1;
  border: 0 !important;
  box-shadow: none !important;
  outline: 0;
  background: transparent;
  padding: 11px 13px;
  color: var(--text);
  font: 500 14px 'Inter', sans-serif;
  width: 100%;
  min-width: 0;
  border-radius: 0;
}
.field-input input::placeholder,
.field-input textarea::placeholder { color: var(--faint); font-weight: 400; }
/* Password reveal button inside field-input */
.pw-reveal {
  display: grid;
  place-items: center;
  padding: 0 12px;
  height: 42px;
  background: none;
  border: 0;
  color: var(--faint);
  cursor: pointer;
  flex-shrink: 0;
  transition: color 0.15s;
}
.pw-reveal:hover { color: var(--text); }

/* ── Scrollbar ───────────────────────────────────────────────────────────── */
::-webkit-scrollbar       { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--faint); }

/* ── Inline page alerts ─────────────────────────────────────────────────── */
.alert {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 13.5px;
  font-weight: 600;
}
.alert-success { background: var(--green-soft); color: var(--green); border: 1px solid var(--green); }
.alert-error   { background: var(--red-soft);   color: var(--red);   border: 1px solid var(--red);   }
