/* ==========================================================================
   Webneuron Admin — design system
   ========================================================================== */

:root {
  --bg: #f4f6fb;
  --surface: #ffffff;
  --surface-2: #f8f9fd;
  --border: #e6e9f2;
  --border-strong: #d5dae8;

  --ink: #16192c;
  --ink-2: #4b5268;
  --muted: #8a91a5;

  --accent: #4f46e5;
  --accent-2: #7c3aed;
  --accent-soft: #eef0ff;
  --accent-grad: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);

  --danger: #dc2626;
  --danger-soft: #fef2f2;
  --success: #059669;
  --success-soft: #ecfdf5;
  --warn: #b45309;
  --warn-soft: #fef9c3;

  --sidebar-bg: #10142a;
  --sidebar-ink: #a3aac4;

  --r-lg: 16px;
  --r-md: 12px;
  --r-sm: 9px;

  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow-md: 0 1px 3px rgba(16, 24, 40, 0.05), 0 12px 32px -16px rgba(16, 24, 40, 0.14);
  --shadow-pop: 0 4px 6px -2px rgba(79, 70, 229, 0.18), 0 12px 24px -8px rgba(79, 70, 229, 0.28);

  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: none; }

code {
  font-family: var(--mono);
  font-size: 0.86em;
  background: var(--accent-soft);
  color: var(--accent);
  padding: 1px 6px;
  border-radius: 5px;
}

.icn { vertical-align: -3px; flex-shrink: 0; }

/* ==========================================================================
   App shell
   ========================================================================== */

.app { display: flex; min-height: 100vh; }

.main-wrap { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.main {
  flex: 1;
  width: 100%;
  max-width: 1060px;
  padding: 30px 42px 64px;
}

/* --- Sidebar ------------------------------------------------------------ */

.sidebar {
  width: 256px;
  flex-shrink: 0;
  background: var(--sidebar-bg);
  background-image: radial-gradient(1200px 400px at -30% -10%, rgba(124, 58, 237, 0.22), transparent 60%),
    radial-gradient(800px 500px at 130% 110%, rgba(79, 70, 229, 0.16), transparent 55%);
  color: var(--sidebar-ink);
  padding: 22px 14px 18px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 2px 8px 20px;
}

.logo-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--accent-grad);
  color: #fff;
  font-weight: 700;
  font-size: 17px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 16px -6px rgba(124, 58, 237, 0.7);
  letter-spacing: -0.02em;
}

.brand { font-weight: 600; font-size: 15px; color: #fff; letter-spacing: -0.01em; line-height: 1.2; }
.brand-sub { font-size: 11px; color: #6d7490; margin-top: 1px; }

.sidebar nav { flex: 1; }

.sidebar nav a {
  display: flex;
  align-items: center;
  gap: 11px;
  color: var(--sidebar-ink);
  padding: 8px 11px;
  border-radius: var(--r-sm);
  font-size: 13.5px;
  font-weight: 500;
  margin-bottom: 2px;
  transition: background 0.15s, color 0.15s;
}

.sidebar nav a .icn { opacity: 0.75; }

.sidebar nav a:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #e8eaf5;
}

.sidebar nav a.active {
  background: var(--accent-grad);
  color: #fff;
  box-shadow: 0 6px 18px -8px rgba(99, 82, 235, 0.9);
}

.sidebar nav a.active .icn { opacity: 1; }

.sidebar .section-label {
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #565d7a;
  margin: 20px 11px 7px;
}

.sidebar-foot {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.sidebar-foot form { margin: 0; }

.logout-btn {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  background: none;
  border: none;
  color: var(--sidebar-ink);
  padding: 9px 11px;
  border-radius: var(--r-sm);
  font-size: 13.5px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.logout-btn:hover { background: rgba(220, 38, 38, 0.14); color: #fca5a5; }

/* --- Topbar ------------------------------------------------------------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 42px;
  background: rgba(244, 246, 251, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.hamburger {
  display: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 7px 9px;
  cursor: pointer;
  color: var(--ink);
}

.crumb { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 8px; min-width: 0; }
.crumb .sep { color: var(--border-strong); }
.crumb strong { color: var(--ink); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--ink-2);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 12px 5px 5px;
}

.user-chip .avatar {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: var(--accent-grad);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ==========================================================================
   Typography / page headers
   ========================================================================== */

h1 { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; margin: 0 0 4px; }
h2 { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; margin: 0 0 12px; }
.page-sub { color: var(--muted); margin: 0 0 26px; font-size: 13.5px; max-width: 640px; }

.page-head { margin-bottom: 26px; }
.page-head .page-sub { margin-bottom: 0; }

.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}

/* ==========================================================================
   Cards
   ========================================================================== */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 26px;
  margin-bottom: 22px;
  box-shadow: var(--shadow-sm);
}

.card.flush { padding: 0; overflow: hidden; }

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}
.card-head h2 { margin: 0; }
.card-head .hint-inline { font-size: 12.5px; color: var(--muted); }

/* --- Dashboard stat grid ------------------------------------------------ */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
  gap: 14px;
  margin-bottom: 28px;
}

.stat-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 18px;
  box-shadow: var(--shadow-sm);
  color: var(--ink);
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}

.stat-card:hover {
  border-color: #c7cdf6;
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.stat-card .stat-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-card .stat-count { font-size: 21px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; }
.stat-card .stat-label { font-size: 12.5px; color: var(--muted); font-weight: 500; }

.quick-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.quick-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

.quick-card p { margin: 0 0 14px; color: var(--muted); font-size: 13px; }
.quick-card .quick-icon {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
}
.quick-card .quick-icon.indigo { background: var(--accent-soft); color: var(--accent); }
.quick-card .quick-icon.green { background: var(--success-soft); color: var(--success); }
.quick-card h2 { margin-bottom: 2px; }
.quick-card .btn { margin-top: auto; }

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--accent-grad);
  color: #fff;
  border: none;
  padding: 9px 18px;
  border-radius: var(--r-sm);
  font-size: 13.5px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  line-height: 1.4;
  transition: box-shadow 0.15s, transform 0.15s, background 0.15s, border-color 0.15s;
  box-shadow: 0 1px 2px rgba(79, 70, 229, 0.35);
}

.btn:hover { box-shadow: var(--shadow-pop); transform: translateY(-1px); color: #fff; }
.btn:active { transform: translateY(0); box-shadow: none; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; box-shadow: none; }

.btn.secondary {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-sm);
}
.btn.secondary:hover { background: var(--surface-2); border-color: #c1c8dd; box-shadow: var(--shadow-sm); }

.btn.ghost {
  background: transparent;
  color: var(--ink-2);
  border: 1px solid transparent;
  box-shadow: none;
}
.btn.ghost:hover { background: var(--surface); border-color: var(--border); color: var(--ink); box-shadow: var(--shadow-sm); transform: none; }

.btn.danger {
  background: var(--surface);
  color: var(--danger);
  border: 1px solid #f3c6c6;
  box-shadow: var(--shadow-sm);
}
.btn.danger:hover { background: var(--danger-soft); border-color: #efb0b0; box-shadow: var(--shadow-sm); }

.btn.small { padding: 6px 12px; font-size: 12.5px; border-radius: 8px; gap: 6px; }

/* ==========================================================================
   Tables
   ========================================================================== */

.table-wrap { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; }

table th,
table td {
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 13.5px;
  vertical-align: middle;
}

table th {
  color: var(--muted);
  font-weight: 600;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

table tr:last-child td { border-bottom: none; }
tbody tr { transition: background 0.12s; }
tbody tr:hover { background: var(--surface-2); }

table td.actions { text-align: right; white-space: nowrap; }
table td.actions form { display: inline-block; margin-left: 6px; }

.cell-title { font-weight: 600; color: var(--ink); }

.pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 500;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--ink-2);
  white-space: nowrap;
}

.count-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: var(--accent-soft);
  color: var(--accent);
}

/* --- List toolbar / search ---------------------------------------------- */

.search-box {
  position: relative;
  min-width: 230px;
}

.search-box .icn {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}

.search-box input {
  width: 100%;
  padding: 8px 12px 8px 36px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  font-size: 13px;
  font-family: inherit;
  background: var(--surface);
  color: var(--ink);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.search-box input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.13);
}

.empty-state {
  text-align: center;
  padding: 52px 24px;
  color: var(--muted);
}

.empty-state .empty-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
}

.empty-state h3 { margin: 0 0 4px; font-size: 15px; color: var(--ink); }
.empty-state p { margin: 0 0 18px; font-size: 13px; }

/* ==========================================================================
   Alerts
   ========================================================================== */

.alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--r-md);
  font-size: 13.5px;
  font-weight: 500;
  margin-bottom: 18px;
  border: 1px solid;
}

.alert .icn { margin-top: 1px; }

.alert.success { background: var(--success-soft); color: #047857; border-color: #a7f3d0; }
.alert.error { background: var(--danger-soft); color: #b91c1c; border-color: #fecaca; }
.alert.info { background: var(--accent-soft); color: #4338ca; border-color: #c7d2fe; }

/* ==========================================================================
   Forms
   ========================================================================== */

.field { margin-bottom: 22px; }
.field:last-child { margin-bottom: 0; }

.field > label,
.field .field-label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  font-size: 13px;
  color: var(--ink);
}

.field .hint { color: var(--muted); font-size: 12.5px; margin-top: 6px; line-height: 1.5; }

.field input[type="text"],
.field input[type="password"],
.field input:not([type]),
.field select,
.field textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  font-size: 13.5px;
  font-family: inherit;
  background: var(--surface);
  color: var(--ink);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.13);
}

.field select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%238a91a5' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.field textarea { resize: vertical; min-height: 84px; line-height: 1.55; }

.field textarea.mono {
  font-family: var(--mono);
  font-size: 12.5px;
  min-height: 180px;
  line-height: 1.6;
  background: var(--surface-2);
}

.field .fixed-value {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-2);
}

.sub-label {
  display: block;
  font-weight: 500;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 4px;
}

/* --- Repeater & object groups ------------------------------------------- */

.object-fields {
  display: grid;
  gap: 12px;
  padding: 16px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
}

.repeater-rows { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }

.repeater-row {
  position: relative;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 16px;
  padding-right: 44px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  transition: border-color 0.15s;
}

.repeater-row:hover { border-color: var(--border-strong); }
.repeater-row > div { flex: 1; min-width: 0; }
.repeater-row input,
.repeater-row textarea { background: var(--surface); }
.repeater-row textarea { min-height: 64px; }

.repeater-row .remove-row {
  position: absolute;
  top: 10px;
  right: 10px;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--muted);
  cursor: pointer;
  padding: 0;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.repeater-row .remove-row:hover {
  color: var(--danger);
  border-color: #f3c6c6;
  background: var(--danger-soft);
}

/* --- Sticky form action bar ---------------------------------------------- */

.form-actions {
  position: sticky;
  bottom: 0;
  z-index: 20;
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 8px;
  padding: 14px 0;
  background: linear-gradient(to top, var(--bg) 72%, rgba(244, 246, 251, 0));
}

/* ==========================================================================
   Login
   ========================================================================== */

.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--sidebar-bg);
  background-image: radial-gradient(900px 480px at 15% 0%, rgba(124, 58, 237, 0.35), transparent 55%),
    radial-gradient(800px 500px at 90% 100%, rgba(79, 70, 229, 0.3), transparent 55%),
    radial-gradient(600px 300px at 60% 40%, rgba(56, 189, 248, 0.12), transparent 60%);
}

.login-card {
  width: 100%;
  max-width: 384px;
  background: var(--surface);
  border-radius: 20px;
  padding: 38px 34px 34px;
  box-shadow: 0 24px 64px -16px rgba(2, 6, 23, 0.55);
}

.login-card .logo-mark { width: 44px; height: 44px; border-radius: 12px; font-size: 20px; margin-bottom: 18px; }
.login-card h1 { font-size: 20px; margin-bottom: 4px; }
.login-card .page-sub { margin-bottom: 24px; }
.login-card .btn { width: 100%; padding: 11px 18px; margin-top: 6px; }
.login-foot { text-align: center; margin-top: 22px; font-size: 12px; color: var(--muted); }

/* ==========================================================================
   Build page
   ========================================================================== */

.build-status-row { display: flex; align-items: center; gap: 12px; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.badge .dot { width: 7px; height: 7px; border-radius: 999px; background: currentColor; }

.badge.running { background: var(--warn-soft); color: var(--warn); }
.badge.running .dot { animation: pulse 1.1s ease-in-out infinite; }
.badge.ok { background: var(--success-soft); color: var(--success); }
.badge.fail { background: var(--danger-soft); color: var(--danger); }
.badge.idle { background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.35; transform: scale(0.75); }
}

.terminal {
  border-radius: var(--r-md);
  overflow: hidden;
  border: 1px solid #1c2138;
  box-shadow: var(--shadow-md);
}

.terminal-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #171b30;
  padding: 10px 14px;
  border-bottom: 1px solid #232945;
}

.terminal-bar .t-dot { width: 10px; height: 10px; border-radius: 999px; }
.terminal-bar .t-dot.red { background: #f87171; }
.terminal-bar .t-dot.yellow { background: #fbbf24; }
.terminal-bar .t-dot.green { background: #34d399; }
.terminal-bar .t-title { margin-left: 8px; font-size: 11.5px; color: #6d7490; font-family: var(--mono); }

pre.log {
  margin: 0;
  background: #0d1021;
  color: #c7f9e5;
  padding: 18px;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.65;
  max-height: 440px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.steps { margin: 0; padding-left: 0; list-style: none; counter-reset: step; }
.steps li {
  counter-increment: step;
  position: relative;
  padding: 0 0 14px 40px;
  font-size: 13.5px;
  color: var(--ink-2);
}
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: -1px;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.steps li:last-child { padding-bottom: 0; }

/* ==========================================================================
   Inbox
   ========================================================================== */

.nav-badge {
  margin-left: auto;
  background: var(--accent-grad);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  border-radius: 999px;
  padding: 1px 8px;
  min-width: 20px;
  text-align: center;
}

tr.row-unread td { background: var(--accent-soft); }
tr.row-unread .cell-title { font-weight: 700; }
tr.row-unread:hover td { background: #e5e8ff; }

.cell-sub { font-size: 12px; color: var(--muted); }
.cell-preview { color: var(--ink-2); max-width: 320px; }

.filter-select {
  padding: 7px 32px 7px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  font-size: 12.5px;
  font-family: inherit;
  background: var(--surface);
  color: var(--ink);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%238a91a5' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  text-transform: capitalize;
}

.detail-grid { display: grid; gap: 0; }
.detail-row {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13.5px;
}
.detail-row:last-child { border-bottom: none; }
.detail-label { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }

.message-box {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 16px 18px;
  font-size: 13.5px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ==========================================================================
   Branding page
   ========================================================================== */

.logo-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 110px;
  padding: 22px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
}

.logo-preview.on-dark {
  background: var(--sidebar-bg);
  background-image: radial-gradient(500px 200px at 20% 0%, rgba(124, 58, 237, 0.25), transparent 60%);
  border-color: #232945;
}

.logo-preview.on-light {
  background: #fff;
  background-image: linear-gradient(45deg, #f1f3f9 25%, transparent 25%, transparent 75%, #f1f3f9 75%),
    linear-gradient(45deg, #f1f3f9 25%, transparent 25%, transparent 75%, #f1f3f9 75%);
  background-size: 18px 18px;
  background-position: 0 0, 9px 9px;
}

.logo-preview img { max-height: 56px; max-width: 100%; }
.logo-missing { color: var(--muted); font-size: 12.5px; }

.upload-form { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

.upload-form input[type="file"] {
  flex: 1;
  min-width: 200px;
  font-size: 12.5px;
  color: var(--ink-2);
  font-family: inherit;
}

.upload-form input[type="file"]::file-selector-button {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 12.5px;
  font-weight: 600;
  font-family: inherit;
  color: var(--ink);
  cursor: pointer;
  margin-right: 10px;
  transition: background 0.15s;
}

.upload-form input[type="file"]::file-selector-button:hover { background: var(--surface-2); }

/* ==========================================================================
   JSON editor helpers (nav page)
   ========================================================================== */

.json-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.json-status { font-size: 12.5px; font-weight: 500; }
.json-status.ok { color: var(--success); }
.json-status.bad { color: var(--danger); }

/* ==========================================================================
   Misc / responsive
   ========================================================================== */

.notfound {
  text-align: center;
  padding: 90px 20px;
}
.notfound .code {
  font-size: 64px;
  font-weight: 800;
  letter-spacing: -0.04em;
  background: var(--accent-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  line-height: 1;
  margin-bottom: 10px;
}

.sidebar-scrim {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(9, 12, 26, 0.55);
  z-index: 40;
}

@media (max-width: 900px) {
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 50;
    transform: translateX(-102%);
    transition: transform 0.22s ease;
    box-shadow: 0 0 60px rgba(2, 6, 23, 0.5);
  }
  body.sidebar-open .sidebar { transform: translateX(0); }
  body.sidebar-open .sidebar-scrim { display: block; }
  .hamburger { display: inline-flex; align-items: center; }
  .topbar { padding: 11px 18px; }
  .main { padding: 22px 18px 56px; }
  .quick-grid { grid-template-columns: 1fr; }
  .user-chip span { display: none; }
  .user-chip { padding-right: 5px; }
  .repeater-row { flex-direction: column; gap: 10px; }
}
