/* ============================================================
   Веселин Костадинов — design system
   Graphite + champagne gold. Oswald / Golos Text / JetBrains Mono.
   Tokens and components extracted from the Claude Design board.
   ============================================================ */

:root {
  /* Render native controls (date/time pickers, selects, scrollbars) in dark
     mode — without this the date picker's calendar icon is black-on-black. */
  color-scheme: dark;

  /* surfaces */
  --bg: #0a0b0d;
  --bg-1: #0b0c0e;
  --bg-2: #0e0f12;
  --bg-3: #101216;
  --surface: #16181d;
  --surface-2: #1d2126;
  --surface-3: #23262c;

  /* lines */
  --line: rgba(255, 255, 255, .07);
  --line-2: rgba(255, 255, 255, .12);
  --line-3: rgba(255, 255, 255, .18);

  /* text */
  --text: #ecebe6;
  --text-soft: #d8d6cf;
  --text-soft-2: #cfcdc6;
  --muted: #a6a59d;
  --faint: #6f6e68;

  /* brand */
  --gold: #c9a24b;
  --gold-2: #e0c378;
  --gold-soft: rgba(201, 162, 75, .12);
  --green: #4ea076;
  --orange: #c0603f;
  --orange-2: #d98763;

  /* radii */
  --r-sm: 10px;
  --r: 14px;
  --r-md: 16px;
  --r-lg: 18px;
  --r-xl: 20px;

  --f-display: 'Oswald', system-ui, sans-serif;
  --f-body: 'Golos Text', system-ui, sans-serif;
  --f-mono: 'JetBrains Mono', ui-monospace, monospace;

  --maxw: 1240px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--f-body);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--gold); color: var(--bg); }

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font-family: var(--f-body); cursor: pointer; }

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

/* ---------- typography ---------- */
.display {
  font-family: var(--f-display);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: -.5px;
  line-height: .95;
  margin: 0;
}
.display-xl { font-size: clamp(40px, 7vw, 96px); letter-spacing: -2px; }
.display-lg { font-size: clamp(32px, 5vw, 52px); letter-spacing: -1px; }
.display-md { font-size: clamp(24px, 4vw, 34px); }

.eyebrow {
  font-family: var(--f-mono);
  font-size: 12px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--gold);
}
.label {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--faint);
}
.mono { font-family: var(--f-mono); }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.gold { color: var(--gold); }
.gold-2 { color: var(--gold-2); }
.text-soft { color: var(--text-soft); }

.gold-rule { width: 64px; height: 3px; background: var(--gold); border: 0; }

.icon {
  font-family: 'Material Symbols Rounded';
  font-weight: normal;
  font-style: normal;
  line-height: 1;
  letter-spacing: normal;
  -webkit-font-feature-settings: 'liga';
  user-select: none;
}
.icon.fill { font-variation-settings: 'FILL' 1; }

/* ---------- layout ---------- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.section { padding: 88px 0; border-top: 1px solid var(--line); }
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
  margin-bottom: 40px;
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 48px;
  padding: 0 24px;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  font-weight: 700;
  font-size: 15px;
  white-space: nowrap;
  transition: transform .12s ease, background .2s ease, border-color .2s ease;
}
.btn:active { transform: translateY(1px); }
.btn-gold { background: var(--gold); color: var(--bg); }
.btn-gold:hover { background: var(--gold-2); }
.btn-ghost {
  background: rgba(255, 255, 255, .05);
  border-color: var(--line-3);
  color: var(--text);
}
.btn-ghost:hover { border-color: var(--line-3); background: rgba(255,255,255,.09); }
.btn-block { width: 100%; }
.btn-sm { height: 40px; font-size: 13px; padding: 0 16px; }

/* ---------- cards / pills ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 18px;
}
.card-2 { background: var(--bg-2); }
.card-flush { padding: 0; overflow: hidden; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--f-mono);
  font-size: 11px;
  color: var(--muted);
  border: 1px solid var(--line-2);
  border-radius: 999px;
  padding: 6px 12px;
}
.pill-gold { color: var(--gold); border-color: rgba(201, 162, 75, .4); }
.pill-solid { background: var(--gold); color: var(--bg); border: 0; font-weight: 600; }

/* progress bars */
.bar { height: 5px; border-radius: 3px; background: rgba(255,255,255,.08); overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: 3px; background: var(--gold); }

/* ---------- forms ---------- */
.field { display: block; margin-bottom: 16px; }
.field > span.lbl {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 8px;
}
.input, .select, .textarea {
  width: 100%;
  background: var(--bg-2);
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  padding: 0 14px;
  height: 46px;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.textarea { height: auto; padding: 12px 14px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201, 162, 75, .22);
}
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ---------- public nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 40;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(10, 11, 13, .82);
  backdrop-filter: blur(10px);
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 34px; height: 34px;
  border: 1.5px solid var(--gold);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--f-display); font-weight: 600; color: var(--gold);
  font-size: 14px; letter-spacing: 1px;
}
.brand-name {
  font-family: var(--f-display); font-weight: 600;
  text-transform: uppercase; letter-spacing: 2px; font-size: 14px;
}
.nav-links { display: flex; gap: 28px; font-size: 14px; color: var(--muted); }
.nav-links a:hover, .nav-links a.active { color: var(--text); }
.lang {
  display: flex; border: 1px solid var(--line-2); border-radius: 8px;
  overflow: hidden; font-family: var(--f-mono); font-size: 12px;
}
.lang a { padding: 6px 11px; color: var(--muted); }
.lang a.active { background: var(--gold); color: var(--bg); font-weight: 600; }
.nav-cta { display: flex; align-items: center; gap: 16px; }
.nav-burger { display: none; }

/* ---------- footer ---------- */
.footer { padding: 56px 0 36px; background: var(--bg); border-top: 1px solid var(--line-2); }
.footer-cols { display: flex; gap: 56px; flex-wrap: wrap; }
.footer-col h4 {
  font-family: var(--f-mono); font-size: 11px; letter-spacing: 1px;
  color: var(--faint); margin: 0 0 14px; font-weight: 400;
}
.footer-col a { display: block; color: var(--muted); font-size: 14px; padding: 5px 0; }
.footer-bottom {
  display: flex; justify-content: space-between; align-items: center;
  border-top: 1px solid var(--line); padding-top: 22px; margin-top: 36px;
  font-size: 12px; color: var(--faint); flex-wrap: wrap; gap: 12px;
}

/* ---------- messages / alerts ---------- */
.alert {
  border-radius: var(--r-md); padding: 13px 16px; font-size: 14px;
  display: flex; align-items: center; gap: 10px; margin-bottom: 12px;
}
.alert-ok { background: rgba(78,160,118,.12); border: 1px solid rgba(78,160,118,.4); color: #bfe6d2; }
.alert-warn { background: linear-gradient(100deg, rgba(192,96,63,.16), rgba(192,96,63,.05)); border: 1px solid rgba(192,96,63,.35); }
.alert-err { background: rgba(192,96,63,.14); border: 1px solid rgba(192,96,63,.45); color: #f0c9bb; }
.alert-info { background: var(--gold-soft); border: 1px solid rgba(201,162,75,.25); color: var(--text-soft-2); }

/* ============================================================
   CLIENT APP SHELL (responsive: sidebar desktop / tab bar mobile)
   ============================================================ */
.app { display: flex; min-height: 100vh; background: var(--bg-2); }

.app-sidebar {
  width: 248px; flex: none; position: sticky; top: 0; height: 100vh;
  background: var(--bg-1); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 22px 16px;
}
.app-sidebar .brand { padding: 0 8px 22px; }
.side-nav { display: flex; flex-direction: column; gap: 4px; }
.side-link {
  display: flex; align-items: center; gap: 12px; padding: 11px 12px;
  border-radius: var(--r-sm); color: var(--muted); font-weight: 500; font-size: 14px;
}
.side-link .icon { font-size: 22px; }
.side-link:hover { background: var(--surface); color: var(--text); }
.side-link.active { background: var(--gold-soft); color: var(--gold); }
.side-link.locked { opacity: .5; }
.side-foot { margin-top: auto; }

.app-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.app-topbar {
  height: 64px; flex: none; display: flex; align-items: center;
  justify-content: space-between; padding: 0 28px;
  border-bottom: 1px solid var(--line); background: var(--bg-1);
  position: sticky; top: 0; z-index: 20;
}
.app-content { padding: 28px; max-width: 1080px; width: 100%; margin: 0 auto; flex: 1; }
.page-head { margin-bottom: 22px; }
.page-title { font-family: var(--f-display); font-weight: 600; text-transform: uppercase; font-size: 28px; margin: 0; }

.avatar {
  width: 38px; height: 38px; border-radius: 50%; flex: none;
  background: var(--surface-2); border: 1px solid rgba(201,162,75,.4);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--f-display); font-weight: 600; color: var(--gold); font-size: 14px;
}
.icon-btn {
  width: 38px; height: 38px; border-radius: 50%; background: var(--surface);
  border: 0; display: flex; align-items: center; justify-content: center;
  position: relative; color: var(--muted);
}
.icon-btn .dot {
  position: absolute; top: 9px; right: 10px; width: 7px; height: 7px;
  border-radius: 50%; background: var(--gold); border: 2px solid var(--bg-1);
}

/* bottom tab bar (mobile only) */
.tabbar {
  display: none;
  position: sticky; bottom: 0; z-index: 30; height: 64px;
  background: rgba(12, 13, 16, .94); border-top: 1px solid var(--line-2);
  align-items: center; justify-content: space-around;
  padding: 0 6px env(safe-area-inset-bottom, 6px);
  backdrop-filter: blur(8px);
}
.tab {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  color: var(--faint); font-size: 10px; font-weight: 500; flex: 1;
}
.tab .icon { font-size: 24px; }
.tab.active { color: var(--gold); font-weight: 600; }

/* metric tiles */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 16px; }
.tile .k { font-family: var(--f-display); font-weight: 600; font-size: 30px; }
.tile .delta-down { color: var(--green); }

/* generic grids */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }

/* section locked card */
.locked-card { background: var(--bg-3); border: 1px dashed var(--line-2); opacity: .65; }

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .nav-links { display: none; }
  .nav-burger { display: inline-flex; }
  .grid-3, .grid-2, .form-grid-2 { grid-template-columns: 1fr; }
  .app-sidebar { display: none; }
  .tabbar { display: flex; }
  .app-content { padding: 18px 16px 24px; }
  .app-topbar { padding: 0 16px; }
  .section { padding: 56px 0; }
}
