﻿:root {
    --app-primary: #0f766e;
    --app-primary-dark: #115e59;
    --app-secondary: #0891b2;
    --app-accent: #22c55e;
    --app-bg: #eef5ff;
    --app-bg-soft: #f8fbff;
    --app-text: #0f172a;
    --card-bg: rgba(255, 255, 255, 0.92);
    --card-border: rgba(148, 163, 184, 0.18);
    --table-head: #f1f5f9;
    --font-sans: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 18px;
    --shadow-card: 0 8px 26px rgba(15, 23, 42, 0.07);
    --shadow-card-hover: 0 16px 36px rgba(15, 23, 42, 0.11);
    /* Sidebar & menu — latar netral, aksen hijau hanya saat hover */
    --app-nav-surface: #ffffff;
    --app-nav-surface-hover: #ecfdf5;
    --app-nav-border: rgba(148, 163, 184, 0.28);
    --app-nav-text: #1e293b;
    --app-nav-muted: #64748b;
    --app-nav-icon-bg: #f1f5f9;
    --app-nav-icon-border: rgba(148, 163, 184, 0.32);
    --app-nav-active-shadow: 0 8px 22px rgba(14, 116, 144, 0.28);
}

body {
    font-family: var(--font-sans);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-size: 0.875rem;
    line-height: 1.45;
    background:
        radial-gradient(1200px 420px at -8% -12%, rgba(8, 145, 178, 0.16), transparent 52%),
        radial-gradient(1000px 360px at 108% 5%, rgba(34, 197, 94, 0.11), transparent 48%),
        radial-gradient(800px 500px at 50% 100%, rgba(37, 99, 235, 0.06), transparent 55%),
        linear-gradient(180deg, var(--app-bg-soft) 0%, var(--app-bg) 100%);
    min-height: 100vh;
    min-height: 100dvh;
    color: var(--app-text);
}

.app-main h1,
.app-main .h1 {
    font-weight: 700;
    letter-spacing: -0.025em;
    line-height: 1.25;
}

.app-main h2,
.app-main .h2,
.app-main h3,
.app-main .h3,
.app-main h4,
.app-main .h4 {
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.3;
}

.app-main .text-muted {
    color: #64748b !important;
}

[data-theme="dark"] .app-main .text-muted {
    color: #94a3b8 !important;
}

/* —— Layout: sidebar tetap (desktop) + area konten luas —— */
.app-body-shell {
    overflow-x: hidden;
}

.app-frame {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
}

.app-frame-main {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.app-topbar {
    background: linear-gradient(118deg, var(--app-primary) 0%, var(--app-primary-dark) 38%, var(--app-secondary) 72%, #1d4ed8 100%) !important;
    box-shadow: 0 4px 16px rgba(14, 116, 144, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    position: sticky;
    top: 0;
    z-index: 1040;
    flex-shrink: 0;
}

.app-topbar::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(ellipse 55% 120% at 0% 50%, rgba(255, 255, 255, 0.14), transparent 55%),
        radial-gradient(ellipse 40% 90% at 100% 0%, rgba(255, 255, 255, 0.1), transparent 50%);
}

.app-topbar-inner {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: nowrap;
    min-height: 60px;
    padding: 0.5rem clamp(0.85rem, 2.5vw, 1.35rem);
}

.app-topbar .container-fluid {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: nowrap;
}

.app-topbar-left,
.app-topbar-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}

.app-topbar-left {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 0.55rem;
}

.app-topbar-right {
    flex: 0 0 auto;
    margin-left: auto;
    gap: 0.45rem;
}

.app-topbar-icon {
    font-size: 1.05rem;
    line-height: 1;
}

.app-topbar-title {
    color: #fff;
    font-weight: 600;
    letter-spacing: 0.2px;
    padding-left: 0.85rem;
    margin-left: 0.25rem;
    border-left: 1px solid rgba(255, 255, 255, 0.28);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 60vw;
}

.app-topbar-center {
    flex: 1 1 auto;
    min-width: 0;
    text-align: center;
}

.app-topbar-title-mobile {
    color: #fff;
    font-weight: 600;
    font-size: 0.92rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

.app-topbar-page {
    display: none;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 0.05rem;
    min-width: 0;
    padding-left: 0.15rem;
}

.app-topbar-page-kicker {
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.72);
}

.app-topbar-page-title {
    margin: 0;
    font-size: clamp(1rem, 1.6vw, 1.2rem);
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.02em;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: min(520px, 48vw);
}

.app-topbar-role {
    background: rgba(255, 255, 255, 0.16) !important;
    color: #fff !important;
    border: 1px solid rgba(255, 255, 255, 0.28);
    font-weight: 600;
    font-size: 0.68rem;
    letter-spacing: 0.04em;
    padding: 0.35em 0.75em;
}

.app-topbar-user-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    text-decoration: none;
    color: #fff;
    padding: 0.28rem 0.65rem 0.28rem 0.28rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.22);
    transition: background 0.18s ease, border-color 0.18s ease;
    max-width: min(240px, 36vw);
}

.app-topbar-user-pill:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.35);
}

.app-topbar-user-name {
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: min(140px, 28vw);
}

.app-topbar-user-role {
    font-size: 0.65rem;
    opacity: 0.85;
    line-height: 1.1;
}

.app-topbar-toolgroup {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    gap: 0.2rem;
    padding: 0.18rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.22);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.app-topbar-tool-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    min-height: 2.15rem;
    min-width: 2.15rem;
    padding: 0.35rem 0.6rem;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: #fff;
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.1;
    white-space: nowrap;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.app-topbar-tool-btn:hover {
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
}

.app-topbar-tool-btn:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.85);
    outline-offset: 2px;
}

.app-topbar-tool-btn__label {
    line-height: 1.1;
}

.app-topbar-vdivider {
    flex: 0 0 auto;
    align-self: stretch;
    width: 1px;
    min-height: 1.75rem;
    margin: 0.15rem 0;
    background: rgba(255, 255, 255, 0.22);
}

.app-topbar-actions {
    display: inline-flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 0.4rem;
    max-width: 100%;
}

.app-topbar-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    min-height: 2.15rem;
    padding: 0.35rem 0.65rem;
    border-radius: 10px;
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.1;
    text-decoration: none;
    white-space: nowrap;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.28);
    background: rgba(255, 255, 255, 0.1);
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.app-topbar-action-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.4);
}

.app-topbar-action-btn__label {
    max-width: 7.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Tombol menu — mobile (hamburger) & desktop (panah) */
.app-topbar-menu-btn {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0;
    margin: 0;
    border: none;
    background: transparent;
    color: #fff;
    cursor: pointer;
    transition: opacity 0.15s ease, transform 0.12s ease;
    -webkit-tap-highlight-color: transparent;
}

.app-topbar-menu-btn:active {
    transform: scale(0.96);
}

.app-topbar-menu-btn:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
    border-radius: 10px;
}

/* Mobile: tombol pill besar */
.app-topbar-menu-btn--mobile {
    min-height: 44px;
    padding: 0.4rem 0.7rem 0.4rem 0.55rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.32);
    background: rgba(255, 255, 255, 0.16);
    font-size: 0.88rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.app-topbar-menu-btn--mobile:hover {
    background: rgba(255, 255, 255, 0.26);
}

.app-topbar-menu-btn--mobile.is-open {
    background: rgba(255, 255, 255, 0.28);
    border-color: rgba(255, 255, 255, 0.45);
}

.app-topbar-menu-btn--mobile i {
    font-size: 1.05rem;
    width: 1.25rem;
    text-align: center;
}

.app-topbar-menu-btn__label {
    line-height: 1;
}

/* Desktop: satu panah di topbar hanya saat sidebar disembunyikan */
.app-topbar-menu-btn--desktop {
    width: 2.35rem;
    height: 2.35rem;
    min-width: 2.35rem;
    min-height: 2.35rem;
    margin-right: 0.35rem;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    background: rgba(255, 255, 255, 0.14);
}

.app-topbar-menu-btn--desktop:hover {
    background: rgba(255, 255, 255, 0.24);
}

.app-topbar-menu-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.65rem;
    height: 1.65rem;
    border-radius: 8px;
    background: var(--app-primary);
    color: #fff;
    font-size: 0.72rem;
    box-shadow: 0 2px 6px rgba(15, 118, 110, 0.35);
    transition: background 0.15s ease, transform 0.15s ease;
}

.app-topbar-menu-btn--desktop:hover .app-topbar-menu-arrow {
    background: var(--app-primary-dark);
    transform: translateX(2px);
}

/* Panel menu mobile */
.app-mobile-sidebar {
    --bs-offcanvas-width: min(88vw, 20.5rem);
}

.app-mobile-sidebar__header {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--card-border);
    background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
}

.app-mobile-sidebar__body {
    padding: 0.75rem 0.85rem max(1rem, env(safe-area-inset-bottom, 0px));
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.app-mobile-sidebar .app-side-nav-item {
    min-height: 48px;
    padding-top: 0.65rem;
    padding-bottom: 0.65rem;
    font-size: 0.92rem;
}

.app-mobile-sidebar .app-side-nav-accordion__summary {
    min-height: 48px;
}

.app-topbar-back {
    order: -1;
}

.app-topbar-back .app-topbar-action-btn__label {
    max-width: 5.5rem;
}

@media (max-width: 380px) {
    .app-topbar-menu-btn__label {
        display: none;
    }

    .app-topbar-menu-btn--mobile {
        min-width: 44px;
        padding-inline: 0.55rem;
    }
}

@media (max-width: 575.98px) {
    .app-topbar-back .app-topbar-action-btn__label {
        display: none;
    }

    .app-topbar-back {
        min-width: 2.15rem;
        padding-inline: 0.5rem;
    }
}

.app-topbar-profile-menu .dropdown-toggle::after {
    margin-left: 0.35rem;
    vertical-align: 0.15em;
}

.app-topbar-profile-dropdown {
    min-width: 13rem;
    border-radius: 12px;
    padding: 0.35rem 0;
}

.app-topbar-profile-dropdown .dropdown-item {
    font-size: 0.88rem;
    padding: 0.55rem 0.85rem;
}

.app-topbar-profile-dropdown .js-fcm-subscribe {
    width: 100%;
    text-align: left;
    border: 0;
    background: transparent;
}

.app-topbar-icon-btn {
    color: #fff !important;
    border: 1px solid rgba(255, 255, 255, 0.32) !important;
    background: rgba(255, 255, 255, 0.08) !important;
    border-radius: 10px !important;
    padding: 0.35rem 0.65rem !important;
    line-height: 1.2;
}

.app-topbar-icon-btn:hover {
    background: rgba(255, 255, 255, 0.18) !important;
    border-color: rgba(255, 255, 255, 0.45) !important;
    color: #fff !important;
}

.app-brand-link {
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    letter-spacing: 0.02em;
    font-size: 0.98rem;
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    line-height: 1.15;
    max-width: min(300px, 72vw);
    min-width: 0;
}

.app-brand-mark {
    flex: 0 0 auto;
    width: 2.35rem;
    height: 2.35rem;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.28);
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.12);
}

.app-brand-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.08rem;
    min-width: 0;
}

.app-brand-title {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.app-brand-tagline {
    display: block;
    font-size: 0.68rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    opacity: 0.88;
    line-height: 1.25;
    white-space: normal;
    max-width: 100%;
}

.app-brand-kicker {
    text-transform: none;
    letter-spacing: 0.02em;
    font-weight: 600;
    opacity: 0.9;
}

.app-brand-link:hover {
    color: #fff;
    opacity: 0.92;
}

.app-topbar-profile {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    text-decoration: none;
    color: #fff;
    min-width: 0;
    max-width: min(220px, 42vw);
}

.app-topbar-profile:hover {
    color: #fff;
    opacity: 0.92;
}

.app-topbar-user {
    color: #fff;
    font-size: 0.85rem;
    font-weight: 500;
    padding: 0.2rem 0.55rem 0.2rem 0;
    background: transparent;
    border-radius: 0;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-user-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 50%;
    overflow: hidden;
    background: linear-gradient(145deg, var(--app-primary) 0%, var(--app-secondary) 100%);
    color: #fff;
    font-weight: 700;
    border: 2px solid rgba(255, 255, 255, 0.35);
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.15);
}

.app-user-avatar__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.app-user-avatar--sm {
    width: 2rem;
    height: 2rem;
    font-size: 0.68rem;
}

.app-user-avatar--table {
    width: 2.25rem;
    height: 2.25rem;
    font-size: 0.72rem;
}

.app-user-avatar--md {
    width: 2.75rem;
    height: 2.75rem;
    font-size: 0.82rem;
}

.app-user-avatar--lg {
    width: 3.5rem;
    height: 3.5rem;
    font-size: 1rem;
}

.app-user-avatar--xl {
    width: 6.5rem;
    height: 6.5rem;
    font-size: 1.35rem;
    border-width: 3px;
}

.user-profil-preview .app-user-avatar--xl {
    margin-inline: auto;
}

.app-topbar .btn-outline-light {
    border-color: rgba(255, 255, 255, 0.45);
    font-weight: 600;
}

.app-topbar .btn-outline-light:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.65);
}

.app-topbar .btn-light {
    font-weight: 600;
    border: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.card {
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    background: var(--card-bg);
    backdrop-filter: blur(6px);
    transition: box-shadow 0.22s ease, border-color 0.22s ease;
}

.card:hover {
    box-shadow: var(--shadow-card-hover);
    border-color: rgba(8, 145, 178, 0.22);
}

.card.no-card-hover:hover {
    box-shadow: var(--shadow-card);
    border-color: var(--card-border);
}

.card .card-body {
    padding: 0.85rem 1rem;
}

.app-main .card-header {
    padding: 0.5rem 0.85rem;
    font-size: 0.9rem;
}

.app-main .table > :not(caption) > * > * {
    padding: 0.35rem 0.5rem;
    vertical-align: middle;
}

.app-main .list-group-item {
    padding-top: 0.45rem;
    padding-bottom: 0.45rem;
}

.app-main .page-intro {
    margin-bottom: 0.75rem !important;
}

.app-main .row.g-3 {
    --bs-gutter-y: 0.65rem;
}

.app-main .mb-3 {
    margin-bottom: 0.65rem !important;
}

.btn {
    border-radius: 10px;
    padding: 0.5rem 1.25rem;
    font-weight: 600;
    letter-spacing: 0.15px;
    transition: all 0.2s;
}

.btn-primary {
    background: linear-gradient(120deg, var(--app-primary) 0%, var(--app-secondary) 100%);
    border-color: transparent;
}

.btn-primary:hover {
    background: linear-gradient(120deg, var(--app-primary-dark) 0%, #0e7490 100%);
    border-color: transparent;
}

.btn-success {
    background: linear-gradient(120deg, #16a34a 0%, var(--app-accent) 100%);
    border-color: transparent;
}

.btn-success:hover {
    background: linear-gradient(120deg, #15803d 0%, #16a34a 100%);
    border-color: transparent;
}

.app-shell {
    flex: 1 1 auto;
    display: block;
    width: 100%;
    padding: 0 clamp(0.65rem, 2vw, 1.25rem) 2.5rem;
}

.app-body-shell--no-sidebar .app-sidebar--desktop,
.app-body-shell--no-sidebar .app-topbar-menu-btn {
    display: none !important;
}

@media (min-width: 992px) {
    .app-body-shell--no-sidebar .app-frame {
        flex-direction: column;
    }
}

.app-sidebar {
    width: 258px;
    flex-shrink: 0;
}

.app-sidebar--desktop {
    flex-direction: column;
    width: min(300px, 28vw);
    max-width: 300px;
    flex-shrink: 0;
    padding: 0.85rem 0.7rem 1rem;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    border-right: 1px solid var(--app-nav-border);
    box-shadow: 4px 0 28px rgba(15, 118, 110, 0.06);
    position: sticky;
    top: 0;
    align-self: flex-start;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    transition: width 0.24s ease, max-width 0.24s ease, padding 0.24s ease, opacity 0.2s ease, border-color 0.24s ease;
}

.app-sidebar-footer {
    flex: 0 0 auto;
    margin-top: auto;
    padding-top: 0.55rem;
    border-top: 1px solid var(--app-nav-border);
}

.app-sidebar-hide-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    width: 100%;
    padding: 0.5rem 0.65rem;
    border: 1px solid var(--app-nav-border);
    border-radius: 10px;
    background: #fff;
    color: #64748b;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.app-sidebar-hide-btn:hover {
    background: var(--app-nav-surface-hover);
    color: var(--app-primary-dark);
    border-color: rgba(15, 118, 110, 0.28);
}

.app-sidebar-hide-btn__text {
    line-height: 1.2;
}

/* —— Sidebar: identitas pondok + profil pengguna —— */
.app-sidebar-head {
    position: relative;
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    margin: 0 0 0.75rem;
    padding: 1rem 0.9rem;
    border-radius: 14px;
    overflow: hidden;
    color: #f8fafc;
    background: linear-gradient(128deg, var(--app-primary) 0%, var(--app-secondary) 40%, #1d4ed8 98%);
    border: 1px solid rgba(255, 255, 255, 0.16);
    box-shadow: 0 12px 32px rgba(14, 116, 144, 0.32);
}

.app-sidebar-head::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    opacity: 0.4;
    background-image:
        radial-gradient(ellipse 85% 60% at 100% 0%, rgba(255, 255, 255, 0.28), transparent 55%),
        radial-gradient(circle at 1.5px 1.5px, rgba(255, 255, 255, 0.18) 1px, transparent 0);
    background-size: auto, 18px 18px;
    -webkit-mask-image: linear-gradient(155deg, #000 0%, rgba(0, 0, 0, 0.4) 72%, transparent 100%);
    mask-image: linear-gradient(155deg, #000 0%, rgba(0, 0, 0, 0.4) 72%, transparent 100%);
}

.app-sidebar-head > * {
    position: relative;
    z-index: 1;
}

.app-sidebar-pondok-link {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
    text-decoration: none;
    color: inherit;
    transition: opacity 0.15s ease;
}

.app-sidebar-pondok-link:hover {
    color: #fff;
    opacity: 0.94;
}

.app-sidebar-pondok-logo-wrap {
    flex: 0 0 auto;
    width: 3.1rem;
    height: 3.1rem;
    padding: 0.06rem;
    border-radius: 50%;
    background: #fff;
    border: 1px solid rgba(255, 255, 255, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.12);
    overflow: hidden;
}

.app-sidebar-pondok-logo-wrap--fallback {
    background: #fff;
    border-color: rgba(255, 255, 255, 0.35);
    border-radius: 50%;
}

.app-sidebar-pondok-logo {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: cover;
    object-position: center center;
    border-radius: 50%;
    display: block;
    background: #fff;
}

.app-sidebar-pondok-logo-fallback {
    font-weight: 800;
    font-size: 0.82rem;
    color: #fff;
    letter-spacing: 0.05em;
}

.app-sidebar-pondok-kicker {
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.78);
    line-height: 1.3;
}

.app-sidebar-pondok-title {
    font-size: 0.95rem;
    font-weight: 800;
    line-height: 1.28;
    letter-spacing: -0.02em;
    color: #fff;
    margin-top: 0.1rem;
    text-shadow: 0 1px 2px rgba(15, 23, 42, 0.12);
}

.app-sidebar-pondok-alamat {
    display: flex;
    align-items: flex-start;
    gap: 0.35rem;
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.86);
    line-height: 1.35;
    margin-top: 0.45rem;
}

.app-sidebar-pondok-alamat i {
    margin-top: 0.15rem;
    opacity: 0.9;
    flex-shrink: 0;
    color: rgba(255, 255, 255, 0.9);
}

.app-sidebar-user {
    padding: 0.65rem 0.55rem;
    border-radius: 12px;
    background: linear-gradient(165deg, rgba(15, 118, 110, 0.08) 0%, rgba(8, 145, 178, 0.06) 100%);
    border: 1px solid rgba(15, 118, 110, 0.16);
}

.app-sidebar-user-main {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin-bottom: 0.55rem;
}

.app-sidebar-user-avatar-link {
    flex: 0 0 auto;
    text-decoration: none;
    border-radius: 50%;
    line-height: 0;
}

.app-user-avatar--sidebar {
    width: 3rem;
    height: 3rem;
    font-size: 0.85rem;
}

.app-sidebar-user-sapaan {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--app-primary-dark);
    line-height: 1.2;
}

.app-sidebar-user-nama {
    font-size: 0.75rem;
    color: #64748b;
    line-height: 1.25;
}

.app-sidebar-user-role {
    margin-top: 0.25rem;
    font-size: 0.62rem;
    font-weight: 600;
    background: rgba(15, 118, 110, 0.12) !important;
    color: var(--app-primary-dark) !important;
    border: 1px solid rgba(15, 118, 110, 0.2);
}

.app-sidebar-foto-btn {
    font-weight: 600;
    font-size: 0.78rem;
}

.app-sidebar-foto-remove {
    font-size: 0.72rem;
    text-decoration: none;
}

.app-sidebar-profil-link {
    display: inline-block;
    margin-top: 0.35rem;
    color: var(--app-secondary);
    text-decoration: none;
}

.app-sidebar-profil-link:hover {
    text-decoration: underline;
}

.app-sidebar-head--compact {
    padding: 0.85rem 0.85rem;
}

.app-sidebar-head--compact .app-sidebar-pondok-link {
    align-items: center;
    gap: 0.75rem;
}

.app-sidebar-head--compact .app-sidebar-pondok-text {
    flex: 1 1 auto;
    min-width: 0;
}

.app-sidebar-head--compact .app-sidebar-pondok-logo-wrap {
    width: 3rem;
    height: 3rem;
    flex-shrink: 0;
}

.app-sidebar-head--compact .app-sidebar-pondok-kicker {
    font-size: 0.58rem;
    letter-spacing: 0.1em;
}

.app-sidebar-head--compact .app-sidebar-pondok-title {
    font-size: clamp(0.84rem, 3.6vw, 0.95rem);
    line-height: 1.3;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.app-sidebar-head--compact .app-sidebar-pondok-alamat {
    font-size: 0.68rem;
    margin-top: 0.35rem;
    line-height: 1.4;
}

.app-sidebar-head--compact .app-sidebar-pondok-alamat span {
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
}

/* Mobile / offcanvas — penataan logo & teks */
.app-sidebar-head--mobile {
    margin-bottom: 0.85rem;
}

#mobileSidebar .app-sidebar-head--mobile {
    width: 100%;
}

#mobileSidebar .app-sidebar-head--mobile .app-sidebar-pondok-link {
    width: 100%;
}

@media (max-width: 400px) {
    .app-sidebar-head--mobile .app-sidebar-pondok-logo-wrap {
        width: 3.25rem;
        height: 3.25rem;
    }

    .app-sidebar-head--mobile .app-sidebar-pondok-title {
        font-size: clamp(0.88rem, 4.2vw, 0.98rem);
    }

    .app-sidebar-head--mobile .app-sidebar-pondok-alamat {
        font-size: 0.68rem;
    }
}

@media (min-width: 401px) and (max-width: 575.98px) {
    .app-sidebar-head--mobile .app-sidebar-pondok-logo-wrap {
        width: 3.5rem;
        height: 3.5rem;
    }
}

/* HP / Android — logo & nama pondok di topbar & menu */
@media (max-width: 991.98px) {
    .app-topbar-inner {
        padding-top: max(0.45rem, env(safe-area-inset-top, 0px));
        padding-left: max(0.75rem, env(safe-area-inset-left, 0px));
        padding-right: max(0.75rem, env(safe-area-inset-right, 0px));
        min-height: 56px;
        gap: 0.5rem;
        display: grid;
        grid-template-columns: auto 1fr auto;
        grid-template-areas: "left center right";
        align-items: center;
    }

    .app-topbar-left {
        grid-area: left;
        flex: 0 0 auto;
        min-width: 0;
        gap: 0.45rem;
    }

    .app-topbar-center {
        grid-area: center;
        display: flex !important;
        align-items: center;
        justify-content: center;
        min-width: 0;
        padding: 0 0.35rem;
    }

    .app-topbar-right {
        grid-area: right;
    }

    .app-topbar-title-mobile {
        font-size: clamp(0.82rem, 3.2vw, 0.95rem);
        font-weight: 700;
        line-height: 1.25;
        text-align: center;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100%;
        color: #fff;
        text-shadow: 0 1px 2px rgba(15, 23, 42, 0.25);
    }

    .app-brand-link {
        max-width: min(38vw, 8.5rem);
        flex: 0 1 auto;
        min-width: 0;
        gap: 0.45rem;
    }

    .app-topbar-menu-btn__label {
        display: inline;
    }

    .app-brand-mark,
    .app-brand-mark--logo {
        width: 2.85rem;
        height: 2.85rem;
        border-radius: 50%;
        flex-shrink: 0;
        overflow: hidden;
    }

    .app-brand-mark--logo {
        padding: var(--pondok-logo-ring, 2px);
        background: #fff;
    }

    .app-brand-logo {
        min-width: 1.5rem;
        min-height: 1.5rem;
    }

    .app-brand-text {
        flex: 1 1 auto;
        min-width: 0;
    }

    .app-brand-tagline,
    .app-brand-kicker {
        font-size: clamp(0.58rem, 2.2vw, 0.68rem);
        line-height: 1.3;
        opacity: 0.92;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        overflow-wrap: anywhere;
        order: 1;
    }

    .app-brand-title {
        white-space: normal;
        overflow: hidden;
        text-overflow: ellipsis;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        font-size: clamp(0.8rem, 3.4vw, 0.98rem);
        line-height: 1.28;
        font-weight: 800;
        letter-spacing: -0.02em;
        overflow-wrap: anywhere;
        word-break: break-word;
        text-shadow: 0 1px 3px rgba(15, 23, 42, 0.2);
        order: 2;
    }

    .app-topbar-toolgroup {
        flex-shrink: 0;
    }

    .app-topbar-right {
        flex-shrink: 0;
    }

    .app-topbar-actions {
        gap: 0.3rem;
    }

    .app-topbar-role {
        display: none !important;
    }

    .app-topbar-user-pill {
        padding: 0.22rem 0.45rem 0.22rem 0.22rem;
        max-width: none;
    }

    .app-topbar-logout .app-topbar-action-btn__label {
        display: none;
    }

    .app-topbar-logout {
        min-width: 2.15rem;
        padding-inline: 0.5rem;
    }

    #mobileSidebar .app-sidebar-head--mobile .app-sidebar-pondok-logo-wrap,
    .app-sidebar-head--mobile .app-sidebar-pondok-logo-wrap {
        width: 3.5rem;
        height: 3.5rem;
        padding: var(--pondok-logo-ring, 2px);
    }

    #mobileSidebar .app-sidebar-pondok-title,
    .app-sidebar-head--mobile .app-sidebar-pondok-title {
        font-size: clamp(0.92rem, 4vw, 1.08rem);
        line-height: 1.35;
        overflow-wrap: anywhere;
        word-break: break-word;
        hyphens: auto;
    }

    #mobileSidebar .app-sidebar-pondok-kicker,
    .app-sidebar-head--mobile .app-sidebar-pondok-kicker {
        font-size: 0.64rem;
        letter-spacing: 0.1em;
    }
}

@media (max-width: 575.98px) {
    .dash-page .dash-hero-brand--top {
        flex-wrap: wrap;
        justify-content: center;
        text-align: center;
        gap: 0.75rem;
    }

    .dash-page .dash-hero-logo-wrap:not(.dash-hero-logo-wrap--placeholder) {
        max-width: min(128px, 34vw);
        max-height: min(100px, 26vw);
    }

    .dash-page .dash-hero-logo {
        max-width: min(128px, 34vw);
        max-height: min(100px, 26vw);
    }

    .dash-page .dash-hero-pesantren {
        font-size: clamp(1rem, 4.6vw, 1.22rem);
        line-height: 1.3;
        text-align: center;
    }

    .dash-page .dash-hero-pesantren-kicker {
        text-align: center;
    }

    .dash-page .dash-hero-pesantren-sub {
        font-size: 0.68rem;
        text-align: center;
    }
}

[data-theme="dark"] .app-sidebar-head {
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.35);
    background: linear-gradient(128deg, #0d5c56 0%, #0e7490 42%, #1e3a8a 98%);
}

[data-theme="dark"] .app-sidebar-pondok-logo-wrap {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.22);
}

[data-theme="dark"] .app-sidebar-pondok-logo-fallback {
    color: #fff;
}

[data-theme="dark"] .app-sidebar-pondok-title {
    color: #fff;
}

[data-theme="dark"] .app-sidebar-pondok-kicker,
[data-theme="dark"] .app-sidebar-pondok-alamat {
    color: rgba(255, 255, 255, 0.82);
}

[data-theme="dark"] .app-sidebar-user-nama {
    color: #94a3b8;
}

[data-theme="dark"] .app-sidebar-user {
    background: rgba(15, 118, 110, 0.15);
    border-color: rgba(45, 212, 191, 0.2);
}

[data-theme="dark"] .app-sidebar-user-sapaan {
    color: #5eead4;
}

.app-sidebar-brand {
    flex: 0 0 auto;
    margin-bottom: 0.75rem;
    padding: 0.15rem 0.35rem 0.85rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.app-sidebar-brand-link {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    text-decoration: none;
    color: var(--app-text);
    min-width: 0;
}

.app-sidebar-brand-link:hover {
    color: var(--app-primary-dark);
}

.app-sidebar-brand-mark {
    flex: 0 0 auto;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: #fff;
    background: linear-gradient(145deg, var(--app-primary) 0%, var(--app-secondary) 100%);
    box-shadow: 0 8px 20px rgba(14, 116, 144, 0.28);
}

.app-sidebar-brand-mark--logo {
    width: 3rem;
    height: 3rem;
    padding: 0.06rem;
    border-radius: 50%;
    overflow: hidden;
    background: #fff;
    border: 1px solid rgba(148, 163, 184, 0.28);
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
}

.app-sidebar-brand-mark--offcanvas {
    width: 2.65rem;
    height: 2.65rem;
}

.app-sidebar-brand-logo {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    object-position: center center;
    background: #fff;
}

.app-sidebar-brand-mark--fallback {
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.05em;
}

.app-brand-mark--logo {
    border-radius: 50%;
    overflow: hidden;
    background: #fff;
    border: 1px solid rgba(255, 255, 255, 0.35);
    padding: 0.06rem;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.12);
}

.app-brand-mark--logo .app-brand-logo,
.app-brand-logo {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    object-position: center center;
    background: #fff;
}

.app-brand-mark--fallback {
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.05em;
}

[data-theme="dark"] .app-sidebar-brand-mark--logo {
    background: #fff;
    border: 1px solid rgba(255, 255, 255, 0.35);
}

.app-sidebar-brand-text {
    display: flex;
    flex-direction: column;
    gap: 0.12rem;
    min-width: 0;
}

.app-sidebar-brand-title {
    font-size: 0.88rem;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.02em;
    color: #0f172a;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.app-sidebar-brand-tagline {
    font-size: 0.65rem;
    font-weight: 500;
    color: #64748b;
    line-height: 1.25;
}

.app-sidebar-inner {
    flex: 1 1 auto;
    min-height: 0;
    background: transparent;
    border-radius: 0;
    padding: 0;
    border: none;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    max-height: none;
    overflow: hidden;
}

.app-sidebar-nav {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 0.15rem;
    margin-right: -0.15rem;
}

.app-sidebar-nav-label {
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--app-nav-muted);
    padding: 0.35rem 0.5rem 0.55rem;
}

.app-sidebar-nav-label--toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin: 0 0.15rem 0.1rem;
    padding: 0.5rem 0.55rem;
    border-radius: 10px;
    border: 1px solid rgba(15, 118, 110, 0.22);
    background: linear-gradient(135deg, rgba(15, 118, 110, 0.1) 0%, rgba(14, 165, 233, 0.06) 100%);
    cursor: pointer;
    user-select: none;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.app-sidebar-nav-label__text {
    flex: 1 1 auto;
    min-width: 0;
}

.app-sidebar-nav-label__arrow {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.65rem;
    height: 1.65rem;
    border-radius: 8px;
    background: var(--app-primary);
    color: #fff;
    font-size: 0.72rem;
    box-shadow: 0 2px 6px rgba(15, 118, 110, 0.35);
    transition: background 0.15s ease, transform 0.2s ease, box-shadow 0.15s ease;
}

.app-sidebar-nav-label--toggle:hover,
.app-sidebar-nav-label--toggle:focus-visible {
    background: linear-gradient(135deg, rgba(15, 118, 110, 0.16) 0%, rgba(14, 165, 233, 0.1) 100%);
    color: var(--app-primary-dark);
    border-color: rgba(15, 118, 110, 0.38);
    outline: none;
    box-shadow: 0 2px 10px rgba(15, 118, 110, 0.12);
}

.app-sidebar-nav-label--toggle:hover .app-sidebar-nav-label__arrow,
.app-sidebar-nav-label--toggle:focus-visible .app-sidebar-nav-label__arrow {
    background: var(--app-primary-dark);
    transform: translateX(-2px);
    box-shadow: 0 3px 8px rgba(15, 118, 110, 0.45);
}

.app-topbar-title-mobile--menu-hit {
    cursor: pointer;
    transition: opacity 0.15s ease;
}

.app-topbar-title-mobile--menu-hit::before {
    content: "\f0c9";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    margin-right: 0.4rem;
    font-size: 0.82em;
    opacity: 0.88;
}

.app-topbar-title-mobile--menu-hit:hover,
.app-topbar-title-mobile--menu-hit:focus-visible {
    opacity: 0.92;
    outline: none;
}

.app-side-nav-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.55rem 0.65rem;
    margin-bottom: 0.28rem;
    border-radius: 12px;
    text-decoration: none;
    color: var(--app-nav-text);
    font-weight: 600;
    font-size: 0.86rem;
    border: 1px solid var(--app-nav-border);
    background: #ffffff;
    transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, color 0.18s ease, transform 0.15s ease;
}

.app-side-nav-item:hover {
    background: var(--app-nav-surface-hover);
    border-color: rgba(15, 118, 110, 0.28);
    color: var(--app-primary-dark);
    box-shadow: 0 4px 14px rgba(15, 118, 110, 0.1);
}

.app-side-nav-item.active {
    background: linear-gradient(118deg, var(--app-primary) 0%, var(--app-primary-dark) 42%, var(--app-secondary) 100%);
    color: #fff;
    border-color: transparent;
    box-shadow: var(--app-nav-active-shadow);
}

.app-side-nav-item.active .app-side-nav-ico {
    background: rgba(255, 255, 255, 0.22);
    border-color: rgba(255, 255, 255, 0.35);
    color: #fff;
}

.app-side-nav-ico {
    flex: 0 0 auto;
    width: 2.1rem;
    height: 2.1rem;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    color: #475569;
    background: var(--app-nav-icon-bg);
    border: 1px solid var(--app-nav-icon-border);
}

.app-side-nav-item:hover .app-side-nav-ico {
    color: var(--app-primary-dark);
    background: rgba(15, 118, 110, 0.14);
    border-color: rgba(15, 118, 110, 0.24);
}

.app-side-nav-item--hub .app-side-nav-ico {
    color: var(--app-secondary);
    background: rgba(8, 145, 178, 0.12);
    border-color: rgba(8, 145, 178, 0.22);
}

.app-side-nav-text {
    flex: 1 1 auto;
    min-width: 0;
    line-height: 1.25;
}

.app-side-nav-chevron {
    flex: 0 0 auto;
    font-size: 0.65rem;
    opacity: 0.45;
}

.app-side-nav-item--hub:hover .app-side-nav-chevron {
    opacity: 0.85;
    transform: translateX(2px);
}

.app-side-nav-item--hub .app-side-nav-chevron {
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.app-sidebar-nav-hint {
    flex: 0 0 auto;
    margin-top: 0.65rem;
    padding: 0.55rem 0.5rem 0;
    border-top: 1px solid var(--app-nav-border);
    line-height: 1.35;
    color: var(--app-nav-muted) !important;
    font-size: 0.72rem;
}

.app-side-nav-group {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    margin-bottom: 0.35rem;
}

.app-side-nav-group__label {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.45rem 0.65rem 0.35rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--app-nav-muted);
}

.app-side-nav-item--child {
    padding-left: 1.35rem;
    font-size: 0.84rem;
}

.app-side-nav-item--child .app-side-nav-ico {
    width: 1.35rem;
    height: 1.35rem;
    font-size: 0.65rem;
    opacity: 0.65;
}

/* Accordion submenu — mobile offcanvas */
.app-sidebar-nav--accordion .app-side-nav-accordion {
    border: 0;
    margin: 0 0 0.35rem;
    border-radius: var(--radius-md);
    background: transparent;
}

.app-sidebar-nav--accordion .app-side-nav-accordion__summary {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.65rem 0.75rem;
    min-height: 44px;
    cursor: pointer;
    border-radius: var(--radius-md);
    color: var(--app-nav-text);
    font-weight: 600;
    font-size: 0.9rem;
    user-select: none;
}

.app-sidebar-nav--accordion .app-side-nav-accordion__summary::-webkit-details-marker {
    display: none;
}

.app-sidebar-nav--accordion .app-side-nav-accordion__summary:hover {
    background: var(--app-nav-surface-hover);
}

.app-sidebar-nav--accordion .app-side-nav-accordion.is-active > .app-side-nav-accordion__summary,
.app-sidebar-nav--accordion .app-side-nav-accordion[open] > .app-side-nav-accordion__summary {
    background: var(--app-nav-surface);
}

.app-sidebar-nav--accordion .app-side-nav-accordion__summary .app-side-nav-chevron {
    margin-left: auto;
    transition: transform 0.18s ease;
}

.app-sidebar-nav--accordion .app-side-nav-accordion[open] .app-side-nav-chevron {
    transform: rotate(180deg);
}

.app-sidebar-nav--accordion .app-side-nav-accordion__body {
    padding: 0.15rem 0 0.35rem 0.35rem;
}

.app-sidebar-nav--accordion .app-side-nav-section-title {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--app-nav-muted);
    padding: 0.45rem 0.75rem 0.2rem 1.35rem;
}

.app-sidebar-nav--accordion .app-side-nav-item {
    min-height: 44px;
}

#mobileSidebar.offcanvas {
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    border-right: 1px solid var(--app-nav-border);
}

#mobileSidebar .offcanvas-body {
    max-height: calc(100vh - 4.5rem);
    max-height: calc(100dvh - 4.5rem);
    overflow-y: auto;
    padding-top: 0.35rem;
    padding-left: max(0.85rem, env(safe-area-inset-left, 0px));
    padding-right: max(0.85rem, env(safe-area-inset-right, 0px));
}

#mobileSidebar .app-sidebar-mobile {
    display: block;
}

#mobileSidebar .app-sidebar-nav-hint {
    display: none;
}

[data-theme="dark"] {
    --app-bg: #0f172a;
    --app-bg-soft: #111827;
    --app-text: #e2e8f0;
    --card-bg: rgba(30, 41, 59, 0.94);
    --card-border: rgba(71, 85, 105, 0.5);
    --table-head: #1e293b;
    --shadow-card: 0 8px 26px rgba(0, 0, 0, 0.35);
    --shadow-card-hover: 0 16px 36px rgba(0, 0, 0, 0.45);
    --app-nav-surface: rgba(15, 118, 110, 0.12);
    --app-nav-surface-hover: rgba(15, 118, 110, 0.22);
    --app-nav-border: rgba(45, 212, 191, 0.2);
    --app-nav-text: #ccfbf1;
    --app-nav-muted: #94a3b8;
    --app-nav-icon-bg: rgba(15, 118, 110, 0.28);
    --app-nav-icon-border: rgba(45, 212, 191, 0.25);
    color-scheme: dark;
}

[data-theme="dark"] body {
    background:
        radial-gradient(900px 380px at -8% -12%, rgba(8, 145, 178, 0.12), transparent 52%),
        radial-gradient(800px 320px at 108% 5%, rgba(34, 197, 94, 0.08), transparent 48%),
        linear-gradient(180deg, var(--app-bg-soft) 0%, var(--app-bg) 100%);
    color: var(--app-text);
}

[data-theme="dark"] .app-main,
[data-theme="dark"] .app-main h1,
[data-theme="dark"] .app-main h2,
[data-theme="dark"] .app-main h3,
[data-theme="dark"] .app-main h4,
[data-theme="dark"] .app-main h5,
[data-theme="dark"] .app-main h6,
[data-theme="dark"] .app-main .h1,
[data-theme="dark"] .app-main .h2,
[data-theme="dark"] .app-main .h3,
[data-theme="dark"] .app-main .h4,
[data-theme="dark"] .app-main .h5,
[data-theme="dark"] .app-main .h6 {
    color: var(--app-text);
}

[data-theme="dark"] .app-main .text-dark,
[data-theme="dark"] .text-dark {
    color: var(--app-text) !important;
}

[data-theme="dark"] .app-card-title {
    color: var(--app-text);
}

[data-theme="dark"] .card,
[data-theme="dark"] .card-body,
[data-theme="dark"] .modal-content,
[data-theme="dark"] .offcanvas {
    background-color: var(--card-bg);
    border-color: var(--card-border);
    color: var(--app-text);
}

[data-theme="dark"] .card .text-muted,
[data-theme="dark"] .form-text {
    color: #94a3b8 !important;
}

[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select,
[data-theme="dark"] .input-group-text {
    background-color: #1e293b;
    border-color: rgba(71, 85, 105, 0.65);
    color: #f1f5f9;
}

[data-theme="dark"] .form-control::placeholder {
    color: #64748b;
}

[data-theme="dark"] .form-control:focus,
[data-theme="dark"] .form-select:focus {
    background-color: #1e293b;
    border-color: var(--app-secondary);
    color: #f8fafc;
}

[data-theme="dark"] .alert-light,
[data-theme="dark"] .alert-secondary {
    background-color: rgba(30, 41, 59, 0.9);
    border-color: var(--card-border);
    color: var(--app-text);
}

[data-theme="dark"] .alert-light a,
[data-theme="dark"] .alert-secondary a {
    color: #67e8f9;
}

[data-theme="dark"] .badge.text-bg-light,
[data-theme="dark"] .app-badge-muted {
    background-color: rgba(51, 65, 85, 0.9) !important;
    border: 1px solid rgba(71, 85, 105, 0.55) !important;
    color: #e2e8f0 !important;
}

[data-theme="dark"] .app-mini-stat {
    background: var(--card-bg);
    border-color: var(--card-border);
}

[data-theme="dark"] .app-mini-stat-label {
    color: #94a3b8;
}

[data-theme="dark"] .app-mini-stat-value {
    color: #f1f5f9;
}

[data-theme="dark"] .page-intro-kicker a,
[data-theme="dark"] .app-main a:not(.btn):not(.app-side-nav-item):not(.menu-hub-tile) {
    color: #5eead4;
}

[data-theme="dark"] .table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--app-text);
    --bs-table-border-color: rgba(71, 85, 105, 0.45);
}

[data-theme="dark"] .table thead th {
    background: var(--table-head);
    color: #cbd5e1;
}

[data-theme="dark"] code {
    color: #fda4af;
    background: rgba(30, 41, 59, 0.8);
}

[data-theme="dark"] .btn-outline-primary {
    color: #5eead4;
    border-color: rgba(45, 212, 191, 0.45);
}

[data-theme="dark"] .btn-outline-primary:hover,
[data-theme="dark"] .btn-check:checked + .btn-outline-primary {
    background-color: rgba(15, 118, 110, 0.35);
    color: #ecfdf5;
}

[data-theme="dark"] .btn-outline-secondary {
    color: #cbd5e1;
    border-color: rgba(100, 116, 139, 0.6);
}

[data-theme="dark"] .text-primary {
    color: #5eead4 !important;
}

[data-theme="dark"] .border-bottom {
    border-color: rgba(71, 85, 105, 0.45) !important;
}

.app-card-title {
    color: var(--app-text);
}

.app-badge-muted {
    background-color: #f8fafc;
    border: 1px solid rgba(148, 163, 184, 0.35);
    color: #334155;
    font-weight: 600;
}

/* Mode tampilan: tanpa transisi saat pertama buka (cegah layout "loncat") */
html:not(.theme-ready) *,
html:not(.theme-ready) *::before,
html:not(.theme-ready) *::after {
    transition: none !important;
}

html.theme-ready body,
html.theme-ready .app-main,
html.theme-ready .card,
html.theme-ready .app-mini-stat,
html.theme-ready .app-sidebar--desktop,
html.theme-ready .offcanvas,
html.theme-ready .modal-content,
html.theme-ready .form-control,
html.theme-ready .form-select,
html.theme-ready .table {
    transition:
        background-color 0.28s ease,
        color 0.28s ease,
        border-color 0.28s ease,
        box-shadow 0.28s ease;
}

html[data-theme-transitioning] .app-theme-switch {
    pointer-events: none;
    opacity: 0.88;
}

@media (prefers-reduced-motion: reduce) {
    html.theme-ready body,
    html.theme-ready .app-main,
    html.theme-ready .card,
    html.theme-ready .app-mini-stat,
    html.theme-ready .app-sidebar--desktop,
    html.theme-ready .offcanvas,
    html.theme-ready .modal-content,
    html.theme-ready .form-control,
    html.theme-ready .form-select,
    html.theme-ready .table {
        transition: none !important;
    }
}

[data-theme="dark"] .app-sidebar--desktop {
    background: linear-gradient(180deg, #1a2f2d 0%, #152826 48%, #0f172a 100%);
    border-right-color: var(--app-nav-border);
}

[data-theme="dark"] .app-sidebar-inner {
    background: transparent;
    border-color: rgba(71, 85, 105, 0.45);
}

[data-theme="dark"] #mobileSidebar.offcanvas {
    background: linear-gradient(180deg, #1a2f2d 0%, #0f172a 100%);
}

[data-theme="dark"] .app-side-nav-item.active {
    box-shadow: 0 8px 24px rgba(8, 145, 178, 0.35);
}

[data-theme="dark"] .app-side-nav-ico {
    color: #5eead4;
}

[data-theme="dark"] .app-side-nav-item--hub .app-side-nav-ico {
    color: #67e8f9;
    background: rgba(8, 145, 178, 0.2);
}

/* Halaman hub submenu (menu/menu_hub.php) */
.menu-hub-hero {
    position: relative;
    border-radius: var(--radius-lg) !important;
}

.menu-hub-hero-bg {
    position: absolute;
    inset: 0;
    background: linear-gradient(125deg, #0f766e 0%, #0891b2 42%, #2563eb 100%);
    opacity: 1;
}

.menu-hub-hero .card-body {
    z-index: 1;
}

.menu-hub-hero-icon {
    width: 3.25rem;
    height: 3.25rem;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.28);
}

.menu-hub-hero-kicker {
    letter-spacing: 0.12em;
}

.menu-hub-section-title {
    letter-spacing: 0.1em;
}

.menu-hub-tile {
    border-radius: var(--radius-md) !important;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
    border: 1px solid rgba(148, 163, 184, 0.2) !important;
}

.menu-hub-tile:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 32px rgba(15, 23, 42, 0.12) !important;
    border-color: rgba(8, 145, 178, 0.35) !important;
}

.menu-hub-tile-icon {
    flex: 0 0 auto;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    color: #0f766e;
    background: linear-gradient(145deg, rgba(15, 118, 110, 0.12) 0%, rgba(8, 145, 178, 0.12) 100%);
    border: 1px solid rgba(15, 118, 110, 0.18);
}

.menu-hub-tile-go {
    flex: 0 0 auto;
    align-self: center;
    transition: transform 0.18s ease, color 0.18s ease;
}

.menu-hub-tile:hover .menu-hub-tile-go {
    transform: translateX(4px);
    color: var(--app-secondary) !important;
}

@media (max-width: 575.98px) {
    .menu-hub-tile-hint {
        display: none;
    }

    .menu-hub-section-title {
        font-size: 0.72rem;
    }
}

[data-theme="dark"] .menu-hub-tile {
    background: rgba(30, 41, 59, 0.88) !important;
    border-color: rgba(71, 85, 105, 0.45) !important;
}

[data-theme="dark"] .menu-hub-tile-label {
    color: #f1f5f9 !important;
}

[data-theme="dark"] .menu-hub-tile:hover {
    border-color: rgba(45, 212, 191, 0.35) !important;
}

[data-theme="dark"] .menu-hub-tile-icon {
    color: #5eead4;
    background: rgba(15, 118, 110, 0.28);
    border-color: rgba(45, 212, 191, 0.25);
}

.settings-subnav-hub {
    max-width: 920px;
    margin-left: auto;
    margin-right: auto;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(148, 163, 184, 0.22);
}

/* Submenu pengaturan — ringkas di bawah, satu klik buka semua */
.settings-subnav-compact {
    max-width: 720px;
    margin-inline: auto;
}

.settings-subnav-compact__toggle[aria-expanded="true"] .settings-subnav-compact__chevron {
    transform: rotate(180deg);
}

.settings-subnav-compact__chevron {
    transition: transform 0.2s ease;
    font-size: 0.75rem;
}

.settings-subnav-compact__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr));
    gap: 0.35rem 0.5rem;
}

.settings-subnav-compact__group {
    grid-column: 1 / -1;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-size: 0.68rem;
}

.settings-subnav-compact__link {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.45rem 0.35rem;
    border-radius: 8px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: #fff;
    text-decoration: none;
    color: #334155;
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1.2;
    text-align: center;
    min-height: 3.25rem;
    transition: border-color 0.15s, background 0.15s;
}

.settings-subnav-compact__link i {
    font-size: 1rem;
    color: #0f766e;
}

.settings-subnav-compact__link:hover {
    border-color: #0f766e;
    background: rgba(15, 118, 110, 0.06);
    color: #0f172a;
}

.settings-subnav-compact__link.is-active {
    border-color: #0f766e;
    background: rgba(15, 118, 110, 0.12);
    color: #0f766e;
    pointer-events: none;
}

[data-theme="dark"] .settings-subnav-compact__link {
    background: rgba(30, 41, 59, 0.65);
    border-color: rgba(71, 85, 105, 0.5);
    color: #e2e8f0;
}

.settings-subnav-hub-title {
    letter-spacing: 0.1em;
}

.settings-subnav-hub .menu-hub-tile--active {
    border: 2px solid rgba(8, 145, 178, 0.45) !important;
    box-shadow: 0 8px 22px rgba(15, 118, 110, 0.18) !important;
    pointer-events: none;
    cursor: default;
}

.settings-subnav-hub .menu-hub-tile--active .menu-hub-tile-label {
    color: #0f766e !important;
}

[data-theme="dark"] .settings-subnav-hub {
    border-top-color: rgba(71, 85, 105, 0.45);
}

[data-theme="dark"] .settings-subnav-hub .menu-hub-tile--active {
    border-color: rgba(45, 212, 191, 0.4) !important;
}

[data-theme="dark"] .settings-subnav-hub .menu-hub-tile--active .menu-hub-tile-label {
    color: #5eead4 !important;
}

.app-menu-link {
    display: block;
    text-decoration: none;
    color: #334155;
    padding: 0.62rem 0.85rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.9rem;
    transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.app-menu-group-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.35rem;
    width: 100%;
    background: transparent;
    border: 0;
    text-align: left;
    cursor: pointer;
    color: #334155;
}

.app-menu-group-label {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-menu-group-toggle .app-menu-caret {
    font-size: 0.7rem;
    transition: transform 0.2s ease;
    opacity: 0.65;
}

.app-menu-group-toggle[aria-expanded="true"] .app-menu-caret {
    transform: rotate(180deg);
    opacity: 1;
}

.app-menu-group-toggle.has-active {
    color: var(--app-primary);
}

.app-menu-group {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding-left: 0.65rem;
    margin: 0.15rem 0 0.35rem;
    border-left: 2px solid rgba(15, 118, 110, 0.18);
}

.app-menu-hub {
    border-left-width: 3px;
    border-left-color: rgba(8, 145, 178, 0.45);
    background: linear-gradient(95deg, rgba(240, 253, 250, 0.95) 0%, rgba(248, 250, 252, 0.4) 100%);
    border-radius: 0 12px 12px 0;
    padding: 0.35rem 0 0.45rem;
    margin-bottom: 0.45rem;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.app-menu-section-title {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #64748b;
    padding: 0.45rem 0.75rem 0.15rem;
    margin-top: 0.15rem;
}

.app-menu-hub .app-menu-sublink {
    border-radius: 9px;
    margin-right: 0.15rem;
}

.app-menu-hub .app-menu-sublink.active {
    box-shadow: 0 4px 14px rgba(15, 118, 110, 0.28);
}

.app-menu-sublink {
    font-size: 0.85rem;
    padding: 0.5rem 0.75rem;
    font-weight: 500;
}

.app-menu-sublink:not(.active) {
    color: #475569;
}

[data-theme="dark"] .app-menu-group-toggle {
    color: #cbd5e1;
}

[data-theme="dark"] .app-menu-group-toggle.has-active {
    color: #5eead4;
}

[data-theme="dark"] .app-menu-group {
    border-left-color: rgba(94, 234, 212, 0.28);
}

[data-theme="dark"] .app-menu-hub {
    background: linear-gradient(95deg, rgba(15, 118, 110, 0.22) 0%, rgba(15, 23, 42, 0.35) 100%);
    border-left-color: rgba(45, 212, 191, 0.45);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

[data-theme="dark"] .app-menu-section-title {
    color: #94a3b8;
}

[data-theme="dark"] .app-menu-sublink:not(.active) {
    color: #94a3b8;
}

.app-menu-link:hover {
    background: rgba(8, 145, 178, 0.1);
    color: #0f172a;
}

.app-menu-link.active {
    background: linear-gradient(120deg, var(--app-primary) 0%, var(--app-secondary) 100%);
    color: #ffffff;
    box-shadow: 0 6px 16px rgba(15, 118, 110, 0.35);
}

.app-content {
    flex: 1;
    min-width: 0;
    transition: all 0.25s ease;
}

.app-main {
    animation: app-fade-in 0.35s ease-out;
}

@media (prefers-reduced-motion: reduce) {
    .app-main {
        animation: none;
    }
}

@keyframes app-fade-in {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

body.app-page-leaving .app-main {
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity 0.15s ease, transform 0.15s ease;
}

.rekap-rank-summary {
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.rekap-rank-summary:hover {
    background: rgba(8, 145, 178, 0.06);
}

.rekap-rank-summary.is-expanded {
    background: rgba(8, 145, 178, 0.1);
}

.rekap-rank-summary.is-expanded .rekap-rank-chevron {
    transform: rotate(180deg);
}

.rekap-rank-chevron {
    display: inline-block;
    transition: transform 0.2s ease;
}

.rekap-rank-detail {
    display: none;
}

.rekap-rank-detail.is-open {
    display: table-row;
}

.rekap-rank-detail.is-open .rekap-rank-detail-inner {
    animation: rekap-detail-in 0.28s ease-out;
}

.rekap-rank-detail-inner {
    background: var(--bs-light, #f8fafc);
    border-top: 1px solid rgba(15, 23, 42, 0.06);
}

.rekap-rank-chart-wrap {
    min-height: 280px;
}

.rekap-rank-pos {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.75rem;
    height: 1.75rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 700;
    background: #e2e8f0;
    color: #334155;
}

.rekap-rank-pos--1 {
    background: linear-gradient(135deg, #16a34a, #22c55e);
    color: #fff;
    box-shadow: 0 2px 8px rgba(22, 163, 74, 0.35);
}

.rekap-rank-pos--2 {
    background: linear-gradient(135deg, #0ea5e9, #38bdf8);
    color: #fff;
}

.rekap-rank-pos--3 {
    background: linear-gradient(135deg, #f59e0b, #fbbf24);
    color: #1f2937;
}

.rekap-rank-summary--worst {
    background: rgba(220, 53, 69, 0.04);
}

.rekap-rank-summary--worst:hover {
    background: rgba(220, 53, 69, 0.08);
}

@keyframes rekap-detail-in {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

[data-theme="dark"] .rekap-rank-detail-inner {
    background: rgba(15, 23, 42, 0.45);
}

@media (prefers-reduced-motion: reduce) {
    body.app-page-leaving .app-main,
    .rekap-rank-detail.is-open .rekap-rank-detail-inner,
    .rekap-rank-chevron {
        transition: none;
        animation: none;
        transform: none;
    }
}

/* Flash & global UI */
.app-flash--hide {
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity 0.28s ease, transform 0.28s ease;
}

.app-flash {
    border-radius: var(--radius-md);
    border: none;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
    font-weight: 500;
    padding: 0.85rem 1.1rem;
}

.app-flash.alert-success {
    background: linear-gradient(135deg, rgba(220, 252, 231, 0.95) 0%, rgba(187, 247, 208, 0.55) 100%);
    color: #14532d !important;
    border-left: 4px solid #22c55e;
}

.app-flash.alert-danger {
    background: linear-gradient(135deg, rgba(254, 226, 226, 0.95) 0%, rgba(254, 202, 202, 0.45) 100%);
    color: #7f1d1d !important;
    border-left: 4px solid #ef4444;
}

[data-theme="dark"] .app-flash.alert-success {
    background: rgba(20, 83, 45, 0.45);
    color: #bbf7d0 !important;
    border-left-color: #4ade80;
}

[data-theme="dark"] .app-flash.alert-danger {
    background: rgba(127, 29, 29, 0.45);
    color: #fecaca !important;
    border-left-color: #f87171;
}

.app-hub-tabs {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.65rem 0.85rem;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid var(--card-border, rgba(15, 23, 42, 0.08));
    border-radius: var(--radius-md, 0.75rem);
}

[data-theme="dark"] .app-hub-tabs {
    background: rgba(15, 23, 42, 0.55);
}

.app-hub-tabs__title {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #64748b;
}

.app-hub-tabs__links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.app-hub-tabs__link {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.75rem;
    border-radius: 2rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: #475569;
    text-decoration: none;
    background: #f1f5f9;
}

.app-hub-tabs__link:hover {
    color: #0f766e;
    background: #ecfdf5;
}

.app-hub-tabs__link.active {
    color: #fff;
    background: #0f766e;
}

[data-theme="dark"] .app-hub-tabs__link {
    background: rgba(51, 65, 85, 0.6);
    color: #cbd5e1;
}

[data-theme="dark"] .app-hub-tabs__link.active {
    background: #0f766e;
    color: #fff;
}

/* Sub-menu horizontal swipe — HP & tablet */
@media (max-width: 991.98px) {
    .app-swipe-row,
    .app-hub-tabs__links,
    .wali-portal-tabs,
    .ikhtibar-portal-tabs,
    .wali-nav-scroll,
    .btn-group.flex-wrap[role="group"],
    .nav.nav-tabs.flex-wrap,
    .nav.nav-pills.flex-wrap,
    .nav.nav-tabs.flex-nowrap,
    .nav.nav-tabs.overflow-auto {
        display: flex;
        flex-wrap: nowrap !important;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x proximity;
        overscroll-behavior-x: contain;
        touch-action: pan-x;
        scrollbar-width: none;
        scroll-behavior: smooth;
        padding-bottom: 0.15rem;
        max-width: 100%;
    }

    .app-swipe-row::-webkit-scrollbar,
    .app-hub-tabs__links::-webkit-scrollbar,
    .wali-portal-tabs::-webkit-scrollbar,
    .ikhtibar-portal-tabs::-webkit-scrollbar,
    .wali-nav-scroll::-webkit-scrollbar,
    .btn-group.flex-wrap[role="group"]::-webkit-scrollbar,
    .nav.nav-tabs.flex-wrap::-webkit-scrollbar,
    .nav.nav-pills.flex-wrap::-webkit-scrollbar,
    .nav.nav-tabs.flex-nowrap::-webkit-scrollbar,
    .nav.nav-tabs.overflow-auto::-webkit-scrollbar {
        display: none;
        height: 0;
        width: 0;
    }

    .app-hub-tabs__link,
    .wali-portal-tabs a,
    .ikhtibar-portal-tabs a,
    .wali-nav-scroll .btn,
    .btn-group.flex-wrap[role="group"] > .btn,
    .nav.nav-tabs.flex-wrap .nav-link,
    .nav.nav-pills.flex-wrap .nav-link,
    .nav.nav-tabs.flex-nowrap .nav-link,
    .nav.nav-tabs.overflow-auto .nav-link {
        flex: 0 0 auto !important;
        white-space: nowrap;
        scroll-snap-align: center;
    }

    .wali-portal-tabs a,
    .ikhtibar-portal-tabs a {
        font-size: 0.78rem;
    }
}

.table-responsive {
    border-radius: var(--radius-md);
    border: 1px solid var(--card-border);
    overflow: hidden;
    background: rgba(255, 255, 255, 0.45);
}

[data-theme="dark"] .table-responsive {
    background: rgba(15, 23, 42, 0.4);
}

.table-responsive .table {
    margin-bottom: 0;
}

.table thead th {
    background: var(--table-head);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 700;
    color: #475569;
    border-bottom-width: 1px;
    vertical-align: middle;
    padding-top: 0.85rem;
    padding-bottom: 0.85rem;
}

.table tbody td {
    vertical-align: middle;
    padding-top: 0.72rem;
    padding-bottom: 0.72rem;
}

.table-hover > tbody > tr:hover > * {
    background-color: rgba(8, 145, 178, 0.06);
}

[data-theme="dark"] .table-hover > tbody > tr:hover > * {
    background-color: rgba(8, 145, 178, 0.12);
}

.form-control,
.form-select {
    border-radius: var(--radius-sm);
    border-color: rgba(148, 163, 184, 0.45);
    padding: 0.52rem 0.85rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--app-secondary);
    box-shadow: 0 0 0 0.2rem rgba(8, 145, 178, 0.2);
}

.form-label {
    font-weight: 600;
    font-size: 0.9rem;
    color: #334155;
    margin-bottom: 0.35rem;
}

[data-theme="dark"] .form-label {
    color: #cbd5e1;
}

.btn-outline-primary,
.btn-outline-success,
.btn-outline-secondary,
.btn-outline-danger,
.btn-outline-warning,
.btn-outline-info {
    font-weight: 600;
    border-width: 1.5px;
}

.badge {
    font-weight: 600;
    padding: 0.35em 0.65em;
    border-radius: 8px;
}

.pagination .page-link {
    border-radius: var(--radius-sm);
    font-weight: 600;
    margin: 0 2px;
    border: 1px solid var(--card-border);
}

.modal-content {
    border-radius: var(--radius-lg);
    border: 1px solid var(--card-border);
    box-shadow: 0 24px 48px rgba(15, 23, 42, 0.18);
}

/* Modal atur hak akses user — area geser + tombol naik/turun */
.modal-perm-access .modal-dialog {
    max-height: calc(100vh - 2rem);
    max-height: calc(100dvh - 2rem);
    margin-top: 1rem;
    margin-bottom: 1rem;
}

.modal-perm-access .modal-content {
    max-height: calc(100vh - 2rem);
    max-height: calc(100dvh - 2rem);
    display: flex;
    flex-direction: column;
}

.modal-perm-access .modal-header,
.modal-perm-access .modal-footer {
    flex-shrink: 0;
}

.modal-perm-access .modal-body {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
}

.perm-access-toolbar {
    flex-shrink: 0;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--card-border);
    background: var(--card-bg, #fff);
    position: sticky;
    top: 0;
    z-index: 2;
}

.perm-access-scroll-wrap {
    position: relative;
    flex: 1 1 auto;
    min-height: 12rem;
    max-height: min(58vh, 520px);
}

.perm-access-scroll {
    height: 100%;
    max-height: min(58vh, 520px);
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    padding: 0.75rem 1rem 1rem;
    padding-right: 2.75rem;
}

.perm-access-scroll-fab {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    z-index: 3;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.perm-access-scroll-fab .btn {
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.15);
}

.perm-access-jump {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.5rem;
}

.perm-access-jump .btn {
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
}

.perm-group[data-group="keuangan"] {
    scroll-margin-top: 0.5rem;
}

@media (max-width: 575.98px) {
    .modal-perm-access .modal-dialog {
        margin: 0;
        max-width: 100%;
        max-height: 100vh;
        max-height: 100dvh;
    }
    .modal-perm-access .modal-content {
        border-radius: 0;
        max-height: 100vh;
        max-height: 100dvh;
    }
    .modal-perm-access .perm-access-scroll {
        padding-right: 1rem;
    }
    .modal-perm-access .perm-access-scroll-fab {
        display: none;
    }
}

.perm-check-block {
    padding: 0.35rem 0.45rem;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.02);
    height: 100%;
}

.perm-submenu-list {
    list-style: none;
    max-height: 7.5rem;
    overflow: auto;
}

.perm-submenu-list li {
    line-height: 1.35;
    padding: 0.05rem 0;
}

.perm-submenu-list .font-monospace {
    font-size: 0.68rem;
}

.dropdown-menu {
    border-radius: var(--radius-md);
    border: 1px solid var(--card-border);
    box-shadow: var(--shadow-card-hover);
}

.list-group-item {
    border-color: var(--card-border);
}

.nav-tabs .nav-link {
    font-weight: 600;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

.nav-tabs .nav-link.active {
    color: var(--app-primary);
    border-color: var(--card-border) var(--card-border) transparent;
}

.card-header {
    font-weight: 700;
    border-bottom: 1px solid var(--card-border);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0 !important;
    padding: 1rem 1.25rem;
}

.offcanvas-header {
    border-bottom: 1px solid var(--card-border);
}

.offcanvas-title {
    font-weight: 700;
}

/* Desktop: sidebar + konten sejajar; sidebar bisa disembunyikan */
@media (min-width: 992px) {
    .app-frame {
        flex-direction: row;
        align-items: stretch;
    }

    .app-frame-main {
        flex: 1 1 auto;
        min-width: 0;
        width: 100%;
    }

    html.app-sidebar-hidden-boot .app-sidebar--desktop,
    .app-body-shell.app-sidebar-hidden .app-sidebar--desktop {
        width: 0 !important;
        max-width: 0 !important;
        min-width: 0 !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        opacity: 0;
        pointer-events: none;
        border-right-color: transparent;
        box-shadow: none;
        overflow: hidden;
    }

    html.app-sidebar-hidden-boot .app-sidebar--desktop > *,
    .app-body-shell.app-sidebar-hidden .app-sidebar--desktop > * {
        visibility: hidden;
    }

    html.app-sidebar-hidden-boot .app-brand-link.d-lg-none,
    .app-body-shell.app-sidebar-hidden .app-topbar-left .app-brand-link.d-lg-none {
        display: inline-flex !important;
    }

    html.app-sidebar-hidden-boot .app-topbar-page.d-none.d-lg-flex,
    .app-body-shell.app-sidebar-hidden .app-topbar-page.d-none.d-lg-flex {
        display: flex !important;
        flex-direction: column;
        min-width: 0;
    }

    html.app-sidebar-hidden-boot #appMenuBtnDesktop,
    .app-body-shell.app-sidebar-hidden #appMenuBtnDesktop {
        display: inline-flex !important;
    }
}

/* Responsif konten utama */
.app-main {
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.app-main .table-responsive {
    -webkit-overflow-scrolling: touch;
}

.app-main img,
.app-main video,
.app-main canvas,
.app-main svg {
    max-width: 100%;
    height: auto;
}

@media (max-width: 991.98px) {
    .app-shell {
        padding-left: max(0.5rem, env(safe-area-inset-left, 0px));
        padding-right: max(0.5rem, env(safe-area-inset-right, 0px));
        padding-bottom: max(1.5rem, env(safe-area-inset-bottom, 0px));
    }
}

@media (max-width: 575.98px) {
    .app-shell {
        padding-left: max(0.4rem, env(safe-area-inset-left, 0px));
        padding-right: max(0.4rem, env(safe-area-inset-right, 0px));
    }

    .app-main .card-body {
        padding-left: 0.85rem;
        padding-right: 0.85rem;
    }
}

[data-theme="dark"] .app-sidebar--desktop {
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    border-right-color: rgba(71, 85, 105, 0.5);
}

[data-theme="dark"] .app-sidebar-nav-label--toggle {
    border-color: rgba(45, 212, 191, 0.28);
    background: linear-gradient(135deg, rgba(15, 118, 110, 0.22) 0%, rgba(30, 41, 59, 0.65) 100%);
}

[data-theme="dark"] .app-sidebar-nav-label--toggle:hover,
[data-theme="dark"] .app-sidebar-nav-label--toggle:focus-visible {
    border-color: rgba(45, 212, 191, 0.45);
    background: linear-gradient(135deg, rgba(15, 118, 110, 0.32) 0%, rgba(30, 41, 59, 0.75) 100%);
}

[data-theme="dark"] .app-sidebar-nav-label__arrow {
    background: #0d9488;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

[data-theme="dark"] .app-sidebar-hide-btn {
    background: rgba(15, 23, 42, 0.65);
    border-color: rgba(71, 85, 105, 0.45);
    color: #cbd5e1;
}

[data-theme="dark"] .app-sidebar-hide-btn:hover {
    background: rgba(15, 118, 110, 0.22);
    color: #99f6e4;
}

[data-theme="dark"] .app-topbar-menu-btn--mobile {
    background: rgba(15, 23, 42, 0.4);
    border-color: rgba(148, 163, 184, 0.35);
    color: #f1f5f9;
}

[data-theme="dark"] .app-topbar-menu-btn--desktop {
    background: rgba(15, 23, 42, 0.35);
    border-color: rgba(148, 163, 184, 0.35);
}

[data-theme="dark"] .app-mobile-sidebar__header {
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    border-bottom-color: rgba(71, 85, 105, 0.45);
}

[data-theme="dark"] .app-sidebar-footer {
    border-top-color: rgba(71, 85, 105, 0.45);
}

[data-theme="dark"] .app-sidebar-brand {
    border-bottom-color: rgba(71, 85, 105, 0.45);
}

[data-theme="dark"] .app-sidebar-brand-title {
    color: #f1f5f9;
}

[data-theme="dark"] .app-sidebar-brand-tagline {
    color: #94a3b8;
}

.table {
    font-size: 0.92rem;
}

#qr-reader,
#qr-reader-kembali {
    border: 1px dashed #67a1d9 !important;
    border-radius: 12px !important;
    overflow: hidden;
    background: #fff;
}

/* Sembunyikan teks hasil decode QR dari library html5-qrcode */
#qr-reader__dashboard_section_csr,
#qr-reader__dashboard_section_swaplink,
#qr-reader__dashboard_section_fsr,
#qr-reader-kembali__dashboard_section_csr,
#qr-reader-kembali__dashboard_section_swaplink,
#reader__dashboard_section_csr,
#reader__dashboard_section_swaplink,
#money_reader__dashboard_section_csr,
#money_reader__dashboard_section_swaplink {
    display: none !important;
}

.scan-camera-box {
    width: 100%;
    min-height: 320px;
}

.scan-camera-box video {
    width: 100% !important;
    border-radius: 10px;
}

/* Kop rekap: hanya muncul saat dicetak, gaya identik dengan kop Surat Izin (perizinan/surat.php). */
.print-kop {
    display: none;
}

.print-kop-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 7px;
    border-bottom: 2px solid #0f172a;
    position: relative;
}

.print-kop-row::after {
    content: "";
    display: block;
    position: absolute;
    bottom: -6px;
    left: 0;
    right: 0;
    border-bottom: 1px solid #334155;
}

.print-kop-logo {
    width: 52px;
    height: 52px;
    min-width: 52px;
    min-height: 52px;
    object-fit: contain;
    border-radius: 999px;
    border: 1px solid #d1d5db;
    background: #fff;
}

.print-kop-brand {
    flex: 1;
    text-align: center;
}

.print-kop-small {
    margin: 0;
    font-size: 8.7pt;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: #0f172a;
}

.print-kop-title {
    margin: 0;
    font-size: 14.5pt;
    color: #065f46;
    font-weight: 800;
    text-transform: uppercase;
    line-height: 1.1;
}

.print-kop-addr {
    margin: 0;
    font-size: 7.7pt;
    font-style: italic;
    color: #334155;
}

.print-kop-contact {
    margin-top: 1px;
    font-size: 7.4pt;
    color: #475569;
}

.print-kop-meta {
    margin: 10px 0 4px;
    font-size: 7.3pt;
    color: #64748b;
    font-style: italic;
    text-align: right;
}

@media print {
    .print-kop {
        display: block !important;
        margin: 0 0 10px;
        padding: 0;
        border: none;
        background: transparent;
        box-shadow: none;
    }
}

[data-theme="dark"] .text-muted {
    color: #a8b3c2 !important;
}

[data-theme="dark"] h1,
[data-theme="dark"] h2,
[data-theme="dark"] h3,
[data-theme="dark"] h4,
[data-theme="dark"] h5,
[data-theme="dark"] h6,
[data-theme="dark"] p,
[data-theme="dark"] li,
[data-theme="dark"] small,
[data-theme="dark"] strong,
[data-theme="dark"] span,
[data-theme="dark"] label,
[data-theme="dark"] .card-title,
[data-theme="dark"] .card-text {
    color: var(--app-text);
}

[data-theme="dark"] a {
    color: #7dd3fc;
}

[data-theme="dark"] a:hover {
    color: #bae6fd;
}

[data-theme="dark"] .app-sidebar-inner,
[data-theme="dark"] .offcanvas,
[data-theme="dark"] .offcanvas-body,
[data-theme="dark"] .offcanvas-header {
    background: #0f172a;
    color: #e2e8f0;
}

[data-theme="dark"] .app-menu-link {
    color: #cbd5e1;
}

[data-theme="dark"] .app-menu-link:hover {
    background: #1e293b;
    color: #fff;
}

[data-theme="dark"] .table,
[data-theme="dark"] .form-label {
    color: var(--app-text);
}

[data-theme="dark"] .table {
    border-color: #334155;
}

[data-theme="dark"] .table > :not(caption) > * > * {
    border-color: #334155;
}

[data-theme="dark"] .table thead th {
    background: #1f2937;
    color: #f8fafc;
}

[data-theme="dark"] .table-striped > tbody > tr:nth-of-type(odd) > * {
    background-color: rgba(30, 41, 59, 0.72);
    color: #e2e8f0;
}

[data-theme="dark"] .table-striped > tbody > tr:nth-of-type(even) > * {
    background-color: rgba(15, 23, 42, 0.86);
    color: #e2e8f0;
}

[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select,
[data-theme="dark"] .btn-outline-secondary,
[data-theme="dark"] .btn-outline-dark {
    background-color: #0b1220;
    color: #f1f5f9;
    border-color: #475569;
}

[data-theme="dark"] .form-control::placeholder {
    color: #9fb0c7;
}

[data-theme="dark"] .form-control:focus,
[data-theme="dark"] .form-select:focus {
    background-color: #0b1220;
    color: #f8fafc;
    border-color: #38bdf8;
    box-shadow: 0 0 0 0.2rem rgba(56, 189, 248, 0.2);
}

[data-theme="dark"] .form-check-input {
    background-color: #0b1220;
    border-color: #64748b;
}

[data-theme="dark"] .form-check-input:checked {
    background-color: #0ea5e9;
    border-color: #0ea5e9;
}

[data-theme="dark"] .input-group-text {
    background-color: #111827;
    border-color: #475569;
    color: #e2e8f0;
}

[data-theme="dark"] .card-header {
    background: #0b1220 !important;
    border-bottom-color: #475569;
}

[data-theme="dark"] .alert-info,
[data-theme="dark"] .alert-warning,
[data-theme="dark"] .alert-success,
[data-theme="dark"] .alert-danger {
    color: #f8fafc;
    border-color: transparent;
}

[data-theme="dark"] #qr-reader,
[data-theme="dark"] #qr-reader-kembali {
    background: #0b1220;
    border-color: #38bdf8 !important;
}

/* Rekap poin — ringkasan cepat */
.poin-stat-tile {
    border-radius: 14px;
    border-left: 4px solid var(--app-primary);
    height: 100%;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.poin-stat-tile:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.09);
}

.poin-stat-tile .poin-stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.poin-stat-tile.poin-stat--danger {
    border-left-color: #dc3545;
}

.poin-stat-tile.poin-stat--success {
    border-left-color: #198754;
}

.poin-stat-tile.poin-stat--neutral {
    border-left-color: #64748b;
}

.poin-stat-tile.poin-stat--accent {
    border-left-color: #0891b2;
}

.poin-priority-panel {
    border-radius: 16px;
    border: 1px solid rgba(220, 53, 69, 0.35);
    background: linear-gradient(135deg, rgba(254, 242, 242, 0.88) 0%, rgba(255, 255, 255, 0.96) 48%);
}

[data-theme="dark"] .poin-priority-panel {
    background: linear-gradient(135deg, rgba(127, 29, 29, 0.28) 0%, rgba(15, 23, 42, 0.94) 50%);
    border-color: rgba(248, 113, 113, 0.35);
}

.poin-tindakan-card {
    border-radius: 14px;
    border: 1px solid var(--card-border);
    background: var(--card-bg);
}

.poin-tindakan-card .poin-tindakan-meta {
    border-right: 1px solid var(--card-border);
}

@media (max-width: 991px) {
    .poin-tindakan-card .poin-tindakan-meta {
        border-right: none;
        border-bottom: 1px solid var(--card-border);
        padding-bottom: 1rem;
        margin-bottom: 0.25rem;
    }
}

.poin-howto {
    border-radius: 12px;
    border: 1px dashed rgba(8, 145, 178, 0.45);
    background: rgba(8, 145, 178, 0.06);
}

[data-theme="dark"] .poin-howto {
    background: rgba(8, 145, 178, 0.12);
    border-color: rgba(56, 189, 248, 0.35);
}

.poin-santri-picker-list {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    margin-top: 2px;
    z-index: 40;
    max-height: 14rem;
    overflow-y: auto;
    background: var(--card-bg, #fff);
}

[data-theme="dark"] .poin-santri-picker-list {
    background: var(--card-bg, #0b1220);
}

.poin-santri-picker-list .list-group-item-action {
    cursor: pointer;
}

.poin-asal-angka {
    background: rgba(8, 145, 178, 0.08);
    border: 1px dashed rgba(8, 145, 178, 0.35);
}

[data-theme="dark"] .poin-asal-angka {
    background: rgba(56, 189, 248, 0.1);
    border-color: rgba(56, 189, 248, 0.3);
}

.poin-keterangan-ringkas {
    max-width: 18rem;
    max-height: 6rem;
    overflow-y: auto;
    line-height: 1.38;
}

.poin-detail-angka-cell {
    min-width: 9.5rem;
}

.poin-row-urgent td {
    background: rgba(254, 243, 199, 0.45) !important;
    box-shadow: inset 4px 0 0 #f59e0b;
}

[data-theme="dark"] .poin-row-urgent td {
    background: rgba(120, 53, 15, 0.35) !important;
    box-shadow: inset 4px 0 0 #fbbf24;
}

.dashboard-poin-alert {
    border-radius: 16px;
    border: 1px solid rgba(220, 53, 69, 0.4);
    background: linear-gradient(145deg, rgba(254, 226, 226, 0.78) 0%, #fff 55%);
    overflow: hidden;
}

[data-theme="dark"] .dashboard-poin-alert {
    background: linear-gradient(145deg, rgba(127, 29, 29, 0.32) 0%, #0b1220 55%);
    border-color: rgba(248, 113, 113, 0.4);
}

.dashboard-poin-alert .dashboard-poin-count {
    font-size: 2.25rem;
    font-weight: 800;
    line-height: 1;
    color: #b91c1c;
    letter-spacing: -0.03em;
}

[data-theme="dark"] .dashboard-poin-alert .dashboard-poin-count {
    color: #fca5a5;
}

.dashboard-poin-list-item {
    background: rgba(255, 255, 255, 0.65);
    border-color: rgba(220, 53, 69, 0.2) !important;
}

[data-theme="dark"] .dashboard-poin-list-item {
    background: rgba(15, 23, 42, 0.65);
    border-color: rgba(248, 113, 113, 0.28) !important;
}

/* === Kompatibilitas perangkat (HP santri, tablet, browser berbeda) === */
html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

.app-main img,
.app-main video,
.app-main svg,
.app-main canvas {
    max-width: 100%;
    height: auto;
}

.app-main pre,
.app-main .table-responsive {
    max-width: 100%;
}

.app-main .card-body:has(> table),
.app-main .card-body:has(> .table),
.app-main .table-scroll-x {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.app-main .btn-group,
.app-main .input-group {
    flex-wrap: wrap;
}

/* Backdrop menu/modal — jangan tertinggal menutupi layar */
body:not(:has(.offcanvas.show)) .offcanvas-backdrop,
body:not(.modal-open) .modal-backdrop {
    display: none !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.offcanvas-backdrop {
    opacity: 0.4 !important;
}

.modal-backdrop {
    opacity: 0.35 !important;
}


/* PWA terpasang — latar splash mengikuti tema teal aplikasi */
html {
    background-color: #0d9488;
}

@media (display-mode: standalone) {
    html,
    body.app-body-shell {
        background-color: #0d9488;
    }

    body.app-body-shell {
        background:
            radial-gradient(900px 320px at -5% -8%, rgba(8, 145, 178, 0.2), transparent 50%),
            radial-gradient(800px 280px at 105% 0%, rgba(34, 197, 94, 0.12), transparent 48%),
            linear-gradient(180deg, var(--app-bg-soft) 0%, var(--app-bg) 100%);
    }
}

@media (max-width: 575.98px) {
    .app-topbar {
        box-shadow: 0 2px 10px rgba(14, 116, 144, 0.16);
    }

    .app-main .row {
        --bs-gutter-x: 0.65rem;
    }

    .app-main .card-header,
    .app-main .card-body {
        padding-left: 0.85rem;
        padding-right: 0.85rem;
    }

    .app-main .table {
        font-size: 0.82rem;
    }

    .app-main .table th.wrap,
    .app-main .table td.wrap,
    .app-main .table .text-wrap-cell {
        white-space: normal;
    }

    .app-main .d-flex.flex-nowrap {
        flex-wrap: wrap !important;
    }
}

/* Tabel rekap — mobile: scroll horizontal kompak; desktop tidak berubah */
@media (max-width: 767.98px) {
    .app-table-mobile .table-responsive,
    .table-responsive.app-table-mobile {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        max-width: 100%;
    }

    .app-table-mobile .table,
    .table-responsive.app-table-mobile .table {
        font-size: 0.75rem;
        margin-bottom: 0;
        width: max-content;
        min-width: 100%;
    }

    .app-table-mobile .table th,
    .app-table-mobile .table td,
    .table-responsive.app-table-mobile .table th,
    .table-responsive.app-table-mobile .table td {
        white-space: nowrap;
        padding: 0.35rem 0.45rem;
        vertical-align: middle;
    }

    .app-table-mobile .table .btn-sm,
    .table-responsive.app-table-mobile .table .btn-sm {
        padding: 0.15rem 0.35rem;
        font-size: 0.7rem;
    }

    .app-table-mobile .table .font-monospace,
    .table-responsive.app-table-mobile .table .font-monospace {
        font-size: 0.7rem;
    }
}

@media (min-width: 768px) {
    .app-table-mobile .table th,
    .app-table-mobile .table td,
    .table-responsive.app-table-mobile .table th,
    .table-responsive.app-table-mobile .table td {
        white-space: inherit;
    }
}

/* Semua tabel di kartu konten — mobile scroll horizontal (desktop tidak diubah) */
@media (max-width: 767.98px) {
    .app-main .card .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        max-width: 100%;
    }

    .app-main .card .table-responsive .table {
        font-size: 0.75rem;
        width: max-content;
        min-width: 100%;
    }

    .app-main .card .table-responsive .table th,
    .app-main .card .table-responsive .table td {
        white-space: nowrap;
        padding: 0.35rem 0.45rem;
    }
}

/* Jadwal — grid mingguan & kartu slot */
.jadwal-stat-row .jadwal-stat-card {
    min-height: 5.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.jadwal-view-tabs .btn.active {
    font-weight: 600;
}

.jadwal-minggu-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(11rem, 1fr));
    gap: 0.65rem;
    overflow-x: auto;
    padding-bottom: 0.25rem;
    -webkit-overflow-scrolling: touch;
}

@media (min-width: 992px) {
    .jadwal-minggu-grid {
        grid-template-columns: repeat(8, minmax(9.5rem, 1fr));
    }
}

.jadwal-minggu-col {
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: 10px;
    background: #fff;
    min-height: 8rem;
    display: flex;
    flex-direction: column;
}

.jadwal-minggu-col--today {
    border-color: rgba(13, 148, 136, 0.55);
    box-shadow: 0 0 0 2px rgba(13, 148, 136, 0.15);
}

.jadwal-minggu-col--dim {
    opacity: 0.45;
}

.jadwal-minggu-col__head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    padding: 0.45rem 0.55rem;
    border-bottom: 1px solid rgba(226, 232, 240, 0.9);
    background: rgba(248, 250, 252, 0.9);
    border-radius: 10px 10px 0 0;
}

.jadwal-minggu-col__today {
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #0f766e;
}

.jadwal-minggu-col__count {
    margin-left: auto;
    font-size: 0.72rem;
    font-weight: 700;
    color: #64748b;
}

.jadwal-minggu-col__body {
    padding: 0.45rem;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    flex: 1;
}

.jadwal-minggu-col__empty {
    padding: 0.75rem 0.35rem;
    text-align: center;
}

.jadwal-minggu-col__more {
    display: block;
    text-align: center;
    padding: 0.35rem 0.25rem;
    color: var(--bs-primary);
    text-decoration: none;
}

.jadwal-minggu-col__more:hover {
    text-decoration: underline;
}

.jadwal-slot-card {
    border: 1px solid rgba(226, 232, 240, 0.95);
    border-radius: 8px;
    padding: 0.45rem 0.5rem;
    background: linear-gradient(180deg, #fff 0%, #f8fafc 100%);
    transition: box-shadow 0.12s ease, border-color 0.12s ease;
}

.jadwal-slot-card:hover {
    border-color: rgba(13, 148, 136, 0.35);
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
}

.jadwal-slot-card__head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    margin-bottom: 0.35rem;
}

.jadwal-slot-card__title {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    font-weight: 600;
    font-size: 0.82rem;
    color: #134e4a;
    margin-bottom: 0.25rem;
}

.jadwal-slot-card__tingkatan {
    display: flex;
    flex-wrap: wrap;
    gap: 0.2rem;
    margin-bottom: 0.25rem;
}

.jadwal-slot-card__meta {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    margin-bottom: 0.35rem;
}

.jadwal-slot-card__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-top: 0.15rem;
}

.jadwal-kat-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.jadwal-kat-dot--jamaah {
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.18);
}

.jadwal-kat-dot--taalim {
    background: linear-gradient(135deg, #14b8a6, #0d9488);
    box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.18);
}

.jadwal-kat-badge {
    font-size: 0.62rem;
    font-weight: 600;
}

.jadwal-kat-badge--jamaah {
    background: rgba(99, 102, 241, 0.12);
    color: #4338ca;
}

.jadwal-kat-badge--taalim {
    background: rgba(13, 148, 136, 0.12);
    color: #0f766e;
}

.jadwal-peta-waktu {
    font-size: 0.88rem;
    font-weight: 700;
    color: #0f766e;
}

.jadwal-slot-card--jamaah {
    border-left: 3px solid #6366f1;
}

.jadwal-slot-card--jamaah .jadwal-peta-waktu {
    color: #4338ca;
}

.btn-outline-indigo {
    color: #4338ca;
    border-color: rgba(99, 102, 241, 0.45);
}

.btn-outline-indigo:hover {
    color: #fff;
    background: #4f46e5;
    border-color: #4f46e5;
}

.jadwal-tab-jamaah.active {
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    border-color: #4f46e5;
    color: #fff;
}

.jadwal-jamaah-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr));
    gap: 0.85rem;
}

.jadwal-jamaah-card {
    border: 1px solid rgba(99, 102, 241, 0.22);
    border-radius: 12px;
    padding: 0.85rem 1rem;
    background: linear-gradient(180deg, #fff 0%, #f8fafc 100%);
}

.jadwal-jamaah-card--off {
    opacity: 0.72;
}

.jadwal-jamaah-card__head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.65rem;
    border-bottom: 1px solid rgba(226, 232, 240, 0.9);
}

.jadwal-jamaah-card__title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #312e81;
}

.jadwal-jamaah-card__now {
    font-size: 0.95rem;
    font-weight: 700;
    color: #4338ca;
    white-space: nowrap;
}

.jadwal-jamaah-time-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.5rem;
    margin-bottom: 0.65rem;
}

.jadwal-jamaah-time-field {
    flex: 1 1 8rem;
    min-width: 0;
}

.jadwal-jamaah-time-sep {
    padding-bottom: 0.35rem;
    font-size: 0.8rem;
    color: #64748b;
    font-weight: 600;
}

.jadwal-jamaah-empty {
    border: 1px dashed rgba(148, 163, 184, 0.5);
    border-radius: 12px;
    background: rgba(248, 250, 252, 0.8);
}

.jadwal-jamaah-kelompok-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
}

@media (min-width: 768px) {
    .jadwal-jamaah-kelompok-row {
        grid-template-columns: 1fr 1fr;
    }
}

.jadwal-jamaah-kelompok {
    border: 1px solid rgba(226, 232, 240, 0.95);
    border-radius: 10px;
    padding: 0.65rem 0.75rem;
    background: rgba(255, 255, 255, 0.7);
}

.jadwal-jamaah-kelompok--putra {
    border-top: 3px solid #0ea5e9;
}

.jadwal-jamaah-kelompok--putri {
    border-top: 3px solid #ec4899;
}

.jadwal-jamaah-kelompok__head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.35rem;
    margin-bottom: 0.35rem;
}

.jadwal-jamaah-kelompok__badge {
    font-weight: 700;
    font-size: 0.88rem;
}

.jadwal-jamaah-kelompok--putra .jadwal-jamaah-kelompok__badge {
    color: #0369a1;
}

.jadwal-jamaah-kelompok--putri .jadwal-jamaah-kelompok__badge {
    color: #be185d;
}

.jadwal-jamaah-kelompok__now {
    color: #475569;
}

.jadwal-jamaah-time-row--compact .jadwal-jamaah-time-field {
    flex: 1 1 6.5rem;
}

.jadwal-jamaah-pisah-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.5rem;
}

@media (min-width: 576px) {
    .jadwal-jamaah-pisah-grid {
        grid-template-columns: 1fr 1fr;
    }
}

[data-theme="dark"] .jadwal-jamaah-kelompok {
    background: rgba(30, 41, 59, 0.45);
    border-color: rgba(148, 163, 184, 0.2);
}

[data-theme="dark"] .jadwal-jamaah-card {
    background: rgba(30, 41, 59, 0.6);
    border-color: rgba(99, 102, 241, 0.3);
}

.jadwal-jamaah-pembimbing-table-wrap {
    max-width: 52rem;
}

.jadwal-jamaah-pembimbing-table__hari {
    width: 6.5rem;
    white-space: nowrap;
}

.jadwal-jamaah-pembimbing-table select {
    min-width: 10rem;
}

.jadwal-legend {
    padding: 0.5rem 0.75rem;
    background: rgba(248, 250, 252, 0.9);
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 0.5rem;
}

.jadwal-legend__items {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.25rem;
    align-items: center;
    font-size: 0.8125rem;
}

.jadwal-legend__item {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

[data-theme="dark"] .jadwal-legend {
    background: rgba(30, 41, 59, 0.5);
    border-color: rgba(148, 163, 184, 0.2);
}

[data-theme="dark"] .jadwal-minggu-col {
    background: var(--bs-body-bg, #1e293b);
    border-color: rgba(148, 163, 184, 0.25);
}

[data-theme="dark"] .jadwal-slot-card {
    background: rgba(30, 41, 59, 0.6);
    border-color: rgba(148, 163, 184, 0.2);
}

/* Responsif global — semua halaman aplikasi */
.app-main {
    min-width: 0;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.app-main .container,
.app-main .container-fluid {
    max-width: 100%;
}

.app-main .table-responsive {
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
}

@media (max-width: 991.98px) {
    .app-shell {
        padding-left: max(0.5rem, env(safe-area-inset-left, 0px));
        padding-right: max(0.5rem, env(safe-area-inset-right, 0px));
        padding-bottom: max(1.5rem, env(safe-area-inset-bottom, 0px));
    }

    .app-main .card-body {
        padding: 0.85rem 0.75rem;
    }

    .app-main .card-header {
        padding: 0.75rem 0.85rem;
    }

    .app-main .btn-toolbar,
    .app-main .page-actions,
    .app-main .d-flex.gap-2 {
        flex-wrap: wrap;
    }

    .app-main h1,
    .app-main .h1 {
        font-size: clamp(1.15rem, 4.5vw, 1.5rem);
        line-height: 1.25;
    }

    .app-main .page-intro {
        font-size: 0.88rem;
    }
}

/* Logo pondok — isi penuh, pinggir putih tipis */
:root {
    --pondok-logo-ring: 2px;
}

.app-sidebar-pondok-logo-wrap,
.app-sidebar-brand-mark--logo,
.app-brand-mark--logo,
.dash-hero-logo-wrap:not(.dash-hero-logo-wrap--placeholder),
.pb-dash-hero-banner__logo-wrap,
.st-id-logo-wrap,
.pb-id-logo-wrap,
.mw-logo-wrap {
    padding: var(--pondok-logo-ring) !important;
}

.app-sidebar-pondok-logo,
.app-sidebar-brand-logo,
.app-brand-logo,
.dash-hero-logo,
.pondok-logo-preview,
.pb-dash-hero-banner__logo,
.st-id-logo,
.pb-id-logo,
.mw-logo,
.koperasi-topbar-logo,
.auth-portal-logo-img,
.auth-portal-kop__logo .logo-ring img,
.auth-portal-hero .logo-ring img,
.wali-login-logo {
    object-fit: cover !important;
    object-position: center center;
    background: #fff;
}

.pb-dash-hero-banner__logo-wrap,
.st-id-logo-wrap,
.pb-id-logo-wrap,
.mw-logo-wrap {
    background: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

@media (max-width: 575.98px) {
    .app-shell {
        padding-left: max(0.4rem, env(safe-area-inset-left, 0px));
        padding-right: max(0.4rem, env(safe-area-inset-right, 0px));
    }

    .app-main .table {
        font-size: 0.82rem;
    }

    .app-main .table td,
    .app-main .table th {
        white-space: nowrap;
    }

    .app-main .table-responsive .table td,
    .app-main .table-responsive .table th {
        white-space: normal;
        word-break: break-word;
    }

    .app-main .form-control,
    .app-main .form-select,
    .app-main textarea.form-control {
        font-size: 16px;
    }

    .app-main .row > [class*="col-"] {
        min-width: 0;
    }

    .app-main .modal-dialog:not(.modal-fullscreen) {
        margin: 0.5rem auto;
        max-width: calc(100% - 1rem);
    }

    .app-main .input-group {
        flex-wrap: wrap;
    }

    .app-main .input-group > .form-control,
    .app-main .input-group > .form-select,
    .app-main .input-group > .btn {
        flex: 1 1 auto;
        min-width: 0;
    }
}

/* Syarat ALPA — tampilan perizinan */
.izin-alpa-cell {
    min-width: 9.5rem;
    max-width: 16rem;
    line-height: 1.35;
}

.izin-alpa-cell__head {
    margin-bottom: 0.2rem;
}

.izin-alpa-cell__badge {
    font-size: 0.68rem;
    font-weight: 600;
    white-space: normal;
    text-align: left;
}

.izin-alpa-cell__stat {
    font-size: 0.78rem;
}

.izin-alpa-cell__stat strong {
    font-weight: 700;
}

.izin-alpa-cell__rule {
    font-size: 0.7rem;
    line-height: 1.3;
}

.izin-alpa-cell__progress-label {
    font-size: 0.65rem;
    margin-top: 0.15rem;
}

.izin-alpa-cell__note {
    line-height: 1.35;
}

.izin-alpa-panel-modal .izin-alpa-cell {
    max-width: none;
}

.izin-alpa-panel-modal .izin-alpa-cell__badge {
    font-size: 0.75rem;
}

.izin-alpa-glosarium {
    font-size: 0.78rem;
    color: var(--bs-secondary-color);
    border-left: 3px solid rgba(var(--bs-warning-rgb), 0.55);
    padding-left: 0.65rem;
    margin-bottom: 0.75rem;
}
