/* PSK Business ERP — design tokens, base and utilities */
:root {
  --primary: #173B68;
  --primary-700: #122F54;
  --primary-900: #0D223E;
  --secondary: #2563EB;
  --secondary-600: #1D4ED8;
  --accent: #F59E0B;
  --success: #16A34A;
  --danger: #DC2626;
  --violet: #7C3AED;
  --teal: #0D9488;
  --bg: #F5F7FB;
  --surface: #FFFFFF;
  --surface-2: #F8FAFD;
  --text: #172033;
  --text-2: #475069;
  --muted: #718096;
  --line: #E4E9F2;
  --line-2: #EEF2F8;
  --blue-50: #EFF4FF;
  --green-50: #ECFDF3;
  --amber-50: #FFF7E6;
  --red-50: #FEF1F1;
  --violet-50: #F4EFFE;
  --teal-50: #E8F7F5;
  --navy-50: #EBF0F7;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --shadow-xs: 0 1px 2px rgba(16, 32, 64, .05);
  --shadow-sm: 0 1px 2px rgba(16, 32, 64, .04), 0 2px 8px rgba(16, 32, 64, .04);
  --shadow-md: 0 4px 16px rgba(16, 32, 64, .08), 0 1px 3px rgba(16, 32, 64, .05);
  --shadow-lg: 0 18px 48px rgba(13, 34, 62, .18), 0 4px 12px rgba(13, 34, 62, .08);
  --sidebar-w: 248px;
  --sidebar-w-collapsed: 72px;
  --topbar-h: 64px;
  --font: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --ease: cubic-bezier(.2, .7, .3, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: 'cv11', 'ss01';
  overflow: hidden;
}
h1, h2, h3, h4, p { margin: 0; }
h1 { font-size: 22px; font-weight: 700; letter-spacing: -.02em; line-height: 1.25; }
h2 { font-size: 18px; font-weight: 650; letter-spacing: -.01em; }
h3 { font-size: 15px; font-weight: 650; letter-spacing: -.005em; }
h4 { font-size: 14px; font-weight: 600; }
a { color: var(--secondary); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img { max-width: 100%; }
[hidden] { display: none !important; }
::selection { background: rgba(37, 99, 235, .18); }
:focus-visible { outline: 2px solid var(--secondary); outline-offset: 2px; border-radius: 6px; }
kbd { font: 600 11px var(--font); padding: 1px 6px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; color: var(--muted); background: var(--surface); }
.icon { flex: none; vertical-align: middle; }

/* scrollbars */
* { scrollbar-width: thin; scrollbar-color: #CBD3E1 transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #CBD3E1; border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: #AEB8CA; background-clip: padding-box; border: 2px solid transparent; }

/* utilities */
.muted { color: var(--muted); }
.strong { font-weight: 600; }
.mono, .num { font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.ta-right { text-align: right; }
.ta-center { text-align: center; }
.text-sm { font-size: 12.5px; }
.text-xs { font-size: 11.5px; }
.text-lg { font-size: 16px; }
.text-green { color: var(--success); }
.text-red { color: var(--danger); }
.text-amber { color: #B45309; }
.text-blue { color: var(--secondary); }
.flex { display: flex; align-items: center; gap: 10px; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.flex-wrap { flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.stack-sm { display: flex; flex-direction: column; gap: 8px; }
.grow { flex: 1; min-width: 0; }
.grid { display: grid; gap: 16px; }
.grid-2 { display: grid; gap: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { display: grid; gap: 16px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { display: grid; gap: 16px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-2-1 { display: grid; gap: 16px; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.grid-1-2 { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 4px; } .mt-2 { margin-top: 8px; } .mt-3 { margin-top: 16px; } .mt-4 { margin-top: 24px; }
.mb-2 { margin-bottom: 8px; } .mb-3 { margin-bottom: 16px; } .mb-4 { margin-bottom: 24px; }
.bg-blue { background: var(--secondary); } .bg-green { background: var(--success); } .bg-amber { background: var(--accent); }
.bg-red { background: var(--danger); } .bg-navy { background: var(--primary); } .bg-violet { background: var(--violet); } .bg-teal { background: var(--teal); } .bg-gray { background: #94A3B8; }
.link { background: none; border: 0; padding: 0; color: var(--secondary); font-weight: 600; font-size: 12.5px; }
.link:hover { text-decoration: underline; }
.cell-main { display: flex; flex-direction: column; line-height: 1.35; min-width: 0; }
.cell-main b { font-weight: 600; }
.cell-main small { color: var(--muted); font-size: 12px; }
.cell-user { display: flex; align-items: center; gap: 10px; min-width: 0; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #94A3B8; flex: none; }
.dot.green { background: var(--success); } .dot.blue { background: var(--secondary); } .dot.amber { background: var(--accent); }
.dot.red { background: var(--danger); } .dot.violet { background: var(--violet); } .dot.teal { background: var(--teal); }

/* brand mark */
.brand-mark {
  width: 38px; height: 38px; border-radius: 10px; flex: none; display: grid; place-items: center; overflow: hidden;
  background: linear-gradient(145deg, #2563EB, #173B68); color: #fff; font-weight: 700; font-size: 12.5px; letter-spacing: .04em;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14);
}
.brand-mark img { width: 100%; height: 100%; object-fit: cover; background: #fff; }
.brand-mark.lg { width: 52px; height: 52px; border-radius: 14px; font-size: 16px; }

/* boot splash */
.boot { position: fixed; inset: 0; z-index: 400; display: grid; place-items: center; background: var(--bg); transition: opacity .3s; }
.boot.out { opacity: 0; pointer-events: none; }
.boot-card { display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; max-width: 420px; padding: 24px; }
.boot-title { font-size: 18px; font-weight: 700; color: var(--primary); }
.boot-text { color: var(--muted); font-size: 13px; }
.boot-bar { width: 180px; height: 4px; border-radius: 4px; background: var(--line); overflow: hidden; }
.boot-bar i { display: block; height: 100%; width: 40%; border-radius: 4px; background: var(--secondary); animation: boot 1.1s var(--ease) infinite; }
@keyframes boot { from { transform: translateX(-110%); } to { transform: translateX(280%); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
