:root {
  color-scheme: dark;
  --bg: #06101c;
  --surface: rgba(13, 28, 45, .86);
  --surface-2: rgba(18, 38, 59, .9);
  --line: rgba(150, 184, 214, .14);
  --text: #eef7ff;
  --muted: #8fa9bf;
  --cyan: #36d6c8;
  --blue: #5b8cff;
  --green: #3ddc97;
  --yellow: #f5c45b;
  --red: #ff6577;
  --shadow: 0 24px 70px rgba(0, 0, 0, .32);
  --radius: 18px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; color: var(--text); background: radial-gradient(circle at 55% -10%, #143a54 0, transparent 42%), var(--bg); }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.ambient { position: fixed; width: 340px; height: 340px; border-radius: 50%; filter: blur(110px); opacity: .12; pointer-events: none; }
.ambient-one { background: #17d0bd; top: 20%; left: 20%; }
.ambient-two { background: #536eff; right: 5%; bottom: 0; }
.eyebrow { margin: 0 0 7px; color: var(--cyan); font-size: .68rem; letter-spacing: .16em; font-weight: 800; }
.muted { color: var(--muted); }
.tiny { font-size: .78rem; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: clamp(1.65rem, 3vw, 2.35rem); letter-spacing: -.045em; margin-bottom: 4px; }
h2 { font-size: 1.12rem; letter-spacing: -.02em; margin-bottom: 6px; }
.brand-mark { display: grid; place-items: center; width: 54px; height: 54px; border-radius: 16px; background: linear-gradient(135deg, var(--cyan), var(--blue)); color: #031019; font-weight: 900; box-shadow: 0 12px 40px rgba(54, 214, 200, .22); }
.brand-mark.small { width: 40px; height: 40px; border-radius: 12px; font-size: .82rem; flex: 0 0 auto; }
.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: min(430px, 100%); padding: 38px; border: 1px solid var(--line); border-radius: 26px; background: rgba(8, 21, 35, .84); backdrop-filter: blur(22px); box-shadow: var(--shadow); }
.login-card .brand-mark { margin-bottom: 28px; }
label { display: grid; gap: 8px; color: #c6d8e6; font-size: .82rem; font-weight: 650; }
input, textarea, select { width: 100%; color: var(--text); background: rgba(3, 12, 22, .66); border: 1px solid rgba(145, 180, 211, .2); border-radius: 11px; padding: 12px 13px; outline: none; transition: .2s ease; }
input:focus, textarea:focus, select:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(54, 214, 200, .1); }
.button { border: 1px solid transparent; border-radius: 11px; padding: 10px 15px; color: var(--text); font-weight: 750; transition: transform .18s ease, background .18s ease; }
.button:hover { transform: translateY(-1px); }
.button.primary { color: #041415; background: linear-gradient(135deg, #44e0d1, #61b6ff); box-shadow: 0 8px 30px rgba(54, 214, 200, .15); }
.button.secondary { background: rgba(78, 120, 160, .15); border-color: var(--line); }
.button.ghost { background: transparent; border-color: var(--line); color: #c7d9e6; }
.button.full { width: 100%; margin-top: 18px; }
.form-error { min-height: 18px; margin: 10px 0 0; color: #ff8391; font-size: .82rem; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 236px 1fr; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 25px 18px; border-right: 1px solid var(--line); background: rgba(4, 13, 23, .74); backdrop-filter: blur(20px); }
.brand { display: flex; align-items: center; gap: 11px; padding: 0 6px 31px; }
.brand strong, .brand small { display: block; }
.brand small { margin-top: 2px; color: var(--muted); font-size: .68rem; }
.nav { display: grid; gap: 6px; }
.nav-item { display: flex; gap: 11px; align-items: center; padding: 11px 13px; border: 0; border-radius: 11px; background: transparent; color: #849db3; text-align: left; font-weight: 700; }
.nav-item:hover, .nav-item.active { color: var(--text); background: rgba(81, 139, 183, .13); }
.nav-item.active { box-shadow: inset 3px 0 var(--cyan); }
.sidebar-foot { display: flex; align-items: center; gap: 10px; margin-top: auto; padding: 13px; border: 1px solid var(--line); border-radius: 13px; background: rgba(25, 48, 67, .3); }
.sidebar-foot strong, .sidebar-foot small { display: block; font-size: .72rem; }
.sidebar-foot small { margin-top: 3px; color: var(--muted); }
.pulse-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 5px rgba(61, 220, 151, .1); }
.main { width: 100%; min-width: 0; padding: 30px clamp(22px, 4vw, 54px) 54px; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 30px; }
.top-actions, .row-actions { display: flex; align-items: center; gap: 9px; }
.icon-button, .close-button { border: 1px solid var(--line); color: var(--text); background: rgba(18, 39, 58, .55); }
.icon-button { width: 41px; height: 41px; border-radius: 11px; font-size: 1.25rem; }
.summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px; }
.summary-card { position: relative; overflow: hidden; min-height: 128px; padding: 19px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: 0 16px 45px rgba(0,0,0,.12); }
.summary-card::after { content: ''; position: absolute; width: 78px; height: 78px; right: -24px; bottom: -28px; border-radius: 50%; background: var(--card-color); filter: blur(23px); opacity: .16; }
.summary-card .summary-label { display: flex; justify-content: space-between; color: var(--muted); font-size: .76rem; font-weight: 700; }
.summary-icon { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 9px; color: var(--card-color); background: color-mix(in srgb, var(--card-color) 12%, transparent); }
.summary-number { display: block; margin: 13px 0 3px; font-size: 1.82rem; line-height: 1; }
.summary-note { color: #7490a6; font-size: .7rem; }
.section-heading { display: flex; align-items: end; justify-content: space-between; margin: 31px 0 14px; }
.section-heading h2 { margin-bottom: 3px; }
.section-heading p { margin: 0; font-size: .78rem; }
.segmented { display: flex; padding: 3px; border: 1px solid var(--line); border-radius: 10px; background: rgba(9, 23, 37, .65); }
.segmented button { border: 0; border-radius: 7px; padding: 7px 11px; color: var(--muted); background: transparent; font-size: .72rem; font-weight: 700; }
.segmented button.active { color: var(--text); background: rgba(71, 123, 160, .23); }
.server-grid { display: grid; grid-template-columns: repeat(3, minmax(260px, 1fr)); gap: 15px; }
.server-card { position: relative; overflow: hidden; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); transition: transform .2s ease, border-color .2s ease; }
.server-card:hover { transform: translateY(-2px); border-color: rgba(90, 214, 202, .28); }
.server-top { display: flex; justify-content: space-between; gap: 12px; }
.server-title { display: flex; gap: 10px; align-items: center; min-width: 0; }
.server-title h3 { overflow: hidden; margin-bottom: 3px; font-size: .94rem; white-space: nowrap; text-overflow: ellipsis; }
.server-title p { margin: 0; color: var(--muted); font-size: .69rem; }
.status-orb { flex: 0 0 auto; width: 10px; height: 10px; border-radius: 50%; background: var(--status-color); box-shadow: 0 0 0 5px color-mix(in srgb, var(--status-color) 12%, transparent); }
.status-badge { padding: 5px 8px; border-radius: 999px; color: var(--status-color); background: color-mix(in srgb, var(--status-color) 10%, transparent); font-size: .62rem; font-weight: 850; letter-spacing: .06em; }
.resource-list { display: grid; gap: 13px; margin-top: 21px; }
.resource-row { display: grid; grid-template-columns: 39px 1fr auto; align-items: center; gap: 9px; }
.resource-row span, .resource-row strong { font-size: .68rem; }
.resource-row span { color: var(--muted); }
.resource-track { height: 5px; border-radius: 5px; background: rgba(125, 158, 185, .13); overflow: hidden; }
.resource-track i { display: block; height: 100%; width: var(--value); border-radius: inherit; background: var(--bar-color); }
.server-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 19px; padding-top: 13px; border-top: 1px solid var(--line); color: var(--muted); font-size: .68rem; }
.text-button { border: 0; color: var(--cyan); background: transparent; font-size: .68rem; font-weight: 750; }
.empty-state { padding: 60px 20px; border: 1px dashed var(--line); border-radius: var(--radius); text-align: center; color: var(--muted); }
.empty-icon { display: grid; place-items: center; width: 54px; height: 54px; margin: 0 auto 15px; border-radius: 17px; background: rgba(54, 214, 200, .1); color: var(--cyan); font-size: 1.5rem; }
.panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.panel-head { padding: 21px; border-bottom: 1px solid var(--line); }
.incident-list { min-height: 180px; }
.incident-row { display: grid; grid-template-columns: 12px 1fr auto; gap: 13px; align-items: center; padding: 16px 21px; border-bottom: 1px solid var(--line); }
.incident-row:last-child { border-bottom: 0; }
.incident-row p { margin: 3px 0 0; color: var(--muted); font-size: .74rem; }
.incident-row time { color: var(--muted); font-size: .7rem; }
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.settings-card { padding: 23px; }
.settings-icon { display: grid; place-items: center; width: 40px; height: 40px; margin-bottom: 18px; border-radius: 12px; color: var(--cyan); background: rgba(54, 214, 200, .1); }
.settings-icon.telegram { color: #6cbcf8; background: rgba(108, 188, 248, .1); }
.schedule-row { display: flex; justify-content: space-between; align-items: center; padding: 13px 0; border-bottom: 1px solid var(--line); font-size: .82rem; }
.schedule-row i { display: inline-block; width: 8px; height: 8px; margin-right: 8px; border-radius: 50%; }
.day-dot { background: var(--yellow); }.night-dot { background: var(--blue); }
.check-list { display: grid; gap: 10px; padding: 0; list-style: none; color: #bfd1df; font-size: .8rem; }
.check-list li::before { content: '✓'; margin-right: 8px; color: var(--green); }
.inline-status { min-height: 18px; margin: 13px 0 0; color: var(--muted); font-size: .76rem; }
.modal { width: min(680px, calc(100vw - 30px)); max-height: calc(100vh - 34px); padding: 25px; overflow: auto; border: 1px solid rgba(147, 182, 211, .18); border-radius: 22px; color: var(--text); background: #0b1b2b; box-shadow: 0 35px 100px rgba(0,0,0,.55); }
.modal::backdrop { background: rgba(1, 7, 13, .78); backdrop-filter: blur(7px); }
.modal-head { display: flex; justify-content: space-between; align-items: start; gap: 16px; margin-bottom: 22px; }
.close-button { flex: 0 0 auto; width: 34px; height: 34px; border-radius: 10px; font-size: 1.25rem; }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 15px; }
.form-grid .span-2 { grid-column: span 2; }
.form-grid.compact { grid-template-columns: repeat(4, 1fr); }
.form-divider { display: flex; align-items: center; gap: 10px; margin: 22px 0 15px; color: var(--muted); font-size: .7rem; font-weight: 800; letter-spacing: .1em; }
.form-divider::after { content: ''; height: 1px; flex: 1; background: var(--line); }
.modal-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 22px; }
.success-banner { display: flex; gap: 12px; align-items: center; margin-bottom: 19px; padding: 15px; border: 1px solid rgba(61, 220, 151, .2); border-radius: 13px; background: rgba(61, 220, 151, .08); }
.success-banner > span { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; color: #042116; background: var(--green); font-weight: 900; }
.success-banner p { margin: 3px 0 0; color: var(--muted); font-size: .74rem; }
.copy-field { display: grid; grid-template-columns: 1fr auto; border: 1px solid var(--line); border-radius: 11px; overflow: hidden; background: rgba(2, 10, 18, .72); }
.copy-field code { min-width: 0; overflow: auto; padding: 14px; color: #a9e8df; font-size: .72rem; white-space: nowrap; }
.copy-button { border: 0; border-left: 1px solid var(--line); color: var(--cyan); background: rgba(54, 214, 200, .08); font-weight: 750; }
.token-note { margin-top: 16px; padding: 13px 15px; border-radius: 12px; background: rgba(89, 128, 167, .1); color: var(--muted); font-size: .76rem; line-height: 1.6; }
.detail-modal { width: min(850px, calc(100vw - 30px)); }
.detail-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 11px; margin-bottom: 20px; }
.detail-stat { padding: 13px; border: 1px solid var(--line); border-radius: 12px; background: rgba(15, 34, 52, .7); }
.detail-stat span { display: block; color: var(--muted); font-size: .67rem; }
.detail-stat strong { display: block; margin-top: 6px; font-size: 1rem; }
.realtime-control { display: grid; grid-template-columns: minmax(190px, 1fr) minmax(230px, 1.4fr); gap: 14px; align-items: end; padding: 15px; border: 1px solid var(--line); border-radius: 14px; background: rgba(54, 214, 200, .05); }
.realtime-control .button { width: 100%; }
.realtime-control p { margin: 7px 0 0; }
.chart-toolbar { display: flex; justify-content: space-between; align-items: center; margin: 18px 0 10px; }
.chart-toolbar select { width: auto; padding: 7px 10px; }
.chart-wrap { position: relative; min-height: 260px; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: rgba(3, 12, 21, .46); }
.chart-wrap canvas { width: 100%; height: 260px; }
.chart-empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); }
.toast-region { position: fixed; z-index: 20; right: 20px; bottom: 20px; display: grid; gap: 9px; }
.toast { min-width: 260px; max-width: 390px; padding: 13px 15px; border: 1px solid var(--line); border-radius: 12px; background: #10263a; box-shadow: var(--shadow); animation: toast-in .25s ease; }
.toast.error { border-color: rgba(255, 101, 119, .35); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }
@media (max-width: 1050px) { .server-grid { grid-template-columns: repeat(2, minmax(240px, 1fr)); }.summary-grid { grid-template-columns: repeat(2, 1fr); }.form-grid.compact { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 760px) {
  .app-shell { display: block; }.sidebar { position: fixed; z-index: 10; right: 12px; bottom: 12px; left: 12px; top: auto; height: auto; padding: 6px; border: 1px solid var(--line); border-radius: 15px; }.brand, .sidebar-foot { display: none; }.nav { grid-template-columns: repeat(3, 1fr); }.nav-item { justify-content: center; padding: 9px; font-size: .68rem; }.nav-item.active { box-shadow: inset 0 -2px var(--cyan); }
  .main { padding: 22px 15px 92px; }.topbar { align-items: start; }.top-actions .button.ghost, .top-actions .icon-button { display: none; }.top-actions .button { padding: 9px 11px; }.server-grid, .settings-grid { grid-template-columns: 1fr; }.section-heading { align-items: start; gap: 12px; }.segmented button { padding-inline: 8px; }.detail-stats { grid-template-columns: repeat(2, 1fr); }.realtime-control { grid-template-columns: 1fr; }.modal { padding: 20px; }.form-grid, .form-grid.compact { grid-template-columns: 1fr; }.form-grid .span-2 { grid-column: auto; }.row-actions { align-items: stretch; flex-direction: column; }
}
@media (max-width: 430px) { .summary-grid { grid-template-columns: 1fr 1fr; gap: 10px; }.summary-card { min-height: 112px; padding: 14px; }.server-grid { grid-template-columns: 1fr; }.login-card { padding: 28px 22px; }.topbar h1 { font-size: 1.45rem; } }
