/* ============================================================
   TecBro Backend — Design System
   #050508 base · #E8173D accent · Syne display · Inter body
   ============================================================ */

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

/* ── Tokens ─────────────────────────────────────────────── */
:root {
  /* Palette */
  --bg:          #050508;
  --bg-2:        #08080D;
  --surface:     #0D0D14;
  --surface-2:   #121219;
  --surface-3:   #18181F;
  --border:      rgba(255,255,255,0.06);
  --border-2:    rgba(255,255,255,0.10);

  --accent:      #E8173D;
  --accent-dim:  rgba(232,23,61,0.15);
  --accent-glow: rgba(232,23,61,0.25);

  --text:        #F0F0F5;
  --text-mid:    #8A8A9A;
  --text-dim:    #3D3D50;
  --on-accent:   #FFFFFF;

  --green:       #22C55E;
  --green-dim:   rgba(34,197,94,0.12);
  --amber:       #F59E0B;
  --amber-dim:   rgba(245,158,11,0.12);
  --red:         #EF4444;
  --red-dim:     rgba(239,68,68,0.12);
  --purple:      #8B5CF6;
  --purple-dim:  rgba(139,92,246,0.12);
  --blue:        #3B82F6;
  --blue-dim:    rgba(59,130,246,0.12);

  /* Typography */
  --font-display: 'Syne', sans-serif;
  --font-body:    'Inter', sans-serif;
  --font-mono:    'JetBrains Mono', monospace;

  /* Radii */
  --r-sm:  8px;
  --r-md:  12px;
  --r-lg:  16px;
  --r-xl:  20px;
  --r-pill: 999px;

  /* Shadows */
  --shadow-sm:  0 1px 3px rgba(0,0,0,0.4);
  --shadow-md:  0 4px 16px rgba(0,0,0,0.5);
  --shadow-accent: 0 0 24px rgba(232,23,61,0.2);

  /* Transitions */
  --t-fast:   0.12s ease;
  --t-base:   0.2s ease;
  --t-slow:   0.35s ease;

  /* Nav */
  --nav-h: 60px;
}

/* Light mode overrides */
[data-theme="light"] {
  --bg:        #F4F4F8;
  --bg-2:      #EEEEF4;
  --surface:   #FFFFFF;
  --surface-2: #F8F8FC;
  --surface-3: #F0F0F6;
  --border:    rgba(0,0,0,0.07);
  --border-2:  rgba(0,0,0,0.12);
  --text:      #0D0D14;
  --text-mid:  #5A5A70;
  --text-dim:  #AAAABC;
}

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overscroll-behavior: none;
  min-height: 100dvh;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  background: none;
  border: none;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

/* ── Typography ──────────────────────────────────────────── */
.display-xl {
  font-family: var(--font-display);
  font-size: clamp(28px, 7vw, 40px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--text);
}
.display-lg {
  font-family: var(--font-display);
  font-size: clamp(22px, 5vw, 30px);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.2;
}
.display-md {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
}
.label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.label-accent {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
}
.mono {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
}

/* ── Layout ──────────────────────────────────────────────── */
.app-shell {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  background: var(--bg);
}

.page {
  flex: 1;
  padding: 16px 16px calc(var(--nav-h) + 24px);
  max-width: 680px;
  width: 100%;
  margin: 0 auto;
}

.page--full {
  padding: 0;
  max-width: none;
}

/* ── Cards ───────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 16px;
}
.card--sm { padding: 12px 14px; border-radius: var(--r-md); }
.card--lg { padding: 20px; border-radius: var(--r-xl); }
.card--accent {
  border-color: rgba(232,23,61,0.2);
  background: linear-gradient(135deg, rgba(232,23,61,0.05) 0%, var(--surface) 60%);
}
.card--interactive {
  cursor: pointer;
  transition: border-color var(--t-fast), background var(--t-fast);
}
.card--interactive:active {
  background: var(--surface-2);
  border-color: var(--border-2);
}

/* ── Home screen animations ──────────────────────────────── */
@keyframes card-fade-up {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes value-pop {
  0%   { transform: scale(0.92); opacity: 0; }
  60%  { transform: scale(1.04); }
  100% { transform: scale(1);    opacity: 1; }
}
@keyframes bar-grow {
  from { transform: scaleY(0); transform-origin: bottom; }
  to   { transform: scaleY(1); transform-origin: bottom; }
}

/* Stat card — interactive */
.home-stat-card {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  padding: 18px 16px;
  flex: 1 1 140px;
  min-width: 130px;
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  transition: border-color 0.2s, transform 0.15s, box-shadow 0.2s;
  animation: card-fade-up 0.4s cubic-bezier(0.16,1,0.3,1) both;
}
.home-stat-card:active {
  transform: scale(0.97);
}
.home-stat-card:hover {
  border-color: var(--border-2);
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}
.home-stat-card--accent {
  background: linear-gradient(135deg, rgba(232,23,61,0.10) 0%, rgba(232,23,61,0.03) 100%);
  border-color: rgba(232,23,61,0.22);
}
.home-stat-card--accent:hover {
  border-color: rgba(232,23,61,0.4);
  box-shadow: 0 4px 24px rgba(232,23,61,0.15);
}
/* Shimmer line on top of accent card */
.home-stat-card--accent::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, rgba(232,23,61,0.8), transparent);
}
.home-stat-card__label {
  font-family: var(--font-mono);
  font-size: 9px; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--text-dim); margin-bottom: 10px;
}
.home-stat-card__value {
  font-family: 'Urbanist','Syne',sans-serif;
  font-size: 28px; font-weight: 800;
  letter-spacing: -0.03em; line-height: 1;
  animation: value-pop 0.5s cubic-bezier(0.34,1.56,0.64,1) both;
  animation-delay: 0.15s;
}
.home-stat-card__sub {
  font-size: 11px; color: var(--text-mid);
  margin-top: 6px; line-height: 1.4;
}

/* Section label */
.home-section-label {
  font-family: var(--font-mono);
  font-size: 9px; font-weight: 700;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 12px;
  display: flex; align-items: center; gap: 8px;
}
.home-section-label::before {
  content: '';
  display: inline-block;
  width: 16px; height: 1.5px;
  background: var(--accent);
  border-radius: 2px;
  opacity: 0.7;
}

/* Quick access grid */
.home-quick-btn {
  display: flex; flex-direction: column;
  align-items: center; gap: 6px;
  padding: 14px 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  cursor: pointer;
  flex: 1 1 70px; min-width: 68px; max-width: 90px;
  transition: border-color 0.15s, background 0.15s, transform 0.1s;
  -webkit-tap-highlight-color: transparent;
  animation: card-fade-up 0.4s cubic-bezier(0.16,1,0.3,1) both;
}
.home-quick-btn:active {
  transform: scale(0.93);
  background: var(--surface-2);
}
.home-quick-btn:hover {
  border-color: rgba(232,23,61,0.25);
}
.home-quick-btn__icon {
  width: 36px; height: 36px; border-radius: 10px;
  background: rgba(232,23,61,0.08);
  display: flex; align-items: center; justify-content: center;
  color: var(--accent);
  transition: background 0.15s;
}
.home-quick-btn:hover .home-quick-btn__icon,
.home-quick-btn:active .home-quick-btn__icon {
  background: rgba(232,23,61,0.15);
}
.home-quick-btn__label {
  font-size: 10px; color: var(--text-mid);
  font-family: var(--font-mono); font-weight: 600;
  letter-spacing: 0.04em; text-align: center; line-height: 1.3;
}


  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
.stat-card__label {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.stat-card__value {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.stat-card--accent  { border-left: 2px solid var(--accent);  }
.stat-card--green   { border-left: 2px solid var(--green);   }
.stat-card--amber   { border-left: 2px solid var(--amber);   }
.stat-card--purple  { border-left: 2px solid var(--purple);  }
.stat-card--red     { border-left: 2px solid var(--red);     }
.stat-card--blue    { border-left: 2px solid var(--blue);    }

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: var(--r-md);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity var(--t-fast), transform var(--t-fast);
  white-space: nowrap;
  border: none;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { opacity: 0.85; transform: scale(0.98); }

.btn--primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 20px var(--accent-glow);
}
.btn--secondary {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border-2);
}
.btn--ghost {
  background: transparent;
  color: var(--text-mid);
  border: 1px solid var(--border);
}
.btn--danger {
  background: var(--red-dim);
  color: var(--red);
  border: 1px solid rgba(239,68,68,0.2);
}
.btn--full { width: 100%; }
.btn--sm { padding: 8px 14px; font-size: 12px; border-radius: var(--r-sm); }
.btn--lg { padding: 15px 24px; font-size: 15px; border-radius: var(--r-lg); }

/* ── Inputs ──────────────────────────────────────────────── */
.input {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 12px 14px;
  font-size: 15px;
  color: var(--text);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
  -webkit-appearance: none;
}
.input::placeholder { color: var(--text-dim); }
.input:focus {
  border-color: rgba(232,23,61,0.4);
  box-shadow: 0 0 0 3px var(--accent-dim);
  outline: none;
}
.input--sm { padding: 9px 12px; font-size: 13px; }

.input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.input-group__label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-mid);
}

/* ── Status Badges ───────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: var(--r-pill);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}
.badge--green  { background: var(--green-dim);  color: var(--green);  border: 1px solid rgba(34,197,94,0.2);  }
.badge--amber  { background: var(--amber-dim);  color: var(--amber);  border: 1px solid rgba(245,158,11,0.2); }
.badge--red    { background: var(--red-dim);    color: var(--red);    border: 1px solid rgba(239,68,68,0.2);  }
.badge--purple { background: var(--purple-dim); color: var(--purple); border: 1px solid rgba(139,92,246,0.2); }
.badge--blue   { background: var(--blue-dim);   color: var(--blue);   border: 1px solid rgba(59,130,246,0.2); }
.badge--accent { background: var(--accent-dim); color: var(--accent); border: 1px solid rgba(232,23,61,0.2);  }
.badge--dim    { background: rgba(255,255,255,0.05); color: var(--text-mid); border: 1px solid var(--border); }

/* ── Dividers ────────────────────────────────────────────── */
.divider {
  height: 1px;
  background: var(--border);
  margin: 16px 0;
}

/* ── Section Headers ─────────────────────────────────────── */
.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.section-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}
.section-action {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  cursor: pointer;
}

/* ── Top Bar ─────────────────────────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(5,5,8,0.85);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid var(--border);
  padding: 0 16px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: 100%;
}
[data-theme="light"] .topbar {
  background: rgba(244,244,248,0.85);
}
.topbar__brand {
  display: flex;
  align-items: center;
  gap: 9px;
}
.topbar__logo {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  object-fit: contain;
}
.topbar__name {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
}
.topbar__sub {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-top: 1px;
}
.topbar__actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Live indicator */
.live-dot {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--green);
}
.live-dot::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  animation: pulse-dot 2s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.5; transform: scale(0.8); }
}

/* ── Bottom Nav ──────────────────────────────────────────── */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 50;
  height: var(--nav-h);
  background: rgba(5,5,8,0.92);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
[data-theme="light"] .bottom-nav {
  background: rgba(244,244,248,0.92);
}
.bottom-nav__inner {
  display: flex;
  align-items: center;
  height: 100%;
  max-width: 680px;
  margin: 0 auto;
  padding: 0 4px;
}

.nav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 8px 4px 6px;
  border-radius: var(--r-md);
  cursor: pointer;
  border: none;
  background: transparent;
  color: var(--text-dim);
  transition: color var(--t-fast), background var(--t-fast), flex var(--t-slow);
  -webkit-tap-highlight-color: transparent;
  position: relative;
  min-width: 0;
}
.nav-btn--active {
  color: var(--accent);
  flex: 1.6;
  background: var(--accent-dim);
}
/* The signature red glow behind active tab */
.nav-btn--active::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 2px;
  background: var(--accent);
  border-radius: 0 0 2px 2px;
  box-shadow: 0 0 12px 3px var(--accent-glow);
}
.nav-btn__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--t-fast);
}
.nav-btn--active .nav-btn__icon {
  transform: scale(1.05);
}
.nav-btn__label {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  opacity: 0;
  max-height: 0;
  transition: opacity var(--t-base), max-height var(--t-slow);
  overflow: hidden;
}
.nav-btn--active .nav-btn__label {
  opacity: 1;
  max-height: 20px;
}

/* ── More Drawer ─────────────────────────────────────────── */
.more-backdrop {
  position: fixed;
  inset: 0;
  z-index: 48;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(2px);
  animation: fade-in var(--t-base) ease;
}
.more-drawer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: var(--nav-h);
  z-index: 49;
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  padding: 8px 16px 20px;
  animation: slide-up var(--t-slow) cubic-bezier(0.16,1,0.3,1);
}
.more-drawer__handle {
  width: 36px;
  height: 4px;
  border-radius: var(--r-pill);
  background: var(--border-2);
  margin: 10px auto 16px;
}
.more-drawer__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.more-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 8px;
  border-radius: var(--r-md);
  background: var(--surface-2);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: background var(--t-fast), border-color var(--t-fast);
  -webkit-tap-highlight-color: transparent;
}
.more-item:active { background: var(--surface-3); }
.more-item--active {
  background: var(--accent-dim);
  border-color: rgba(232,23,61,0.2);
  color: var(--accent);
}
.more-item__label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-mid);
  text-align: center;
}
.more-item--active .more-item__label {
  color: var(--accent);
}

/* ── Page Transitions ────────────────────────────────────── */
.page-enter {
  animation: page-in var(--t-slow) cubic-bezier(0.16,1,0.3,1) both;
}
@keyframes page-in {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Animations ──────────────────────────────────────────── */
@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes slide-up {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}
@keyframes slide-down {
  from { transform: translateY(0); }
  to   { transform: translateY(100%); }
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── Login — Futuristic Animations ──────────────────────── */
@keyframes grid-drift {
  0%   { transform: translateY(0); }
  100% { transform: translateY(40px); }
}
@keyframes orb-float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%       { transform: translate(20px, -30px) scale(1.05); }
  66%       { transform: translate(-15px, 15px) scale(0.97); }
}
@keyframes orb-float-2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%       { transform: translate(-25px, 20px) scale(1.08); }
  66%       { transform: translate(18px, -25px) scale(0.95); }
}
@keyframes scan-line {
  0%   { top: -4px; opacity: 0; }
  5%   { opacity: 1; }
  95%  { opacity: 1; }
  100% { top: 100%; opacity: 0; }
}
@keyframes border-glow-rotate {
  0%   { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
@keyframes card-in {
  0%   { opacity: 0; transform: translateY(28px) scale(0.97); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes logo-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(232,23,61,0.4), 0 8px 32px rgba(0,0,0,0.5); }
  50%       { box-shadow: 0 0 0 8px rgba(232,23,61,0), 0 8px 32px rgba(0,0,0,0.5); }
}
@keyframes flicker {
  0%, 97%, 100% { opacity: 1; }
  98%            { opacity: 0.7; }
  99%            { opacity: 1; }
  99.5%          { opacity: 0.8; }
}
@keyframes corner-pulse {
  0%, 100% { opacity: 0.5; }
  50%       { opacity: 1; }
}

/* ── Login Screen ────────────────────────────────────────── */
.login-screen {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 20px;
  background: var(--bg);
  position: relative;
  overflow: hidden;
}

/* Dot grid background */
.login-screen::before {
  content: '';
  position: absolute;
  inset: -40px;
  background-image: radial-gradient(circle, rgba(232,23,61,0.18) 1px, transparent 1px);
  background-size: 32px 32px;
  animation: grid-drift 8s ease-in-out infinite alternate;
  pointer-events: none;
  opacity: 0.5;
}
[data-theme="light"] .login-screen::before {
  opacity: 0.2;
}

/* Main red orb — top */
.login-screen::after {
  content: '';
  position: absolute;
  top: -180px; left: 50%;
  transform: translateX(-50%);
  width: 600px; height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(232,23,61,0.18) 0%, rgba(232,23,61,0.04) 50%, transparent 70%);
  animation: orb-float 12s ease-in-out infinite;
  pointer-events: none;
}

/* ── Card ────────────────────────────────────────────────── */
.login-card {
  width: 100%;
  max-width: 390px;
  position: relative;
  z-index: 2;
  border-radius: 24px;
  padding: 36px 28px 30px;
  animation: card-in 0.6s cubic-bezier(0.16,1,0.3,1) both;

  /* Glassmorphism */
  background: rgba(10,10,16,0.82);
  backdrop-filter: blur(40px) saturate(180%);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.06),
    0 32px 80px rgba(0,0,0,0.7),
    0 0 60px rgba(232,23,61,0.06) inset;
  overflow: hidden;
}
[data-theme="light"] .login-card {
  background: rgba(255,255,255,0.82);
  box-shadow:
    0 0 0 1px rgba(0,0,0,0.07),
    0 24px 60px rgba(0,0,0,0.12),
    0 0 40px rgba(232,23,61,0.04) inset;
}

/* Animated top border — rotating conic gradient clipped to top edge */
.login-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(232,23,61,0.0) 20%,
    rgba(232,23,61,0.8) 50%,
    rgba(232,23,61,0.0) 80%,
    transparent 100%
  );
  animation: flicker 6s ease-in-out infinite;
}

/* Scanning beam — sweeps top to bottom inside card */
.login-card::after {
  content: '';
  position: absolute;
  left: 0; right: 0;
  height: 80px;
  background: linear-gradient(to bottom,
    transparent,
    rgba(232,23,61,0.04) 40%,
    rgba(232,23,61,0.07) 50%,
    rgba(232,23,61,0.04) 60%,
    transparent
  );
  animation: scan-line 5s linear infinite;
  pointer-events: none;
  z-index: 0;
}

/* Corner brackets — top-left */
.login-card .corner-tl,
.login-card .corner-tr,
.login-card .corner-bl,
.login-card .corner-br {
  position: absolute;
  width: 16px; height: 16px;
  animation: corner-pulse 3s ease-in-out infinite;
}
.login-card .corner-tl {
  top: 10px; left: 10px;
  border-top: 1.5px solid rgba(232,23,61,0.6);
  border-left: 1.5px solid rgba(232,23,61,0.6);
  border-radius: 3px 0 0 0;
}
.login-card .corner-tr {
  top: 10px; right: 10px;
  border-top: 1.5px solid rgba(232,23,61,0.6);
  border-right: 1.5px solid rgba(232,23,61,0.6);
  border-radius: 0 3px 0 0;
  animation-delay: 0.75s;
}
.login-card .corner-bl {
  bottom: 10px; left: 10px;
  border-bottom: 1.5px solid rgba(232,23,61,0.6);
  border-left: 1.5px solid rgba(232,23,61,0.6);
  border-radius: 0 0 0 3px;
  animation-delay: 1.5s;
}
.login-card .corner-br {
  bottom: 10px; right: 10px;
  border-bottom: 1.5px solid rgba(232,23,61,0.6);
  border-right: 1.5px solid rgba(232,23,61,0.6);
  border-radius: 0 0 3px 0;
  animation-delay: 2.25s;
}

/* Card inner content above scan layer */
.login-card__inner {
  position: relative;
  z-index: 1;
}

/* Logo ring — clean spinning arc */
.logo-ring {
  position: absolute;
  inset: -6px;
  border-radius: 24px;
  border: 1.5px solid transparent;
  border-top-color: rgba(232,23,61,1);
  border-right-color: rgba(232,23,61,0.3);
  border-bottom-color: transparent;
  border-left-color: rgba(232,23,61,0.15);
  animation: border-glow-rotate 2s linear infinite;
  z-index: 0;
}
.login-logo-wrap {
  display: inline-block;
  position: relative;
  margin-bottom: 16px;
}
.login-logo-wrap img {
  width: 68px; height: 68px;
  border-radius: 18px;
  object-fit: contain;
  display: block;
}

.login-title {
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--text);
  line-height: 1;
  animation: flicker 8s ease-in-out infinite;
}
.login-tagline {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  margin-top: 4px;
  opacity: 0.7;
}
.login-sub {
  font-size: 12px;
  color: var(--text-mid);
  margin-top: 8px;
  margin-bottom: 0;
  line-height: 1.5;
}
.login-fields {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 6px;
}
.login-footer {
  text-align: center;
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 20px;
  font-family: var(--font-mono);
  letter-spacing: 0.06em;
}

/* Status bar at very bottom of card */
.login-status-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid rgba(255,255,255,0.05);
}
[data-theme="light"] .login-status-bar {
  border-top-color: rgba(0,0,0,0.06);
}
.login-status-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: #22C55E;
  box-shadow: 0 0 6px #22C55E;
  animation: pulse 2s ease-in-out infinite;
}
.login-status-text {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
  flex: 1;
}
.login-version {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text-dim);
  letter-spacing: 0.08em;
  opacity: 0.5;
}

/* ── Home Dashboard ──────────────────────────────────────── */
.greeting-block {
  margin-bottom: 24px;
}
.greeting-time {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 6px;
}
.greeting-name {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
}
.greeting-date {
  font-size: 13px;
  color: var(--text-mid);
  margin-top: 2px;
}

.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 24px;
}
.stat-grid--3 { grid-template-columns: repeat(3, 1fr); }

.quick-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 24px;
}
.quick-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  padding: 14px 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: background var(--t-fast), border-color var(--t-fast);
  -webkit-tap-highlight-color: transparent;
}
.quick-btn:active { background: var(--surface-2); border-color: var(--border-2); }
.quick-btn__icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-mid);
}
.quick-btn--accent .quick-btn__icon {
  background: var(--accent-dim);
  color: var(--accent);
}
.quick-btn__label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-mid);
  text-align: center;
  line-height: 1.3;
}

/* ── Chart / Bars ────────────────────────────────────────── */
.bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 80px;
  padding: 0 4px;
}
.bar-chart__bar {
  flex: 1;
  border-radius: 4px 4px 0 0;
  background: var(--surface-3);
  transition: height var(--t-slow) ease;
  position: relative;
  min-height: 4px;
  cursor: pointer;
}
.bar-chart__bar--active { background: var(--accent); }
.bar-chart__bar--today  { background: rgba(232,23,61,0.4); }
.bar-chart__label {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  color: var(--text-dim);
  text-align: center;
  margin-top: 6px;
}

/* ── Lists ───────────────────────────────────────────────── */
.list { display: flex; flex-direction: column; gap: 8px; }

.list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: background var(--t-fast), border-color var(--t-fast);
  -webkit-tap-highlight-color: transparent;
}
.list-item:active { background: var(--surface-2); }
.list-item--left-accent { border-left-width: 3px; }

.list-item__icon {
  width: 38px;
  height: 38px;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--text-mid);
}
.list-item__body { flex: 1; min-width: 0; }
.list-item__title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.list-item__sub {
  font-size: 12px;
  color: var(--text-mid);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.list-item__right { flex-shrink: 0; text-align: right; }

/* ── Sub Tabs (horizontal scroll) ───────────────────────── */
.sub-tabs {
  display: flex;
  gap: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 4px;
  margin-bottom: 16px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.sub-tabs::-webkit-scrollbar { display: none; }

.sub-tab {
  flex: 1;
  min-width: fit-content;
  padding: 8px 12px;
  border-radius: var(--r-sm);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-mid);
  background: transparent;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--t-fast), color var(--t-fast);
  -webkit-tap-highlight-color: transparent;
}
.sub-tab--active {
  background: var(--accent);
  color: #fff;
}

/* ── Modals / Bottom Sheets ──────────────────────────────── */
.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 98;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  animation: fade-in var(--t-base) ease;
}
.sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 99;
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  padding: 8px 20px calc(env(safe-area-inset-bottom, 0px) + 24px);
  max-height: 92dvh;
  overflow-y: auto;
  animation: slide-up var(--t-slow) cubic-bezier(0.16,1,0.3,1);
}
.sheet__handle {
  width: 36px;
  height: 4px;
  border-radius: var(--r-pill);
  background: var(--border-2);
  margin: 10px auto 20px;
}
.sheet__title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 20px;
}

/* ── Toast ───────────────────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: calc(var(--nav-h) + 12px);
  left: 16px;
  right: 16px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  max-width: 480px;
  margin: 0 auto;
}
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--surface-3);
  border: 1px solid var(--border-2);
  border-radius: var(--r-md);
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  box-shadow: var(--shadow-md);
  animation: slide-up 0.25s cubic-bezier(0.16,1,0.3,1) both;
}
.toast--success { border-left: 3px solid var(--green);  }
.toast--error   { border-left: 3px solid var(--red);    }
.toast--info    { border-left: 3px solid var(--accent);  }

/* ── PWA Install Banner ──────────────────────────────────── */
.pwa-banner {
  position: fixed;
  bottom: calc(var(--nav-h) + 12px);
  left: 12px;
  right: 12px;
  z-index: 90;
  background: var(--surface);
  border: 1px solid rgba(232,23,61,0.25);
  border-radius: var(--r-lg);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5), 0 0 0 1px rgba(232,23,61,0.1);
  animation: slide-up 0.4s cubic-bezier(0.16,1,0.3,1) both;
  max-width: 480px;
  margin: 0 auto;
}
.pwa-banner__text { flex: 1; min-width: 0; }
.pwa-banner__title { font-size: 13px; font-weight: 700; color: var(--text); }
.pwa-banner__sub { font-size: 11px; color: var(--text-mid); margin-top: 1px; }

/* ── Form rows (Cash Entry) ──────────────────────────────── */
.field-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.field-row:last-child { border-bottom: none; }
.field-row__emoji { font-size: 16px; width: 24px; text-align: center; flex-shrink: 0; }
.field-row__label { flex: 1; font-size: 12px; font-weight: 500; color: var(--text-mid); min-width: 80px; }
.field-row__input {
  width: 82px;
  text-align: right;
  padding: 7px 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text);
  transition: border-color var(--t-fast);
}
.field-row__input:focus {
  border-color: rgba(232,23,61,0.4);
  outline: none;
}
.field-row__note-btn {
  width: 28px;
  height: 28px;
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  background: transparent;
  border: 1px solid var(--border);
  cursor: pointer;
  color: var(--text-dim);
  transition: all var(--t-fast);
}
.field-row__note-btn--active {
  background: var(--accent-dim);
  border-color: rgba(232,23,61,0.3);
  color: var(--accent);
}

/* ── Repair Status Colors ────────────────────────────────── */
.status--received  { color: #818CF8; }
.status--diagnosed { color: var(--amber); }
.status--repairing { color: var(--blue); }
.status--ready     { color: var(--green); }
.status--delivered { color: var(--text-mid); }
.status--unfixable { color: var(--red); }
.status--cancelled { color: var(--text-dim); }

/* ── Scrollbar ───────────────────────────────────────────── */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 2px; }

/* ── Utilities ───────────────────────────────────────────── */
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-6 { gap: 24px; }
.flex-1 { flex: 1; }
.min-w-0 { min-width: 0; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.w-full { width: 100%; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

/* ── Reduced Motion ──────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ── Responsive ──────────────────────────────────────────── */
@media (min-width: 480px) {
  .quick-grid { grid-template-columns: repeat(4, 1fr); }
  .stat-grid  { grid-template-columns: repeat(3, 1fr); }
}

/* ── Employee inner screens — brand overrides ─────────── */
/* Page title style used by Repairs, Inventory, Suppliers, Cash headings */
.emp-screen-title {
  font-family: 'Urbanist','Syne',sans-serif;
  font-size: 24px; font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text); line-height: 1.1;
  margin-bottom: 2px;
}
.emp-screen-sub {
  font-family: var(--font-mono);
  font-size: 10px; font-weight: 600;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--text-dim); margin-bottom: 16px;
}

/* Filter tab pills — replace generic pill buttons */
.filter-pill {
  display: inline-flex; align-items: center;
  padding: 6px 14px; border-radius: 999px;
  font-family: var(--font-mono); font-size: 10px;
  font-weight: 700; letter-spacing: 0.10em;
  text-transform: uppercase; cursor: pointer;
  transition: all 0.15s; border: 1px solid var(--border);
  background: transparent; color: var(--text-dim);
  white-space: nowrap;
}
.filter-pill.active {
  background: rgba(232,23,61,0.12);
  border-color: rgba(232,23,61,0.4);
  color: var(--accent);
}
.filter-pill:hover:not(.active) {
  border-color: var(--border-2);
  color: var(--text-mid);
}
