/* INVOBILLING — base.css : design tokens, typography, resets, theme */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color .2s ease, color .2s ease;
}
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: inherit; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

:root {
  /* Light theme (default) */
  --bg: #F7F8FB;
  --bg-elevated: #FFFFFF;
  --bg-soft: #F1F3F9;
  --bg-hover: #EEF1F8;
  --surface: #FFFFFF;
  --surface-2: #FAFBFD;
  --border: #E5E8EE;
  --border-strong: #D5DAE3;
  --text: #0F172A;
  --text-muted: #64748B;
  --text-subtle: #94A3B8;
  --accent: #6366F1;
  --accent-hover: #5457E5;
  --accent-soft: #EEF0FE;
  --accent-contrast: #FFFFFF;
  --primary: #0F172A;     /* deep navy / dark charcoal */
  --primary-hover: #1E293B;
  --success: #10B981;
  --success-soft: #E7F8F1;
  --warning: #F59E0B;
  --warning-soft: #FEF3E2;
  --danger: #EF4444;
  --danger-soft: #FEECEC;
  --info: #3B82F6;
  --info-soft: #E8F1FE;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .04), 0 1px 3px rgba(15, 23, 42, .06);
  --shadow: 0 2px 4px rgba(15, 23, 42, .04), 0 4px 12px rgba(15, 23, 42, .06);
  --shadow-lg: 0 10px 30px rgba(15, 23, 42, .08), 0 4px 12px rgba(15, 23, 42, .04);
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;
  --sidebar-w: 256px;
  --topbar-h: 60px;
  --font-mono: 'JetBrains Mono', 'SF Mono', Menlo, monospace;
  --font-display: 'Manrope', 'Inter', sans-serif;
}

[data-theme="dark"] {
  --bg: #0B1120;
  --bg-elevated: #131A2A;
  --bg-soft: #1A2233;
  --bg-hover: #1F283B;
  --surface: #131A2A;
  --surface-2: #0F1626;
  --border: #243049;
  --border-strong: #2F3D5B;
  --text: #E8ECF5;
  --text-muted: #94A3B8;
  --text-subtle: #64748B;
  --accent: #818CF8;
  --accent-hover: #A5B0FC;
  --accent-soft: #1E2542;
  --accent-contrast: #0B1120;
  --primary: #E8ECF5;
  --primary-hover: #FFFFFF;
  --success: #34D399;
  --success-soft: #0F2A22;
  --warning: #FBBF24;
  --warning-soft: #2D2410;
  --danger: #F87171;
  --danger-soft: #2A1414;
  --info: #60A5FA;
  --info-soft: #15233A;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.3);
  --shadow: 0 4px 12px rgba(0,0,0,.35);
  --shadow-lg: 0 12px 32px rgba(0,0,0,.45);
}

h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-family: var(--font-display);
  color: var(--text);
  font-weight: 700;
  line-height: 1.25;
}
h1 { font-size: 1.5rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.1rem; }
h4 { font-size: 1rem; }
p { margin: 0 0 .5rem; }
small { color: var(--text-muted); }
code, .mono { font-family: var(--font-mono); }

/* Scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 8px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--text-subtle); }

/* Focus */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--radius-sm); }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: none; }

/* Spinner */
.spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .8s linear infinite;
  margin: 0 auto 12px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 80px 20px; color: var(--text-muted); text-align: center;
}

/* Empty state */
.empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 60px 20px; text-align: center; color: var(--text-muted);
}
.empty-state svg { margin-bottom: 16px; color: var(--text-subtle); }
.empty-state h3 { margin-bottom: 8px; color: var(--text); }
.empty-state p { margin-bottom: 16px; max-width: 360px; }

/* Utility */
.hidden { display: none !important; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-center { text-align: center; }
.text-right { text-align: right; }
.flex { display: flex; }
.flex-1 { flex: 1; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; } .mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; } .mb-3 { margin-bottom: 12px; } .mb-4 { margin-bottom: 16px; }
.w-full { width: 100%; }
