/* Head Office Security Operations Centre v8
   Dense, responsive control-room layout. This file intentionally overrides the older stacked-card presentation. */

:root {
  --soc-navy-950: #07101f;
  --soc-navy-900: #0b1830;
  --soc-navy-800: #122544;
  --soc-blue-600: #1f63d7;
  --soc-cyan-500: #0ea5c6;
  --soc-red-600: #c7373f;
  --soc-amber-500: #c78312;
  --soc-green-600: #16845b;
  --soc-surface: #ffffff;
  --soc-surface-muted: #f4f7fb;
  --soc-border: #d9e2ee;
  --soc-text: #142033;
  --soc-muted: #64748b;
  --soc-shadow: 0 12px 34px rgba(15, 23, 42, .08);
}

html[data-ops-theme="dark"] {
  --soc-surface: #0d192b;
  --soc-surface-muted: #101e33;
  --soc-border: #263a56;
  --soc-text: #edf4ff;
  --soc-muted: #9badc3;
  --soc-shadow: 0 12px 34px rgba(0, 0, 0, .28);
}

body.ops-tailwind {
  background: var(--soc-surface-muted) !important;
  color: var(--soc-text);
}

body.ops-tailwind .ops-header-main {
  min-height: 60px !important;
  padding: 0 18px !important;
  gap: 14px !important;
}

body.ops-tailwind .ops-subheader {
  min-height: 44px !important;
  padding: 5px 18px !important;
}

body.ops-tailwind .ops-brand .brand-mark {
  width: 36px !important;
  height: 36px !important;
  border-radius: 9px !important;
}

body.ops-tailwind .ops-brand-copy strong { font-size: 13px !important; }
body.ops-tailwind .ops-brand-copy span { font-size: 10px !important; }
body.ops-tailwind .header-nav-item { min-height: 34px !important; padding: 7px 10px !important; }
body.ops-tailwind .all-tools-button,
body.ops-tailwind .theme-button,
body.ops-tailwind .account-menu summary { min-height: 34px !important; }
body.ops-tailwind .global-search { min-height: 34px !important; width: min(560px, 48vw) !important; }

@media (min-width: 1024px) {
  body.ops-tailwind .app-shell {
    grid-template-columns: 238px minmax(0, 1fr) !important;
  }

  body.ops-tailwind .tools-drawer {
    top: 105px !important;
    width: 238px !important;
    min-height: calc(100vh - 105px) !important;
    height: calc(100vh - 105px) !important;
    max-height: calc(100vh - 105px) !important;
  }

  body.ops-tailwind .tools-drawer-heading { padding: 15px 14px 11px !important; }
  body.ops-tailwind #mainNavigation { padding: 7px 7px 12px !important; }
  body.ops-tailwind .nav-group { padding: 4px 0 !important; }
  body.ops-tailwind .nav-label { margin: 4px 8px !important; font-size: 9px !important; }
  body.ops-tailwind .tools-drawer .nav-item {
    min-height: 31px !important;
    padding: 6px 9px !important;
    border-radius: 7px !important;
    font-size: 11px !important;
  }
}

body.ops-tailwind .content {
  padding: 18px 22px 30px !important;
}

body.ops-tailwind .system-footer {
  min-height: 46px !important;
  padding: 9px 22px !important;
  font-size: 11px !important;
}

body.ops-tailwind .page-heading {
  margin-bottom: 12px !important;
  padding: 0 !important;
  gap: 14px !important;
  align-items: flex-start !important;
}

body.ops-tailwind .page-heading h1 {
  margin: 2px 0 4px !important;
  font-size: clamp(22px, 2.2vw, 30px) !important;
  line-height: 1.1 !important;
}

body.ops-tailwind .page-heading p:not(.eyebrow) {
  max-width: 920px;
  margin: 0 !important;
  font-size: 12px !important;
  line-height: 1.5 !important;
}

body.ops-tailwind .eyebrow {
  margin: 0 0 3px !important;
  font-size: 9px !important;
  letter-spacing: .12em !important;
}

body.ops-tailwind .heading-actions,
body.ops-tailwind .page-heading > .button,
body.ops-tailwind .page-heading > div:last-child { gap: 7px !important; }

body.ops-tailwind .button {
  min-height: 34px !important;
  padding: 7px 11px !important;
  border-radius: 8px !important;
  font-size: 11px !important;
}

body.ops-tailwind .button.small {
  min-height: 27px !important;
  padding: 4px 8px !important;
  border-radius: 6px !important;
  font-size: 10px !important;
}

body.ops-tailwind .metrics,
body.ops-tailwind .didit-metrics {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 9px !important;
  margin: 0 0 12px !important;
}

body.ops-tailwind .metric-card,
body.ops-tailwind .didit-metric {
  min-height: 82px !important;
  padding: 12px 13px !important;
  border: 1px solid var(--soc-border) !important;
  border-radius: 11px !important;
  background: var(--soc-surface) !important;
  box-shadow: 0 3px 12px rgba(15, 23, 42, .04) !important;
}

body.ops-tailwind .metric-card strong,
body.ops-tailwind .didit-metric strong {
  font-size: 24px !important;
  line-height: 1 !important;
}

body.ops-tailwind .metric-card span,
body.ops-tailwind .didit-metric span,
body.ops-tailwind .metric-card small,
body.ops-tailwind .didit-metric small { font-size: 10px !important; }

body.ops-tailwind .panel,
body.ops-tailwind .platform-card {
  border: 1px solid var(--soc-border) !important;
  border-radius: 11px !important;
  background: var(--soc-surface) !important;
  box-shadow: 0 3px 14px rgba(15, 23, 42, .04) !important;
}

body.ops-tailwind .panel-header { padding: 11px 13px !important; }
body.ops-tailwind .panel-header h2 { font-size: 14px !important; }
body.ops-tailwind .panel-header p { margin-top: 2px !important; font-size: 10px !important; }
body.ops-tailwind .panel-body { padding: 12px 13px !important; }
body.ops-tailwind .split-grid { gap: 10px !important; }

body.ops-tailwind .table-wrap {
  max-width: 100%;
  max-height: min(54vh, 520px);
  overflow: auto !important;
  border-radius: 0 0 11px 11px;
  scrollbar-width: thin;
}

body.ops-tailwind .data-table {
  min-width: 760px;
  font-size: 10.5px !important;
}

body.ops-tailwind .data-table thead {
  position: sticky;
  top: 0;
  z-index: 4;
}

body.ops-tailwind .data-table th {
  padding: 8px 10px !important;
  background: var(--soc-surface-muted) !important;
  color: var(--soc-muted) !important;
  font-size: 9px !important;
  letter-spacing: .06em !important;
  white-space: nowrap;
}

body.ops-tailwind .data-table td {
  padding: 8px 10px !important;
  line-height: 1.35 !important;
  vertical-align: middle !important;
}

body.ops-tailwind .data-table tbody tr:hover td { background: color-mix(in srgb, var(--soc-blue-600) 5%, transparent) !important; }
body.ops-tailwind .primary-cell strong { font-size: 11px !important; }
body.ops-tailwind .primary-cell small { font-size: 9.5px !important; }
body.ops-tailwind .tag,
body.ops-tailwind [class*="status-pill"] { font-size: 9px !important; padding: 3px 6px !important; }
body.ops-tailwind .toolbar { gap: 7px !important; }
body.ops-tailwind .toolbar input,
body.ops-tailwind .toolbar select,
body.ops-tailwind .field input,
body.ops-tailwind .field select,
body.ops-tailwind .field textarea { min-height: 34px !important; font-size: 11px !important; }
body.ops-tailwind .field textarea { min-height: 82px !important; }
body.ops-tailwind .notice { margin: 0 0 11px !important; padding: 10px 12px !important; border-radius: 9px !important; font-size: 11px !important; }

.soc-page { display: grid; gap: 11px; }
.soc-command-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: start;
  padding: 16px 17px;
  border: 1px solid #263d61;
  border-radius: 13px;
  background:
    radial-gradient(circle at 88% 20%, rgba(14,165,198,.18), transparent 260px),
    linear-gradient(135deg, var(--soc-navy-950), var(--soc-navy-800));
  color: #fff;
  box-shadow: 0 14px 36px rgba(7,16,31,.22);
}
.soc-command-header h1 { margin: 3px 0 5px !important; color: #fff !important; }
.soc-command-header p { margin: 0; color: #b7c6db; font-size: 11.5px; line-height: 1.5; }
.soc-command-header .eyebrow { color: #7dd3fc !important; }
.soc-command-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.soc-command-actions .button.secondary { border-color: rgba(255,255,255,.22) !important; background: rgba(255,255,255,.08) !important; color: #fff !important; }

.soc-status-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid var(--soc-border);
  border-radius: 10px;
  background: var(--soc-surface);
}
.soc-status-item { display: grid; grid-template-columns: auto 1fr; gap: 9px; align-items: center; padding: 9px 11px; border-right: 1px solid var(--soc-border); }
.soc-status-item:last-child { border-right: 0; }
.soc-status-dot { width: 8px; height: 8px; border-radius: 999px; background: var(--soc-green-600); box-shadow: 0 0 0 4px rgba(22,132,91,.12); }
.soc-status-dot.warn { background: var(--soc-amber-500); box-shadow: 0 0 0 4px rgba(199,131,18,.12); }
.soc-status-dot.critical { background: var(--soc-red-600); box-shadow: 0 0 0 4px rgba(199,55,63,.12); }
.soc-status-item strong { display: block; font-size: 10.5px; }
.soc-status-item span { display: block; margin-top: 1px; color: var(--soc-muted); font-size: 9.5px; }

.soc-metric-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.soc-metric {
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid var(--soc-border);
  border-radius: 10px;
  background: var(--soc-surface);
}
.soc-metric span { display: block; color: var(--soc-muted); font-size: 9px; text-transform: uppercase; letter-spacing: .06em; }
.soc-metric strong { display: block; margin-top: 4px; font-size: 22px; line-height: 1; }
.soc-metric small { display: block; margin-top: 5px; color: var(--soc-muted); font-size: 9px; line-height: 1.3; }
.soc-metric.critical { border-color: color-mix(in srgb, var(--soc-red-600) 42%, var(--soc-border)); }

.soc-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(320px, .85fr); gap: 10px; align-items: start; }
.soc-stack { display: grid; gap: 10px; }
.soc-panel { min-width: 0; overflow: hidden; border: 1px solid var(--soc-border); border-radius: 11px; background: var(--soc-surface); box-shadow: 0 3px 14px rgba(15,23,42,.04); }
.soc-panel-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 10px 12px; border-bottom: 1px solid var(--soc-border); }
.soc-panel-header h2 { margin: 0; font-size: 13px; }
.soc-panel-header p { margin: 2px 0 0; color: var(--soc-muted); font-size: 9.5px; }
.soc-panel-body { padding: 11px 12px; }
.soc-scroll { max-height: 330px; overflow: auto; }
.soc-empty { padding: 24px 14px; color: var(--soc-muted); text-align: center; font-size: 11px; }
.soc-code { display: inline-flex; align-items: center; padding: 3px 6px; border: 1px solid var(--soc-border); border-radius: 6px; background: var(--soc-surface-muted); font: 700 9px ui-monospace,SFMono-Regular,Consolas,monospace; letter-spacing: .03em; }
.soc-lockdown-row { display: grid; grid-template-columns: minmax(160px,1fr) minmax(150px,.8fr) auto; gap: 10px; align-items: center; padding: 9px 11px; border-bottom: 1px solid var(--soc-border); }
.soc-lockdown-row:last-child { border-bottom: 0; }
.soc-lockdown-row strong { display: block; font-size: 11px; }
.soc-lockdown-row small { display: block; margin-top: 2px; color: var(--soc-muted); font-size: 9px; }
.soc-config-list { display: grid; gap: 7px; }
.soc-config-item { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; padding: 9px 10px; border: 1px solid var(--soc-border); border-radius: 8px; background: var(--soc-surface-muted); }
.soc-config-item strong { display: block; font-size: 10.5px; }
.soc-config-item span { display: block; margin-top: 2px; color: var(--soc-muted); font-size: 9px; word-break: break-word; }
.soc-compact-table { width: 100%; border-collapse: collapse; font-size: 10px; }
.soc-compact-table th { position: sticky; top: 0; z-index: 1; padding: 7px 9px; background: var(--soc-surface-muted); color: var(--soc-muted); text-align: left; font-size: 8.5px; text-transform: uppercase; letter-spacing: .06em; }
.soc-compact-table td { padding: 8px 9px; border-top: 1px solid var(--soc-border); vertical-align: middle; }
.soc-compact-table tr:hover td { background: color-mix(in srgb, var(--soc-blue-600) 5%, transparent); }
.soc-integration-tabs { display: flex; gap: 5px; padding: 7px 9px; border-bottom: 1px solid var(--soc-border); background: var(--soc-surface-muted); }
.soc-integration-tabs button { min-height: 29px; padding: 5px 9px; border: 1px solid transparent; border-radius: 7px; background: transparent; color: var(--soc-muted); font-size: 10px; font-weight: 700; cursor: pointer; }
.soc-integration-tabs button.active { border-color: var(--soc-border); background: var(--soc-surface); color: var(--soc-blue-600); }

@media (max-width: 1260px) {
  .soc-metric-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .soc-status-strip { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .soc-status-item:nth-child(2) { border-right: 0; }
  .soc-status-item:nth-child(-n+2) { border-bottom: 1px solid var(--soc-border); }
}

@media (max-width: 900px) {
  body.ops-tailwind .content { padding: 14px 12px 24px !important; }
  body.ops-tailwind .metrics,
  body.ops-tailwind .didit-metrics { grid-template-columns: repeat(2,minmax(0,1fr)) !important; }
  .soc-grid { grid-template-columns: 1fr; }
  .soc-command-header { grid-template-columns: 1fr; }
  .soc-command-actions { justify-content: flex-start; }
}

@media (max-width: 620px) {
  .soc-metric-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .soc-status-strip { grid-template-columns: 1fr; }
  .soc-status-item { border-right: 0; border-bottom: 1px solid var(--soc-border); }
  .soc-status-item:last-child { border-bottom: 0; }
  .soc-lockdown-row { grid-template-columns: 1fr; }
}
