﻿/* =========================================================
   lnkt.win â€” design tokens & base
   ========================================================= */
:root {
  /* Surfaces â€” clean off-white, not manila */
  --paper:      oklch(0.985 0.008 95);   /* page bg, hint of warm */
  --paper-2:    oklch(0.965 0.010 95);   /* sidebar, inset */
  --paper-3:    oklch(0.945 0.012 95);
  --surface:    #ffffff;                  /* card surface */
  --line:       oklch(0.905 0.010 260);   /* hairline, slight cool */
  --line-soft:  oklch(0.945 0.008 260);

  --ink:        oklch(0.17  0.025 268);   /* primary text, cool ink */
  --ink-2:      oklch(0.32  0.025 268);
  --ink-mute:   oklch(0.52  0.020 268);
  --ink-faint:  oklch(0.70  0.015 268);

  /* PRIMARY â€” electric indigo / cobalt. The brand color. */
  --accent:        oklch(0.55  0.225 268);
  --accent-2:      oklch(0.48  0.225 268);
  --accent-tint:   oklch(0.95  0.045 268);
  --accent-line:   oklch(0.85  0.100 268);
  --accent-soft:   oklch(0.90  0.080 268);

  /* SECONDARY â€” warm coral. Now the main pop. */
  --coral:         oklch(0.70  0.185 25);
  --coral-deep:    oklch(0.58  0.190 25);
  --coral-tint:    oklch(0.95  0.045 25);
  --coral-soft:    oklch(0.90  0.080 25);

  /* TERTIARY â€” fresh mint. */
  --mint:          oklch(0.78  0.140 165);
  --mint-deep:     oklch(0.64  0.150 165);
  --mint-tint:     oklch(0.94  0.050 165);

  /* Accent yellow retained only for very rare highlights â€” not used in chrome. */
  --yellow:        oklch(0.88  0.150 95);
  --yellow-deep:   oklch(0.78  0.160 90);

  /* GOOD â€” same as mint */
  --good:          oklch(0.62  0.140 158);
  --good-tint:     oklch(0.94  0.050 158);

  --display: "Geist", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --sans:    "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono:    "Geist Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 22px;

  --shadow-1: 0 1px 0 oklch(0.92 0.008 260 / 0.7), 0 1px 2px oklch(0.18 0.025 268 / 0.04);
  --shadow-2: 0 2px 0 oklch(0.92 0.008 260 / 0.6), 0 12px 32px -10px oklch(0.18 0.025 268 / 0.14);
  --shadow-pop: 0 8px 28px -10px oklch(0.55 0.225 268 / 0.35);
}

*, *::before, *::after { box-sizing: border-box; }
html, body, #root { height: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14.5px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input, textarea, select { font: inherit; color: inherit; }

::selection { background: var(--accent); color: var(--paper); }

/* =========================================================
   Layout shell
   ========================================================= */
.app {
  display: grid;
  grid-template-columns: 232px 1fr;
  min-height: 100vh;
  background: var(--paper);
}
.app.no-chrome { grid-template-columns: 1fr; }

.sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  padding: 22px 18px;
  border-right: 1px solid var(--line);
  background: var(--paper-2);
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 6px 0;
}
.brand-mark {
  width: 30px; height: 30px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--accent) 0%, oklch(0.5 0.24 285) 100%);
  color: #fff;
  display: grid;
  place-items: center;
  position: relative;
  flex: 0 0 30px;
  box-shadow: 0 2px 0 oklch(0.40 0.225 268), 0 6px 14px -4px oklch(0.55 0.225 268 / 0.5);
}
.brand-mark svg { width: 15px; height: 15px; }
.brand-mark::after {
  content: "";
  position: absolute; top: 4px; right: 4px;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--coral);
  box-shadow: 0 0 0 2px oklch(0.5 0.24 280);
}
.brand-word {
  font-family: var(--display);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: -0.035em;
  line-height: 1;
  color: var(--ink);
}
.brand-word .dot { color: var(--accent); }
.brand-word .tld { font-family: var(--sans); font-weight: 500; font-size: 13px; letter-spacing: 0; color: var(--ink-mute); margin-left: 1px; }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-section-label {
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 10px;
  color: var(--ink-faint);
  padding: 6px 10px 4px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 13.5px;
  color: var(--ink-2);
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
  position: relative;
}
.nav-item:hover { background: var(--paper-2); color: var(--ink); }
.nav-item.active {
  background: var(--ink);
  color: #fff;
  box-shadow: inset 0 -2px 0 var(--accent);
}
.nav-item.active .nav-icon { color: var(--coral); }
.nav-item.disabled { opacity: 0.45; cursor: not-allowed; }
.nav-item .nav-icon { width: 16px; height: 16px; color: var(--ink-mute); display: inline-flex; }
.nav-item .badge {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.sidebar-footer {
  margin-top: auto;
  padding: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-top: 1px solid var(--line);
}
.avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--coral) 0%, var(--coral-deep) 100%);
  color: #fff;
  display: grid; place-items: center;
  font-family: var(--display); font-weight: 700;
  font-size: 13px;
  letter-spacing: -0.02em;
  box-shadow: inset 0 -2px 0 oklch(0 0 0 / 0.12);
}
.sidebar-footer .who { display: flex; flex-direction: column; line-height: 1.15; }
.sidebar-footer .who b { font-size: 13px; font-weight: 500; }
.sidebar-footer .who small { font-size: 11px; color: var(--ink-mute); }

/* =========================================================
   Topbar
   ========================================================= */
.topbar {
  display: flex; align-items: center; gap: 16px;
  padding: 14px 32px;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
  position: sticky; top: 0; z-index: 5;
}
.search {
  flex: 1; max-width: 520px;
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink-mute);
}
.search input {
  flex: 1; border: 0; background: transparent; outline: none;
  font-size: 13.5px; color: var(--ink);
}
.search input::placeholder { color: var(--ink-faint); }
.kbd {
  font-family: var(--mono); font-size: 10.5px;
  padding: 2px 6px; border-radius: 4px;
  background: var(--paper);
  border: 1px solid var(--line);
  color: var(--ink-mute);
}
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.icon-btn {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: 8px;
  color: var(--ink-mute);
}
.icon-btn:hover { background: var(--paper-2); color: var(--ink); }

/* =========================================================
   Page container
   ========================================================= */
.page { padding: 32px 32px 96px; max-width: 1180px; }
.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.page-title {
  font-family: var(--display);
  font-weight: 700;
  font-size: 44px;
  line-height: 1.02;
  letter-spacing: -0.04em;
  color: var(--ink);
}
.page-sub {
  margin-top: 8px;
  color: var(--ink-mute);
  font-size: 13.5px;
}
.eyebrow {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

/* =========================================================
   Buttons
   ========================================================= */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 16px;
  border-radius: 9px;
  font-size: 13.5px;
  font-weight: 500;
  border: 1px solid transparent;
  transition: background 0.12s, border-color 0.12s, transform 0.08s;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--accent); color: #fff;
  border-color: var(--accent);
  box-shadow: 0 2px 0 var(--accent-2), var(--shadow-pop);
}
.btn-primary:hover { background: var(--accent-2); }
.btn-primary:active { box-shadow: 0 1px 0 var(--accent-2); }
.btn-accent {
  background: var(--coral); color: #fff;
  border-color: var(--coral-deep);
  box-shadow: 0 2px 0 var(--coral-deep);
  font-weight: 500;
}
.btn-accent:hover { background: var(--coral-deep); }
.btn-ink {
  background: var(--ink); color: #fff;
  border-color: var(--ink);
}
.btn-ink:hover { background: oklch(0.10 0.025 268); }
.btn-ghost {
  color: var(--ink-2); background: transparent;
  border-color: var(--line);
}
.btn-ghost:hover { background: var(--paper-2); }
.btn-link {
  color: var(--ink-mute);
  padding: 6px 8px;
}
.btn-link:hover { color: var(--ink); }

/* =========================================================
   Cards & link list (Bitly-style roomy cards)
   ========================================================= */
.surface {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
}
.surface-2 {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}
.toolbar .filter {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--paper);
  color: var(--ink-2);
  font-size: 13px;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}
.toolbar .filter:hover { background: var(--paper-2); }
.toolbar .filter.active { border-color: var(--ink); background: var(--ink); color: var(--paper); }
.toolbar .search-inline {
  flex: 1; max-width: 360px;
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--paper);
  color: var(--ink-mute);
}
.toolbar .search-inline input {
  flex: 1; border: 0; background: transparent; outline: none;
  font-size: 13px; color: var(--ink);
}
.toolbar .spacer { flex: 1; }
.toolbar .view-toggle {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 9px;
  overflow: hidden;
  background: var(--paper);
}
.toolbar .view-toggle button {
  padding: 8px 10px;
  color: var(--ink-mute);
}
.toolbar .view-toggle button.active { background: var(--ink); color: var(--paper); }

.bulk-bar {
  display: flex; align-items: center; gap: 18px;
  padding: 12px 18px;
  border: 1px solid var(--line);
  background: var(--paper-2);
  border-radius: var(--r-lg);
  margin-bottom: 12px;
  font-size: 13px;
  color: var(--ink-mute);
}
.bulk-bar .count { color: var(--ink); font-weight: 500; }
.bulk-bar .right { margin-left: auto; display: flex; gap: 6px; }
.bulk-bar .right .icon-btn { color: var(--ink-mute); }
.bulk-bar .show {
  margin-left: auto;
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12.5px;
  color: var(--ink-2);
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.link-list { display: flex; flex-direction: column; gap: 14px; }

.link-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 22px 24px;
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 18px;
  align-items: start;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.12s;
  position: relative;
}
.link-card:hover {
  border-color: var(--accent-line);
  box-shadow: var(--shadow-2);
  transform: translateY(-1px);
}

.link-card .check {
  width: 18px; height: 18px;
  border: 1.5px solid var(--line);
  border-radius: 4px;
  margin-top: 6px;
  background: var(--paper);
  cursor: pointer;
  display: grid; place-items: center;
  color: transparent;
}
.link-card .check:hover { border-color: var(--ink-mute); }
.link-card .check.checked {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}

.link-card .body { min-width: 0; }
.link-card .title {
  font-family: var(--display);
  font-weight: 600;
  font-size: 19px;
  line-height: 1.2;
  color: var(--ink);
  letter-spacing: -0.025em;
  margin-bottom: 8px;
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}
.link-card .title .tag {
  font-family: var(--mono);
  font-style: normal;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-mute);
  border: 1px solid var(--line);
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--paper-2);
}

.short-link {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono);
  font-size: 13.5px;
  color: var(--accent);
  font-weight: 500;
}
.short-link .copy {
  width: 22px; height: 22px;
  display: grid; place-items: center;
  border-radius: 5px;
  color: var(--ink-faint);
  cursor: pointer;
}
.short-link .copy:hover { background: var(--accent-tint); color: var(--accent); }
.short-link .copy.copied { color: var(--good); }

.dest {
  margin-top: 10px;
  display: flex; align-items: center; gap: 8px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-mute);
  overflow: hidden;
}
.dest .arrow { color: var(--ink-faint); }
.dest .url { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.link-meta {
  margin-top: 14px;
  display: flex; align-items: center; gap: 18px;
  font-size: 12.5px;
  color: var(--ink-mute);
  flex-wrap: wrap;
}
.link-meta .item { display: inline-flex; align-items: center; gap: 6px; }
.link-meta .item.engagement.has { color: var(--good); font-weight: 500; }
.link-meta .item svg { width: 13px; height: 13px; color: var(--ink-faint); }
.link-meta .item.engagement.has svg { color: var(--good); }

.link-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}
.link-actions .icon-btn { color: var(--ink-mute); }
.link-actions .icon-btn:hover { color: var(--ink); background: var(--paper-2); }
.link-actions .icon-btn.danger:hover { color: var(--accent); background: var(--accent-tint); }

/* =========================================================
   Dashboard create-form card
   ========================================================= */
.create-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: 28px;
  box-shadow: var(--shadow-2);
  position: relative;
}
.create-card::before {
  content: "";
  position: absolute;
  top: -1px; left: 24px; right: 24px;
  height: 2px;
  background: linear-gradient(90deg, var(--accent) 0%, var(--coral) 100%);
  border-radius: 2px;
}
.create-card .row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.create-card .row.three { grid-template-columns: 1fr 1fr 1fr; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
.field .hint { font-size: 11.5px; color: var(--ink-faint); }
.field .input,
.field input,
.field textarea,
.field select {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 11px 13px;
  font-size: 14px;
  color: var(--ink);
  transition: border-color 0.12s, background 0.12s;
  outline: none;
  width: 100%;
}
.field input:focus,
.field textarea:focus,
.field select:focus { border-color: var(--ink); background: var(--paper); }

.field .input-with-prefix {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: stretch;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--paper-2);
  overflow: hidden;
  transition: border-color 0.12s, background 0.12s;
}
.field .input-with-prefix:focus-within { border-color: var(--ink); background: var(--paper); }
.field .input-with-prefix .prefix {
  display: inline-flex; align-items: center;
  padding: 0 12px;
  font-family: var(--mono); font-size: 13px;
  color: var(--ink-mute);
  border-right: 1px solid var(--line);
  background: var(--paper);
}
.field .input-with-prefix input {
  background: transparent;
  border: 0;
  padding: 11px 13px;
  font-family: var(--mono);
  font-size: 13px;
  outline: none;
  width: 100%;
}

.create-actions {
  display: flex; align-items: center; gap: 10px; margin-top: 12px;
}
.create-actions .grow { flex: 1; }

/* =========================================================
   Stat tiles & sparkline (analytics)
   ========================================================= */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 18px 20px;
  display: flex; flex-direction: column; gap: 6px;
  min-width: 0;
  position: relative;
  overflow: hidden;
}
.stat .delta.up { color: var(--good); }
.stat .delta.down { color: var(--coral-deep); }

.bulk-card {
  background:
    radial-gradient(140% 160% at 100% 0%, oklch(0.78 0.16 25) 0%, var(--coral) 45%, var(--coral-deep) 100%);
  border: 1px solid var(--coral-deep);
  border-radius: var(--r-xl);
  padding: 26px;
  display: flex; flex-direction: column;
  gap: 14px;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
  color: #fff;
  box-shadow: 0 2px 0 var(--coral-deep), 0 16px 32px -12px oklch(0.58 0.19 25 / 0.45);
}
.bulk-card::before {
  content: "";
  position: absolute;
  bottom: -70px; left: -30px;
  width: 200px; height: 200px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent) 0%, transparent 70%);
  opacity: 0.35;
  pointer-events: none;
}
.bulk-card > * { position: relative; }
.bulk-card .eyebrow { color: oklch(0.96 0.04 25); font-weight: 500; }
.bulk-card .stat-row {
  display: flex; flex-direction: column; gap: 4px;
  font-family: var(--mono); font-size: 11.5px;
  color: oklch(0.92 0.06 25);
}
.bulk-card .stat-row b { color: #fff; font-weight: 500; }
.bulk-card .btn-primary {
  background: #fff; color: var(--coral-deep);
  border-color: #fff;
  box-shadow: 0 2px 0 oklch(0.92 0.04 25);
}
.bulk-card .btn-primary:hover { background: oklch(0.96 0.02 25); }
.stat .label {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
.stat .value {
  font-family: var(--display);
  font-weight: 700;
  font-size: 42px;
  line-height: 1;
  letter-spacing: -0.045em;
  color: var(--ink);
  font-feature-settings: "tnum";
}
.stat .value .unit { font-family: var(--sans); font-style: normal; font-size: 14px; color: var(--ink-mute); margin-left: 4px; vertical-align: 6px; letter-spacing: 0.01rem; }
.stat .delta {
  margin-top: 2px;
  font-size: 12px; color: var(--ink-mute);
  display: inline-flex; align-items: center; gap: 6px;
}
.stat .delta.up { color: var(--good); }
.stat .delta.down { color: var(--accent); }

.stat.hero {
  grid-column: span 2;
  background:
    radial-gradient(120% 140% at 0% 0%, oklch(0.62 0.22 275) 0%, var(--accent) 55%, var(--accent-2) 100%);
  color: #fff;
  border-color: var(--accent-2);
  position: relative;
  overflow: hidden;
}
.stat.hero::after {
  content: "";
  position: absolute;
  right: -50px; top: -50px;
  width: 200px; height: 200px;
  border-radius: 50%;
  /*background: radial-gradient(circle, var(--coral) 0%, transparent 65%);*/
  opacity: 0.42;
  pointer-events: none;
}
.stat.hero .label { color: oklch(0.92 0.06 268); position: relative; }
.stat.hero .value { color: #fff; font-size: 84px; position: relative; }
.stat.hero .delta { color: oklch(0.94 0.08 268); position: relative; }
.stat.hero .value .unit { color: oklch(0.88 0.08 268); }

/* =========================================================
   Chart + referer/country lists + clicks table
   ========================================================= */
.chart-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 22px 24px 18px;
}
.chart-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 16px;
  margin-bottom: 18px;
}
.chart-head h3 {
  font-family: var(--display); font-weight: 600;
  font-size: 18px; letter-spacing: -0.03em;
}
.range-toggle {
  display: inline-flex; gap: 0;
  border: 1px solid var(--line); border-radius: 8px; overflow: hidden;
  font-family: var(--mono); font-size: 11px;
  background: var(--paper);
}
.range-toggle button {
  padding: 6px 12px;
  color: var(--ink-mute);
  letter-spacing: 0.04em;
}
.range-toggle button.active { background: var(--ink); color: var(--paper); }

.chart-svg { display: block; width: 100%; height: 260px; }
.chart-axis { font-family: var(--mono); font-size: 10px; fill: var(--ink-faint); letter-spacing: 0.05em; }
.chart-grid { stroke: var(--line-soft); stroke-width: 1; stroke-dasharray: 2 3; }
.chart-line { stroke: var(--accent); stroke-width: 2.5; fill: none; }
.chart-fill { fill: url(#chart-gradient); }
.chart-dot { fill: var(--accent); }
.chart-dot.peak { fill: var(--ink); }
.chart-baseline { stroke: var(--line); stroke-width: 1; }

.two-col {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 14px;
}
@media (max-width: 920px) { .two-col { grid-template-columns: 1fr; } }

.bar-list { display: flex; flex-direction: column; gap: 10px; }
.bar-row { display: grid; grid-template-columns: 1fr auto; gap: 6px; align-items: center; }
.bar-row .top { display: flex; align-items: center; gap: 8px; min-width: 0; }
.bar-row .label {
  font-size: 13px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bar-row .label.mono { font-family: var(--mono); font-size: 12px; }
.bar-row .value { font-family: var(--mono); font-size: 12px; color: var(--ink-mute); }
.bar-row .bar {
  grid-column: 1 / -1;
  height: 6px;
  background: var(--paper-2);
  border-radius: 3px;
  overflow: hidden;
}
.bar-row .bar .fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent) 0%, oklch(0.62 0.22 285) 100%);
  border-radius: 3px;
}
.bar-row.muted .bar .fill { background: var(--ink-mute); }
.bar-row:nth-child(3n+2) .bar .fill { background: linear-gradient(90deg, var(--coral) 0%, var(--coral-deep) 100%); }
.bar-row:nth-child(3n+3) .bar .fill { background: linear-gradient(90deg, var(--mint-deep) 0%, var(--mint) 100%); }

.flag {
  width: 18px; height: 13px;
  border-radius: 2px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  display: inline-block;
  flex: 0 0 18px;
  background-size: cover;
  background-position: center;
}

.clicks-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.clicks-table th {
  text-align: left;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-mute);
  font-weight: 500;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}
.clicks-table td {
  padding: 12px 12px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--ink);
  vertical-align: middle;
}
.clicks-table td.mono { font-family: var(--mono); font-size: 12px; color: var(--ink-mute); }
.clicks-table tr:hover td { background: var(--paper-2); }
.clicks-table tr:last-child td { border-bottom: 0; }

/* =========================================================
   Landing page (public)
   ========================================================= */
.landing {
  min-height: 100vh;
  background: var(--paper);
  display: flex; flex-direction: column;
  padding: 28px 40px 80px;
}
.landing-nav {
  display: flex; align-items: center; gap: 16px;
  margin-bottom: 100px;
}
.landing-nav .links { margin-left: auto; display: flex; align-items: center; gap: 22px; }
.landing-nav .links a {
  color: var(--ink-2);
  font-size: 13.5px;
}
.landing-nav .links a:hover { color: var(--ink); }

.hero {
  max-width: 880px;
  margin: 0 auto;
  text-align: left;
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
.hero .eyebrow { color: var(--accent); }
.hero h1 {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(54px, 8.5vw, 108px);
  line-height: 0.95;
  letter-spacing: -0.05em;
  color: var(--ink);
  max-width: 14ch;
}
.hero h1 .strike {
  position: relative;
  color: var(--ink-mute);
}
.hero h1 .strike::after {
  content: "";
  position: absolute;
  left: -3%; right: -3%;
  top: 50%;
  height: 8px;
  background: var(--coral);
  transform: rotate(-2.5deg);
  border-radius: 2px;
  z-index: -1;
  opacity: 0.85;
}
.hero h1 .accent {
  color: var(--accent);
  position: relative;
  display: inline-block;
}
.hero h1 .accent::after {
  content: "";
  position: absolute;
  left: 0; right: 0;
  bottom: 0.08em;
  height: 0.12em;
  background: var(--coral);
  border-radius: 4px;
  opacity: 0.6;
}
.hero p.lede {
  max-width: 56ch;
  font-size: 18px;
  line-height: 1.5;
  color: var(--ink-2);
  margin-top: 6px;
}
.hero .cta-row {
  margin-top: 18px;
  display: flex; align-items: center; gap: 14px;
  flex-wrap: wrap;
}
.hero .cta-row .btn-primary { padding: 13px 20px; font-size: 14px; }
.hero .meta {
  margin-top: 28px;
  display: flex; gap: 28px; flex-wrap: wrap;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.06em;
  color: var(--ink-mute);
}
.hero .meta b { color: var(--ink); font-weight: 500; }

.landing-grid {
  max-width: 1080px;
  margin: 100px auto 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.hero .eyebrow {
  color: var(--accent);
  font-weight: 600;
}
.feature {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 22px;
  display: flex; flex-direction: column; gap: 8px;
  position: relative;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}
.feature:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-2);
  border-color: var(--accent-line);
}
.feature .num {
  font-family: var(--mono); font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.feature:nth-child(3n+1) .num { color: var(--accent); }
.feature:nth-child(3n+2) .num { color: var(--coral-deep); }
.feature:nth-child(3n+3) .num { color: var(--mint-deep); }
.feature h4 {
  font-family: var(--display); font-weight: 600;
  font-size: 20px;
  color: var(--ink);
  letter-spacing: -0.03em;
}
.feature p { color: var(--ink-mute); font-size: 13.5px; line-height: 1.55; }

.landing-footer {
  margin-top: 80px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
  max-width: 1080px;
  margin-left: auto; margin-right: auto;
  display: flex; align-items: center; gap: 16px;
  font-family: var(--mono); font-size: 11.5px;
  color: var(--ink-mute);
}
.landing-footer .spacer { flex: 1; }

/* =========================================================
   Login screen
   ========================================================= */
.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: var(--paper);
  padding: 40px;
}
.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: 32px;
  box-shadow: var(--shadow-2);
}
.login-card .brand { padding: 0; justify-content: center; margin-bottom: 22px; }
.login-card h2 {
  font-family: var(--display); font-weight: 700;
  font-size: 28px;
  text-align: center; margin-bottom: 8px;
  letter-spacing: -0.035em;
}
.login-card .sub {
  text-align: center; color: var(--ink-mute);
  font-size: 13px; margin-bottom: 22px;
}
.login-card .btn-primary { width: 100%; justify-content: center; padding: 12px; }
.login-card .hint {
  margin-top: 16px; text-align: center;
  font-size: 11.5px; color: var(--ink-faint);
  font-family: var(--mono); letter-spacing: 0.06em;
}

/* =========================================================
   Toast / utility
   ========================================================= */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--ink);
  color: var(--paper);
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 13px;
  font-family: var(--sans);
  box-shadow: var(--shadow-2);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.25s cubic-bezier(.2,.7,.3,1);
  z-index: 50;
  display: inline-flex; align-items: center; gap: 8px;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.show svg { color: var(--good); }

.divider { height: 1px; background: var(--line); margin: 24px 0; }
.empty-state {
  padding: 60px 20px;
  text-align: center;
  color: var(--ink-mute);
}
.empty-state .icon {
  width: 48px; height: 48px;
  margin: 0 auto 14px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--paper-2);
  color: var(--ink-faint);
}

/* =========================================================
   Templates list + edit + bulk runner
   ========================================================= */

/* ---- Templates list grid ---- */
.template-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
@media (max-width: 980px) { .template-grid { grid-template-columns: 1fr; } }

.template-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.12s;
  position: relative;
  overflow: hidden;
}
.template-card:hover {
  border-color: var(--accent-line);
  box-shadow: var(--shadow-2);
  transform: translateY(-1px);
}
.template-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; bottom: 0;
  width: 3px;
  background: var(--accent);
}
.template-card:nth-child(3n+2)::before { background: var(--coral); }
.template-card:nth-child(3n+3)::before { background: var(--mint-deep); }

.template-card header { display: flex; flex-direction: column; gap: 4px; }
.template-card h3 {
  font-family: var(--display); font-weight: 600;
  font-size: 22px; letter-spacing: -0.035em;
  color: var(--ink);
}
.template-card header p {
  color: var(--ink-mute);
  font-size: 13.5px;
  line-height: 1.5;
}

.row-preview {
  list-style: none;
  padding: 0; margin: 0;
  display: flex; flex-wrap: wrap; gap: 6px;
}
.row-preview li {
  font-family: var(--mono);
  font-size: 11.5px;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  color: var(--ink-2);
  display: inline-flex; align-items: center; gap: 6px;
}
.row-preview li .src { color: var(--ink); font-weight: 500; }
.row-preview li .med { color: var(--ink-mute); }
.row-preview li .sep { color: var(--ink-faint); }
.row-preview li.more { background: transparent; border-color: transparent; color: var(--ink-mute); font-style: normal; }

.template-card footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--line-soft);
}
.template-card footer .meta {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--ink-mute);
  letter-spacing: 0.02em;
}
.template-card footer .footer-actions { display: flex; gap: 6px; }
.template-card footer .btn-link {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px;
}

/* ---- Template edit: row table ---- */
.row-table {
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: var(--paper-2);
}
.row-table-head, .row-table-row {
  display: grid;
  grid-template-columns: 22px 1.4fr 1fr 1fr 96px;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
}
.row-table-head {
  background: var(--paper-3);
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
.row-table-row + .row-table-row { border-top: 1px solid var(--line-soft); }
.row-table-row {
  background: var(--surface);
  transition: background 0.12s;
}
.row-table-row:hover { background: oklch(0.985 0.005 95); }
.row-table-row .handle {
  color: var(--ink-faint);
  cursor: grab;
  width: 20px; display: grid; place-items: center;
}
.row-table-row input {
  background: transparent;
  border: 0;
  border-bottom: 1px dashed transparent;
  padding: 6px 4px;
  font-size: 13px;
  outline: none;
  border-radius: 0;
  width: 100%;
}
.row-table-row input:focus {
  border-bottom-color: var(--accent);
  background: oklch(0.985 0.01 268);
}
.row-table-row .row-actions {
  display: flex; gap: 2px; justify-content: flex-end;
}

/* ---- Preview titles list (template edit + bulk) ---- */
.preview-titles {
  list-style: none;
  padding: 0; margin: 12px 0 0;
  display: flex; flex-direction: column;
  gap: 6px;
  font-size: 13px;
}
.preview-titles li {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 0;
  color: var(--ink);
  border-bottom: 1px dashed var(--line-soft);
}
.preview-titles li:last-child { border-bottom: 0; }
.preview-titles li .num {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--ink-faint);
  letter-spacing: 0.06em;
  flex: 0 0 22px;
}
.preview-titles li.more {
  color: var(--ink-mute);
  font-style: italic;
  border-bottom: 0;
  padding-top: 8px;
}

/* ---- Bulk runner: progress + result panel ---- */
.progress-track {
  height: 6px;
  background: var(--paper-3);
  border-radius: 99px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent) 0%, oklch(0.62 0.22 285) 100%);
  border-radius: 99px;
  transition: width 0.25s cubic-bezier(.2,.7,.3,1);
}

.result-panel {
  background: var(--ink);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-2);
}
.result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 22px;
  border-bottom: 1px solid oklch(0.28 0.025 268);
  color: #fff;
}
.result-head h3 { color: #fff; }
.result-head .eyebrow { color: oklch(0.65 0.04 268); }
.result-head .btn-ink {
  background: #fff; color: var(--ink); border-color: #fff;
}
.result-head .btn-ink:hover { background: oklch(0.96 0.005 95); }
.result-head .btn-ghost {
  border-color: oklch(0.32 0.03 268);
  color: oklch(0.85 0.02 268);
}

.result-pre {
  margin: 0;
  padding: 18px 22px 24px;
  font-family: var(--mono);
  font-size: 12.5px;
  color: oklch(0.85 0.02 268);
  white-space: normal;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.result-meta {
  display: block;
  white-space: pre;
  color: oklch(0.65 0.04 268);
  padding-bottom: 12px;
  border-bottom: 1px solid oklch(0.28 0.025 268);
  line-height: 1.7;
}
.result-grid {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.result-line {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  margin: 0 -10px;
  border-radius: 6px;
  flex-wrap: wrap;
  transition: background 0.12s;
}
.result-line:hover { background: oklch(0.22 0.025 268); }
.result-line .label {
  color: oklch(0.65 0.04 268);
  white-space: nowrap;
}
.result-line .link {
  color: var(--coral);
  white-space: nowrap;
}
.result-line .copy {
  width: 24px; height: 24px;
  display: grid; place-items: center;
  border-radius: 5px;
  color: oklch(0.65 0.04 268);
  background: transparent;
  border: 1px solid transparent;
  flex: 0 0 24px;
}
.result-line .copy:hover { background: oklch(0.28 0.03 268); color: #fff; }
.result-line .copy.copied { color: var(--mint); border-color: var(--mint-deep); }

/* =========================================================
   First-run empty state (links list)
   ========================================================= */
.empty-hero {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: 64px 48px;
  text-align: center;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-2);
}
.empty-hero::before {
  content: "";
  position: absolute;
  top: -100px; right: -80px;
  width: 360px; height: 360px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--coral-tint) 0%, transparent 70%);
  opacity: 0.7;
  pointer-events: none;
}
.empty-hero::after {
  content: "";
  position: absolute;
  bottom: -120px; left: -60px;
  width: 320px; height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-tint) 0%, transparent 70%);
  opacity: 0.7;
  pointer-events: none;
}
.empty-hero > * { position: relative; }
.empty-hero .glyph {
  width: 72px; height: 72px;
  border-radius: 20px;
  margin: 0 auto 24px;
  background: linear-gradient(135deg, var(--accent) 0%, oklch(0.5 0.24 285) 100%);
  color: #fff;
  display: grid; place-items: center;
  box-shadow: 0 4px 0 var(--accent-2), 0 14px 28px -10px oklch(0.55 0.225 268 / 0.5);
}
.empty-hero h2 {
  font-family: var(--display);
  font-weight: 700;
  font-size: 36px;
  letter-spacing: -0.045em;
  color: var(--ink);
  margin-bottom: 12px;
}
.empty-hero p {
  color: var(--ink-mute);
  font-size: 15px;
  max-width: 48ch;
  margin: 0 auto 24px;
  line-height: 1.55;
}
.empty-hero .cta-row {
  display: flex; gap: 10px; justify-content: center;
  flex-wrap: wrap;
}
.empty-hero .quick-list {
  display: flex; gap: 18px;
  justify-content: center;
  margin-top: 36px;
  flex-wrap: wrap;
}
.empty-hero .quick-list li {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 11.5px;
  color: var(--ink-mute);
  letter-spacing: 0.04em;
}
.empty-hero .quick-list li b { color: var(--ink); font-weight: 500; }

/* login: error message (used in component-level state) */
.field .error {
  font-size: 12px; color: var(--coral-deep);
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 4px;
}
.field input.invalid {
  border-color: var(--coral);
  background: var(--coral-tint);
}



/* =========================================================
   Production-only additions (lnkt.win build)
   ========================================================= */
.row-table-row.dragging { opacity: 0.45; }
.row-table-row[draggable=true] .handle { cursor: grabbing; }

.link-card .check input { position: absolute; opacity: 0; width: 18px; height: 18px; margin: 0; cursor: pointer; }
.link-card .check:has(input:checked) { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.link-card .check:has(input:checked) svg { display: block; }
.link-card .check svg { display: none; width: 12px; height: 12px; }

.btn[disabled], button[disabled] { opacity: 0.45; cursor: not-allowed; }
.btn-link[disabled] { pointer-events: none; }

/* danger ghost button used by delete actions */
.btn-danger {
  background: transparent;
  color: var(--coral-deep);
  border: 1px solid var(--coral-soft);
  padding: 10px 16px;
  border-radius: 9px;
  font-size: 13.5px;
  font-weight: 500;
  display: inline-flex; align-items: center; gap: 8px;
}
.btn-danger:hover { background: var(--coral-tint); border-color: var(--coral); }

/* Highlighted alert row at the top of a form (used for login error, etc.) */
.flash-error {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  background: var(--coral-tint);
  border: 1px solid var(--coral-soft);
  color: var(--coral-deep);
  border-radius: var(--r-md);
  font-size: 13px;
  margin-bottom: 14px;
}

/* Tiny visual cue when a copy button is on a dark background */
.result-line .copy svg { width: 12px; height: 12px; }
.short-link .copy svg { width: 13px; height: 13px; }
.short-link .copy.copied { color: var(--good); }

/* ---------------------------------------------------------
   Utility classes (replaces repeated inline styles across PHP)
   --------------------------------------------------------- */

/* Two-column form/aside grid used on dashboard, link-edit, template-edit,
   bulk. The original .two-col (1.2fr 1fr) is for analytics; this is the
   slightly-wider main-content variant. Combines with data-two-col so the
   mobile media query collapses it to one column. */
.form-aside-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 18px;
  min-width: 0;
}

/* Page-header action cluster (top-right of every page-header). */
.page-actions { display: flex; gap: 10px; }

/* Breadcrumb row above the page title on detail pages
   (link-edit / link-analytics / bulk / template-edit). */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.breadcrumb .sep { color: var(--ink-faint); }
.breadcrumb .btn-link { padding: 0; }

/* Label/value rows used inside surface cards (link-edit activity card). */
.kv-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.kv-row .k { color: var(--ink-mute); font-size: 13px; }

/* Small muted paragraph (form hints, surface descriptions). */
.muted-p {
  color: var(--ink-mute);
  font-size: 12.5px;
  margin-top: 6px;
  line-height: 1.5;
}

/* Mono inline text colored to ink (used as inline code in copy). */
.mono-ink { font-family: var(--mono); color: var(--ink); }

/* Small mono meta line (action-row context strings). */
.mono-meta { font-family: var(--mono); font-size: 12px; color: var(--ink-mute); }

/* All-caps mono eyebrow used as a row-counter / id-line — looks like
   .eyebrow but reads as data. */
.eyebrow-meta {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-mute);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* .surface variant with the coral-tinted "danger zone" border. */
.surface.danger {
  padding: 22px;
  border-color: var(--coral-soft);
}
.surface.danger .eyebrow { color: var(--coral-deep); }

/* Section-title sized down from .page-title. */
.section-title {
  font-family: var(--display);
  font-weight: 600;
  font-size: 24px;
  letter-spacing: -0.035em;
}
.section-title.sm { font-size: 22px; letter-spacing: -0.035em; }
.section-title.xs { font-size: 17px; letter-spacing: -0.025em; }

/* Surface paddings. The bare .surface has no padding; this fills it. */
.surface.pad { padding: 22px; }

/* Detail-page header (breadcrumb + title + actions) wants less bottom
   gap than the dashboard's full header. */
.page-header.tight { margin-bottom: 18px; }

/* Bulk-card headline (the deep-coral CTA on the dashboard). Both the
   has-template and the empty-template variants share this typography. */
.bulk-card .headline {
  font-family: var(--display);
  font-weight: 700;
  font-size: 32px;
  letter-spacing: -0.045em;
  margin-top: 8px;
  line-height: 0.95;
  color: #fff;
}
.bulk-card .lede {
  color: oklch(0.94 0.05 25);
  font-size: 13.5px;
  margin-top: 10px;
  line-height: 1.55;
}

/* Mobile note: collapse two-column grids on narrow screens */
@media (max-width: 920px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
  .page { padding: 24px 18px 60px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .stat.hero { grid-column: span 2; }
  div[data-two-col] { grid-template-columns: 1fr !important; }
  .create-card .row, .create-card .row.three { grid-template-columns: 1fr; }
}
