:root {
  --bg: #040906;
  --bg-soft: #07110c;
  --sidebar: #050d09;
  --panel: #0a1711;
  --panel-2: #0d2117;
  --panel-3: #102a1c;
  --border: rgba(193, 235, 55, .13);
  --border-strong: rgba(193, 235, 55, .26);
  --text: #f4f7f1;
  --muted: #98a89d;
  --muted-2: #708278;
  --accent: #c8ef22;
  --accent-soft: #8eb80d;
  --biotech: #0b6843;
  --biotech-2: #0f8253;
  --teal: #32d6a0;
  --warning: #f5c451;
  --danger: #ff6d7a;
  --ok: #77e49e;
  --shadow: 0 18px 60px rgba(0, 0, 0, .34);
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  background:
    radial-gradient(circle at 88% 0%, rgba(27, 118, 73, .23), transparent 27%),
    radial-gradient(circle at 62% 28%, rgba(200, 239, 34, .04), transparent 26%),
    linear-gradient(180deg, #050c08 0%, #040906 100%);
  color: var(--text);
  font: 14px/1.45 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
button, input, select { font: inherit; }
button { color: inherit; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 276px 1fr; }
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  border-right: 1px solid var(--border);
  background:
    linear-gradient(180deg, rgba(11, 42, 27, .22), transparent 25%),
    rgba(4, 12, 8, .97);
  backdrop-filter: blur(18px);
  padding: 18px 16px 16px;
  display: flex;
  flex-direction: column;
}

.biotech-logo-shell {
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 14px;
  background: #fff;
  padding: 8px 10px;
  min-height: 60px;
  display: grid;
  place-items: center;
  box-shadow: 0 14px 40px rgba(0,0,0,.28);
}
.biotech-logo { width: 100%; max-width: 218px; height: auto; display: block; }

.product-lockup {
  display: flex;
  align-items: center;
  gap: 13px;
  margin: 18px 2px 8px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(20, 67, 41, .44), rgba(8, 22, 14, .75));
  box-shadow: inset 0 1px rgba(255,255,255,.025);
}
.operia-logo {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(200,239,34,.42);
  box-shadow: 0 0 24px rgba(200,239,34,.12);
}
.product-lockup-copy strong { display: block; font-size: 17px; letter-spacing: -.01em; }
.product-lockup-copy span { color: var(--accent); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.product-tagline {
  margin: 0 8px 16px;
  color: #9fb0a5;
  font-size: 11px;
  line-height: 1.55;
}

.nav { display: grid; gap: 4px; padding: 4px 0; }
.nav-item {
  border: 0;
  background: transparent;
  color: var(--muted);
  text-align: left;
  padding: 10px 13px;
  border-radius: 10px;
  cursor: pointer;
  transition: .16s ease;
  position: relative;
}
.nav-item:hover { background: rgba(200,239,34,.055); color: var(--text); }
.nav-item.active {
  color: #f8fff0;
  background: linear-gradient(90deg, rgba(18, 119, 73, .42), rgba(200,239,34,.055));
  box-shadow: inset 3px 0 var(--accent);
}
.nav-item.active::after {
  content: "";
  position: absolute;
  right: 10px;
  top: 50%;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  transform: translateY(-50%);
  box-shadow: 0 0 12px rgba(200,239,34,.6);
}

.sidebar-brand-note {
  margin: 18px 2px 10px;
  padding: 13px 14px;
  border: 1px solid rgba(200,239,34,.12);
  border-radius: 13px;
  background: linear-gradient(145deg, rgba(12, 39, 25, .82), rgba(6, 17, 11, .9));
}
.brand-note-kicker {
  display: block;
  color: var(--accent);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .14em;
  margin-bottom: 6px;
}
.sidebar-brand-note strong { display: block; color: #d9e7dd; font-size: 11px; line-height: 1.45; }
.sidebar-footer {
  margin-top: auto;
  padding: 10px 6px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.link-button { border: 0; background: none; color: var(--muted); cursor: pointer; padding: 4px; }
.link-button:hover { color: var(--accent); }
.pill {
  display: inline-flex;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(200,239,34,.07);
  color: #dafa72;
  font-size: 10px;
  border: 1px solid rgba(200,239,34,.16);
}

.main { padding: 28px 34px 50px; min-width: 0; }
.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 18px;
}
.page-heading { max-width: 780px; }
.topbar h1 { margin: 4px 0 0; font-size: clamp(31px, 3.2vw, 46px); line-height: 1.02; letter-spacing: -.045em; }
.page-lead { margin: 10px 0 0; color: var(--muted); max-width: 720px; font-size: 13px; }
.eyebrow, .panel-kicker, .brand-strip-kicker {
  color: var(--accent);
  font-weight: 800;
  font-size: 10px;
  letter-spacing: .15em;
  text-transform: uppercase;
}
.topbar-actions { display: flex; align-items: end; gap: 12px; flex-shrink: 0; }
.tenant-select-label { color: var(--muted); font-size: 10px; display: grid; gap: 5px; }
select, input {
  color: var(--text);
  background: #08150e;
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 9px 11px;
  outline: none;
}
select:focus, input:focus { border-color: rgba(200,239,34,.55); box-shadow: 0 0 0 3px rgba(200,239,34,.06); }
.operator {
  padding: 9px 12px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.025);
  border-radius: 9px;
  color: var(--muted);
  min-width: 132px;
}

.brand-strip {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(360px, .75fr);
  align-items: center;
  gap: 22px;
  padding: 17px 19px;
  margin-bottom: 18px;
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  background:
    linear-gradient(110deg, rgba(11, 104, 67, .28), rgba(9, 23, 15, .84) 48%, rgba(200,239,34,.055)),
    #08130d;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.brand-strip::after {
  content: "";
  position: absolute;
  width: 240px;
  height: 240px;
  right: -120px;
  top: -150px;
  border: 1px solid rgba(200,239,34,.14);
  border-radius: 50%;
  box-shadow: 0 0 0 24px rgba(200,239,34,.018), 0 0 0 48px rgba(200,239,34,.012);
}
.brand-strip-copy strong { display: block; margin-top: 5px; font-size: 16px; line-height: 1.3; }
.brand-capabilities { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; position: relative; z-index: 1; }
.brand-capabilities span {
  min-height: 46px;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 8px;
  border: 1px solid rgba(200,239,34,.11);
  border-radius: 10px;
  color: #c7d8cd;
  background: rgba(0,0,0,.16);
  font-size: 10px;
  font-weight: 700;
}

.metric-grid { display: grid; grid-template-columns: repeat(6, minmax(118px,1fr)); gap: 12px; margin-bottom: 17px; }
.metric {
  position: relative;
  overflow: hidden;
  background: linear-gradient(145deg, rgba(15, 41, 27, .96), rgba(7, 22, 14, .96));
  border: 1px solid var(--border);
  border-radius: 15px;
  padding: 16px;
  box-shadow: var(--shadow);
}
.metric::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, var(--biotech-2), transparent 75%);
}
.metric .label { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .07em; }
.metric .value { margin-top: 7px; font-size: 28px; font-weight: 800; letter-spacing: -.04em; }
.metric .hint { margin-top: 4px; font-size: 10px; color: var(--muted-2); }
.metric.alert .value { color: var(--warning); }
.metric.good .value { color: var(--ok); }

.panel-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 17px; }
.operational-grid { grid-template-columns: minmax(0, 1.45fr) minmax(360px, .55fr); }
.panel {
  background: linear-gradient(180deg, rgba(12, 31, 21, .96), rgba(7, 20, 13, .97));
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.incident-panel { background: linear-gradient(160deg, rgba(9, 35, 23, .96), rgba(7, 20, 13, .97)); }
.panel.full { min-height: 420px; }
.panel-header { display: flex; justify-content: space-between; gap: 16px; align-items: center; padding: 17px 19px; border-bottom: 1px solid var(--border); }
.panel-header h2 { margin: 4px 0 0; font-size: 17px; }
.panel-description { margin: 5px 0 0; color: #75887c; font-size: 11px; }
.live-dot { font-size: 10px; color: var(--ok); letter-spacing: .08em; }
.live-dot::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); margin-right: 6px; box-shadow: 0 0 14px rgba(119,228,158,.75); }
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; min-width: 0; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid rgba(255,255,255,.05); vertical-align: middle; }
th { color: #71857a; font-size: 9px; letter-spacing: .08em; text-transform: uppercase; font-weight: 800; white-space: nowrap; }
td { color: #dce8df; font-size: 12px; overflow-wrap: anywhere; }
tbody tr:hover { background: rgba(200,239,34,.025); }
.clickable-row { cursor: pointer; }
.row-sub { display: block; margin-top: 3px; color: #667a6f; font-size: 10px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.technical-id { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: #9bad9f; }
.badge { display: inline-flex; border-radius: 999px; padding: 3px 8px; font-size: 9px; font-weight: 800; border: 1px solid var(--border); white-space: nowrap; }
.badge.ok { color: var(--ok); background: rgba(119,228,158,.08); }
.badge.warn { color: var(--warning); background: rgba(245,196,81,.08); }
.badge.danger { color: var(--danger); background: rgba(255,109,122,.08); }
.badge.neutral { color: #a8b8ae; background: rgba(168,184,174,.06); }

.client-presentation-bar {
  display: grid;
  grid-template-columns: minmax(260px, .8fr) minmax(0, 1.2fr);
  gap: 22px;
  align-items: center;
  margin-top: 17px;
  padding: 16px 18px;
  border: 1px solid rgba(200,239,34,.14);
  border-radius: 15px;
  background: linear-gradient(90deg, rgba(11,104,67,.18), rgba(200,239,34,.025));
}
.client-presentation-bar strong { display: block; margin-top: 5px; font-size: 15px; }
.client-presentation-bar p { margin: 0; color: var(--muted); font-size: 11px; }

.resource-toolbar { display: flex; align-items: end; gap: 12px; padding: 14px 18px; background: rgba(255,255,255,.012); border-bottom: 1px solid var(--border); }
.filter-field { display: grid; gap: 5px; min-width: min(420px, 55vw); }
.filter-field.compact { min-width: 190px; }
.filter-field span { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .07em; }
.filter-field input, .filter-field select { width: 100%; }

.detail-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.58); z-index: 49; backdrop-filter: blur(2px); }
.detail-drawer {
  position: fixed; top: 0; right: 0; width: min(520px, 92vw); height: 100vh; z-index: 50;
  background: #07110c; border-left: 1px solid var(--border); box-shadow: -28px 0 70px rgba(0,0,0,.5);
  transform: translateX(105%); transition: transform .2s ease; overflow-y: auto;
}
.detail-drawer.open { transform: translateX(0); }
.detail-header { padding: 24px; display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; border-bottom: 1px solid var(--border); }
.detail-header h2 { margin: 5px 0 0; font-size: 23px; line-height: 1.2; }
.detail-subtitle { margin: 7px 0 0; color: #6f8277; font: 10px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; overflow-wrap: anywhere; }
.detail-close { width: 36px; height: 36px; border: 1px solid var(--border); border-radius: 10px; background: rgba(255,255,255,.03); color: var(--muted); cursor: pointer; font-size: 22px; }
.detail-close:hover { color: var(--accent); background: rgba(200,239,34,.05); }
.detail-body { padding: 18px 24px 34px; display: grid; gap: 1px; }
.detail-field { display: grid; grid-template-columns: minmax(120px, .8fr) minmax(0, 1.2fr); gap: 18px; padding: 12px 0; border-bottom: 1px solid rgba(255,255,255,.05); }
.detail-field > span { color: #71857a; font-size: 10px; text-transform: uppercase; letter-spacing: .04em; }
.detail-field > strong { color: #dce8df; font-size: 12px; font-weight: 600; overflow-wrap: anywhere; min-width: 0; }
.detail-field code { white-space: pre-wrap; overflow-wrap: anywhere; color: #a7d6bd; }

.loading-card, .error-card { padding: 18px; border-radius: 12px; border: 1px solid var(--border); background: var(--panel); color: var(--muted); }
.error-card { color: #ffb2bb; border-color: rgba(255,109,122,.25); }
.empty-state { padding: 50px; text-align: center; color: var(--muted); }

.auth-page {
  display: grid;
  place-items: center;
  padding: 28px;
  background:
    radial-gradient(circle at 16% 15%, rgba(11,104,67,.32), transparent 28%),
    radial-gradient(circle at 80% 82%, rgba(200,239,34,.08), transparent 24%),
    #040906;
}
.auth-shell {
  width: min(1020px,100%);
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  border: 1px solid var(--border-strong);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: var(--shadow);
  background: rgba(7,17,12,.96);
}
.auth-brand {
  padding: 52px;
  background: linear-gradient(145deg, rgba(12,58,37,.92), rgba(5,17,10,.97));
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 24px;
}
.auth-biotech-shell { width: 250px; max-width: 100%; background: #fff; border-radius: 13px; padding: 8px 10px; }
.auth-biotech-shell img { width: 100%; display: block; }
.auth-operia-row { display: flex; align-items: center; gap: 16px; }
.auth-operia-row img { width: 92px; height: 92px; border-radius: 50%; border: 1px solid rgba(200,239,34,.38); }
.auth-brand h1 { margin: 0; font-size: 38px; letter-spacing: -.045em; }
.auth-brand p { color: #b2c3b8; max-width: 430px; font-size: 14px; }
.auth-brand .auth-promise { color: var(--accent); font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.auth-card { padding: 50px; display: flex; flex-direction: column; justify-content: center; }
.auth-card h2 { font-size: 24px; margin: 18px 0 4px; }
.muted { color: var(--muted); }
.status-dot { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.status-dot span { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); margin-right: 6px; box-shadow: 0 0 12px rgba(119,228,158,.5); }
.auth-form { display: grid; gap: 14px; margin-top: 23px; }
.auth-form label { display: grid; gap: 6px; color: #a8b9ae; font-size: 12px; }
.auth-form input { width: 100%; padding: 12px; }
.btn { border: 0; padding: 12px 15px; border-radius: 10px; cursor: pointer; font-weight: 800; }
.btn-primary { background: linear-gradient(135deg,var(--accent),#87b811); color: #0a1105; margin-top: 4px; box-shadow: 0 10px 28px rgba(200,239,34,.12); }
.btn-primary:hover { filter: brightness(1.04); }
.login-error { margin-top: 14px; padding: 10px; border-radius: 8px; color: #ffb2bb; background: rgba(255,109,122,.08); border: 1px solid rgba(255,109,122,.18); }
.auth-note { margin-top: 25px; color: #617268; font-size: 10px; }

@media (max-width: 1380px) {
  .metric-grid { grid-template-columns: repeat(3,1fr); }
  .brand-strip { grid-template-columns: 1fr; }
  .brand-capabilities { max-width: 620px; }
}
@media (max-width: 1180px) {
  .operational-grid { grid-template-columns: 1fr; }
  .topbar { align-items: stretch; flex-direction: column; }
  .topbar-actions { align-items: stretch; }
}
@media (max-width: 820px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: relative; height: auto; border-right: 0; border-bottom: 1px solid var(--border); }
  .biotech-logo-shell { width: 230px; }
  .product-lockup { max-width: 360px; }
  .nav { grid-template-columns: repeat(4,1fr); overflow-x: auto; }
  .nav-item { text-align: center; font-size: 11px; min-width: 95px; }
  .nav-item.active::after { display: none; }
  .sidebar-brand-note, .sidebar-footer, .product-tagline { display: none; }
  .main { padding: 22px 16px 40px; }
  .topbar-actions { flex-direction: column; }
  .metric-grid { grid-template-columns: repeat(2,1fr); }
  .brand-capabilities { grid-template-columns: 1fr; }
  .client-presentation-bar { grid-template-columns: 1fr; }
  .resource-toolbar { align-items: stretch; flex-direction: column; }
  .filter-field, .filter-field.compact { min-width: 0; width: 100%; }
  .detail-field { grid-template-columns: 1fr; gap: 5px; }
  .auth-shell { grid-template-columns: 1fr; }
  .auth-brand { padding: 34px; }
  .auth-card { padding: 34px; }
}
