/* Sentinel interface refresh: Magic-inspired security operations console */
:root {
  --bg: #f3f6fb;
  --panel: #ffffff;
  --panel-soft: #f7f9fc;
  --text: #101828;
  --muted: #667085;
  --line: #e4e9f1;
  --line-strong: #d2d9e5;
  --accent: #0f9f86;
  --accent-strong: #087763;
  --accent-soft: #e8f8f4;
  --warning: #d78b18;
  --warning-soft: #fff7e7;
  --danger: #dc4c4c;
  --danger-soft: #fff0f0;
  --info: #4677e8;
  --info-soft: #edf3ff;
  --ink: #182230;
  --sidebar: #0c1424;
  --sidebar-muted: #8d9ab0;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.03), 0 10px 28px rgba(16, 24, 40, 0.055);
  --shadow-hover: 0 2px 5px rgba(16, 24, 40, 0.04), 0 18px 42px rgba(16, 24, 40, 0.09);
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
}

html {
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 72% -12%, rgba(70, 119, 232, 0.11), transparent 29rem),
    radial-gradient(circle at 92% 28%, rgba(15, 159, 134, 0.07), transparent 25rem),
    var(--bg);
  color: var(--text);
  font-family: Inter, "Segoe UI Variable Text", "Segoe UI", ui-sans-serif, system-ui, sans-serif;
  font-size: 14px;
  letter-spacing: -0.005em;
}

body::before {
  position: fixed;
  z-index: 0;
  inset: 0 0 0 var(--sidebar-width, 272px);
  pointer-events: none;
  background-image:
    linear-gradient(rgba(77, 102, 142, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(77, 102, 142, 0.035) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.55), transparent 58%);
  content: "";
}

::selection {
  background: rgba(15, 159, 134, 0.2);
}

:focus-visible {
  outline: 3px solid rgba(70, 119, 232, 0.3);
  outline-offset: 2px;
}

.skip-link {
  position: fixed;
  z-index: 200;
  top: 12px;
  left: 12px;
  transform: translateY(-160%);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  background: #fff;
  color: var(--text);
  box-shadow: var(--shadow-hover);
  font-weight: 700;
  transition: transform 140ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.traffic-background {
  opacity: 0.35;
}

.traffic-background::after {
  background: linear-gradient(180deg, rgba(243, 246, 251, 0.77), rgba(243, 246, 251, 0.96));
}

.shell {
  --sidebar-width: 272px;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
}

.topbar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  max-width: var(--sidebar-width);
  border-right: 1px solid rgba(255, 255, 255, 0.065);
  padding: 20px 14px 14px;
  background:
    radial-gradient(circle at 18% 0, rgba(48, 207, 174, 0.12), transparent 16rem),
    linear-gradient(180deg, #0c1628 0%, #0a1220 100%);
  box-shadow: 10px 0 40px rgba(14, 25, 45, 0.08);
}

.brand {
  min-height: 62px;
  border-bottom-color: rgba(255, 255, 255, 0.075);
  padding: 0 7px 18px;
}

.brand-mark {
  position: relative;
}

.brand-mark::after {
  position: absolute;
  inset: 9px;
  border: 3px solid #0d1728;
  border-top-width: 2px;
  border-radius: 50% 50% 46% 46%;
  clip-path: polygon(50% 0, 100% 18%, 86% 78%, 50% 100%, 14% 78%, 0 18%);
  content: "";
}

.brand h1 {
  color: #f8fbff;
  font-size: 19px;
  letter-spacing: -0.035em;
}

.brand p {
  color: #7f8da5;
  font-size: 11px;
}

.sidebar-collapse {
  width: 30px;
  height: 30px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.035);
}

.top-actions {
  gap: 12px;
}

.sidebar-search {
  position: relative;
}

.sidebar-search input,
.tenant-picker input,
.timezone-trigger,
.language-trigger {
  min-height: 40px;
  border-color: rgba(255, 255, 255, 0.08);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.045);
  color: #edf3fb;
  transition: border-color 150ms ease, background 150ms ease, box-shadow 150ms ease;
}

.sidebar-search input {
  padding-right: 38px;
}

.sidebar-search input:focus,
.tenant-picker input:focus,
.timezone-trigger:focus-visible,
.language-trigger:focus-visible {
  border-color: rgba(56, 207, 177, 0.55);
  background: rgba(255, 255, 255, 0.075);
  box-shadow: 0 0 0 3px rgba(56, 207, 177, 0.1);
}

.sidebar-search kbd {
  position: absolute;
  right: 9px;
  bottom: 8px;
  display: grid;
  width: 23px;
  height: 23px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.055);
  color: #8290a6;
  font: 700 11px/1 ui-monospace, SFMono-Regular, Consolas, monospace;
}

.control-label,
.nav-group-label {
  color: #68768d;
  font-size: 9px;
  letter-spacing: 0.12em;
}

.tabs {
  gap: 4px;
  margin-inline: -3px;
  padding-right: 2px;
}

.tabs::-webkit-scrollbar {
  width: 5px;
}

.tabs::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
}

.tab {
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 10px;
  padding-inline: 9px;
  color: #95a2b6;
  transition: color 140ms ease, background 140ms ease, border-color 140ms ease, transform 140ms ease;
}

.tab:hover {
  border-color: rgba(255, 255, 255, 0.055);
  background: rgba(255, 255, 255, 0.045);
  color: #f5f8fc;
  transform: translateX(2px);
}

.tab.active {
  border-color: rgba(46, 201, 169, 0.15);
  background: linear-gradient(90deg, rgba(39, 199, 165, 0.16), rgba(39, 199, 165, 0.055));
  color: #fff;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.025);
}

.tab::before {
  top: 10px;
  bottom: 10px;
  width: 3px;
  border-radius: 999px;
}

.nav-icon {
  width: 27px;
  height: 27px;
  border-color: rgba(255, 255, 255, 0.07);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  color: #76849a;
  font-size: 8px;
  letter-spacing: 0.04em;
}

.tab.active .nav-icon {
  border-color: rgba(48, 207, 174, 0.24);
  background: rgba(48, 207, 174, 0.13);
  color: #5cdec3;
  box-shadow: 0 0 18px rgba(48, 207, 174, 0.09);
}

.sidebar-footer {
  border-top-color: rgba(255, 255, 255, 0.075);
  padding: 14px 3px 0;
}

.role-badge {
  min-height: 27px;
  border-color: rgba(48, 207, 174, 0.23);
  background: rgba(48, 207, 174, 0.09);
  color: #68dfc6;
}

.topbar .button.secondary {
  min-height: 38px;
  border-color: rgba(255, 255, 255, 0.09);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.045);
}

.topbar .logout-button {
  border-color: rgba(231, 86, 95, 0.18);
  color: #ffc3c7;
}

.topbar .logout-button:hover,
.topbar .logout-button:focus-visible {
  border-color: rgba(231, 86, 95, 0.36);
  background: rgba(231, 86, 95, 0.1);
  color: #fff;
}

.workspace-header {
  min-height: 96px;
  border-bottom: 1px solid rgba(210, 217, 229, 0.78);
  padding: 18px clamp(22px, 3vw, 46px);
  background: rgba(248, 250, 253, 0.82);
  box-shadow: 0 8px 25px rgba(16, 24, 40, 0.025);
  backdrop-filter: blur(18px) saturate(140%);
}

.workspace-header h2 {
  margin-top: 3px;
  color: #101828;
  font-size: clamp(20px, 2vw, 25px);
  font-weight: 760;
  letter-spacing: -0.035em;
}

.workspace-header p {
  font-size: 12px;
}

.workspace-breadcrumb {
  color: var(--accent) !important;
  font-size: 10px !important;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.workspace-actions {
  gap: 10px;
}

.workspace-tenant {
  min-height: 36px;
  border-color: var(--line);
  border-radius: 9px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.03);
}

.workspace-tenant::before {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 7px;
  border-radius: 50%;
  background: #20b996;
  box-shadow: 0 0 0 4px rgba(32, 185, 150, 0.11);
  content: "";
}

.icon-button {
  width: 38px;
  height: 38px;
  border-color: var(--line);
  border-radius: 10px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.025);
  transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease;
}

.icon-button:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.view {
  width: min(100%, 1600px);
  padding: 30px clamp(22px, 3vw, 46px) 72px;
}

.band {
  margin-bottom: 38px;
}

.section-title {
  margin-bottom: 18px;
}

.eyebrow {
  margin-bottom: 5px;
  color: var(--accent);
  font-size: 10px;
  letter-spacing: 0.1em;
}

h2 {
  color: #101828;
  font-size: clamp(22px, 2.2vw, 30px);
  font-weight: 760;
  letter-spacing: -0.04em;
}

h3 {
  color: #1d2939;
  font-weight: 720;
  letter-spacing: -0.015em;
}

.section-description {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.panel,
.resource-row,
.tracked-row,
.analytics-details,
.workspace-disclosure,
.create-resource {
  border-color: var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.panel {
  padding: 19px;
}

.panel,
.resource-row,
.tracked-row,
.metric,
.attention-item {
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.panel:hover,
.resource-row:hover,
.tracked-row:hover {
  border-color: #d5dce8;
  box-shadow: var(--shadow-hover);
}

.metric-grid {
  gap: 12px;
  margin-bottom: 18px;
}

.metric {
  display: grid;
  grid-template-rows: 30px auto minmax(34px, auto);
  align-content: start;
  gap: 8px;
  position: relative;
  min-height: 154px;
  overflow: hidden;
  border-color: var(--line);
  border-radius: var(--radius);
  padding: 18px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.99), rgba(249, 251, 254, 0.98));
  box-shadow: var(--shadow);
}

.metric::after {
  position: absolute;
  right: -22px;
  bottom: -28px;
  width: 90px;
  height: 90px;
  border: 18px solid rgba(70, 119, 232, 0.035);
  border-radius: 50%;
  content: "";
}

.metric:hover {
  transform: translateY(-2px);
  border-color: #d5dce8;
  box-shadow: var(--shadow-hover);
}

.primary-metrics .metric {
  border-top: 0;
}

.primary-metrics .metric::before {
  position: absolute;
  top: 0;
  right: 18px;
  left: 18px;
  height: 3px;
  border-radius: 0 0 999px 999px;
  background: var(--info);
  content: "";
}

.primary-metrics .metric-good::before {
  background: var(--accent);
}

.primary-metrics .metric-warn::before {
  background: var(--warning);
}

.primary-metrics .metric-bad::before {
  background: var(--danger);
}

.metric .meta {
  position: relative;
  z-index: 1;
  display: -webkit-box;
  min-height: 30px;
  overflow: hidden;
  color: #7b8798;
  font-size: 10px;
  line-height: 1.45;
  letter-spacing: 0.075em;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.metric-value {
  position: relative;
  z-index: 1;
  align-self: start;
  margin-top: 0;
  color: #101828;
  font-size: clamp(23px, 2.2vw, 30px);
  line-height: 1.05;
  font-weight: 780;
  letter-spacing: -0.04em;
}

.metric-help {
  position: relative;
  z-index: 1;
  align-self: start;
  min-height: 34px;
  margin: 0;
  font-size: 11px;
  line-height: 1.35;
}

.attention-panel {
  gap: 10px;
  margin-bottom: 18px;
}

.attention-item {
  min-height: 82px;
  grid-template-columns: 10px minmax(0, 1fr);
  border-color: var(--line);
  border-radius: var(--radius);
  padding: 15px 16px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 1px 3px rgba(16, 24, 40, 0.035);
}

.attention-item:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.attention-marker {
  width: 9px;
  height: 9px;
  box-shadow: 0 0 0 4px rgba(70, 119, 232, 0.1);
}

.attention-item.warning .attention-marker {
  box-shadow: 0 0 0 4px rgba(215, 139, 24, 0.12);
}

.attention-item.critical .attention-marker {
  box-shadow: 0 0 0 4px rgba(220, 76, 76, 0.12);
}

.attention-item.success .attention-marker {
  box-shadow: 0 0 0 4px rgba(15, 159, 134, 0.12);
}

.attention-item strong {
  color: #182230;
  font-size: 13px;
}

.analytics-details,
.workspace-disclosure,
.create-resource {
  overflow: hidden;
  padding-inline: 18px;
}

.analytics-details > summary,
.workspace-disclosure > summary,
.create-resource > summary,
.technical-details > summary {
  min-height: 62px;
}

.analytics-details[open] > summary,
.workspace-disclosure[open] > summary,
.create-resource[open] > summary {
  border-bottom-color: var(--line);
}

.workspace-disclosure > summary > span > strong {
  color: #1d2939;
  font-size: 15px;
}

.overview-disclosure {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 18px 16px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.overview-disclosure > summary {
  min-height: 54px;
  border-bottom-color: var(--line);
}

.disclosure-content,
.disclosure-panel {
  margin-top: 14px;
}

.overview-grid,
.traffic-insights-grid,
.web-analytics-grid,
.settings-grid,
.rules-grid,
.system-grid,
.result-grid,
.session-investigation {
  gap: 16px;
}

.calibration-sample-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(320px, 1.1fr);
  gap: 16px;
  margin-top: 16px;
}

.calibration-sample-form,
.calibration-samples-panel {
  display: grid;
  align-content: start;
  gap: 13px;
}

.calibration-sample-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 13px;
  background: rgba(248, 250, 252, 0.72);
}

.calibration-sample-row + .calibration-sample-row {
  margin-top: 10px;
}

.calibration-sample-row strong {
  display: block;
  overflow-wrap: anywhere;
  color: #182230;
  font-size: 12px;
}

.calibration-sample-notes {
  margin-top: 5px;
  color: #667085;
  font-size: 12px;
}

@media (max-width: 980px) {
  .calibration-sample-grid {
    grid-template-columns: 1fr;
  }
}

.section-badge,
.health-badge,
.cell-badge,
.severity,
.resource-status,
.mode-badge {
  border-radius: 999px;
}

.section-badge,
.health-badge {
  min-height: 31px;
  padding-inline: 11px;
}

.health-badge {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.025);
}

label {
  gap: 7px;
  color: #475467;
  font-size: 12px;
  font-weight: 650;
}

input,
select {
  min-height: 42px;
  border-color: var(--line-strong);
  border-radius: 9px;
  padding: 8px 12px;
  background: #fff;
  color: #182230;
  transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

input:hover,
select:hover {
  border-color: #b9c3d2;
}

input:focus,
select:focus {
  border-color: var(--info);
  box-shadow: 0 0 0 4px rgba(70, 119, 232, 0.11);
}

.button {
  min-height: 41px;
  border-color: #0b8f78;
  border-radius: 9px;
  padding-inline: 15px;
  background: linear-gradient(180deg, #16a88e, #0c8d77);
  box-shadow: 0 1px 2px rgba(7, 103, 86, 0.2);
  font-weight: 700;
  transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.button:hover {
  transform: translateY(-1px);
  border-color: #087763;
  background: linear-gradient(180deg, #119b83, #087763);
  box-shadow: 0 7px 18px rgba(8, 119, 99, 0.17);
}

.button.secondary {
  border-color: var(--line-strong);
  background: #fff;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.03);
  color: #344054;
}

.button.secondary:hover {
  border-color: #b7c1d0;
  background: #f8fafc;
}

.button.danger {
  border-color: #f0c4c4;
  background: #fff5f5;
  box-shadow: none;
}

.switch {
  width: 45px;
  height: 26px;
}

.switch span {
  background: #c5cdd8;
  box-shadow: inset 0 0 0 1px rgba(16, 24, 40, 0.04);
}

.switch span::before {
  width: 20px;
  height: 20px;
}

.switch input:checked + span {
  background: linear-gradient(90deg, #0e927b, #18b497);
}

.switch input:checked + span::before {
  transform: translateX(19px);
}

.table-wrap {
  border-color: var(--line);
  border-radius: 10px;
  background: #fff;
  scrollbar-color: #c8d1de transparent;
}

table {
  background: transparent;
}

th {
  position: sticky;
  z-index: 1;
  top: 0;
  border-bottom-color: var(--line);
  padding: 11px 13px;
  background: #f6f8fb;
  color: #667085;
  font-size: 9px;
  letter-spacing: 0.07em;
}

td {
  border-bottom-color: #edf0f5;
  padding: 12px 13px;
  color: #344054;
  font-size: 12px;
}

tbody tr {
  transition: background 120ms ease;
}

tbody tr:hover {
  background: #f7fafc;
}

.resource-scope-bar {
  border-color: var(--line);
  border-radius: var(--radius);
  padding: 18px;
  background:
    linear-gradient(135deg, rgba(70, 119, 232, 0.045), rgba(15, 159, 134, 0.045)),
    #fafcff;
}

.subtabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0;
  border-bottom: 1px solid var(--line);
}

.subtab {
  min-height: 38px;
  border: 0;
  border-bottom: 2px solid transparent;
  padding: 0 12px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  font-weight: 720;
  cursor: pointer;
}

.subtab:hover {
  color: var(--text);
}

.subtab.active {
  border-bottom-color: var(--accent);
  color: var(--accent-strong);
}

.subtab-band {
  margin-bottom: 18px;
}

.subtab-band .subtabs {
  margin-top: 0;
}

.event-stream-console {
  display: grid;
  gap: 14px;
  max-width: 100%;
  overflow: visible;
}

.event-summary-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.event-summary-grid .metric {
  min-width: 0;
  min-height: 108px;
  padding: 16px 18px;
}

.event-summary-grid .metric-value {
  margin-top: 8px;
  font-size: 28px;
}

.event-summary-grid .metric-help {
  margin-top: 8px;
  font-size: 11px;
  line-height: 1.35;
}

.event-workbench {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  min-height: 0;
  overflow: visible;
}

.event-hotlist-panel,
.event-tabs-panel {
  min-width: 0;
}

.event-hotlist-panel {
  max-height: none;
  overflow: visible;
}

.event-tabs-panel {
  display: grid;
  gap: 14px;
  min-width: 0;
  overflow: visible;
}

.event-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px;
  background: #f7fafc;
}

.event-tab {
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 0 14px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  font-weight: 760;
  cursor: pointer;
}

.event-tab:hover {
  color: var(--ink);
}

.event-tab.active {
  border-color: rgba(15, 159, 134, 0.28);
  background: #e7faf6;
  color: var(--accent-strong);
  box-shadow: inset 0 0 0 1px rgba(15, 159, 134, 0.08);
}

.event-panel {
  display: grid;
  gap: 12px;
  min-width: 0;
  min-height: 0;
  overflow: visible;
}

.event-panel[hidden] {
  display: none !important;
}

.event-timeline {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.event-timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 10px;
  padding-bottom: 12px;
}

.event-timeline-item::before {
  position: absolute;
  top: 15px;
  bottom: -3px;
  left: 6px;
  width: 2px;
  background: var(--line);
  content: "";
}

.event-timeline-item:last-child::before {
  display: none;
}

.event-timeline-marker {
  position: relative;
  z-index: 1;
  width: 14px;
  height: 14px;
  margin-top: 14px;
  border: 3px solid #fff;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 1px var(--line-strong);
}

.event-timeline-item.warn .event-timeline-marker {
  background: var(--warning);
}

.event-timeline-item.bad .event-timeline-marker {
  background: var(--danger);
}

.event-timeline-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  background: #fff;
}

.event-timeline-head,
.event-timeline-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.event-timeline-head strong {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 13px;
}

.event-timeline-meta,
.event-timeline-details {
  margin: 6px 0 0;
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.event-timeline-details {
  color: var(--muted-strong);
}

.event-timeline-footer {
  margin-top: 10px;
  border-top: 1px solid var(--line);
  padding-top: 9px;
  color: var(--muted);
  font-size: 11px;
}

.event-timeline-score {
  flex: 0 0 auto;
  color: var(--ink);
  font-weight: 800;
}

@media (max-width: 760px) {
  .fp-review-status-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .event-timeline-head,
  .event-timeline-footer {
    align-items: flex-start;
    flex-direction: column;
  }
}

.log-query-form {
  display: grid;
  grid-template-columns: minmax(140px, 0.8fr) repeat(2, minmax(190px, 1fr)) minmax(150px, 0.8fr) minmax(100px, 0.55fr) auto;
  gap: 12px;
  align-items: end;
}

.log-query-form .button {
  min-height: 42px;
  white-space: nowrap;
}

.log-query-form input,
.log-query-form select {
  min-width: 0;
}

@media (max-width: 1180px) {
  .log-query-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .log-query-form .button {
    width: 100%;
  }
}

.event-signal-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  align-items: stretch;
}

.event-signal {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  width: 100%;
  min-width: 0;
  max-width: none;
  min-height: 76px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
  color: inherit;
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.event-signal-marker {
  width: 8px;
  height: 8px;
  margin-top: 5px;
  border-radius: 999px;
  background: var(--accent);
}

.event-signal.warn .event-signal-marker {
  background: var(--warning);
}

.event-signal.bad .event-signal-marker {
  background: var(--danger);
}

.event-signal-title {
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
}

.event-signal-meta,
.event-signal-reasons {
  margin: 4px 0 0;
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.event-signal-reasons {
  color: var(--muted-strong);
  display: -webkit-box;
  max-height: 2.9em;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.event-signal-score {
  min-width: 34px;
  border-radius: 999px;
  padding: 4px 8px;
  background: #edf3f8;
  color: var(--ink);
  font-size: 12px;
  font-weight: 850;
  text-align: center;
}

.event-signal.warn .event-signal-score {
  background: #fff5df;
  color: #9a6300;
}

.event-signal.bad .event-signal-score {
  background: #ffe8e8;
  color: #c73737;
}

.event-panel > .result-panel {
  min-width: 0;
  overflow: visible;
}

.event-panel > .result-panel > .table-wrap {
  max-height: calc(100dvh - 430px);
  min-height: 360px;
  overflow: auto;
}

.event-panel > .result-panel table {
  min-width: 1180px;
}

.event-panel > .result-panel .column-reasons {
  max-width: 300px;
}

.empty-state.compact {
  margin: 0;
  padding: 14px;
  font-size: 12px;
}

.empty-state {
  border-color: #ccd5e2;
  border-radius: 10px;
  padding: 22px;
  background: linear-gradient(145deg, #fafbfd, #f6f8fb);
  color: #7a8698;
}

.error-page-policy {
  margin-top: 16px;
  margin-bottom: 30px;
  padding-bottom: 28px;
}

.captcha-policy {
  margin-top: 16px;
  margin-bottom: 30px;
  overflow: hidden;
}

.captcha-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 16px;
}

.captcha-grid label {
  display: grid;
  grid-template-rows: auto 42px minmax(16px, auto);
  align-content: start;
  align-self: start;
  gap: 7px;
}

.captcha-host-check {
  align-self: end;
  display: flex;
  grid-template-rows: none;
  min-height: 42px;
}

.captcha-hosts-field {
  grid-column: span 2;
}

.captcha-actions {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 22px 0 0;
  border-top: 1px solid var(--line);
  padding: 12px 16px 14px;
  background: var(--panel-soft);
}

.captcha-actions .section-note {
  margin: 0;
  line-height: 1.45;
}

.captcha-actions .button {
  min-width: 176px;
  min-height: 42px;
  margin: 0;
}

.error-page-grid {
  display: grid;
  gap: 14px;
}

.error-page-html-field textarea {
  min-height: 220px;
  resize: vertical;
  font-family: "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
  line-height: 1.55;
}

.toast {
  border-radius: 11px;
  box-shadow: 0 18px 44px rgba(16, 24, 40, 0.17);
}

.platform-overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 16px;
  margin-top: 2px;
}

.emergency-control-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 16px 0;
  border-color: rgba(245, 158, 11, 0.28);
  background:
    linear-gradient(135deg, rgba(245, 158, 11, 0.08), rgba(255, 255, 255, 0.92)),
    #fff;
}

.emergency-control-card.is-active {
  border-color: rgba(220, 38, 38, 0.38);
  background:
    linear-gradient(135deg, rgba(220, 38, 38, 0.09), rgba(255, 255, 255, 0.94)),
    #fff;
}

.emergency-control-copy {
  min-width: 0;
}

.emergency-control-copy h3 {
  margin: 2px 0 4px;
  font-size: 17px;
}

.emergency-control-copy p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.emergency-control-actions {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
}

.emergency-switch {
  flex: 0 0 auto;
}

.l7-ddos-card {
  display: grid;
  gap: 16px;
  margin: 0 0 16px;
}

.l7-ddos-dashboard {
  display: grid;
  gap: 16px;
}

.data-cluster-card {
  display: grid;
  gap: 16px;
  margin: 0 0 16px;
}

.data-cluster-dashboard {
  display: grid;
  gap: 14px;
}

.data-cluster-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.data-cluster-list {
  display: grid;
  gap: 8px;
}

.data-cluster-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  background: var(--panel-soft);
}

.data-cluster-row > div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.data-cluster-row strong,
.data-cluster-row span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.data-cluster-row > div > span,
.data-cluster-note {
  color: var(--muted);
  font-size: 12px;
}

.data-cluster-note {
  margin: 0;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.data-cluster-note.warn {
  color: var(--danger);
}

.l7-ddos-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.l7-ddos-metric {
  position: relative;
  min-width: 0;
  min-height: 112px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px;
  background: var(--panel-soft);
}

.l7-ddos-metric::after {
  content: "";
  position: absolute;
  right: -24px;
  bottom: -34px;
  width: 86px;
  height: 86px;
  border: 18px solid rgba(22, 163, 127, 0.07);
  border-radius: 999px;
}

.l7-ddos-metric.bad {
  border-color: rgba(239, 68, 68, 0.22);
}

.l7-ddos-metric.warn {
  border-color: rgba(245, 158, 11, 0.28);
}

.l7-ddos-metric span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.l7-ddos-metric strong {
  display: block;
  margin-top: 10px;
  color: var(--text);
  font-size: 28px;
  line-height: 1;
}

.l7-ddos-metric small {
  display: block;
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.l7-ddos-timeline {
  display: grid;
  gap: 10px;
  min-height: 158px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px;
  background: #fff;
}

.mini-chart-title {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.l7-ddos-bars {
  display: flex;
  align-items: flex-end;
  gap: 5px;
  height: 96px;
  padding-top: 12px;
  border-bottom: 1px solid var(--line);
}

.l7-ddos-bar {
  flex: 1 1 0;
  min-width: 4px;
  border-radius: 999px 999px 0 0;
  background: rgba(22, 163, 127, 0.34);
}

.l7-ddos-bar.hot {
  background: rgba(245, 158, 11, 0.72);
}

.l7-ddos-bar.blocked {
  background: rgba(239, 68, 68, 0.74);
}

.l7-ddos-lists {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.l7-ddos-list {
  display: grid;
  gap: 10px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px;
  background: var(--panel-soft);
}

.l7-ddos-list > strong {
  font-size: 13px;
}

.l7-ddos-list-row {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  min-height: 32px;
  align-items: start;
  padding-bottom: 7px;
}

.l7-ddos-list-row span {
  min-width: 0;
  overflow: hidden;
  color: #344054;
  font-size: 12px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.l7-ddos-list-row b {
  color: var(--text);
  font-size: 12px;
}

.l7-ddos-list-row i {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 3px;
  border-radius: 999px;
  background: rgba(22, 163, 127, 0.72);
}

.platform-operations-card,
.platform-attention-card {
  min-width: 0;
}

.platform-network-overrides-card {
  margin-top: 12px;
}

.network-override-form {
  display: grid;
  grid-template-columns: minmax(180px, 1.1fr) minmax(170px, 0.9fr) minmax(180px, 1fr) minmax(220px, 1.2fr) minmax(140px, 0.7fr);
  gap: 12px;
  align-items: end;
  margin-top: 16px;
}

.network-override-form > label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.network-override-form > label > input,
.network-override-form > label > select {
  min-height: 42px;
}

.network-override-form .button {
  min-height: 42px;
  white-space: nowrap;
}

.remote-installation-form {
  display: grid;
  gap: 16px;
  margin-bottom: 16px;
}

.remote-installation-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
}

.remote-installation-grid label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.remote-installation-grid input,
.remote-installation-grid select {
  min-height: 42px;
}

.remote-installation-product-summary {
  display: grid;
  gap: 4px;
  border: 1px solid rgba(13, 148, 136, 0.24);
  border-radius: 12px;
  padding: 12px 14px;
  background: rgba(20, 184, 166, 0.07);
}

.remote-installation-product-summary p,
.remote-installation-product-summary small {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.remote-installation-product-summary p {
  font-size: 13px;
}

.remote-installation-product-summary small {
  font-size: 12px;
}

.remote-installation-advanced {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0 14px;
  background: var(--panel-soft);
}

.remote-installation-advanced summary {
  min-height: 44px;
  align-content: center;
  color: var(--text);
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
}

.remote-installation-advanced[open] {
  display: grid;
  gap: 12px;
  padding-bottom: 14px;
}

.remote-installation-list {
  display: grid;
  gap: 12px;
}

.remote-installation-card {
  border-left: 4px solid var(--line);
}

.remote-installation-card.trust-trusted {
  border-left-color: var(--accent);
}

.remote-installation-card.trust-degraded {
  border-left-color: var(--warning);
}

.remote-installation-card.trust-untrusted,
.remote-installation-card.trust-tampered {
  border-left-color: var(--danger);
}

.remote-installation-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.remote-installation-meta > div {
  display: grid;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  background: var(--panel-soft);
  min-width: 0;
}

.remote-installation-meta span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.remote-installation-meta strong {
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: 13px;
}

.remote-installation-trust {
  display: grid;
  gap: 6px;
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  background: rgba(248, 250, 252, 0.78);
}

.remote-installation-trust p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.remote-installation-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 14px;
}

.network-overrides-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.network-override-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  background: var(--panel-soft);
}

.network-override-row strong {
  color: #1d2939;
  font-size: 13px;
}

.network-override-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.platform-operations-card .panel-head,
.platform-attention-card .panel-head {
  align-items: flex-start;
  margin-bottom: 16px;
}

.platform-signal-list,
.platform-attention-list {
  display: grid;
  gap: 8px;
}

.platform-signal {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 43px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.platform-signal:first-child {
  border-top: 0;
}

.platform-signal-value {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  color: #344054;
  font-size: 12px;
}

.platform-signal-value::before {
  width: 8px;
  height: 8px;
  margin-right: 8px;
  border-radius: 50%;
  background: #98a2b3;
  content: "";
}

.platform-signal-value.good::before {
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(15, 159, 134, 0.1);
}

.platform-signal-value.warn::before {
  background: var(--warning);
  box-shadow: 0 0 0 4px rgba(215, 139, 24, 0.1);
}

.platform-signal-value.bad::before {
  background: var(--danger);
  box-shadow: 0 0 0 4px rgba(220, 76, 76, 0.1);
}

.platform-attention-item {
  display: grid;
  grid-template-columns: 9px minmax(0, 1fr);
  gap: 12px;
  min-height: 62px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 13px;
  background: var(--panel-soft);
}

.platform-attention-marker {
  width: 9px;
  height: 9px;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--info);
}

.platform-attention-item.warning .platform-attention-marker {
  background: var(--warning);
  box-shadow: 0 0 0 4px rgba(215, 139, 24, 0.1);
}

.platform-attention-item.critical .platform-attention-marker {
  background: var(--danger);
  box-shadow: 0 0 0 4px rgba(220, 76, 76, 0.1);
}

.platform-attention-item.success .platform-attention-marker {
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(15, 159, 134, 0.1);
}

.platform-attention-item strong {
  color: #1d2939;
  font-size: 12px;
}

.platform-attention-item p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

@media (max-width: 1180px) {
  .primary-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .settings-grid,
  .rules-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .platform-overview-grid {
    grid-template-columns: 1fr;
  }

  .network-override-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .l7-ddos-metrics,
  .l7-ddos-lists,
  .data-cluster-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .emergency-control-card {
    align-items: flex-start;
    flex-direction: column;
  }

  .emergency-control-actions {
    justify-content: space-between;
    width: 100%;
  }

  .network-override-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .network-override-actions {
    justify-content: space-between;
    width: 100%;
  }
}

@media (max-width: 760px) {
  body::before {
    inset: 0;
  }

  .l7-ddos-metrics,
  .l7-ddos-lists {
    grid-template-columns: 1fr;
  }

  .shell,
  .sidebar-collapsed .shell {
    width: 100%;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
  }

  .topbar {
    width: min(310px, calc(100vw - 36px));
    min-width: 0;
    max-width: none;
    padding: 20px 15px 15px;
    box-shadow: 24px 0 70px rgba(8, 16, 30, 0.28);
  }

  .topbar .tabs,
  .sidebar-collapsed .topbar .tabs {
    grid-template-columns: 1fr;
  }

  .mobile-nav-toggle {
    top: 16px;
    width: 42px;
    height: 42px;
    border-color: var(--line);
    border-radius: 11px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: var(--shadow);
    backdrop-filter: blur(12px);
  }

  .sidebar-overlay {
    background: rgba(7, 13, 24, 0.54);
    backdrop-filter: blur(5px);
  }

  .workspace-header {
    grid-column: 1;
    width: 100%;
    min-height: 78px;
    padding: 12px 14px 12px 68px;
  }

  .workspace-header h2 {
    font-size: 19px;
  }

  .view {
    grid-column: 1;
    width: 100%;
    padding: 24px 14px 54px;
  }

  .band {
    margin-bottom: 30px;
  }

  .metric {
    min-height: 110px;
  }

  .settings-grid,
  .rules-grid,
  .result-grid,
  .primary-metrics {
    grid-template-columns: 1fr;
  }

  .section-title {
    align-items: stretch;
  }

  .overview-controls {
    align-items: stretch;
  }

  .panel,
  .metric {
    padding: 16px;
  }

  .analytics-details,
  .workspace-disclosure,
  .create-resource,
  .overview-disclosure {
    border-radius: 11px;
  }
}

@media (max-width: 480px) {
  .workspace-actions {
    gap: 6px;
  }

  .workspace-header h2 {
    max-width: 210px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .icon-button {
    width: 36px;
    height: 36px;
  }

  .metric-value {
    font-size: 27px;
  }

  .resource-row,
  .tracked-row,
  .principal-row {
    border-radius: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}
