:root {
  color-scheme: dark;
  --bg: #080a0f;
  --bg-soft: #0d1017;
  --panel: #11151e;
  --panel-2: #151a24;
  --line: #252b38;
  --line-soft: #1d222d;
  --text: #f5f7fb;
  --muted: #929bab;
  --muted-2: #697386;
  --accent: #7dd3fc;
  --accent-strong: #38bdf8;
  --accent-dark: #082f49;
  --green: #6ee7b7;
  --red: #fca5a5;
  --yellow: #fde68a;
  --radius: 18px;
  --shadow: 0 24px 70px rgba(0,0,0,.28);
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

.public-body {
  background:
    radial-gradient(circle at 15% 12%, rgba(56,189,248,.12), transparent 30%),
    radial-gradient(circle at 85% 20%, rgba(139,92,246,.09), transparent 28%),
    var(--bg);
}
.public-shell { width: min(1160px, calc(100% - 40px)); margin: 0 auto; }
.public-nav { height: 86px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid rgba(255,255,255,.08); }
.public-logo { display: inline-flex; align-items: center; gap: 12px; font-weight: 800; letter-spacing: -.03em; }
.public-logo span, .mark-icon, .auth-symbol {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  color: #04131c;
  background: linear-gradient(135deg, #bae6fd, #38bdf8);
  box-shadow: 0 10px 30px rgba(56,189,248,.18);
  font-weight: 900;
}
.public-hero { min-height: 580px; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; padding: 92px 0 72px; }
.eyebrow { display: inline-flex; align-items: center; gap: 10px; color: #b8c0cd; font-size: 12px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; }
.eyebrow i { display: block; width: 7px; height: 7px; border-radius: 99px; background: var(--accent); box-shadow: 0 0 20px var(--accent); }
.public-hero h1 { max-width: 920px; margin: 25px 0 24px; font-size: clamp(54px, 8vw, 106px); line-height: .94; letter-spacing: -.075em; }
.public-hero h1 span { color: #778194; }
.public-hero > p { max-width: 680px; margin: 0; color: #a9b1be; font-size: clamp(17px, 2vw, 21px); line-height: 1.75; }
.public-actions { display: flex; align-items: center; gap: 24px; margin-top: 38px; flex-wrap: wrap; }
.secure-note { color: var(--muted-2); font-size: 13px; }
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; padding: 0 0 54px; }
.feature-grid article { min-height: 220px; padding: 28px; border: 1px solid var(--line-soft); border-radius: var(--radius); background: rgba(17,21,30,.72); }
.feature-grid article > span { color: var(--accent); font-family: ui-monospace, monospace; font-size: 12px; }
.feature-grid h2 { margin: 52px 0 10px; font-size: 20px; letter-spacing: -.03em; }
.feature-grid p { margin: 0; color: var(--muted); line-height: 1.65; font-size: 14px; }
.public-footer { display: flex; justify-content: space-between; gap: 20px; padding: 28px 0 42px; border-top: 1px solid var(--line-soft); color: var(--muted-2); font-size: 12px; }

.button {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 17px;
  border: 1px solid transparent;
  border-radius: 11px;
  font-weight: 750;
  font-size: 13px;
  transition: transform .16s ease, border-color .16s ease, background .16s ease;
}
.button:hover { transform: translateY(-1px); }
.button-primary { background: linear-gradient(135deg, #bae6fd, #38bdf8); color: #04131c; box-shadow: 0 12px 32px rgba(56,189,248,.16); }
.button-ghost { border-color: var(--line); background: rgba(255,255,255,.025); color: #dce2eb; }
.button-ghost:hover { border-color: #465064; background: rgba(255,255,255,.05); }
.button-danger { border-color: rgba(248,113,113,.25); background: rgba(127,29,29,.15); color: #fecaca; }
.button-small { min-height: 38px; padding: 0 14px; font-size: 12px; }
.button-full { width: 100%; }
.button.copied { background: var(--green); color: #052e23; }

.auth-body { min-height: 100vh; display: grid; place-items: center; padding: 28px; background: radial-gradient(circle at 50% 0%, rgba(56,189,248,.13), transparent 30%), var(--bg); }
.auth-card { width: min(100%, 440px); padding: 34px; border: 1px solid var(--line); border-radius: 24px; background: rgba(17,21,30,.94); box-shadow: var(--shadow); }
.auth-symbol { margin-bottom: 24px; }
.eyebrow-text { margin: 0 0 12px; color: var(--accent); font-size: 11px; font-weight: 800; letter-spacing: .18em; }
.auth-card h1 { margin: 0; font-size: 30px; letter-spacing: -.05em; }
.auth-subtitle { margin: 10px 0 25px; color: var(--muted); font-size: 14px; line-height: 1.6; }
.form-stack { display: grid; gap: 16px; }
label { display: grid; gap: 8px; color: #d9dee7; font-size: 12px; font-weight: 700; }
label small, .field-help { color: var(--muted-2); font-size: 11px; font-weight: 500; line-height: 1.5; }
input, select, textarea {
  width: 100%;
  min-height: 45px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: 0;
  background: #0b0e14;
  color: var(--text);
  transition: border-color .16s ease, box-shadow .16s ease;
}
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--accent-strong); box-shadow: 0 0 0 3px rgba(56,189,248,.1); }
input::placeholder, textarea::placeholder { color: #515b6c; }

.app-shell { min-height: 100vh; }
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 30;
  width: 230px;
  display: flex;
  flex-direction: column;
  padding: 22px 16px;
  border-right: 1px solid var(--line-soft);
  background: #0b0e14;
}
.product-mark { display: flex; align-items: center; gap: 11px; padding: 0 6px 21px; }
.product-mark .mark-icon { width: 36px; height: 36px; }
.product-mark strong { display: block; font-size: 14px; letter-spacing: -.02em; }
.product-mark small { display: block; margin-top: 3px; color: var(--muted-2); font-size: 10px; }
.nav-list { display: grid; gap: 5px; margin-top: 18px; }
.nav-list a { padding: 11px 12px; border: 1px solid transparent; border-radius: 10px; color: #9da6b4; font-size: 13px; font-weight: 700; }
.nav-list a:hover { color: #e7ebf1; background: rgba(255,255,255,.025); }
.nav-list a.active { color: #dff5ff; border-color: rgba(56,189,248,.16); background: rgba(56,189,248,.08); }
.sidebar-footer { display: grid; gap: 6px; margin-top: auto; padding: 16px 12px 4px; border-top: 1px solid var(--line-soft); }
.sidebar-footer small { color: var(--muted-2); font-size: 10px; }
.sidebar-footer strong { font-size: 12px; }
.sidebar-footer a { margin-top: 5px; color: #fca5a5; font-size: 11px; }
.admin-main { min-height: 100vh; margin-left: 230px; padding: 40px 42px 60px; }
.mobile-header { display: none; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 26px; }
.page-head h1 { margin: 5px 0 0; font-size: 34px; letter-spacing: -.055em; }
.page-head p { margin: 0; color: var(--muted); font-size: 13px; }
.section-label { color: var(--accent); font-size: 10px; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; }

.flash { margin-bottom: 20px; padding: 13px 15px; border: 1px solid var(--line); border-radius: 11px; color: #dce2ea; background: var(--panel); font-size: 13px; }
.flash.success { border-color: rgba(52,211,153,.24); background: rgba(6,78,59,.18); color: #a7f3d0; }
.flash.error { border-color: rgba(248,113,113,.24); background: rgba(127,29,29,.18); color: #fecaca; }
.flash.warning { border-color: rgba(251,191,36,.24); background: rgba(120,53,15,.18); color: #fde68a; }

.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; margin-bottom: 18px; }
.stat-card, .panel { border: 1px solid var(--line-soft); background: var(--panel); border-radius: var(--radius); }
.stat-card { min-height: 138px; padding: 22px; }
.stat-card span { color: var(--muted); font-size: 11px; font-weight: 650; }
.stat-card strong { display: block; margin-top: 17px; font-size: 30px; letter-spacing: -.05em; }
.stat-card small { display: block; margin-top: 7px; color: var(--muted-2); font-size: 10px; }
.panel { overflow: hidden; margin-top: 16px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 18px 20px; border-bottom: 1px solid var(--line-soft); }
.panel-head h2 { margin: 0; font-size: 15px; letter-spacing: -.02em; }
.panel-head p { margin: 5px 0 0; color: var(--muted-2); font-size: 11px; }
.panel-body { padding: 20px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; }
.form-grid .wide { grid-column: 1 / -1; }
.form-actions { display: flex; gap: 10px; align-items: center; margin-top: 18px; }
.toolbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.filter-form { display: flex; gap: 9px; align-items: flex-end; flex-wrap: wrap; }
.filter-form input { width: 240px; }
.filter-form select { width: 150px; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { padding: 12px 15px; border-bottom: 1px solid var(--line-soft); color: var(--muted-2); font-size: 9px; letter-spacing: .1em; text-align: left; text-transform: uppercase; white-space: nowrap; }
td { padding: 15px; border-bottom: 1px solid var(--line-soft); color: #d5dbe4; font-size: 12px; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: rgba(255,255,255,.012); }
.cell-title { display: block; color: #f4f6f9; font-weight: 750; }
.cell-sub { display: block; max-width: 420px; margin-top: 4px; color: var(--muted-2); font-size: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.short-url { color: var(--accent); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.table-actions { display: flex; gap: 6px; align-items: center; }
.icon-button { min-height: 32px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; background: #0d1017; color: #cbd2dd; font-size: 10px; font-weight: 700; }
.icon-button:hover { border-color: #465064; }

.badge { display: inline-flex; align-items: center; min-height: 24px; padding: 0 9px; border-radius: 999px; font-size: 9px; font-weight: 800; }
.badge-success { color: #a7f3d0; background: rgba(16,185,129,.12); }
.badge-danger { color: #fecaca; background: rgba(239,68,68,.12); }
.badge-warning { color: #fde68a; background: rgba(245,158,11,.12); }
.badge-muted { color: #a8b0be; background: rgba(148,163,184,.1); }
.empty-state { padding: 50px 20px; color: var(--muted-2); text-align: center; font-size: 13px; }

.split-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(280px, .8fr); gap: 16px; }
.metric-list { display: grid; gap: 10px; }
.metric-row { display: grid; grid-template-columns: 100px 1fr 46px; align-items: center; gap: 12px; color: #cbd2dc; font-size: 11px; }
.metric-row progress { width: 100%; height: 8px; appearance: none; border: 0; border-radius: 999px; overflow: hidden; background: #0a0d13; }
.metric-row progress::-webkit-progress-bar { background: #0a0d13; }
.metric-row progress::-webkit-progress-value { background: linear-gradient(90deg, #38bdf8, #818cf8); border-radius: 999px; }
.metric-row progress::-moz-progress-bar { background: linear-gradient(90deg, #38bdf8, #818cf8); border-radius: 999px; }
.metric-row strong { text-align: right; font-size: 10px; }
.kpi-line { display: flex; justify-content: space-between; align-items: center; gap: 15px; padding: 13px 0; border-bottom: 1px solid var(--line-soft); }
.kpi-line:last-child { border-bottom: 0; }
.kpi-line span { color: var(--muted); font-size: 11px; }
.kpi-line strong { font-size: 14px; }

.error-page { display: grid; place-items: center; padding: 28px; }
.error-card { width: min(100%, 540px); padding: 42px; border: 1px solid var(--line); border-radius: 24px; background: var(--panel); text-align: center; box-shadow: var(--shadow); }
.error-code { color: var(--accent); font-family: ui-monospace, monospace; font-size: 13px; font-weight: 800; letter-spacing: .16em; }
.error-card h1 { margin: 15px 0 10px; font-size: 32px; letter-spacing: -.05em; }
.error-card p { margin: 0 auto 26px; max-width: 410px; color: var(--muted); line-height: 1.65; }

@media (max-width: 1040px) {
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split-grid { grid-template-columns: 1fr; }
}
@media (max-width: 780px) {
  .feature-grid { grid-template-columns: 1fr; }
  .public-hero { min-height: auto; padding: 90px 0 70px; }
  .public-footer { flex-direction: column; }
  .sidebar { transform: translateX(-100%); transition: transform .2s ease; box-shadow: 20px 0 60px rgba(0,0,0,.4); }
  .sidebar.open { transform: translateX(0); }
  .admin-main { margin-left: 0; padding: 86px 18px 40px; }
  .mobile-header { position: fixed; inset: 0 0 auto 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; height: 68px; padding: 0 17px; border-bottom: 1px solid var(--line-soft); background: rgba(8,10,15,.94); backdrop-filter: blur(16px); }
  .mobile-header .product-mark { padding: 0; }
  .menu-button { min-height: 36px; padding: 0 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel); color: var(--text); }
  .page-head { align-items: flex-start; flex-direction: column; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .wide { grid-column: auto; }
}
@media (max-width: 560px) {
  .public-shell { width: min(100% - 28px, 1160px); }
  .public-hero h1 { font-size: 54px; }
  .stats-grid { grid-template-columns: 1fr; }
  .stat-card { min-height: 116px; }
  .filter-form, .filter-form input, .filter-form select { width: 100%; }
  .filter-form .button { width: 100%; }
  .auth-card { padding: 26px 20px; }
  .panel-body { padding: 15px; }
  .metric-row { grid-template-columns: 78px 1fr 38px; }
}
