:root {
  --primary: #d6336c;
  --primary-dark: #a61e4d;
  --primary-light: #fdeef2;
  --accent: #ffb3c6;
  --bg: #fdf6f8;
  --card-bg: #ffffff;
  --text: #1f2937;
  --text-muted: #6b7280;
  --border: #e5e7eb;
  --danger: #ef4444;
  --radius: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
}

/* ===== Login Page ===== */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
}
.login-box {
  background: var(--card-bg);
  padding: 40px 36px;
  border-radius: var(--radius);
  box-shadow: 0 10px 40px rgba(0,0,0,0.2);
  width: 100%;
  max-width: 380px;
}
.login-box h1 {
  font-size: 20px;
  margin: 0 0 4px;
  color: var(--primary-dark);
}
.login-box p.subtitle {
  color: var(--text-muted);
  margin: 0 0 24px;
  font-size: 14px;
}

/* ===== Navbar ===== */
.navbar {
  background: var(--primary-dark);
  color: #fff;
  padding: 14px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.navbar .brand { font-weight: 600; font-size: 16px; }
.navbar .user-info { font-size: 13px; opacity: 0.9; }
.navbar a.logout {
  color: #fff;
  background: rgba(255,255,255,0.15);
  padding: 6px 14px;
  border-radius: 6px;
  text-decoration: none;
  margin-left: 12px;
  font-size: 13px;
}
.navbar a.logout:hover { background: rgba(255,255,255,0.25); }

/* ===== Layout ===== */
.container { max-width: 1100px; margin: 0 auto; padding: 24px; }
.page-title { font-size: 22px; margin-bottom: 4px; color: var(--primary-dark); }
.page-subtitle { color: var(--text-muted); margin-bottom: 24px; font-size: 14px; }

/* ===== Cards ===== */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 20px 22px;
  margin-bottom: 18px;
}
.card h3 { margin-top: 0; font-size: 16px; color: var(--primary-dark); }

/* ===== Form ===== */
label { display: block; font-size: 13px; font-weight: 600; margin: 14px 0 6px; color: var(--text); }
input, select, textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); }
textarea { resize: vertical; min-height: 70px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

button, .btn {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 10px 20px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  margin-top: 18px;
}
button:hover, .btn:hover { background: var(--primary-dark); }
.btn-secondary { background: #6b7280; }
.btn-secondary:hover { background: #4b5563; }
.btn-danger { background: var(--danger); }

.alert {
  padding: 12px 16px;
  border-radius: 6px;
  margin-bottom: 16px;
  font-size: 14px;
}
.alert-error { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.alert-success { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }

/* ===== Status badge ===== */
.badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
}

/* ===== Table ===== */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); }
th { background: var(--primary-light); color: var(--primary-dark); font-size: 13px; }
tr:hover { background: #fafafa; }

/* ===== Timeline (tracking status) ===== */
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li {
  position: relative;
  padding: 0 0 20px 28px;
  border-left: 2px solid var(--border);
}
.timeline li:last-child { border-left: 2px solid transparent; padding-bottom: 0; }
.timeline li::before {
  content: '';
  position: absolute;
  left: -7px;
  top: 2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--primary);
  border: 2px solid #fff;
  box-shadow: 0 0 0 2px var(--primary);
}
.timeline .waktu { font-size: 12px; color: var(--text-muted); }
.timeline .judul { font-weight: 600; font-size: 14px; }

/* ===== Stat cards on dashboard ===== */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 24px; }
.stat-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 16px 18px;
  text-align: center;
}
.stat-card .num { font-size: 26px; font-weight: 700; color: var(--primary-dark); }
.stat-card .label { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

@media (max-width: 640px) {
  .form-row { grid-template-columns: 1fr; }
}
/* ===== SIDEBAR LAYOUT (Dashboard v2) ===== */
.app-shell { display: flex; min-height: 100vh; background: #f4f6fb; }

.sidebar {
  width: 260px;
  background: #14213d;
  color: #cbd5e1;
  flex-shrink: 0;
  padding: 20px 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.sidebar .brand-v2 { display: flex; align-items: center; gap: 10px; padding: 0 20px 20px; border-bottom: 1px solid rgba(255,255,255,0.08); }
.sidebar .brand-v2 .icon { font-size: 26px; }
.sidebar .brand-v2 .txt b { display: block; color: #fff; font-size: 14px; line-height: 1.3; }
.sidebar .brand-v2 .txt small { color: #94a3b8; font-size: 11px; }

.sidebar nav { padding: 14px 10px; }
.sidebar .nav-label { font-size: 11px; text-transform: uppercase; color: #64748b; padding: 14px 12px 6px; letter-spacing: 0.05em; }
.sidebar a.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 8px; color: #cbd5e1;
  text-decoration: none; font-size: 14px; margin-bottom: 2px;
}
.sidebar a.nav-item:hover { background: rgba(255,255,255,0.06); color: #fff; }
.sidebar a.nav-item.active { background: var(--primary); color: #fff; font-weight: 600; }
.sidebar a.nav-item.disabled { opacity: 0.45; cursor: default; pointer-events: none; }
.sidebar a.nav-item .badge-soon { margin-left: auto; font-size: 9px; background: rgba(255,255,255,0.12); padding: 2px 6px; border-radius: 10px; }

.main-v2 { flex: 1; min-width: 0; }
.topbar-v2 {
  background: #fff; border-bottom: 1px solid var(--border);
  padding: 14px 28px; display: flex; justify-content: space-between; align-items: center;
}
.topbar-v2 .facility-pill { font-size: 13px; font-weight: 600; color: var(--primary-dark); background: var(--primary-light); padding: 6px 14px; border-radius: 20px; }
.topbar-v2 .right-cluster { display: flex; align-items: center; gap: 16px; }
.topbar-v2 .avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; }
.topbar-v2 .who b { display: block; font-size: 13px; }
.topbar-v2 .who small { color: var(--text-muted); font-size: 11px; }

.content-v2 { padding: 26px 28px; }
.welcome-v2 { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; }
.welcome-v2 .emoji-badge { width: 48px; height: 48px; border-radius: 12px; background: var(--primary-light); display: flex; align-items: center; justify-content: center; font-size: 22px; }
.welcome-v2 h2 { margin: 0; font-size: 20px; color: var(--primary-dark); }
.welcome-v2 p { margin: 2px 0 0; color: var(--text-muted); font-size: 13px; }

.stat-grid-v2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 16px; }
.stat-card-v2 {
  background: #fff; border-radius: 12px; border: 1px solid var(--border);
  padding: 16px 18px; display: flex; gap: 12px; align-items: flex-start;
}
.stat-card-v2 .ic { width: 42px; height: 42px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 19px; flex-shrink: 0; }
.stat-card-v2 .num { font-size: 22px; font-weight: 700; color: var(--text); line-height: 1.1; }
.stat-card-v2 .lbl { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

.status-row-v2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-bottom: 20px; }
.status-card-v2 { background: #fff; border-radius: 12px; border: 1px solid var(--border); padding: 16px 18px; display: flex; align-items: center; gap: 12px; }
.status-card-v2 .dot { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 17px; color: #fff; }
.status-card-v2 .num { font-size: 20px; font-weight: 700; }
.status-card-v2 .lbl { font-size: 12px; color: var(--text-muted); }

.grid-2col { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; margin-bottom: 20px; }
@media (max-width: 900px) { .grid-2col { grid-template-columns: 1fr; } .sidebar { display: none; } }

.card-v2 { background: #fff; border-radius: 12px; border: 1px solid var(--border); padding: 18px 20px; }
.card-v2 h3 { margin: 0 0 14px; font-size: 15px; color: var(--text); display: flex; align-items: center; gap: 8px; }

.table-v2 { width: 100%; border-collapse: collapse; font-size: 13px; }
.table-v2 th { text-align: left; padding: 10px 8px; color: var(--text-muted); font-size: 11px; text-transform: uppercase; border-bottom: 1px solid var(--border); }
.table-v2 td { padding: 12px 8px; border-bottom: 1px solid #f1f5f9; }
.pill-v2 { padding: 4px 12px; border-radius: 20px; font-size: 11px; font-weight: 600; color: #fff; display: inline-block; }
.pill-jenis-maternal { background: #fce7f3; color: #be185d; }
.pill-jenis-neonatal { background: #ede9fe; color: #6d28d9; }