/* Smart MCH — Laravel edition */
@font-face { font-family: 'Hind Siliguri'; src: url('../vendor/fonts/HindSiliguri-Regular.ttf') format('truetype'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Hind Siliguri'; src: url('../vendor/fonts/HindSiliguri-Medium.ttf') format('truetype'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Hind Siliguri'; src: url('../vendor/fonts/HindSiliguri-SemiBold.ttf') format('truetype'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Hind Siliguri'; src: url('../vendor/fonts/HindSiliguri-Bold.ttf') format('truetype'); font-weight: 700; font-display: swap; }

:root {
  --ink: #1d2a32;
  --muted: #64748b;
  --bg: #f5f3ef;
  --card: #ffffff;
  --line: #e7e2da;
  --brand: #0f5c63;        /* deep teal */
  --brand-2: #127a7f;
  --brand-soft: #e3f1f1;
  --rose: #c8456d;         /* maternal accent */
  --rose-soft: #fbe9ef;
  --amber: #c27c0e;
  --amber-soft: #fdf3e1;
  --green: #2f8a57;
  --green-soft: #e5f4ea;
  --sidebar-w: 262px;
  --radius: 14px;
}
html, body { background: var(--bg); color: var(--ink); }
body { font-family: "Hind Siliguri", system-ui, -apple-system, "Segoe UI", sans-serif; font-size: 15px; }
a { color: var(--brand-2); }
.num, .table td.num { font-variant-numeric: tabular-nums; }

/* ---------- Sidebar ---------- */
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); z-index: 1040;
  background: linear-gradient(180deg, #0c4a50 0%, #0f5c63 55%, #116b70 100%);
  color: #d7ecec; display: flex; flex-direction: column; transition: transform .25s ease;
}
.sidebar .brand { padding: 20px 20px 16px; display: flex; gap: 12px; align-items: center; border-bottom: 1px solid rgba(255,255,255,.08); }
.sidebar .brand-mark { width: 42px; height: 42px; border-radius: 12px; background: #fff; color: var(--rose); display: grid; place-items: center; font-size: 22px; flex: none; }
.sidebar .brand-title { font-weight: 700; color: #fff; line-height: 1.15; font-size: 16px; }
.sidebar .brand-sub { font-size: 12px; color: #9fcfcf; }
.sidebar nav { overflow-y: auto; padding: 10px 12px 24px; flex: 1; }
.sidebar .nav-label { font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: #8fc3c3; margin: 16px 10px 6px; }
.sidebar .nav-link { color: #d7ecec; border-radius: 10px; padding: 8px 12px; display: flex; gap: 11px; align-items: center; font-size: 15px; }
.sidebar .nav-link i { font-size: 17px; opacity: .9; width: 20px; text-align: center; }
.sidebar .nav-link:hover { background: rgba(255,255,255,.08); color: #fff; }
.sidebar .nav-link.active { background: #fff; color: var(--brand); font-weight: 600; box-shadow: 0 4px 14px rgba(0,0,0,.12); }
.sidebar .nav-link .badge { margin-left: auto; }
.main { margin-left: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 1030; background: rgba(245,243,239,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); padding: 12px 28px; display: flex; align-items: center; gap: 14px; }
.topbar h1 { font-size: 20px; margin: 0; font-weight: 700; }
.topbar .crumb { font-size: 13px; color: var(--muted); }
.content { padding: 24px 28px 40px; flex: 1; }
.sidebar-backdrop { display: none; }
@media (max-width: 991.98px) {
  .sidebar { transform: translateX(-100%); }
  body.sidebar-open .sidebar { transform: none; }
  body.sidebar-open .sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 1035; }
  .main { margin-left: 0; }
  .topbar, .content { padding-left: 16px; padding-right: 16px; }
}

/* ---------- Cards ---------- */
.card { border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 1px 2px rgba(29,42,50,.04); }
.card-header { background: transparent; border-bottom: 1px solid var(--line); padding: 14px 18px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.card-header .bi { color: var(--brand-2); }
.card-body { padding: 18px; }
.stat { padding: 16px 18px; display: flex; flex-direction: row; gap: 14px; align-items: center; height: 100%; text-decoration: none; color: inherit; transition: transform .15s, box-shadow .15s; }
a.stat:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(29,42,50,.08); color: inherit; }
.stat .ico { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; font-size: 21px; flex: none; }
.stat .val { font-size: 26px; font-weight: 700; line-height: 1.05; }
.stat .lbl { color: var(--muted); font-size: 13.5px; }
.tone-brand .ico { background: var(--brand-soft); color: var(--brand); }
.tone-rose .ico { background: var(--rose-soft); color: var(--rose); }
.tone-amber .ico { background: var(--amber-soft); color: var(--amber); }
.tone-green .ico { background: var(--green-soft); color: var(--green); }
.tone-slate .ico { background: #eef1f5; color: #475569; }

/* ---------- Tables ---------- */
.table { --bs-table-bg: transparent; margin: 0; }
.table thead th { font-size: 13px; color: var(--muted); font-weight: 600; background: #faf8f5; border-bottom: 1px solid var(--line); white-space: nowrap; padding: 10px 12px; }
.table td { padding: 10px 12px; vertical-align: middle; border-color: #f0ece6; }
.table-hover tbody tr:hover { background: #fbfaf7; }
.table .person { font-weight: 600; color: var(--ink); text-decoration: none; }
.table .person:hover { color: var(--brand-2); }
.table .sub { font-size: 12.5px; color: var(--muted); }
.table-report td, .table-report th { font-size: 13px; white-space: nowrap; padding: 7px 10px; }
.table-report tr.total td { font-weight: 700; background: #f3f8f8; }

.pill { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.pill-primary { background: var(--brand-soft); color: var(--brand); }
.pill-success { background: var(--green-soft); color: var(--green); }
.pill-warning { background: var(--amber-soft); color: var(--amber); }
.pill-danger { background: var(--rose-soft); color: var(--rose); }
.pill-muted { background: #eef1f5; color: #475569; }

/* ---------- Forms ---------- */
.form-label { font-size: 13.5px; font-weight: 600; color: #334155; margin-bottom: 4px; }
.form-control, .form-select { border-radius: 10px; border-color: #d9d3c9; padding: .5rem .75rem; }
.form-control:focus, .form-select:focus { border-color: var(--brand-2); box-shadow: 0 0 0 .2rem rgba(18,122,127,.15); }
.req::after { content: " *"; color: var(--rose); }
.form-section { margin-bottom: 18px; }
.form-section .card-header { background: #faf8f5; }
.btn { border-radius: 10px; font-weight: 600; }
.btn-brand { background: var(--brand); color: #fff; border-color: var(--brand); }
.btn-brand:hover { background: #0b4a50; color: #fff; }
.btn-rose { background: var(--rose); color: #fff; }
.btn-rose:hover { background: #ad3a5d; color: #fff; }
.filter-bar { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 16px; }
.filter-bar .form-control, .filter-bar .form-select { font-size: 14px; }

/* ---------- Detail page ---------- */
.profile-head { background: linear-gradient(120deg, #0f5c63, #127a7f 60%, #1a8c8a); color: #fff; border-radius: var(--radius); padding: 22px; position: relative; overflow: hidden; }
.profile-head::after { content: ""; position: absolute; right: -40px; top: -40px; width: 200px; height: 200px; border-radius: 50%; background: rgba(255,255,255,.07); }
.profile-head h2 { font-size: 24px; font-weight: 700; margin: 0; }
.profile-head .meta { color: #cdeaea; font-size: 14px; }
.dl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px 18px; }
.dl-grid .k { font-size: 12.5px; color: var(--muted); }
.dl-grid .v { font-weight: 600; }
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 13px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.timeline li { position: relative; padding: 0 0 14px 40px; }
.timeline .dot { position: absolute; left: 4px; top: 2px; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; background: #fff; border: 2px solid var(--line); color: var(--muted); }
.timeline li.done .dot { background: var(--green); border-color: var(--green); color: #fff; }
.timeline li.next .dot { background: var(--rose); border-color: var(--rose); color: #fff; box-shadow: 0 0 0 4px var(--rose-soft); }
.timeline .t { font-weight: 600; }
.timeline .d { font-size: 13px; color: var(--muted); }

/* ---------- Report ---------- */
.report-tile { display: flex; gap: 14px; padding: 18px; height: 100%; text-decoration: none; color: inherit; }
.report-tile:hover { background: #fbfaf7; color: inherit; }
.report-tile .ico { width: 48px; height: 48px; border-radius: 12px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; font-size: 22px; flex: none; }
.summary-chip { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; min-width: 120px; }
.summary-chip .v { font-size: 20px; font-weight: 700; }
.summary-chip .k { font-size: 12.5px; color: var(--muted); }
.print-head { display: none; }

/* ---------- Login ---------- */
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-art { background: linear-gradient(150deg, #0c4a50, #127a7f 60%, #c8456d 140%); color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.login-art::before { content: ""; position: absolute; width: 520px; height: 520px; border-radius: 50%; border: 60px solid rgba(255,255,255,.06); right: -180px; bottom: -180px; }
.login-art h1 { font-size: 40px; font-weight: 700; line-height: 1.2; }
.login-form { display: grid; place-items: center; padding: 32px 20px; }
.login-card { width: 100%; max-width: 400px; }
@media (max-width: 991.98px) { .login-wrap { grid-template-columns: 1fr; } .login-art { padding: 28px; } .login-art h1 { font-size: 26px; } }

/* ---------- Print ---------- */
@media print {
  @page { size: A4 landscape; margin: 10mm; }
  body { background: #fff; font-size: 11px; }
  .sidebar, .topbar, .filter-bar, .no-print, .pagination, .btn { display: none !important; }
  .main { margin: 0; }
  .content { padding: 0; }
  .card { border: none; box-shadow: none; }
  .print-head { display: block; text-align: center; margin-bottom: 10px; }
  .print-head h3 { font-size: 16px; margin: 0; }
  .table-report td, .table-report th { font-size: 10px; padding: 3px 5px; border: 1px solid #999 !important; white-space: normal; }
  .table-responsive { overflow: visible !important; }
  .summary-chip { border: 1px solid #999; padding: 4px 8px; }
}
