/* ─────────────────────────────────────────────────────────────────────────
   Zetat™ — Dark theme stylesheet
   zetat.fyicyber.com
   ───────────────────────────────────────────────────────────────────────── */

/* ── Reset + box model ───────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button, select, input, textarea { font-family: inherit; font-size: inherit; }
ul, ol { list-style: none; }
img { max-width: 100%; display: block; }

/* ── Topbar ──────────────────────────────────────────────────────────────── */
.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
  height: 60px;
}
.topbar-inner {
  max-width: 1400px; margin: 0 auto;
  display: flex; align-items: center; gap: 24px;
  padding: 0 20px; height: 100%;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-shield {
  display: block; flex-shrink: 0;
  filter: drop-shadow(0 0 6px rgba(0,200,255,.35));
}
.brand-text   { display: flex; flex-direction: column; gap: 1px; }
.brand-name   { color: var(--accent); font-weight: 700; font-size: 16px; }
.brand-sub    { color: var(--muted); font-size: 12px; }

.topbar-nav { display: flex; gap: 2px; margin-left: 8px; }
.nav-link {
  color: var(--muted); font-size: 13px; font-weight: 500;
  padding: 6px 12px; border-radius: 6px;
  text-decoration: none; transition: color .15s, background .15s;
}
.nav-link:hover, .nav-link.active {
  color: var(--accent); background: rgba(0,200,255,.08);
}

.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.badge-nsa {
  background: #0f2d10; color: var(--green);
  font-size: 11px; font-weight: 600;
  padding: 3px 10px; border-radius: 4px;
  cursor: default;
}
.org-label { color: var(--muted); font-size: 12px; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── User bar (below topbar, far right) ──────────────────────────────────── */
.user-bar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  padding: 3px 20px;
  font-size: 11px;
}
.user-bar-email {
  color: var(--muted);
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-bar-signout {
  color: var(--muted);
  text-decoration: none;
  transition: color .15s;
}
.user-bar-signout:hover { color: var(--accent); text-decoration: none; }

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 16px; border-radius: 6px;
  font-size: 13px; font-weight: 500;
  border: 1px solid transparent; cursor: pointer;
  transition: background .15s, color .15s, opacity .15s;
}
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: #000; border-color: var(--accent); }
.btn-primary:hover:not(:disabled) { background: #00b3e6; }
.btn-ghost {
  background: var(--card); color: var(--text); border-color: var(--border);
}
.btn-ghost:hover:not(:disabled) { background: var(--border); color: var(--accent); }

/* ── Main layout ─────────────────────────────────────────────────────────── */
#appMain { max-width: 1400px; margin: 0 auto; padding: 0 20px 40px; }

/* ── Pages (SPA) ─────────────────────────────────────────────────────────── */
.page { display: none; }
.page.active { display: block; }

/* ── Page header ─────────────────────────────────────────────────────────── */
.page-header { padding: 20px 0 10px; }
.page-header-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.page-title { font-size: 22px; font-weight: 700; }
.page-sub { color: var(--muted); font-size: 13px; margin-top: 2px; }

/* ── Card ────────────────────────────────────────────────────────────────── */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px;
}
.section-title { font-size: 14px; font-weight: 600; margin-bottom: 12px; }
.section-title.center { text-align: center; }

/* ── Phase timeline ──────────────────────────────────────────────────────── */
.phase-timeline {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 8px; margin-bottom: 16px;
}
.phase-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 8px; padding: 14px 12px; text-align: center;
}
.phase-icon  { font-size: 22px; }
.phase-label { font-size: 13px; font-weight: 600; margin: 4px 0 2px; }
.phase-sub   { font-size: 11px; color: var(--muted); }

/* ── Stat grid ───────────────────────────────────────────────────────────── */
.stat-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 10px; margin-bottom: 16px;
}
.stat-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 10px; padding: 14px 16px;
}
.stat-lbl { font-size: 11px; color: var(--muted); margin-bottom: 4px; }
.stat-val { font-size: 28px; font-weight: 700; line-height: 1.1; }
.stat-hint { font-size: 11px; color: var(--muted); margin-top: 3px; }

/* ── Mid row: pillars + radar ────────────────────────────────────────────── */
.mid-row { display: flex; gap: 16px; margin-bottom: 16px; }
.pillar-section { flex: 1; min-width: 0; }
.pillar-row {
  background: var(--card); border-radius: 6px;
  display: flex; align-items: center; gap: 10px;
  padding: 7px 12px; margin-bottom: 4px;
}
.pillar-name { font-size: 12px; font-weight: 600; width: 88px; flex-shrink: 0; }
.pillar-bar-wrap {
  flex: 1; height: 8px; background: var(--border); border-radius: 99px; overflow: hidden;
}
.pillar-bar { height: 100%; border-radius: 99px; transition: width .4s ease; }
.pillar-pct { font-size: 12px; font-weight: 600; width: 72px; text-align: right; flex-shrink: 0; }

.radar-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 10px; padding: 14px; flex-shrink: 0; width: 320px;
}
#radarSvg { width: 100%; height: auto; display: block; }

/* ── Bottom row ──────────────────────────────────────────────────────────── */
.bottom-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.phase-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.phase-row-label { font-size: 12px; width: 90px; flex-shrink: 0; }
.phase-bar-wrap { flex: 1; height: 8px; background: var(--border); border-radius: 99px; overflow: hidden; }
.phase-bar { height: 100%; border-radius: 99px; transition: width .4s ease; }
.phase-pct { font-size: 12px; font-weight: 600; width: 40px; text-align: right; }

.gap-item {
  display: flex; align-items: center; gap: 6px;
  padding: 5px 0; border-bottom: 1px solid var(--border);
}
.gap-item:last-child { border: none; }
.gap-cid { font-size: 11px; font-weight: 700; width: 34px; flex-shrink: 0; }
.gap-name { font-size: 12px; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gap-status { font-size: 11px; font-weight: 600; flex-shrink: 0; }

/* ── Toolbar / filters ───────────────────────────────────────────────────── */
.toolbar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  background: var(--surface); border-bottom: 1px solid var(--border);
  padding: 8px 16px;
}
.filter-label { font-size: 12px; color: var(--muted); }
.filter-select {
  background: var(--card); color: var(--text);
  border: 1px solid var(--border); border-radius: 5px;
  padding: 5px 10px; font-size: 12px; cursor: pointer;
}
.filter-select:focus { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ── Capabilities table ──────────────────────────────────────────────────── */
.table-wrap {
  overflow-x: auto; overflow-y: auto;
  max-height: calc(100vh - 160px);
}
.cap-table {
  width: 100%; border-collapse: collapse;
  font-size: 12px; min-width: 900px;
}
.cap-table thead { position: sticky; top: 0; z-index: 2; }
.cap-table th {
  background: var(--card); color: var(--muted);
  text-transform: uppercase; font-size: 10px; letter-spacing: .5px;
  padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--border);
}
.cap-table td {
  padding: 8px 12px; border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.cap-table tbody tr:hover { background: var(--surface); }
.col-id { width: 42px; }
.col-phase { width: 88px; }
.col-status { width: 100px; }
.col-priority { width: 72px; }
.col-due { width: 88px; }
.col-actions { width: 48px; }

.status-badge {
  display: inline-block; font-size: 10px; font-weight: 600;
  padding: 2px 8px; border-radius: 4px;
  background: rgba(255,255,255,.06);
}
.edit-btn {
  background: none; border: none; cursor: pointer;
  color: var(--accent); font-size: 14px; padding: 2px 6px;
  border-radius: 4px; transition: background .15s;
}
.edit-btn:hover { background: var(--border); }

/* ── Gap Analysis ────────────────────────────────────────────────────────── */
.gap-layout { display: flex; gap: 16px; margin-top: 12px; }
.heatmap-wrap { flex: 1; position: relative; min-width: 0; }
.heatmap-grid {
  display: flex; gap: 6px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 10px; padding: 14px;
}
.hm-col { flex: 1; min-width: 0; }
.hm-col-label {
  font-size: 10px; font-weight: 700; text-align: center;
  margin-bottom: 6px; white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis;
}
.hm-cell {
  border-radius: 4px; border: 1px solid;
  font-size: 9px; font-weight: 700;
  text-align: center; padding: 4px 2px;
  cursor: pointer; margin-bottom: 3px;
  transition: filter .15s;
}
.hm-cell:hover { filter: brightness(1.25); }

.hm-tooltip {
  position: fixed; z-index: 200;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 6px; padding: 8px 12px;
  font-size: 12px; max-width: 260px;
  pointer-events: none;
  box-shadow: 0 4px 16px rgba(0,0,0,.5);
}

.gap-list-wrap { width: 300px; flex-shrink: 0; }
.gap-list { overflow-y: auto; max-height: calc(100vh - 220px); }
.gap-list-item {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 10px; border-bottom: 1px solid var(--border);
  background: var(--card); border-radius: 4px; margin-bottom: 2px;
}
.gl-cid  { font-size: 10px; font-weight: 700; width: 30px; flex-shrink: 0; }
.gl-name { font-size: 11px; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gl-st   { font-size: 10px; font-weight: 600; flex-shrink: 0; }

/* ── Tech mapping ────────────────────────────────────────────────────────── */
.tech-layout { display: flex; gap: 16px; margin-top: 12px; height: calc(100vh - 200px); }
.tech-sidebar {
  width: 260px; flex-shrink: 0;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; overflow-y: auto; padding: 12px;
}
.tech-category-label {
  font-size: 11px; color: var(--muted); font-weight: 600;
  text-transform: uppercase; letter-spacing: .5px;
  padding: 6px 4px 4px; cursor: pointer;
  display: flex; align-items: center; gap: 4px;
}
.tech-item {
  font-size: 12px; padding: 5px 10px; border-radius: 5px;
  cursor: pointer; transition: background .12s, color .12s;
  color: var(--muted);
}
.tech-item:hover, .tech-item.active {
  background: var(--border); color: var(--accent);
}
.tech-detail-pane {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; gap: 10px;
}
.tech-detail {
  flex: 1; background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 16px; overflow-y: auto;
  font-size: 13px;
}
.tech-detail h3 { color: var(--accent); font-size: 16px; margin-bottom: 4px; }
.tech-detail .sub { color: var(--muted); font-size: 12px; margin-bottom: 14px; }
.tech-cap-row { display: flex; gap: 8px; align-items: baseline; margin-bottom: 4px; font-size: 12px; }
.tech-pillar-muted { color: var(--muted); font-size: 11px; }
.tech-status-right { font-size: 11px; margin-left: auto; }
.tech-empty { margin: 12px 0; }
.tech-section-head { font-size: 12px; color: var(--muted); font-weight: 600; margin: 12px 0 6px; }
.muted-hint { color: var(--muted); font-size: 13px; }

/* ── Reports ─────────────────────────────────────────────────────────────── */
.report-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 14px; margin-bottom: 28px;
}
.report-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 10px; padding: 18px;
}
.report-icon  { font-size: 24px; margin-bottom: 8px; }
.report-title { font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.report-desc  { font-size: 12px; color: var(--muted); margin-bottom: 14px; line-height: 1.5; }

.snapshot-section { margin-top: 8px; }
.snap-table {
  width: 100%; border-collapse: collapse;
  font-size: 12px; margin-top: 12px;
}
.snap-table th {
  background: var(--card); color: var(--muted);
  text-transform: uppercase; font-size: 10px; letter-spacing: .5px;
  padding: 8px 12px; text-align: left; border-bottom: 1px solid var(--border);
}
.snap-table td { padding: 8px 12px; border-bottom: 1px solid var(--border); }

/* ── About page ──────────────────────────────────────────────────────────── */
.about-wrap { max-width: 960px; margin: 0 auto; padding: 24px 0 40px; }
.about-hero {
  display: flex; align-items: center; gap: 16px;
  margin-bottom: 28px;
}
.about-shield {
  flex-shrink: 0;
  filter: drop-shadow(0 0 10px rgba(0,200,255,.4));
}
.about-title   { font-size: 22px; font-weight: 700; }
.about-version { font-size: 13px; color: var(--muted); margin-top: 2px; }

.about-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.about-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 10px; padding: 20px;
}
.about-card.full-width { grid-column: 1 / -1; }
.about-card h2 { font-size: 15px; font-weight: 600; margin-bottom: 12px; color: var(--accent); }
.about-card p  { font-size: 13px; color: var(--muted); line-height: 1.7; margin-bottom: 8px; }
.about-link    { color: var(--accent); }

.how-list { display: flex; flex-direction: column; gap: 16px; }
.how-list li { display: flex; gap: 14px; font-size: 13px; }
.step-num {
  background: var(--accent); color: #000;
  font-size: 11px; font-weight: 700;
  min-width: 24px; height: 24px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; flex-shrink: 0; margin-top: 1px;
}
.how-list strong { color: var(--text); }
.how-list p, .how-list div { color: var(--muted); line-height: 1.6; }

.pillar-list li {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 0; border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.pillar-list li:last-child { border: none; }
.pillar-dot {
  width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0;
}

.framework-list li {
  font-size: 12px; color: var(--muted);
  padding: 6px 0; border-bottom: 1px solid var(--border);
  line-height: 1.6;
}
.framework-list li:last-child { border: none; }
.framework-list strong { color: var(--text); }

/* ── Modals ──────────────────────────────────────────────────────────────── */
dialog {
  background: transparent; border: none; padding: 0;
  max-width: 100vw; max-height: 100vh;
}
dialog::backdrop { background: rgba(0,0,0,.65); backdrop-filter: blur(2px); }
.modal-inner {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; min-width: 520px; max-width: 680px;
  display: flex; flex-direction: column; max-height: 90vh;
}
.snap-modal .modal-inner { min-width: 380px; max-width: 420px; }
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.modal-title { font-size: 16px; font-weight: 600; }
.modal-close {
  background: none; border: none; color: var(--muted);
  font-size: 18px; cursor: pointer; padding: 2px 6px; border-radius: 4px;
  transition: background .12s, color .12s;
}
.modal-close:hover { background: var(--border); color: var(--text); }
.modal-body { padding: 18px 20px; overflow-y: auto; flex: 1; }
.modal-desc {
  font-size: 12px; color: var(--muted); line-height: 1.6;
  margin-bottom: 16px; padding: 10px 12px;
  background: var(--card); border-radius: 6px;
}
.capability-phases { color: var(--accent); font-size: 12px; margin: -6px 0 14px; }
.modal-footer {
  display: flex; justify-content: flex-end; gap: 8px;
  padding: 14px 20px; border-top: 1px solid var(--border);
}
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; margin-bottom: 12px; }
.form-field { display: flex; flex-direction: column; gap: 5px; }
.form-field.full { margin-bottom: 12px; }
.form-field label { font-size: 12px; color: var(--muted); font-weight: 500; }
.form-field input, .form-field select, .form-field textarea {
  background: var(--card); color: var(--text);
  border: 1px solid var(--border); border-radius: 6px;
  padding: 7px 10px; font-size: 13px;
  transition: border-color .15s;
}
.form-field input:focus, .form-field select:focus, .form-field textarea:focus {
  outline: none; border-color: var(--accent);
}
.form-field textarea { resize: vertical; }
.hint { font-size: 11px; color: var(--muted); font-weight: 400; }
.hint-block { font-size: 12px; color: var(--muted); margin-top: 12px; }
.nsa-link { font-size: 12px; color: var(--accent); }

.activity-tracking { border-top: 1px solid var(--border); padding-top: 16px; margin-top: 6px; }
.activity-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.activity-heading h3 { font-size: 14px; font-weight: 600; }
.activity-heading .hint-block { margin-top: 4px; }
.activity-list, .supplemental-list { display: grid; gap: 10px; }
.activity-row, .ot-assessment-row, .legacy-assessment-row {
  border: 1px solid var(--border); border-radius: 6px; padding: 12px;
}
.activity-fields, .ot-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 12px; }
.activity-field, .ot-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.activity-field.full, .ot-field.full { grid-column: 1 / -1; }
.activity-field label, .ot-field label { color: var(--muted); font-size: 11px; }
.activity-field input, .activity-field select, .activity-field textarea,
.ot-field input, .ot-field select, .ot-field textarea {
  width: 100%; min-width: 0; background: var(--card); color: var(--text);
  border: 1px solid var(--border); border-radius: 5px; padding: 7px 9px; font-size: 12px;
}
.activity-field textarea, .ot-field textarea { resize: vertical; min-height: 58px; }
.activity-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }
.supplemental-section { border-top: 1px solid var(--border); padding: 18px 0; }
.supplemental-section > .page-sub { margin: 0 0 8px; }
.supplemental-section > p { margin-bottom: 12px; }
.source-note { color: #fbbf24; font-size: 12px; line-height: 1.5; }
.ot-assessment-row h3, .legacy-assessment-row h3 { font-size: 14px; margin-bottom: 4px; }
.ot-assessment-row > p { color: var(--muted); font-size: 12px; line-height: 1.5; margin-bottom: 10px; }
.legacy-assessment-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.legacy-assessment-meta { color: var(--muted); font-size: 12px; }
.supplemental-save { display: flex; justify-content: flex-end; margin-top: 10px; }

/* ── Toast ───────────────────────────────────────────────────────────────── */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--card); color: var(--text);
  border: 1px solid var(--border); border-radius: 8px;
  padding: 10px 20px; font-size: 13px; z-index: 500;
  box-shadow: 0 4px 20px rgba(0,0,0,.4);
  animation: slideUp .2s ease;
}
@keyframes slideUp {
  from { opacity: 0; transform: translateX(-50%) translateY(10px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ── Footer ──────────────────────────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 14px 20px; margin-top: 40px;
  text-align: center; font-size: 11px; color: var(--muted);
}
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--accent); }
.footer-brand-link { display: flex; justify-content: center; margin-top: 10px; }
.footer-brand-logo { display: block; height: 42px; width: auto; opacity: .8; transition: opacity .2s; }
.footer-brand-link:hover .footer-brand-logo { opacity: 1; }

/* ── Colour utilities ────────────────────────────────────────────────────── */
.c-green  { color: var(--green);  }
.c-yellow { color: var(--yellow); }
.c-red    { color: var(--red);    }
.c-muted  { color: var(--muted);  }
.c-accent { color: var(--accent); }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .mid-row { flex-direction: column; }
  .radar-card { width: 100%; }
  .report-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .brand-sub   { display: none; }
  .topbar-nav  { display: none; }
  .phase-timeline, .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .bottom-row  { grid-template-columns: 1fr; }
  .about-grid  { grid-template-columns: 1fr; }
  .modal-inner { min-width: auto; width: 95vw; }
  .form-grid   { grid-template-columns: 1fr; }
  .activity-fields, .ot-fields { grid-template-columns: 1fr; }
  .activity-heading { flex-direction: column; }
  .legacy-assessment-row { align-items: stretch; flex-direction: column; }
  .tech-layout { flex-direction: column; height: auto; }
  .tech-sidebar { width: 100%; }
  .gap-layout  { flex-direction: column; }
  .gap-list-wrap { width: 100%; }
  .report-grid { grid-template-columns: 1fr; }
}
