/* ==========================================================================
   CISORADAR MyRadar(TM) — app.css
   Enterprise GRC / cybersecurity. Navy #032555 · Blue #0076E7 · Gold #C9A227.
   Signature: a restrained radar sweep on the auth panel + progress radar.
   ========================================================================== */

:root {
  --navy:      #032555;
  --navy-700:  #03214E;
  --navy-900:  #021736;
  --blue:      #0076E7;
  --blue-600:  #0663c0;
  --accent:    #4DA3F0;
  --sky:       #E8F1FC;
  --gold:      #C9A227;
  --gold-soft: #F3E6BE;

  --ink:       #0F1B2D;
  --muted:     #5A6B82;
  --line:      #E2E8F1;
  --bg:        #F6F8FB;
  --surface:   #FFFFFF;
  --ok:        #1B8A5A;
  --warn:      #B26A00;
  --danger:    #C0392B;

  --radius:    14px;
  --radius-sm: 9px;
  --shadow:    0 1px 2px rgba(3,37,85,.06), 0 8px 24px rgba(3,37,85,.06);
  --shadow-lg: 0 18px 50px rgba(3,37,85,.16);

  --font-display: "Sora", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body:    "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --sidebar-w: 256px;
  --topbar-h:  64px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4 { font-family: var(--font-display); color: var(--navy); line-height: 1.2; margin: 0 0 .4em; letter-spacing: -.01em; }
h1 { font-size: 1.9rem; font-weight: 700; }
h2 { font-size: 1.35rem; font-weight: 600; }
h3 { font-size: 1.08rem; font-weight: 600; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
p { margin: 0 0 1rem; }
small { color: var(--muted); }

/* ---- Buttons ------------------------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  font-family: var(--font-display); font-weight: 600; font-size: .94rem;
  padding: .7rem 1.15rem; border-radius: var(--radius-sm);
  border: 1px solid transparent; cursor: pointer; transition: .15s ease;
  text-decoration: none; line-height: 1;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-600); }
.btn-navy { background: var(--navy); color: #fff; }
.btn-navy:hover { background: var(--navy-700); }
.btn-ghost { background: #fff; color: var(--navy); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--accent); color: var(--blue); }
.btn-gold { background: linear-gradient(180deg, #d9b643, var(--gold)); color: #3a2e00; }
.btn-block { width: 100%; }
.btn:focus-visible, a:focus-visible, input:focus-visible, .btn-icon:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* ---- Utility ------------------------------------------------------------ */
.container { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.stack > * + * { margin-top: 1rem; }
.muted { color: var(--muted); }
.eyebrow { font-family: var(--font-display); text-transform: uppercase; letter-spacing: .14em;
  font-size: .72rem; font-weight: 600; color: var(--blue); }
.badge { display: inline-block; font-size: .74rem; font-weight: 600; padding: .2rem .6rem;
  border-radius: 999px; background: var(--sky); color: var(--navy); }
.badge-gold { background: var(--gold-soft); color: #6b5400; }
.pill { font-family: var(--font-display); font-size: .72rem; letter-spacing: .04em; }

/* ==========================================================================
   AUTH LAYOUT — split screen with radar signature
   ========================================================================== */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; }
.auth-brand {
  position: relative; overflow: hidden; color: #eaf2ff;
  background: radial-gradient(120% 120% at 20% 0%, #0a3572 0%, var(--navy) 55%, var(--navy-900) 100%);
  padding: 56px 56px 48px; display: flex; flex-direction: column; justify-content: space-between;
}
.auth-brand .brandmark { display: flex; align-items: center; gap: 12px; position: relative; z-index: 2; }
.auth-brand .brandmark img { width: 46px; height: 46px; border-radius: 10px; background: #fff; padding: 4px; }
.auth-brand .brandmark span { font-family: var(--font-display); font-weight: 700; letter-spacing: .02em; }
.auth-hero { position: relative; z-index: 2; max-width: 30ch; }
.auth-hero h1 { color: #fff; font-size: 2.1rem; }
.auth-hero p { color: #b9cdf0; }
.auth-steps { position: relative; z-index: 2; display: flex; flex-wrap: wrap; gap: 10px; }
.auth-steps span { font-family: var(--font-display); font-size: .74rem; letter-spacing: .06em;
  color: #cfe0fb; border: 1px solid rgba(255,255,255,.18); border-radius: 999px; padding: .3rem .7rem; }

/* radar sweep */
.radar-sig { position: absolute; right: -120px; top: 50%; transform: translateY(-50%);
  width: 460px; height: 460px; z-index: 1; opacity: .5; }
.radar-sig .ring { fill: none; stroke: rgba(140,180,240,.28); stroke-width: 1; }
.radar-sig .cross { stroke: rgba(140,180,240,.18); stroke-width: 1; }
.radar-sig .sweep { transform-origin: 230px 230px; animation: sweep 5s linear infinite; }
.radar-sig .blip { fill: var(--accent); }
@keyframes sweep { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .radar-sig .sweep { animation: none; } }

.auth-panel { display: flex; align-items: center; justify-content: center; padding: 40px 24px; background: var(--surface); }
.auth-card { width: 100%; max-width: 420px; }
.auth-card h2 { font-size: 1.5rem; }
.auth-card .sub { color: var(--muted); margin-top: -.3rem; margin-bottom: 1.4rem; }
.auth-alt { margin-top: 1.4rem; font-size: .92rem; color: var(--muted); text-align: center; }

@media (max-width: 900px) {
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-brand { padding: 32px 24px; min-height: 240px; }
  .radar-sig { width: 300px; height: 300px; right: -90px; }
}

/* ==========================================================================
   FORMS
   ========================================================================== */
.form-row { margin-bottom: 1rem; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-grid .full { grid-column: 1 / -1; }
label.lbl { display: block; font-weight: 600; font-size: .88rem; color: var(--navy); margin-bottom: .35rem; }
.input, select.input, textarea.input {
  width: 100%; padding: .68rem .8rem; border: 1px solid var(--line); border-radius: var(--radius-sm);
  font: inherit; color: var(--ink); background: #fff; transition: border .15s, box-shadow .15s;
}
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(77,163,240,.18); outline: none; }
.input-group { display: grid; grid-template-columns: 92px 1fr; gap: .5rem; }
.field-error { color: var(--danger); font-size: .82rem; margin-top: .3rem; }
.check { display: flex; gap: .6rem; align-items: flex-start; font-size: .9rem; color: var(--muted); }
.check input { margin-top: .25rem; }
.helper { font-size: .82rem; color: var(--muted); margin-top: .3rem; }

@media (max-width: 560px) { .form-grid { grid-template-columns: 1fr; } }

/* ---- Flash --------------------------------------------------------------- */
.flash { border-radius: var(--radius-sm); padding: .8rem 1rem; margin-bottom: 1.1rem; font-size: .92rem; border: 1px solid; }
.flash-success { background: #eaf7f0; border-color: #bfe6d2; color: #16603f; }
.flash-error { background: #fdeeec; border-color: #f6cfc9; color: #8f2c20; }

/* ==========================================================================
   APP SHELL (topbar + sidebar)
   ========================================================================== */
.app { min-height: 100vh; }
.topbar {
  height: var(--topbar-h); background: var(--navy); color: #fff; position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 16px; padding: 0 20px;
}
.topbar .brandmark { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 700; }
.topbar .brandmark img { width: 34px; height: 34px; border-radius: 8px; background: #fff; padding: 3px; }
.topbar .brandmark .tag { color: var(--accent); font-weight: 600; }
.topbar .spacer { flex: 1; }
.topbar .who { font-size: .9rem; color: #cfe0fb; }
.topbar .who b { color: #fff; font-weight: 600; }
.topbar .btn-icon { background: transparent; border: 1px solid rgba(255,255,255,.2); color: #fff;
  border-radius: 8px; padding: .45rem .6rem; cursor: pointer; }
.hamburger { display: none; background: transparent; border: 0; color: #fff; font-size: 1.4rem; cursor: pointer; }

.shell { display: grid; grid-template-columns: var(--sidebar-w) 1fr; align-items: start; }
.sidebar {
  position: sticky; top: var(--topbar-h); height: calc(100vh - var(--topbar-h));
  background: var(--surface); border-right: 1px solid var(--line); padding: 18px 12px; overflow-y: auto;
}
.side-group { font-size: .7rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted);
  margin: 14px 12px 6px; font-weight: 700; }
.side-link { display: flex; align-items: center; gap: 10px; padding: .6rem .75rem; border-radius: 9px;
  color: var(--navy); font-weight: 500; font-size: .94rem; }
.side-link:hover { background: var(--sky); text-decoration: none; }
.side-link.active { background: var(--navy); color: #fff; }
.side-link .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }

.main { padding: 28px 28px 60px; min-width: 0; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .hamburger { display: block; }
  .sidebar { position: fixed; left: 0; top: var(--topbar-h); width: 82%; max-width: 300px; z-index: 45;
    transform: translateX(-105%); transition: transform .2s ease; box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: translateX(0); }
  .scrim { position: fixed; inset: var(--topbar-h) 0 0 0; background: rgba(3,23,54,.4); z-index: 44; display: none; }
  .scrim.open { display: block; }
  .main { padding: 20px 16px 50px; }
}

/* ==========================================================================
   CARDS · STATS · TABLES · PROGRESS
   ========================================================================== */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.card + .card { margin-top: 18px; }
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.grid { display: grid; gap: 18px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-2-1 { grid-template-columns: 2fr 1fr; }
@media (max-width: 980px) { .grid-4 { grid-template-columns: repeat(2,1fr); } .grid-3 { grid-template-columns: 1fr; } .grid-2-1 { grid-template-columns: 1fr; } }

.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.stat .k { font-family: var(--font-display); font-size: 2rem; font-weight: 700; color: var(--navy); line-height: 1; }
.stat .l { color: var(--muted); font-size: .86rem; margin-top: .35rem; }
.stat .accent { color: var(--blue); }

.progress { height: 10px; background: var(--sky); border-radius: 999px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: linear-gradient(90deg, var(--blue), var(--accent)); border-radius: 999px; }
.progress-label { display: flex; justify-content: space-between; font-size: .84rem; color: var(--muted); margin-bottom: .4rem; }

table.tbl { width: 100%; border-collapse: collapse; font-size: .92rem; }
table.tbl th { text-align: left; font-family: var(--font-display); font-size: .76rem; text-transform: uppercase;
  letter-spacing: .08em; color: var(--muted); padding: .6rem .7rem; border-bottom: 1px solid var(--line); }
table.tbl td { padding: .7rem; border-bottom: 1px solid var(--line); }
table.tbl tr:last-child td { border-bottom: 0; }
.table-wrap { overflow-x: auto; }

/* radar levels */
.radar-list { display: grid; gap: 12px; }
.radar-item { display: grid; grid-template-columns: 1fr auto; gap: 6px; align-items: center; }
.radar-item .name { font-weight: 600; color: var(--navy); font-size: .92rem; }
.radar-item .lvl { font-size: .78rem; color: var(--muted); }
.radar-track { grid-column: 1 / -1; height: 8px; background: var(--sky); border-radius: 999px; overflow: hidden; }
.radar-track > span { display: block; height: 100%; background: linear-gradient(90deg, var(--navy), var(--blue)); }

.note { font-size: .82rem; color: var(--muted); background: var(--sky); border-radius: var(--radius-sm);
  padding: .7rem .9rem; border: 1px solid #d4e6fb; }

.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty .em-icon { width: 56px; height: 56px; margin: 0 auto 12px; opacity: .7; }

/* ---- Footer -------------------------------------------------------------- */
.foot { border-top: 1px solid var(--line); padding: 22px 0; color: var(--muted); font-size: .84rem; }
.foot a { color: var(--muted); }
.foot .row { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between; }

/* prose (legal) */
.prose { max-width: 760px; }
.prose h2 { margin-top: 1.6rem; }
.prose ul { padding-left: 1.2rem; }
