:root{
  --bg:#f6fbfb;
  --muted:#7b8a88;
  --accent:#042f2e;
  --teal:#0f6b63;
  --accent-2:#10B981;
  --card-radius:14px;
  --glass:rgba(255,255,255,0.85);
  --shadow: 0 10px 30px rgba(6,22,27,0.06);
  font-family: Inter, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial;
}

*{box-sizing:border-box}
body{margin:0;background:var(--bg);color:var(--accent);-webkit-font-smoothing:antialiased}
.container{max-width:1280px;margin:26px auto;padding:0 20px}
.site-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:18px}
.site-header h1{margin:0;font-size:20px}
.site-header .lead{margin:0;color:var(--muted);font-size:13px}

.layout{display:flex;gap:20px}

/* left vertical dark sidebar inspired by reference */
.sidebar{width:260px;background:linear-gradient(180deg,#053937,#063f3a);border-radius:12px;padding:18px;color:#dff6f0;display:flex;flex-direction:column}
.sidebar .brand{display:flex;gap:12px;align-items:center;margin-bottom:14px}
.sidebar .brand .logo{width:48px;height:48px;border-radius:10px;background:rgba(255,255,255,0.04);display:flex;align-items:center;justify-content:center}
.sidebar .brand .brand-text{font-weight:700;color:#eafff7;font-size:15px}
.sidebar .brand .muted{display:block;font-weight:400;color:#bfeee3;font-size:12px}

.sidebar .tabs{display:flex;flex-direction:column;gap:8px;margin-top:6px}
.tab-btn{background:transparent;border:0;color:rgba(255,255,255,0.9);padding:10px 12px;border-radius:10px;text-align:left;cursor:pointer;display:flex;gap:12px;align-items:center}
.tab-btn .la{font-size:18px}
.tab-btn.active{background:linear-gradient(90deg,rgba(255,255,255,0.03),rgba(255,255,255,0.02));box-shadow:inset 0 1px 0 rgba(255,255,255,0.02)}
.sidebar .small{margin-top:auto;background:transparent;color:#c7efe5;font-size:13px;padding:8px}

.card{background:#fff;border-radius:var(--card-radius);padding:14px;box-shadow:var(--shadow)}
.small{padding:10px;font-size:13px}

.content{flex:1}
.panel{display:none}
.panel.active{display:block}
.panel-grid{display:grid;grid-template-columns:1fr 420px;gap:16px}
.kpis .kpi-row{display:flex;gap:12px}
.kpi{flex:1;background:linear-gradient(180deg,#ffffff,#f6fffb);padding:14px;border-radius:10px;text-align:center;box-shadow:0 6px 18px rgba(11,58,50,0.03)}
.kpi-value{font-size:20px;font-weight:700}
.map-card .map{height:360px;border-radius:10px;overflow:hidden}
.chart-card canvas{max-height:240px}

.form-card .row{display:flex;gap:12px;margin-bottom:10px}
.form-card label{flex:1;font-size:13px}
.form-card input,.form-card select{width:100%;padding:10px;border-radius:8px;border:1px solid #eef6f3;background:#fbfffe}
.actions{margin-top:12px}
button{cursor:pointer}
button#btn-predict{background:var(--teal);color:#fff;padding:10px 14px;border-radius:10px;border:none}

/* Improved form controls appearance */
input[type="text"], input[type="number"], input[type="search"], textarea, select {
  padding:10px 12px;
  border-radius:10px;
  border:1px solid #e6f2ee;
  background: #ffffff;
  box-shadow: inset 0 1px 0 rgba(6,22,27,0.02);
  font-size:14px;
  color:var(--accent);
  transition: border-color .12s, box-shadow .12s, transform .06s;
}
select{ padding-right:36px; background-position: right 12px center; background-repeat:no-repeat; background-size:12px; -webkit-appearance:none; -moz-appearance:none; appearance:none;}
select:focus, input[type="text"]:focus, input[type="number"]:focus, textarea:focus{ outline: none; border-color: var(--accent-2); box-shadow: 0 6px 18px rgba(16,185,129,0.08); }

/* custom arrow for selects using inline SVG */
select{
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24'><path fill='%23666' d='M7 10l5 5 5-5z'/></svg>");
}

/* make small numeric inputs compact */
input[type="number"]{max-width:160px}

/* force uniform widths for prediction form fields */
#predict-form input, #predict-form select { max-width: none; width: 100%; }
#predict-form .row{display:flex;gap:12px}
#predict-form .row label{flex:1;display:flex;flex-direction:column}

/* prediction result styling */
.predict-result-grid{display:flex;gap:14px;align-items:flex-start}
.predict-left{flex:1}
.predict-right{width:220px}
.predict-detail{background:#fff;padding:12px;border-radius:10px;margin-top:8px;box-shadow:0 8px 24px rgba(6,22,27,0.04)}
.detail-grid{display:flex;gap:12px}
.detail-col{flex:1}
.detail-row{display:flex;justify-content:space-between;padding:6px 0;border-bottom:1px dashed #f1f5f9}
.detail-row strong{font-size:13px;color:var(--muted)}
.detail-row div{font-weight:700;color:var(--accent)}

/* icons in small places */
.kpi .kpi-icon{display:block;font-size:18px;margin-bottom:6px;color:#0f6b63}
.tab-btn .la{margin-right:10px}

/* nicer buttons */
button{border-radius:10px;padding:8px 12px;border:1px solid transparent;background:linear-gradient(90deg,var(--teal),#0b8b7f);color:#fff}
button.secondary{background:transparent;color:var(--teal);border:1px solid rgba(16,185,129,0.12);padding:8px 10px}

/* labels and form rows alignment */
label{display:block;font-size:13px;color:var(--muted);margin-bottom:6px}
.form-card .row label{margin-bottom:0}

.result-grid{display:flex;gap:12px;align-items:center}
.metric .label{font-size:12px;color:var(--muted)}
.metric .value{font-size:22px;font-weight:700;margin-top:6px}
.recommendation{margin-top:10px;padding:10px;border-radius:8px;background:linear-gradient(90deg,#f8fafc,#ffffff);border:1px solid #eef6f1}

.prior-card .row{display:flex;gap:8px;align-items:center}
.patient-card{margin-top:10px;padding:12px;border-radius:10px;background:linear-gradient(180deg,#ffffff,#fbfff8);border-left:4px solid #f59e0b}
.map.small{height:300px;border-radius:10px}

.warn{color:#b91c1c}

@media (max-width:980px){.layout{flex-direction:column}.sidebar{width:100%}.panel-grid{grid-template-columns:1fr}}

/* small visual tweaks */
.card h3{margin-top:0;margin-bottom:8px}
.site-header .la-heart{color:var(--accent-2)}
.tab-btn .label{font-weight:600}

/* Department details card */
.dept-card{padding:12px;border-radius:12px;background:linear-gradient(180deg,#ffffff,#fbfff8);box-shadow:0 8px 24px rgba(6,22,27,0.06)}
.dept-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:8px}
.dept-header h2{margin:0;font-size:20px;letter-spacing:0.6px}
.dept-header .badge{background:#f59e0b;color:#1f2937;padding:6px 10px;border-radius:999px;font-weight:700}
.dept-stats{display:flex;gap:10px;margin-bottom:10px}
.stat{flex:1;background:linear-gradient(90deg,#ffffff,#f7fff9);padding:10px;border-radius:10px;text-align:center}
.stat-value{font-size:20px;font-weight:800;color:var(--accent)}
.stat-value.large{font-size:28px;color:#f59e0b}
.stat-label{font-size:12px;color:var(--muted)}
.stage-dist h4{margin:8px 0 6px 0;font-size:13px}
.stage-row{display:flex;flex-direction:column;padding:6px 0}
.stage-row .right{font-size:12px;color:var(--muted);margin-top:4px}
.progress{height:8px;background:#f1f5f9;border-radius:8px;overflow:hidden;margin-top:6px}
.progress-bar{height:100%;background:linear-gradient(90deg,#f59e0b,#f97316)}
.patient-row:hover {
  background: #f0fdf4 !important;
}
.patient-row.selected {
  background: #fef3c7 !important;
  border-left: 4px solid #f59e0b;
}
.badge {
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
}
