/* =====================================================================
   SIPERAT RS UNS - gaya aplikasi (di atas Bootstrap 5.3, aset lokal)
   Navy #0F2747 · Teal #0F8B8D · Latar #F5F7FB · Kartu putih
   ===================================================================== */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/inter-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/inter-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/inter-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/inter-latin-700-normal.woff2") format("woff2"); }

:root {
  --sp-navy: #0F2747;
  --sp-navy-2: #17345c;
  --sp-teal: #0F8B8D;
  --sp-teal-dark: #0b6c6e;
  --sp-bg: #F5F7FB;
  --sp-card: #ffffff;
  --sp-border: #e3e8f0;
  --sp-muted: #5b6577;
  --sp-orange: #c2570c;
  --sp-radius: .75rem;
  --sidebar-w: 260px;
  --bs-body-font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --bs-body-bg: var(--sp-bg);
  --bs-body-color: #1d2533;
  --bs-primary: var(--sp-teal);
  --bs-primary-rgb: 15, 139, 141;
  --bs-link-color: var(--sp-teal-dark);
  --bs-link-color-rgb: 11, 108, 110;
  --bs-link-hover-color: var(--sp-navy);
  --bs-border-radius: .5rem;
  --bs-focus-ring-color: rgba(15, 139, 141, .35);
}

body { background: var(--sp-bg); font-size: .9375rem; }
h1, h2, h3, h4, h5, .h1, .h2, .h3, .h4, .h5 { color: var(--sp-navy); font-weight: 650; }
.text-muted, .form-text { color: var(--sp-muted) !important; }

/* Fokus keyboard yang jelas */
:focus-visible { outline: 3px solid rgba(15, 139, 141, .6) !important; outline-offset: 2px; }
.btn:focus-visible, .form-control:focus, .form-select:focus, .form-check-input:focus { box-shadow: 0 0 0 .25rem rgba(15, 139, 141, .3); border-color: var(--sp-teal); }
.skip-link { position: absolute; left: -9999px; top: 0; z-index: 2000; background: var(--sp-navy); color: #fff; padding: .5rem 1rem; }
.skip-link:focus { left: 1rem; top: 1rem; }

/* Tombol */
.btn-primary { --bs-btn-bg: var(--sp-teal); --bs-btn-border-color: var(--sp-teal); --bs-btn-hover-bg: var(--sp-teal-dark); --bs-btn-hover-border-color: var(--sp-teal-dark); --bs-btn-active-bg: var(--sp-teal-dark); --bs-btn-disabled-bg: var(--sp-teal); --bs-btn-disabled-border-color: var(--sp-teal); }
.btn-navy { --bs-btn-color: #fff; --bs-btn-bg: var(--sp-navy); --bs-btn-border-color: var(--sp-navy); --bs-btn-hover-color: #fff; --bs-btn-hover-bg: var(--sp-navy-2); --bs-btn-hover-border-color: var(--sp-navy-2); --bs-btn-active-bg: var(--sp-navy-2); --bs-btn-active-color: #fff; }
.btn-outline-primary { --bs-btn-color: var(--sp-teal-dark); --bs-btn-border-color: var(--sp-teal); --bs-btn-hover-bg: var(--sp-teal); --bs-btn-hover-border-color: var(--sp-teal); --bs-btn-active-bg: var(--sp-teal-dark); }
.text-teal { color: var(--sp-teal-dark) !important; }
.bg-navy { background: var(--sp-navy) !important; color: #fff; }

/* Layout */
.app-shell { display: flex; min-height: 100vh; }
.sidebar { width: var(--sidebar-w); background: var(--sp-navy); color: #c9d4e5; flex-shrink: 0; }
@media (min-width: 992px) {
  .sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; }
}
.sidebar .brand { display: flex; align-items: center; gap: .75rem; padding: 1.25rem 1.25rem 1rem; color: #fff; text-decoration: none; border-bottom: 1px solid rgba(255,255,255,.08); }
.sidebar .brand-mark { width: 40px; height: 40px; border-radius: .6rem; background: var(--sp-teal); display: grid; place-items: center; font-weight: 700; color: #fff; letter-spacing: .5px; flex-shrink: 0; overflow: hidden; }
.sidebar .brand-mark img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.sidebar .brand-title { font-weight: 700; font-size: 1rem; line-height: 1.15; }
.sidebar .brand-sub { font-size: .72rem; color: #9fb0c9; }
.sidebar .nav-section { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: #8396b3; padding: 1rem 1.25rem .35rem; }
.sidebar .nav-link { color: #d2dbe9; padding: .5rem 1.25rem; display: flex; align-items: center; gap: .7rem; border-left: 3px solid transparent; font-size: .9rem; }
.sidebar .nav-link .bi { font-size: 1.05rem; width: 1.2rem; text-align: center; }
.sidebar .nav-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.sidebar .nav-link.active { background: rgba(15,139,141,.22); color: #fff; border-left-color: var(--sp-teal); font-weight: 600; }
.sidebar .nav-link .badge { margin-left: auto; }
.sidebar .nav-link.featured { color: #fff; }
.sidebar .nav-link.featured .bi { color: #5fd3d4; }
.offcanvas-lg.sidebar { --bs-offcanvas-bg: var(--sp-navy); --bs-offcanvas-color: #c9d4e5; --bs-offcanvas-width: 280px; }

.app-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { background: #fff; border-bottom: 1px solid var(--sp-border); padding: .6rem 1.25rem; display: flex; align-items: center; gap: .75rem; position: sticky; top: 0; z-index: 1020; }
.topbar .search { flex: 1; max-width: 520px; }
.topbar .avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--sp-navy); color: #fff; display: grid; place-items: center; font-weight: 600; font-size: .85rem; }
.topbar .icon-btn { position: relative; width: 40px; height: 40px; display: grid; place-items: center; border-radius: .6rem; color: var(--sp-navy); border: 1px solid var(--sp-border); background: #fff; }
.topbar .icon-btn .count { position: absolute; top: -6px; right: -6px; font-size: .65rem; }
main.content { padding: 1.5rem 1.25rem 5.5rem; flex: 1; }
@media (min-width: 992px) { main.content { padding: 1.75rem 2rem 2rem; } }
.app-footer { padding: .75rem 2rem; font-size: .8rem; color: var(--sp-muted); }

/* Navigasi ringkas ponsel */
.bottom-nav { position: fixed; bottom: 0; left: 0; right: 0; background: #fff; border-top: 1px solid var(--sp-border); display: flex; z-index: 1030; padding-bottom: env(safe-area-inset-bottom); }
.bottom-nav a, .bottom-nav button { flex: 1; text-align: center; padding: .45rem .25rem; font-size: .7rem; color: var(--sp-muted); text-decoration: none; background: none; border: 0; }
.bottom-nav .bi { display: block; font-size: 1.25rem; margin-bottom: .1rem; }
.bottom-nav .active { color: var(--sp-teal-dark); font-weight: 600; }
@media (min-width: 992px) { .bottom-nav { display: none; } }

/* Kartu */
.card { border: 1px solid var(--sp-border); border-radius: var(--sp-radius); box-shadow: 0 1px 2px rgba(15,39,71,.04); }
.card-header { background: #fff; border-bottom: 1px solid var(--sp-border); font-weight: 600; color: var(--sp-navy); border-radius: var(--sp-radius) var(--sp-radius) 0 0 !important; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: .75rem; margin-bottom: 1.25rem; }
.page-head h1 { font-size: 1.45rem; margin: 0; }
.page-head .sub { color: var(--sp-muted); font-size: .9rem; margin-top: .25rem; }

.stat-card { display: block; text-decoration: none; color: inherit; height: 100%; transition: transform .12s ease, box-shadow .12s ease; }
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(15,39,71,.08); color: inherit; }
.stat-card .card-body { display: flex; gap: .9rem; align-items: center; }
.stat-icon { width: 46px; height: 46px; border-radius: .7rem; display: grid; place-items: center; font-size: 1.35rem; flex-shrink: 0; }
.stat-value { font-size: 1.6rem; font-weight: 700; color: var(--sp-navy); line-height: 1.1; }
.stat-label { font-size: .82rem; color: var(--sp-muted); }
.ic-teal { background: rgba(15,139,141,.12); color: var(--sp-teal-dark); }
.ic-navy { background: rgba(15,39,71,.1); color: var(--sp-navy); }
.ic-amber { background: #fff4d6; color: #8a5a00; }
.ic-red { background: #fde7e7; color: #b02a37; }
.ic-green { background: #e3f6ea; color: #17733e; }
.ic-gray { background: #eef1f5; color: #4a5568; }
.monitoring-hero { background: linear-gradient(120deg, var(--sp-navy) 0%, #14406b 60%, var(--sp-teal) 100%); color: #fff; border: 0; }
.monitoring-hero h2, .monitoring-hero .h5 { color: #fff; }
.monitoring-hero .hero-stat { background: rgba(255,255,255,.1); border-radius: .6rem; padding: .6rem .8rem; text-decoration: none; color: #fff; display: block; }
.monitoring-hero .hero-stat:hover { background: rgba(255,255,255,.18); }
.monitoring-hero .hero-stat .v { font-size: 1.35rem; font-weight: 700; }

/* Status */
.badge-status { font-weight: 600; font-size: .75rem; padding: .35em .6em; }
.badge-orange { background: #fde3cf; color: #8a3b03; }
.badge-late { background: #b02a37; color: #fff; }
.text-bg-warning { color: #3d2c00 !important; }
.text-bg-info { background-color: #d7eef6 !important; color: #08465a !important; }
.badge.text-bg-light { color: #44505f !important; }
.demo-flag { background: #fff4d6; border: 1px dashed #c99a1d; color: #6a4b00; }

/* Progres */
.progress { height: .55rem; background: #e8edf4; }
.progress-bar { background-color: var(--sp-teal); }
.bar-row { display: grid; grid-template-columns: minmax(110px, 30%) 1fr 4.5rem; gap: .6rem; align-items: center; margin-bottom: .55rem; font-size: .85rem; }
.bar-row .progress { height: .7rem; }

/* Tabel */
.table { --bs-table-bg: transparent; margin-bottom: 0; }
.table thead th { font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--sp-muted); font-weight: 600; background: #f8fafc; white-space: nowrap; }
.table td { vertical-align: middle; }
.table-hover tbody tr:hover { background: #f6fafb; }
@media (max-width: 767.98px) {
  .table-stack thead { display: none; }
  .table-stack tbody tr { display: block; border: 1px solid var(--sp-border); border-radius: .6rem; margin: .6rem; padding: .4rem .6rem; background: #fff; }
  .table-stack tbody td { display: flex; justify-content: space-between; gap: 1rem; border: 0; padding: .3rem 0; text-align: right; }
  .table-stack tbody td::before { content: attr(data-label); font-weight: 600; color: var(--sp-muted); text-align: left; font-size: .8rem; }
  .table-stack tbody td.td-main { display: block; text-align: left; font-weight: 600; }
  .table-stack tbody td.td-main::before { display: none; }
}

/* Form */
.form-label { font-weight: 600; font-size: .875rem; color: #243049; }
.req::after { content: " *"; color: #b02a37; }
.form-section { border-bottom: 1px solid var(--sp-border); padding-bottom: 1.25rem; margin-bottom: 1.25rem; }
.form-section:last-child { border-bottom: 0; margin-bottom: 0; padding-bottom: 0; }
.form-section-title { font-size: 1rem; font-weight: 650; color: var(--sp-navy); display: flex; align-items: center; gap: .5rem; margin-bottom: .9rem; }
.form-section-title .num { width: 26px; height: 26px; border-radius: 50%; background: var(--sp-teal); color: #fff; display: grid; place-items: center; font-size: .8rem; }
.sticky-actions { position: sticky; bottom: 0; background: rgba(245,247,251,.96); border-top: 1px solid var(--sp-border); padding: .75rem 0; z-index: 10; }
@media (max-width: 991.98px) { .sticky-actions { bottom: 56px; } }
select[multiple].form-select { min-height: 8rem; }

/* Tab */
.nav-tabs .nav-link { color: var(--sp-muted); font-weight: 500; }
.nav-tabs .nav-link.active { color: var(--sp-navy); font-weight: 600; border-top: 3px solid var(--sp-teal); }
.nav-tabs { flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; }
.nav-tabs .nav-link { white-space: nowrap; }

/* Data kosong */
.empty-state { text-align: center; padding: 2.5rem 1rem; color: var(--sp-muted); }
.empty-state .bi { font-size: 2.4rem; color: #a8b4c6; display: block; margin-bottom: .5rem; }

/* Kronologi */
.timeline { list-style: none; padding: 0; margin: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 15px; top: 4px; bottom: 4px; width: 2px; background: var(--sp-border); }
.timeline li { position: relative; padding: 0 0 1.1rem 44px; }
.timeline .dot { position: absolute; left: 4px; top: 0; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: #fff; border: 2px solid var(--sp-teal); color: var(--sp-teal-dark); font-size: .7rem; }
.timeline .meta { font-size: .78rem; color: var(--sp-muted); }

/* Kalender */
.calendar { display: grid; grid-template-columns: repeat(7, 1fr); border: 1px solid var(--sp-border); border-radius: var(--sp-radius); overflow: hidden; background: #fff; }
.calendar .dow { background: #f1f4f9; font-size: .75rem; font-weight: 600; text-align: center; padding: .45rem; color: var(--sp-muted); }
.calendar .day { min-height: 108px; border-top: 1px solid var(--sp-border); border-left: 1px solid var(--sp-border); padding: .35rem; font-size: .78rem; }
.calendar .day:nth-child(7n+1) { border-left: 0; }
.calendar .day.other { background: #fafbfd; color: #b3bccb; }
.calendar .day.today { background: #eefaf9; }
.calendar .day .num { font-weight: 600; }
.calendar .ev { display: block; background: rgba(15,139,141,.12); color: var(--sp-navy); border-left: 3px solid var(--sp-teal); padding: .15rem .3rem; border-radius: .25rem; margin-top: .2rem; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.calendar .ev.cancelled { opacity: .55; text-decoration: line-through; border-left-color: #8792a2; }
@media (max-width: 767.98px) { .calendar { display: none; } }

/* Galeri foto */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .75rem; }
.gallery a { display: block; border-radius: .5rem; overflow: hidden; border: 1px solid var(--sp-border); background: #fff; text-decoration: none; }
.gallery img { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; }
.gallery .cap { font-size: .75rem; padding: .3rem .45rem; color: var(--sp-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Editor notulensi */
.minutes-row { border: 1px solid var(--sp-border); border-radius: .6rem; padding: .9rem; margin-bottom: .75rem; background: #fff; }
.minutes-row .row-no { width: 30px; height: 30px; border-radius: 50%; background: var(--sp-navy); color: #fff; display: grid; place-items: center; font-weight: 600; font-size: .85rem; }
.minutes-row.locked { background: #f7fafb; }

/* Login */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1fr; }
@media (min-width: 992px) { .auth-wrap { grid-template-columns: 1.1fr 1fr; } }
.auth-hero { background: linear-gradient(150deg, var(--sp-navy) 0%, #123a63 55%, var(--sp-teal) 130%); color: #fff; padding: 3rem; display: none; flex-direction: column; justify-content: space-between; }
@media (min-width: 992px) { .auth-hero { display: flex; } }
.auth-hero h1 { color: #fff; font-size: 2.4rem; font-weight: 700; }
.auth-hero .feature { display: flex; gap: .8rem; align-items: flex-start; margin-bottom: 1rem; color: #d7e3f2; }
.auth-hero .feature .bi { font-size: 1.3rem; color: #6fe0e1; }
.auth-panel { display: flex; align-items: center; justify-content: center; padding: 2rem 1rem; }
.auth-card { width: 100%; max-width: 420px; }

/* Cetak dalam aplikasi */
.print-only { display: none; }
@media print {
  .sidebar, .topbar, .bottom-nav, .no-print, .app-footer { display: none !important; }
  .print-only { display: block; }
  main.content { padding: 0; }
}

.min-w-0 { min-width: 0; }
.text-pre { white-space: pre-line; }
.small-muted { font-size: .8rem; color: var(--sp-muted); }
.cursor-pointer { cursor: pointer; }
dl.meta-list dt { font-size: .78rem; color: var(--sp-muted); font-weight: 500; }
dl.meta-list dd { margin-bottom: .75rem; font-weight: 500; }
.flash-secret { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
