/* Mira web — CuraNet-inspired theme. Ported from frontend/components/ui.py.
   Single source for spacing/typography/color. Vertical rhythm: 1rem. */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root{
  --bg:#EDECF6; --card:#FFFFFF; --border:#E4E2F2;
  --text-primary:#1E1B39; --text-secondary:#6B6690; --text-tertiary:#A5A1C7;
  --primary:#7C6CF0; --primary-hover:#6A5AE0; --primary-light:#F1EFFE;
  --teal:#14B8A6; --teal-light:#D9F7F0; --yellow:#FFB020; --yellow-light:#FFF4D6;
  --green-600:#16A34A; --green-50:#F0FDF4; --green-200:#BBF7D0;
  --amber-600:#B45309; --amber-50:#FFFBEB; --amber-200:#FDE68A;
  --red-600:#DC2626; --red-50:#FEF2F2; --red-200:#FECACA;
  --shadow-card:0 8px 30px rgba(124,108,240,0.10);
  --shadow-sm:0 2px 8px rgba(30,27,57,0.06);
}

*{ box-sizing:border-box; }
html, body{ font-family:'Plus Jakarta Sans', system-ui, -apple-system, sans-serif; -webkit-font-smoothing:antialiased; font-size:14px; line-height:1.7; color:var(--text-primary); }
body{ background:var(--bg); margin:0; }

/* layout */
.page{ max-width:1120px; margin:0 auto; padding:1rem; }
.stack{ display:flex; flex-direction:column; gap:1rem; }
.grid-main{ display:grid; grid-template-columns:1fr; gap:1rem; align-items:start; }
.grid-2{ display:grid; grid-template-columns:1fr 1fr; gap:1rem; }
.grid-3{ display:grid; grid-template-columns:repeat(3,1fr); gap:1rem; }
.grid-4{ display:grid; grid-template-columns:repeat(4,1fr); gap:1rem; }
.grid-5{ display:grid; grid-template-columns:repeat(5,1fr); gap:1rem; }
@media (max-width:900px){
  .grid-main, .grid-2, .grid-3, .grid-4, .grid-5{ grid-template-columns:1fr; }
}

/* CuraNet pill nav */
.cura-nav{ display:flex; align-items:center; gap:8px; flex-wrap:wrap; background:white; border:1px solid var(--border); border-radius:999px; padding:6px; box-shadow:var(--shadow-sm); width:fit-content; }
.cura-nav__pill{ font-size:12px; font-weight:600; color:var(--text-secondary); padding:8px 16px; border-radius:999px; white-space:nowrap; text-decoration:none; }
.cura-nav__pill--active{ background:var(--primary); color:white; }
a.cura-nav__pill:hover{ background:var(--primary-light); }
a.cura-nav__pill--active:hover{ background:var(--primary-hover); }

/* greeting */
.cura-greet{ margin:0 2px; }
.cura-greet__hi{ font-size:12px; color:var(--text-secondary); margin-bottom:2px; }
.cura-greet__title{ font-size:26px; font-weight:700; letter-spacing:-0.02em; color:var(--text-primary); margin:0; }

/* topbar */
.topbar{ background:var(--card); border:1px solid var(--border); border-radius:12px; padding:20px 24px; margin:0; display:flex; align-items:center; justify-content:space-between; gap:16px; box-shadow:var(--shadow-card); }
.topbar__logo{ width:40px; height:40px; border-radius:10px; display:flex; align-items:center; justify-content:center; background:var(--primary); color:white; font-weight:700; font-size:14px; flex:0 0 40px; }
.topbar__title h1{ margin:0; font-size:18px; font-weight:700; color:var(--text-primary); letter-spacing:-0.01em; }
.topbar__title p{ margin:4px 0 0 0; font-size:13px; color:var(--text-secondary); line-height:1.7; }
.topbar__meta{ display:flex; align-items:center; gap:8px; flex-wrap:wrap; justify-content:flex-end; }
.badge{ font-size:11px; font-weight:600; padding:5px 10px; border-radius:999px; border:1px solid var(--border); background:var(--card); color:var(--text-secondary); }
.badge--primary{ background:var(--primary); border-color:var(--primary); color:white; }
.mono{ font-family:'JetBrains Mono', monospace; font-size:11px; color:var(--text-tertiary); }

/* cards */
.card{ background:var(--card); border:1px solid var(--border); border-radius:20px; overflow:hidden; box-shadow:var(--shadow-card); }
.card__hd{ padding:16px 22px; border-bottom:1px solid var(--border); display:flex; align-items:center; justify-content:space-between; gap:12px; background:var(--card); }
.card__title{ font-size:14px; font-weight:700; color:var(--text-primary); }
.card__bd{ padding:22px; }

/* section header */
.section-hd{ margin:0 0 1rem 0; padding-bottom:12px; }
.section-hd__title{ font-size:16px; font-weight:700; color:var(--text-primary); letter-spacing:-0.01em; }

/* metrics */
.metric{ background:var(--card); border:1px solid var(--border); border-radius:12px; padding:16px 20px; display:flex; flex-direction:column; gap:4px; box-shadow:var(--shadow-card); }
.metric__label{ font-size:11px; font-weight:600; letter-spacing:0.04em; text-transform:uppercase; color:var(--text-tertiary); }
.metric__value{ font-size:28px; font-weight:700; color:var(--text-primary); line-height:1; letter-spacing:-0.02em; }
.metric__hint{ font-size:12px; color:var(--text-secondary); }

/* pills, dots, chips */
.dot{ width:8px; height:8px; border-radius:999px; display:inline-block; flex:0 0 8px; }
.dot--green{ background:var(--green-600); box-shadow:0 0 0 2px var(--green-200); }
.dot--amber{ background:var(--amber-600); box-shadow:0 0 0 2px var(--amber-200); }
.dot--red{ background:var(--red-600); box-shadow:0 0 0 2px var(--red-200); }
.legend{ display:flex; flex-wrap:wrap; gap:8px 20px; align-items:center; background:var(--card); border:1px solid var(--border); border-radius:10px; padding:10px 16px; margin:8px 0 4px; }
.legend-item{ display:inline-flex; align-items:center; gap:7px; font-size:12px; font-weight:600; color:var(--text-secondary); }
.status-pill{ display:inline-flex; align-items:center; gap:6px; padding:4px 12px; border-radius:999px; font-size:11px; font-weight:600; border:1px solid transparent; }
.status-pill--hijau{ background:var(--green-50); color:var(--green-600); border-color:var(--green-200); }
.status-pill--kuning{ background:var(--amber-50); color:var(--amber-600); border-color:var(--amber-200); }
.status-pill--merah{ background:var(--red-50); color:var(--red-600); border-color:var(--red-200); }
.chip{ display:inline-flex; align-items:center; gap:6px; padding:4px 12px; border-radius:999px; background:var(--primary-light); font-size:13px; font-weight:600; color:var(--text-primary); }
.chip--diag{ background:#F1EFFE; }
.chip__conf{ font-size:10px; padding:2px 6px; border-radius:999px; background:rgba(255,255,255,0.7); color:var(--text-tertiary); }

/* banner, items */
.banner{ background:var(--card); border:1px solid var(--border); border-left:3px solid var(--primary); border-radius:8px; padding:14px 18px; }
.item{ display:flex; gap:12px; padding:12px 14px; border-radius:10px; border:1px solid var(--border); background:var(--card); }
.item + .item{ margin-top:8px; }
.muted{ color:var(--text-tertiary); } .small{ font-size:13px; line-height:1.7; } .caption{ font-size:11px; color:var(--text-tertiary); }
hr{ margin:1rem 0; border-color:var(--border); opacity:0.15; }

/* buttons */
.btn{ border-radius:999px; font-weight:600; font-size:13px; padding:10px 20px; border:1px solid var(--border); background:white; color:var(--text-primary); min-height:42px; cursor:pointer; font-family:inherit; transition:all 0.2s ease; text-decoration:none; display:inline-block; text-align:center; }
.btn--primary{ background:var(--primary); color:white; border-color:var(--primary); box-shadow:0 4px 14px rgba(124,108,240,0.35); }
.btn--primary:hover{ background:var(--primary-hover); border-color:var(--primary-hover); }
.btn--block{ width:100%; }

/* forms */
.cura-form{ border:1px solid var(--border); border-radius:20px; background:var(--card); box-shadow:var(--shadow-card); padding:24px; }
.cura-form label{ display:block; font-size:12px; font-weight:600; color:var(--text-secondary); margin-bottom:6px; }
.cura-form input[type="text"], .cura-form input[type="number"], .cura-form select, .cura-form textarea{
  width:100%; border-radius:12px; border:1px solid transparent; font-size:14px; font-family:inherit;
  padding:8px 12px; min-height:40px; background:var(--primary-light); color:var(--text-primary); margin-bottom:12px;
}
.cura-form textarea{ min-height:120px; resize:vertical; }
.cura-form input:focus, .cura-form textarea:focus, .cura-form select:focus{ outline:none; border-color:var(--primary); box-shadow:0 0 0 3px var(--primary-light); background:white; }
.cura-form input[type="password"]{ width:100%; border-radius:12px; border:1px solid transparent; font-size:14px; font-family:inherit; padding:8px 12px; min-height:40px; background:var(--primary-light); color:var(--text-primary); margin-bottom:12px; }
.check-field{ display:flex !important; align-items:center; gap:10px; cursor:pointer; font-weight:600 !important; color:var(--text-secondary) !important; background:var(--primary-light); border:1px solid transparent; border-radius:12px; padding:10px 12px; min-height:40px; margin-bottom:12px; }
.check-field:hover{ border-color:var(--primary); background:white; }
.check-field__input{ width:auto !important; min-height:auto !important; flex:0 0 auto; accent-color:var(--primary); margin:0; }
.form-label{ font-size:14px; font-weight:600; color:var(--text-primary); margin-bottom:6px; }
.form-helper{ font-size:11px; color:var(--text-tertiary); margin-top:4px; margin-bottom:12px; line-height:1.7; }
.action-bar{ position:sticky; bottom:0; z-index:10; background:rgba(255,255,255,0.95); backdrop-filter:blur(8px); border-top:1px solid var(--border); padding:16px 24px; display:flex; justify-content:flex-end; gap:12px; border-radius:0 0 20px 20px; box-shadow:0 -2px 8px rgba(0,0,0,0.04); }

/* stepper */
.stepper{ display:flex; align-items:center; gap:0; margin:0; justify-content:flex-start; flex-wrap:wrap; row-gap:8px; }
.stepper__step{ display:flex; align-items:center; gap:8px; padding:8px 16px; border-radius:999px; font-size:12px; font-weight:600; color:var(--text-secondary); background:var(--card); border:1px solid var(--border); white-space:nowrap; }
.stepper__step--active{ background:var(--primary); border-color:var(--primary); color:white; box-shadow:0 4px 14px rgba(124,108,240,0.35); }
.stepper__step--done{ background:var(--green-50); border-color:var(--green-200); color:var(--green-600); }
.stepper__line{ flex:0 0 24px; height:2px; background:var(--border); min-width:24px; }

.mini-stat__title{ font-size:13px; font-weight:700; color:var(--text-primary); margin-bottom:10px; }

/* score ring + bar (faskes) */
.score{ width:72px; height:72px; border-radius:999px; display:flex; align-items:center; justify-content:center; font-weight:600; font-size:20px; color:white; flex:0 0 72px; }
.score__inner{ width:56px; height:56px; border-radius:999px; background:white; display:flex; align-items:center; justify-content:center; font-size:18px; font-weight:600; }
.bar{ height:4px; background:var(--primary-light); border-radius:999px; overflow:hidden; }
.bar__fill{ height:100%; border-radius:999px; }

/* admin toolbar + status */
.toolbar{ background:white; border:1px solid var(--border); border-radius:20px; padding:12px 16px; display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; box-shadow:var(--shadow-card); }
.status{ display:inline-flex; align-items:center; gap:6px; padding:4px 10px; border-radius:999px; font-size:11px; font-weight:600; border:1px solid transparent; }
.status--hijau{ background:var(--green-50); color:var(--green-600); border-color:var(--green-200); }
.status--kuning{ background:var(--amber-50); color:var(--amber-600); border-color:var(--amber-200); }
.status--merah{ background:var(--red-50); color:var(--red-600); border-color:var(--red-200); }

/* tables */
table.tbl{ width:100%; border-collapse:collapse; font-size:13px; }
table.tbl th{ text-align:left; font-size:11px; font-weight:600; text-transform:uppercase; letter-spacing:0.04em; color:var(--text-tertiary); padding:8px 10px; border-bottom:1px solid var(--border); }
table.tbl td{ padding:8px 10px; border-bottom:1px solid var(--border); vertical-align:top; }
table.tbl tr:last-child td{ border-bottom:none; }

/* alerts (ganti st.warning/error/success/info) */
.alert{ border-radius:12px; padding:12px 14px; font-size:13px; border:1px solid; }
.alert--warn{ background:var(--amber-50); border-color:var(--amber-200); color:var(--amber-600); }
.alert--error{ background:var(--red-50); border-color:var(--red-200); color:var(--red-600); }
.alert--success{ background:var(--green-50); border-color:var(--green-200); color:var(--green-600); }
.alert--info{ background:var(--primary-light); border-color:var(--border); color:var(--text-primary); }

/* citations + reasoning */
.cit{ border:1px solid var(--border); background:white; border-radius:8px; padding:10px 12px; margin-bottom:8px; }
.cit__hd{ display:flex; justify-content:space-between; gap:12px; align-items:center; }
details.card-details{ border:1px solid var(--border); border-radius:12px; background:white; padding:12px 16px; }
details.card-details summary{ cursor:pointer; font-weight:600; font-size:13px; }
pre.json{ background:var(--text-primary); color:#E4E2F2; border-radius:12px; padding:14px; font-size:11px; overflow:auto; max-height:320px; }

/* toast */
#toast-region{ position:fixed; bottom:1rem; right:1rem; z-index:50; display:flex; flex-direction:column; gap:8px; }
.toast{ background:var(--text-primary); color:white; border-radius:12px; padding:10px 16px; font-size:13px; box-shadow:var(--shadow-card); }

/* footer */
.page-foot{ text-align:center; padding:1rem 0 0 0; }

/* htmx loading indicator */
.htmx-indicator{ display:none; }
.htmx-request .htmx-indicator{ display:inline; }
.htmx-request.htmx-indicator{ display:inline; }
