:root {
  color-scheme: dark;
  --bg: #06110c;
  --bg-soft: #091a12;
  --surface: #0d2117;
  --surface-2: #112a1d;
  --surface-3: #173524;
  --border: rgba(151, 188, 166, .17);
  --border-strong: rgba(67, 230, 139, .32);
  --text: #f2f8f4;
  --text-soft: #a8b9ae;
  --text-muted: #74877b;
  --brand: #20d673;
  --brand-strong: #13b85d;
  --brand-soft: rgba(32, 214, 115, .13);
  --blue: #5f8cff;
  --warning: #f2b84b;
  --danger: #f15b69;
  --success: #2bd47f;
  --sidebar: 272px;
  --topbar: 78px;
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;
  --shadow: 0 22px 55px rgba(0, 0, 0, .22);
  --focus: 0 0 0 3px rgba(32, 214, 115, .25);
}

[data-theme="light"] {
  color-scheme: light;
  --bg: #f3f7f4;
  --bg-soft: #edf4ef;
  --surface: #ffffff;
  --surface-2: #f8fbf9;
  --surface-3: #edf6f0;
  --border: rgba(19, 61, 38, .13);
  --border-strong: rgba(8, 116, 67, .42);
  --text: #122219;
  --text-soft: #40584b;
  --text-muted: #53675b;
  --brand: #087443;
  --brand-strong: #055f35;
  --brand-soft: rgba(8, 116, 67, .11);
  --blue: #2452ad;
  --warning: #744700;
  --danger: #ad1f32;
  --success: #087443;
  --shadow: 0 18px 45px rgba(28, 62, 42, .09);
}

*, *::before, *::after { box-sizing: border-box; }
html { min-height: 100%; scroll-behavior: smooth; }
body {
  min-height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
body.nav-open { overflow: hidden; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
button, a, input, textarea, select { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
img, svg { max-width: 100%; }
[hidden] { display: none !important; }
[data-cloak] { display: none !important; }
::selection { background: rgba(32, 214, 115, .28); color: var(--text); }

:focus-visible { outline: none; box-shadow: var(--focus); }
.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.skip-link {
  position: fixed; z-index: 1000; top: 10px; left: 10px; padding: 10px 14px;
  border-radius: 10px; background: var(--brand); color: #031109; font-weight: 800;
  transform: translateY(-150%);
}
.skip-link:focus { transform: translateY(0); }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); }
.sidebar {
  position: sticky; top: 0; z-index: 40; height: 100vh; min-width: 0;
  display: flex; flex-direction: column; overflow: hidden;
  background: linear-gradient(180deg, #071a10 0%, #06140d 100%);
  border-right: 1px solid var(--border);
}
[data-theme="light"] .sidebar { background: linear-gradient(180deg, #fafffb 0%, #f1f7f3 100%); }
.sidebar-brand {
  height: 88px; display: flex; align-items: center; gap: 12px; padding: 0 22px;
  border-bottom: 1px solid var(--border);
}
.sidebar-brand img { width: 168px; height: auto; display: block; }
.sidebar-close { display: none; margin-left: auto; }
.sidebar-profile {
  margin: 18px 16px 8px; padding: 13px; display: grid; grid-template-columns: 42px minmax(0,1fr);
  align-items: center; gap: 11px; border: 1px solid var(--border); border-radius: 16px;
  background: rgba(255,255,255,.025);
}
.avatar {
  width: 42px; height: 42px; display: grid; place-items: center; border-radius: 13px;
  background: linear-gradient(145deg, var(--brand), #098e4c); color: #fff; font-weight: 800;
  box-shadow: 0 8px 24px rgba(32, 214, 115, .18);
}
.sidebar-profile strong, .sidebar-profile small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-profile strong { font-size: .89rem; }
.sidebar-profile small { margin-top: 2px; color: var(--text-soft); font-size: .76rem; }
.sidebar-profile small::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 4px rgba(43,212,127,.1); }
.nav-scroll { flex: 1; overflow: auto; padding: 14px 12px 22px; scrollbar-width: thin; }
.nav-section { margin: 17px 10px 8px; color: var(--text-muted); font-size: .66rem; letter-spacing: .15em; text-transform: uppercase; font-weight: 850; }
.nav-link {
  min-height: 45px; margin: 3px 0; padding: 0 12px; display: flex; align-items: center; gap: 12px;
  border: 1px solid transparent; border-radius: 12px; color: var(--text-soft); font-weight: 660;
  transition: background .18s ease, color .18s ease, border-color .18s ease, transform .18s ease;
}
.nav-link:hover { color: var(--text); background: rgba(255,255,255,.035); transform: translateX(2px); }
.nav-link.is-active { color: var(--brand); border-color: rgba(32,214,115,.23); background: var(--brand-soft); }
.nav-icon { width: 20px; height: 20px; display: inline-grid; place-items: center; flex: 0 0 20px; }
.nav-icon svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.8; }
.sidebar-footer { padding: 12px; border-top: 1px solid var(--border); }
.logout-button { width: 100%; border: 0; background: transparent; cursor: pointer; }

.app-main { min-width: 0; min-height: 100vh; }
.topbar {
  position: sticky; top: 0; z-index: 30; min-height: var(--topbar); padding: 12px clamp(18px,3vw,38px);
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  background: color-mix(in srgb, var(--bg) 88%, transparent); border-bottom: 1px solid var(--border);
  -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
}
.topbar-leading { min-width: 0; display: flex; align-items: center; gap: 12px; }
.mobile-menu { display: none; }
.page-heading { min-width: 0; }
.page-heading h1 { margin: 0; font-size: clamp(1.18rem, 2vw, 1.55rem); line-height: 1.2; letter-spacing: -.025em; }
.page-heading p { margin: 4px 0 0; color: var(--text-soft); font-size: .83rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-actions { display: flex; align-items: center; justify-content: flex-end; gap: 9px; }
.topbar-stat {
  min-width: 92px; min-height: 50px; padding: 7px 12px; border: 1px solid var(--border); border-radius: 14px;
  display: grid; grid-template-columns: auto 1fr; column-gap: 8px; align-items: center; background: var(--surface);
}
.topbar-stat i { grid-row: 1/3; width: 8px; height: 8px; border-radius: 50%; background: var(--text-muted); }
.topbar-stat.is-good i { background: var(--success); box-shadow: 0 0 0 4px rgba(43,212,127,.1); }
.topbar-stat.is-danger i { background: var(--danger); }
.topbar-stat strong { font-size: .91rem; line-height: 1; }
.topbar-stat small { color: var(--text-muted); font-size: .65rem; line-height: 1.1; }
.icon-button {
  width: 44px; height: 44px; display: inline-grid; place-items: center; flex: 0 0 auto;
  border: 1px solid var(--border); border-radius: 13px; background: var(--surface); cursor: pointer;
}
.icon-button:hover { border-color: var(--border-strong); background: var(--surface-2); }
.icon-button svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.icon-button.sidebar-close, .icon-button.mobile-menu { display: none; }

.page-content { width: min(100%, 1640px); margin: 0 auto; padding: clamp(20px,3vw,42px); }
.page-content.compact { max-width: 1180px; }
.page-toolbar { margin-bottom: 22px; display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.page-toolbar h2 { margin: 0; font-size: clamp(1.45rem,2.6vw,2.05rem); letter-spacing: -.04em; }
.page-toolbar p { margin: 6px 0 0; color: var(--text-soft); }
.toolbar-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.section-stack > * + * { margin-top: 22px; }
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2,minmax(0,1fr)); }
.grid-3 { grid-template-columns: repeat(3,minmax(0,1fr)); }
.grid-4 { grid-template-columns: repeat(4,minmax(0,1fr)); }
.grid-main-aside { grid-template-columns: minmax(0,1.6fr) minmax(300px,.75fr); }
.span-2 { grid-column: span 2; }

.app-card {
  min-width: 0; padding: 22px; border: 1px solid var(--border); border-radius: var(--radius-lg);
  background: linear-gradient(145deg, var(--surface), color-mix(in srgb, var(--surface) 92%, #001a0b)); box-shadow: 0 1px 0 rgba(255,255,255,.015);
}
.app-card.is-accent { border-color: rgba(32,214,115,.25); background: linear-gradient(145deg, rgba(15,52,31,.95), var(--surface)); }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.card-head h2, .card-head h3 { margin: 0; font-size: 1.03rem; letter-spacing: -.02em; }
.card-head p { margin: 4px 0 0; color: var(--text-soft); font-size: .82rem; }
.metric-card { min-height: 142px; display: flex; flex-direction: column; justify-content: space-between; }
.metric-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 13px; color: var(--brand); background: var(--brand-soft); }
.metric-icon.is-blue { color: var(--blue); background: rgba(95,140,255,.12); }
.metric-icon.is-warning { color: var(--warning); background: rgba(242,184,75,.12); }
.metric-icon.is-danger { color: var(--danger); background: rgba(241,91,105,.12); }
.metric-icon svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 2; }
.metric-value { display: block; margin-top: 18px; font-size: clamp(1.55rem,3vw,2.1rem); font-weight: 820; letter-spacing: -.045em; }
.metric-label { color: var(--text-soft); font-size: .82rem; }
.metric-trend { margin-left: 7px; color: var(--success); font-size: .72rem; font-weight: 750; }

.hero-panel {
  position: relative; overflow: hidden; min-height: 250px; padding: clamp(26px,4vw,48px); display: flex; align-items: center;
  border: 1px solid rgba(32,214,115,.24); border-radius: 28px;
  background: radial-gradient(circle at 10% 10%, rgba(32,214,115,.16), transparent 42%), linear-gradient(115deg, #0b2a1a, #071711 65%, #07120e);
}
.hero-panel::after { content: ""; position: absolute; width: 390px; height: 390px; right: -150px; bottom: -245px; border: 1px solid rgba(32,214,115,.28); border-radius: 50%; box-shadow: 0 0 0 54px rgba(32,214,115,.03), 0 0 0 108px rgba(32,214,115,.025); }
.hero-copy { position: relative; z-index: 1; max-width: 780px; }
.eyebrow { display: block; margin-bottom: 12px; color: var(--brand); font-size: .71rem; font-weight: 850; letter-spacing: .16em; text-transform: uppercase; }
.hero-copy h2 { margin: 0; max-width: 680px; color: #f3f8f5; font-size: clamp(2rem,4.6vw,3.8rem); line-height: 1.03; letter-spacing: -.055em; }
.hero-copy p { max-width: 720px; margin: 16px 0 0; color: #a9bcaf; font-size: clamp(.92rem,1.5vw,1.03rem); }
.hero-actions { margin-top: 24px; display: flex; gap: 11px; flex-wrap: wrap; }
.hero-panel .btn-ghost { color: #f3f8f5; border-color: rgba(255,255,255,.18); }

.btn {
  min-height: 44px; padding: 0 17px; border: 1px solid var(--border); border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  background: var(--surface-2); color: var(--text); font-weight: 750; cursor: pointer;
  transition: transform .16s ease, border-color .16s ease, background .16s ease, opacity .16s ease;
}
.btn:hover { transform: translateY(-1px); border-color: var(--border-strong); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn-primary { color: #03140b; border-color: var(--brand); background: linear-gradient(135deg,var(--brand),#43e992); box-shadow: 0 10px 25px rgba(32,214,115,.16); }
.btn-primary:hover { background: linear-gradient(135deg,#38e88a,var(--brand)); }
.btn-danger { color: #fff; border-color: rgba(241,91,105,.5); background: rgba(241,91,105,.85); }
.btn-ghost { background: transparent; }
.btn-sm { min-height: 44px; padding: 0 12px; font-size: .78rem; }
.btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; }
[data-theme="light"] .btn-primary { color: #fff; border-color: #055f35; background: linear-gradient(135deg,#087443,#055f35); box-shadow: 0 10px 25px rgba(8,116,67,.18); }
[data-theme="light"] .btn-primary:hover { background: linear-gradient(135deg,#096b40,#044d2b); }
[data-theme="light"] .btn-danger { border-color: #8e1727; background: #ad1f32; }
[data-theme="light"] .skip-link { color: #fff; }
[data-theme="light"] .avatar { background: linear-gradient(145deg,#087443,#055f35); }

.field { display: grid; gap: 7px; min-width: 0; }
.field label { color: var(--text-soft); font-size: .79rem; font-weight: 700; }
.field small { color: var(--text-muted); font-size: .72rem; }
.input, .select, .textarea {
  width: 100%; min-height: 46px; padding: 10px 13px; border: 1px solid var(--border); border-radius: 12px;
  background: color-mix(in srgb,var(--bg) 58%,var(--surface)); color: var(--text); outline: none;
}
.textarea { min-height: 138px; resize: vertical; }
.input::placeholder, .textarea::placeholder { color: var(--text-muted); }
.input:focus, .select:focus, .textarea:focus { border-color: var(--brand); box-shadow: var(--focus); }
.input:disabled { opacity: .68; cursor: not-allowed; }
.input-row { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
.search-field { position: relative; min-width: min(360px,100%); }
.search-field .input { padding-left: 42px; }
.search-field svg { position: absolute; left: 14px; top: 50%; width: 18px; transform: translateY(-50%); fill: none; stroke: var(--text-muted); }
.checkbox-row { display: flex; align-items: flex-start; gap: 10px; color: var(--text-soft); font-size: .82rem; }
.checkbox-row input { width: 18px; height: 18px; accent-color: var(--brand); }

.status-badge, .chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 27px; padding: 3px 9px;
  border-radius: 999px; color: var(--text-soft); background: var(--surface-3); font-size: .7rem; font-weight: 800;
}
.status-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-badge.is-success { color: var(--success); background: rgba(43,212,127,.1); }
.status-badge.is-warning { color: var(--warning); background: rgba(242,184,75,.1); }
.status-badge.is-danger { color: var(--danger); background: rgba(241,91,105,.1); }
.status-badge.is-info { color: var(--blue); background: rgba(95,140,255,.1); }
.chip { min-height: 38px; padding: 6px 13px; border: 1px solid var(--border); cursor: pointer; }
.chip.is-active { color: var(--brand); border-color: var(--border-strong); background: var(--brand-soft); }
.chip-row { display: flex; gap: 8px; flex-wrap: wrap; }

.table-wrap { overflow: auto; border: 1px solid var(--border); border-radius: 17px; background: var(--surface); }
.data-table { width: 100%; border-collapse: collapse; font-size: .82rem; }
.data-table th, .data-table td { padding: 13px 15px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
.data-table th { color: var(--text-muted); background: var(--surface-2); font-size: .67rem; letter-spacing: .07em; text-transform: uppercase; white-space: nowrap; }
.data-table tbody tr:hover { background: rgba(255,255,255,.018); }
.data-table tbody tr:last-child td { border-bottom: 0; }
.table-primary { display: block; min-width: 0; overflow-wrap: anywhere; font-weight: 740; color: var(--text); }
.table-secondary { display: block; min-width: 0; margin-top: 3px; overflow-wrap: anywhere; color: var(--text-muted); font-size: .72rem; }
.data-table td, .data-table code { overflow-wrap: anywhere; word-break: break-word; }
.table-actions { min-width: 0; display: flex; align-items: center; justify-content: flex-end; gap: 6px; flex-wrap: wrap; }

.empty-state { min-height: 220px; padding: 30px; display: grid; place-items: center; text-align: center; }
.empty-state > div { max-width: 430px; }
.empty-icon { width: 56px; height: 56px; margin: 0 auto 14px; display: grid; place-items: center; border-radius: 18px; color: var(--brand); background: var(--brand-soft); }
.empty-state h3 { margin: 0; font-size: 1.05rem; }
.empty-state p { margin: 7px 0 18px; color: var(--text-soft); font-size: .83rem; }
.alert { padding: 13px 15px; display: flex; align-items: flex-start; gap: 10px; border: 1px solid var(--border); border-radius: 13px; background: var(--surface-2); font-size: .82rem; }
.alert.is-danger { color: #ffbdc3; border-color: rgba(241,91,105,.32); background: rgba(241,91,105,.08); }
.alert.is-success { color: #9bf5c4; border-color: rgba(43,212,127,.3); background: rgba(43,212,127,.08); }
.alert.is-warning { color: #ffe2a8; border-color: rgba(242,184,75,.3); background: rgba(242,184,75,.08); }
[data-theme="light"] .alert.is-danger { color: #94182a; border-color: rgba(173,31,50,.35); background: #feeff0; }
[data-theme="light"] .alert.is-success { color: #075f37; border-color: rgba(8,116,67,.32); background: #eafbf2; }
[data-theme="light"] .alert.is-warning { color: #684000; border-color: rgba(116,71,0,.32); background: #fef8ed; }
.toast-region { position: fixed; z-index: 100; top: 90px; right: 20px; width: min(380px,calc(100vw - 32px)); display: grid; gap: 8px; }
.toast { padding: 13px 15px; border: 1px solid var(--border-strong); border-radius: 13px; background: var(--surface); box-shadow: var(--shadow); animation: toast-in .2s ease-out; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } }

.tabs { display: flex; align-items: center; gap: 5px; padding: 5px; overflow-x: auto; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
.tab-button { min-height: 44px; padding: 0 14px; border: 0; border-radius: 10px; background: transparent; color: var(--text-soft); font-weight: 730; white-space: nowrap; cursor: pointer; }
.tab-button.is-active { color: var(--brand); background: var(--brand-soft); }
.dialog-backdrop { position: fixed; inset: 0; z-index: 90; padding: 18px; display: grid; place-items: center; background: rgba(1,7,4,.74); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.dialog { width: min(560px,100%); max-height: calc(100vh - 36px); overflow: auto; border: 1px solid var(--border); border-radius: 22px; background: var(--surface); box-shadow: var(--shadow); }
.dialog-head, .dialog-body, .dialog-actions { padding: 19px 22px; }
.dialog-head { display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--border); }
.dialog-head h2 { margin: 0; font-size: 1.08rem; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 9px; border-top: 1px solid var(--border); }
.event-fieldset { min-width: 0; margin: 0; padding: 16px; border: 1px solid var(--border); border-radius: 15px; }
.event-fieldset legend { padding: 0 6px; color: var(--text-soft); font-size: .79rem; font-weight: 750; }
.event-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 13px; }
.checkbox-row span, .checkbox-row strong, .checkbox-row small { display: block; }
.checkbox-row small { margin-top: 2px; color: var(--text-muted); }
.webhook-list { min-height: 220px; }
.webhook-card { display: flex; flex-direction: column; gap: 16px; }
.webhook-card .card-head { margin-bottom: 0; }
.webhook-url { display: block; overflow: hidden; padding: 11px 13px; border: 1px solid var(--border); border-radius: 11px; color: var(--text-soft); background: var(--bg); text-overflow: ellipsis; white-space: nowrap; }
.chip-row { display: flex; flex-wrap: wrap; gap: 7px; }
.chip { padding: 5px 9px; border: 1px solid var(--border); border-radius: 999px; color: var(--text-soft); background: var(--surface-2); font-size: .7rem; }
.webhook-meta { display: flex; justify-content: space-between; gap: 10px; color: var(--text-muted); font-size: .75rem; }
.card-actions { margin-top: auto; display: flex; flex-wrap: wrap; gap: 8px; }
.secret-box { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 10px; align-items: center; }
.secret-box code { min-width: 0; overflow-wrap: anywhere; padding: 13px; border: 1px solid var(--border); border-radius: 12px; background: var(--bg); }
.skeleton-card { min-height: 190px; display: grid; align-content: center; gap: 14px; }
.skeleton { height: 16px; border-radius: 999px; background: linear-gradient(90deg,var(--surface-2),var(--surface-3),var(--surface-2)); background-size: 220% 100%; animation: skeleton-pulse 1.4s linear infinite; }
.skeleton:nth-child(2) { width: 75%; }.skeleton:nth-child(3) { width: 48%; }
@keyframes skeleton-pulse { to { background-position: -220% 0; } }

.bar-chart { height: 250px; display: flex; align-items: flex-end; gap: clamp(6px,2vw,18px); padding: 22px 10px 0; border-bottom: 1px solid var(--border); }
.bar-column { min-width: 0; flex: 1; display: grid; align-content: end; gap: 7px; text-align: center; color: var(--text-muted); font-size: .65rem; }
.bar { min-height: 4px; border-radius: 7px 7px 2px 2px; background: linear-gradient(180deg,var(--brand),rgba(32,214,115,.38)); box-shadow: 0 0 20px rgba(32,214,115,.08); }
.progress { height: 7px; overflow: hidden; border-radius: 99px; background: var(--surface-3); }
.progress > span { display: block; height: 100%; border-radius: inherit; background: var(--brand); }
.activity-list { display: grid; }
.activity-item { padding: 13px 0; display: grid; grid-template-columns: 35px minmax(0,1fr) auto; gap: 10px; align-items: center; border-bottom: 1px solid var(--border); }
.activity-item:last-child { border-bottom: 0; }
.activity-dot { width: 35px; height: 35px; display: grid; place-items: center; border-radius: 11px; color: var(--brand); background: var(--brand-soft); }
.activity-item strong, .activity-item small { display: block; }
.activity-item strong { font-size: .8rem; }
.activity-item small { color: var(--text-muted); font-size: .69rem; }
.activity-item time { color: var(--text-muted); font-size: .67rem; white-space: nowrap; }

.pagination { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 16px; color: var(--text-soft); font-size: .79rem; }
.pagination-actions { display: flex; gap: 7px; }
.skeleton { position: relative; overflow: hidden; border-radius: 8px; background: var(--surface-3); }
.skeleton::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg,transparent,rgba(255,255,255,.06),transparent); animation: shimmer 1.3s infinite; }
@keyframes shimmer { to { transform: translateX(100%); } }

.admin-accent { border-left: 3px solid var(--brand); }
.health-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.health-item { padding: 12px; border: 1px solid var(--border); border-radius: 13px; background: var(--surface-2); }
.health-item span { display: block; color: var(--text-muted); font-size: .68rem; }
.health-item strong { display: block; margin-top: 4px; font-size: .92rem; }

.nav-backdrop { display: none; }
@media (max-width: 1279px) and (min-width: 901px) {
  :root { --sidebar: 82px; }
  .sidebar-brand { padding: 0 15px; justify-content: center; }
  .sidebar-brand img { width: 48px; height: 48px; object-fit: cover; object-position: left; }
  .sidebar-profile { margin-inline: 12px; padding: 8px; display: flex; justify-content: center; }
  .sidebar-profile > div:last-child, .nav-section, .nav-label { display: none; }
  .nav-link { justify-content: center; padding: 0; }
  .nav-link:hover { transform: none; }
}

@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .grid-main-aside { grid-template-columns: 1fr; }
  .topbar-stat { display: none; }
}

@media (max-width: 900px) {
  .app-shell { display: block; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: min(82vw,300px); height: 100dvh; transform: translateX(-105%); transition: transform .22s ease; box-shadow: var(--shadow); }
  body.nav-open .sidebar { transform: translateX(0); }
  .icon-button.sidebar-close { display: inline-grid; }
  .nav-backdrop { position: fixed; inset: 0; z-index: 35; display: block; visibility: hidden; opacity: 0; border: 0; background: rgba(0,0,0,.56); transition: opacity .2s ease, visibility .2s; }
  body.nav-open .nav-backdrop { visibility: visible; opacity: 1; }
  .icon-button.mobile-menu { display: inline-grid; }
  .topbar { min-height: 70px; padding-inline: 16px; }
  .topbar-actions .topbar-user { display: none; }
  .page-content { padding: 22px 16px 34px; }
  .page-heading p { max-width: 52vw; }
}

@media (max-width: 720px) {
  .grid-2, .grid-3, .grid-4, .input-row { grid-template-columns: 1fr; }
  .event-grid { grid-template-columns: 1fr; }
  .webhook-meta { align-items: flex-start; flex-direction: column; }
  .secret-box { grid-template-columns: 1fr; }
  .secret-box .btn { width: 100%; }
  .span-2 { grid-column: auto; }
  .page-toolbar { align-items: stretch; flex-direction: column; }
  .toolbar-actions { width: 100%; }
  .toolbar-actions > .btn, .toolbar-actions > .search-field { flex: 1; }
  .hero-panel { min-height: 310px; align-items: flex-start; }
  .hero-copy h2 { font-size: clamp(2rem,11vw,3rem); }
  .app-card { padding: 18px; border-radius: 19px; }
  .table-wrap.mobile-cards { overflow: visible; border: 0; background: transparent; }
  .mobile-cards .data-table, .mobile-cards thead, .mobile-cards tbody, .mobile-cards tr, .mobile-cards td { display: block; }
  .mobile-cards thead { display: none; }
  .mobile-cards tr { margin-bottom: 12px; padding: 8px 15px; border: 1px solid var(--border); border-radius: 15px; background: var(--surface); }
  .mobile-cards td { min-width: 0; min-height: 38px; padding: 9px 0; display: flex; align-items: flex-start; justify-content: space-between; gap: 10px 14px; flex-wrap: wrap; overflow-wrap: anywhere; border-bottom: 1px solid var(--border); text-align: right; }
  .mobile-cards td::before { content: attr(data-label); flex: 0 0 min(34%,8rem); color: var(--text-muted); font-size: .7rem; font-weight: 800; text-transform: uppercase; text-align: left; }
  .mobile-cards td > * { min-width: 0; max-width: 100%; }
  .mobile-cards td:last-child { border-bottom: 0; }
  .mobile-cards .table-actions { flex: 1 1 12rem; justify-content: flex-end; flex-wrap: wrap; }
  .mobile-cards .table-actions .btn { flex: 0 1 auto; white-space: normal; }
  .mobile-cards code { max-width: min(100%,22rem); white-space: normal; overflow-wrap: anywhere; word-break: break-word; }
  .bar-chart { gap: 5px; height: 210px; }
  .bar-column span { font-size: .58rem; transform: rotate(-35deg); transform-origin: center; }
}

@media (max-width: 440px) {
  .topbar-actions .theme-label { display: none; }
  .page-heading p { display: none; }
  .hero-actions .btn { width: 100%; }
  .btn { padding-inline: 14px; }
  .metric-card { min-height: 126px; }
  .health-grid { grid-template-columns: 1fr; }
  .dialog-backdrop { padding: 0; place-items: end center; }
  .dialog { max-height: 92dvh; border-radius: 22px 22px 0 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

@media print {
  .sidebar, .topbar, .nav-backdrop, .no-print { display: none !important; }
  .app-shell { display: block; }
  body { background: #fff; color: #111; }
  .app-card, .table-wrap { box-shadow: none; border-color: #bbb; }
}
