* { box-sizing: border-box; }

:root {
  --bg: #0b0e12;
  --bg-soft: #10141a;
  --sidebar: #0f1318;
  --panel: #141920;
  --panel-soft: #181e26;
  --panel-hover: #1b222c;
  --border: rgba(255,255,255,.07);
  --border-strong: rgba(255,255,255,.12);
  --text: #f2f4f7;
  --muted: #9098a5;
  --muted-2: #66707e;
  --accent: #4f83ff;
  --accent-soft: rgba(79,131,255,.13);
  --accent-border: rgba(79,131,255,.28);
  --green: #58c995;
  --green-soft: rgba(88,201,149,.11);
  --yellow: #d8ad62;
  --yellow-soft: rgba(216,173,98,.11);
  --red: #e36d72;
  --red-soft: rgba(227,109,114,.11);
  --purple: #9e87e7;
  --shadow: 0 24px 70px rgba(0,0,0,.36);
}

html, body { width: 100%; min-height: 100%; margin: 0; }
body {
  background: radial-gradient(circle at 78% 4%, rgba(79,131,255,.055), transparent 26%), var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; }
button { color: inherit; }
button, select { cursor: pointer; }
input, textarea, select { color: var(--text); }
.hidden { display: none !important; }
.muted { color: var(--muted-2); font-size: 12px; }
.good { color: var(--green); }

.login-view {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 30px;
}
.login-card {
  width: min(430px, 94vw);
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  background: rgba(16,20,26,.96);
  box-shadow: var(--shadow);
  padding: 28px;
}
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 40px; }
.login-brand img { width: 40px; height: 40px; object-fit: contain; }
.login-brand div { display: flex; flex-direction: column; gap: 2px; }
.login-brand strong { font-size: 15px; }
.login-brand span { color: var(--muted); font-size: 11px; }
.login-copy h1 { margin: 5px 0 8px; font-size: 26px; letter-spacing: -.035em; }
.login-copy p:last-child { margin: 0; color: var(--muted); line-height: 1.6; font-size: 12px; }
.login-form { display: grid; gap: 14px; margin-top: 26px; }
.login-form label { display: grid; gap: 7px; }
.login-form label > span { color: #b5bcc6; font-size: 11px; font-weight: 650; }
.login-form input {
  height: 42px; border: 1px solid var(--border-strong); border-radius: 8px;
  background: #0d1116; padding: 0 12px; outline: none;
}
.login-form input:focus { border-color: rgba(79,131,255,.6); box-shadow: 0 0 0 3px rgba(79,131,255,.09); }
.form-error { margin: 0; color: #f08d92; font-size: 11px; }
.login-footer { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 24px; color: var(--muted-2); font-size: 10px; }

.app { min-height: 100vh; display: grid; grid-template-columns: 230px minmax(0,1fr); }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: 230px; z-index: 20;
  display: flex; flex-direction: column; padding: 18px 14px 14px;
  border-right: 1px solid var(--border); background: rgba(15,19,24,.98);
}
.brand-row { height: 48px; display: flex; align-items: center; gap: 11px; padding: 0 7px; }
.brand-logo { width: 34px; height: 34px; object-fit: contain; }
.brand-copy { display: flex; flex-direction: column; gap: 3px; }
.brand-copy strong { font-size: 14px; font-weight: 700; }
.brand-copy span { color: var(--muted); font-size: 10px; }

.server-switcher { position: relative; margin: 18px 0 16px; padding: 0 2px; }
.server-switcher-label { display: block; padding: 0 8px 7px; color: var(--muted-2); font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.server-switcher-button {
  width: 100%; min-height: 50px; display: flex; align-items: center; gap: 10px;
  border: 1px solid var(--border); border-radius: 9px; background: #12171d; padding: 9px 10px; text-align: left;
}
.server-switcher-button:hover { background: #151a21; border-color: var(--border-strong); }
.server-switcher-copy { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 3px; }
.server-switcher-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.server-switcher-copy small { color: var(--muted-2); font-size: 9px; }
.chevron { color: var(--muted-2); }
.server-menu {
  position: absolute; z-index: 80; left: 2px; right: 2px; top: calc(100% + 7px);
  padding: 6px; border: 1px solid var(--border-strong); border-radius: 9px;
  background: #131820; box-shadow: 0 16px 34px rgba(0,0,0,.4);
}
.server-menu button {
  width: 100%; display: flex; align-items: center; gap: 9px; border: 0; border-radius: 7px;
  background: transparent; padding: 9px; text-align: left; font-size: 10px;
}
.server-menu button:hover { background: rgba(255,255,255,.04); }

.nav { display: flex; flex-direction: column; gap: 3px; flex: 1; }
.nav-item {
  width: 100%; height: 39px; display: flex; align-items: center; gap: 10px;
  border: 0; border-radius: 7px; background: transparent; padding: 0 10px;
  color: var(--muted); font-size: 11px; font-weight: 570; text-align: left;
}
.nav-item:hover { background: rgba(255,255,255,.025); color: #d9dee6; }
.nav-item.active { background: var(--accent-soft); color: #dce6ff; }
.nav-glyph { width: 18px; text-align: center; font-size: 13px; }
.nav-count { margin-left: auto; min-width: 21px; padding: 2px 6px; border-radius: 99px; background: rgba(255,255,255,.055); font-size: 9px; text-align: center; }
.nav-count.warn { background: var(--red-soft); color: #ec9296; }
.nav-divider { height: 1px; margin: 9px 9px; background: var(--border); }
.sidebar-footer { display: flex; align-items: center; gap: 8px; padding: 12px 7px 0; border-top: 1px solid var(--border); }
.protection-state { flex: 1; min-width: 0; display: flex; align-items: center; gap: 9px; }
.protection-state div { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.protection-state strong { font-size: 10px; }
.protection-state div span { color: var(--muted-2); font-size: 9px; }
.status-dot, .server-led { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px rgba(88,201,149,.09); }
.status-dot.off, .server-led.offline { background: #59616d; box-shadow: none; }
.server-led { flex: 0 0 auto; }

.main { grid-column: 2; min-width: 0; }
.topbar {
  position: sticky; top: 0; z-index: 10; height: 72px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px; border-bottom: 1px solid var(--border); background: rgba(11,14,18,.9); backdrop-filter: blur(14px);
}
.eyebrow { margin: 0 0 3px; color: var(--muted-2); font-size: 9px; text-transform: uppercase; letter-spacing: .09em; font-weight: 700; }
.topbar h1 { margin: 0; font-size: 19px; letter-spacing: -.025em; }
.top-actions { display: flex; align-items: center; gap: 9px; }
.sync-status { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 10px; margin-right: 2px; }
.icon-button, .ghost-icon {
  display: grid; place-items: center; border: 1px solid var(--border); background: #12171d; color: var(--muted); border-radius: 8px;
}
.icon-button { width: 34px; height: 34px; }
.ghost-icon { width: 31px; height: 31px; background: transparent; }
.icon-button:hover, .ghost-icon:hover { color: var(--text); border-color: var(--border-strong); background: #171c23; }
.icon-button.spinning { animation: spin .6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.user-chip { display: flex; align-items: center; gap: 8px; min-width: 160px; padding-left: 7px; }
.avatar { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 8px; background: #1a2029; border: 1px solid var(--border); color: #c9d4f1; font-size: 10px; font-weight: 700; }
.user-chip div { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.user-chip strong { max-width: 145px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; }
.user-chip span:last-child { color: var(--muted-2); font-size: 9px; }

.content { padding: 26px 28px 46px; max-width: 1540px; margin: 0 auto; }
.page { display: none; }
.page.active { display: block; }
.hero-row, .section-toolbar, .protection-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 22px; margin-bottom: 20px; }
.hero-row h2, .section-toolbar h2, .protection-header h2 { margin: 8px 0 6px; font-size: 24px; letter-spacing: -.035em; }
.hero-row p, .section-toolbar p, .protection-header p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.status-badge { display: inline-flex; align-items: center; gap: 7px; padding: 5px 8px; border-radius: 6px; background: var(--green-soft); color: #83d9b1; font-size: 9px; font-weight: 700; }
.status-badge.offline { background: rgba(110,120,133,.10); color: #9199a5; }

.primary, .secondary, .text-button, .danger-button, .small-button {
  border: 1px solid transparent; border-radius: 7px; font-weight: 650; transition: .12s ease;
}
.primary { min-height: 36px; padding: 0 13px; background: var(--accent); border-color: rgba(255,255,255,.05); color: #fff; font-size: 10px; }
.primary:hover { filter: brightness(1.08); }
.primary.full { width: 100%; height: 42px; }
.secondary { min-height: 35px; padding: 0 12px; background: #151a21; border-color: var(--border-strong); color: #c5cbd3; font-size: 10px; }
.secondary:hover { background: #1a2028; color: #fff; }
.text-button { border: 0; background: transparent; color: #94b0ff; font-size: 10px; }
.text-button:hover { color: #c2d1ff; }
.danger-button { min-height: 31px; padding: 0 10px; background: var(--red-soft); border-color: rgba(227,109,114,.16); color: #ef969a; font-size: 9px; }
.small-button { min-height: 29px; padding: 0 9px; background: #171d24; border-color: var(--border); color: #b2bac5; font-size: 9px; }
.small-button:hover, .danger-button:hover { filter: brightness(1.12); }

.stats-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; margin-bottom: 14px; }
.stat-card { min-height: 120px; padding: 17px; border: 1px solid var(--border); border-radius: 10px; background: var(--panel); }
.stat-label { display: block; color: #a7afb9; font-size: 10px; font-weight: 620; }
.stat-card > strong { display: block; margin: 16px 0 9px; font-size: 26px; letter-spacing: -.045em; }
.stat-card > strong.text-value { font-size: 18px; letter-spacing: -.02em; margin-top: 21px; }
.stat-meta { color: var(--muted-2); font-size: 9px; }

.dashboard-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 14px; }
.panel { overflow: hidden; border: 1px solid var(--border); border-radius: 10px; background: var(--panel); }
.panel.span-2 { min-width: 0; }
.panel-header { min-height: 67px; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 17px; border-bottom: 1px solid var(--border); }
.panel-header h3 { margin: 0; font-size: 12px; font-weight: 670; }
.panel-header p { margin: 4px 0 0; color: var(--muted-2); font-size: 9px; }
.table-shell { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 0 16px; border-bottom: 1px solid var(--border); text-align: left; white-space: nowrap; }
th { height: 36px; color: var(--muted-2); font-size: 8px; text-transform: uppercase; letter-spacing: .06em; font-weight: 750; }
td { height: 54px; color: #abb3bf; font-size: 9px; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: rgba(255,255,255,.012); }
.name-cell { display: flex; align-items: center; gap: 9px; }
.name-cell .avatar { width: 28px; height: 28px; font-size: 8px; }
.name-cell div { display: flex; flex-direction: column; gap: 2px; }
.name-cell strong { color: #dce1e8; font-size: 9px; }
.name-cell span { color: var(--muted-2); font-size: 8px; }
.table-actions { display: flex; align-items: center; gap: 6px; justify-content: flex-end; }
.detection-name { color: #d8dde5; font-weight: 600; }
.detection-code { color: var(--muted-2); }
.empty-table { min-height: 170px; display: grid; place-items: center; padding: 30px; color: var(--muted-2); font-size: 10px; text-align: center; }

.severity, .status-pill, .source-pill, .chip, .command-status {
  display: inline-flex; align-items: center; justify-content: center; padding: 4px 7px; border-radius: 5px; font-size: 8px; font-weight: 700;
}
.severity.low { background: rgba(125,142,166,.11); color: #9daabd; }
.severity.medium { background: var(--yellow-soft); color: #dfbd83; }
.severity.high, .severity.critical { background: var(--red-soft); color: #ed9297; }
.status-pill.review { background: var(--yellow-soft); color: #dfbd83; }
.status-pill.resolved { background: var(--green-soft); color: #7dd7ad; }
.status-pill.active { background: var(--red-soft); color: #ed9297; }
.status-pill.inactive { background: rgba(125,142,166,.1); color: #9ba7b7; }
.source-pill { background: rgba(79,131,255,.10); color: #91adff; }
.chip { border: 1px solid var(--border); background: #181e25; color: var(--muted); }

.rule-summary { display: grid; gap: 0; padding: 6px 16px; }
.rule-summary-row { min-height: 49px; display: flex; align-items: center; gap: 9px; border-bottom: 1px solid var(--border); }
.rule-summary-row:last-child { border-bottom: 0; }
.rule-summary-row .rule-state { width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
.rule-summary-row .rule-state.off { background: #59616d; }
.rule-summary-row div { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.rule-summary-row strong { font-size: 9px; }
.rule-summary-row span { color: var(--muted-2); font-size: 8px; }
.activity-mini { padding: 6px 16px; }
.activity-mini-row { min-height: 49px; display: grid; grid-template-columns: 28px 1fr auto; align-items: center; gap: 8px; border-bottom: 1px solid var(--border); }
.activity-mini-row:last-child { border-bottom: 0; }
.activity-mini-icon { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 7px; background: #1a2028; color: #a9b4c7; font-size: 9px; }
.activity-mini-row div:nth-child(2) { display: flex; flex-direction: column; gap: 2px; }
.activity-mini-row strong { font-size: 9px; }
.activity-mini-row span { color: var(--muted-2); font-size: 8px; }
.activity-mini-row time { color: var(--muted-2); font-size: 8px; }

.page-tools { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.search-box { width: min(330px,55vw); height: 35px; display: flex; align-items: center; gap: 8px; border: 1px solid var(--border); border-radius: 8px; background: #11161c; padding: 0 10px; color: var(--muted-2); }
.search-box input { width: 100%; border: 0; outline: 0; background: transparent; font-size: 10px; }
select { height: 35px; border: 1px solid var(--border); border-radius: 8px; background: #11161c; padding: 0 10px; outline: none; font-size: 10px; }

.protection-header { align-items: center; }
.section-kicker { display: block; color: #8aa8ff; font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.protection-actions { display: flex; align-items: center; gap: 10px; }
.save-state { color: var(--yellow); font-size: 9px; }
.global-config { min-height: 78px; display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; margin-bottom: 12px; }
.global-config-copy { display: flex; align-items: center; gap: 12px; }
.config-icon { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid var(--accent-border); border-radius: 9px; background: var(--accent-soft); color: #93adff; }
.global-config h3 { margin: 0 0 4px; font-size: 12px; }
.global-config p { margin: 0; color: var(--muted-2); font-size: 9px; }
.switch { position: relative; display: inline-flex; width: 36px; height: 20px; }
.switch input { opacity: 0; position: absolute; }
.switch span { width: 100%; height: 100%; border-radius: 99px; background: #303740; border: 1px solid rgba(255,255,255,.06); transition: .14s; }
.switch span::after { content: ''; position: absolute; width: 14px; height: 14px; left: 3px; top: 3px; border-radius: 50%; background: #9aa2ad; transition: .14s; }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(16px); background: white; }
.config-meta-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 12px; margin-bottom: 12px; }
.field-card { min-height: 102px; display: flex; flex-direction: column; justify-content: center; gap: 9px; padding: 14px 16px; border: 1px solid var(--border); border-radius: 10px; background: var(--panel); }
.field-card > span { color: #b1b8c2; font-size: 9px; font-weight: 650; }
.field-card > div { display: flex; align-items: center; gap: 7px; }
.field-card input { width: 100px; height: 31px; border: 1px solid var(--border-strong); border-radius: 7px; background: #10151b; padding: 0 9px; outline: none; font-size: 11px; }
.field-card small { color: var(--muted-2); font-size: 9px; }
.field-card p { margin: 0; color: var(--muted-2); font-size: 8px; }
.field-card.readonly strong { font-size: 17px; }
.rule-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.rule-card { border: 1px solid var(--border); border-radius: 10px; background: var(--panel); overflow: hidden; }
.rule-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 16px; border-bottom: 1px solid var(--border); }
.rule-title { display: flex; gap: 11px; }
.rule-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 8px; background: #1a2028; border: 1px solid var(--border); color: #a9b4c7; font-size: 11px; }
.rule-title h3 { margin: 1px 0 4px; font-size: 11px; }
.rule-title p { margin: 0; max-width: 380px; color: var(--muted-2); font-size: 8px; line-height: 1.45; }
.rule-card-body { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; padding: 14px 16px 16px; }
.rule-field { display: grid; gap: 6px; }
.rule-field.full { grid-column: 1 / -1; }
.rule-field > span { color: var(--muted); font-size: 8px; font-weight: 650; }
.rule-field input, .rule-field select, .rule-field textarea { width: 100%; border: 1px solid var(--border); border-radius: 7px; background: #10151b; outline: none; font-size: 9px; }
.rule-field input, .rule-field select { height: 32px; padding: 0 9px; }
.rule-field textarea { min-height: 65px; resize: vertical; padding: 9px; line-height: 1.4; }

.server-card-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.server-card { border: 1px solid var(--border); border-radius: 10px; background: var(--panel); padding: 17px; }
.server-card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.server-card-name { display: flex; align-items: center; gap: 10px; }
.server-card-name img { width: 34px; height: 34px; object-fit: contain; }
.server-card-name h3 { margin: 0 0 4px; font-size: 12px; }
.server-card-name p { margin: 0; color: var(--muted-2); font-size: 8px; }
.server-card-stats { display: grid; grid-template-columns: repeat(4,1fr); gap: 8px; margin-bottom: 14px; }
.server-mini-stat { padding: 10px; border-radius: 8px; background: #11161c; border: 1px solid var(--border); }
.server-mini-stat span { display: block; color: var(--muted-2); font-size: 8px; }
.server-mini-stat strong { display: block; margin-top: 5px; font-size: 11px; }
.server-card-actions { display: flex; flex-wrap: wrap; gap: 7px; }

.settings-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.settings-card .settings-body { padding: 8px 17px; }
.detail-row { min-height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 18px; border-bottom: 1px solid var(--border); font-size: 9px; }
.detail-row:last-child { border-bottom: 0; }
.detail-row > span { color: var(--muted); }
.detail-row code { color: #a9baf1; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

.modal-backdrop { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; background: rgba(4,6,9,.68); backdrop-filter: blur(4px); }
.modal { width: min(470px,94vw); border: 1px solid var(--border-strong); border-radius: 12px; background: #141920; box-shadow: var(--shadow); }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.modal-header h3 { margin: 0; font-size: 13px; }
.modal-body { display: grid; gap: 13px; padding: 17px 18px; }
.modal-body label { display: grid; gap: 6px; }
.modal-body label > span { color: var(--muted); font-size: 9px; font-weight: 650; }
.modal-body input, .modal-body select, .modal-body textarea { width: 100%; border: 1px solid var(--border); border-radius: 7px; background: #0f141a; outline: none; }
.modal-body input, .modal-body select { height: 35px; padding: 0 10px; font-size: 10px; }
.modal-body textarea { min-height: 80px; padding: 10px; resize: vertical; font-size: 10px; }
.modal-info { padding: 11px; border-radius: 8px; border: 1px solid var(--border); background: #11161c; color: var(--muted); font-size: 9px; line-height: 1.55; }
.token-box { display: flex; gap: 7px; }
.token-box input { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.modal-footer { display: flex; justify-content: flex-end; gap: 8px; padding: 13px 18px; border-top: 1px solid var(--border); }

.toast-stack { position: fixed; z-index: 150; right: 20px; bottom: 20px; display: grid; gap: 8px; width: min(330px,90vw); }
.toast { display: flex; align-items: flex-start; gap: 9px; padding: 12px; border: 1px solid var(--border-strong); border-radius: 9px; background: #171c23; box-shadow: 0 12px 30px rgba(0,0,0,.32); animation: toast-in .18s ease; }
.toast-dot { width: 7px; height: 7px; margin-top: 4px; border-radius: 50%; background: var(--accent); }
.toast.success .toast-dot { background: var(--green); }
.toast.error .toast-dot { background: var(--red); }
.toast.warning .toast-dot { background: var(--yellow); }
.toast div { display: flex; flex-direction: column; gap: 3px; }
.toast strong { font-size: 9px; }
.toast span { color: var(--muted); font-size: 9px; line-height: 1.4; }
@keyframes toast-in { from { opacity: 0; transform: translateY(6px); } }

@media (max-width: 1180px) {
  .stats-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .rule-grid, .server-card-grid { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .app { grid-template-columns: 72px minmax(0,1fr); }
  .sidebar { width: 72px; padding: 16px 10px; }
  .brand-row { justify-content: center; padding: 0; }
  .brand-copy, .server-switcher-label, .server-switcher-copy, .chevron, .nav-item > span:not(.nav-glyph):not(.nav-count), .protection-state div { display: none; }
  .server-switcher-button { justify-content: center; padding: 0; }
  .nav-item { justify-content: center; padding: 0; position: relative; }
  .nav-glyph { width: auto; }
  .nav-count { position: absolute; right: 0; top: 3px; min-width: 17px; padding: 1px 4px; }
  .sidebar-footer { justify-content: center; padding-left: 0; padding-right: 0; }
  .protection-state { flex: 0; }
  .main { grid-column: 2; }
  .topbar { padding: 0 17px; }
  .user-chip div, .sync-status { display: none; }
  .user-chip { min-width: auto; padding: 0; }
  .content { padding: 20px 17px 36px; }
  .config-meta-grid, .settings-grid { grid-template-columns: 1fr; }
}
@media (max-width: 590px) {
  .stats-grid { grid-template-columns: 1fr; }
  .hero-row, .section-toolbar, .protection-header { align-items: flex-start; flex-direction: column; }
  .page-tools { align-items: stretch; flex-direction: column; }
  .search-box { width: 100%; }
  .rule-card-body { grid-template-columns: 1fr; }
  .rule-field.full { grid-column: auto; }
  .server-card-stats { grid-template-columns: 1fr; }
}

/* Sky Anticheat v4 additions */
.plan-badge { display:inline-flex;align-items:center;height:28px;padding:0 10px;border:1px solid var(--accent-border);border-radius:999px;background:var(--accent-soft);color:#b9ccff;font-size:9px;font-weight:750;letter-spacing:.02em; }
.plan-badge.inactive { border-color:var(--border);background:#12171d;color:var(--muted); }
.plan-showcase { display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin-bottom:14px; }
.plan-card { min-height:132px;display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:15px;padding:18px;border:1px solid var(--border);border-radius:11px;background:linear-gradient(145deg,#151a22,#11161c);transition:transform .18s ease,border-color .18s ease,background .18s ease; }
.plan-card:hover { transform:translateY(-2px);border-color:var(--border-strong);background:linear-gradient(145deg,#181e28,#121821); }
.plan-card.featured { border-color:rgba(79,131,255,.28);box-shadow:inset 0 0 0 1px rgba(79,131,255,.04); }
.plan-card h3 { margin:3px 0 6px;font-size:16px; }
.plan-card p { margin:0;color:var(--muted);font-size:9px;line-height:1.55; }
.plan-card > strong { color:#c7d5ff;font-size:12px; }
.plan-icon { width:42px;height:42px;display:grid;place-items:center;border-radius:11px;background:linear-gradient(145deg,#267eff,#635cf7);box-shadow:0 8px 22px rgba(55,109,255,.18);font-weight:800; }
.plan-pill { display:inline-flex;padding:4px 7px;border-radius:6px;border:1px solid var(--border);background:#11161d;color:var(--muted);font-size:9px;font-weight:700; }
.plan-pill.monthly { color:#9fc2ff;border-color:rgba(79,131,255,.22);background:rgba(79,131,255,.08); }
.plan-pill.lifetime { color:#c2b4ff;border-color:rgba(158,135,231,.24);background:rgba(158,135,231,.09); }
.server-license-row { display:flex;align-items:center;justify-content:space-between;gap:12px;margin:-3px 0 14px;padding:9px 10px;border:1px solid var(--border);border-radius:8px;background:#10151b; }
.server-license-row span { color:var(--muted-2);font-size:8px;text-transform:uppercase;letter-spacing:.07em; }
.server-license-row code { overflow:hidden;text-overflow:ellipsis;color:#a9bfff;font:9px ui-monospace,SFMono-Regular,Menlo,monospace;white-space:nowrap; }
.primary-soft { border-color:rgba(79,131,255,.22)!important;background:rgba(79,131,255,.08)!important;color:#aac1ff!important; }
.danger-soft { border-color:rgba(227,109,114,.2)!important;color:#e98b90!important; }
.download-callout { display:grid;gap:8px;padding:12px;border:1px solid var(--accent-border);border-radius:9px;background:rgba(79,131,255,.055); }
.download-callout strong { font-size:10px; }
.download-callout code { display:block;padding:7px 9px;border:1px solid var(--border);border-radius:6px;background:#0d1218;color:#b7c7ef;font:9px ui-monospace,SFMono-Regular,Menlo,monospace; }
.settings-note { margin:12px 0;color:var(--muted);font-size:9px;line-height:1.6; }
.settings-form { display:grid;gap:12px;padding:16px 17px; }
.settings-form label { display:grid;gap:6px; }
.settings-form label span { color:var(--muted);font-size:9px;font-weight:650; }
.settings-form input { height:36px;padding:0 10px;border:1px solid var(--border);border-radius:7px;background:#0f141a;outline:none; }
.settings-form input:focus { border-color:var(--accent-border);box-shadow:0 0 0 3px rgba(79,131,255,.07); }
button:disabled { cursor:not-allowed;opacity:.45; }

/* restrained motion: quick, functional and easy to disable */
@keyframes sky-page-in { from { opacity:0;transform:translateY(7px); } to { opacity:1;transform:none; } }
@keyframes sky-login-in { from { opacity:0;transform:translateY(10px) scale(.99); } to { opacity:1;transform:none; } }
@keyframes sky-status-pulse { 0%,100% { box-shadow:0 0 0 0 rgba(88,201,149,.16); } 50% { box-shadow:0 0 0 5px rgba(88,201,149,0); } }
.login-card { animation:sky-login-in .28s ease both; }
.page.active { animation:sky-page-in .2s ease both; }
.server-card,.stat-card,.panel,.rule-card { transition:transform .16s ease,border-color .16s ease,background .16s ease; }
.server-card:hover,.stat-card:hover { transform:translateY(-1px);border-color:var(--border-strong); }
.status-dot:not(.off),.server-led:not(.offline) { animation:sky-status-pulse 2.4s ease-in-out infinite; }
.modal:not(.hidden) { animation:sky-page-in .16s ease both; }

@media (prefers-reduced-motion: reduce) {
  *,*::before,*::after { animation-duration:.001ms!important;animation-iteration-count:1!important;transition-duration:.001ms!important;scroll-behavior:auto!important; }
}
@media (max-width: 820px) { .plan-badge { display:none; } .plan-showcase { grid-template-columns:1fr; } }


/* Sky Anticheat v4.3 Full GTA V Live Map */
.live-map-toolbar { gap:20px; }
.live-map-toolbar-actions { display:flex;align-items:center;gap:8px;flex-wrap:wrap; }
.live-map-toolbar-actions .search-box { width:230px; }
.live-map-toolbar-actions select { height:34px;min-width:145px;padding:0 30px 0 10px;border:1px solid var(--border);border-radius:7px;background:#10151b;color:var(--text);font-size:9px;outline:none; }
.live-map-status-row { min-height:38px;display:flex;align-items:center;gap:12px;margin:-3px 0 11px; }
.live-map-live { display:inline-flex;align-items:center;gap:7px;padding:5px 8px;border:1px solid rgba(88,201,149,.18);border-radius:999px;background:rgba(88,201,149,.06);color:#8fd9b5;font-size:8px;font-weight:750;letter-spacing:.05em; }
.live-map-live i { width:6px;height:6px;border-radius:50%;background:var(--green);box-shadow:0 0 0 4px rgba(88,201,149,.08);animation:sky-status-pulse 2.4s ease-in-out infinite; }
.live-map-status-row .chip { margin-left:auto; }
.live-map-layout { display:grid;grid-template-columns:minmax(0,1.65fr) minmax(270px,.55fr);gap:12px;align-items:start; }
.live-map-panel { overflow:hidden; }
.live-map-canvas { position:relative;min-height:650px;overflow:hidden;border-radius:10px;background:#06090d;isolation:isolate; }
.live-gta-map { position:absolute;inset:0;overflow:hidden;touch-action:none;cursor:grab;outline:none;background:radial-gradient(circle at 50% 45%,#111821 0,#080d12 62%,#05080b 100%);user-select:none; }
.live-gta-map.dragging { cursor:grabbing; }
.live-map-tile-layer,.live-map-markers { position:absolute;inset:0; }
.live-map-tile-layer { z-index:1;pointer-events:none; }
.live-map-tile { position:absolute;width:256px;height:256px;max-width:none;object-fit:cover;pointer-events:none;user-select:none;filter:brightness(.60) saturate(.72) contrast(1.09);opacity:.96; }
.live-map-tile.missing { visibility:hidden; }
.live-map-markers { z-index:3;pointer-events:none; }
.live-map-marker { --heading:0deg;position:absolute;width:30px;height:30px;display:grid;place-items:center;padding:0;border:1px solid rgba(121,164,255,.58);border-radius:50%;background:#161f2b;color:#dce7ff;box-shadow:0 4px 12px rgba(0,0,0,.42),0 0 0 4px rgba(79,131,255,.1);transform:translate(-50%,-50%);cursor:pointer;z-index:4;transition:transform .12s ease,border-color .12s ease,box-shadow .12s ease;pointer-events:auto; }
.live-map-marker:hover,.live-map-marker.selected { transform:translate(-50%,-50%) scale(1.12);border-color:#8bb0ff;box-shadow:0 5px 15px rgba(0,0,0,.48),0 0 0 6px rgba(79,131,255,.14);z-index:6; }
.live-map-marker.staff { border-color:rgba(157,128,255,.75);background:#211d32;box-shadow:0 4px 12px rgba(0,0,0,.42),0 0 0 4px rgba(153,120,255,.12); }
.live-map-marker-initials { font-size:7px;font-weight:850;letter-spacing:.01em;pointer-events:none; }
.live-map-marker-arrow { position:absolute;left:50%;top:-8px;width:0;height:0;border-left:4px solid transparent;border-right:4px solid transparent;border-bottom:8px solid #78a2ff;transform:translateX(-50%) rotate(var(--heading));transform-origin:50% 23px;opacity:.9;pointer-events:none; }
.live-map-marker-label { position:absolute;left:50%;top:35px;max-width:150px;padding:4px 6px;border:1px solid var(--border);border-radius:5px;background:rgba(9,13,18,.94);color:#c4cedc;font-size:7px;font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;transform:translateX(-50%);pointer-events:none;opacity:0;transition:opacity .12s ease; }
.live-map-marker:hover .live-map-marker-label,.live-map-marker.selected .live-map-marker-label { opacity:1; }
.live-map-controls { position:absolute;left:14px;top:14px;z-index:6;display:grid;grid-template-columns:34px 34px auto;gap:5px; }
.live-map-controls button { height:34px;min-width:34px;padding:0 9px;border:1px solid rgba(255,255,255,.11);border-radius:7px;background:rgba(10,15,21,.9);color:#cbd6e5;font:700 14px/1 ui-sans-serif,system-ui;box-shadow:0 5px 16px rgba(0,0,0,.28);backdrop-filter:blur(7px);cursor:pointer;transition:background .12s ease,border-color .12s ease,color .12s ease; }
.live-map-controls button:hover { border-color:rgba(121,164,255,.34);background:#111a24;color:#fff; }
.live-map-controls .map-fit-button { font-size:8px;letter-spacing:.03em;text-transform:uppercase; }
.live-map-compass { position:absolute;right:16px;top:16px;z-index:5;width:38px;height:38px;display:grid;place-items:center;border:1px solid var(--border);border-radius:50%;background:rgba(10,15,21,.86);box-shadow:0 4px 12px rgba(0,0,0,.28);backdrop-filter:blur(6px); }
.live-map-compass strong { position:absolute;top:4px;color:#91adf3;font-size:7px; }
.live-map-compass span { width:1px;height:17px;background:linear-gradient(#8fb0ff 50%,#44505d 50%);transform:translateY(2px); }
.live-map-legend { position:absolute;left:14px;bottom:14px;z-index:5;display:flex;align-items:center;gap:12px;padding:7px 9px;border:1px solid var(--border);border-radius:7px;background:rgba(10,15,21,.88);backdrop-filter:blur(7px);color:var(--muted);font-size:7px; }
.live-map-legend span { display:flex;align-items:center;gap:5px; }
.live-map-zoom-label { padding-left:10px;border-left:1px solid var(--border);color:#8290a1!important;font-variant-numeric:tabular-nums; }
.legend-dot { width:7px;height:7px;border-radius:50%;background:#729dff; }
.legend-dot.staff { background:#a287ff; }
.live-map-side { display:grid;gap:12px;position:sticky;top:82px; }
.live-map-player-detail { padding:14px; }
.live-map-player-head { display:flex;align-items:center;gap:10px;padding-bottom:13px;border-bottom:1px solid var(--border); }
.live-map-player-head .avatar { width:36px;height:36px; }
.live-map-player-head div { min-width:0;display:flex;flex-direction:column;gap:3px; }
.live-map-player-head strong { overflow:hidden;text-overflow:ellipsis;font-size:11px;white-space:nowrap; }
.live-map-player-head span { color:var(--muted);font-size:8px; }
.live-map-detail-grid { display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px;margin-top:11px; }
.live-map-detail { padding:9px;border:1px solid var(--border);border-radius:7px;background:#10151b; }
.live-map-detail span { display:block;color:var(--muted-2);font-size:7px;text-transform:uppercase;letter-spacing:.05em; }
.live-map-detail strong { display:block;margin-top:4px;overflow:hidden;text-overflow:ellipsis;font-size:9px;white-space:nowrap; }
.live-map-player-actions { display:flex;gap:7px;margin-top:11px; }
.live-map-player-actions button { flex:1; }
.live-map-player-list { max-height:310px;overflow:auto;padding:6px; }
.live-map-list-item { width:100%;min-height:46px;display:grid;grid-template-columns:30px minmax(0,1fr) auto;align-items:center;gap:8px;padding:6px 8px;border:1px solid transparent;border-radius:7px;background:transparent;color:var(--text);text-align:left;cursor:pointer; }
.live-map-list-item:hover,.live-map-list-item.selected { border-color:var(--border);background:#11171e; }
.live-map-list-item .avatar { width:28px;height:28px;font-size:8px; }
.live-map-list-copy { min-width:0;display:flex;flex-direction:column;gap:3px; }
.live-map-list-copy strong { overflow:hidden;text-overflow:ellipsis;font-size:9px;white-space:nowrap; }
.live-map-list-copy span { color:var(--muted-2);font-size:7px; }
.live-map-list-meta { color:var(--muted);font-size:7px;white-space:nowrap; }
.live-map-empty-overlay { position:absolute;left:50%;top:50%;z-index:7;width:min(360px,80%);padding:16px;border:1px solid var(--border);border-radius:9px;background:rgba(13,18,24,.94);color:var(--muted);font-size:9px;line-height:1.6;text-align:center;transform:translate(-50%,-50%);backdrop-filter:blur(7px);pointer-events:none; }
.live-map-empty-overlay strong { display:block;margin-bottom:5px;color:var(--text);font-size:10px; }
@media (max-width:1180px) { .live-map-layout { grid-template-columns:1fr; } .live-map-side { grid-template-columns:repeat(2,minmax(0,1fr));position:static; } .live-map-canvas { min-height:580px; } }
@media (max-width:820px) { .live-map-toolbar-actions { width:100%;align-items:stretch; } .live-map-toolbar-actions .search-box { width:auto;flex:1; } .live-map-canvas { min-height:520px; } .live-map-side { grid-template-columns:1fr; } }
@media (max-width:590px) { .live-map-status-row { align-items:flex-start;flex-wrap:wrap; } .live-map-status-row .chip { margin-left:0; } .live-map-toolbar-actions { flex-direction:column; } .live-map-toolbar-actions select { width:100%; } .live-map-canvas { min-height:500px; } .live-map-marker-label { display:none; } .live-map-controls { grid-template-columns:32px 32px auto; } .live-map-controls button { height:32px;min-width:32px; } .live-map-legend { right:14px;gap:8px;justify-content:center; } }
