/* ============================================================
   Scout Camp Poznań — Design System / Tokens
   Warm operational SaaS. Forest green + sand + graphite.
   ============================================================ */

:root {
  /* --- Brand-tunable (Tweaks) --- */
  --brand: #2f6a4c;          /* forest green primary */
  --brand-600: #357a57;
  --brand-700: #265a3f;
  --brand-50: #e9f1eb;
  --brand-100: #d6e7db;

  --font-ui: "Hanken Grotesk", system-ui, sans-serif;
  --font-mono: "Spline Sans Mono", ui-monospace, monospace;

  /* --- Warm neutrals --- */
  --bg: #f4f2ec;             /* app background, sand-tinted */
  --surface: #fffdf9;        /* cards, warm white */
  --surface-2: #f6f4ee;
  --surface-3: #efece3;
  --border: #e7e3d8;
  --border-strong: #d8d3c5;
  --text: #2a2e2b;           /* warm graphite */
  --text-2: #5d625b;
  --text-3: #8b8f86;
  --text-on-brand: #fbfdfb;

  /* --- Secondary / sand --- */
  --sand: #c8b793;
  --sand-bg: #ece4d3;
  --sand-line: #ddd2ba;

  /* --- Functional / status --- */
  --amber: #cf8729;          /* firecamp / warning */
  --amber-bg: #fbefda;
  --amber-line: #f0d8ad;
  --amber-700: #a96914;

  --red: #c0473a;            /* error / urgent */
  --red-bg: #f8e4e0;
  --red-line: #eecbc4;

  --blue: #3a6c9e;           /* technical info */
  --blue-bg: #e5eef6;
  --blue-line: #c9dbec;

  --purple: #6f5a9c;
  --purple-bg: #ece6f4;
  --purple-line: #d8cee9;

  --teal: #2c7d72;
  --teal-bg: #def0ed;
  --teal-line: #bfe1db;

  --slate: #5d6470;
  --slate-bg: #eceef1;
  --slate-line: #d8dce2;

  /* --- Radius --- */
  --r-xs: 6px;
  --r-sm: 9px;
  --r: 12px;
  --r-lg: 16px;
  --r-xl: 22px;
  --r-pill: 999px;

  /* --- Shadows (soft, warm) --- */
  --sh-xs: 0 1px 2px rgba(54, 48, 36, .06);
  --sh-sm: 0 1px 3px rgba(54, 48, 36, .07), 0 1px 2px rgba(54, 48, 36, .04);
  --sh: 0 4px 14px rgba(54, 48, 36, .07), 0 1px 3px rgba(54, 48, 36, .05);
  --sh-lg: 0 12px 34px rgba(40, 36, 26, .12), 0 3px 10px rgba(40, 36, 26, .06);
  --sh-pop: 0 18px 50px rgba(30, 28, 20, .22);

  /* --- Spacing scale --- */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px;
  --s5: 20px; --s6: 24px; --s7: 32px; --s8: 40px; --s9: 56px;

  --sidebar-w: 248px;
  --topbar-h: 60px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
}

body {
  font-family: var(--font-ui);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

#root { height: 100%; }

::selection { background: var(--brand-100); }

h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -0.01em; color: var(--text); }
p { margin: 0; }
button { font-family: inherit; cursor: pointer; }
a { color: inherit; text-decoration: none; }

.mono { font-family: var(--font-mono); font-feature-settings: "tnum"; }
.tnum { font-variant-numeric: tabular-nums; }

/* ---------- scrollbars ---------- */
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-thumb { background: #d6d1c4; border-radius: 99px; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: #c2bcaf; }
::-webkit-scrollbar-track { background: transparent; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 38px; padding: 0 15px;
  border-radius: var(--r-sm);
  font-size: 13.5px; font-weight: 600; letter-spacing: -0.005em;
  border: 1px solid transparent; white-space: nowrap;
  transition: background .14s, border-color .14s, box-shadow .14s, transform .04s;
  user-select: none;
}
.btn:active { transform: translateY(.5px); }
.btn .ic { width: 17px; height: 17px; }
.btn-sm { height: 32px; padding: 0 11px; font-size: 12.5px; border-radius: var(--r-xs); }
.btn-lg { height: 44px; padding: 0 20px; font-size: 15px; }
.btn-block { width: 100%; }

.btn-primary { background: var(--brand); color: var(--text-on-brand); box-shadow: var(--sh-xs); }
.btn-primary:hover { background: var(--brand-600); }
.btn-primary:active { background: var(--brand-700); }

.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); box-shadow: var(--sh-xs); }
.btn-secondary:hover { background: var(--surface-2); border-color: var(--sand-line); }

.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-3); color: var(--text); }

.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { filter: brightness(.95); }
.btn-danger-soft { background: var(--red-bg); color: var(--red); border-color: var(--red-line); }
.btn-danger-soft:hover { background: #f4d8d2; }

.btn-icon { width: 38px; padding: 0; }
.btn-icon.btn-sm { width: 32px; }

/* ============================================================
   BADGES / STATUS PILLS
   ============================================================ */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  height: 23px; padding: 0 9px;
  border-radius: var(--r-pill);
  font-size: 12px; font-weight: 600; letter-spacing: -0.005em;
  border: 1px solid transparent; white-space: nowrap; line-height: 1;
}
.badge .dot { width: 7px; height: 7px; border-radius: 99px; background: currentColor; flex: none; }
.badge .ic { width: 13px; height: 13px; }
.badge-lg { height: 28px; padding: 0 12px; font-size: 13px; }

.t-green  { color: var(--brand-700); background: var(--brand-50); border-color: var(--brand-100); }
.t-amber  { color: var(--amber-700); background: var(--amber-bg); border-color: var(--amber-line); }
.t-red    { color: var(--red); background: var(--red-bg); border-color: var(--red-line); }
.t-blue   { color: var(--blue); background: var(--blue-bg); border-color: var(--blue-line); }
.t-purple { color: var(--purple); background: var(--purple-bg); border-color: var(--purple-line); }
.t-teal   { color: var(--teal); background: var(--teal-bg); border-color: var(--teal-line); }
.t-slate  { color: var(--slate); background: var(--slate-bg); border-color: var(--slate-line); }
.t-sand   { color: #8a6f3c; background: var(--sand-bg); border-color: var(--sand-line); }

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-sm);
}
.card-pad { padding: var(--s5); }
.card-head {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s3);
  padding: 15px var(--s5); border-bottom: 1px solid var(--border);
}
.card-title { font-size: 14.5px; font-weight: 700; display: flex; align-items: center; gap: 9px; }
.card-title .ic { width: 18px; height: 18px; color: var(--text-2); }

/* ============================================================
   FORM CONTROLS
   ============================================================ */
.field { display: flex; flex-direction: column; gap: 6px; }
.label { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.hint { font-size: 12px; color: var(--text-3); }

.input, .select, .textarea {
  width: 100%; height: 40px; padding: 0 12px;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border-strong); border-radius: var(--r-sm);
  font-family: inherit; font-size: 14px; outline: none;
  transition: border-color .14s, box-shadow .14s;
}
.textarea { height: auto; min-height: 84px; padding: 10px 12px; line-height: 1.5; resize: vertical; }
.input::placeholder, .textarea::placeholder { color: var(--text-3); }
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-50);
}
.input.err, .textarea.err { border-color: var(--red); }
.input.err:focus { box-shadow: 0 0 0 3px var(--red-bg); }
.select {
  appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235d625b' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center; padding-right: 34px;
}
.input-icon { position: relative; }
.input-icon .ic { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--text-3); pointer-events: none; }
.input-icon .input { padding-left: 34px; }

/* checkbox */
.check { width: 20px; height: 20px; border: 1.8px solid var(--border-strong); border-radius: 6px;
  display: inline-flex; align-items: center; justify-content: center; background: var(--surface);
  transition: background .12s, border-color .12s; flex: none; cursor: pointer; }
.check .ic { width: 14px; height: 14px; color: #fff; opacity: 0; transition: opacity .12s; }
.check.on { background: var(--brand); border-color: var(--brand); }
.check.on .ic { opacity: 1; }

/* toggle */
.toggle { width: 38px; height: 22px; border-radius: 99px; background: var(--border-strong); position: relative; transition: background .16s; flex: none; cursor: pointer; }
.toggle::after { content:""; position:absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 99px; background: #fff; box-shadow: var(--sh-xs); transition: left .16s; }
.toggle.on { background: var(--brand); }
.toggle.on::after { left: 18px; }

/* segmented control */
.seg { display: inline-flex; background: var(--surface-3); border-radius: var(--r-sm); padding: 3px; gap: 2px; }
.seg button { border: none; background: transparent; height: 30px; padding: 0 13px; border-radius: var(--r-xs); font-size: 13px; font-weight: 600; color: var(--text-2); }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--sh-xs); }

/* ============================================================
   TABS
   ============================================================ */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { border: none; background: transparent; padding: 11px 14px; font-size: 13.5px; font-weight: 600; color: var(--text-2); position: relative; white-space: nowrap; display:flex; align-items:center; gap:7px; }
.tab .ic { width: 16px; height: 16px; }
.tab:hover { color: var(--text); }
.tab.on { color: var(--brand-700); }
.tab.on::after { content:""; position:absolute; left: 8px; right: 8px; bottom: -1px; height: 2.5px; background: var(--brand); border-radius: 3px 3px 0 0; }
.tab .tabcount { font-size: 11px; background: var(--surface-3); color: var(--text-2); border-radius: 99px; padding: 1px 6px; font-weight: 700; }

/* ============================================================
   TABLE
   ============================================================ */
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th { text-align: left; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text-3); padding: 10px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.tbl td { padding: 13px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: none; }
.tbl tbody tr { transition: background .1s; cursor: pointer; }
.tbl tbody tr:hover { background: var(--surface-2); }

/* ============================================================
   MISC
   ============================================================ */
.divider { height: 1px; background: var(--border); border: none; margin: 0; }
.kv { display: flex; flex-direction: column; gap: 3px; }
.kv .k { font-size: 11.5px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: .03em; }
.kv .v { font-size: 14px; font-weight: 600; color: var(--text); }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.avatar { width: 30px; height: 30px; border-radius: 99px; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; color: #fff; flex: none; letter-spacing: -.02em; }

.scrim { position: fixed; inset: 0; background: rgba(38,34,24,.42); backdrop-filter: blur(2px); z-index: 60; animation: fade .15s ease; }
@keyframes fade { from { opacity: 0; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(10px); } }
@keyframes slideIn { from { transform: translateX(100%); } }
.pop-in { animation: slideUp .18s cubic-bezier(.2,.8,.3,1); }

.chip { display:inline-flex; align-items:center; gap:6px; height:28px; padding:0 11px; border-radius: var(--r-pill); background: var(--surface); border:1px solid var(--border-strong); font-size:12.5px; font-weight:600; color: var(--text-2); transition: background .12s, border-color .12s; cursor:pointer; }
.chip:hover { background: var(--surface-2); }
.chip.on { background: var(--brand-50); border-color: var(--brand-100); color: var(--brand-700); }
.chip .ic { width: 14px; height: 14px; }

.progress { height: 7px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.progress > span { display:block; height:100%; border-radius:99px; background: var(--brand); transition: width .3s; }

.empty { display:flex; flex-direction:column; align-items:center; justify-content:center; text-align:center; padding: var(--s8) var(--s5); color: var(--text-3); gap: 12px; }
.empty .ic { width: 34px; height: 34px; color: var(--sand); }
.empty h4 { color: var(--text-2); font-size: 14.5px; }

/* texture: subtle topographic feel for hero/login */
.topo-bg { background-color: var(--brand-700); background-image:
  radial-gradient(120% 90% at 80% -10%, rgba(207,135,41,.20), transparent 55%),
  radial-gradient(90% 80% at 0% 110%, rgba(0,0,0,.28), transparent 60%); }
