:root {
  --bg: #070a0f;
  --panel: #0f1721;
  --panel-soft: #141f2b;
  --ink: #f5f8fc;
  --muted: #9aa8b8;
  --line: rgba(255, 255, 255, 0.11);
  --green: #23c98d;
  --cyan: #39b7ff;
  --gold: #f4c95d;
  --red: #ff6b5f;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 8%, rgba(35, 201, 141, 0.14), transparent 30%),
    radial-gradient(circle at 90% 4%, rgba(57, 183, 255, 0.12), transparent 28%),
    var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

a { color: inherit; text-decoration: none; }

button,
input { font: inherit; }

.admin-shell[data-auth="locked"] .dashboard { display: none; }
.admin-shell[data-auth="unlocked"] .login-panel { display: none; }

.login-panel {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
}

.back-link {
  position: fixed;
  top: 22px;
  left: 22px;
  color: var(--muted);
  font-weight: 750;
}

.login-card {
  width: min(100%, 470px);
  padding: clamp(26px, 5vw, 42px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.035));
  box-shadow: var(--shadow);
}

.brand,
.brand-mark { display: inline-flex; align-items: center; }

.brand { gap: 10px; font-weight: 900; }

.brand-mark {
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  color: #06100c;
  background: linear-gradient(135deg, var(--green), var(--gold));
  font-size: 0.86rem;
  font-weight: 900;
}

.eyebrow {
  margin: 20px 0 10px;
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
p { overflow-wrap: anywhere; }

h1 { margin: 0; font-size: clamp(2rem, 5vw, 3.3rem); line-height: 1; }
h2 { margin: 0; font-size: clamp(1.5rem, 3vw, 2.35rem); line-height: 1.05; }
p { color: var(--muted); }

.login-copy { margin-bottom: 24px; }

form { display: grid; gap: 11px; }

label { display: grid; gap: 8px; color: var(--ink); font-weight: 750; }

input {
  width: 100%;
  min-height: 48px;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(255,255,255,0.055);
  outline: none;
}

input:focus { border-color: rgba(35, 201, 141, 0.7); box-shadow: 0 0 0 3px rgba(35, 201, 141, 0.12); }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 12px 16px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-weight: 850;
  cursor: pointer;
}

.button.primary { color: #06100c; background: linear-gradient(135deg, var(--green), var(--gold)); }
.button.secondary { color: var(--ink); border-color: var(--line); background: rgba(255,255,255,0.06); }
.button.ghost { color: var(--muted); border-color: var(--line); background: transparent; }

.form-note { min-height: 22px; margin: 4px 0 0; font-size: 0.88rem; }
.form-note.is-error { color: var(--red); }
.form-note.is-success { color: var(--green); }

.dashboard { min-height: 100vh; display: grid; grid-template-columns: 260px minmax(0, 1fr); }

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 24px;
  border-right: 1px solid var(--line);
  background: rgba(7, 10, 15, 0.72);
  backdrop-filter: blur(16px);
}

.sidebar nav { display: grid; gap: 8px; }
.sidebar nav a {
  min-height: 42px;
  display: flex;
  align-items: center;
  padding: 9px 11px;
  border-radius: 8px;
  color: var(--muted);
  font-weight: 800;
}
.sidebar nav a.is-active,
.sidebar nav a:hover { color: var(--ink); background: rgba(255,255,255,0.07); }
.sidebar .ghost { margin-top: auto; }

.workspace { padding: clamp(20px, 4vw, 44px); }

.topbar,
.panel-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
}

.topbar { margin-bottom: 24px; }
.topbar .eyebrow,
.panel-heading .eyebrow { margin-top: 0; }

.metric-grid,
.order-grid,
.settings-grid { display: grid; gap: 16px; }

.metric-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 18px; }

.metric-card,
.panel,
.order-grid article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(255,255,255,0.075), rgba(255,255,255,0.035));
  box-shadow: 0 10px 34px rgba(0,0,0,0.2);
}

.metric-card { padding: 18px; }
.metric-card span { color: var(--muted); font-weight: 800; }
.metric-card strong { display: block; margin-top: 14px; font-size: 2.25rem; line-height: 1; }
.metric-card p { margin-bottom: 0; }

.panel { margin-top: 18px; padding: 20px; }
.table-wrap { overflow-x: auto; margin-top: 18px; }

table { width: 100%; min-width: 720px; border-collapse: collapse; }
th,
td { padding: 13px 12px; text-align: left; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.05em; }
td button { padding: 8px 11px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: rgba(255,255,255,0.06); cursor: pointer; }

.status { display: inline-flex; padding: 5px 9px; border-radius: 8px; font-size: 0.82rem; font-weight: 850; }
.status.review { color: var(--gold); background: rgba(244, 201, 93, 0.1); }
.status.priority { color: var(--cyan); background: rgba(57, 183, 255, 0.1); }
.status.publish { color: var(--green); background: rgba(35, 201, 141, 0.1); }

.order-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 18px; }
.order-grid article { padding: 16px; }
.order-grid strong,
.order-grid span { display: block; }
.order-grid span { margin-top: 8px; color: var(--green); font-weight: 850; }
.order-grid p { margin-bottom: 0; }

.settings-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 18px; }
.settings-grid .button,
.settings-grid .form-note { grid-column: 1 / -1; }

@media (max-width: 1100px) {
  .dashboard { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .order-grid { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  .login-panel { padding: 18px; }
  .topbar,
  .panel-heading { align-items: flex-start; flex-direction: column; }
  .metric-grid,
  .settings-grid { grid-template-columns: 1fr; }
  .workspace { padding: 18px; }
}

.button {
  gap: 8px;
}

.button.is-loading {
  cursor: wait;
  opacity: 0.88;
  pointer-events: none;
}

.button.is-loading::before {
  content: "";
  width: 16px;
  height: 16px;
  border: 2px solid rgba(6, 16, 12, 0.28);
  border-top-color: #06100c;
  border-radius: 999px;
  animation: button-spin 760ms linear infinite;
}

.button.secondary.is-loading::before,
.button.ghost.is-loading::before {
  border-color: rgba(245, 248, 252, 0.25);
  border-top-color: var(--ink);
}

@keyframes button-spin {
  to { transform: rotate(360deg); }
}

.version-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 26px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--green);
  background: rgba(35, 201, 141, 0.08);
  font-size: 0.78rem;
  font-weight: 900;
}

.sidebar-version {
  margin-top: auto;
}

.sidebar-version + .ghost {
  margin-top: 0;
}

.quick-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.quick-grid a {
  display: grid;
  gap: 8px;
  min-height: 120px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.055);
}

.quick-grid strong {
  color: var(--ink);
  font-size: 1.05rem;
}

.quick-grid span {
  color: var(--muted);
}

@media (max-width: 900px) {
  .quick-grid {
    grid-template-columns: 1fr;
  }
}
