﻿:root {
  --bg: #f4f7f8;
  --surface: #ffffff;
  --surface-strong: #eef4f5;
  --text: #142426;
  --muted: #657476;
  --line: #dce6e8;
  --primary: #176b5b;
  --primary-dark: #0f4d42;
  --accent: #e3a72f;
  --accent-strong: #f1bf49;
  --danger: #c84630;
  --success: #1e8a4f;
  --brand: #0c4a43;
  --radius: 12px;
  --radius-lg: 16px;
  --shadow: 0 18px 45px rgba(28, 48, 52, 0.12);
  --shadow-soft: 0 12px 35px rgba(18, 47, 51, 0.08);
  --font-stack: "Inter", "Segoe UI", "Aptos", "Helvetica Neue", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: var(--font-stack);
  background:
    radial-gradient(circle at 12% 12%, rgba(233, 169, 26, 0.16), transparent 28%),
    linear-gradient(135deg, #f8fbfa 0%, var(--bg) 44%, #dbe8e4 100%);
}

.admin-shell {
  width: min(1440px, calc(100% - 36px));
  margin: 0 auto;
  padding: 34px 0 52px;
  display: grid;
  gap: 18px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(260px, 420px) 1fr;
  gap: 34px;
  align-items: center;
  margin-bottom: 24px;
}

.hero-brand {
  min-height: 220px;
  border-radius: var(--radius-lg);
  background: #061111;
  display: grid;
  place-items: center;
  padding: 26px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.hero-brand::after {
  content: "";
  position: absolute;
  inset: auto -15% -35% 35%;
  height: 120px;
  background: rgba(233, 169, 26, 0.22);
  filter: blur(34px);
}

.hero-brand img {
  width: min(100%, 360px);
  height: auto;
  position: relative;
  z-index: 1;
}

.hero-brand span {
  position: absolute;
  left: 24px;
  bottom: 18px;
  color: #e7f0ee;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 12px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--brand);
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 12px;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  font-size: clamp(36px, 6vw, 64px);
  line-height: 0.95;
  margin-bottom: 18px;
}

h2, h3 {
  margin-bottom: 12px;
}

.hero-copy {
  color: var(--muted);
  max-width: 720px;
  font-size: 18px;
  line-height: 1.6;
}

.login-panel,
.panel,
.dashboard-header,
.metric {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.login-panel {
  display: grid;
  grid-template-columns: 1fr minmax(280px, 430px);
  gap: 24px;
  padding: 26px;
  align-items: start;
}

.status {
  min-height: 22px;
  color: #9b3d2c;
  font-weight: 700;
}

.is-hidden {
  display: none !important;
}

.login-form {
  display: grid;
  gap: 12px;
}

.dashboard {
  display: grid;
  gap: 18px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-weight: 700;
}

input,
button {
  font: inherit;
}

input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 13px 14px;
  background: #fff;
  color: var(--text);
  min-height: 42px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}

input:hover {
  border-color: #b8d0d4;
}

input:focus-visible {
  outline: 3px solid rgba(23, 107, 91, 0.18);
  outline-offset: 1px;
}

button {
  border: 0;
  border-radius: 999px;
  padding: 13px 18px;
  background: var(--primary);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease;
  box-shadow: 0 10px 22px rgba(23, 107, 91, 0.15);
}

button:hover:not(:disabled) {
  transform: translateY(-1px);
  background: var(--primary-dark);
}

button.ghost,
button.ghost-button,
button.secondary {
  background: #fff;
  color: var(--brand);
  border: 1px solid var(--line);
  box-shadow: none;
}

button.ghost:hover,
button.ghost-button:hover,
button.secondary:hover {
  border-color: var(--primary);
  background: #f4fbf9;
}

.dashboard-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  padding: 22px 24px;
}

.dashboard-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 14px;
}

.metric {
  padding: 18px;
  box-shadow: none;
}

.metric span {
  color: var(--muted);
  display: block;
  margin-bottom: 8px;
}

.metric strong {
  font-size: 34px;
}

.panel {
  padding: 20px;
  box-shadow: 0 16px 44px rgba(18, 49, 51, 0.1);
}

.panel-heading {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
  margin-bottom: 14px;
}

.panel-heading input {
  max-width: 360px;
}

.panel-note {
  color: var(--muted);
  margin: 0;
  max-width: 680px;
}

.traffic-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 12px;
}

.traffic-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 15px;
  background: #fbfdfc;
}

.traffic-card span {
  color: var(--muted);
  display: block;
  margin-bottom: 8px;
}

.traffic-card strong {
  font-size: 24px;
}

.registration-panel {
  display: grid;
  gap: 14px;
}

.chart-range {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.chart-range button {
  padding: 10px 13px;
  min-height: 40px;
}

.chart-range button.is-active {
  color: #fff;
  background: #176b5b;
  border-color: #176b5b;
  box-shadow: 0 10px 22px rgba(23, 107, 91, 0.18);
}

.registration-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  gap: 10px;
}

.registration-stats article {
  border: 1px solid #dce6e8;
  border-radius: 14px;
  padding: 12px;
  background: #f8fcfb;
}

.registration-stats span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 5px;
}

.registration-stats strong {
  color: var(--admin-ink, var(--text));
  font-size: 24px;
}

.chart-wrap {
  overflow-x: auto;
  border: 1px solid #deeaee;
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff, #f7fbfb);
  padding: 14px;
}

.chart-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.registration-chart {
  display: block;
  min-width: 720px;
  width: 100%;
  height: auto;
}

.chart-grid {
  stroke: #dbe9e8;
  stroke-width: 1;
}

.chart-axis,
.chart-empty {
  fill: #667a7e;
  font-size: 12px;
}

.chart-area {
  fill: rgba(23, 107, 91, 0.1);
  stroke: none;
}

.chart-line {
  fill: none;
  stroke: #176b5b;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chart-dot {
  fill: #176b5b;
  stroke: #fff;
  stroke-width: 2;
}

.chart-bar {
  fill: #e3a72f;
  opacity: 0.78;
}

.chart-note {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 900px;
}

th,
td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid #edf3f1;
  vertical-align: top;
}

th {
  color: var(--brand);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: #f5faf8;
}

td {
  color: #2b4140;
}

.empty-row {
  color: var(--muted);
  text-align: center;
}

.codex-panel {
  border-color: rgba(233, 169, 26, 0.45);
  background: rgba(255, 252, 245, 0.96);
}

.codex-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(120px, 1fr));
  gap: 10px;
  min-width: 300px;
}

.codex-summary article {
  border: 1px solid rgba(233, 169, 26, 0.35);
  border-radius: 16px;
  padding: 12px;
  background: #fffaf0;
}

.codex-summary span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 5px;
}

.codex-summary strong {
  font-size: 22px;
  color: var(--brand);
}

.split-tables {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.split-tables h4 {
  margin: 0 0 10px;
}

.compact-table table {
  min-width: 560px;
}

button:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(23, 107, 91, 0.22);
  outline-offset: 1px;
}

@media (max-width: 900px) {
  .hero,
  .login-panel {
    grid-template-columns: 1fr;
  }

  .metrics,
  .traffic-grid {
    grid-template-columns: repeat(2, minmax(140px, 1fr));
  }

  .dashboard-header,
  .panel-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .panel-heading input {
    max-width: none;
  }

  .split-tables {
    grid-template-columns: 1fr;
  }

  .codex-summary {
    min-width: 0;
  }
}

@media (max-width: 560px) {
  .admin-shell {
    width: min(100% - 20px, 1440px);
    padding-top: 18px;
  }

  .metrics,
  .traffic-grid {
    grid-template-columns: 1fr;
  }

  .hero-brand {
    min-height: 170px;
  }
}
/* ---------- MODERN ADMIN VISUAL UPGRADE ---------- */
:root {
  --admin-bg: linear-gradient(140deg, #0c2f34 0%, #173840 36%, #f4f7f8 100%);
  --admin-surface: rgba(255, 255, 255, 0.94);
  --admin-border: rgba(17, 42, 47, 0.11);
  --admin-ink: #0d2d33;
  --admin-soft: #f3f7f8;
}

body {
  background: var(--admin-bg);
  color: var(--admin-ink);
  background-attachment: fixed;
}

.admin-shell {
  width: min(1560px, calc(100% - 28px));
  gap: 18px;
}

.hero,
.login-panel,
.panel,
.dashboard,
.table-wrap,
.metric,
.traffic-card,
.codex-summary article,
.traffic-grid .traffic-card {
  border: 1px solid var(--admin-border);
  background: var(--admin-surface);
  border-radius: 16px;
  box-shadow: 0 18px 44px rgba(20, 38, 43, 0.11);
}

.hero {
  align-items: stretch;
  background: linear-gradient(180deg, rgba(16, 54, 58, 0.92) 0%, rgba(8, 30, 34, 0.9) 100%);
  border-radius: 18px;
  padding: 10px;
  overflow: hidden;
}

.hero-brand {
  border-radius: 16px;
  min-height: 260px;
  background:
    linear-gradient(160deg, #07252b 0%, #11343a 55%, #0a272f 100%),
    radial-gradient(circle at 18% 20%, rgba(227, 167, 47, 0.22), transparent 55%);
  box-shadow: 0 20px 50px rgba(7, 24, 27, 0.35);
}

.hero-copy {
  color: #4a686e;
  max-width: 680px;
}

.eyebrow,
h1,
h2,
h3 {
  color: var(--admin-ink);
}

.login-panel {
  padding: 26px;
  gap: 12px;
  border-radius: 16px;
}

.login-form {
  margin: 0;
}

button,
input {
  border-radius: 11px;
}

button {
  border: 1px solid transparent;
  font-weight: 800;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease,
    background 0.16s ease;
}

button:hover {
  transform: translateY(-1px);
}

button[type="submit"],
button[type="button"] {
  background: linear-gradient(180deg, #1f886f, #176b5b);
  color: #fff;
  border-color: #176b5b;
  box-shadow: 0 10px 24px rgba(23, 107, 91, 0.2);
}

button[type="submit"]:hover,
button[type="button"]:hover {
  background: linear-gradient(180deg, #0f4d42, #0d3b35);
}

button.ghost,
button.ghost-button,
button.secondary {
  color: var(--admin-ink);
  background: #fff;
  border: 1px solid #c7d7dc;
  box-shadow: none;
}

button.ghost:hover,
button.ghost-button:hover,
button.secondary:hover {
  background: #f2fbf8;
  border-color: var(--primary);
}

button:focus-visible,
input:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 3px rgba(23, 107, 91, 0.2);
}

.dashboard-header,
.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.dashboard-header {
  padding: 18px;
  background: linear-gradient(180deg, #ffffff, #f3f9f8);
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(170px, 1fr));
  gap: 12px;
}

.metric {
  border-color: #dce6e8;
  background: linear-gradient(145deg, #ffffff, #f7fbfb);
  padding: 18px;
  min-height: 118px;
}

.metric strong {
  font-size: 32px;
}

.traffic-grid {
  grid-template-columns: repeat(4, minmax(150px, 1fr));
}

.traffic-card {
  border-radius: 14px;
  border-color: #dce6e8;
}

.table-wrap {
  border-radius: 14px;
  overflow: auto;
  background: #fff;
  border: 1px solid #deeaee;
}

table {
  min-width: 860px;
}

table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: linear-gradient(180deg, #f5faf8, #edf7f3);
  color: var(--admin-ink);
  font-size: 12px;
  letter-spacing: 0.05em;
}

table tbody tr {
  transition: background 0.16s ease;
}

table tbody tr:hover {
  background: #f5fbf9;
}

.codex-panel {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), #fffaf0 100%);
  border: 1px solid rgba(227, 169, 47, 0.28);
}

.codex-summary {
  min-width: 0;
}

.codex-summary article {
  background: #fffaf0;
  border-radius: 14px;
}

.codex-summary strong {
  font-size: 24px;
}

.panel-note {
  max-width: 780px;
}

.split-tables {
  align-items: start;
}

.empty-row {
  color: #637578;
}

@media (max-width: 1280px) {
  .metrics {
    grid-template-columns: repeat(2, minmax(170px, 1fr));
  }

  .traffic-grid {
    grid-template-columns: repeat(2, minmax(150px, 1fr));
  }

  .dashboard-header,
  .panel-heading {
    align-items: stretch;
    flex-direction: column;
  }
}

@media (max-width: 900px) {
  .admin-shell {
    width: min(100% - 18px, 1440px);
    gap: 12px;
  }

  .hero {
    grid-template-columns: 1fr;
    padding: 0;
  }

  .hero-brand {
    min-height: 170px;
  }

  .hero-copy {
    padding: 0 4px 12px;
  }

  .split-tables {
    grid-template-columns: 1fr;
  }

  .dashboard-header {
    border-radius: 14px;
    padding: 14px;
  }
}

/* ---------- BUTTON READABILITY FIX ---------- */
button,
button[type="submit"],
button[type="button"],
button.ghost,
button.ghost-button,
button.secondary {
  color: var(--admin-ink);
}

button[type="submit"],
button[type="button"] {
  background: #fff;
  border-color: #c7d7dc;
  box-shadow: 0 8px 20px rgba(16, 48, 54, 0.09);
}

button[type="submit"]:hover,
button[type="button"]:hover,
button.ghost:hover,
button.ghost-button:hover,
button.secondary:hover {
  color: #071b1d;
  background: #d7eee7;
  border-color: #0f4d42;
  box-shadow: 0 12px 26px rgba(15, 77, 66, 0.2);
}

.metric:hover,
.panel:hover,
.traffic-card:hover,
.codex-summary article:hover {
  border-color: rgba(15, 77, 66, 0.62);
  background-color: #f0faf6;
}

.registration-stats article:hover {
  border-color: rgba(15, 77, 66, 0.62);
  background-color: #f0faf6;
}

@media (max-width: 720px) {
  .registration-stats {
    grid-template-columns: repeat(2, minmax(120px, 1fr));
  }

  .chart-header {
    align-items: flex-start;
    flex-direction: column;
  }
}
