/* ==========================================================================
   SiGMA 2 — SMP Negeri 11 Banjarbaru
   Identitas: biru tua (seragam SMP) + biru kerajaan untuk aksi + emas sebagai penanda.
   ========================================================================== */
:root {
  --sg-font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --sg-navy: #0f1d44;
  --sg-navy-2: #172a5e;
  --sg-primary: #2453d6;
  --sg-primary-600: #1c43b4;
  --sg-primary-rgb: 36, 83, 214;
  --sg-accent: #f5a524;
  --sg-page: #f3f5fa;
  --sg-surface: #ffffff;
  --sg-surface-2: #f8f9fc;
  --sg-line: #e5e8f0;
  --sg-text: #111a2e;
  --sg-muted: #667085;
  --sg-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 6px 18px -8px rgba(16, 24, 40, .08);
  --sg-shadow-lg: 0 20px 40px -18px rgba(16, 24, 40, .28);
  --sg-radius: 16px;
  --sg-radius-sm: 11px;
  --sg-side-w: 268px;
  --sg-side-mini: 78px;
  --sg-top-h: 64px;

  --sg-green: #12a150; --sg-green-bg: rgba(18, 161, 80, .12);
  --sg-amber: #c77700; --sg-amber-bg: rgba(245, 165, 36, .18);
  --sg-red: #d92d20;   --sg-red-bg: rgba(217, 45, 32, .11);
  --sg-cyan: #0b7fa3;  --sg-cyan-bg: rgba(11, 127, 163, .12);
  --sg-blue: #2453d6;  --sg-blue-bg: rgba(36, 83, 214, .11);
  --sg-violet: #6d3fd6; --sg-violet-bg: rgba(109, 63, 214, .11);
  --sg-gray: #5b6474;  --sg-gray-bg: rgba(91, 100, 116, .12);

  --bs-body-font-family: var(--sg-font);
  --bs-body-font-size: .925rem;
  --bs-body-color: var(--sg-text);
  --bs-body-bg: var(--sg-surface);
  --bs-border-color: var(--sg-line);
  --bs-border-radius: var(--sg-radius-sm);
  --bs-border-radius-sm: 8px;
  --bs-border-radius-lg: 14px;
  --bs-primary: #2453d6;
  --bs-primary-rgb: 36, 83, 214;
  --bs-link-color: #2453d6;
  --bs-link-color-rgb: 36, 83, 214;
  --bs-link-hover-color: #1c43b4;
  --bs-link-hover-color-rgb: 28, 67, 180;
  --bs-secondary-color: var(--sg-muted);
  --bs-emphasis-color: var(--sg-text);
}
[data-bs-theme="dark"] {
  --sg-page: #0a0f1e;
  --sg-surface: #121a2f;
  --sg-surface-2: #0f1628;
  --sg-line: rgba(255, 255, 255, .085);
  --sg-text: #e6eaf3;
  --sg-muted: #97a1b5;
  --sg-primary: #5b82f0;
  --sg-primary-rgb: 91, 130, 240;
  --sg-shadow: 0 1px 2px rgba(0, 0, 0, .3);
  --sg-green: #3ecf7c; --sg-amber: #f5b64a; --sg-red: #ff6b5f; --sg-cyan: #3fc1e6; --sg-blue: #7c9cf5; --sg-violet: #a98bf5; --sg-gray: #a3acbd;
  --bs-body-bg: var(--sg-surface);
  --bs-body-color: var(--sg-text);
  --bs-tertiary-bg: var(--sg-surface-2);
  --bs-link-color: #7c9cf5;
  --bs-link-color-rgb: 124, 156, 245;
  --bs-link-hover-color: #a3baf8;
  --bs-primary-rgb: 91, 130, 240;
}

html { -webkit-text-size-adjust: 100%; }
body.sg { background: var(--sg-page); color: var(--sg-text); font-family: var(--sg-font); font-feature-settings: 'cv11', 'ss01'; -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4, h5, h6 { font-weight: 700; letter-spacing: -.015em; color: var(--sg-text); }
.min-w-0 { min-width: 0; }
code { color: var(--sg-violet); background: var(--sg-violet-bg); padding: .08rem .35rem; border-radius: 6px; font-size: .84em; }
::selection { background: rgba(var(--sg-primary-rgb), .2); }
.sg-skip { position: absolute; left: 1rem; top: .5rem; z-index: 2000; background: var(--sg-surface); padding: .5rem 1rem; border-radius: 8px; }

/* ---------- Kerangka ---------- */
.sg-shell { min-height: 100vh; min-height: 100dvh; }
.sg-sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sg-side-w); z-index: 1040;
  display: flex; flex-direction: column;
  background: radial-gradient(120% 60% at 0% 0%, #1c3478 0%, transparent 55%), linear-gradient(180deg, var(--sg-navy) 0%, #0b1533 100%);
  color: #c9d3ee; transition: width .22s ease, transform .25s ease;
}
.sg-main { margin-left: var(--sg-side-w); min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; transition: margin-left .22s ease; }
.sg-brand { height: var(--sg-top-h); display: flex; align-items: center; justify-content: space-between; padding: 0 .9rem 0 1.1rem; flex: none; }
.sg-brand-link { display: flex; align-items: center; gap: .75rem; text-decoration: none; color: #fff; min-width: 0; }
.sg-brand-mark { width: 2.4rem; height: 2.4rem; border-radius: 12px; flex: none; display: grid; place-items: center; font-weight: 800; font-size: 1.3rem; color: var(--sg-navy); background: linear-gradient(135deg, #ffd27a, var(--sg-accent)); box-shadow: 0 6px 16px -6px rgba(245, 165, 36, .7); }
.sg-brand-logo { width: 2.4rem; height: 2.4rem; object-fit: contain; border-radius: 12px; background: #fff; padding: 3px; flex: none; }
.sg-brand-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.sg-brand-name { font-weight: 800; font-size: 1.15rem; letter-spacing: -.02em; }
.sg-brand-text small { color: #93a3cf; font-size: .72rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sg-nav { flex: 1; overflow-y: auto; padding: .35rem .75rem 1rem; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .15) transparent; }
.sg-nav-h { font-size: .68rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: #6f80b3; padding: 1.05rem .75rem .4rem; white-space: nowrap; }
.sg-nav-link { position: relative; display: flex; align-items: center; gap: .8rem; padding: .6rem .75rem; margin: 1px 0; border-radius: 11px; color: #c3cdea; text-decoration: none; font-weight: 500; font-size: .9rem; white-space: nowrap; transition: background .15s, color .15s; }
.sg-nav-link i { font-size: 1.1rem; width: 1.25rem; text-align: center; color: #8d9dcc; transition: color .15s; }
.sg-nav-link:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.sg-nav-link:hover i { color: #fff; }
.sg-nav-link.active { background: linear-gradient(90deg, rgba(91, 130, 240, .32), rgba(91, 130, 240, .12)); color: #fff; font-weight: 600; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06); }
.sg-nav-link.active i { color: var(--sg-accent); }
.sg-nav-link.active::before { content: ''; position: absolute; left: -.75rem; top: .55rem; bottom: .55rem; width: 3px; border-radius: 0 3px 3px 0; background: var(--sg-accent); }
.sg-nav-badge { margin-left: auto; min-width: 1.35rem; height: 1.35rem; padding: 0 .4rem; border-radius: 99px; background: var(--sg-accent); color: #3b2500; font-size: .7rem; font-weight: 800; display: grid; place-items: center; }
.sg-side-foot { padding: .8rem 1rem 1rem; border-top: 1px solid rgba(255, 255, 255, .07); flex: none; }
.sg-side-sem { display: flex; gap: .55rem; align-items: center; font-size: .78rem; color: #aab7de; background: rgba(255, 255, 255, .05); border-radius: 10px; padding: .55rem .7rem; white-space: nowrap; overflow: hidden; }
.sg-side-sem i { color: var(--sg-accent); }
.sg-backdrop { position: fixed; inset: 0; background: rgba(8, 13, 30, .5); backdrop-filter: blur(2px); z-index: 1035; opacity: 0; visibility: hidden; transition: opacity .2s; }

/* Sidebar ringkas (desktop) */
@media (min-width: 992px) {
  .sg-mini .sg-sidebar { width: var(--sg-side-mini); }
  .sg-mini .sg-main { margin-left: var(--sg-side-mini); }
  .sg-mini .sg-brand { justify-content: center; padding: 0; }
  .sg-mini .sg-brand-text, .sg-mini .sg-nav-t, .sg-mini .sg-nav-h, .sg-mini .sg-side-foot { display: none; }
  .sg-mini .sg-nav { padding: .5rem .7rem; }
  .sg-mini .sg-nav-link { justify-content: center; padding: .7rem 0; }
  .sg-mini .sg-nav-badge { position: absolute; top: .15rem; right: .15rem; min-width: 1.05rem; height: 1.05rem; font-size: .6rem; padding: 0 .25rem; }
}

/* Bilah atas */
.sg-topbar { position: sticky; top: 0; z-index: 1020; height: var(--sg-top-h); display: flex; align-items: center; gap: .75rem; padding: 0 1.5rem; background: rgba(243, 245, 250, .82); backdrop-filter: saturate(160%) blur(12px); -webkit-backdrop-filter: saturate(160%) blur(12px); border-bottom: 1px solid transparent; transition: border-color .2s, box-shadow .2s; }
[data-bs-theme="dark"] .sg-topbar { background: rgba(10, 15, 30, .78); }
.sg-scrolled .sg-topbar { border-bottom-color: var(--sg-line); }
.sg-top-brand { display: flex; align-items: center; gap: .55rem; font-weight: 800; font-size: 1.05rem; color: var(--sg-text); text-decoration: none; min-width: 0; flex: 1; }
.sg-top-brand .sg-brand-mark, .sg-top-brand .sg-brand-logo { width: 2rem; height: 2rem; font-size: 1.05rem; border-radius: 10px; box-shadow: none; }
.sg-top-brand small { display: block; font-size: .68rem; font-weight: 600; color: var(--sg-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sg-top-brand > span:last-child { min-width: 0; line-height: 1.1; }
.sg-top-title { font-weight: 700; font-size: 1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 1; }
.sg-top-right { margin-left: auto; display: flex; align-items: center; gap: .45rem; flex: none; }
.sg-icon-btn { width: 2.5rem; height: 2.5rem; border-radius: 12px; border: 0; background: transparent; color: var(--sg-text); display: inline-grid; place-items: center; font-size: 1.25rem; transition: background .15s; flex: none; }
.sg-icon-btn:hover { background: rgba(var(--sg-primary-rgb), .08); }
.sg-sidebar .sg-icon-btn { color: #c9d3ee; }
.sg-sidebar .sg-icon-btn:hover { background: rgba(255, 255, 255, .08); }
.sg-chip { display: inline-flex; align-items: center; gap: .45rem; padding: .35rem .8rem; border-radius: 99px; font-size: .78rem; font-weight: 600; border: 0; white-space: nowrap; }
.sg-chip-sem { background: var(--sg-surface); color: var(--sg-muted); box-shadow: inset 0 0 0 1px var(--sg-line); }
.sg-chip-sem i { color: var(--sg-primary); }
.sg-chip-role { background: var(--sg-amber-bg); color: var(--sg-amber); height: 2.3rem; }
.sg-user { display: flex; align-items: center; gap: .6rem; border: 0; background: transparent; padding: .25rem .45rem .25rem .25rem; border-radius: 99px; color: var(--sg-text); transition: background .15s; }
.sg-user:hover { background: rgba(var(--sg-primary-rgb), .07); }
.sg-avatar { width: 2.3rem; height: 2.3rem; border-radius: 50%; display: grid; place-items: center; font-weight: 800; color: #fff; background: linear-gradient(135deg, #4f7bf0, #2446b8); flex: none; box-shadow: 0 0 0 2px var(--sg-surface), 0 0 0 3px rgba(var(--sg-primary-rgb), .25); }
.sg-user-txt { flex-direction: column; align-items: flex-start; line-height: 1.15; max-width: 14rem; }
.sg-user-txt b { font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.sg-user-txt small { font-size: .72rem; color: var(--sg-muted); }
.sg-user-menu { min-width: 15rem; }

/* Konten */
.sg-content { flex: 1; padding: .5rem 1.5rem 2rem; width: 100%; max-width: 1480px; }
.sg-pagehead { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; padding: .6rem 0 1.25rem; }
.sg-title { font-size: 1.6rem; font-weight: 800; margin: 0; letter-spacing: -.025em; }
.sg-sub { color: var(--sg-muted); margin: .3rem 0 0; max-width: 70ch; }
.sg-crumbs { font-size: .78rem; margin-bottom: .35rem; --bs-breadcrumb-divider-color: var(--sg-muted); --bs-breadcrumb-item-active-color: var(--sg-muted); }
.sg-crumbs a { color: var(--sg-muted); text-decoration: none; }
.sg-crumbs a:hover { color: var(--sg-primary); }
.sg-footer { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; justify-content: space-between; padding: 1rem 1.5rem; font-size: .76rem; color: var(--sg-muted); border-top: 1px solid var(--sg-line); }

/* Navigasi bawah (ponsel) */
.sg-bottomnav { display: none; }

/* ---------- Komponen ---------- */
.card { --bs-card-bg: var(--sg-surface); border: 1px solid var(--sg-line); border-radius: var(--sg-radius); box-shadow: var(--sg-shadow); --bs-card-inner-border-radius: calc(var(--sg-radius) - 1px); }
.card-header { background: transparent; border-bottom: 1px solid var(--sg-line); font-weight: 700; padding: .95rem 1.2rem; font-size: .95rem; }
.card-header .text-secondary, .card-header .fw-normal { font-weight: 500; }
.card-body { padding: 1.2rem; }
.card-footer { background: var(--sg-surface-2); border-top: 1px solid var(--sg-line); }

.btn { --bs-btn-font-weight: 600; --bs-btn-border-radius: 11px; --bs-btn-padding-y: .5rem; --bs-btn-padding-x: .95rem; --bs-btn-font-size: .88rem; transition: background .15s, border-color .15s, box-shadow .15s, transform .05s; }
.btn:active { transform: translateY(1px); }
.btn-sm { --bs-btn-padding-y: .33rem; --bs-btn-padding-x: .6rem; --bs-btn-font-size: .8rem; --bs-btn-border-radius: 9px; }
.btn-lg { --bs-btn-padding-y: .75rem; --bs-btn-padding-x: 1.3rem; --bs-btn-font-size: 1rem; --bs-btn-border-radius: 13px; }
.btn-primary { --bs-btn-bg: var(--sg-primary); --bs-btn-border-color: var(--sg-primary); --bs-btn-hover-bg: var(--sg-primary-600); --bs-btn-hover-border-color: var(--sg-primary-600); --bs-btn-active-bg: var(--sg-primary-600); --bs-btn-active-border-color: var(--sg-primary-600); --bs-btn-disabled-bg: var(--sg-primary); --bs-btn-disabled-border-color: var(--sg-primary); box-shadow: 0 4px 12px -4px rgba(var(--sg-primary-rgb), .55); }
.btn-outline-primary { --bs-btn-color: var(--sg-primary); --bs-btn-border-color: rgba(var(--sg-primary-rgb), .35); --bs-btn-hover-bg: var(--sg-primary); --bs-btn-hover-border-color: var(--sg-primary); --bs-btn-active-bg: var(--sg-primary); --bs-btn-active-border-color: var(--sg-primary); }
.btn-outline-secondary { --bs-btn-color: var(--sg-text); --bs-btn-border-color: var(--sg-line); --bs-btn-bg: var(--sg-surface); --bs-btn-hover-bg: var(--sg-surface-2); --bs-btn-hover-color: var(--sg-text); --bs-btn-hover-border-color: #cfd5e3; --bs-btn-active-bg: var(--sg-surface-2); --bs-btn-active-color: var(--sg-text); --bs-btn-active-border-color: #cfd5e3; }
[data-bs-theme="dark"] .btn-outline-secondary { --bs-btn-hover-border-color: rgba(255, 255, 255, .2); --bs-btn-active-border-color: rgba(255, 255, 255, .2); }
.btn-outline-danger { --bs-btn-border-color: rgba(217, 45, 32, .3); }
.btn-outline-warning { --bs-btn-color: #b36b00; --bs-btn-border-color: rgba(245, 165, 36, .6); --bs-btn-hover-bg: var(--sg-accent); --bs-btn-hover-border-color: var(--sg-accent); --bs-btn-hover-color: #3b2500; --bs-btn-active-bg: var(--sg-accent); --bs-btn-active-border-color: var(--sg-accent); --bs-btn-active-color: #3b2500; }
.btn-outline-info { --bs-btn-color: #0a7597; --bs-btn-border-color: rgba(11, 127, 163, .4); --bs-btn-hover-bg: #0b7fa3; --bs-btn-hover-border-color: #0b7fa3; --bs-btn-hover-color: #fff; --bs-btn-active-bg: #0b7fa3; --bs-btn-active-border-color: #0b7fa3; --bs-btn-active-color: #fff; }
.btn-outline-success { --bs-btn-color: #0e8743; --bs-btn-hover-bg: #12a150; --bs-btn-hover-border-color: #12a150; --bs-btn-active-bg: #12a150; }
[data-bs-theme="dark"] .btn-outline-warning { --bs-btn-color: #f5b64a; }
[data-bs-theme="dark"] .btn-outline-info { --bs-btn-color: #3fc1e6; }
[data-bs-theme="dark"] .btn-outline-success { --bs-btn-color: #3ecf7c; }
.btn-outline-success { --bs-btn-border-color: rgba(18, 161, 80, .4); }
.btn-light { --bs-btn-bg: var(--sg-surface-2); --bs-btn-border-color: var(--sg-line); --bs-btn-color: var(--sg-text); --bs-btn-hover-bg: var(--sg-line); --bs-btn-hover-border-color: var(--sg-line); --bs-btn-hover-color: var(--sg-text); }
.btn-success { --bs-btn-bg: #12a150; --bs-btn-border-color: #12a150; --bs-btn-hover-bg: #0e8743; --bs-btn-hover-border-color: #0e8743; }
.btn-warning { --bs-btn-bg: var(--sg-accent); --bs-btn-border-color: var(--sg-accent); --bs-btn-color: #3b2500; --bs-btn-hover-bg: #e8961a; --bs-btn-hover-border-color: #e8961a; }
td .btn-sm, .text-nowrap > .btn-sm, .text-nowrap > form > .btn-sm { min-width: 2.1rem; }

.form-control, .form-select { border-radius: var(--sg-radius-sm); border-color: var(--sg-line); background-color: var(--sg-surface); padding: .55rem .8rem; font-size: .9rem; }
.form-select { padding-right: 2.25rem; }
.form-control-sm, .form-select-sm { padding: .35rem .6rem; font-size: .82rem; border-radius: 9px; }
.form-select-sm { padding-right: 2rem; }
.form-control:focus, .form-select:focus { border-color: var(--sg-primary); box-shadow: 0 0 0 .22rem rgba(var(--sg-primary-rgb), .16); }
.form-label { font-weight: 600; font-size: .84rem; margin-bottom: .35rem; }
.form-text { font-size: .78rem; color: var(--sg-muted); }
.form-check-input { border-color: #b9c1d3; }
.form-check-input:checked { background-color: var(--sg-primary); border-color: var(--sg-primary); }
.form-check-input:focus { box-shadow: 0 0 0 .2rem rgba(var(--sg-primary-rgb), .18); }
.input-group-text { background: var(--sg-surface-2); border-color: var(--sg-line); color: var(--sg-muted); }
.search-box { max-width: 330px; flex: 1 1 220px; }
.search-box .input-group-text { border-right: 0; background: var(--sg-surface); padding-right: .35rem; }
.search-box .form-control { border-left: 0; padding-left: .2rem; }
.search-box:focus-within .input-group-text { border-color: var(--sg-primary); }

/* Lencana: gaya lembut */
.badge { font-weight: 700; font-size: .72rem; padding: .36em .65em; border-radius: 7px; letter-spacing: .01em; }
.badge.text-bg-success { background: var(--sg-green-bg) !important; color: var(--sg-green) !important; }
.badge.text-bg-warning { background: var(--sg-amber-bg) !important; color: var(--sg-amber) !important; }
.badge.text-bg-danger { background: var(--sg-red-bg) !important; color: var(--sg-red) !important; }
.badge.text-bg-info { background: var(--sg-cyan-bg) !important; color: var(--sg-cyan) !important; }
.badge.text-bg-primary { background: var(--sg-blue-bg) !important; color: var(--sg-blue) !important; }
.badge.text-bg-secondary { background: var(--sg-gray-bg) !important; color: var(--sg-gray) !important; }
.badge.text-bg-light { background: var(--sg-surface-2) !important; color: var(--sg-muted) !important; border: 1px solid var(--sg-line); }
.badge-soft-warning { background: var(--sg-amber-bg); color: var(--sg-amber); }
.badge-soft-primary { background: var(--sg-blue-bg); color: var(--sg-blue); }
.badge-dot::before { content: ''; display: inline-block; width: .45rem; height: .45rem; border-radius: 50%; background: currentColor; margin-right: .35rem; vertical-align: .05em; }

/* Peringatan */
.alert { border-radius: 14px; border: 1px solid transparent; font-size: .88rem; padding: .85rem 1rem; }
.alert.sg-alert, .alert.d-flex, .alert:has(> .bi:first-child) { display: flex; gap: .7rem; align-items: flex-start; }
.alert:has(> .bi:first-child) > .btn { flex: none; align-self: center; }
.alert > .bi:first-child, .alert.sg-alert > .bi { font-size: 1.1rem; line-height: 1.25; flex: none; }
.alert-dismissible { padding-right: 3rem; }
.alert-success { background: var(--sg-green-bg); color: var(--sg-text); border-color: rgba(18, 161, 80, .25); } .alert-success > .bi { color: var(--sg-green); }
.alert-danger { background: var(--sg-red-bg); color: var(--sg-text); border-color: rgba(217, 45, 32, .22); } .alert-danger > .bi { color: var(--sg-red); }
.alert-warning { background: var(--sg-amber-bg); color: var(--sg-text); border-color: rgba(245, 165, 36, .35); } .alert-warning > .bi { color: var(--sg-amber); }
.alert-info { background: var(--sg-blue-bg); color: var(--sg-text); border-color: rgba(36, 83, 214, .2); } .alert-info > .bi { color: var(--sg-blue); }
.alert-secondary { background: var(--sg-surface-2); color: var(--sg-text); border-color: var(--sg-line); }
.alert a:not(.btn) { font-weight: 600; }

/* Tabel */
.table { --bs-table-bg: transparent; --bs-table-color: var(--sg-text); --bs-table-border-color: var(--sg-line); margin-bottom: 0; font-size: .88rem; }
.table > :not(caption) > * > * { padding: .8rem .85rem; }
.table thead th { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--sg-muted); background: var(--sg-surface-2); border-bottom: 1px solid var(--sg-line); white-space: nowrap; }
.table thead th:first-child { border-top-left-radius: 10px; }
.table thead th:last-child { border-top-right-radius: 10px; }
.table-hover > tbody > tr:hover > * { --bs-table-hover-bg: rgba(var(--sg-primary-rgb), .035); --bs-table-accent-bg: rgba(var(--sg-primary-rgb), .035); }
.table tbody tr:last-child > * { border-bottom: 0; }
.table-sm > :not(caption) > * > * { padding: .5rem .6rem; }
.table-bordered > :not(caption) > * > * { border-width: 0 1px 1px 0; }
.table-bordered { border: 1px solid var(--sg-line); border-radius: 10px; border-collapse: separate; border-spacing: 0; overflow: hidden; }
.table-bordered > :not(caption) > * > :last-child { border-right: 0; }
.table-striped > tbody > tr:nth-of-type(odd) > * { --bs-table-bg-type: var(--sg-surface-2); }
.table-light { --bs-table-bg: var(--sg-surface-2); --bs-table-color: var(--sg-muted); }
.table-responsive { border-radius: 10px; }

.toolbar { display: flex; flex-wrap: wrap; gap: .65rem; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.toolbar .filters { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; flex: 1 1 auto; }
.bulkbar { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; padding: .6rem .75rem; margin-bottom: 1rem; border-radius: 12px; background: rgba(var(--sg-primary-rgb), .06); border: 1px dashed rgba(var(--sg-primary-rgb), .25); }

.empty-state { text-align: center; padding: 2.6rem 1rem; }
.empty-ico { width: 4rem; height: 4rem; border-radius: 20px; display: inline-grid; place-items: center; font-size: 1.7rem; margin-bottom: .8rem; color: var(--sg-primary); background: linear-gradient(135deg, rgba(var(--sg-primary-rgb), .14), rgba(var(--sg-primary-rgb), .04)); }
.empty-t { font-weight: 700; font-size: 1rem; }
.empty-d { color: var(--sg-muted); font-size: .85rem; margin-top: .25rem; }

/* Kartu statistik */
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
.stat-card { position: relative; display: flex; align-items: center; gap: .95rem; padding: 1.1rem 1.15rem; background: var(--sg-surface); border: 1px solid var(--sg-line); border-radius: var(--sg-radius); box-shadow: var(--sg-shadow); overflow: hidden; color: inherit; text-decoration: none; transition: transform .15s, box-shadow .15s; }
a.stat-card:hover { transform: translateY(-2px); box-shadow: var(--sg-shadow-lg); color: inherit; }
.stat-card::after { content: ''; position: absolute; right: -1.8rem; top: -1.8rem; width: 5.5rem; height: 5.5rem; border-radius: 50%; background: var(--tone-bg); opacity: .6; }
.stat-ico { width: 2.9rem; height: 2.9rem; border-radius: 14px; display: grid; place-items: center; font-size: 1.3rem; flex: none; color: var(--tone); background: var(--tone-bg); }
.stat-val { font-size: 1.55rem; font-weight: 800; line-height: 1.05; letter-spacing: -.02em; white-space: nowrap; }
.stat-lbl { font-size: .78rem; color: var(--sg-muted); margin-top: .25rem; font-weight: 500; }
.tone-teal { --tone: var(--sg-green); --tone-bg: var(--sg-green-bg); }
.tone-blue { --tone: var(--sg-blue); --tone-bg: var(--sg-blue-bg); }
.tone-gold { --tone: var(--sg-amber); --tone-bg: var(--sg-amber-bg); }
.tone-rose { --tone: var(--sg-red); --tone-bg: var(--sg-red-bg); }
.tone-violet { --tone: var(--sg-violet); --tone-bg: var(--sg-violet-bg); }
.tone-cyan { --tone: var(--sg-cyan); --tone-bg: var(--sg-cyan-bg); }

/* Tab / pil */
.nav-pills { gap: .35rem; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding: .3rem; background: var(--sg-surface); border: 1px solid var(--sg-line); border-radius: 14px; display: inline-flex; max-width: 100%; }
.nav-pills::-webkit-scrollbar { display: none; }
.nav-pills .nav-link { border-radius: 10px; color: var(--sg-muted); font-weight: 600; font-size: .85rem; padding: .45rem .9rem; white-space: nowrap; }
.nav-pills .nav-link:hover { color: var(--sg-text); background: var(--sg-surface-2); }
.nav-pills .nav-link.active { background: var(--sg-primary); color: #fff; box-shadow: 0 4px 10px -4px rgba(var(--sg-primary-rgb), .6); }
.nav-pills .nav-link.active .badge { background: rgba(255, 255, 255, .22) !important; color: #fff !important; border-color: transparent; }

.pagination { --bs-pagination-border-radius: 9px; --bs-pagination-color: var(--sg-text); --bs-pagination-bg: var(--sg-surface); --bs-pagination-border-color: var(--sg-line); --bs-pagination-active-bg: var(--sg-primary); --bs-pagination-active-border-color: var(--sg-primary); gap: .25rem; }
.pagination .page-link { border-radius: 9px !important; min-width: 2.1rem; text-align: center; }

.dropdown-menu { border-radius: 14px; border-color: var(--sg-line); box-shadow: var(--sg-shadow-lg); padding: .4rem; --bs-dropdown-bg: var(--sg-surface); }
.dropdown-item { border-radius: 9px; padding: .5rem .75rem; font-size: .88rem; }
.dropdown-item.active, .dropdown-item:active { background: var(--sg-primary); }

.modal-content { border: 0; border-radius: 20px; box-shadow: 0 30px 60px -20px rgba(8, 13, 30, .45); background: var(--sg-surface); }
.modal-header { border-bottom: 1px solid var(--sg-line); padding: 1.05rem 1.3rem; }
.modal-title { font-weight: 800; font-size: 1.08rem; }
.modal-body { padding: 1.3rem; }
.modal-footer { border-top: 1px solid var(--sg-line); padding: .85rem 1.3rem; gap: .5rem; }
.modal-footer > * { margin: 0; }
.modal-backdrop.show { opacity: .45; }
.progress { background: var(--sg-surface-2); border-radius: 99px; }
.progress-bar { border-radius: 99px; }
.bg-success { background-color: var(--sg-green) !important; }
.text-success { color: var(--sg-green) !important; }
.text-danger { color: var(--sg-red) !important; }
.text-warning { color: var(--sg-amber) !important; }
.text-primary { color: var(--sg-primary) !important; }
.text-secondary, .text-body-secondary { color: var(--sg-muted) !important; }
hr { border-color: var(--sg-line); opacity: 1; }
.border, .border-top, .border-bottom { border-color: var(--sg-line) !important; }
.bg-success-subtle { background: var(--sg-green-bg) !important; }
.border-success { border-color: rgba(18, 161, 80, .45) !important; }
.list-row { display: flex; justify-content: space-between; align-items: center; gap: .75rem; padding: .7rem 0; border-bottom: 1px solid var(--sg-line); }
.list-row:last-child { border-bottom: 0; padding-bottom: 0; }
.list-row:first-child { padding-top: 0; }

/* Kotak konfirmasi */
.sg-confirm .modal-body { text-align: center; padding: 1.8rem 1.5rem 1.2rem; }
.sg-confirm .c-ico { width: 3.6rem; height: 3.6rem; border-radius: 18px; display: inline-grid; place-items: center; font-size: 1.6rem; margin-bottom: .9rem; background: var(--sg-amber-bg); color: var(--sg-amber); }
.sg-confirm .c-ico.danger { background: var(--sg-red-bg); color: var(--sg-red); }
.sg-confirm .modal-footer { border: 0; justify-content: center; padding-top: 0; padding-bottom: 1.4rem; }
.sg-confirm .modal-footer .btn { min-width: 8rem; }

/* ---------- Jadwal & kartu sesi ---------- */
.tl { list-style: none; margin: 0; padding: 0; }
.tl-item { display: grid; grid-template-columns: 4.3rem 1fr; gap: .9rem; padding: .35rem 0; }
.tl-time { text-align: right; padding-top: .85rem; font-weight: 700; font-size: .88rem; }
.tl-time small { display: block; font-weight: 500; color: var(--sg-muted); font-size: .72rem; }
.tl-card { position: relative; border: 1px solid var(--sg-line); border-radius: 14px; padding: .85rem 1rem; background: var(--sg-surface); }
.tl-card::before { content: ''; position: absolute; left: -1px; top: .8rem; bottom: .8rem; width: 4px; border-radius: 0 4px 4px 0; background: var(--sg-primary); }
.tl-card.now { background: linear-gradient(90deg, rgba(245, 165, 36, .1), transparent 70%); border-color: rgba(245, 165, 36, .45); }
.tl-card.now::before { background: var(--sg-accent); }
.tl-card.done::before { background: #9aa4b8; }
.tl-card .t { font-weight: 700; }
.tl-card .m { color: var(--sg-muted); font-size: .8rem; }

.ka-card { height: 100%; transition: transform .15s, box-shadow .15s; }
.ka-card:hover { transform: translateY(-2px); box-shadow: var(--sg-shadow-lg); }
.ka-card .ka-top { display: flex; justify-content: space-between; gap: .6rem; }
.ka-card .ka-kelas { font-weight: 800; font-size: 1.3rem; letter-spacing: -.02em; }
.ka-meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .45rem .9rem; font-size: .8rem; color: var(--sg-muted); margin: .9rem 0 1rem; padding: .75rem .85rem; background: var(--sg-surface-2); border-radius: 12px; }
.ka-meta b { color: var(--sg-text); }

.day-col { border: 1px solid var(--sg-line); border-radius: var(--sg-radius); background: var(--sg-surface); height: 100%; box-shadow: var(--sg-shadow); overflow: hidden; }
.day-col .day-h { padding: .8rem 1rem; font-weight: 800; border-bottom: 1px solid var(--sg-line); background: var(--sg-surface-2); }
.day-col.today { border-color: rgba(245, 165, 36, .55); }
.day-col.today .day-h { background: var(--sg-amber-bg); }
.slot { padding: .8rem 1rem; border-bottom: 1px dashed var(--sg-line); }
.slot:last-child { border-bottom: 0; }
.slot .s-time { font-size: .74rem; color: var(--sg-primary); font-weight: 700; }

/* Absensi H S I A */
.abs-group { display: inline-flex; gap: .25rem; padding: .2rem; border-radius: 12px; background: var(--sg-surface-2); border: 1px solid var(--sg-line); }
.abs-group input { position: absolute; opacity: 0; pointer-events: none; }
.abs-group label { min-width: 2.2rem; height: 2.1rem; display: grid; place-items: center; cursor: pointer; font-weight: 800; font-size: .8rem; margin: 0; border-radius: 9px; color: var(--sg-muted); user-select: none; transition: background .12s, color .12s; }
.abs-group label:hover { background: var(--sg-surface); color: var(--sg-text); }
.abs-group input:checked + label.l-H { background: var(--sg-green); color: #fff; }
.abs-group input:checked + label.l-S { background: #e0a100; color: #fff; }
.abs-group input:checked + label.l-I { background: var(--sg-blue); color: #fff; }
.abs-group input:checked + label.l-A { background: var(--sg-red); color: #fff; }
.abs-group input:focus-visible + label { outline: 2px solid var(--sg-primary); outline-offset: 1px; }
.abs-row { display: flex; justify-content: space-between; align-items: center; gap: .6rem; padding: .55rem 0; border-bottom: 1px solid var(--sg-line); }
.abs-row:last-child { border-bottom: 0; }
.abs-nama { font-weight: 600; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.abs-no { display: inline-grid; place-items: center; width: 1.8rem; height: 1.8rem; border-radius: 8px; background: var(--sg-surface-2); font-size: .75rem; font-weight: 700; color: var(--sg-muted); flex: none; }
.abs-count { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; margin-bottom: 1rem; }
.abs-count > div { text-align: center; padding: .55rem .3rem; border-radius: 12px; font-size: .72rem; font-weight: 600; }
.abs-count b { display: block; font-size: 1.2rem; font-weight: 800; }
.abs-count .c-H { background: var(--sg-green-bg); color: var(--sg-green); }
.abs-count .c-S { background: var(--sg-amber-bg); color: var(--sg-amber); }
.abs-count .c-I { background: var(--sg-blue-bg); color: var(--sg-blue); }
.abs-count .c-A { background: var(--sg-red-bg); color: var(--sg-red); }
.nilai-input { width: 5.5rem; text-align: center; font-weight: 700; }

/* ---------- Pemantauan harian ---------- */
.pm-slot { margin-bottom: 1.5rem; }
.pm-slot-h { display: flex; align-items: center; gap: .75rem; margin-bottom: .75rem; }
.pm-slot-h .ke { font-weight: 800; font-size: .95rem; }
.pm-slot-h .jam { font-size: .8rem; color: var(--sg-muted); font-weight: 600; }
.pm-slot-h .line { flex: 1; height: 1px; background: var(--sg-line); }
.pm-slot-h .now { font-size: .7rem; }
.pm-card { height: 100%; border: 1px solid var(--sg-line); border-radius: var(--sg-radius); background: var(--sg-surface); box-shadow: var(--sg-shadow); padding: 1rem; display: flex; flex-direction: column; gap: .7rem; position: relative; }
.pm-card.st-ok { border-color: rgba(18, 161, 80, .35); }
.pm-card.st-wait { border-color: rgba(245, 165, 36, .5); box-shadow: 0 0 0 3px rgba(245, 165, 36, .08), var(--sg-shadow); }
.pm-card.st-none { border-style: dashed; }
.pm-kelas { display: inline-grid; place-items: center; min-width: 3rem; height: 3rem; padding: 0 .5rem; border-radius: 14px; font-weight: 800; font-size: .95rem; background: var(--sg-blue-bg); color: var(--sg-blue); flex: none; }
.pm-guru { font-weight: 700; line-height: 1.25; }
.pm-mapel { font-size: .8rem; color: var(--sg-muted); }
.pm-status { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; font-size: .78rem; }
.pm-note { font-size: .78rem; color: var(--sg-muted); background: var(--sg-surface-2); border-radius: 10px; padding: .45rem .6rem; }
.pm-actions { margin-top: auto; }
.st-choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .4rem; }
.st-choices .btn { font-size: .8rem; padding: .5rem .3rem; }
.pm-legend { display: flex; flex-wrap: wrap; gap: .5rem 1rem; font-size: .78rem; color: var(--sg-muted); }
.pm-legend span::before { content: ''; display: inline-block; width: .65rem; height: .65rem; border-radius: 3px; margin-right: .35rem; vertical-align: -.05em; }
.pm-legend .l-ok::before { background: var(--sg-green); } .pm-legend .l-wait::before { background: var(--sg-accent); } .pm-legend .l-none::before { border: 1px dashed var(--sg-muted); }
.day-strip { display: flex; gap: .4rem; overflow-x: auto; scrollbar-width: none; padding-bottom: .15rem; }
.day-strip::-webkit-scrollbar { display: none; }
.day-strip a { flex: none; text-align: center; min-width: 3.6rem; padding: .45rem .5rem; border-radius: 13px; background: var(--sg-surface); border: 1px solid var(--sg-line); text-decoration: none; color: var(--sg-text); line-height: 1.15; transition: border-color .15s, background .15s; }
.day-strip a small { display: block; font-size: .66rem; color: var(--sg-muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.day-strip a b { font-size: 1.05rem; }
.day-strip a:hover { border-color: rgba(var(--sg-primary-rgb), .45); }
.day-strip a.active { background: var(--sg-primary); border-color: var(--sg-primary); color: #fff; box-shadow: 0 6px 14px -6px rgba(var(--sg-primary-rgb), .7); }
.day-strip a.active small { color: rgba(255, 255, 255, .8); }
.day-strip a.duty:not(.active) { border-color: rgba(245, 165, 36, .6); }
.day-strip a.duty i { color: var(--sg-accent); font-size: .6rem; }

/* Penugasan pengawas */
.duty-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.duty-day { border: 1px solid var(--sg-line); border-radius: var(--sg-radius); background: var(--sg-surface); box-shadow: var(--sg-shadow); display: flex; flex-direction: column; }
.duty-day.today { border-color: rgba(245, 165, 36, .6); }
.duty-day-h { display: flex; justify-content: space-between; align-items: center; padding: .8rem 1rem; border-bottom: 1px solid var(--sg-line); font-weight: 800; }
.duty-day-b { padding: .8rem 1rem; flex: 1; display: flex; flex-direction: column; gap: .45rem; }
.duty-person { display: flex; align-items: center; gap: .6rem; padding: .45rem .55rem; border-radius: 11px; background: var(--sg-surface-2); }
.duty-person .sg-avatar { width: 1.9rem; height: 1.9rem; font-size: .78rem; box-shadow: none; }
.duty-person .nm { font-weight: 600; font-size: .85rem; line-height: 1.2; min-width: 0; flex: 1; }
.duty-person .nm small { display: block; font-weight: 500; color: var(--sg-muted); font-size: .72rem; }

.role-pick { display: inline-block; }
.print-only { display: none; }

/* ---------- Halaman masuk ---------- */
.login { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); background: var(--sg-surface); }
.login-hero { position: relative; overflow: hidden; color: #fff; padding: 2.2rem 3rem; display: flex; flex-direction: column; justify-content: space-between; gap: 1.5rem;
  background:
    radial-gradient(38rem 26rem at 105% -5%, rgba(91, 130, 240, .55), transparent 60%),
    radial-gradient(30rem 22rem at -10% 110%, rgba(245, 165, 36, .22), transparent 60%),
    linear-gradient(160deg, #0f1d44 0%, #0b1533 100%); }
.login-hero::before { content: ''; position: absolute; inset: 0; background-image: radial-gradient(rgba(255, 255, 255, .09) 1px, transparent 1px); background-size: 22px 22px; mask-image: linear-gradient(180deg, #000 20%, transparent 85%); -webkit-mask-image: linear-gradient(180deg, #000 20%, transparent 85%); pointer-events: none; }
.login-hero > * { position: relative; }
.login-brand { display: flex; align-items: center; gap: .8rem; }
.login-brand .sg-brand-mark, .login-brand .sg-brand-logo { width: 2.8rem; height: 2.8rem; }
.login-brand b { font-size: 1.25rem; font-weight: 800; display: block; line-height: 1.1; }
.login-brand small { color: #a8b6de; font-size: .8rem; }
.login-hero h1 { color: #fff; font-size: clamp(1.9rem, 3vw, 2.7rem); line-height: 1.12; font-weight: 800; letter-spacing: -.03em; margin: 0 0 .9rem; max-width: 18ch; }
.login-hero h1 span { background: linear-gradient(90deg, #ffd27a, var(--sg-accent)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.login-hero .lead { color: #c3cdea; font-size: 1rem; max-width: 38ch; margin: 0; }
.login-feats { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.4rem; }
.login-feats span { display: inline-flex; align-items: center; gap: .45rem; font-size: .8rem; font-weight: 600; padding: .45rem .8rem; border-radius: 99px; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .12); color: #e3e9fa; }
.login-feats i { color: var(--sg-accent); }
.mock { position: relative; max-width: 30rem; margin-top: 1.8rem; }
.mock-card { background: rgba(255, 255, 255, .96); color: #111a2e; border-radius: 18px; padding: 1rem 1.1rem; box-shadow: 0 30px 50px -25px rgba(0, 0, 0, .7); }
.mock-card .mh { display: flex; justify-content: space-between; align-items: center; margin-bottom: .7rem; font-size: .78rem; color: #667085; font-weight: 600; }
.mock-card .mh b { color: #111a2e; font-size: .92rem; }
.mock-row { display: grid; grid-template-columns: 2.6rem 1fr auto; gap: .7rem; align-items: center; padding: .55rem 0; border-top: 1px solid #eef0f5; }
.mock-row .k { height: 2.6rem; border-radius: 11px; display: grid; place-items: center; font-weight: 800; font-size: .72rem; background: rgba(36, 83, 214, .1); color: #2453d6; }
.mock-row .g { font-weight: 700; font-size: .82rem; line-height: 1.2; }
.mock-row .g small { display: block; color: #667085; font-weight: 500; font-size: .72rem; }
.mock-row .s { font-size: .68rem; font-weight: 800; padding: .3rem .55rem; border-radius: 7px; }
.mock-row .s.ok { background: rgba(18, 161, 80, .12); color: #0e8743; }
.mock-row .s.wait { background: rgba(245, 165, 36, .2); color: #a86400; }
.mock-row .s.late { background: rgba(217, 45, 32, .1); color: #c0271b; }
.mock-float { position: absolute; right: -1.2rem; bottom: -1.3rem; background: #fff; color: #111a2e; border-radius: 14px; padding: .6rem .8rem; display: flex; gap: .6rem; align-items: center; box-shadow: 0 20px 40px -18px rgba(0, 0, 0, .6); font-size: .78rem; font-weight: 700; }
.mock-float i { width: 2rem; height: 2rem; border-radius: 10px; display: grid; place-items: center; background: rgba(18, 161, 80, .14); color: #12a150; font-size: 1rem; }
.mock-float small { display: block; color: #667085; font-weight: 500; }
.kutipan { margin: 0; padding-left: 1rem; border-left: 3px solid var(--sg-accent); max-width: 34rem; }
.kutipan blockquote { margin: 0; font-size: .9rem; line-height: 1.55; color: #c3cdea; transition: opacity .45s ease; min-height: 2.8rem; }
.login-foot { color: #7f8fbf; font-size: .78rem; }
.login-side { display: grid; place-items: center; padding: 2rem 1.5rem; background: var(--sg-surface); }
.login-card { width: 100%; max-width: 24rem; }
.login-card h2 { font-size: 1.7rem; font-weight: 800; letter-spacing: -.025em; margin-bottom: .35rem; }
.login-card .form-control { padding: .7rem .9rem; font-size: .95rem; }
.login-card .input-group-text { background: var(--sg-surface); padding: 0 .85rem; border-right: 0; }
.login-card .input-group .form-control { border-left: 0; padding-left: .2rem; }
.login-card .input-group:focus-within .input-group-text { border-color: var(--sg-primary); color: var(--sg-primary); }
.login-card .input-group .form-control:focus { box-shadow: none; }
.login-card .input-group:focus-within { box-shadow: 0 0 0 .22rem rgba(var(--sg-primary-rgb), .16); border-radius: var(--sg-radius-sm); }
.login-card .pw-toggle { border: 1px solid var(--sg-line); border-left: 0; background: var(--sg-surface); color: var(--sg-muted); padding: 0 .85rem; border-radius: 0 var(--sg-radius-sm) var(--sg-radius-sm) 0; }
.login-card .input-group:focus-within .pw-toggle { border-color: var(--sg-primary); }
.login-card .input-group .form-control.has-toggle { border-right: 0; }
.login-card .btn-primary { padding: .8rem 1rem; font-size: .95rem; }
.login-help { display: flex; gap: .6rem; align-items: flex-start; margin-top: 1.5rem; padding: .8rem .9rem; border-radius: 12px; background: var(--sg-surface-2); font-size: .8rem; color: var(--sg-muted); }
.login-help i { color: var(--sg-primary); font-size: 1rem; }
.login-mobile-brand { display: none; }
@media (min-width: 992px) {
  .login { height: 100vh; height: 100dvh; }
  .login-hero { overflow: hidden; }
}
@media (min-width: 992px) and (max-height: 700px) { .mock { display: none; } }
@media (max-width: 991.98px) {
  .login { grid-template-columns: 1fr; align-content: start; }
  .login-hero { padding: 1.3rem 1.25rem 3.4rem; gap: .8rem; }
  .login-hero h1 { font-size: 1.55rem; margin-bottom: .4rem; }
  .login-hero .lead { font-size: .88rem; }
  .login-hero .mock, .login-hero .kutipan, .login-hero .login-foot, .login-feats { display: none; }
  .login-side { place-items: start center; padding: 0 1rem 2rem; background: transparent; margin-top: -2.2rem; position: relative; }
  .login-card { background: var(--sg-surface); border-radius: 22px; padding: 1.6rem 1.35rem; box-shadow: var(--sg-shadow-lg); border: 1px solid var(--sg-line); }
  .login { background: var(--sg-page); }
}

/* ---------- Responsif ---------- */
@media (max-width: 1199.98px) {
  .duty-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 991.98px) {
  :root { --sg-top-h: 58px; }
  .sg-sidebar { transform: translateX(-102%); width: min(84vw, 300px); box-shadow: var(--sg-shadow-lg); }
  .sg-open .sg-sidebar { transform: none; }
  .sg-open .sg-backdrop { opacity: 1; visibility: visible; }
  .sg-open body, body.sg-open { overflow: hidden; }
  .sg-main { margin-left: 0; }
  .sg-topbar { padding: 0 .75rem; gap: .4rem; }
  .sg-content { padding: .25rem 1rem calc(6rem + env(safe-area-inset-bottom)); }
  .sg-pagehead { padding: .5rem 0 1rem; }
  .sg-title { font-size: 1.35rem; }
  .sg-crumbs { display: none; }
  .sg-footer { padding: 1rem 1rem calc(5.5rem + env(safe-area-inset-bottom)); }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
  .sg-bottomnav { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; position: fixed; left: .6rem; right: .6rem; bottom: calc(.6rem + env(safe-area-inset-bottom)); z-index: 1030; background: rgba(255, 255, 255, .92); backdrop-filter: saturate(180%) blur(14px); -webkit-backdrop-filter: saturate(180%) blur(14px); border: 1px solid var(--sg-line); border-radius: 20px; box-shadow: 0 14px 34px -12px rgba(16, 24, 40, .35); padding: .35rem; }
  [data-bs-theme="dark"] .sg-bottomnav { background: rgba(18, 26, 47, .92); }
  .sg-bottomnav a, .sg-bottomnav button { display: flex; flex-direction: column; align-items: center; gap: .15rem; padding: .35rem .2rem; border: 0; background: transparent; color: var(--sg-muted); text-decoration: none; font-size: .66rem; font-weight: 700; border-radius: 14px; }
  .sg-bottomnav .sg-bn-ico { position: relative; font-size: 1.2rem; line-height: 1; width: 2.6rem; height: 1.8rem; display: grid; place-items: center; border-radius: 99px; transition: background .15s; }
  .sg-bottomnav .sg-bn-ico em { position: absolute; top: -.25rem; right: .05rem; font-style: normal; font-size: .58rem; min-width: 1rem; height: 1rem; padding: 0 .2rem; border-radius: 99px; background: var(--sg-red); color: #fff; display: grid; place-items: center; }
  .sg-bottomnav .active { color: var(--sg-primary); }
  .sg-bottomnav .active .sg-bn-ico { background: rgba(var(--sg-primary-rgb), .12); }
}
@media (max-width: 767.98px) {
  .duty-grid { grid-template-columns: 1fr; }
  .card-body { padding: 1rem; }
  .card-header { padding: .85rem 1rem; }
  .toolbar { align-items: stretch; }
  .toolbar > .btn, .toolbar > a.btn { flex: 1 1 auto; }
  .toolbar .filters { width: 100%; }
  .toolbar .filters > .form-select, .toolbar .filters > .form-control, .toolbar .filters > .search-box { flex: 1 1 100%; max-width: none !important; min-width: 0 !important; }
  .toolbar > .d-flex { width: 100%; }
  .toolbar > .d-flex > .btn { flex: 1 1 auto; }
  .search-box { max-width: none; }
  .nav-pills { display: flex; }
  .sg-user { padding: .15rem; }

  /* Tabel menjadi kartu bertumpuk */
  .table-stack thead { display: none; }
  .table-stack, .table-stack tbody, .table-stack tr, .table-stack td { display: block; width: 100%; }
  .table-stack tr { position: relative; display: flex; flex-direction: column; border: 1px solid var(--sg-line); border-radius: 14px; padding: .6rem .9rem; margin-bottom: .7rem; background: var(--sg-surface); box-shadow: var(--sg-shadow); }
  .table-stack tr:last-child { margin-bottom: 0; }
  .table-stack > tbody > tr > td { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .3rem 0 !important; font-size: .86rem; border: 0 !important; text-align: right; min-height: 0; background: transparent !important; box-shadow: none !important; }
  .table-stack > tbody > tr > td::before { content: attr(data-label); flex: none; max-width: 45%; text-align: left; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--sg-muted); }
  .table-stack > tbody > tr > td[data-label=""]::before { display: none; }
  .table-stack > tbody > tr > td.st-main { order: -1; display: block; text-align: left; padding: .15rem 2.2rem .5rem 0 !important; margin-bottom: .3rem; border-bottom: 1px dashed var(--sg-line) !important; font-size: .92rem; }
  .table-stack > tbody > tr > td.st-main::before { display: none; }
  .table-stack > tbody > tr > td.st-check { position: absolute; top: .75rem; right: .9rem; width: auto; padding: 0 !important; }
  .table-stack > tbody > tr > td.st-check .form-check-input { width: 1.25rem; height: 1.25rem; }
  .table-stack > tbody > tr > td.st-check::before { display: none; }
  .table-stack > tbody > tr > td.text-end:last-child { order: 99; justify-content: flex-end; flex-wrap: wrap; padding-top: .6rem !important; margin-top: .25rem; border-top: 1px dashed var(--sg-line) !important; }
  .table-stack > tbody > tr > td.text-end:last-child::before { display: none; }
  .table-stack > tbody > tr > td > * { min-width: 0; }
  .table-stack > tbody > tr > td.d-none { display: none !important; }
  .table-stack .text-truncate { white-space: normal; }
  .table-stack td[style] { max-width: none !important; min-width: 0 !important; }
  .table-responsive:has(> .table-stack) { overflow: visible; }

  /* Dialog menjadi lembar bawah */
  .modal-dialog { margin: 0; max-width: none; min-height: 100%; display: flex; align-items: flex-end; }
  .modal.fade .modal-dialog { transform: translateY(40px); }
  .modal.show .modal-dialog { transform: none; }
  .modal-dialog-scrollable { height: 100%; }
  .modal-content { border-radius: 22px 22px 0 0; max-height: 92vh; width: 100%; padding-bottom: env(safe-area-inset-bottom); }
  .modal-content::before { content: ''; width: 2.6rem; height: .3rem; border-radius: 99px; background: var(--sg-line); position: absolute; top: .45rem; left: 50%; transform: translateX(-50%); }
  .modal-header { padding-top: 1.35rem; }
  .modal-footer { flex-wrap: nowrap; }
  .modal-footer > .btn { flex: 1; }
  .sg-confirm .modal-dialog { align-items: flex-end; }

  .tl-item { grid-template-columns: 3.3rem 1fr; gap: .6rem; }
  .tl-time { font-size: .8rem; }
  .abs-group { gap: .15rem; }
  .abs-group label { min-width: 2.05rem; height: 2.3rem; }
  .abs-row { gap: .4rem; }
  .sg-title { font-size: 1.25rem; }
}
@media (max-width: 380px) {
  .stat-card { padding: .85rem; gap: .65rem; }
  .stat-ico { width: 2.4rem; height: 2.4rem; font-size: 1.1rem; }
  .stat-val { font-size: 1.25rem; }
}

@media print {
  @page { margin: 14mm; }
  .no-print, .sg-sidebar, .sg-topbar, .sg-footer, .sg-pagehead, .sg-bottomnav, .sg-backdrop { display: none !important; }
  .print-only { display: block !important; }
  .sg-main { margin: 0 !important; }
  .sg-content { padding: 0 !important; max-width: none; }
  body.sg { background: #fff !important; color: #000; }
  .card { border: 0; box-shadow: none; }
  .card-body { padding: 0; }
  .table { font-size: 11px; }
  .table thead th { background: #eee !important; color: #000; }
  .badge { border: 1px solid #999; color: #000 !important; background: transparent !important; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }

/* Bilah aksi lengket di bawah formulir panjang */
.sticky-actions { position: sticky; bottom: 0; z-index: 900; display: flex; gap: .6rem; justify-content: flex-end; margin: 1rem -1.5rem 0; padding: .85rem 1.5rem; background: rgba(243, 245, 250, .9); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-top: 1px solid var(--sg-line); }
[data-bs-theme="dark"] .sticky-actions { background: rgba(10, 15, 30, .88); }
@media (max-width: 991.98px) {
  .sticky-actions { bottom: calc(4.6rem + env(safe-area-inset-bottom)); margin: 1rem 0 0; padding: .7rem; border: 1px solid var(--sg-line); border-radius: 16px; box-shadow: var(--sg-shadow-lg); }
  .sticky-actions .btn { flex: 1; }
}
