/* Supply Chain Autopilot demo — lightweight, single-page, no build step */
:root{
  --bg:#0b1020;
  --panel:#0f1730;
  --panel2:#121c39;
  --text:#e8ecff;
  --muted:#aab3da;
  --line:rgba(255,255,255,.08);
  --ok:#3ddc97;
  --warn:#ffcc66;
  --bad:#ff6b6b;
  --info:#64b5ff;
  --btn:#1f2d5a;
  --btn2:#223569;
  --shadow: 0 10px 30px rgba(0,0,0,.35);
  --radius:14px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --sans: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif;
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family:var(--sans);
  background: radial-gradient(1200px 800px at 10% 0%, #1a2a66 0%, var(--bg) 55%);
  color:var(--text);
}

a{ color:inherit; text-decoration:none; }

.topbar{
  position:sticky;
  top:0;
  z-index:20;
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:12px 16px;
  border-bottom:1px solid var(--line);
  background: rgba(11,16,32,.78);
  backdrop-filter: blur(10px);
}

.brand{
  display:flex;
  align-items:center;
  gap:12px;
}
.logo{
  width:38px;height:38px;border-radius:12px;
  display:grid; place-items:center;
  background: linear-gradient(135deg,#4d9cff,#7cf0c0);
  color:#06102a;
  font-weight:800;
  box-shadow: var(--shadow);
}
.brandtext .title{ font-weight:800; letter-spacing:.2px; }
.brandtext .subtitle{ color:var(--muted); font-size:12px; margin-top:1px; }

.topbar-right{ display:flex; align-items:center; gap:10px; flex-wrap:wrap; justify-content:flex-end; }
.scenario-pills{ display:flex; gap:6px; flex-wrap:wrap; justify-content:flex-end; }
.pill{
  padding:6px 10px;
  border:1px solid var(--line);
  border-radius:999px;
  font-size:12px;
  color:var(--muted);
  background: rgba(255,255,255,.03);
}
.pill.on{ color:#081330; background: linear-gradient(135deg,#7cf0c0,#4d9cff); border-color:transparent; font-weight:800; }

.nav{
  display:flex;
  gap:6px;
  padding:10px 16px;
  border-bottom:1px solid var(--line);
  background: rgba(11,16,32,.55);
  backdrop-filter: blur(10px);
  overflow:auto;
  white-space:nowrap;
}
.nav a{
  padding:8px 10px;
  border-radius:10px;
  color:var(--muted);
  border:1px solid transparent;
}
.nav a.active{
  color:var(--text);
  background: rgba(255,255,255,.06);
  border-color: var(--line);
}

.main{ padding:16px; }
.footer{
  display:flex;
  justify-content:space-between;
  gap:10px;
  padding:12px 16px;
  border-top:1px solid var(--line);
  color:var(--muted);
  font-size:12px;
}

.grid{
  display:grid;
  grid-template-columns: 1.1fr .9fr;
  gap:14px;
}
@media (max-width: 980px){
  .grid{ grid-template-columns: 1fr; }
}

.panel{
  background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.02));
  border:1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding:14px;
}
.panel h2, .panel h3{
  margin:0 0 10px 0;
  font-size:14px;
  letter-spacing:.2px;
}
.panel .sub{
  margin-top:-6px;
  margin-bottom:10px;
  color:var(--muted);
  font-size:12px;
}

.cards{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap:12px;
}
@media (max-width: 1100px){ .cards{ grid-template-columns: repeat(2, 1fr);} }
@media (max-width: 720px){ .cards{ grid-template-columns: 1fr;} }

.card{
  background: rgba(0,0,0,.18);
  border:1px solid var(--line);
  border-radius: var(--radius);
  padding:12px;
  min-height: 132px;
  display:flex;
  flex-direction:column;
  gap:8px;
}
.card .kpi{
  font-size:26px;
  font-weight:900;
  letter-spacing:.3px;
}
.card .label{ color:var(--muted); font-size:12px; }
.card .hint{ color:var(--muted); font-size:12px; line-height:1.35; }
.card .row{ display:flex; gap:8px; flex-wrap:wrap; align-items:center; justify-content:space-between; }

.badge{
  padding:5px 8px;
  border-radius:999px;
  font-size:12px;
  border:1px solid var(--line);
  color:var(--muted);
}
.badge.ok{ color: #061f14; background: rgba(61,220,151,.9); border-color:transparent; font-weight:900; }
.badge.warn{ color: #2a1b00; background: rgba(255,204,102,.95); border-color:transparent; font-weight:900; }
.badge.bad{ color: #2a0606; background: rgba(255,107,107,.95); border-color:transparent; font-weight:900; }
.badge.info{ color: #041a2a; background: rgba(100,181,255,.95); border-color:transparent; font-weight:900; }

.btn{
  border:1px solid var(--line);
  background: linear-gradient(180deg, var(--btn2), var(--btn));
  color:var(--text);
  padding:9px 10px;
  border-radius: 12px;
  cursor:pointer;
  font-weight:700;
  letter-spacing:.2px;
}
.btn:hover{ filter:brightness(1.08); }
.btn:active{ transform: translateY(1px); }
.btn-small{ padding:7px 9px; border-radius: 10px; font-size:12px; }
.btn-ghost{
  background: rgba(255,255,255,.04);
}
.btn-danger{
  background: linear-gradient(180deg, rgba(255,107,107,.45), rgba(255,107,107,.25));
}

.table{
  width:100%;
  border-collapse: collapse;
  font-size:12px;
}
.table th, .table td{
  padding:10px 8px;
  border-bottom:1px solid var(--line);
  text-align:left;
  vertical-align:top;
}
.table th{
  color:var(--muted);
  font-weight:700;
  letter-spacing:.2px;
}
.table tr:hover td{ background: rgba(255,255,255,.03); }
.mono{ font-family: var(--mono); }

.split{
  display:flex;
  gap:12px;
  flex-wrap:wrap;
  align-items:center;
  justify-content:space-between;
}
.controls{
  display:flex; gap:10px; flex-wrap:wrap; align-items:center;
}
.select, .input{
  background: rgba(255,255,255,.04);
  border:1px solid var(--line);
  color:var(--text);
  padding:9px 10px;
  border-radius:12px;
}
.select{ min-width: 200px; }
.input{ min-width: 160px; }

.twoCol{ display:grid; grid-template-columns: 1fr 1fr; gap:12px; }
@media (max-width: 980px){ .twoCol{ grid-template-columns: 1fr; } }

.big{
  font-size:18px;
  font-weight:900;
}

.callout{
  border:1px dashed rgba(255,255,255,.18);
  padding:10px 12px;
  border-radius: 14px;
  background: rgba(255,255,255,.03);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

#map{
  height: 520px;
  border-radius: var(--radius);
  overflow:hidden;
  border:1px solid var(--line);
}

textarea.code{
  width:100%;
  min-height: 420px;
  resize: vertical;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text);
  background: rgba(0,0,0,.22);
  border:1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
}

.kv{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:10px;
}
.kv .item{
  border:1px solid var(--line);
  border-radius: 14px;
  padding: 10px 12px;
  background: rgba(0,0,0,.12);
}
.kv .item .k{ color:var(--muted); font-size:12px;}
.kv .item .v{ font-weight:900; font-size:16px; margin-top:4px; }

.smallNote{ color:var(--muted); font-size:12px; line-height:1.4; }
hr.sep{ border:none; border-top:1px solid var(--line); margin: 12px 0; }

.toast{
  position: fixed;
  bottom: 16px;
  right: 16px;
  background: rgba(10,15,30,.92);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px 12px;
  color: var(--text);
  box-shadow: var(--shadow);
  z-index: 99;
  max-width: 420px;
}
.toast .t{ font-weight:900; }
.toast .d{ color: var(--muted); font-size:12px; margin-top:2px; line-height: 1.4; }
