/* Shared design tokens and primitives for landing, app and admin. */
:root {
  --bg: #f6f7f5;
  --surface: #ffffff;
  --surface-2: #eef1ee;
  --text: #15201b;
  --muted: #5d6b64;
  --line: #dde3df;
  --accent: #0e9f6e;
  --accent-ink: #ffffff;
  --accent-soft: #dcf3e9;
  --warn: #c98a06;
  --warn-soft: #fbefd2;
  --danger: #d93f3f;
  --danger-soft: #fbe1e1;
  --info: #2f6fdb;
  --info-soft: #dfe9fb;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgb(16 24 20 / 6%), 0 8px 24px rgb(16 24 20 / 6%);
  --font: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1412;
    --surface: #171e1b;
    --surface-2: #1f2824;
    --text: #e8eeeb;
    --muted: #93a39b;
    --line: #2a3530;
    --accent: #2fc28c;
    --accent-ink: #06261a;
    --accent-soft: #143528;
    --warn: #f0b43c;
    --warn-soft: #3a2e12;
    --danger: #ff6b6b;
    --danger-soft: #3b1b1b;
    --info: #6ea0ff;
    --info-soft: #1a2640;
    --shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 8px 24px rgb(0 0 0 / 25%);
    color-scheme: dark;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
  line-height: 1.2;
  margin: 0 0 0.5em;
  letter-spacing: -0.01em;
}

a {
  color: var(--accent);
}

.muted {
  color: var(--muted);
}

.num {
  font-variant-numeric: tabular-nums;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.08s ease, background 0.15s ease, opacity 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.btn:active {
  transform: scale(0.97);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
}

.btn-ghost {
  background: transparent;
  border-color: var(--line);
}

.btn-danger {
  background: var(--danger-soft);
  color: var(--danger);
}

.btn-sm {
  min-height: 36px;
  padding: 6px 12px;
  font-size: 14px;
}

.btn-lg {
  min-height: 56px;
  padding: 14px 28px;
  font-size: 18px;
}

.input,
select.input,
textarea.input {
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

.input:focus,
.btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}

.table th,
.table td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.table th {
  color: var(--muted);
  font-weight: 600;
  font-size: 13px;
}

.table-scroll {
  overflow-x: auto;
}

.kv {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
  border-bottom: 1px dashed var(--line);
}

/* Admin */
.admin-wrap {
  max-width: 1040px;
  margin: 0 auto;
  padding: 24px 16px 64px;
  display: grid;
  gap: 16px;
}

.admin-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}
