/* assets/css/main.css — STAR Design System */

:root {
  --primary: #4f46e5;
  --primary-light: #6366f1;
  --primary-dark: #3730a3;
  --accent: #60efca;
  --accent-dark: #0ea5a0;
  --surface: #ffffff;
  --surface-2: #f8f7ff;
  --surface-3: #eef0ff;
  --border: #e2e0f0;
  --text: #1a1730;
  --text-2: #4b4869;
  --text-3: #8e8ba8;
  --success: #10b981;
  --warning: #f59e0b;
  --error: #ef4444;
  --info: #3b82f6;
  --sidebar-w: 0px;
  --header-h: 64px;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(79,70,229,.08), 0 4px 16px rgba(79,70,229,.06);
  --shadow-lg: 0 8px 32px rgba(79,70,229,.12);
  --font-display: 'Sora', sans-serif;
  --font-body: 'Inter', sans-serif;
  --transition: 0.18s cubic-bezier(0.4,0,0.2,1);
}

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

html { font-size: 15px; -webkit-font-smoothing: antialiased; }

body {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--surface-2);
  line-height: 1.6;
  min-height: 100vh;
}

/* ─── AUTH ────────────────────────────────── */
.auth-body { display: flex; align-items: center; justify-content: center; min-height: 100vh;
  background: linear-gradient(135deg, #f0efff 0%, #e8f9f6 100%); }

.auth-wrapper { width: 100%; max-width: 400px; padding: 24px; }

.auth-brand { text-align: center; margin-bottom: 28px; }
.brand-icon { display: inline-flex; margin-bottom: 12px; }
.brand-name { font-family: var(--font-display); font-size: 1.6rem; font-weight: 700; color: var(--primary-dark); }
.brand-tagline { color: var(--text-3); font-size: .85rem; margin-top: 4px; }

.auth-card { background: var(--surface); border-radius: var(--radius); padding: 32px;
  box-shadow: var(--shadow-lg); border: 1px solid var(--border); }
.auth-card h2 { font-family: var(--font-display); font-size: 1.3rem; color: var(--text); }
.auth-sub { color: var(--text-3); font-size: .875rem; margin-top: 4px; margin-bottom: 24px; }
.auth-footer { text-align: center; margin-top: 16px; font-size: .78rem; color: var(--text-3); }
.auth-footer code { background: var(--surface-3); padding: 1px 5px; border-radius: 4px;
  font-size: .75rem; color: var(--primary); }

/* ─── FORMS ───────────────────────────────── */
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: .8rem; font-weight: 500; color: var(--text-2);
  margin-bottom: 6px; letter-spacing: .01em; }

input[type="text"], input[type="email"], input[type="password"], input[type="number"],
input[type="search"], select, textarea {
  width: 100%; padding: 10px 14px; border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  font-family: var(--font-body); font-size: .875rem; color: var(--text);
  background: var(--surface); outline: none; transition: border-color var(--transition);
}
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79,70,229,.1); }
textarea { resize: vertical; min-height: 100px; }

.input-pw-wrap { position: relative; }
.input-pw-wrap input { padding-right: 42px; }
.toggle-pw { position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer; color: var(--text-3); padding: 4px; }
.toggle-pw:hover { color: var(--primary); }

/* ─── BUTTONS ─────────────────────────────── */
.btn-primary { background: var(--primary); color: #fff; border: none; padding: 11px 22px;
  border-radius: var(--radius-sm); font-family: var(--font-body); font-weight: 600;
  font-size: .875rem; cursor: pointer; transition: background var(--transition), transform var(--transition);
  display: inline-flex; align-items: center; gap: 8px; }
.btn-primary:hover { background: var(--primary-light); }
.btn-primary:active { transform: scale(0.98); }
.btn-block { width: 100%; justify-content: center; }

.btn-secondary { background: var(--surface-3); color: var(--primary); border: 1.5px solid var(--border);
  padding: 9px 20px; border-radius: var(--radius-sm); font-weight: 600; font-size: .875rem;
  cursor: pointer; transition: all var(--transition); display: inline-flex; align-items: center; gap: 8px; }
.btn-secondary:hover { background: var(--border); }

.btn-danger { background: #fee2e2; color: var(--error); border: 1.5px solid #fca5a5;
  padding: 9px 20px; border-radius: var(--radius-sm); font-weight: 600; font-size: .875rem;
  cursor: pointer; transition: all var(--transition); }
.btn-danger:hover { background: var(--error); color: #fff; }

.btn-icon { background: none; border: none; padding: 8px; border-radius: var(--radius-sm);
  cursor: pointer; color: var(--text-3); transition: all var(--transition); display: inline-flex; }
.btn-icon:hover { background: var(--surface-3); color: var(--primary); }

.btn-sm { padding: 6px 14px; font-size: .8rem; }
.btn-accent { background: var(--accent-dark); color: #fff; }
.btn-accent:hover { background: var(--accent); color: var(--text); }

/* ─── ALERTS ──────────────────────────────── */
.alert { padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 16px;
  font-size: .85rem; display: flex; align-items: flex-start; gap: 10px; }
.alert-error   { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.alert-success { background: #d1fae5; color: #065f46; border: 1px solid #6ee7b7; }
.alert-warning { background: #fef3c7; color: #92400e; border: 1px solid #fcd34d; }
.alert-info    { background: #dbeafe; color: #1e40af; border: 1px solid #93c5fd; }

/* ─── LAYOUT ──────────────────────────────── */
.app-layout { display: flex; flex-direction: column; min-height: 100vh; }

.floating-top-nav {
  position: sticky; top: 16px; left: 0; right: 0; width: 90%; margin: 16px auto; height: var(--header-h); z-index: 100;
  background: #1e1b4b; color: #c4c2e8; display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px; box-shadow: 0 4px 12px rgba(0,0,0,.15);
  border-radius: 12px;
}

.floating-top-nav .nav-brand { display: flex; align-items: center; gap: 12px; text-decoration: none; cursor: pointer; transition: opacity var(--transition); }
.floating-top-nav .nav-brand:hover { opacity: 0.85; }
.floating-top-nav .nav-brand .brand-icon { display: flex; }
.floating-top-nav .nav-brand .brand-text { font-family: var(--font-display); font-size: 1.1rem; font-weight: 700; color: #fff; line-height:1.2; }
.floating-top-nav .nav-brand .brand-role { font-size: .65rem; color: var(--accent); text-transform: uppercase; letter-spacing: .08em; font-weight: 600; }

.floating-top-nav .nav-menu { flex: 1; display: flex; align-items: center; justify-content: flex-end; gap: 6px; margin-left: auto; margin-right: 24px; }
.floating-top-nav .nav-item { position: relative; padding: 8px 14px; color: rgba(196,194,232,.8); font-size: .88rem; font-weight: 500; text-decoration: none; border-radius: var(--radius-sm); transition: all var(--transition); display:flex; align-items:center; gap: 8px; cursor: pointer; }
.floating-top-nav .nav-item:hover, .floating-top-nav .nav-item.active { background: rgba(255,255,255,.08); color: #fff; }
.floating-top-nav .nav-item .nav-icon { width: 16px; height: 16px; opacity: .85; }

/* Dropdown Menu */
.floating-top-nav .nav-dropdown-wrapper { position: relative; }
.floating-top-nav .nav-dropdown { position: absolute; top: 100%; left: 0; background: var(--surface); color: var(--text); border: 1px solid var(--border); box-shadow: var(--shadow-lg); border-radius: var(--radius-sm); min-width: 200px; padding: 8px 0; opacity: 0; visibility: hidden; transform: translateY(10px); transition: all var(--transition); z-index: 101; display:flex; flex-direction: column; margin-top: 8px; }
.floating-top-nav .nav-dropdown-wrapper:hover .nav-dropdown { opacity: 1; visibility: visible; transform: translateY(0); }
.floating-top-nav .nav-dropdown a { padding: 10px 18px; color: var(--text-2); font-size: .85rem; text-decoration: none; display: flex; align-items: center; gap: 10px; transition: background var(--transition); }
.floating-top-nav .nav-dropdown a:hover { background: var(--surface-2); color: var(--primary); }
.floating-top-nav .nav-dropdown a.active { background: var(--surface-3); color: var(--primary); font-weight: 600; }
.floating-top-nav .nav-dropdown a svg { width: 16px; height: 16px; opacity: 0.7; }
.floating-top-nav .nav-dropdown-wrapper.user-dropdown-wrapper .nav-dropdown { right: 0; left: auto; min-width: 160px; }

.floating-top-nav .nav-actions { display: flex; align-items: center; gap: 12px; }

.sidebar {
  width: var(--sidebar-w); background: #1e1b4b; color: #c4c2e8;
  display: flex; flex-direction: column; position: fixed; top: 0; left: 0;
  height: 100vh; overflow-y: auto; z-index: 100;
  box-shadow: 2px 0 24px rgba(0,0,0,.18);
}

.sidebar-brand { padding: 22px 20px 18px; display: flex; align-items: center; gap: 12px;
  border-bottom: 1px solid rgba(255,255,255,.06); }
.sidebar-brand .brand-icon { display: flex; }
.sidebar-brand .brand-text { font-family: var(--font-display); font-size: 1rem; font-weight: 700;
  color: #fff; }
.sidebar-brand .brand-role { font-size: .7rem; color: var(--accent); letter-spacing: .08em;
  text-transform: uppercase; font-weight: 500; }

.sidebar-nav { flex: 1; padding: 16px 12px; }
.nav-section { margin-bottom: 24px; }
.nav-section-title { font-size: .68rem; letter-spacing: .12em; text-transform: uppercase;
  color: rgba(196,194,232,.4); font-weight: 600; padding: 0 8px; margin-bottom: 8px; }

.nav-item { display: flex; align-items: center; gap: 10px; padding: 9px 12px;
  border-radius: var(--radius-sm); color: rgba(196,194,232,.8); font-size: .85rem;
  font-weight: 500; text-decoration: none; transition: all var(--transition); margin-bottom: 2px; }
.nav-item:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav-item.active { background: rgba(99,102,241,.25); color: #fff; }
.nav-item .nav-icon { width: 18px; height: 18px; flex-shrink: 0; opacity: .85; }
.nav-item .nav-badge { margin-left: auto; background: var(--accent-dark); color: #fff;
  font-size: .65rem; font-weight: 700; padding: 1px 7px; border-radius: 50px; }

.sidebar-footer { padding: 16px 12px; border-top: 1px solid rgba(255,255,255,.06); }
.user-pill { display: flex; align-items: center; gap: 10px; padding: 8px 10px;
  border-radius: var(--radius-sm); }
.user-avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--primary-light);
  display: flex; align-items: center; justify-content: center; color: #fff;
  font-weight: 700; font-size: .8rem; flex-shrink: 0; }
.user-info .user-name { font-size: .82rem; font-weight: 600; color: #fff; }
.user-info .user-role { font-size: .7rem; color: var(--accent); text-transform: capitalize; }

.main-content { flex: 1; display: flex; flex-direction: column; width: 90%; margin: 0 auto; }

/* The old .topbar is replaced by .page-header to avoid collision with topnav */
.page-header { background: transparent; border-bottom: none;
  display: flex; align-items: center; justify-content: space-between; padding: 24px 0 0 0; }
.page-header-title { font-family: var(--font-display); font-size: 1.4rem; font-weight: 700; color: var(--text); }
.page-header-actions { display: flex; align-items: center; gap: 10px; }

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

/* ─── CARDS ───────────────────────────────── */
.card { background: var(--surface); border-radius: var(--radius); border: 1px solid var(--border);
  box-shadow: var(--shadow); }
.card-header { padding: 18px 22px; border-bottom: 1px solid var(--border); display: flex;
  align-items: center; justify-content: space-between; }
.card-title { font-family: var(--font-display); font-size: .95rem; font-weight: 600; }
.card-body { padding: 22px; }

/* ─── STATS ───────────────────────────────── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { background: var(--surface); border-radius: var(--radius); padding: 20px 22px;
  border: 1px solid var(--border); box-shadow: var(--shadow); }
.stat-label { font-size: .75rem; color: var(--text-3); font-weight: 500; text-transform: uppercase;
  letter-spacing: .05em; margin-bottom: 8px; }
.stat-value { font-family: var(--font-display); font-size: 1.8rem; font-weight: 700; color: var(--text);
  line-height: 1; }
.stat-change { font-size: .78rem; color: var(--text-3); margin-top: 4px; }
.stat-icon { float: right; margin-top: -44px; width: 44px; height: 44px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center; }
.stat-icon.blue  { background: #dbeafe; color: var(--info); }
.stat-icon.green { background: #d1fae5; color: var(--success); }
.stat-icon.purple{ background: var(--surface-3); color: var(--primary); }
.stat-icon.amber { background: #fef3c7; color: var(--warning); }

/* ─── TABLES ──────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .85rem; }
thead th { background: var(--surface-2); padding: 12px 16px; text-align: left;
  font-size: .75rem; font-weight: 600; color: var(--text-2); text-transform: uppercase;
  letter-spacing: .05em; border-bottom: 1px solid var(--border); white-space: nowrap; }
tbody td { padding: 12px 16px; border-bottom: 1px solid var(--border); color: var(--text); }
tbody tr:hover { background: var(--surface-2); }
tbody tr:last-child td { border-bottom: none; }

/* ─── BADGES ──────────────────────────────── */
.badge { display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 50px;
  font-size: .72rem; font-weight: 600; letter-spacing: .02em; }
.badge-success { background: #d1fae5; color: #065f46; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-error   { background: #fee2e2; color: #991b1b; }
.badge-info    { background: #dbeafe; color: #1e40af; }
.badge-purple  { background: var(--surface-3); color: var(--primary); }
.badge-gray    { background: #f3f4f6; color: #374151; }

/* ─── CHAT ────────────────────────────────── */
.chat-layout { display: flex; height: calc(100vh - var(--header-h)); overflow: hidden; }

.chat-sidebar { width: 260px; border-right: 1px solid var(--border); display: flex;
  flex-direction: column; background: var(--surface); }
.chat-sessions { flex: 1; overflow-y: auto; padding: 12px; }
.chat-session-item { padding: 10px 12px; border-radius: var(--radius-sm); cursor: pointer;
  margin-bottom: 4px; font-size: .83rem; color: var(--text-2); transition: all var(--transition);
  display: flex; align-items: center; justify-content: space-between; }
.chat-session-item:hover, .chat-session-item.active { background: var(--surface-3); color: var(--primary); }
.chat-session-item .session-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; }
.chat-session-item .delete-session { opacity: 0; color: var(--error); cursor: pointer; font-size: .75rem; }
.chat-session-item:hover .delete-session { opacity: 1; }

.chat-main { flex: 1; display: flex; flex-direction: column; }
.chat-messages { flex: 1; overflow-y: auto; padding: 24px; display: flex; flex-direction: column; gap: 20px; }

.msg-wrap { display: flex; gap: 12px; max-width: 820px; }
.msg-wrap.user { flex-direction: row-reverse; margin-left: auto; }
.msg-avatar { width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center;
  justify-content: center; font-weight: 700; font-size: .78rem; flex-shrink: 0; }
.msg-avatar.ai   { background: linear-gradient(135deg, var(--primary), var(--primary-light)); color: #fff; }
.msg-avatar.user { background: var(--surface-3); color: var(--primary); border: 2px solid var(--border); }
.msg-bubble { padding: 14px 18px; border-radius: var(--radius); font-size: .88rem; line-height: 1.65;
  max-width: 680px; }
.msg-bubble.ai   { background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); }
.msg-bubble.user { background: var(--primary); color: #fff; }
.msg-bubble p { margin-bottom: 8px; }
.msg-bubble p:last-child { margin-bottom: 0; }
.msg-bubble ul, .msg-bubble ol { margin: 8px 0 8px 20px; padding: 0; }
.msg-bubble li { margin-bottom: 4px; line-height: 1.55; }
.msg-bubble h3, .msg-bubble h4, .msg-bubble h5, .msg-bubble h6 {
  font-family: var(--font-display); margin: 12px 0 6px; font-size: .95rem; font-weight: 600; }
.msg-bubble h3:first-child, .msg-bubble h4:first-child { margin-top: 0; }
.msg-bubble strong { font-weight: 600; }
.msg-bubble.ai em { font-style: italic; color: var(--text-2); }
.msg-bubble code { background: rgba(0,0,0,.06); padding: 1px 5px; border-radius: 4px;
  font-family: monospace; font-size: .83em; }
.msg-bubble.user code { background: rgba(255,255,255,.2); }
.msg-sources { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); }
.msg-sources .src-label { font-size: .72rem; color: var(--text-3); font-weight: 600;
  text-transform: uppercase; letter-spacing: .05em; margin-bottom: 6px; }
.source-chip { display: inline-flex; align-items: center; gap: 5px; background: var(--surface-3);
  border: 1px solid var(--border); border-radius: 50px; padding: 3px 10px; font-size: .75rem;
  color: var(--primary); font-weight: 500; margin: 2px 2px 0 0; }
.msg-time { font-size: .7rem; color: var(--text-3); margin-top: 4px; }

.chat-input-area { padding: 20px 24px; border-top: 1px solid var(--border); background: var(--surface); }
.chat-input-wrap { display: flex; gap: 10px; align-items: flex-end;
  background: var(--surface-2); border: 1.5px solid var(--border); border-radius: 14px; padding: 8px 12px; }
.chat-input-wrap:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79,70,229,.1); }
#chatInput { flex: 1; border: none; background: none; outline: none; resize: none;
  font-family: var(--font-body); font-size: .9rem; color: var(--text); max-height: 140px;
  padding: 6px 4px; line-height: 1.5; }
.chat-send-btn { background: var(--primary); color: #fff; border: none; width: 38px; height: 38px;
  border-radius: 10px; cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background var(--transition); flex-shrink: 0; align-self: flex-end; margin-bottom: 2px; }
.chat-send-btn:hover { background: var(--primary-light); }
.chat-send-btn:disabled { background: var(--border); cursor: not-allowed; }
.voice-btn { background: none; border: none; color: var(--text-3); cursor: pointer; width: 36px;
  height: 36px; border-radius: 9px; display: flex; align-items: center; justify-content: center;
  transition: all var(--transition); flex-shrink: 0; align-self: flex-end; margin-bottom: 4px; }
.voice-btn:hover { background: var(--surface-3); color: var(--primary); }
.voice-btn.recording { color: var(--error); animation: pulse 1s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .5; } }

.typing-indicator { display: flex; align-items: center; gap: 5px; padding: 12px 16px; }
.typing-dot { width: 8px; height: 8px; background: var(--primary); border-radius: 50%;
  animation: typing 1.2s infinite; }
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes typing { 0%,60%,100% { transform: translateY(0); } 30% { transform: translateY(-6px); } }

/* ─── FILE UPLOAD ─────────────────────────── */
.drop-zone { border: 2px dashed var(--border); border-radius: var(--radius); padding: 48px 24px;
  text-align: center; cursor: pointer; transition: all var(--transition);
  background: var(--surface-2); }
.drop-zone:hover, .drop-zone.dragover { border-color: var(--primary); background: var(--surface-3); }
.drop-zone-icon { color: var(--text-3); margin-bottom: 12px; }
.drop-zone-text { font-size: .9rem; color: var(--text-2); }
.drop-zone-text strong { color: var(--primary); cursor: pointer; }
.drop-zone-hint { font-size: .78rem; color: var(--text-3); margin-top: 6px; }

.file-list { margin-top: 16px; display: flex; flex-direction: column; gap: 8px; }
.file-item { display: flex; align-items: center; gap: 12px; padding: 12px 16px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.file-item-icon { width: 36px; height: 36px; background: #fee2e2; border-radius: 8px;
  display: flex; align-items: center; justify-content: center; color: var(--error); flex-shrink: 0; }
.file-item-name { font-size: .85rem; font-weight: 500; flex: 1; }
.file-item-size { font-size: .75rem; color: var(--text-3); }
.file-progress { height: 4px; background: var(--border); border-radius: 2px; margin-top: 6px;
  overflow: hidden; }
.file-progress-bar { height: 100%; background: var(--primary); border-radius: 2px; transition: width .3s; }

/* ─── MODAL ───────────────────────────────── */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 1000;
  display: flex; align-items: center; justify-content: center; opacity: 0; pointer-events: none;
  transition: opacity var(--transition); }
.modal-overlay.active { opacity: 1; pointer-events: auto; }
.modal { background: var(--surface); border-radius: var(--radius); max-width: 520px; width: 90%;
  max-height: 80vh; overflow-y: auto; box-shadow: var(--shadow-lg);
  transform: scale(0.96); transition: transform var(--transition); }
.modal-overlay.active .modal { transform: scale(1); }
.modal-header { padding: 20px 24px; border-bottom: 1px solid var(--border); display: flex;
  align-items: center; justify-content: space-between; }
.modal-title { font-family: var(--font-display); font-size: 1rem; font-weight: 600; }
.modal-close { background: none; border: none; font-size: 1.2rem; cursor: pointer; color: var(--text-3); }
.modal-body { padding: 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--border); display: flex;
  gap: 10px; justify-content: flex-end; }

/* ─── STATUS PILL ─────────────────────────── */
.status-pill { display: inline-flex; align-items: center; gap: 5px; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; }
.status-dot.green  { background: var(--success); }
.status-dot.red    { background: var(--error); }
.status-dot.yellow { background: var(--warning); }
.status-dot.blue   { background: var(--info); }

/* ─── MISC ────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-center { display: flex; align-items: center; gap: 10px; }
.text-muted { color: var(--text-3); font-size: .82rem; }
.text-sm { font-size: .82rem; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.empty-state { text-align: center; padding: 60px 24px; color: var(--text-3); }
.empty-state svg { opacity: .3; margin-bottom: 12px; }
.empty-state h3 { font-size: .95rem; color: var(--text-2); margin-bottom: 6px; }
.empty-state p { font-size: .83rem; }

.tabs { display: flex; border-bottom: 2px solid var(--border); margin-bottom: 24px; gap: 0; }
.tab-btn { padding: 10px 20px; background: none; border: none; cursor: pointer;
  font-family: var(--font-body); font-size: .875rem; font-weight: 500; color: var(--text-3);
  border-bottom: 2px solid transparent; margin-bottom: -2px; transition: all var(--transition); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-btn:hover { color: var(--text); }

.processing-spinner { display: inline-block; width: 18px; height: 18px; border: 2.5px solid var(--border);
  border-top-color: var(--primary); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── RESPONSIVE ──────────────────────────── */
/* Hamburger toggle for admin/provider topbar — hidden on desktop */
.topbar-hamburger { display: none; background: none; border: none; cursor: pointer;
  padding: 6px; color: var(--text); border-radius: var(--radius-sm); margin-right: 4px; }
.topbar-hamburger:hover { background: var(--surface-3); }
.app-sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 99; }

@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); transition: transform .25s ease; width: 82%; max-width: 300px; }
  .sidebar.open { transform: translateX(0); }
  .app-sidebar-overlay.show { display: block; }
  .main-content { margin-left: 0; }
  .topbar-hamburger { display: flex; align-items: center; }
  .topbar { padding: 0 14px; gap: 10px; }
  .topbar-title { font-size: .95rem; }
  .page-content { padding: 16px 0; }
  .grid-2 { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .data-table { font-size: .8rem; }
  .data-table th, .data-table td { padding: 8px 10px; }
  .card { padding: 18px; }
  .modal-box { width: 94%; max-width: 94%; }
}
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .topbar-actions .btn-secondary, .topbar-actions .btn-primary { padding: 7px 10px; font-size: .78rem; }
}
/* Make wide tables scroll horizontally on small screens */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
