/* Citadel Command portal layout — loads after site.css */
body.command { background: var(--stage); }
.cmd-shell { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
@media (max-width: 900px) { .cmd-shell { grid-template-columns: 1fr; } .cmd-side { position: static !important; height: auto !important; } }

.cmd-side { background: linear-gradient(180deg, var(--navy) 0%, var(--navy-deep) 100%); color: #D6DEE9; padding: 1.4rem 1rem; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 1rem; border-right: 1px solid #23395E; }
.cmd-logo { text-align: center; padding: .4rem 0 .2rem; }
.cmd-logo .word { color: #fff; font-weight: 700; font-size: 1.25rem; letter-spacing: .32em; text-indent: .32em; margin-top: .4rem; }
.cmd-logo .sub { color: var(--gold); font-size: .56rem; letter-spacing: .28em; font-weight: 600; margin-top: .15rem; }
.cmd-logo .powered { color: #7F90A8; font-size: .62rem; letter-spacing: .12em; margin-top: .55rem; }
.cmd-logo .powered b { color: #C9D3E0; }
.cmd-demo { margin: .2rem 0; padding: .45rem .6rem; border-radius: 8px; background: rgba(184,148,78,.14); border: 1px solid rgba(184,148,78,.45); color: #E6CC8A; font-size: .64rem; letter-spacing: .06em; line-height: 1.45; text-align: center; }
.cmd-nav { display: flex; flex-direction: column; gap: .15rem; }
.cmd-nav a { display: flex; align-items: center; gap: .6rem; padding: .55rem .75rem; border-radius: 8px; color: #D6DEE9; font-weight: 500; font-size: .93rem; }
.cmd-nav a:hover { background: #1B3156; color: #fff; }
.cmd-nav a.active { background: #1F3A66; color: var(--gold-light); }
.cmd-nav a .ico { width: 18px; text-align: center; opacity: .9; }
.cmd-nav .sep { height: 1px; background: #23395E; margin: .5rem 0; }
.cmd-side .foot { margin-top: auto; border-top: 1px solid #23395E; padding-top: .8rem; font-size: .68rem; color: #7F90A8; line-height: 1.5; }
.cmd-side .foot b { color: #C9D3E0; }
.cmd-side .user { display: flex; align-items: center; gap: .6rem; padding: .5rem .6rem; background: rgba(255,255,255,.05); border-radius: 10px; font-size: .82rem; }
.cmd-side .user .avatar { width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(180deg, var(--gold-light), var(--gold-deep)); color: var(--navy); font-weight: 700; display: grid; place-items: center; font-size: .85rem; }
.cmd-side .user a { color: #9FB0C6; margin-left: auto; font-size: .75rem; }

.cmd-main { padding: 1.6rem 2rem 3rem; min-width: 0; }
@media (max-width: 620px) { .cmd-main { padding: 1rem 1rem 2.5rem; } }
.cmd-hero { background: var(--navy); color: #fff; border-radius: var(--radius); padding: 1.3rem 1.6rem; margin-bottom: 1.1rem; border-left: 6px solid var(--gold); display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; }
.cmd-hero .kicker { margin-bottom: .2rem; }
.cmd-hero h1 { color: #fff; font-size: 1.5rem; margin: 0; }
.cmd-hero p { color: #B9C6D8; margin: .3rem 0 0; font-size: .92rem; max-width: 52rem; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .8rem; margin-bottom: 1.1rem; }
.kpi { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: .9rem 1.1rem; }
.kpi .label { color: var(--muted); font-size: .66rem; letter-spacing: .18em; font-weight: 600; text-transform: uppercase; }
.kpi .value { font-size: 1.25rem; font-weight: 700; color: var(--navy); line-height: 1.25; overflow-wrap: anywhere; margin-top: .15rem; }
.kpi .hint { color: var(--muted); font-size: .76rem; margin-top: .15rem; }
.kpi.gold .value { color: var(--gold-deep); }

.panel { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 1.1rem 1.25rem; margin-bottom: 1.1rem; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: .8rem; flex-wrap: wrap; }
.panel-head h3 { margin: 0; font-size: 1rem; }
.panel-head .actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.cols-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem; }
.cols-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.1rem; }
.cols-2-1 { display: grid; grid-template-columns: 2fr 1fr; gap: 1.1rem; }
@media (max-width: 1100px) { .cols-3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 820px) { .cols-2, .cols-3, .cols-2-1 { grid-template-columns: 1fr; } }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
table.data { width: 100%; border-collapse: collapse; font-size: .86rem; }
table.data th { text-align: left; background: #F4F6F9; color: var(--muted); font-weight: 600; font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; padding: .6rem .75rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.data td { padding: .55rem .75rem; border-bottom: 1px solid #EEF2F7; vertical-align: top; }
table.data tr:last-child td { border-bottom: 0; }
table.data tr:hover td { background: #FAFBFD; }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.data tr.clickable { cursor: pointer; }
table.data tr.total td { font-weight: 700; background: #F4F6F9; }

.evidence { font-family: var(--mono); font-size: .74rem; color: var(--steel); background: #EEF2F7; border-radius: 6px; padding: .12rem .45rem; display: inline-block; }
.gate { background: #FBF7EE; border: 1px dashed var(--gold); border-radius: 10px; padding: .7rem 1rem; margin: .6rem 0; font-size: .86rem; color: #4A3A1A; }
.gate b { color: var(--gold-deep); }
.conf { display: inline-block; min-width: 2.6rem; text-align: center; }

.chart { width: 100%; height: auto; display: block; }
.chart text { font-family: var(--font); fill: var(--muted); font-size: 11px; }
.chart .axis { stroke: var(--line); }
.legend { display: flex; gap: 1rem; flex-wrap: wrap; font-size: .78rem; color: var(--muted); margin-top: .5rem; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: .35rem; vertical-align: -1px; }

.dropzone { border: 2px dashed var(--line); border-radius: 12px; padding: 1.6rem; text-align: center; color: var(--muted); background: #FAFBFD; transition: all .15s; cursor: pointer; }
.dropzone:hover, .dropzone.over { border-color: var(--gold); background: #FBF7EE; color: var(--gold-deep); }
.dropzone b { color: var(--navy); }
.progress { height: 8px; background: #EEF2F7; border-radius: 4px; overflow: hidden; margin: .6rem 0; }
.progress i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--navy), var(--gold)); transition: width .6s ease; }
.steps { list-style: none; padding: 0; margin: .5rem 0 0; font-size: .84rem; }
.steps li { padding: .28rem 0 .28rem 1.5rem; position: relative; color: var(--muted); }
.steps li::before { content: ""; position: absolute; left: .2rem; top: .62rem; width: 8px; height: 8px; border-radius: 50%; background: var(--line); }
.steps li.done { color: var(--ink); } .steps li.done::before { background: var(--ok); }
.steps li.active { color: var(--navy); font-weight: 600; } .steps li.active::before { background: var(--gold); box-shadow: 0 0 0 4px rgba(184,148,78,.25); }

.tabs { display: flex; gap: .2rem; border-bottom: 1px solid var(--line); margin-bottom: 1rem; overflow-x: auto; }
.tabs button { background: none; border: 0; border-bottom: 2px solid transparent; padding: .6rem .9rem; font: inherit; font-weight: 600; color: var(--muted); cursor: pointer; white-space: nowrap; }
.tabs button.active { color: var(--navy); border-bottom-color: var(--gold); }
.tab-panel { display: none; } .tab-panel.active { display: block; }

.toast { position: fixed; right: 1.2rem; bottom: 1.2rem; background: var(--navy); color: #fff; padding: .8rem 1.1rem; border-radius: 10px; box-shadow: var(--shadow); font-size: .9rem; z-index: 100; border-left: 4px solid var(--gold); opacity: 0; transform: translateY(8px); transition: all .25s; pointer-events: none; }
.toast.show { opacity: 1; transform: none; }

.modal-back { position: fixed; inset: 0; background: rgba(13,27,51,.55); display: none; z-index: 90; align-items: center; justify-content: center; padding: 1rem; }
.modal-back.open { display: flex; }
.modal { background: #fff; border-radius: 14px; max-width: 920px; width: 100%; max-height: 90vh; overflow: auto; padding: 1.6rem 1.8rem; box-shadow: var(--shadow); }
.modal-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.modal-head h2 { margin: 0; font-size: 1.3rem; }
.close-x { background: none; border: 0; font-size: 1.4rem; cursor: pointer; color: var(--muted); }

/* report (print) */
.report { font-size: .9rem; }
.report h1 { font-size: 1.6rem; } .report h2 { font-size: 1.1rem; margin-top: 1.4rem; }
.report table.data { font-size: .82rem; }
.report .sig { margin-top: 2rem; border-top: 1px solid var(--ink); width: 60%; padding-top: .4rem; }
@media print {
  body.command { background: #fff; }
  .cmd-side, .no-print, .toast { display: none !important; }
  .cmd-shell { display: block; } .cmd-main { padding: 0; }
  .modal-back { position: static; display: block; background: none; padding: 0; }
  .modal { max-height: none; box-shadow: none; max-width: none; padding: 0; }
}

/* login */
.login-wrap { min-height: 100vh; display: grid; place-items: center; background: radial-gradient(900px 420px at 80% -10%, rgba(184,148,78,.28), transparent 60%), linear-gradient(180deg, var(--navy) 0%, var(--navy-deep) 100%); padding: 2rem 1rem; }
.login-card { background: #fff; border-radius: 16px; padding: 2.2rem 2.2rem 1.8rem; width: 100%; max-width: 420px; box-shadow: 0 30px 60px rgba(0,0,0,.35); }
.login-card .mark { text-align: center; margin-bottom: 1.2rem; }
.login-card .mark .word { font-weight: 700; letter-spacing: .32em; text-indent: .32em; color: var(--navy); font-size: 1.2rem; margin-top: .4rem; }
.login-card .mark .sub { color: var(--gold); font-size: .58rem; letter-spacing: .28em; font-weight: 600; }
.login-card .error { color: var(--bad); font-size: .85rem; margin-top: .5rem; min-height: 1.2rem; }
.login-foot { text-align: center; color: #9FB0C6; font-size: .78rem; margin-top: 1.2rem; }
.login-foot a { color: #C9D3E0; }
