:root {
  color-scheme: light;
  --ink: #10233f;
  --muted: #64748b;
  --line: #e3e9f2;
  --soft: #f5f8fc;
  --panel: #ffffff;
  --blue: #1769e0;
  --blue-dark: #0d4fac;
  --navy: #0a1f3b;
  --orange: #f08c2e;
  --danger: #c93636;
  --success: #168765;
  --shadow: 0 18px 50px rgba(20, 45, 78, .10);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--soft); min-height: 100vh; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.eyebrow { margin: 0 0 8px; color: var(--blue); font-size: 11px; font-weight: 800; letter-spacing: .14em; }
.muted { color: var(--muted); }
.brand-mark { width: 58px; height: 58px; display: grid; place-items: center; border-radius: 18px; color: white; background: linear-gradient(145deg, #2c82f2, #0d4fac); font-weight: 900; font-size: 28px; box-shadow: 0 12px 28px rgba(28, 105, 224, .28); }
.brand-mark.small { width: 38px; height: 38px; border-radius: 12px; font-size: 18px; }

.login-layout { min-height: 100vh; display: grid; grid-template-columns: minmax(380px, 1.05fr) minmax(420px, .95fr); }
.brand-panel { padding: clamp(48px, 8vw, 120px); color: white; background: radial-gradient(circle at 15% 15%, #23598c 0, transparent 38%), linear-gradient(145deg, #071a32, #0d2a4c 65%, #123b66); display: flex; flex-direction: column; justify-content: center; gap: 56px; }
.brand-panel .eyebrow { color: #75b6ff; }
.brand-panel h1 { max-width: 620px; margin: 0; font-size: clamp(42px, 5vw, 74px); line-height: .98; letter-spacing: -.045em; }
.brand-copy { max-width: 520px; color: #c3d5e9; font-size: 18px; line-height: 1.7; }
.trust-row { color: #b9cce0; font-size: 13px; display: flex; align-items: center; gap: 10px; }
.trust-row span { width: 9px; height: 9px; border-radius: 50%; background: #2dd4a4; box-shadow: 0 0 0 5px rgba(45, 212, 164, .13); }
.login-panel { display: grid; place-items: center; padding: 40px; background: #f7f9fc; }
.login-card { width: min(430px, 100%); padding: 44px; border: 1px solid var(--line); border-radius: 24px; background: white; box-shadow: var(--shadow); }
.login-card h2 { margin: 0; font-size: 32px; letter-spacing: -.025em; }
.login-card > .muted { margin: 8px 0 30px; }
label { display: grid; gap: 8px; color: #33445c; font-size: 13px; font-weight: 700; margin: 17px 0; }
input, select, textarea { width: 100%; border: 1px solid #ccd7e5; border-radius: 11px; background: white; color: var(--ink); padding: 12px 13px; outline: none; transition: border .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(23, 105, 224, .12); }
.primary-button, .secondary-button { border: 0; border-radius: 11px; padding: 12px 16px; font-weight: 800; }
.primary-button { width: 100%; color: white; background: var(--blue); margin-top: 10px; }
.primary-button:hover { background: var(--blue-dark); }
.primary-button:disabled { opacity: .55; cursor: not-allowed; }
.secondary-button { color: var(--ink); background: white; border: 1px solid var(--line); }
.secondary-button:disabled { opacity: .4; cursor: not-allowed; }
.text-button { border: 0; padding: 0; color: #9bb6d5; background: transparent; font-size: 12px; }
.form-error { min-height: 18px; color: var(--danger); font-size: 13px; }

.app-layout { min-height: 100vh; display: grid; grid-template-columns: 230px 1fr; }
.sidebar { position: sticky; top: 0; height: 100vh; color: white; background: var(--navy); padding: 26px 18px; display: flex; flex-direction: column; }
.sidebar-brand { display: flex; align-items: center; gap: 12px; padding: 0 8px 34px; }
.sidebar-brand strong, .sidebar-brand span { display: block; }
.sidebar-brand strong { font-size: 17px; }
.sidebar-brand span { color: #93abc6; font-size: 11px; margin-top: 3px; }
.sidebar nav { display: grid; gap: 8px; }
.nav-item { width: 100%; border: 0; border-radius: 11px; padding: 12px; display: flex; justify-content: space-between; color: #9fb5cd; background: transparent; text-align: left; }
.nav-item:hover, .nav-item.active { color: white; background: #15385e; }
.nav-item strong { min-width: 26px; padding: 2px 7px; border-radius: 999px; color: #c5d8ec; background: rgba(255,255,255,.08); text-align: center; font-size: 11px; }
.sidebar-footer { margin-top: auto; border-top: 1px solid rgba(255,255,255,.09); padding: 18px 8px 0; display: grid; gap: 7px; color: #d8e4f0; font-size: 13px; }
.workspace { min-width: 0; }
.topbar { height: 96px; padding: 20px 30px; background: white; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.topbar h2 { margin: 0; font-size: 24px; letter-spacing: -.02em; }
.search-box { margin: 0; width: min(380px, 40vw); display: flex; align-items: center; gap: 9px; color: #778ba3; border: 1px solid var(--line); border-radius: 12px; padding-left: 13px; background: #f9fbfd; }
.search-box input { border: 0; box-shadow: none; background: transparent; padding-left: 0; }
.content-grid { display: grid; grid-template-columns: minmax(440px, 1.02fr) minmax(420px, .98fr); min-height: calc(100vh - 96px); }
.case-list-panel { min-width: 0; padding: 22px; border-right: 1px solid var(--line); }
.case-list { display: grid; gap: 10px; }
.case-card { width: 100%; border: 1px solid var(--line); border-radius: 15px; padding: 17px; background: white; text-align: left; transition: transform .12s, border .12s, box-shadow .12s; }
.case-card:hover { transform: translateY(-1px); border-color: #afc6e4; box-shadow: 0 8px 24px rgba(20, 45, 78, .07); }
.case-card.selected { border-color: var(--blue); box-shadow: 0 0 0 2px rgba(23, 105, 224, .10); }
.case-head, .case-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.case-card h3 { margin: 9px 0 5px; font-size: 16px; }
.case-card p { margin: 0; color: var(--muted); font-size: 13px; }
.case-meta { justify-content: flex-start; margin-top: 13px; color: #6b7e94; font-size: 11px; }
.case-meta span + span::before { content: "•"; margin-right: 8px; }
.badge { display: inline-flex; align-items: center; border-radius: 999px; padding: 4px 8px; font-size: 10px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.badge.high, .badge.critical { color: #9d4c12; background: #fff0df; }
.badge.normal { color: #1b6c59; background: #e5f7f1; }
.pagination { padding: 18px 2px; display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 12px; }
.empty-state, .detail-placeholder { padding: 70px 30px; text-align: center; color: var(--muted); }
.empty-state div, .detail-placeholder div { width: 52px; height: 52px; margin: 0 auto 16px; display: grid; place-items: center; border-radius: 16px; color: var(--blue); background: #eaf2ff; font-size: 24px; }
.empty-state h3, .detail-placeholder h3 { color: var(--ink); margin-bottom: 6px; }
.empty-state p, .detail-placeholder p { margin: 0; font-size: 13px; }

.detail-panel { min-width: 0; background: white; padding: 28px; overflow: auto; max-height: calc(100vh - 96px); }
.detail-top { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.detail-top h2 { margin: 5px 0 7px; font-size: 24px; letter-spacing: -.025em; }
.detail-top p { margin: 0; color: var(--muted); font-size: 13px; }
.section { border-top: 1px solid var(--line); margin-top: 24px; padding-top: 22px; }
.section h3 { margin: 0 0 14px; font-size: 13px; text-transform: uppercase; letter-spacing: .07em; color: #53667e; }
.data-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.data-item { min-width: 0; padding: 11px 12px; border-radius: 10px; background: var(--soft); }
.data-item span { display: block; color: #71849b; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; }
.data-item strong { display: block; margin-top: 5px; font-size: 13px; overflow-wrap: anywhere; }
.instruction { padding: 14px; border-left: 3px solid var(--orange); border-radius: 0 10px 10px 0; color: #5f482f; background: #fff8ef; font-size: 13px; line-height: 1.55; }
.detail-actions { display: flex; gap: 10px; }
.detail-actions .secondary-button { flex: 1; }
.evidence-link { color: var(--blue); font-size: 13px; font-weight: 800; text-decoration: none; }
.resolution-card { padding: 17px; border-radius: 14px; background: #f5f8fc; }
.resolution-card label { margin: 12px 0; }
.resolution-card textarea { min-height: 88px; resize: vertical; }
.timeline { display: grid; gap: 13px; }
.timeline-item { padding-left: 16px; border-left: 2px solid #d9e4f1; }
.timeline-item strong { font-size: 12px; }
.timeline-item p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.toast { position: fixed; right: 22px; bottom: 22px; z-index: 20; padding: 13px 16px; color: white; background: #163454; border-radius: 11px; box-shadow: var(--shadow); font-size: 13px; }
.imports-layout { padding: 28px; display: grid; grid-template-columns: repeat(2, minmax(320px, 1fr)); gap: 20px; }
.operations-card { min-width: 0; padding: 24px; border: 1px solid var(--line); border-radius: 18px; background: white; box-shadow: 0 10px 30px rgba(20, 45, 78, .05); }
.operations-card h3 { margin: 0 0 8px; font-size: 20px; }
.operations-card > .muted { font-size: 13px; line-height: 1.55; }
.operation-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 24px; }
.operation-actions .primary-button { margin: 0; }
.status-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.status-metrics div { padding: 15px; border-radius: 12px; background: var(--soft); text-align: center; }
.status-metrics strong, .status-metrics span { display: block; }
.status-metrics strong { font-size: 25px; color: var(--blue); }
.status-metrics span { margin-top: 4px; color: var(--muted); font-size: 11px; }
.status-line { margin: 15px 0 0; color: var(--success); font-weight: 800; font-size: 12px; }
.import-output-card pre { max-height: 280px; overflow: auto; margin: 12px 0 0; padding: 14px; border-radius: 11px; background: #0d2038; color: #d9e9f8; white-space: pre-wrap; overflow-wrap: anywhere; font: 12px/1.55 ui-monospace, SFMono-Regular, Consolas, monospace; }
.profile-card { grid-column: 1 / -1; }
.profile-card form { display: grid; grid-template-columns: repeat(3, minmax(180px, 1fr)); gap: 12px; align-items: end; }
.profile-card form label { margin: 0; }
.profile-card form .primary-button { margin: 0; }
.profile-card pre { max-height: 360px; overflow: auto; margin: 18px 0 0; padding: 14px; border-radius: 11px; background: #0d2038; color: #d9e9f8; white-space: pre-wrap; overflow-wrap: anywhere; font: 12px/1.55 ui-monospace, SFMono-Regular, Consolas, monospace; }
.research-list { display: grid; gap: 12px; margin-top: 18px; }
.research-item { padding: 15px; border: 1px solid var(--line); border-radius: 12px; background: var(--soft); }
.research-item h4 { margin: 0 0 6px; }
.research-item p { margin: 5px 0; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }

@media (max-width: 1050px) {
  .content-grid { grid-template-columns: 1fr; }
  .detail-panel { max-height: none; border-top: 1px solid var(--line); }
}
@media (max-width: 760px) {
  .login-layout { grid-template-columns: 1fr; }
  .brand-panel { display: none; }
  .app-layout { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; padding: 14px; }
  .sidebar-brand { padding-bottom: 14px; }
  .sidebar nav { grid-template-columns: repeat(2, 1fr); }
  .sidebar-footer { display: flex; justify-content: space-between; }
  .topbar { height: auto; align-items: stretch; flex-direction: column; padding: 18px; }
  .search-box { width: 100%; }
  .content-grid { min-height: auto; }
  .case-list-panel, .detail-panel { padding: 16px; }
  .data-grid { grid-template-columns: 1fr; }
  .imports-layout { grid-template-columns: 1fr; padding: 16px; }
  .operation-actions { grid-template-columns: 1fr; }
  .profile-card form { grid-template-columns: 1fr; }
}
