:root {
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  color: #eef0f4;
  background: #0b0e13;
  font-synthesis: none;
  --bg: #0b0e13;
  --panel: #12171f;
  --panel-2: #171d27;
  --line: #252c38;
  --muted: #8c96a7;
  --gold: #f1c40f;
  --gold-light: #ffdc55;
  --green: #55d99a;
  --red: #ff7770;
  --blue: #79a8ff;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; min-height: 100vh; background: radial-gradient(circle at 80% -20%, #1e2532 0, transparent 35%), var(--bg); }
a { color: var(--gold-light); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, textarea, select { font: inherit; }
button, a, input, textarea, select { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 9px; font-size: clamp(28px, 4vw, 40px); letter-spacing: -1.3px; line-height: 1.1; }
h2 { margin-bottom: 15px; font-size: 17px; letter-spacing: -.25px; }
code { color: #d8c77e; font-family: "Cascadia Code", Consolas, monospace; font-size: 12px; overflow-wrap: anywhere; }
pre { max-width: 480px; white-space: pre-wrap; overflow-wrap: anywhere; color: #b6bfcc; font-size: 11px; }
.layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; display: flex; flex-direction: column; height: 100vh; padding: 28px 20px 22px; border-right: 1px solid var(--line); background: rgba(13, 17, 23, .96); }
.brand { display: flex; align-items: center; gap: 12px; color: #f7f8fa; font-size: 19px; font-weight: 850; line-height: 1.05; text-decoration: none; }
.brand:hover { text-decoration: none; }
.brand small { color: var(--muted); font-size: 10px; font-weight: 500; letter-spacing: 1.1px; }
.brand-mark { display: grid; place-items: center; width: 42px; height: 42px; color: #181508; background: var(--gold); clip-path: polygon(13% 0, 100% 0, 87% 100%, 0 100%); font-style: italic; font-weight: 950; }
.nav { display: grid; gap: 5px; margin-top: 42px; }
.nav a { padding: 12px 14px; border: 1px solid transparent; border-radius: 9px; color: #a6afbd; font-size: 13px; font-weight: 650; text-decoration: none; }
.nav a:hover { color: #fff; background: #161c25; }
.nav a.active { border-color: #3d3720; color: var(--gold-light); background: #211f16; }
.sidebar-bottom { display: grid; gap: 15px; margin-top: auto; }
.bot-indicator { display: flex; align-items: center; gap: 8px; min-width: 0; color: #aeb7c4; font-size: 11px; overflow-wrap: anywhere; }
.dot { display: inline-block; flex: 0 0 auto; width: 8px; height: 8px; border-radius: 50%; }
.dot.ok { background: var(--green); box-shadow: 0 0 12px rgba(85,217,154,.5); }
.dot.bad { background: var(--red); }
.link-button { padding: 0; border: 0; color: #717c8d; background: none; cursor: pointer; text-align: left; font-size: 11px; }
.link-button:hover { color: #fff; }
.main { width: 100%; max-width: 1560px; padding: 38px clamp(22px, 3.3vw, 52px) 60px; overflow: hidden; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.page-head p { margin-bottom: 0; }
.eyebrow { margin-bottom: 10px; color: var(--gold); font-size: 10px; font-weight: 850; letter-spacing: 2px; }
.muted { color: var(--muted); line-height: 1.55; font-size: 13px; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 10px 15px; border: 1px solid var(--line); border-radius: 8px; color: #d6dce5; background: #171d26; cursor: pointer; font-size: 12px; font-weight: 700; text-decoration: none; white-space: nowrap; }
.button:hover { border-color: #3b4555; background: #1d2530; text-decoration: none; }
.button.primary { border-color: var(--gold); color: #181508; background: var(--gold); }
.button.primary:hover { background: var(--gold-light); }
.button.danger { border-color: #613532; color: #ff9a94; background: #2a1919; }
.button.small { min-height: 32px; padding: 7px 11px; font-size: 11px; }
.button.quiet { background: transparent; }
.cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; margin-bottom: 22px; }
.card { min-width: 0; padding: 20px; border: 1px solid var(--line); border-radius: 12px; background: linear-gradient(135deg, rgba(255,255,255,.02), transparent), var(--panel); }
.card > span { display: block; min-height: 32px; color: #99a4b4; font-size: 11px; line-height: 1.4; }
.card strong { display: block; margin: 8px 0 7px; font-size: 30px; letter-spacing: -1px; }
.card small { color: #687485; font-size: 10px; line-height: 1.45; }
.cards.compact .card > span { min-height: auto; }
.grid { display: grid; gap: 20px; margin-bottom: 20px; }
.two-columns { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); }
.settings-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.panel { min-width: 0; margin-bottom: 20px; padding: 22px; border: 1px solid var(--line); border-radius: 12px; background: rgba(18,23,31,.94); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 15px; }
.panel-head h2 { margin: 0; }
.panel-head > a, .panel-head > span { color: var(--muted); font-size: 11px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 12px; line-height: 1.5; }
th { padding: 10px 12px; border-bottom: 1px solid #313a48; color: #7e8999; text-align: left; font-size: 10px; font-weight: 750; letter-spacing: .4px; text-transform: uppercase; white-space: nowrap; }
td { padding: 13px 12px; border-bottom: 1px solid #202732; color: #c5cdd8; vertical-align: top; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: rgba(255,255,255,.012); }
.nowrap { white-space: nowrap; }
.empty { padding: 25px 10px; color: #727e8f; text-align: center; font-size: 12px; }
.alert { margin-bottom: 20px; padding: 14px 17px; border: 1px solid; border-radius: 9px; font-size: 12px; line-height: 1.55; }
.alert.success { border-color: #285440; color: #8ce5b8; background: #10251d; }
.alert.error { border-color: #653c38; color: #ffaaa5; background: #2a1818; }
.alert.warning { border-color: #5c4d25; color: #e9d28a; background: #272215; }
.alert a { color: inherit; text-decoration: underline; }
.tag { display: inline-flex; align-items: center; padding: 4px 8px; border: 1px solid #3a4050; border-radius: 999px; color: #abb5c3; background: #1b222c; font-size: 10px; white-space: nowrap; }
.tag.green, .tag.status-completed, .tag.status-sent { border-color: #285440; color: #78dcae; background: #12291f; }
.tag.red, .tag.status-blocked, .tag.status-failed, .tag.status-cancelled { border-color: #653c38; color: #ff9a94; background: #2a1818; }
.tag.status-running { border-color: #65561f; color: #efcf62; background: #2a2514; }
.message-list { display: grid; gap: 14px; }
.message-row { margin: 0; }
.message-row h2 { margin: 16px 0 10px; }
.message-meta { display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.message-meta > div { display: flex; align-items: center; gap: 10px; }
.message-preview { margin-bottom: 0; color: #c6cdd7; font-size: 13px; line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere; }
.message-buttons { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 16px; color: #747f90; font-size: 10px; }
.message-buttons span { padding: 5px 8px; border-radius: 5px; background: #191f28; }
.truncate { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.form-panel { max-width: 940px; }
.form-stack { display: grid; gap: 18px; }
.form-stack label, .filters label { display: grid; gap: 8px; color: #c3cbd6; font-size: 12px; font-weight: 650; }
label small { color: #758092; font-size: 10px; font-weight: 400; line-height: 1.5; }
input, textarea, select { width: 100%; border: 1px solid #303947; border-radius: 8px; color: #edf0f5; background: #0c1118; font-size: 13px; }
input, select { min-height: 43px; padding: 10px 12px; }
textarea { min-height: 130px; padding: 12px; line-height: 1.55; resize: vertical; }
input:focus, textarea:focus, select:focus { border-color: #9c842d; }
input[readonly] { color: #717d8d; background: #11151b; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.form-actions { display: flex; gap: 10px; padding-top: 4px; }
.danger-zone { margin-top: 25px; padding-top: 20px; border-top: 1px solid var(--line); }
.filters { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 12px; }
.filters label { min-width: 210px; flex: 1; }
.filters .button { margin-bottom: 1px; }
details { color: #9ca7b6; font-size: 11px; }
summary { color: var(--gold-light); cursor: pointer; }
progress { display: block; width: 100%; height: 13px; margin: 10px 0 15px; border: 0; border-radius: 999px; overflow: hidden; background: #222a35; accent-color: var(--gold); }
progress::-webkit-progress-bar { background: #222a35; }
progress::-webkit-progress-value { background: var(--gold); }
progress::-moz-progress-bar { background: var(--gold); }
.error-text { color: #e79893; overflow-wrap: anywhere; }
.bot-status-box { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 20px; padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: #0e131b; }
.bot-status-box .dot { margin-top: 5px; }
.bot-status-box p { margin: 5px 0 0; }
.login-page { display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 50% -10%, #302a16 0, transparent 40%), var(--bg); }
.login-shell { width: min(100%, 430px); }
.login-card { padding: 35px; border: 1px solid var(--line); border-radius: 16px; background: rgba(18,23,31,.96); box-shadow: 0 30px 100px rgba(0,0,0,.3); }
.login-brand { margin-bottom: 35px; }
.login-card h1 { font-size: 29px; }
.login-card .button { width: 100%; margin-top: 4px; }
.wide-form { max-width: 1100px; }
.button-editor { display: grid; gap: 15px; margin: 0; padding: 18px; border: 1px solid #303947; border-radius: 10px; background: #0e141c; }
.button-editor legend { padding: 0 8px; color: var(--gold-light); font-size: 13px; font-weight: 750; }
.help-box { padding: 15px 17px; border: 1px solid #4a4020; border-radius: 9px; color: #d8ca91; background: #211e13; }
.help-box p { margin: 6px 0 0; color: #a99f7d; font-size: 12px; line-height: 1.55; }
.separator { margin: 25px 0; border: 0; border-top: 1px solid var(--line); }
@media (max-width: 1180px) { .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } .two-columns, .settings-grid { grid-template-columns: 1fr; } }
@media (max-width: 780px) {
  .layout { display: block; }
  .sidebar { position: static; width: 100%; height: auto; padding: 18px; border-right: 0; border-bottom: 1px solid var(--line); }
  .nav { display: flex; gap: 5px; margin-top: 20px; overflow-x: auto; }
  .nav a { white-space: nowrap; }
  .sidebar-bottom { display: flex; align-items: center; justify-content: space-between; margin-top: 15px; }
  .main { padding: 25px 16px 45px; }
  .page-head { flex-direction: column; }
  .panel { padding: 17px; }
}
@media (max-width: 520px) { .cards { grid-template-columns: 1fr; } .form-grid { grid-template-columns: 1fr; } .login-card { padding: 25px; } .message-meta { align-items: flex-start; } }
