/* ============================================================
   TaxSquid — KODA Web Portal
   app.css  |  Design tokens + shell layout + shared components
   ============================================================ */

/* ---- Fonts ------------------------------------------------ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* ---- Design tokens ---------------------------------------- */
:root {
  /* Brand blues */
  --blue:        #2E6BFF;
  --blue-2:      #1F5BFF;
  --blue-light:  #6E9BFF;
  --blue-bright: #4D9FFF;

  /* Backgrounds */
  --bg:   #070A14;
  --bg-2: #0A0E1A;
  --bg-3: #0E1526;

  /* Panels (translucent layering) */
  --panel:   rgba(255,255,255,.035);
  --panel-2: rgba(255,255,255,.06);
  --panel-3: rgba(255,255,255,.09);

  /* Borders */
  --border:      rgba(255,255,255,.09);
  --border-blue: rgba(110,155,255,.30);

  /* Text */
  --text:    #EAF0FF;
  --muted:   #9AA7C7;
  --muted-2: #69769A;

  /* Gradient + glow */
  --grad: linear-gradient(135deg,#4D9FFF,#2E6BFF 55%,#6E9BFF);
  --glow: 0 0 0 1px rgba(110,155,255,.18), 0 18px 50px -12px rgba(46,107,255,.45);

  /* Status colors */
  --green:     #34D399;
  --green-bg:  rgba(52,211,153,.13);
  --amber:     #FBBF24;
  --amber-bg:  rgba(251,191,36,.14);
  --red:       #F87171;
  --red-bg:    rgba(248,113,113,.14);

  /* Sidebar */
  --sidebar-w: 228px;
  --sidebar-bg: rgba(9,12,22,.82);

  /* Misc */
  --track:    rgba(255,255,255,.08);
  --radius:   12px;
  --radius-lg: 18px;
}

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

html, body {
  height: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, textarea { font-family: inherit; }

/* ---- Ambient background orbs ----------------------------- */
.orbs {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: .28;
}
.orb-a {
  width: 520px; height: 520px;
  background: #2E6BFF;
  top: -160px; left: -100px;
}
.orb-b {
  width: 400px; height: 400px;
  background: #6E5BFF;
  bottom: -80px; right: 60px;
}
.orb-c {
  width: 280px; height: 280px;
  background: #22D3EE;
  top: 40%; left: 50%;
  opacity: .12;
}

/* ---- App shell ------------------------------------------- */
.app {
  display: flex;
  height: 100vh;
  position: relative;
  z-index: 1;
}

/* ---- Sidebar --------------------------------------------- */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--sidebar-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 20px 12px;
  gap: 4px;
  position: relative;
  z-index: 10;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px 20px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}
.sidebar-logo img {
  width: 32px;
  height: 32px;
  object-fit: contain;
}
.sidebar-logo-text {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -.01em;
}
.sidebar-logo-text span {
  background: var(--grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  text-align: left;
  transition: background .15s, color .15s;
  cursor: pointer;
  text-decoration: none;
}
.nav-item:hover {
  background: var(--panel-2);
  color: var(--text);
}
.nav-item.active {
  background: var(--panel-2);
  color: var(--text);
  font-weight: 600;
}
.nav-item svg {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  opacity: .6;
  transition: opacity .15s;
}
.nav-item.active svg,
.nav-item:hover svg {
  opacity: 1;
  color: var(--blue-bright);
}

.nav-badge {
  margin-left: auto;
  background: var(--blue);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 99px;
  line-height: 1.4;
}

.sidebar-spacer { flex: 1; }

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-top: 1px solid var(--border);
  margin-top: 8px;
}
.sidebar-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--panel-3);
  border: 1px solid var(--border-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--blue-light);
  flex-shrink: 0;
}
.sidebar-user-info {
  min-width: 0;
}
.sidebar-user-name {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-user-role {
  font-size: 11px;
  color: var(--muted-2);
}

/* ---- Main content area ----------------------------------- */
.main {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  position: relative;
}

.page {
  min-height: 100%;
  padding: 32px 36px;
  max-width: 1100px;
}

.page-header {
  margin-bottom: 28px;
}
.page-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -.02em;
  margin-bottom: 4px;
}
.page-subtitle {
  font-size: 13.5px;
  color: var(--muted);
}

/* ---- Cards ----------------------------------------------- */
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.card-sm {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
}

/* ---- Status pills ---------------------------------------- */
.pill {
  display: inline-flex;
  align-items: center;
  font-size: 11.5px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 99px;
  white-space: nowrap;
}
.pill-red    { background: var(--red-bg);   color: var(--red);   border: 1px solid rgba(248,113,113,.25); }
.pill-amber  { background: var(--amber-bg); color: var(--amber); border: 1px solid rgba(251,191,36,.25); }
.pill-green  { background: var(--green-bg); color: var(--green); border: 1px solid rgba(52,211,153,.25); }
.pill-blue   { background: rgba(46,107,255,.14); color: var(--blue-light); border: 1px solid rgba(110,155,255,.25); }
.pill-muted  { background: var(--panel-2);  color: var(--muted); border: 1px solid var(--border); }

/* ---- Buttons --------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 18px;
  border-radius: 10px;
  border: none;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity .15s, background .15s;
  white-space: nowrap;
}
.btn:disabled { opacity: .35; cursor: not-allowed; }

.btn-primary {
  background: var(--grad);
  color: #fff;
  box-shadow: var(--glow);
}
.btn-primary:not(:disabled):hover { opacity: .88; }

.btn-secondary {
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:not(:disabled):hover { background: var(--panel-3); }

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
}
.btn-ghost:hover { color: var(--text); background: var(--panel); }

/* ---- Stat counters (used on client + dashboard) ---------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}
.stat-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  text-align: center;
}
.stat-card .n {
  font-size: 26px;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 4px;
}
.stat-card .l {
  font-size: 10.5px;
  color: var(--muted-2);
  text-transform: uppercase;
  letter-spacing: .06em;
}
.stat-card.red .n   { color: var(--red); }
.stat-card.amber .n { color: var(--amber); }
.stat-card.green .n { color: var(--green); }

/* ---- Divider --------------------------------------------- */
.divider {
  height: 1px;
  background: var(--border);
  margin: 20px 0;
}

/* ---- Empty state ----------------------------------------- */
.empty {
  text-align: center;
  padding: 48px 24px;
  color: var(--muted);
}
.empty svg {
  width: 40px;
  height: 40px;
  opacity: .3;
  margin-bottom: 12px;
}
.empty-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}
.empty-body {
  font-size: 13px;
  color: var(--muted);
}

/* ---- Utility --------------------------------------------- */
.text-muted  { color: var(--muted); }
.text-muted2 { color: var(--muted-2); }
.text-red    { color: var(--red); }
.text-amber  { color: var(--amber); }
.text-green  { color: var(--green); }
.text-blue   { color: var(--blue-light); }
.fw-600      { font-weight: 600; }
.fw-700      { font-weight: 700; }
.fs-12       { font-size: 12px; }
.fs-13       { font-size: 13px; }

/* ---- Scrollbar (webkit) ---------------------------------- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--panel-3); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.15); }
