/*
 * Timeline Management - stylesheet halaman autentikasi & installer (Stage 1).
 * Token desain, tombol, form, tabel, dan banner disalin dari CSS.html asli agar tampilan konsisten.
 * Stylesheet dashboard asli akan dimigrasikan utuh pada stage berikutnya.
 */
:root {
  --navy: #0f233c;
  --navy-2: #163154;
  --blue: #2563eb;
  --blue-soft: #eff6ff;
  --indigo: #6366f1;
  --bg: #f8fafc;
  --surface: #ffffff;
  --text: #0f172a;
  --text-2: #334155;
  --muted: #64748b;
  --muted-2: #94a3b8;
  --line: #e2e8f0;
  --line-soft: #f1f5f9;
  --radius: 14px;
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.04), 0 6px 18px rgba(15, 23, 42, 0.03);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--bg);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

.mono {
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-variant-numeric: tabular-nums;
}

/* ---------- Layout halaman auth ---------- */
.auth-body {
  min-height: 100vh;
  background: linear-gradient(180deg, #0f233c 0%, #152e4d 100%);
}

.auth-wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 28px 16px;
}

.auth-card {
  width: min(440px, 100%);
  background: var(--surface);
  border-radius: 16px;
  padding: 26px 28px 28px;
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.22);
}

.auth-card.is-wide { width: min(760px, 100%); }

.auth-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 22px;
}

.brand-mark {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: 10px;
  background: var(--navy);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 18px;
  font-weight: 800;
}

.brand-text b { display: block; font-size: 14px; color: var(--navy); letter-spacing: 0.3px; }
.brand-text small { display: block; font-size: 9.5px; letter-spacing: 1.4px; color: var(--muted-2); font-weight: 600; }

.auth-foot { margin: 16px 0 0; font-size: 11px; color: #9bb1cb; }

.auth-title {
  font-size: 22px;
  letter-spacing: -0.4px;
  color: var(--navy);
  margin: 8px 0 6px;
}

.auth-sub {
  font-size: 13px;
  color: var(--navy);
  margin: 22px 0 2px;
  padding-top: 14px;
  border-top: 1px solid var(--line-soft);
}

.auth-lead { margin: 0 0 14px; font-size: 12.5px; line-height: 1.55; color: var(--muted); }

.eyebrow { font-size: 10px; letter-spacing: 1.6px; font-weight: 700; color: var(--muted-2); }
.eyebrow.blue { color: var(--blue); }
.muted { font-size: 10.5px; color: var(--muted-2); line-height: 1.5; }

/* ---------- Form ---------- */
.form-group { margin: 13px 0; }

.form-group label {
  display: block;
  font-size: 10.5px;
  letter-spacing: 0.6px;
  font-weight: 700;
  color: var(--text-2);
  margin-bottom: 6px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  font: 12.5px Inter, sans-serif;
  color: var(--text);
  background: var(--surface);
}

.form-group input:focus {
  outline: 2px solid rgba(37, 99, 235, 0.25);
  border-color: var(--blue);
}

.field-error { display: block; margin-top: 5px; font-size: 11px; color: #b91c1c; }

.form-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.form-actions { display: flex; justify-content: flex-end; align-items: center; gap: 8px; margin-top: 18px; }

/* ---------- Tombol ---------- */
.primary-btn {
  display: inline-block;
  border: 0;
  border-radius: 9px;
  background: var(--blue);
  color: #fff;
  padding: 10px 16px;
  font: 600 12px Inter, sans-serif;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
}
.primary-btn:hover { background: #1d4ed8; }
.primary-btn.block { width: 100%; margin-top: 6px; padding: 11px 16px; }

.outline-btn {
  display: inline-block;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--text-2);
  padding: 10px 14px;
  font: 600 12px Inter, sans-serif;
  cursor: pointer;
  text-decoration: none;
}
.outline-btn:hover { background: var(--line-soft); }

.ghost-btn {
  display: inline-block;
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 10px 12px;
  font: 600 12px Inter, sans-serif;
  cursor: pointer;
  text-decoration: none;
}
.ghost-btn:hover { color: var(--navy); }

/* ---------- Banner ---------- */
.error-banner {
  margin: 12px 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
  font-size: 12.5px;
}

.notice-banner {
  margin: 12px 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--blue-soft);
  border: 1px solid #bfdbfe;
  color: #1e3a8a;
  font-size: 12.5px;
  line-height: 1.5;
}

/* ---------- Tabel & kotak detail ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 10px; letter-spacing: 0.8px; color: var(--muted); padding: 11px 10px; border-bottom: 1px solid var(--line); }
td { font-size: 12px; padding: 11px 10px; border-bottom: 1px solid var(--line-soft); color: var(--text-2); vertical-align: middle; }

.detail-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 16px 0; }
.detail-box { background: #f8fafc; border: 1px solid var(--line); border-radius: 10px; padding: 11px 13px; }
.detail-box small { display: block; font-size: 10px; letter-spacing: 0.7px; font-weight: 700; color: var(--muted); margin-bottom: 4px; }
.detail-box b { font-size: 12.5px; color: var(--navy); word-break: break-all; }

/* ---------- Pill status & stepper installer ---------- */
.pill {
  display: inline-block;
  min-width: 52px;
  text-align: center;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.4px;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid transparent;
}
.pill-ok { background: #ecfdf5; color: #047857; border-color: #a7f3d0; }
.pill-no { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }
.pill-warn { background: #fffbeb; color: #b45309; border-color: #fde68a; }

.stepper { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.stepper span {
  font-size: 10.5px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--line-soft);
  color: var(--muted);
}
.stepper span.active { background: var(--navy); color: #fff; }
.stepper span.done { background: #ecfdf5; color: #047857; }

.req-list { list-style: none; margin: 14px 0 0; padding: 0; }
.req-list li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 10px 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: 12.5px;
  color: var(--text-2);
}
.req-list small { display: block; margin-top: 2px; font-size: 11px; color: var(--muted); }

code { font-family: "JetBrains Mono", ui-monospace, Menlo, monospace; font-size: 11.5px; background: var(--line-soft); padding: 1px 5px; border-radius: 5px; }

@media (max-width: 560px) {
  .auth-card { padding: 22px 18px 24px; }
  .form-row, .detail-grid { grid-template-columns: 1fr; gap: 0; }
  .form-actions { flex-wrap: wrap; }
}

/* ======================= Stage 3: aplikasi setelah login ======================= */
.app-body { background: var(--bg); }
.topbar { background: linear-gradient(180deg, #0f233c 0%, #152e4d 100%); position: sticky; top: 0; z-index: 20; }
.topbar-inner { max-width: 1120px; margin: 0 auto; padding: 10px 20px; display: flex; align-items: center; gap: 22px; }
.topbar-brand { margin: 0; text-decoration: none; }
.topbar-brand .brand-mark { background: rgba(255, 255, 255, 0.14); }
.topbar-brand .brand-text b { color: #fff; }
.topnav { display: flex; gap: 4px; flex: 1; }
.topnav a { color: #b7c7dc; text-decoration: none; font-size: 12.5px; font-weight: 600; padding: 7px 12px; border-radius: 9px; }
.topnav a:hover { color: #fff; background: rgba(255, 255, 255, 0.08); }
.topnav a.active { color: #fff; background: rgba(255, 255, 255, 0.14); }
.topbar-user { display: flex; align-items: center; gap: 10px; margin: 0; }
.topbar-name { color: #e2e8f0; font-size: 12px; font-weight: 600; }

.page { max-width: 1120px; margin: 0 auto; padding: 26px 20px 60px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-title { font-size: 26px; letter-spacing: -0.6px; color: var(--navy); margin: 4px 0 4px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.head-actions { display: flex; gap: 8px; align-items: center; }
.page .muted { font-size: 12px; color: var(--muted); margin: 4px 0; }

.small { padding: 7px 11px !important; font-size: 11.5px !important; }
.danger { color: #b91c1c !important; }
.right { text-align: right; }
.hint { display: block; margin-top: 5px; font-size: 11px; color: var(--muted-2); }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); margin: 14px 0; }
.panel-summary { cursor: pointer; list-style: none; padding: 14px 18px; font-size: 12.5px; font-weight: 700; color: var(--blue); }
.panel-summary::-webkit-details-marker { display: none; }
.panel-body { padding: 4px 18px 18px; }
.panel.static .panel-body { padding-top: 14px; }
.auth-sub.first { margin-top: 0; padding-top: 0; border-top: 0; }

.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 14px; margin-top: 14px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.card.is-archived { opacity: 0.7; }
.card-top { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.card h2 { font-size: 15px; margin: 0; color: var(--navy); letter-spacing: -0.2px; }
.card-sub { margin: 0; font-size: 12px; color: var(--muted); }
.card-meta { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--text-2); }
.card-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 4px; }
.card-foot small { color: var(--muted-2); font-size: 10.5px; }
.card-actions { display: flex; gap: 6px; }

.progress { height: 8px; background: var(--line-soft); border-radius: 999px; overflow: hidden; }
.progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--blue), var(--indigo)); border-radius: 999px; }
.progress.sm { height: 6px; min-width: 70px; margin-bottom: 3px; }

.empty { background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); padding: 36px 20px; text-align: center; color: var(--muted); margin-top: 14px; }
.empty b { color: var(--navy); display: block; margin-bottom: 4px; }
.empty p { margin: 0; font-size: 12.5px; }
.empty.small { padding: 18px; margin: 10px 0; }

.list { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.row-item { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.row-item > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 12px 16px; flex-wrap: wrap; }
.row-item > summary::-webkit-details-marker { display: none; }
.row-item .who { flex: 1; min-width: 200px; font-size: 13px; color: var(--navy); }
.row-item .who small { display: block; color: var(--muted); font-size: 11.5px; }
.row-item .meta { font-size: 11px; color: var(--muted-2); }
.row-body { border-top: 1px solid var(--line-soft); padding: 14px 16px 16px; }
.inline-form { display: flex; gap: 10px; align-items: flex-end; margin-top: 12px; }
.inline-form .grow { flex: 1; margin: 0; }
.check { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 500; letter-spacing: 0; }
.check input { width: auto; }

select { width: 100%; padding: 10px 11px; border: 1px solid var(--line); border-radius: 9px; font: 12.5px Inter, sans-serif; background: var(--surface); color: var(--text); }
.form-group input[type="date"], .form-group input[type="number"] { font-family: inherit; }

.pill-info { background: var(--blue-soft); color: #1d4ed8; border-color: #bfdbfe; }
.pill-muted { background: var(--line-soft); color: var(--muted); border-color: var(--line); }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 14px 0; }
.phase-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 6px 0 14px; }
.phase-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--text-2); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; }
.phase-chip i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.phase-chip small { color: var(--muted-2); }
td a { color: var(--blue); text-decoration: none; font-weight: 600; }

@media (max-width: 760px) {
  .topbar-inner { flex-wrap: wrap; gap: 10px; }
  .topnav { order: 3; flex-basis: 100%; }
  .topbar-name { display: none; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .inline-form { flex-direction: column; align-items: stretch; }
}
