
:root{
  --bg:#0b1220;
  --panel:#121b2f;
  --panel-2:#18243c;
  --text:#eaf0ff;
  --muted:#9fb0d0;
  --stroke:rgba(255,255,255,.12);
  --brand:#4da3ff;
  --brand-2:#7c5cff;
  --good:#32d583;
  --warn:#fbbf24;
  --bad:#f97066;
  --card-shadow:0 14px 34px rgba(0,0,0,.22);
}
*{box-sizing:border-box}
html,body{margin:0;padding:0;background:linear-gradient(180deg,#07111f,#0b1220 30%,#101829);color:var(--text);font-family:Inter,system-ui,Segoe UI,Arial,sans-serif}
body{min-height:100vh}
.app-shell{max-width:1520px;margin:0 auto;padding:18px}
.topbar{display:flex;justify-content:space-between;gap:16px;align-items:flex-start;margin-bottom:16px}
.topbar h1{margin:0 0 6px;font-size:clamp(24px,3vw,36px)}
.muted{margin:0;color:var(--muted)}
.top-actions{display:flex;gap:10px;flex-wrap:wrap;align-items:center}
.btn{border:1px solid var(--stroke);background:var(--panel);color:var(--text);padding:11px 14px;border-radius:12px;font-weight:700;cursor:pointer}
.btn:hover{filter:brightness(1.08)}
.btn.accent{background:linear-gradient(135deg,var(--brand),var(--brand-2));border:none}
.btn.secondary{background:#0e172b}
.file-btn{position:relative;overflow:hidden}
.file-btn input{position:absolute;inset:0;opacity:0;cursor:pointer}
.hero-grid,.grid{display:grid;gap:14px}
.hero-grid{grid-template-columns:repeat(8,minmax(0,1fr));margin-bottom:16px}
.grid.cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}
.grid.cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}
.span-2{grid-column:span 2}
.card{background:linear-gradient(180deg,rgba(255,255,255,.03),rgba(255,255,255,.015));backdrop-filter:blur(6px);border:1px solid var(--stroke);border-radius:18px;padding:16px;box-shadow:var(--card-shadow)}
.kpi-card{padding:14px 16px}
.kpi-card span{display:block;color:var(--muted);font-size:12px;margin-bottom:8px}
.kpi-card strong{font-size:24px}
.tabs{display:flex;flex-wrap:wrap;gap:10px;margin:6px 0 16px}
.tab{padding:11px 16px;background:#0f1730;border:1px solid var(--stroke);color:var(--text);border-radius:999px;cursor:pointer;font-weight:700}
.tab.active{background:linear-gradient(135deg,#173055,#1b3e73);border-color:rgba(125,175,255,.4)}
.tab-panel{display:none}
.tab-panel.active{display:block}
h2,h3{margin-top:0}
.form-grid{display:grid;gap:12px}
.form-grid.cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}
label{display:flex;flex-direction:column;gap:6px;font-size:13px;color:var(--muted)}
input,select,textarea{width:100%;padding:11px 12px;border-radius:12px;border:1px solid var(--stroke);background:#081122;color:var(--text)}
input:focus,select:focus,textarea:focus{outline:2px solid rgba(77,163,255,.35);border-color:transparent}
.stack{display:flex;flex-direction:column;gap:10px}
.status-box,.report-preview{display:flex;flex-direction:column;gap:10px}
.badge{display:inline-flex;align-items:center;gap:6px;font-size:12px;font-weight:800;padding:6px 10px;border-radius:999px}
.badge.ok{background:rgba(50,213,131,.12);color:#7ef0ae}
.badge.warn{background:rgba(251,191,36,.12);color:#ffd76d}
.badge.error{background:rgba(249,112,102,.12);color:#ff9b93}
.badge.note{background:rgba(77,163,255,.12);color:#a6d2ff}
.list{display:flex;flex-direction:column;gap:8px}
.list-item{padding:10px 12px;border-radius:12px;border:1px solid var(--stroke);background:rgba(255,255,255,.02)}
.hint{font-size:13px;color:var(--muted)}
.divider{height:1px;background:var(--stroke);margin:12px 0}
.code{font-family:ui-monospace,SFMono-Regular,Menlo,monospace}
.table-wrap{overflow:auto}
table{width:100%;border-collapse:collapse;font-size:13px}
th,td{padding:9px 10px;border-bottom:1px solid rgba(255,255,255,.08);text-align:left;vertical-align:top}
th{color:#bfd2ff;font-weight:800;background:rgba(255,255,255,.02)}
.metric{display:flex;justify-content:space-between;gap:12px;padding:8px 0;border-bottom:1px dashed rgba(255,255,255,.08)}
.metric:last-child{border-bottom:none}
.metric .label{color:var(--muted)}
.metric .value{font-weight:700}
.report-toolbar{display:flex;gap:10px;flex-wrap:wrap;margin-bottom:12px}
.report-preview .sheet{background:white;color:#102038;border-radius:16px;padding:26px;box-shadow:0 18px 40px rgba(0,0,0,.18);margin-bottom:14px}
.sheet h1,.sheet h2,.sheet h3{color:#0f2c55}
.sheet .subtle{color:#52627a}
.sheet .grid2{display:grid;grid-template-columns:1fr 1fr;gap:16px}
.sheet .box{border:1px solid #d5deea;border-radius:12px;padding:12px}
.sheet table{color:#1a2740}
.sheet th{background:#eff5ff;color:#153766}
.report-cover{display:grid;gap:18px}
.print-only{display:none}
@media (max-width:1200px){
  .hero-grid{grid-template-columns:repeat(4,minmax(0,1fr))}
  .grid.cols-3{grid-template-columns:1fr}
}
@media (max-width:900px){
  .topbar{flex-direction:column}
  .hero-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .grid.cols-2,.form-grid.cols-2{grid-template-columns:1fr}
  .span-2{grid-column:span 1}
}
@media print{
  body{background:white}
  .topbar,.tabs,.report-toolbar,.top-actions,.hero-grid{display:none !important}
  .app-shell{max-width:none;padding:0}
  .tab-panel{display:none !important}
  #tab-report{display:block !important}
  .report-preview .sheet{box-shadow:none;border-radius:0;margin:0 0 12mm;padding:12mm}
  .print-only{display:block}
}
