/* ============================================================
 * NOLA Security — Dark Security theme
 * Visual concept: dark navy SOC + cyan neon accent.
 * Typeface & spacing grid borrowed from the Wanted Design System.
 * ============================================================ */

@import url("https://cdn.jsdelivr.net/gh/wanteddev/wanted-sans@v1.0.4/packages/wanted-sans/fonts/webfonts/variable/split/WantedSansVariable.min.css");

:root {
  /* ---- Surfaces (navy) ---- */
  --bg:            #0B1120;   /* page */
  --bg-grad-top:   #0d1426;
  --panel:         #131C2E;   /* cards / panels */
  --panel-2:       #1B2840;   /* hover / emphasised panel */
  --panel-inset:   #0E1626;   /* inset wells, code blocks */
  --border:        #243349;
  --border-soft:   #1c2a40;

  /* ---- Text ---- */
  --text:          #E6EDF7;   /* primary */
  --text-2:        #8FA3BF;   /* secondary */
  --text-3:        #5B6B85;   /* disabled / tertiary */

  /* ---- Accent ---- */
  --cyan:          #22D3EE;   /* primary action / link */
  --cyan-deep:     #0fb6d1;
  --cyan-press:    #0a93ab;
  --violet:        #818CF8;   /* secondary point */

  /* ---- Status ---- */
  --safe:          #34D399;
  --warn:          #FBBF24;
  --danger:        #F87171;
  --info:          #38BDF8;

  /* soft fills (12% alpha-ish) */
  --cyan-soft:     rgba(34, 211, 238, 0.12);
  --violet-soft:   rgba(129, 140, 248, 0.14);
  --safe-soft:     rgba(52, 211, 153, 0.13);
  --warn-soft:     rgba(251, 191, 36, 0.14);
  --danger-soft:   rgba(248, 113, 113, 0.14);
  --info-soft:     rgba(56, 189, 248, 0.13);

  /* ---- Grades ---- */
  --grade-a:       #34D399;
  --grade-b:       #A3E635;
  --grade-c:       #FBBF24;
  --grade-d:       #FB923C;
  --grade-f:       #F87171;

  /* ---- Type (Wanted scale) ---- */
  --font-sans: "Wanted Sans Variable", "Wanted Sans", -apple-system,
               BlinkMacSystemFont, "Apple SD Gothic Neo", "Pretendard",
               "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;

  --w-regular: 400; --w-medium: 500; --w-semibold: 600; --w-bold: 700; --w-extrabold: 800;

  /* ---- Radius ---- */
  --r-card: 16px;
  --r-btn:  10px;
  --r-input: 10px;
  --r-sm:   8px;
  --r-pill: 999px;

  /* ---- Glow / elevation (1px border + micro glow, no heavy shadow) ---- */
  --glow-cyan:   0 0 0 1px rgba(34,211,238,.35), 0 0 18px rgba(34,211,238,.18);
  --glow-soft:   0 0 0 1px var(--border), 0 8px 30px rgba(0,0,0,.35);
  --ring-focus:  0 0 0 3px rgba(34,211,238,.30);

  /* motion */
  --m-fast: 120ms cubic-bezier(.2,.8,.2,1);
  --m-med:  200ms cubic-bezier(.2,.8,.2,1);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-feature-settings: "ss03", "case", "tnum";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-size: 16px;
  line-height: 1.5;
}

.tnum { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }

/* ---- Type helpers ---- */
.t-display { font-size: 52px; line-height: 1.1;  font-weight: 800; letter-spacing: -0.02em; }
.t-h1 { font-size: 36px; line-height: 1.25; font-weight: 800; letter-spacing: -0.02em; }
.t-h2 { font-size: 28px; line-height: 1.3;  font-weight: 700; letter-spacing: -0.015em; }
.t-h3 { font-size: 22px; line-height: 1.4;  font-weight: 700; letter-spacing: -0.01em; }
.t-h4 { font-size: 18px; line-height: 1.45; font-weight: 600; }
.t-body { font-size: 15px; line-height: 1.55; font-weight: 400; }
.t-sm   { font-size: 13px; line-height: 1.5;  font-weight: 400; }
.t-cap  { font-size: 12px; line-height: 1.4;  font-weight: 500; color: var(--text-3); }
.t-mono { font-family: var(--font-mono); }
.text-2 { color: var(--text-2); }
.text-3 { color: var(--text-3); }
.text-cyan { color: var(--cyan); }

h1,h2,h3,h4,h5,p { margin: 0; }
a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }
::selection { background: rgba(34,211,238,.3); color: #fff; }

/* scrollbars */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #1f2c44; border-radius: 999px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #2a3a58; }

/* ============================================================
 * BUTTONS
 * ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: inherit; font-size: 14px; font-weight: 600;
  padding: 10px 16px; border-radius: var(--r-btn);
  border: 1px solid transparent; cursor: pointer;
  transition: all var(--m-fast); white-space: nowrap;
  user-select: none;
}
.btn:focus-visible { outline: none; box-shadow: var(--ring-focus); }
.btn-sm { padding: 7px 12px; font-size: 13px; }
.btn-lg { padding: 13px 22px; font-size: 15px; }

.btn-primary { background: var(--cyan); color: #062330; border-color: var(--cyan); font-weight: 700; }
.btn-primary:hover { background: var(--cyan-deep); box-shadow: 0 0 18px rgba(34,211,238,.32); }
.btn-primary:active { background: var(--cyan-press); }

.btn-secondary { background: transparent; color: var(--text); border-color: var(--border); }
.btn-secondary:hover { background: var(--panel-2); border-color: #32445f; }

.btn-ghost { background: transparent; color: var(--text-2); border-color: transparent; }
.btn-ghost:hover { background: var(--panel-2); color: var(--text); }

.btn-danger { background: rgba(248,113,113,.12); color: var(--danger); border-color: rgba(248,113,113,.35); }
.btn-danger:hover { background: rgba(248,113,113,.2); }

.btn-violet { background: var(--violet-soft); color: var(--violet); border-color: rgba(129,140,248,.35); }
.btn-violet:hover { background: rgba(129,140,248,.22); }

.btn:disabled, .btn.is-disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }

/* ============================================================
 * CARDS / PANELS
 * ============================================================ */
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  padding: 20px;
}
.card-hover { transition: all var(--m-fast); }
.card-hover:hover { background: var(--panel-2); border-color: #32445f; }
.panel-inset { background: var(--panel-inset); border: 1px solid var(--border-soft); border-radius: 12px; }

/* ============================================================
 * BADGES
 * ============================================================ */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; font-weight: 600; line-height: 1;
  padding: 5px 10px; border-radius: var(--r-pill);
  border: 1px solid transparent; white-space: nowrap;
}
.badge .dot { width: 6px; height: 6px; border-radius: 999px; background: currentColor; }
.badge-safe   { color: var(--safe);   background: var(--safe-soft);   border-color: rgba(52,211,153,.3); }
.badge-warn   { color: var(--warn);   background: var(--warn-soft);   border-color: rgba(251,191,36,.3); }
.badge-danger { color: var(--danger); background: var(--danger-soft); border-color: rgba(248,113,113,.3); }
.badge-info   { color: var(--info);   background: var(--info-soft);   border-color: rgba(56,189,248,.3); }
.badge-neutral{ color: var(--text-2); background: var(--alpha,#1a2740); border-color: var(--border); }
.badge-violet { color: var(--violet); background: var(--violet-soft); border-color: rgba(129,140,248,.3); }
.badge-cyan   { color: var(--cyan);   background: var(--cyan-soft);   border-color: rgba(34,211,238,.3); }

/* grade badge */
.grade {
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 800; border-radius: 10px; line-height: 1;
}
.grade-A { color: #062a1d; background: var(--grade-a); }
.grade-B { color: #1a2a05; background: var(--grade-b); }
.grade-C { color: #2a1f02; background: var(--grade-c); }
.grade-D { color: #2a1604; background: var(--grade-d); }
.grade-F { color: #2a0808; background: var(--grade-f); }

/* ============================================================
 * FORM ELEMENTS
 * ============================================================ */
.input, .select {
  width: 100%; font-family: inherit; font-size: 14px; color: var(--text);
  background: var(--panel-inset); border: 1px solid var(--border);
  border-radius: var(--r-input); padding: 11px 13px; transition: all var(--m-fast);
}
.input::placeholder { color: var(--text-3); }
.input:focus, .select:focus { outline: none; border-color: var(--cyan); box-shadow: var(--ring-focus); }
.input.is-error { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(248,113,113,.2); }
.select { appearance: none; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238FA3BF' stroke-width='2'><path d='M6 9l6 6 6-6'/></svg>"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; cursor: pointer; }
label.field-label { display: block; font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 7px; }
.field-help { font-size: 12px; color: var(--text-3); margin-top: 6px; }
.field-error { font-size: 12px; color: var(--danger); margin-top: 6px; }

/* toggle */
.toggle { display: inline-block; position: relative; width: 44px; height: 26px; border-radius: 999px; background: #283750; border: 1px solid var(--border); cursor: pointer; transition: all var(--m-fast); flex: none; vertical-align: middle; }
.toggle::after { content: ""; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 999px; background: #8294b0; transition: all var(--m-med); }
.toggle.on { background: var(--cyan); border-color: var(--cyan); }
.toggle.on::after { transform: translateX(18px); background: #06222e; }

/* checkbox */
.chk { width: 18px; height: 18px; border-radius: 5px; border: 1.5px solid var(--border-strong,#32445f); background: var(--panel-inset); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex: none; transition: all var(--m-fast); }
.chk.on { background: var(--cyan); border-color: var(--cyan); }

/* ============================================================
 * TABLE
 * ============================================================ */
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl thead th { text-align: left; font-weight: 600; font-size: 12px; color: var(--text-3); padding: 12px 14px; border-bottom: 1px solid var(--border); text-transform: none; letter-spacing: .02em; }
.tbl tbody td { padding: 14px; border-bottom: 1px solid var(--border-soft); color: var(--text); vertical-align: middle; }
.tbl tbody tr { transition: background var(--m-fast); }
.tbl tbody tr:hover { background: var(--panel-2); }
.tbl tbody tr:last-child td { border-bottom: none; }

/* ============================================================
 * MISC
 * ============================================================ */
.divider { height: 1px; background: var(--border); border: 0; }
.kbd { font-family: var(--font-mono); font-size: 12px; background: var(--panel-inset); border: 1px solid var(--border); border-radius: 6px; padding: 2px 7px; color: var(--text-2); }
.spinner { width: 16px; height: 16px; border: 2px solid rgba(34,211,238,.25); border-top-color: var(--cyan); border-radius: 999px; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.scanline { position: relative; overflow: hidden; }

/* grid noise / glow backdrop helpers */
.grid-bg {
  background-image:
    linear-gradient(rgba(34,211,238,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(34,211,238,.04) 1px, transparent 1px);
  background-size: 44px 44px;
}
.flash {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; border-radius: 12px; font-size: 14px; font-weight: 500;
}
.flash-success { background: var(--safe-soft); border: 1px solid rgba(52,211,153,.3); color: var(--safe); }
.flash-error   { background: var(--danger-soft); border: 1px solid rgba(248,113,113,.3); color: var(--danger); }
.flash-info    { background: var(--info-soft); border: 1px solid rgba(56,189,248,.3); color: var(--info); }

/* animations — base state is the VISIBLE end-state; only animate from hidden when motion is allowed */
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes pulse-glow { 0%,100% { box-shadow: 0 0 0 1px rgba(34,211,238,.3), 0 0 14px rgba(34,211,238,.15); } 50% { box-shadow: 0 0 0 1px rgba(34,211,238,.5), 0 0 24px rgba(34,211,238,.3); } }
.anim-fade-up { }
.anim-fade-in { }
@media (prefers-reduced-motion: no-preference) {
  .anim-fade-up { animation: fadeUp .45s cubic-bezier(.2,.8,.2,1) both; }
  .anim-fade-in { animation: fadeIn .4s ease both; }
}

/* ============================================================
 * APP SHELL — sidebar + header (ported from JSX inline styles)
 * ============================================================ */
.shell { display: flex; min-height: 100vh; background: var(--bg); }
.sidebar {
  width: 248px; flex: none; background: var(--panel); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.sidebar-brand { padding: 20px 20px 16px; }
.sidebar-nav { padding: 14px 12px; display: flex; flex-direction: column; gap: 3px; flex: 1; overflow-y: auto; }
.sidebar-foot { padding: 12px; border-top: 1px solid var(--border); }
.nav-item {
  display: flex; align-items: center; gap: 11px; width: 100%; padding: 10px 12px;
  border-radius: 10px; border: none; cursor: pointer; background: transparent;
  color: var(--text-2); font-size: 14px; font-weight: 500; font-family: inherit;
  text-align: left; position: relative; transition: all var(--m-fast); text-decoration: none;
}
.nav-item:hover { background: var(--panel-2); color: var(--text); text-decoration: none; }
.nav-item.active { background: var(--cyan-soft); color: var(--cyan); font-weight: 600; }
.nav-item.active::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 2px; background: var(--cyan); box-shadow: 0 0 8px var(--cyan); }
.nav-item .nav-label { flex: 1; }
.nav-item .nav-badge { font-size: 11px; font-weight: 700; color: var(--danger); background: var(--danger-soft); border-radius: 999px; padding: 1px 7px; min-width: 18px; text-align: center; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 16px 28px; border-bottom: 1px solid var(--border);
  background: rgba(11,17,32,.7); backdrop-filter: blur(8px); position: sticky; top: 0; z-index: 50;
}
.topbar h2 { font-size: 20px; font-weight: 700; letter-spacing: -0.01em; }
.topbar .sub { font-size: 13px; color: var(--text-2); margin-top: 2px; }
.topbar-right { display: flex; align-items: center; gap: 14px; }
.avatar { width: 36px; height: 36px; border-radius: 999px; background: linear-gradient(135deg,var(--violet),var(--cyan)); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; color: #06222e; flex: none; }
.content { flex: 1; padding: 28px; max-width: 1320px; width: 100%; margin: 0 auto; }

.brand-logo { display: flex; align-items: center; gap: 10px; }
.brand-mark { width: 34px; height: 34px; border-radius: 9px; background: linear-gradient(135deg, var(--cyan), var(--cyan-deep)); display: flex; align-items: center; justify-content: center; box-shadow: 0 0 16px rgba(34,211,238,.4); flex: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1; }
.brand-text b { font-weight: 800; font-size: 16px; letter-spacing: -0.02em; }
.brand-text span { font-size: 10px; color: var(--text-3); letter-spacing: 0.18em; font-weight: 600; }

/* KPI grid + cards */
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.kpi { background: var(--panel); border: 1px solid var(--border); border-radius: var(--r-card); padding: 18px 20px; display: flex; flex-direction: column; gap: 6px; }
.kpi-label { font-size: 12px; color: var(--text-2); font-weight: 500; display: flex; align-items: center; gap: 6px; }
.kpi-value { font-size: 28px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; }
.kpi-delta { font-size: 12px; font-weight: 600; }
.kpi-delta.up { color: var(--safe); }
.kpi-delta.down { color: var(--danger); }

/* score ring gauge */
.ring { transform: rotate(-90deg); }
.ring-track { stroke: var(--border); }
.ring-fill { stroke: var(--cyan); stroke-linecap: round; transition: stroke-dashoffset var(--m-med); }

/* D-day badge helper */
.dday { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 12px; }
.dday.warn { color: var(--warn); }
.dday.danger { color: var(--danger); }

/* category dot */
.cat-dot { width: 9px; height: 9px; border-radius: 999px; flex: none; }

/* responsive: collapse sidebar */
@media (max-width: 860px) {
  .shell { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; flex-direction: row; align-items: center; overflow-x: auto; }
  .sidebar-brand { padding: 12px 16px; }
  .sidebar-nav { flex-direction: row; padding: 8px; gap: 4px; }
  .nav-item { white-space: nowrap; }
  .nav-item.active::before { display: none; }
  .sidebar-foot { display: none; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .content { padding: 18px; }
}
@media (max-width: 560px) { .kpi-grid { grid-template-columns: 1fr 1fr; } }

/* ============================================================
 * MODAL / OVERLAY
 * ============================================================ */
.overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.58); z-index: 1000;
  display: flex; align-items: center; justify-content: center; padding: 16px;
  opacity: 0; pointer-events: none; transition: opacity var(--m-med);
}
.overlay.open { opacity: 1; pointer-events: auto; }
.modal {
  background: var(--panel); border: 1px solid var(--border); border-radius: 16px;
  box-shadow: 0 24px 70px rgba(0,0,0,.6); max-height: 90vh; overflow: auto;
  transform: translateY(10px) scale(.98); transition: transform var(--m-med);
}
.overlay.open .modal { transform: none; }

/* ============================================================
 * PRINT — 보고서 인쇄 시 다크→라이트 전환 (planreq01 F-U-05)
 * ============================================================ */
@media print {
  html, body { background: #fff !important; color: #111 !important; }
  .sidebar, .topbar, .report-actions, .report-printnote, .overlay, #toast-host { display: none !important; }
  .main { display: block !important; }
  .content { padding: 0 !important; max-width: 100% !important; }
  .card, .panel, .panel-inset {
    background: #fff !important; border: 1px solid #ddd !important; color: #111 !important;
    box-shadow: none !important; break-inside: avoid;
  }
  .text-2, .muted, p, span, div { color: #222 !important; }
  .badge { border: 1px solid #ccc !important; }
  pre { background: #f5f5f5 !important; color: #111 !important; border-color: #ddd !important; }
  a { color: #111 !important; text-decoration: none !important; }
  .ring-track { stroke: #ddd !important; }
}

/* utility */
.flex { display: flex; } .items-center { align-items: center; } .justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .gap-4 { gap: 16px; }
.grid { display: grid; } .mt-4 { margin-top: 16px; } .mt-6 { margin-top: 24px; } .mb-4 { margin-bottom: 16px; }
.flex-col { flex-direction: column; } .flex-1 { flex: 1; } .flex-wrap { flex-wrap: wrap; }
.section-title { font-size: 16px; font-weight: 700; letter-spacing: -0.01em; margin-bottom: 12px; }
