/* ==========================================================================
   Orbit IT — Employee Support Portal
   Design tokens, layout, components. No external fonts (works fully offline).
   ========================================================================== */

:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-subtle: #f8fafc;
  --surface-hover: #f1f5f9;
  --line: #e2e8f0;
  --line-subtle: #f1f5f9;
  --text: #0f172a;
  --text-muted: #64748b;
  --text-dim: #94a3b8;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  --primary-glow: rgba(37, 99, 235, 0.15);
  --accent: #6366f1;
  --success: #10b981;
  --success-bg: #ecfdf5;
  --warning: #b45309;
  --warning-bg: #fffbeb;
  --urgent: #dc2626;
  --urgent-bg: #fef2f2;
  --purple: #7c3aed;
  --purple-bg: #f5f3ff;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.06), 0 2px 6px -1px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 20px 35px -8px rgba(15, 23, 42, 0.12), 0 8px 16px -4px rgba(15, 23, 42, 0.06);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 18px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
}

[data-theme="dark"] {
  --bg: #090d16;
  --surface: #111726;
  --surface-subtle: #172033;
  --surface-hover: #1f2b45;
  --line: #1e293b;
  --line-subtle: #182234;
  --text: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --primary: #3b82f6;
  --primary-hover: #60a5fa;
  --primary-light: rgba(59, 130, 246, 0.15);
  --primary-glow: rgba(59, 130, 246, 0.25);
  --accent: #818cf8;
  --success: #34d399;
  --success-bg: rgba(16, 185, 129, 0.15);
  --warning: #fbbf24;
  --warning-bg: rgba(245, 158, 11, 0.15);
  --urgent: #f87171;
  --urgent-bg: rgba(239, 68, 68, 0.15);
  --purple: #a78bfa;
  --purple-bg: rgba(139, 92, 246, 0.15);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 25px 50px rgba(0, 0, 0, 0.6);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

body {
  font-family: var(--font);
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  transition: background-color 0.25s ease, color 0.25s ease;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

button, input, select, textarea { font-family: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Authentication ---------- */
.auth-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow-y: auto;
}

.auth-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: min(440px, 100%);
  padding: 36px 32px;
  position: relative;
  overflow: hidden;
  animation: authPop 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes authPop {
  from { transform: translateY(16px) scale(0.97); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}
.auth-card::before {
  content: '';
  position: absolute;
  top: -50px;
  right: -50px;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: var(--primary-glow);
  filter: blur(25px);
  pointer-events: none;
}

.auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; }
.auth-brand-icon {
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: white;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}
.auth-brand-icon svg { width: 22px; height: 22px; }
.auth-brand-text h2 { font-size: 20px; font-weight: 800; letter-spacing: -0.5px; }
.auth-brand-text p { font-size: 12px; color: var(--text-muted); }

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  background: var(--surface-subtle);
  border: 1px solid var(--line);
  padding: 4px;
  border-radius: 10px;
  margin-bottom: 22px;
}
.auth-tab-btn {
  padding: 8px 12px;
  font-size: 12.5px;
  font-weight: 700;
  border-radius: 7px;
  color: var(--text-muted);
  text-align: center;
  transition: all 0.15s ease;
}
.auth-tab-btn.active { background: var(--surface); color: var(--primary); box-shadow: var(--shadow-sm); }

.auth-form { display: flex; flex-direction: column; gap: 16px; }
.auth-field { display: flex; flex-direction: column; gap: 6px; }
.auth-field label { font-size: 12px; font-weight: 700; color: var(--text); }
.auth-field input {
  width: 100%;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface-subtle);
  padding: 11px 13px;
  font-size: 13.5px;
  color: var(--text);
  outline: none;
  transition: all 0.15s ease;
}
.auth-field input:focus {
  background: var(--surface);
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}
.auth-tip {
  font-size: 11.5px;
  color: var(--text-muted);
  line-height: 1.4;
  background: var(--surface-subtle);
  border-radius: 8px;
  padding: 10px 12px;
  border-left: 3px solid var(--primary);
}
.auth-tip.success { border-color: var(--success); background: var(--success-bg); color: var(--text); }
.auth-tip.purple { border-color: var(--purple); background: var(--purple-bg); color: var(--text); }
.auth-tip p { margin-top: 4px; }
.auth-error {
  background: var(--urgent-bg);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: var(--urgent);
  font-size: 12px;
  font-weight: 600;
  padding: 10px 12px;
  border-radius: 8px;
  animation: fadeIn 0.2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.auth-submit-btn {
  margin-top: 6px;
  background: var(--primary);
  color: white;
  font-size: 13.5px;
  font-weight: 700;
  padding: 12px;
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.3);
  transition: all 0.15s ease;
}
.auth-submit-btn:hover:not(:disabled) { background: var(--primary-hover); transform: translateY(-1px); }
.auth-submit-btn:disabled { opacity: 0.6; cursor: wait; }
.auth-link {
  align-self: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
  padding: 4px 8px;
  border-radius: 6px;
}
.auth-link:hover { text-decoration: underline; }
.auth-link:disabled { opacity: 0.5; cursor: wait; }
.auth-links { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 4px; }
.qr-box { display: grid; place-items: center; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px; min-height: 120px; }
.qr-box svg { width: 180px; height: 180px; }
.secret-row { display: flex; flex-direction: column; gap: 4px; align-items: center; text-align: center; }
.secret-key { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; letter-spacing: 1px; background: var(--surface-subtle); border: 1px solid var(--line); border-radius: 6px; padding: 6px 10px; user-select: all; }

.notice-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  background: var(--purple-bg); border: 1px solid rgba(139, 92, 246, 0.3); border-radius: var(--radius);
  padding: 12px 16px; margin-bottom: 20px; font-size: 12.5px;
}
.notice-banner strong { display: block; color: var(--purple); margin-bottom: 2px; }
.notice-banner span { color: var(--text-muted); }
.notice-actions { display: flex; gap: 8px; }
.btn-secondary.btn-sm { font-size: 12px; padding: 8px 12px; }
.feed-header-tools { display: flex; align-items: center; gap: 14px; }
.feed-header-action:disabled { opacity: 0.5; }
.user-status-pill.admin { background: var(--purple-bg); color: var(--purple); }

/* ---------- App layout ---------- */
.app-layout { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; }

.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--line);
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 10;
  transition: border-color 0.25s ease;
}

.brand { display: flex; align-items: center; gap: 12px; padding: 6px 12px 28px; text-decoration: none; color: var(--text); }
.brand-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: white;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}
.brand-icon svg { width: 20px; height: 20px; }
.brand-title { font-size: 18px; font-weight: 800; letter-spacing: -0.5px; }
.brand-title span { color: var(--text-muted); font-weight: 500; }

.nav-group-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 700;
  color: var(--text-dim);
  padding: 10px 12px 6px;
}
.nav-list { display: flex; flex-direction: column; gap: 4px; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-muted);
  transition: all 0.15s ease;
  width: 100%;
  text-align: left;
  position: relative;
}
.nav-item:hover { background: var(--surface-hover); color: var(--text); }
.nav-item.active { background: var(--primary-light); color: var(--primary); }
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; }
.nav-badge {
  margin-left: auto;
  background: var(--surface-hover);
  color: var(--text-muted);
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 10px;
  font-weight: 600;
}
.nav-item.active .nav-badge { background: rgba(37, 99, 235, 0.2); color: var(--primary); }

.sidebar-bottom { margin-top: auto; display: flex; flex-direction: column; gap: 14px; }
.user-profile { display: flex; align-items: center; gap: 10px; padding: 12px 6px 0; border-top: 1px solid var(--line); }
.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: white;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}
.avatar.admin-avatar { background: linear-gradient(135deg, #7c3aed, #4f46e5); }
.avatar.avatar-sm { width: 32px; height: 32px; font-size: 11px; }
.user-info { min-width: 0; flex: 1; }
.user-name { font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 11px; color: var(--text-muted); display: flex; align-items: center; gap: 4px; }
.btn-signout { padding: 6px; border-radius: 6px; color: var(--text-dim); transition: all 0.15s ease; }
.btn-signout:hover { background: var(--urgent-bg); color: var(--urgent); }
.btn-signout svg { width: 17px; height: 17px; }

.main-wrapper { min-width: 0; display: flex; flex-direction: column; }

.topbar {
  height: 68px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding: 0 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 9;
  transition: background-color 0.25s ease, border-color 0.25s ease;
}
.breadcrumb { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-muted); }
.breadcrumb b { color: var(--text); font-weight: 600; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  color: var(--text-muted);
  border: 1px solid var(--line);
  background: var(--surface);
  transition: all 0.15s ease;
  position: relative;
}
.icon-btn:hover { color: var(--text); background: var(--surface-hover); }
.icon-btn svg { width: 18px; height: 18px; }

.role-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 700;
}
.role-tag.admin { background: var(--purple-bg); color: var(--purple); border: 1px solid rgba(139, 92, 246, 0.25); }
.role-tag.employee { background: var(--primary-light); color: var(--primary); border: 1px solid rgba(37, 99, 235, 0.2); }

.content-container { max-width: 1160px; width: 100%; margin: 0 auto; padding: 32px 36px 64px; }

.welcome-header { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 24px; gap: 16px; }
.eyebrow {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 4px;
}
.welcome-header h1 { font-size: 28px; font-weight: 800; letter-spacing: -0.8px; }
.welcome-header p { color: var(--text-muted); font-size: 13.5px; margin-top: 2px; }
.current-date { color: var(--text-muted); font-size: 12.5px; font-weight: 500; display: flex; align-items: center; gap: 6px; white-space: nowrap; }

.hero-banner {
  background: linear-gradient(135deg, #1e3a8a, #1d4ed8 60%, #3b82f6);
  border-radius: var(--radius-lg);
  padding: 26px 30px;
  color: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 25px -5px rgba(29, 78, 216, 0.35);
  margin-bottom: 28px;
}
.hero-banner::after {
  content: '';
  position: absolute;
  right: 180px;
  top: -120px;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,0.18) 0%, rgba(255,255,255,0) 70%);
  pointer-events: none;
}
.hero-banner-content { position: relative; z-index: 2; max-width: 540px; }
.hero-banner h2 { font-size: 20px; font-weight: 800; letter-spacing: -0.4px; margin-bottom: 6px; }
.hero-banner p { font-size: 13px; color: #dbeafe; line-height: 1.45; }
.btn-create-request {
  position: relative;
  z-index: 2;
  background: white;
  color: #1e3a8a;
  font-weight: 700;
  font-size: 13px;
  padding: 11px 20px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
  transition: all 0.2s ease;
  white-space: nowrap;
}
.btn-create-request:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2); background: #f8fafc; }
.btn-create-request svg { width: 16px; height: 16px; }

.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 28px; }
.stat-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
  text-align: left;
  width: 100%;
  display: block;
}
button.stat-card { cursor: pointer; }
button.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: rgba(37, 99, 235, 0.3); }
.stat-top { display: flex; align-items: center; justify-content: space-between; color: var(--text-muted); font-size: 12px; font-weight: 600; }
.stat-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--surface-subtle);
  color: var(--text-muted);
}
.stat-icon svg { width: 17px; height: 17px; }
.stat-icon.blue { background: var(--primary-light); color: var(--primary); }
.stat-icon.amber { background: var(--warning-bg); color: var(--warning); }
.stat-icon.purple { background: var(--purple-bg); color: var(--purple); }
.stat-icon.green { background: var(--success-bg); color: var(--success); }
.stat-num { font-size: 28px; font-weight: 800; letter-spacing: -1px; margin: 10px 0 2px; }
.stat-meta { font-size: 11px; color: var(--text-dim); }

.toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.search-box { position: relative; flex: 1; max-width: 320px; min-width: 200px; }
.search-box svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-dim);
  pointer-events: none;
}
.search-box input {
  width: 100%;
  height: 38px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 0 12px 0 36px;
  font-size: 12.5px;
  color: var(--text);
  outline: none;
  transition: all 0.15s ease;
}
.search-box input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-glow); }

.filter-tabs { display: flex; gap: 6px; background: var(--surface); border: 1px solid var(--line); padding: 4px; border-radius: 10px; }
.tab-btn { padding: 6px 12px; border-radius: 7px; font-size: 11.5px; font-weight: 600; color: var(--text-muted); transition: all 0.15s ease; white-space: nowrap; }
.tab-btn:hover { color: var(--text); }
.tab-btn.active { background: var(--primary); color: white; box-shadow: 0 2px 6px rgba(37, 99, 235, 0.3); }

.dashboard-split { display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(280px, 0.95fr); gap: 20px; align-items: start; }

.feed-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; }
.feed-header { padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.feed-header h3 { font-size: 14px; font-weight: 700; letter-spacing: -0.2px; }
.feed-header-action { font-size: 12px; color: var(--primary); font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
.feed-header-action:hover { text-decoration: underline; }

.request-item {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line-subtle);
  transition: background-color 0.15s ease;
  cursor: pointer;
}
.request-item:last-child { border-bottom: none; }
.request-item:hover, .request-item:focus-visible { background-color: var(--surface-hover); }
.request-item:focus-visible { outline-offset: -2px; }
.req-avatar {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--surface-subtle);
  color: var(--text-muted);
  flex-shrink: 0;
}
.req-avatar svg { width: 19px; height: 19px; }
.req-body { min-width: 0; }
.req-title-row { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.req-title { font-size: 13.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); }
.priority-pill {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.3px;
  white-space: nowrap;
}
.priority-pill.Urgent { background: var(--urgent-bg); color: var(--urgent); border: 1px solid rgba(239,68,68,0.2); }
.priority-pill.High { background: var(--warning-bg); color: var(--warning); border: 1px solid rgba(245,158,11,0.2); }
.priority-pill.Normal { background: var(--primary-light); color: var(--primary); }
.priority-pill.Low { background: var(--surface-subtle); color: var(--text-muted); }

.req-meta-line { font-size: 11.5px; color: var(--text-dim); display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.req-meta-line .req-id, .req-meta-line .req-creator { color: var(--text); font-weight: 700; }
.meta-divider { opacity: 0.5; }

.status-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.status-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-badge.open { background: var(--warning-bg); color: var(--warning); }
.status-badge.progress { background: var(--primary-light); color: var(--primary); }
.status-badge.scheduled { background: var(--purple-bg); color: var(--purple); }
.status-badge.done { background: var(--success-bg); color: var(--success); }

.empty-state { padding: 48px 24px; text-align: center; color: var(--text-muted); }
.empty-icon {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: var(--surface-subtle);
  color: var(--text-dim);
  display: grid;
  place-items: center;
  margin: 0 auto 14px;
}
.empty-icon svg { width: 24px; height: 24px; }
.empty-state h4 { font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.empty-state p { font-size: 12.5px; max-width: 320px; margin: 0 auto 16px; }

.quick-actions-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-sm); margin-bottom: 20px; }
.card-title { font-size: 13.5px; font-weight: 700; margin-bottom: 14px; display: flex; align-items: center; justify-content: space-between; }
.card-title-hint { font-size: 11px; font-weight: 600; color: var(--text-dim); }
.action-btn-grid { display: flex; flex-direction: column; gap: 8px; }
.quick-tile {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  text-align: left;
  transition: all 0.15s ease;
  width: 100%;
}
.quick-tile:hover { border-color: var(--primary); background: var(--surface-hover); transform: translateX(2px); }
.tile-icon { width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; flex-shrink: 0; }
.tile-icon.blue { background: var(--primary-light); color: var(--primary); }
.tile-icon.purple { background: var(--purple-bg); color: var(--purple); }
.tile-icon.amber { background: var(--warning-bg); color: var(--warning); }
.tile-icon.green { background: var(--success-bg); color: var(--success); }
.tile-icon svg { width: 17px; height: 17px; }
.tile-info b { display: block; font-size: 12.5px; font-weight: 700; }
.tile-info small { font-size: 11px; color: var(--text-muted); display: block; }

/* ---------- User directory (admin) ---------- */
.users-management-view { display: flex; flex-direction: column; gap: 24px; }
.users-summary-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.user-table-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; }
.user-table-header { padding: 18px 24px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.table-title { font-size: 14px; font-weight: 700; }
.user-table-header .search-box { max-width: 280px; }
.user-row {
  display: grid;
  grid-template-columns: 40px minmax(180px, 1.5fr) minmax(140px, 1.2fr) minmax(150px, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 14px 24px;
  border-bottom: 1px solid var(--line-subtle);
  transition: background-color 0.15s ease;
}
.user-row:last-child { border-bottom: none; }
.user-row:hover { background-color: var(--surface-hover); }
.user-col-name b { font-size: 13.5px; font-weight: 700; display: block; }
.user-col-name small { font-size: 11px; color: var(--text-dim); }
.user-col-phone { font-size: 13px; font-weight: 600; color: var(--text-muted); }
.user-status-col { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.user-status-pill { font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 12px; display: inline-block; }
.user-status-pill.active { background: var(--success-bg); color: var(--success); }
.user-status-pill.pending { background: var(--warning-bg); color: var(--warning); }
.user-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--purple);
  background: var(--purple-bg);
  padding: 2px 8px;
  border-radius: 6px;
}
.user-actions { display: flex; align-items: center; gap: 8px; justify-content: flex-end; }
.btn-user-action {
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 600;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s ease;
}
.btn-user-action:hover { background: var(--surface-hover); border-color: var(--primary); color: var(--primary); }
.btn-user-delete { color: var(--urgent); }
.btn-user-delete:hover { background: var(--urgent-bg); border-color: var(--urgent); color: var(--urgent); }
.field-hint { color: var(--text-dim); font-size: 11px; }

/* ---------- Modals ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 200;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.modal-backdrop.open { display: flex; opacity: 1; }
.modal-dialog {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  width: min(520px, 100%);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  transform: translateY(12px) scale(0.98);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.modal-dialog.modal-dialog-sm { width: min(420px, 100%); }
.modal-backdrop.open .modal-dialog { transform: translateY(0) scale(1); }
.modal-header { padding: 22px 24px 16px; border-bottom: 1px solid var(--line); display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.modal-header h2 { font-size: 18px; font-weight: 800; letter-spacing: -0.3px; }
.modal-header p { font-size: 12px; color: var(--text-muted); margin-top: 4px; white-space: pre-line; }
.detail-id { font-size: 11px; font-weight: 700; color: var(--primary); text-transform: uppercase; letter-spacing: 0.5px; }
.btn-close-modal {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: var(--text-muted);
  background: var(--surface-subtle);
  transition: all 0.15s ease;
  font-size: 18px;
  flex-shrink: 0;
}
.btn-close-modal:hover { background: var(--surface-hover); color: var(--text); }

.form-body { padding: 20px 24px 24px; display: flex; flex-direction: column; gap: 16px; }
.form-field { display: flex; flex-direction: column; gap: 6px; }
.form-field label { font-size: 12px; font-weight: 700; color: var(--text); }
.form-field input, .form-field select, .form-field textarea {
  width: 100%;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 10px 12px;
  font-size: 13px;
  color: var(--text);
  outline: none;
  transition: all 0.15s ease;
}
.form-field input:focus, .form-field select:focus, .form-field textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-glow); }
.form-field textarea { resize: vertical; min-height: 85px; }
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.conditional-fields { display: none; }
.conditional-fields.visible { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-error { color: var(--urgent); font-size: 12px; font-weight: 600; }

.modal-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 8px; }
.btn-secondary {
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 600;
  transition: all 0.15s ease;
}
.btn-secondary:hover { background: var(--surface-hover); color: var(--text); }
.btn-primary {
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  background: var(--primary);
  color: white;
  font-size: 12.5px;
  font-weight: 700;
  transition: all 0.15s ease;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
}
.btn-primary:hover { background: var(--primary-hover); }
.btn-primary.btn-sm { font-size: 12px; padding: 8px 14px; }
.btn-primary.btn-danger { background: var(--urgent); box-shadow: 0 2px 8px rgba(239, 68, 68, 0.25); }
.btn-primary.btn-danger:hover { background: #b91c1c; }

/* Ticket detail */
.detail-section { background: var(--surface-subtle); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px; margin-bottom: 14px; }
.detail-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 10px; }
.detail-item-title { font-size: 11px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.5px; font-weight: 700; }
.detail-item-val { font-size: 13px; font-weight: 600; margin-top: 2px; }
.detail-desc { white-space: pre-wrap; font-weight: 400; margin-top: 4px; overflow-wrap: anywhere; }
.detail-visit-row { grid-column: 1 / -1; }
.ticket-status-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.btn-status-act {
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}
.btn-status-act:hover { background: var(--surface-hover); border-color: var(--primary); }
.btn-status-act.success { color: var(--success); }
.btn-delete { margin-left: auto; color: var(--urgent); border-color: rgba(239, 68, 68, 0.3); }
.btn-delete:hover { background: var(--urgent-bg); border-color: var(--urgent); }

/* ---------- Toasts ---------- */
.toast-container { position: fixed; bottom: 24px; right: 24px; display: flex; flex-direction: column; gap: 8px; z-index: 500; pointer-events: none; }
.toast-message {
  background: #0f172a;
  color: white;
  padding: 12px 18px;
  border-radius: 10px;
  font-size: 12.5px;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 10px;
  pointer-events: auto;
  animation: slideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  border: 1px solid #1e293b;
  max-width: min(420px, calc(100vw - 48px));
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.toast-message.leaving { opacity: 0; transform: translateY(10px); }
[data-theme="dark"] .toast-message { background: #1e293b; border-color: #334155; }
.toast-message svg { width: 16px; height: 16px; color: var(--success); flex-shrink: 0; }
.toast-message.error svg { color: var(--urgent); }
@keyframes slideUp { from { transform: translateY(16px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* ---------- Mobile ---------- */
.mobile-bottom-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: var(--surface);
  border-top: 1px solid var(--line);
  z-index: 40;
  padding: 0 16px env(safe-area-inset-bottom, 0);
  align-items: center;
  justify-content: space-around;
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.05);
}
.bottom-tab { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 10px; font-weight: 600; color: var(--text-muted); transition: color 0.15s ease; }
.bottom-tab.active { color: var(--primary); }
.bottom-tab svg { width: 20px; height: 20px; }
.mobile-fab {
  display: none;
  position: fixed;
  bottom: 80px;
  right: 20px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
  z-index: 45;
  place-items: center;
}
.mobile-fab svg { width: 24px; height: 24px; }

@media (max-width: 980px) {
  .app-layout { grid-template-columns: 80px 1fr; }
  .brand-title, .nav-group-label, .nav-item span, .nav-badge, .user-info { display: none; }
  .sidebar { padding: 20px 10px; align-items: center; }
  .brand { padding: 0 0 24px; }
  .nav-item { justify-content: center; padding: 12px; }
  .user-profile { padding: 16px 0 0; border: none; justify-content: center; }
  .topbar { padding: 0 24px; }
  .content-container { padding: 24px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-split { grid-template-columns: 1fr; }
  .users-summary-grid { grid-template-columns: 1fr; }
  .user-row { grid-template-columns: 36px 1fr 1fr auto; }
  .user-status-col { display: none; }
}

@media (max-width: 680px) {
  .app-layout { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .mobile-bottom-bar { display: flex; }
  .mobile-fab { display: grid; }
  .topbar { height: 58px; padding: 0 16px; }
  .breadcrumb { font-size: 12px; }
  .content-container { padding: 20px 16px 90px; }
  .welcome-header { flex-direction: column; align-items: flex-start; gap: 8px; }
  .hero-banner { padding: 20px; flex-direction: column; align-items: flex-start; gap: 14px; }
  .hero-banner::after { display: none; }
  .hero-banner button { width: 100%; justify-content: center; }
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-card { padding: 14px; }
  .stat-num { font-size: 22px; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .search-box { max-width: 100%; }
  .filter-tabs { overflow-x: auto; width: 100%; }
  .request-item { grid-template-columns: 34px minmax(0, 1fr); padding: 14px; gap: 12px; }
  .status-badge { grid-column: 2; justify-self: start; margin-top: 2px; }
  .req-avatar { width: 34px; height: 34px; }
  .form-row-2, .conditional-fields.visible { grid-template-columns: 1fr; }
  .modal-dialog { border-radius: var(--radius); }
  .user-row { grid-template-columns: 1fr auto; gap: 10px; }
  .user-avatar-col, .user-status-col { display: none; }
  .toast-container { left: 16px; right: 16px; bottom: 84px; }
}
