/* Basic modern styles */
:root{
  --bg:#0b0e12;
  --panel:#11161d;
  --panel2:#141a22;
  --text:#ecf1f8;
  --muted:#a7b0bd;
  --brand:#6ee7ff;
  --accent:#99f6e4;
  --ok:#86efac;
  --warn:#fde68a;
  --danger:#fca5a5;
  --border:#223043;
}
*{box-sizing:border-box}
html,body{min-height:100%}
body{
  margin:0;
  font-family:Inter, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  background:linear-gradient(180deg,#0b0e12,#0a1016);
  color:var(--text);
}

.app-header{
  display:flex; align-items:center; justify-content:space-between;
  padding:16px 20px; border-bottom:1px solid var(--border); background:rgba(10,16,22,.7); backdrop-filter:blur(6px); position:sticky; top:0; z-index:50;
}
.brand{display:flex; flex-direction:column; gap:4px}
.logo{font-weight:800; font-size:20px; color:var(--brand)}
.subtitle{font-size:12px; color:var(--muted)}
.header-actions{display:flex; gap:10px}
button{border:1px solid var(--border); background:var(--panel2); color:var(--text); padding:10px 14px; border-radius:10px; cursor:pointer}
button.primary{background:var(--brand); color:#001018; font-weight:700; border:0}
button.ghost{background:transparent}

.app-main{
  display:grid; gap:16px; padding:16px; grid-template-columns: 1fr 1.3fr; grid-template-areas:
    "inputs outputs"
    "termsheet outputs";
}
@media (max-width: 1100px){
  .app-main{grid-template-columns:1fr; grid-template-areas:
    "inputs"
    "outputs"
    "termsheet";}
}

.panel{
  background:var(--panel);
  border:1px solid var(--border);
  border-radius:16px; padding:16px;
}
.inputs{grid-area:inputs}
.outputs{grid-area:outputs}
.termsheet{grid-area:termsheet}

h2{margin:0 0 12px 0; font-size:18px}
h3{margin:14px 0 8px 0; font-size:15px}
.field{display:flex; flex-direction:column; gap:6px; margin-bottom:12px}
.field.split{display:grid; grid-template-columns:1fr 1fr; gap:12px}
label{font-size:12px; color:var(--muted); display:flex; justify-content:space-between; align-items:center; gap:8px}
input, select{
  width: 100%;
  appearance:none; -webkit-appearance:none;
  border:1px solid var(--border); background:var(--panel2); color:var(--text);
  padding:10px 12px; border-radius:10px;
}
.hint{font-size:12px; color:var(--muted)}

.assumptions{margin-top:8px}
.assump-grid{display:grid; grid-template-columns:1fr 1fr; gap:16px; margin-top:12px}
.assump-notes{margin-top:10px; font-size:13px; color:var(--muted)}
@media (max-width: 700px){
  .assump-grid{grid-template-columns:1fr}
  .field.split{grid-template-columns:1fr}
}

.kpis{display:grid; grid-template-columns: repeat(3, 1fr); gap:12px}
@media (max-width: 700px){
  .kpis{grid-template-columns:1fr 1fr}
}
.kpi{background:var(--panel2); border:1px dashed var(--border); padding:12px; border-radius:12px}
.kpi-label{font-size:12px; color:var(--muted)}
.kpi-value{font-size:20px; font-weight:700; margin-top:6px}

.table{width:100%; border-collapse:collapse; margin-top:8px}
.table th, .table td{border-bottom:1px solid var(--border); padding:10px; text-align:left}
.table th{color:var(--muted); font-weight:600; font-size:12px}
.table td{font-size:14px}

.charts{display:grid; gap:16px; margin-top:16px}
/* Chart containers for ECharts */
.charts .chart{background:var(--panel2); border:1px solid var(--border); border-radius:12px; padding:10px; height:420px}
@media (max-width: 700px){
  .charts .chart{height:320px}
}

.termsheet-box{
  white-space:pre-wrap; background:var(--panel2); border:1px solid var(--border); border-radius:12px;
  padding:14px; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace; font-size:13px; color:#d5e7ff;
  min-height: 240px;
}
.actions{margin-top:10px}

.app-footer{
  padding:16px; font-size:12px; color:var(--muted); display:flex; justify-content:center; border-top:1px solid var(--border); margin-top:16px
}
