/* Design system SIPENA — diambil dari mockupproposalgen.html (mockup acuan).
   Hanya bagian yang dipakai halaman M0 (shell, form, kartu, tombol) yang
   disalin di sini; komponen khusus wizard (step, drop zone, tabel jadwal,
   dst) menyusul di M1 saat halaman itu dibangun. */
:root {
  --brand: #4f46e5;
  --brand-2: #7c3aed;
  --brand-soft: #eef2ff;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --bg: #f6f7fb;
  --card: #ffffff;
  --ok: #10b981;
  --warn: #f59e0b;
  --danger: #ef4444;
  --info: #0ea5e9;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 8px 24px rgba(15, 23, 42, .06);
  --shadow-lg: 0 20px 60px rgba(79, 70, 229, .18);
  --r: 16px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Segoe UI', system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  line-height: 1.55;
}
a { color: inherit; }

/* ---------- App shell ---------- */
.app { display: flex; min-height: 100vh; }

.rail {
  width: 280px;
  background: linear-gradient(180deg, #1e1b4b 0%, #312e81 55%, #4338ca 100%);
  color: #e0e7ff;
  padding: 26px 22px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}
.brand { display: flex; align-items: center; gap: 12px; margin-bottom: 34px; }
.logo {
  width: 44px; height: 44px; border-radius: 13px;
  background: linear-gradient(135deg, #a78bfa, #6366f1);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 20px rgba(124, 58, 237, .5);
  flex-shrink: 0;
}
.brand h1 { font-size: 17px; font-weight: 800; letter-spacing: .2px; color: #fff; }
.brand p { font-size: 11.5px; color: #c7d2fe; letter-spacing: 1.5px; text-transform: uppercase; margin-top: 1px; }

.nav-item {
  display: flex; align-items: center; gap: 13px; padding: 12px 13px;
  border-radius: 12px; cursor: pointer; transition: .18s;
  color: #c7d2fe; font-size: 14px; text-decoration: none;
}
.nav-item:hover { background: rgba(255, 255, 255, .07); }
.nav-item.active { background: rgba(255, 255, 255, .14); color: #fff; font-weight: 600; }

.rail-foot { margin-top: auto; padding-top: 18px; border-top: 1px solid rgba(255, 255, 255, .12); font-size: 12px; color: #a5b4fc; }
.rail-foot .u { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(135deg, #f472b6, #a78bfa);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; color: #fff; font-size: 13px; flex-shrink: 0;
}

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  background: var(--card); border-bottom: 1px solid var(--line);
  padding: 16px 34px; display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 20;
}
.crumb { font-size: 13px; color: var(--muted); }
.crumb b { color: var(--ink); }
.content { padding: 34px; max-width: 1080px; width: 100%; margin: 0 auto; flex: 1; }
.page-title { font-size: 26px; font-weight: 800; letter-spacing: -.3px; }
.page-sub { color: var(--muted); margin-top: 6px; font-size: 14.5px; max-width: 640px; }
.section-head { display: flex; align-items: flex-start; gap: 14px; }

/* ---------- Kartu & form ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 26px; }
.card + .card { margin-top: 20px; }

.field { margin-bottom: 16px; }
.field:last-child { margin-bottom: 0; }
label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 7px; color: #334155; }
label .req { color: var(--danger); }
label .hint { font-weight: 400; color: var(--muted); font-size: 12px; }
input[type=text], input[type=email], input[type=password], input[type=number], select, textarea {
  width: 100%; padding: 11px 13px; border: 1.5px solid var(--line); border-radius: 11px;
  font-size: 14px; font-family: inherit; background: #fff; color: var(--ink); transition: .15s;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft);
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  padding: 12px 22px; border-radius: 12px; border: none; font-size: 14px;
  font-weight: 600; cursor: pointer; font-family: inherit; transition: .18s;
}
.btn-primary { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; box-shadow: 0 10px 24px rgba(79, 70, 229, .28); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 14px 30px rgba(79, 70, 229, .36); }
.btn-ghost { background: #fff; color: #334155; border: 1.5px solid var(--line); }
.btn-ghost:hover { border-color: #cbd5e1; background: #f8fafc; }

.callout {
  display: flex; gap: 12px; background: #eff6ff; border: 1px solid #bfdbfe;
  border-radius: 13px; padding: 15px 17px; font-size: 13px; color: #1e40af; margin-bottom: 22px;
}
.callout.error { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.callout.info { background: #eff6ff; border-color: #bfdbfe; color: #1e40af; }
.callout .ci { flex-shrink: 0; }

.badge-role {
  background: var(--brand-soft); color: var(--brand); font-size: 12px; font-weight: 700;
  padding: 5px 12px; border-radius: 99px; white-space: nowrap;
}

.hidden { display: none; }
.auth-shell { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px; gap: 16px; }
.auth-card { width: 100%; max-width: 380px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-lg); padding: 34px; }
.auth-shell .callout { width: 100%; max-width: 380px; }
.auth-card .brand { margin-bottom: 26px; justify-content: center; }

/* ---------- Wizard: step nav (sidebar) ---------- */
.steps { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }
.step {
  display: flex; align-items: center; gap: 13px; padding: 12px 13px; border-radius: 12px;
  cursor: pointer; transition: .18s; color: #c7d2fe; font-size: 14px; text-decoration: none;
}
.step:hover { background: rgba(255, 255, 255, .07); }
.step.active { background: rgba(255, 255, 255, .14); color: #fff; font-weight: 600; }
.step.done { color: #a5f3d0; }
.step .num {
  width: 28px; height: 28px; border-radius: 9px; background: rgba(255, 255, 255, .12);
  display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; flex-shrink: 0;
}
.step.active .num { background: #fff; color: var(--brand); }
.step.done .num { background: var(--ok); color: #fff; }
.step small { display: block; font-size: 11px; color: #a5b4fc; font-weight: 400; }

/* ---------- Wizard: progress bar (topbar) ---------- */
.progress-wrap { display: flex; align-items: center; gap: 12px; }
.pbar { width: 180px; height: 7px; border-radius: 99px; background: var(--brand-soft); overflow: hidden; }
.pfill { height: 100%; background: linear-gradient(90deg, var(--brand), var(--brand-2)); border-radius: 99px; transition: .4s; }
.pct { font-size: 12.5px; font-weight: 700; color: var(--brand); }

.badge-step { background: var(--brand-soft); color: var(--brand); font-size: 12px; font-weight: 700; padding: 5px 12px; border-radius: 99px; white-space: nowrap; margin-top: 4px; }
.footer-nav { display: flex; justify-content: space-between; align-items: center; margin-top: 26px; }

/* ---------- Upload dropzone ---------- */
.drop { border: 2px dashed #c7d2fe; border-radius: 18px; background: linear-gradient(180deg, #fbfaff, #f5f3ff); padding: 44px; text-align: center; cursor: pointer; transition: .2s; }
.drop:hover { border-color: var(--brand); background: #f0eeff; }
.drop .ic { width: 64px; height: 64px; border-radius: 18px; background: #fff; box-shadow: var(--shadow); display: flex; align-items: center; justify-content: center; margin: 0 auto 16px; }
.drop h3 { font-size: 17px; font-weight: 700; }
.drop p { color: var(--muted); font-size: 13.5px; margin-top: 6px; }

.filechip { display: flex; align-items: center; gap: 14px; background: #fff; border: 1.5px solid var(--line); border-radius: 13px; padding: 14px 16px; margin-top: 16px; }
.filechip .fi { width: 42px; height: 42px; border-radius: 10px; background: #fee2e2; color: #dc2626; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 11px; flex-shrink: 0; }
.filechip .meta { flex: 1; min-width: 0; }
.filechip .meta b { font-size: 14px; word-break: break-word; }
.filechip .meta small { color: var(--muted); display: block; font-size: 12px; }
.tag-ok { background: #ecfdf5; color: #059669; font-size: 11.5px; font-weight: 700; padding: 5px 11px; border-radius: 99px; display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.tag-warn { background: #fffbeb; color: #b45309; font-size: 11.5px; font-weight: 700; padding: 5px 11px; border-radius: 99px; display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }

.parsebox { margin-top: 20px; background: #f8fafc; border: 1px solid var(--line); border-radius: 13px; padding: 18px; }
.parsebox h4 { font-size: 13px; font-weight: 700; margin-bottom: 12px; color: #334155; }
.parse-row { display: flex; align-items: center; justify-content: space-between; padding: 9px 0; border-bottom: 1px dashed var(--line); font-size: 13.5px; }
.parse-row:last-child { border: none; }
.parse-row .l { color: #475569; display: flex; align-items: center; gap: 9px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); flex-shrink: 0; }
.dot.off { background: #cbd5e1; }

/* ---------- Template cards ---------- */
.tpl-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.tpl { border: 2px solid var(--line); border-radius: 15px; padding: 20px; cursor: pointer; transition: .18s; position: relative; background: #fff; }
.tpl:hover { border-color: #c7d2fe; }
.tpl.sel { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 8px 24px rgba(79, 70, 229, .14); }
.tpl .tpl-ic { width: 46px; height: 46px; border-radius: 12px; background: linear-gradient(135deg, var(--brand), var(--brand-2)); display: flex; align-items: center; justify-content: center; color: #fff; margin-bottom: 14px; }
.tpl h4 { font-size: 15px; font-weight: 700; }
.tpl p { font-size: 12.5px; color: var(--muted); margin-top: 5px; }
.tpl .check { position: absolute; top: 16px; right: 16px; width: 24px; height: 24px; border-radius: 50%; background: var(--brand); color: #fff; display: none; align-items: center; justify-content: center; font-size: 14px; }
.tpl.sel .check { display: flex; }

/* ---------- Tabel jadwal ---------- */
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.tbl th, table.tbl td { border: 1px solid var(--line); padding: 10px 12px; text-align: left; }
table.tbl th { background: #f1f5f9; font-weight: 700; font-size: 12.5px; color: #334155; }
table.tbl td.c { text-align: center; }
.help { font-size: 12px; color: var(--muted); margin-top: 6px; }

/* ---------- RAB ---------- */
.rab-meter { margin-top: 6px; height: 8px; background: #eef2ff; border-radius: 99px; overflow: hidden; }
.rab-fill { height: 100%; border-radius: 99px; transition: .3s; }

/* ---------- Generate/Ekspor placeholder ---------- */
.gen-hero { text-align: center; padding: 40px 20px; }
.gen-hero .spin { width: 74px; height: 74px; margin: 0 auto 20px; border-radius: 20px; background: linear-gradient(135deg, var(--brand), var(--brand-2)); display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow-lg); }
.export-card { text-align: center; padding: 40px; }
.export-card .big { width: 88px; height: 88px; margin: 0 auto 22px; border-radius: 24px; background: linear-gradient(135deg, var(--ok), #059669); display: flex; align-items: center; justify-content: center; box-shadow: 0 20px 50px rgba(16, 185, 129, .35); }
.checklist { max-width: 460px; margin: 26px auto 0; text-align: left; background: #f8fafc; border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; }
.checklist .cl { display: flex; align-items: center; gap: 11px; padding: 8px 0; font-size: 13.5px; color: #334155; }
.checklist .clok { color: var(--ok); }
.fmt-row { display: flex; gap: 14px; justify-content: center; margin-top: 26px; flex-wrap: wrap; }
.fmt { border: 1.5px solid var(--line); border-radius: 13px; padding: 16px 22px; min-width: 150px; }
.fmt b { display: block; font-size: 14px; }
.fmt small { color: var(--muted); font-size: 12px; }

/* ---------- Member rows (Alpine) ---------- */
.member-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 12px; align-items: end; margin-bottom: 12px; }
.iconbtn { width: 40px; height: 40px; border-radius: 9px; border: 1.5px solid var(--line); background: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; color: #64748b; transition: .15s; flex-shrink: 0; }
.iconbtn:hover { border-color: var(--danger); color: var(--danger); }

@media (max-width: 920px) { .rail { display: none; } }
