/* Boost Empire admin — red / black / silver */

:root {
  --bg: #08080a;
  --surface: #101014;
  --surface-2: #16161c;
  --border: #232329;
  --border-strong: #33333c;
  --red: #e02d3c;
  --red-hover: #ff4655;
  --red-dim: rgba(224, 45, 60, 0.12);
  --text: #e6e6ea;
  --muted: #8d8d97;
  --silver: #c5c5cf;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --display: "Space Grotesk", sans-serif;
  --body: "Inter", system-ui, sans-serif;
  --radius: 10px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

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

.hidden { display: none !important; }

/* ---------- wordmark ---------- */
.wordmark {
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: 0.06em;
  font-size: 18px;
  color: var(--silver);
}
.wm-sep { color: var(--red); padding: 0 2px; }

/* ---------- login ---------- */
.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background:
    radial-gradient(ellipse 60% 40% at 50% 0%, rgba(224,45,60,0.07), transparent),
    var(--bg);
  padding: 24px;
}
.login-card {
  width: 100%;
  max-width: 360px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 2px solid var(--red);
  border-radius: var(--radius);
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.login-sub {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  margin-top: -10px;
}
.login-error { color: var(--red-hover); font-size: 13px; min-height: 18px; }

/* ---------- app shell ---------- */
.app {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: 100vh;
}

.sidebar {
  border-right: 1px solid var(--border);
  background: var(--surface);
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  position: sticky;
  top: 0;
  height: 100vh;
  box-shadow: 1px 0 0 rgba(0,0,0,.25);
}
.wordmark-side { font-size: 15px; }
.sidebar-tag {
  font-size: 10.5px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  margin-top: 4px;
}

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  text-decoration: none;
  padding: 9px 12px;
  border-radius: 8px;
  border-left: 2px solid transparent;
  font-weight: 500;
  transition: color .15s, background .15s;
}
.nav-icon { width: 17px; height: 17px; flex-shrink: 0; opacity: .85; }
.nav-link:hover { color: var(--text); background: var(--surface-2); }
.nav-link.active {
  color: var(--text);
  background: var(--red-dim);
  border-left-color: var(--red);
}
.nav-link.active .nav-icon { color: var(--red-hover); opacity: 1; }

.sidebar-foot {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-top: 1px solid var(--border);
  padding-top: 14px;
}
.whoami { color: var(--muted); font-size: 12px; font-family: var(--mono); }

.main { padding: 32px 36px; max-width: 1100px; width: 100%; }

.eyebrow {
  font-size: 11px;
  font-weight: 600;
  color: var(--red-hover);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  margin-bottom: 8px;
}
.page-title {
  font-family: var(--display);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0.01em;
  margin-bottom: 4px;
}
.page-sub { color: var(--muted); margin-bottom: 26px; }

.page-head-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

/* ---------- cards / stats ---------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 28px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: 0 1px 2px rgba(0,0,0,.3), 0 0 0 1px rgba(255,255,255,.02) inset;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.stat-label {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 6px;
}
.stat-value {
  font-family: var(--mono);
  font-size: 26px;
  font-weight: 600;
  color: var(--silver);
}
.stat-value .unit { font-size: 14px; color: var(--muted); }
.stat-icon {
  width: 34px; height: 34px;
  flex-shrink: 0;
  display: grid; place-items: center;
  border-radius: 9px;
  background: var(--red-dim);
  color: var(--red-hover);
}
.stat-icon svg { width: 17px; height: 17px; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 18px;
  box-shadow: 0 1px 2px rgba(0,0,0,.3);
}
.card h3 {
  font-family: var(--display);
  font-size: 15px;
  margin-bottom: 14px;
  color: var(--silver);
}

/* ---------- buttons ---------- */
.btn {
  font-family: var(--body);
  font-size: 13px;
  font-weight: 600;
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  color: var(--text);
  border-radius: 8px;
  padding: 9px 16px;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.btn:hover { border-color: var(--muted); }
.btn:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
.btn-primary {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}
.btn-primary:hover { background: var(--red-hover); border-color: var(--red-hover); }
.btn-danger { color: var(--red-hover); border-color: rgba(224,45,60,.4); background: transparent; }
.btn-danger:hover { background: var(--red-dim); border-color: var(--red); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { color: var(--text); border-color: transparent; background: var(--surface-2); }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-icon { display: inline-flex; align-items: center; gap: 6px; }
.btn-icon svg { width: 14px; height: 14px; flex-shrink: 0; }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span {
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
}
input[type="text"], input[type="password"], input[type="number"], input[type="url"],
textarea, select {
  background: var(--bg);
  border: 1px solid var(--border-strong);
  color: var(--text);
  border-radius: 8px;
  padding: 9px 12px;
  font-family: var(--body);
  font-size: 14px;
  width: 100%;
}
textarea { resize: vertical; min-height: 90px; }
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--red);
}
input[type="color"] {
  width: 42px; height: 34px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--bg);
  padding: 3px;
  cursor: pointer;
}
input[type="checkbox"] { accent-color: var(--red); width: 16px; height: 16px; }

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.form-grid .span-2 { grid-column: span 2; }
.check-row { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text); }
.form-actions {
  display: flex; justify-content: flex-end; gap: 10px;
  margin-top: 18px;
}

/* ---------- table ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 1px 2px rgba(0,0,0,.3); }
table { width: 100%; border-collapse: collapse; background: var(--surface); }
th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
}
td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--surface-2); }
.td-mono { font-family: var(--mono); font-size: 13px; color: var(--silver); }
.td-actions { text-align: right; white-space: nowrap; }

.badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 99px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.badge-active { background: rgba(53,199,89,.12); color: #4ade80; }
.badge-draft { background: rgba(141,141,151,.14); color: var(--muted); }
.badge-archived { background: var(--red-dim); color: var(--red-hover); }

.toolbar {
  display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap;
}
.toolbar input[type="text"] { max-width: 260px; }
.toolbar select { width: auto; }

.empty {
  text-align: center;
  color: var(--muted);
  padding: 48px 20px;
}
.empty strong { color: var(--silver); display: block; margin-bottom: 6px; }

/* ---------- theme editor ---------- */
.theme-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 18px;
  align-items: start;
}
.color-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.color-row:last-child { border-bottom: none; }
.color-row label { flex: 1; font-size: 13px; color: var(--text); }
.color-row .hex { font-family: var(--mono); font-size: 12px; color: var(--muted); width: 76px; }

.preview {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  position: sticky;
  top: 24px;
}
.preview-label {
  font-size: 11px; text-transform: uppercase; letter-spacing: .12em;
  color: var(--muted); padding: 10px 14px;
  background: var(--surface); border-bottom: 1px solid var(--border);
}

/* ---------- components ---------- */
.comp-item {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 10px;
}
.comp-item.disabled { opacity: .55; }
.comp-type {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--red-hover);
  background: var(--red-dim);
  padding: 3px 8px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.comp-label { font-weight: 600; flex: 1; }
.comp-order { display: flex; flex-direction: column; gap: 2px; }
.comp-order .btn { padding: 1px 8px; line-height: 1.2; }

/* ---------- modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(4,4,6,.75);
  display: grid; place-items: center;
  padding: 24px;
  z-index: 50;
}
.modal {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-top: 2px solid var(--red);
  border-radius: var(--radius);
  width: 100%;
  max-width: 620px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 50px rgba(0,0,0,.5);
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.modal-head h2 { font-family: var(--display); font-size: 17px; }
.modal-body { padding: 20px; overflow-y: auto; }

/* ---------- toast ---------- */
.toast {
  position: fixed;
  bottom: 24px; right: 24px;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-left: 3px solid var(--red);
  color: var(--text);
  padding: 12px 18px;
  border-radius: 8px;
  font-size: 13px;
  z-index: 60;
  animation: toast-in .18s ease-out;
}
.toast.ok { border-left-color: #4ade80; }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: static; height: auto;
    flex-direction: row; align-items: center;
    gap: 14px; padding: 12px 16px;
    border-right: none; border-bottom: 1px solid var(--border);
    overflow-x: auto;
  }
  .nav { flex-direction: row; }
  .sidebar-foot { margin: 0 0 0 auto; border: none; padding: 0; }
  .main { padding: 20px 16px; }
  .theme-layout { grid-template-columns: 1fr; }
  .preview { position: static; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: span 1; }
}
