:root {
  color-scheme: dark;
  --bg: #0b0f14;
  --panel: #1a2028;
  --panel-2: #252e39;
  --line: #36414e;
  --text: #f4f5f7;
  --muted: #aab3c0;
  --accent: #b8ff5c;
  --accent-ink: #152000;
  --danger: #ff6b74;
  --warning: #ffc45f;
  --radius: 18px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: radial-gradient(circle at 75% -20%, #1d2921 0, var(--bg) 38%); color: var(--text); min-height: 100vh; }
a { color: var(--accent); text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; border-right: 1px solid var(--line); padding: 28px 18px; display: flex; flex-direction: column; background: rgba(11,15,20,.95); backdrop-filter: blur(18px); }
.brand { color: var(--text); display: flex; align-items: center; gap: 12px; padding: 0 10px 30px; }
.brand span:last-child { display: flex; flex-direction: column; line-height: 1.05; }
.brand small { color: var(--muted); margin-top: 4px; letter-spacing: .16em; text-transform: uppercase; font-size: 9px; }
.brand-mark { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: var(--accent); color: var(--accent-ink); font-weight: 900; letter-spacing: -.06em; box-shadow: 0 0 34px rgba(184,255,92,.16); }
.brand-mark.large { width: 56px; height: 56px; border-radius: 17px; margin: 0 auto; }
nav { display: grid; gap: 5px; }
.nav-link { color: #b7bcc6; padding: 11px 13px; border-radius: 11px; font-size: 14px; transition: .18s ease; }
.nav-link:hover { background: var(--panel); color: var(--text); }
.nav-link.active { color: var(--text); background: linear-gradient(90deg, #2b3529, #202821); box-shadow: inset 3px 0 var(--accent); }
.sidebar-foot { margin-top: auto; padding: 18px 10px 0; color: var(--muted); font-size: 11px; border-top: 1px solid var(--line); }
.sidebar-foot form { margin-top: 10px; }
.status-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px var(--accent); margin-right: 6px; }
.main { min-width: 0; padding: 44px clamp(24px, 5vw, 78px) 80px; }
.page-head { display: flex; justify-content: space-between; gap: 28px; align-items: flex-end; margin-bottom: 34px; }
.page-head h1 { max-width: 820px; font-size: clamp(31px, 4vw, 56px); line-height: 1.02; letter-spacing: -.045em; margin: 7px 0 12px; }
.page-head p { color: var(--muted); max-width: 720px; margin: 0; line-height: 1.55; }
.eyebrow { color: var(--accent); font-size: 11px; font-weight: 750; letter-spacing: .16em; text-transform: uppercase; }
h2 { margin: 7px 0 16px; font-size: 23px; letter-spacing: -.025em; }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 22px; }
.stat, .panel { border: 1px solid var(--line); background: linear-gradient(145deg, rgba(31,38,48,.98), rgba(24,30,38,.98)); border-radius: var(--radius); box-shadow: 0 24px 70px rgba(0,0,0,.22); }
.stat { padding: 21px; display: flex; flex-direction: column; min-height: 138px; }
.stat span { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
.stat strong { font-size: 42px; letter-spacing: -.05em; margin: auto 0 2px; }
.stat small { color: var(--muted); }
.panel { padding: 24px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.settings-grid { margin-bottom: 18px; }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.account-row, .compact-row { display: flex; align-items: center; gap: 13px; border-top: 1px solid var(--line); padding: 15px 0; }
.account-row img, .avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; background: var(--panel-2); display: grid; place-items: center; }
.account-row div, .compact-row div { min-width: 0; flex: 1; }
.account-row form { margin: 0; }
.account-row strong, .account-row small, .compact-row strong, .compact-row small { display: block; }
.account-row small, .compact-row small { color: var(--muted); margin-top: 4px; }
.compact-row strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13px; }
.badge { display: inline-flex; width: max-content; padding: 5px 9px; border-radius: 99px; color: #c9cdd5; background: #262a32; font-size: 10px; font-weight: 750; text-transform: uppercase; letter-spacing: .06em; }
.badge.success, .badge.published, .badge.responded { color: #cfff94; background: #22351d; }
.badge.queued, .badge.drafted { color: #aad9ff; background: #1c3040; }
.badge.failed, .badge.needs_review { color: #ff9ca2; background: #3a2024; }
.badge.draft, .badge.new { color: #ffe0a7; background: #392f1f; }
.badge.canceled, .badge.deleted, .badge.ignored, .badge.hidden { color: #aeb4bf; background: #292c33; }
.button { display: inline-flex; align-items: center; justify-content: center; border: 1px solid #3a3f49; border-radius: 11px; background: #202329; color: var(--text); min-height: 42px; padding: 0 15px; font-weight: 700; font-size: 13px; transition: .15s ease; }
.button:hover { transform: translateY(-1px); border-color: #555c68; }
.button.primary { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }
.button.small { min-height: 32px; padding: 0 10px; font-size: 11px; }
.button.wide { width: 100%; }
.text-button { padding: 0; border: 0; background: transparent; color: var(--muted); font-size: 12px; }
.text-button:hover { color: var(--text); }
.text-button.danger { color: var(--danger); }
.flash { position: relative; margin: 0 0 18px; padding: 13px 16px; border-radius: 12px; background: #24351f; color: #d7ffab; border: 1px solid #38532f; }
.flash.error { background: #3a2024; color: #ffb5ba; border-color: #5b2b32; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.span-2 { grid-column: 1 / -1; }
label { display: flex; flex-direction: column; gap: 8px; color: #c9cdd5; font-size: 12px; font-weight: 650; }
input, select, textarea { width: 100%; border: 1px solid #586677; border-radius: 11px; background: #2a3440; color: var(--text); padding: 12px 13px; outline: none; transition: .15s ease; }
input:hover, select:hover, textarea:hover { border-color: #687587; }
input:focus, select:focus, textarea:focus { border-color: #9dce55; box-shadow: 0 0 0 3px rgba(184,255,92,.13); }
textarea { resize: vertical; line-height: 1.55; }
.counter { align-self: flex-end; color: var(--muted); font-weight: 400; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }
.align-end { align-items: flex-end; justify-content: flex-end; }
.table-wrap { overflow-x: auto; padding: 5px 20px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { color: var(--muted); text-transform: uppercase; letter-spacing: .08em; font-size: 10px; text-align: left; padding: 16px 10px; }
td { border-top: 1px solid var(--line); padding: 16px 10px; vertical-align: top; }
td > strong, td > small, td > a { display: block; max-width: 520px; }
td > small, td > a { margin-top: 7px; }
.table-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; min-width: 180px; }
.empty { text-align: center; padding: 28px; color: var(--muted); }
.empty strong { color: var(--text); }
.reply-list { display: grid; gap: 14px; max-width: 960px; }
.reply-card blockquote { border-left: 3px solid var(--accent); margin: 18px 0; padding: 5px 0 5px 17px; font-size: 17px; line-height: 1.5; }
.reply-meta { display: flex; align-items: center; gap: 10px; }
.reply-meta time { margin-left: auto; color: var(--muted); font-size: 11px; }
.answer-form { display: grid; gap: 8px; margin-top: 14px; }
.answer-form .button { justify-self: end; }
.inline-form { display: flex; gap: 14px; align-items: center; margin-top: 12px; }
.result-panel { margin-top: 18px; }
.result-panel pre { white-space: pre-wrap; background: #202a35; border: 1px solid var(--line); border-radius: 12px; padding: 18px; line-height: 1.55; max-height: 520px; overflow: auto; }
code { font-family: "Cascadia Code", ui-monospace, monospace; font-size: .9em; color: #d8ffab; word-break: break-all; }
.status-list { margin: 0; }
.status-list > div { display: flex; justify-content: space-between; gap: 20px; padding: 12px 0; border-top: 1px solid var(--line); }
.status-list dt { color: var(--muted); }
.status-list dd { margin: 0; text-align: right; max-width: 65%; }
.toggle { flex-direction: row; align-items: flex-start; border: 1px solid var(--line); border-radius: 13px; padding: 15px; cursor: pointer; }
.toggle input { width: auto; margin-top: 4px; }
.toggle div { display: flex; flex-direction: column; gap: 4px; }
.toggle small, .hint { color: var(--muted); line-height: 1.5; }
.error-text { color: var(--danger) !important; }
.success-text { color: var(--accent); }
.login-body { display: grid; place-items: center; padding: 24px; }
.login-card { width: min(420px, 100%); padding: 34px; border: 1px solid var(--line); border-radius: 24px; background: linear-gradient(145deg, #202a35, #1a2028); text-align: center; box-shadow: 0 40px 100px rgba(0,0,0,.4); }
.login-card h1 { margin: 18px 0 7px; }
.login-card p { color: var(--muted); margin: 0 0 24px; }
.login-card label { text-align: left; margin-bottom: 15px; }
@media (max-width: 1000px) { .stats-grid { grid-template-columns: repeat(2, 1fr); } .two-col { grid-template-columns: 1fr; } }
@media (max-width: 760px) {
  .shell { display: block; }
  .sidebar { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--line); padding: 16px; }
  .brand { padding-bottom: 15px; }
  nav { display: flex; overflow-x: auto; padding-bottom: 4px; }
  .nav-link { white-space: nowrap; }
  .sidebar-foot { display: none; }
  .main { padding: 28px 16px 60px; }
  .page-head { align-items: flex-start; flex-direction: column; }
  .page-head h1 { font-size: 36px; }
  .form-grid, .stats-grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
}
