/*
 * SPPK — Admin Professional UI
 *
 * Lapisan presentasi untuk area aplikasi setelah login. Selector dibatasi
 * pada sidebar, topbar, dan .main-content agar landing, login, register,
 * query PHP, form action, serta JavaScript operasional tetap tidak berubah.
 */

:root {
    --admin-sidebar-width: 256px;
    --admin-sidebar-collapsed-width: 72px;
    --admin-navy: #09212f;
    --admin-navy-deep: #061923;
    --admin-forest: #0d5f56;
    --admin-teal: #129a88;
    --admin-teal-soft: #dff7f2;
    --admin-cyan: #2eb6d1;
    --admin-surface: #f7f3ff;
    --admin-grid-line: rgba(139, 92, 246, 0.11);
    --admin-grid-glow: rgba(196, 181, 253, 0.18);
    --admin-card: #ffffff;
    --admin-line: #e2e8f0;
    --admin-text: #182230;
    --admin-muted: #667085;
    --admin-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
    --admin-shadow-hover: 0 16px 36px rgba(15, 23, 42, 0.10);
}

/* =========================================================
   APPLICATION SHELL
========================================================= */

.sidebar {
    width: var(--admin-sidebar-width);
    padding: 20px 14px 16px;
    background:
        linear-gradient(165deg, var(--admin-navy-deep) 0%, var(--admin-navy) 56%, #0b4f4b 100%);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 8px 0 28px rgba(2, 12, 18, 0.16);
    overflow: visible;
    transition: width 220ms ease, padding 220ms ease, transform 220ms ease;
}

.sidebar-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0 4px 20px;
    padding: 4px 4px 18px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

/* =========================================================
   SPPK PRIMARY SIDEBAR LOGO
   The supplied logo is the sole identity element in the sidebar.
========================================================= */
.sidebar-primary-logo {
    display: block;
    width: min(100%, 112px);
    height: auto;
    max-height: 98px;
    margin: 0 auto;
    object-fit: contain;
    filter: drop-shadow(0 9px 18px rgba(0, 0, 0, 0.24));
}

.sidebar-brand-version {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    margin: 3px 0 0;
    color: rgba(176, 238, 227, 0.76);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.55px;
    line-height: 1;
}

.sidebar-brand-version i {
    color: #75ecd8;
    font-size: 10px;
}

.rkt-global-badge {
    gap: 6px;
    margin-top: 13px;
    padding: 6px 9px;
    border: 1px solid rgba(93, 232, 202, 0.22);
    border-radius: 8px;
    background: rgba(18, 154, 136, 0.16);
    box-shadow: none;
    color: #b8fff1;
    font-size: 10px;
    letter-spacing: 0.55px;
}

.rkt-global-badge i {
    color: #62e6d0;
    font-size: 12px;
}

.sidebar-menu {
    padding: 2px 2px 8px;
    scrollbar-width: none;
}

.sidebar-menu::-webkit-scrollbar {
    width: 0;
    height: 0;
}

#appSidebar .menu-link {
    position: relative;
    gap: 11px;
    min-height: 42px;
    margin: 3px 0;
    padding: 10px 11px;
    overflow: hidden;
    border: 1px solid transparent;
    border-radius: 10px;
    color: rgba(244, 253, 252, 0.82);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.01em;
    transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease, transform 180ms ease;
}

#appSidebar .menu-link i {
    width: 18px;
    color: #9edbd2;
    font-size: 16px;
    text-align: center;
    transition: color 180ms ease;
}

#appSidebar .menu-link:hover {
    transform: translateX(2px);
    border-color: rgba(141, 235, 216, 0.16);
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

#appSidebar .menu-link:hover i {
    color: #73ead6;
}

#appSidebar .menu-active {
    border-color: rgba(90, 234, 209, 0.24);
    border-radius: 10px;
    background: linear-gradient(90deg, rgba(18, 154, 136, 0.38), rgba(40, 184, 207, 0.16));
    box-shadow: none;
}

#appSidebar .menu-active::before {
    position: absolute;
    top: 10px;
    bottom: 10px;
    left: 0;
    width: 3px;
    border-radius: 0 4px 4px 0;
    background: #6ef0d8;
    content: '';
}

#appSidebar .menu-active i,
#appSidebar .menu-active span {
    color: #ffffff !important;
}

/* Shortcut workspace tetap bagian dari navigasi yang sama, namun diberi aksen
   tipis agar akses intelligence, aktivitas, dan peta mudah ditemukan. */
#appSidebar .menu-link-intelligence:not(.menu-active),
#appSidebar .menu-link-activity:not(.menu-active),
#appSidebar .menu-link-map-workspace:not(.menu-active) {
    border-color: transparent;
    background: transparent;
    box-shadow: none;
}

#appSidebar .menu-link-intelligence i {
    color: #b8a5ff;
}

#appSidebar .menu-link-activity i {
    color: #72ead5;
}

#appSidebar .menu-link-map-workspace i {
    color: #86c8ff;
}

#appSidebar .sidebar-menu-badge {
    display: inline-grid;
    place-items: center;
    min-width: 19px;
    height: 19px;
    margin-left: auto;
    padding: 0 5px;
    border: 1px solid rgba(255, 190, 199, 0.72);
    border-radius: 999px;
    background: linear-gradient(135deg, #ef5367, #cf2945);
    box-shadow: 0 4px 10px rgba(207, 41, 69, 0.27);
    color: #ffffff !important;
    font-size: 9px;
    font-weight: 800;
    line-height: 1;
}

/* Aksi sesi dipisahkan secara halus dari menu operasional. */
#appSidebar .menu-link-logout {
    margin-top: 12px;
    border-color: rgba(251, 113, 133, 0.16);
    background: rgba(190, 24, 93, 0.08);
    color: #ffe4ea;
}

#appSidebar .menu-link-logout i {
    color: #fda4af;
}

#appSidebar .menu-link-logout:hover {
    border-color: rgba(251, 113, 133, 0.32);
    background: rgba(225, 29, 72, 0.2);
    color: #ffffff;
}

#appSidebar .menu-link-logout:hover i {
    color: #fecdd3;
}

/* =========================================================
   SIDEBAR ACCOUNT CARD
   Compact identity panel. Nama dan foto berasal dari akun aktif di index.php;
   CSS ini hanya mengatur presentasi agar tidak memakan area navigasi.
========================================================= */
#appSidebar .sidebar-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    margin: 10px 2px 0;
    padding: 9px 10px;
    overflow: hidden;
    border: 1px solid rgba(168, 255, 240, 0.16);
    border-radius: 12px;
    background:
        linear-gradient(135deg, rgba(255,255,255,.10), rgba(124,242,220,.045)),
        linear-gradient(rgba(154,255,235,.055) 1px, transparent 1px),
        linear-gradient(90deg, rgba(154,255,235,.055) 1px, transparent 1px);
    background-size: auto, 18px 18px, 18px 18px;
    box-shadow: 0 8px 18px rgba(1, 12, 20, 0.14);
    text-align: left;
    backdrop-filter: blur(10px);
    transition: border-color 180ms ease, background-color 180ms ease, transform 180ms ease;
}

#appSidebar .sidebar-profile:hover {
    border-color: rgba(132, 242, 219, 0.30);
    transform: translateY(-1px);
}

#appSidebar .sidebar-profile .profile-avatar {
    display: grid;
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    margin: 0;
    overflow: hidden;
    border: 1px solid rgba(192, 255, 244, 0.40);
    border-radius: 50%;
    background: linear-gradient(135deg, #0f806f, #18b978);
    box-shadow: 0 5px 12px rgba(1, 24, 30, 0.24);
    place-items: center;
}

#appSidebar .sidebar-profile .profile-avatar img,
#appSidebar .sidebar-profile .avatar-default {
    display: grid;
    width: 100%;
    height: 100%;
    margin: 0;
    border: 0;
    border-radius: inherit;
    font-size: 17px;
    font-weight: 800;
    line-height: 1;
    object-fit: cover;
    place-items: center;
}

#appSidebar .sidebar-profile .avatar-default {
    color: #ffffff;
    background: linear-gradient(135deg, #0e876d, #1bc770);
}

/* The name and username are one semantic copy group. This keeps long
   account data compact without allowing it to widen the sidebar. */
#appSidebar .sidebar-profile-copy {
    display: grid;
    min-width: 0;
    gap: 2px;
}

#appSidebar .sidebar-profile h5,
#appSidebar .sidebar-profile p {
    min-width: 0;
    margin: 0;
    overflow: hidden;
    color: #f6fffd;
    line-height: 1.25;
    text-align: left;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#appSidebar .sidebar-profile h5 {
    font-size: 12px;
    font-weight: 750;
    letter-spacing: -0.01em;
}

#appSidebar .sidebar-profile p {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #aee9de;
    font-size: 10px;
    font-weight: 600;
}

#appSidebar .sidebar-profile p > span:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#appSidebar .sidebar-profile-presence {
    width: 6px;
    height: 6px;
    flex: 0 0 6px;
    border-radius: 50%;
    background: #62e6d0;
    box-shadow: 0 0 0 3px rgba(98, 230, 208, 0.13);
}

/* Sidebar identity opens a read-only account summary. */
#appSidebar button.sidebar-profile {
    width: calc(100% - 4px);
    font: inherit;
    cursor: pointer;
}

#appSidebar button.sidebar-profile:focus-visible {
    outline: 2px solid #72ead3;
    outline-offset: 2px;
    border-color: rgba(114, 234, 211, 0.5);
}

#appSidebar .sidebar-profile-action {
    margin-left: auto;
    color: #86cfc2;
    font-size: 11px;
    transition: transform 180ms ease, color 180ms ease;
}

#appSidebar button.sidebar-profile:hover .sidebar-profile-action,
#appSidebar button.sidebar-profile:focus-visible .sidebar-profile-action {
    color: #c7fff4;
    transform: translateX(2px);
}

.sidebar-account-modal {
    --account-modal-ink: #15213a;
    --account-modal-muted: #66758f;
    --account-modal-line: rgba(100, 116, 139, 0.16);
    z-index: 2000200;
}

.modal-backdrop.sidebar-account-modal-backdrop {
    z-index: 2000190;
}

.sidebar-account-modal .modal-dialog {
    width: min(520px, calc(100% - 28px));
    max-width: 520px;
    margin-right: auto;
    margin-left: auto;
}

.sidebar-account-modal .modal-content {
    overflow: hidden;
    border: 1px solid rgba(16, 185, 129, 0.24);
    border-radius: 22px;
    background: #ffffff;
    box-shadow: 0 28px 80px rgba(15, 23, 42, 0.28);
}

.sidebar-account-modal__hero {
    position: relative;
    display: flex;
    min-height: 76px;
    align-items: flex-start;
    justify-content: space-between;
    padding: 20px 22px;
    overflow: hidden;
    background:
        radial-gradient(circle at 88% 10%, rgba(129, 230, 217, 0.18), transparent 34%),
        linear-gradient(135deg, #071b1b, #0c3931 58%, #19483c);
}

.sidebar-account-modal__hero::after {
    position: absolute;
    right: -42px;
    bottom: -78px;
    width: 164px;
    height: 164px;
    border: 24px solid rgba(110, 231, 183, 0.08);
    border-radius: 50%;
    content: '';
    pointer-events: none;
}

.sidebar-account-modal__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 10px;
    border: 1px solid rgba(167, 243, 208, 0.2);
    border-radius: 9px;
    background: rgba(16, 185, 129, 0.1);
    color: #a7f3d0;
    font-size: 9px;
    font-weight: 850;
    letter-spacing: 0.09em;
}

.sidebar-account-modal__hero .btn-close {
    position: relative;
    z-index: 1;
    margin: 0;
    opacity: 0.82;
}

.sidebar-account-modal__body {
    padding: 0 22px 20px;
}

.sidebar-account-modal__identity {
    display: flex;
    align-items: center;
    gap: 15px;
    margin: -26px 0 20px;
    position: relative;
    z-index: 2;
}

.sidebar-account-modal__avatar {
    display: grid;
    width: 78px;
    height: 78px;
    flex: 0 0 78px;
    overflow: hidden;
    border: 4px solid #ffffff;
    border-radius: 22px;
    background: linear-gradient(135deg, #0f806f, #22c55e);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.18);
    color: #ffffff;
    font-size: 28px;
    font-weight: 850;
    place-items: center;
}

.sidebar-account-modal__avatar :is(img, span) {
    display: grid;
    width: 100%;
    height: 100%;
    object-fit: cover;
    place-items: center;
}

.sidebar-account-modal__identity h2 {
    margin: 4px 0 1px;
    color: var(--account-modal-ink);
    font-size: 21px;
    font-weight: 850;
    letter-spacing: -0.03em;
}

.sidebar-account-modal__identity p {
    margin: 0;
    color: var(--account-modal-muted);
    font-size: 12px;
    font-weight: 650;
}

.sidebar-account-modal__online {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #047857;
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.sidebar-account-modal__online i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.12);
}

.sidebar-account-modal__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.sidebar-account-modal__item {
    position: relative;
    min-width: 0;
    min-height: 82px;
    padding: 13px 13px 12px 42px;
    border: 1px solid var(--account-modal-line);
    border-radius: 13px;
    background: #f8fafc;
}

.sidebar-account-modal__item > i {
    position: absolute;
    top: 14px;
    left: 13px;
    display: grid;
    width: 22px;
    height: 22px;
    border-radius: 7px;
    background: #e4f8f1;
    color: #078469;
    font-size: 11px;
    place-items: center;
}

.sidebar-account-modal__item span,
.sidebar-account-modal__item strong {
    display: block;
    min-width: 0;
}

.sidebar-account-modal__item span {
    margin-bottom: 5px;
    color: var(--account-modal-muted);
    font-size: 9px;
    font-weight: 750;
    text-transform: uppercase;
    letter-spacing: 0.055em;
}

.sidebar-account-modal__item strong {
    overflow: hidden;
    color: var(--account-modal-ink);
    font-size: 11px;
    line-height: 1.45;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-account-modal__status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 10px;
    padding: 12px 14px;
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: 12px;
    background: #ecfdf5;
    color: #066b50;
    font-size: 11px;
}

.sidebar-account-modal__status span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.sidebar-account-modal__status strong {
    padding: 5px 9px;
    border-radius: 999px;
    background: rgba(16, 185, 129, 0.12);
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.sidebar-account-modal__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 14px 22px;
    border-top: 1px solid var(--account-modal-line);
    background: #f8fafc;
}

.sidebar-account-modal__footer small {
    color: var(--account-modal-muted);
    font-size: 9px;
    line-height: 1.5;
}

.sidebar-account-modal__close {
    min-height: 36px;
    padding: 8px 16px;
    border: 0;
    border-radius: 10px;
    background: linear-gradient(135deg, #0f766e, #16a34a);
    color: #ffffff;
    font-size: 11px;
    font-weight: 800;
}

body.dark .sidebar-account-modal {
    --account-modal-ink: #f3f7ff;
    --account-modal-muted: #aab9ce;
    --account-modal-line: rgba(148, 163, 184, 0.18);
}

body.dark .sidebar-account-modal .modal-content,
body.dark .sidebar-account-modal__body {
    background: #0d1d2d;
}

body.dark .sidebar-account-modal__avatar {
    border-color: #0d1d2d;
}

body.dark .sidebar-account-modal__item {
    background: #13263a;
}

body.dark .sidebar-account-modal__item > i {
    background: rgba(16, 185, 129, 0.15);
    color: #6ee7b7;
}

body.dark .sidebar-account-modal__online {
    color: #6ee7b7;
}

body.dark .sidebar-account-modal__status {
    border-color: rgba(52, 211, 153, 0.2);
    background: rgba(6, 78, 59, 0.28);
    color: #baf3df;
}

body.dark .sidebar-account-modal__footer {
    background: #101f31;
}

@media (max-width: 575.98px) {
    .sidebar-account-modal__body {
        padding-right: 16px;
        padding-left: 16px;
    }

    .sidebar-account-modal__grid {
        grid-template-columns: 1fr;
    }

    .sidebar-account-modal__item {
        min-height: 72px;
    }

    .sidebar-account-modal__footer {
        align-items: stretch;
        padding-right: 16px;
        padding-left: 16px;
        flex-direction: column;
    }

    .sidebar-account-modal__close {
        width: 100%;
    }
}

:is(html.sidebar-is-collapsed, body.sidebar-is-collapsed) #appSidebar .sidebar-profile {
    display: none;
}

.topbar-account-trigger {
    display: none;
}

.main-content {
    width: calc(100% - var(--admin-sidebar-width));
    margin-left: var(--admin-sidebar-width);
    min-width: 0;
    background-color: var(--admin-surface);
    background-image:
        linear-gradient(var(--admin-grid-line) 1px, transparent 1px),
        linear-gradient(90deg, var(--admin-grid-line) 1px, transparent 1px),
        radial-gradient(circle at 16% 2%, var(--admin-grid-glow), transparent 30%);
    background-position: 0 0, 0 0, 0 0;
    background-size: 24px 24px, 24px 24px, 100% 100%;
    transition: width 220ms ease, margin-left 220ms ease;
}

.topbar {
    left: var(--admin-sidebar-width);
    height: 72px;
    padding: 0 28px;
    border-bottom: 1px solid var(--admin-line);
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 2px 16px rgba(15, 23, 42, 0.035);
    backdrop-filter: blur(12px);
    transition: left 220ms ease;
}

.topbar h4 {
    color: #103f3d !important;
    font-size: 21px;
    font-weight: 700 !important;
    letter-spacing: -0.45px;
    line-height: 1.2;
}

.topbar small {
    color: var(--admin-muted) !important;
    font-size: 12px;
    font-weight: 500;
}

.topbar-page-context {
    display: grid;
    flex: 1 1 auto;
    min-width: 0;
    gap: 4px;
}

.topbar-page-context h4 {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.topbar-breadcrumb {
    display: flex;
    align-items: center;
    min-width: 0;
    gap: 6px;
    color: #6b7e89;
}

.topbar-breadcrumb-marker {
    flex: 0 0 auto;
    color: #159a82;
    font-size: 11px;
}

.topbar-breadcrumb ol {
    display: flex;
    align-items: center;
    min-width: 0;
    max-width: min(52vw, 680px);
    margin: 0;
    padding: 0;
    overflow: hidden;
    list-style: none;
}

.topbar-breadcrumb li {
    display: inline-flex;
    align-items: center;
    min-width: 0;
    color: #71838d;
    font-size: 10px;
    font-weight: 650;
    line-height: 1.25;
    white-space: nowrap;
}

.topbar-breadcrumb li + li::before {
    flex: 0 0 auto;
    margin: 0 6px;
    color: #a2b1b8;
    content: '/';
    font-weight: 500;
}

.topbar-breadcrumb :is(a, span) {
    overflow: hidden;
    text-overflow: ellipsis;
}

.topbar-breadcrumb a {
    color: #52736c;
    text-decoration: none;
    transition: color 160ms ease;
}

.topbar-breadcrumb a:hover,
.topbar-breadcrumb a:focus-visible {
    color: #087463;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.topbar-breadcrumb li[aria-current="page"] span {
    color: #16483f;
    font-weight: 800;
}

.topbar-actions {
    flex: 0 0 auto;
}

.live-clock-box {
    gap: 2px;
    padding-right: 2px;
}

.system-status {
    color: #0c8c78;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.8px;
}

#live-clock {
    color: var(--admin-muted);
    font-size: 11px;
    font-weight: 600;
}

.topbar .btn {
    min-height: 36px;
    padding: 7px 13px;
    border-radius: 9px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.01em;
    box-shadow: none;
}

.topbar .btn-outline-success {
    border-color: #b6d9d2;
    color: #0d685d;
}

.topbar .btn-outline-success:hover {
    border-color: #0d776b;
    background: #e7f7f3;
    color: #09584f;
}

.topbar .btn-danger {
    border-color: #d92d20;
    background: #d92d20;
}

.topbar .page-history-controls {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    min-height: 36px;
    padding: 3px;
    border: 1px solid #d5e2e8;
    border-radius: 10px;
    background: #f8fbfc;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.88);
}

.topbar .page-history-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    min-width: 28px;
    height: 28px;
    min-height: 28px;
    padding: 0;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: #0c6e64;
    font-size: 15px;
    line-height: 1;
    transition: background-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.topbar .page-history-button:hover:not(:disabled),
.topbar .page-history-button:focus-visible {
    background: #e3f5f1;
    color: #07564e;
    outline: none;
    transform: translateY(-1px);
}

.topbar .page-history-button:focus-visible {
    box-shadow: 0 0 0 3px rgba(13, 119, 107, 0.18);
}

.topbar .page-history-button:disabled {
    color: #9caeb7;
    cursor: not-allowed;
    opacity: 0.72;
}

.topbar .page-history-divider {
    width: 1px;
    height: 17px;
    background: #dce7eb;
}

.topbar .sidebar-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    min-width: 36px;
    height: 36px;
    min-height: 36px;
    padding: 0;
    border: 1px solid #d5e2e8;
    border-radius: 9px;
    background: #f8fbfc;
    color: #0c6e64;
}

.topbar .sidebar-toggle:hover {
    border-color: #9bcfc6;
    background: #eaf7f4;
    color: #07564e;
    box-shadow: none;
}

.topbar .sidebar-toggle i {
    font-size: 17px;
    transition: transform 220ms ease;
}

/* Global day/night control. It deliberately lives in the shared topbar so
   every authenticated role can change appearance without opening Settings. */
.topbar .global-theme-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 100px;
    height: 36px;
    padding: 4px 10px 4px 5px;
    border: 1px solid #d5e2e8;
    border-radius: 10px;
    background: #f8fbfc;
    color: #173b48;
    font: inherit;
    line-height: 1;
    cursor: pointer;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.88);
    transition: border-color 180ms ease, background-color 180ms ease, color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.topbar .global-theme-toggle:hover {
    border-color: #8ecfc2;
    background: #edf8f5;
    transform: translateY(-1px);
}

.topbar .global-theme-toggle:focus-visible {
    outline: 0;
    box-shadow: 0 0 0 3px rgba(13, 119, 107, 0.18);
}

.global-theme-toggle-icon {
    display: grid;
    width: 27px;
    height: 27px;
    flex: 0 0 27px;
    place-items: center;
    border-radius: 8px;
    background: #fff1c7;
    color: #a15c00;
    font-size: 13px;
    box-shadow: inset 0 0 0 1px rgba(217, 139, 0, 0.13);
    transition: background-color 180ms ease, color 180ms ease, transform 240ms ease;
}

.global-theme-toggle-copy {
    display: grid;
    gap: 2px;
    text-align: left;
}

.global-theme-toggle-label,
.global-theme-toggle-mode {
    color: inherit !important;
    line-height: 1;
}

.global-theme-toggle-label {
    font-size: 8px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    opacity: 0.68;
}

.global-theme-toggle-mode {
    font-size: 11px;
    font-weight: 800;
}

.global-theme-toggle.is-dark .global-theme-toggle-icon {
    transform: rotate(-12deg);
}

:is(html.sidebar-is-collapsed, body.sidebar-is-collapsed) .sidebar {
    width: var(--admin-sidebar-collapsed-width);
    padding: 16px 11px;
    transform: translateX(0);
}

:is(html.sidebar-is-collapsed, body.sidebar-is-collapsed) .main-content {
    width: calc(100% - var(--admin-sidebar-collapsed-width));
    margin-left: var(--admin-sidebar-collapsed-width);
}

:is(html.sidebar-is-collapsed, body.sidebar-is-collapsed) .topbar {
    left: var(--admin-sidebar-collapsed-width);
}

:is(html.sidebar-is-collapsed, body.sidebar-is-collapsed) .sidebar-toggle i {
    transform: rotate(180deg);
}

:is(html.sidebar-is-collapsed, body.sidebar-is-collapsed) .sidebar-logo {
    margin: 0 0 14px;
    padding: 2px 0 14px;
    text-align: center;
}

:is(html.sidebar-is-collapsed, body.sidebar-is-collapsed) .sidebar-primary-logo {
    width: 36px;
    max-height: 36px;
    margin: 0 auto;
}

:is(html.sidebar-is-collapsed, body.sidebar-is-collapsed) .sidebar-brand-version,
:is(html.sidebar-is-collapsed, body.sidebar-is-collapsed) .rkt-global-badge,
:is(html.sidebar-is-collapsed, body.sidebar-is-collapsed) .sidebar-profile {
    display: none;
}

:is(html.sidebar-is-collapsed, body.sidebar-is-collapsed) .sidebar-menu {
    padding: 0;
    overflow: visible;
}

:is(html.sidebar-is-collapsed, body.sidebar-is-collapsed) #appSidebar .menu-link {
    display: flex;
    justify-content: center;
    width: 48px;
    min-width: 48px;
    min-height: 44px;
    margin: 4px 0;
    padding: 0;
    overflow: visible;
}

:is(html.sidebar-is-collapsed, body.sidebar-is-collapsed) #appSidebar .menu-link i {
    width: auto;
    font-size: 18px;
}

:is(html.sidebar-is-collapsed, body.sidebar-is-collapsed) #appSidebar .menu-link span {
    display: none;
}

:is(html.sidebar-is-collapsed, body.sidebar-is-collapsed) #appSidebar .sidebar-menu-badge {
    display: none;
}

:is(html.sidebar-is-collapsed, body.sidebar-is-collapsed) #appSidebar .menu-link::before {
    top: 9px;
    bottom: 9px;
}

:is(html.sidebar-is-collapsed, body.sidebar-is-collapsed) #appSidebar .menu-link::after {
    position: absolute;
    top: 50%;
    left: 57px;
    z-index: 1200;
    min-width: max-content;
    padding: 7px 9px;
    border: 1px solid #d8e6e9;
    border-radius: 7px;
    background: #ffffff;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.14);
    color: #243b53;
    content: attr(data-sidebar-label);
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    opacity: 0;
    pointer-events: none;
    transform: translate(-4px, -50%);
    transition: opacity 150ms ease, transform 150ms ease;
    white-space: nowrap;
}

:is(html.sidebar-is-collapsed, body.sidebar-is-collapsed) #appSidebar .menu-link:hover::after,
:is(html.sidebar-is-collapsed, body.sidebar-is-collapsed) #appSidebar .menu-link:focus-visible::after {
    opacity: 1;
    transform: translate(0, -50%);
}

.content-area {
    min-width: 0;
}

.main-content .content-area {
    min-height: calc(100vh - 72px);
    margin-top: 72px;
    padding: 24px 28px 42px;
}

.main-content .container,
.main-content .container-fluid {
    min-width: 0;
}

.main-content .container-fluid {
    max-width: 1600px;
    margin-right: auto;
    margin-left: auto;
}

/* =========================================================
   SHARED ADMIN SURFACES
========================================================= */

.main-content .card,
.main-content .modal-content,
.main-content .dropdown-menu {
    border: 1px solid var(--admin-line) !important;
    border-radius: 16px !important;
    background: var(--admin-card);
    box-shadow: var(--admin-shadow);
}

.main-content .card {
    overflow: hidden;
}

.main-content .card-body {
    padding: 20px;
}

.main-content .card-body.p-4 {
    padding: 20px !important;
}

.main-content .card h1,
.main-content .card h2,
.main-content .card h3,
.main-content .card h4,
.main-content .card h5,
.main-content .card h6 {
    letter-spacing: -0.02em;
}

.main-content .form-control,
.main-content .form-select,
.main-content textarea,
.main-content .input-group-text {
    min-height: 40px;
    border-color: #d8e1ea;
    border-radius: 9px;
    color: var(--admin-text);
    font-size: 13px;
    box-shadow: none;
}

.main-content .form-control:focus,
.main-content .form-select:focus,
.main-content textarea:focus {
    border-color: #3bb5a4;
    box-shadow: 0 0 0 3px rgba(18, 154, 136, 0.13);
}

.main-content label,
.main-content .form-label {
    margin-bottom: 6px;
    color: #344054;
    font-size: 12px;
    font-weight: 700;
}

.main-content .btn {
    border-radius: 9px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.01em;
    transition: background-color 180ms ease, border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.main-content .btn:hover {
    transform: translateY(-1px);
}

.main-content .btn-success,
.main-content .btn-primary {
    border-color: #0d8174;
    background: #0d8174;
}

.main-content .btn-success:hover,
.main-content .btn-primary:hover {
    border-color: #09695f;
    background: #09695f;
    box-shadow: 0 6px 14px rgba(13, 129, 116, 0.18);
}

.main-content .table {
    margin-bottom: 0;
    color: #344054;
    font-size: 12.5px;
    vertical-align: middle;
}

.main-content .table > :not(caption) > * > * {
    padding: 12px 14px;
    border-color: #edf1f5;
}

.main-content .table thead th {
    border-bottom-width: 1px;
    background: #f8fafc;
    color: #667085;
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: 0.055em;
    text-transform: uppercase;
}

.main-content .table tbody tr {
    transition: background-color 160ms ease;
}

.main-content .table tbody tr:hover {
    background: #f7fbfa;
}

.main-content .badge {
    padding: 5px 8px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.02em;
}

/* =========================================================
   DASHBOARD
========================================================= */

/* Banner dipertahankan di markup, tetapi tidak ditampilkan pada dashboard. */
.main-content #bannerCarousel {
    display: none !important;
}

.main-content .container-fluid > #bannerCarousel {
    margin-bottom: 24px !important;
    overflow: hidden;
    border: 1px solid #d7e4e8;
    border-radius: 18px !important;
    background: #0b2430;
    box-shadow: var(--admin-shadow);
}

.main-content #bannerCarousel .carousel-item,
.main-content #bannerCarousel .banner-image {
    max-width: 100%;
}

.main-content #bannerCarousel .banner-image {
    height: clamp(220px, 25vw, 360px) !important;
    object-fit: cover;
}

.main-content #bannerCarousel .carousel-caption {
    right: auto;
    bottom: 28px;
    left: clamp(20px, 4vw, 54px);
    max-width: min(550px, 72%);
    padding: 0;
    color: #ffffff;
    text-align: left;
    text-shadow: 0 2px 16px rgba(0, 0, 0, 0.42);
}

.main-content #bannerCarousel .carousel-caption h2 {
    margin-bottom: 6px;
    font-size: clamp(20px, 2.1vw, 31px);
    font-weight: 700;
    line-height: 1.18;
}

.main-content #bannerCarousel .carousel-caption p {
    margin-bottom: 0;
    font-size: clamp(12px, 1.15vw, 15px);
    font-weight: 500;
}

.main-content #bannerCarousel .carousel-indicators {
    margin-bottom: 12px;
}

.main-content #bannerCarousel .carousel-indicators button {
    width: 20px;
    height: 3px;
    margin: 0 3px;
    border: 0;
    border-radius: 999px;
}

.main-content .dashboard-section {
    margin-top: 28px;
}

.main-content .section-title {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 0 0 14px;
    color: #243b53;
    font-size: 16px;
    font-weight: 750;
    letter-spacing: -0.02em;
}

.main-content .section-title i {
    color: #0d8174;
    font-size: 17px;
}

.main-content .kpi-card {
    min-height: 138px;
    padding: 18px 20px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.12);
    transition: transform 180ms ease, box-shadow 180ms ease;
}

.main-content .kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--admin-shadow-hover);
}

.main-content .kpi-card.bg-success {
    background: linear-gradient(135deg, #0d7667, #0f9f8f) !important;
}

.main-content .kpi-card.bg-primary {
    background: linear-gradient(135deg, #123d63, #1e7590) !important;
}

.main-content .kpi-card.bg-warning {
    background: linear-gradient(135deg, #9a5b08, #c68118) !important;
}

.main-content .kpi-card.bg-danger {
    background: linear-gradient(135deg, #982f3f, #bd4252) !important;
}

.main-content .kpi-card small {
    font-size: 11px;
    font-weight: 750;
    letter-spacing: 0.055em;
    text-transform: uppercase;
}

.main-content .kpi-card h2 {
    margin-top: 8px;
    font-size: clamp(25px, 2vw, 30px);
    font-weight: 750;
    letter-spacing: -0.045em;
    line-height: 1.12;
}

.main-content .kpi-card span {
    display: block;
    margin-top: 7px;
    font-size: 11.5px;
    font-weight: 500;
}

.main-content .dashboard-card {
    min-height: 132px;
    border-radius: 16px !important;
    transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.main-content .dashboard-card:hover {
    transform: translateY(-2px);
    border-color: #c8e2dc !important;
    box-shadow: var(--admin-shadow-hover);
}

.main-content .dashboard-card .card-body {
    padding: 18px 20px;
}

.main-content .dashboard-card h6,
.main-content .dashboard-card h6.text-muted {
    min-height: 30px;
    margin: 0;
    color: #667085 !important;
    font-size: 11px;
    font-weight: 750;
    letter-spacing: 0.025em;
    line-height: 1.35;
}

.main-content .dashboard-card h2 {
    margin: 8px 0 5px;
    font-size: clamp(23px, 1.8vw, 28px);
    font-weight: 750;
    letter-spacing: -0.045em;
    line-height: 1.08;
}

.main-content .dashboard-card small,
.main-content .dashboard-card .card-body > :not(h2):not(h6):not(.progress) {
    color: #667085 !important;
    font-size: 11.5px;
    font-weight: 550;
    line-height: 1.4;
}

.main-content .dashboard-card .progress,
.main-content .progress {
    height: 6px;
    overflow: hidden;
    border-radius: 999px;
    background: #e8eef2;
}

.main-content .dashboard-card .progress-bar,
.main-content .progress-bar {
    border-radius: inherit;
}

.main-content .quick-live-card {
    min-height: 138px;
    padding: 20px;
    border-radius: 16px;
    box-shadow: var(--admin-shadow);
}

.main-content .quick-menu-modern {
    min-height: 132px;
    padding: 21px 14px;
    border: 1px solid var(--admin-line);
    border-radius: 14px;
    box-shadow: none;
}

.main-content .quick-menu-modern:hover {
    transform: translateY(-2px);
    border-color: #9bd8ce;
    background: #f0faf8;
    color: #0d685d;
}

.main-content .quick-menu-modern i {
    margin-bottom: 10px;
    color: #0f8f80;
    font-size: 28px;
}

.main-content .quick-menu-modern span {
    font-size: 12px;
}

.main-content .summary-card {
    min-height: 118px;
    padding: 18px;
    border: 1px solid var(--admin-line);
    border-radius: 14px;
    box-shadow: none;
}

.main-content .summary-card h3 {
    margin-top: 6px;
    font-size: 23px;
}

.main-content .activity-item,
.main-content .warning-item {
    gap: 11px;
    padding: 10px 0;
}

.main-content .activity-icon,
.main-content .warning-icon {
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    font-size: 15px;
}

.main-content .analytic-icon {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    font-size: 18px;
}

.main-content .warning-text,
.main-content .activity-content {
    font-size: 12px;
}

.main-content canvas,
.main-content img,
.main-content svg {
    max-width: 100%;
}

/* =========================================================
   DARK THEME COMPATIBILITY
========================================================= */

body.dark .main-content {
    background-color: #151126;
    background-image:
        linear-gradient(rgba(196, 181, 253, 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(196, 181, 253, 0.08) 1px, transparent 1px),
        radial-gradient(circle at 16% 2%, rgba(124, 58, 237, 0.18), transparent 30%);
    background-position: 0 0, 0 0, 0 0;
    background-size: 24px 24px, 24px 24px, 100% 100%;
}

body.dark .topbar {
    border-color: #24313e;
    background: rgba(16, 25, 35, 0.96);
}

body.dark .topbar-page-context h4 {
    color: #eefaf6 !important;
}

body.dark .topbar-breadcrumb,
body.dark .topbar-breadcrumb li {
    color: #9cb0ba;
}

body.dark .topbar-breadcrumb-marker {
    color: #6ee7cd;
}

body.dark .topbar-breadcrumb li + li::before {
    color: #617680;
}

body.dark .topbar-breadcrumb a {
    color: #a7cfc5;
}

body.dark .topbar-breadcrumb a:hover,
body.dark .topbar-breadcrumb a:focus-visible,
body.dark .topbar-breadcrumb li[aria-current="page"] span {
    color: #e1fff6;
}

body.dark .topbar .page-history-controls {
    border-color: #314354;
    background: #162433;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

body.dark .topbar .page-history-button {
    color: #8edfd1;
}

body.dark .topbar .page-history-button:hover:not(:disabled),
body.dark .topbar .page-history-button:focus-visible {
    background: #1d3d45;
    color: #d2fff6;
}

body.dark .topbar .page-history-button:disabled {
    color: #647788;
}

body.dark .topbar .page-history-divider {
    background: #314354;
}

body.dark .topbar .global-theme-toggle {
    border-color: #385064;
    background: #162433;
    color: #eef6ff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

body.dark .topbar .global-theme-toggle:hover {
    border-color: #6b70d8;
    background: #1c2b3c;
}

body.dark .global-theme-toggle-icon {
    background: #292752;
    color: #c8c7ff;
    box-shadow: inset 0 0 0 1px rgba(177, 174, 255, 0.18);
}

body.dark .topbar h4,
body.dark .main-content .section-title {
    color: #e7f0f4 !important;
}

body.dark .topbar small,
body.dark #live-clock {
    color: #aab9c5 !important;
}

body.dark .main-content .card,
body.dark .main-content .modal-content,
body.dark .main-content .dropdown-menu {
    border-color: #263544 !important;
    background: #182331;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.2);
}

body.dark .main-content .dashboard-card h6,
body.dark .main-content .dashboard-card h6.text-muted,
body.dark .main-content .dashboard-card small,
body.dark .main-content .dashboard-card .card-body > :not(h2):not(h6):not(.progress),
body.dark .main-content label,
body.dark .main-content .form-label {
    color: #c9d4de !important;
}

body.dark .main-content .form-control,
body.dark .main-content .form-select,
body.dark .main-content textarea,
body.dark .main-content .input-group-text {
    border-color: #354556;
    background: #111b27;
    color: #ecf4f7;
}

body.dark .main-content .table {
    color: #dce7ee;
}

body.dark .main-content .table thead th,
body.dark .main-content .table tbody tr:hover {
    background: #1d2a38;
    color: #b9c9d5;
}

body.dark .main-content .table > :not(caption) > * > * {
    border-color: #2a3948;
}

/* =========================================================
   RESPONSIVE APPLICATION SHELL
========================================================= */

@media (max-width: 1199.98px) {
    :root {
        --admin-sidebar-width: 240px;
    }

    .sidebar-logo h2 {
        font-size: 28px;
    }

    .topbar,
    .main-content .content-area {
        padding-right: 22px;
        padding-left: 22px;
    }
}

@media (max-width: 991.98px) {
    .topbar {
        padding-right: 18px;
        padding-left: 18px;
    }

    .topbar .live-clock-box {
        display: none;
    }

    .main-content .content-area {
        padding: 20px 18px 34px;
    }

    .main-content #bannerCarousel .banner-image {
        height: 250px !important;
    }
}

@media (min-width: 768px) and (max-width: 991.98px) {
    /* Tablet keeps the user identity, but uses a compact row so the sidebar
       remains dedicated to navigation instead of a large profile card. */
    .sidebar-profile {
        display: flex;
        align-items: center;
        gap: 10px;
        margin-top: 10px;
        padding: 10px;
        text-align: left;
    }

    .sidebar-profile .profile-avatar {
        flex: 0 0 auto;
    }

    .sidebar-profile .user-photo,
    .sidebar-profile .profile-initial,
    .sidebar-profile .profile-avatar img,
    .sidebar-profile .avatar-default {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }

    .sidebar-profile-copy {
        flex: 1 1 auto;
        min-width: 0;
    }

    .sidebar-profile h5,
    .sidebar-profile p {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .sidebar-profile h5 {
        margin: 0;
        font-size: 12px;
    }

    .sidebar-profile p {
        margin: 2px 0 0;
        font-size: 10px;
    }
}

@media (max-width: 767.98px) {
    .sidebar {
        position: relative;
        width: 100%;
        height: auto;
        max-height: 286px;
        padding: 14px 12px 10px;
        overflow-y: auto;
        box-shadow: 0 5px 16px rgba(2, 12, 18, 0.16);
    }

    :is(html.sidebar-is-collapsed, body.sidebar-is-collapsed) .sidebar {
        display: block;
        width: 100%;
        min-height: 56px;
        max-height: 56px;
        padding: 7px 8px;
        overflow: hidden;
    }

    :is(html.sidebar-is-collapsed, body.sidebar-is-collapsed) .sidebar-logo,
    :is(html.sidebar-is-collapsed, body.sidebar-is-collapsed) .rkt-global-badge,
    :is(html.sidebar-is-collapsed, body.sidebar-is-collapsed) .sidebar-profile {
        display: none;
    }

    :is(html.sidebar-is-collapsed, body.sidebar-is-collapsed) .sidebar-menu {
        display: flex;
        height: 42px;
        gap: 5px;
        overflow-x: auto;
        overflow-y: hidden;
        padding: 0;
    }

    :is(html.sidebar-is-collapsed, body.sidebar-is-collapsed) #appSidebar .sidebar-menu .menu-link {
        flex: 0 0 40px;
        width: 40px;
        min-width: 40px;
        min-height: 40px;
        height: 40px;
        margin: 0;
    }

    :is(html.sidebar-is-collapsed, body.sidebar-is-collapsed) #appSidebar .sidebar-menu .menu-link::before {
        top: 8px;
        bottom: 8px;
    }

    :is(html.sidebar-is-collapsed, body.sidebar-is-collapsed) #appSidebar .sidebar-menu .menu-link::after {
        display: none;
    }

    .sidebar-logo {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        margin: 0 2px 10px;
        padding: 0 2px 10px;
    }

    .sidebar-logo {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas:
            'logo badge'
            'version badge';
        align-items: center;
        text-align: left;
    }

    .sidebar-primary-logo {
        grid-area: logo;
        width: 66px;
        max-height: 58px;
        margin: 0;
    }

    .sidebar-brand-version {
        grid-area: version;
        margin: 2px 0 0;
        justify-self: start;
    }

    .sidebar-logo .rkt-global-badge {
        grid-area: badge;
    }

    .rkt-global-badge {
        margin-top: 0;
        font-size: 9px;
    }

    .sidebar-menu {
        display: flex;
        gap: 5px;
        overflow-x: auto;
        overflow-y: visible;
        padding: 0 1px 5px;
    }

    #appSidebar .sidebar-menu .menu-link {
        flex: 0 0 auto;
        min-height: 38px;
        margin: 0;
        padding: 9px 10px;
        font-size: 11px;
    }

    /* Android uses a horizontal navigation rail. A full profile card here
       would increase its height and squeeze menu controls, so it moves to the
       compact account trigger in the topbar. */
    .sidebar-profile {
        display: none !important;
    }

    .main-content {
        width: 100%;
        margin-left: 0;
    }

    .topbar {
        position: sticky;
        left: 0;
        height: 64px;
        padding: 0 14px;
    }

    .topbar h4 {
        font-size: 16px;
    }

    .topbar small {
        display: none;
    }

    .topbar .d-flex.gap-3 {
        gap: 7px !important;
    }

    .topbar .btn {
        min-height: 32px;
        padding: 6px 9px;
        font-size: 10px;
    }

    .topbar .sidebar-toggle {
        width: 32px;
        min-width: 32px;
        height: 32px;
        min-height: 32px;
    }

    .topbar .global-theme-toggle {
        width: 32px;
        min-width: 32px;
        height: 32px;
        padding: 2px;
        justify-content: center;
    }

    .topbar .global-theme-toggle-copy {
        display: none;
    }

    .global-theme-toggle-icon {
        width: 26px;
        height: 26px;
        flex-basis: 26px;
        border-radius: 7px;
    }

    .topbar .topbar-account-trigger {
        display: inline-grid;
        width: 34px;
        height: 34px;
        flex: 0 0 34px;
        place-items: center;
        overflow: hidden;
        border: 1px solid #cfe3df;
        border-radius:11px;
        background:#eff9f7;
        box-shadow:0 3px 10px rgba(12, 96, 82, .08);
        text-decoration:none;
        transition:transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
    }

    .topbar .topbar-account-trigger:hover,
    .topbar .topbar-account-trigger:focus-visible {
        border-color:#70cbb9;
        box-shadow:0 5px 13px rgba(12, 96, 82, .14);
        transform:translateY(-1px);
        outline:0;
    }

    .topbar-account-avatar,
    .topbar-account-avatar img,
    .topbar-account-initial {
        display:grid;
        width:26px;
        height:26px;
        place-items:center;
        overflow:hidden;
        border-radius:50%;
    }

    .topbar-account-avatar {
        border:1px solid rgba(13, 128, 102, .28);
        background:linear-gradient(135deg, #0e876d, #18b678);
    }

    .topbar-account-avatar img {
        width:100%;
        height:100%;
        object-fit:cover;
    }

    .topbar-account-initial {
        color:#ffffff;
        font-size:.7rem;
        font-weight:800;
        line-height:1;
    }

    .topbar .page-history-controls {
        min-height: 32px;
        padding: 2px;
        border-radius: 9px;
    }

    .topbar .page-history-button {
        width: 27px;
        min-width: 27px;
        height: 27px;
        min-height: 27px;
    }

    .main-content .content-area {
        min-height: auto;
        margin-top: 0;
        padding: 16px 12px 28px;
    }

    .main-content .container-fluid {
        padding-right: 0;
        padding-left: 0;
    }

    .main-content #bannerCarousel {
        margin-bottom: 18px !important;
        border-radius: 14px !important;
    }

    .main-content #bannerCarousel .banner-image {
        height: 190px !important;
    }

    .main-content #bannerCarousel .carousel-caption {
        right: 16px;
        bottom: 18px;
        left: 16px;
        max-width: none;
    }

    .main-content #bannerCarousel .carousel-caption h2 {
        margin-bottom: 3px;
        font-size: 18px;
    }

    .main-content #bannerCarousel .carousel-caption p {
        display: none;
    }

    .main-content .kpi-card {
        min-height: 122px;
        padding: 16px;
        border-radius: 14px;
    }

    .main-content .dashboard-card {
        min-height: 120px;
        border-radius: 14px !important;
    }

    .main-content .dashboard-card .card-body,
    .main-content .card-body.p-4 {
        padding: 16px !important;
    }

    .main-content .section-title {
        margin-bottom: 11px;
        font-size: 14px;
    }
}

@media (max-width: 420px) {
    .topbar {
        padding-right: 10px;
        padding-left: 10px;
    }

    .topbar h4 {
        font-size: 14px;
        letter-spacing: -0.025em;
    }

    .topbar .d-flex.gap-3 {
        gap: 5px !important;
    }

    .topbar .topbar-account-trigger {
        width:32px;
        height:32px;
        flex-basis:32px;
        border-radius:10px;
    }
}

body.dark .topbar .topbar-account-trigger {
    border-color:#385462;
    background:#182c39;
    box-shadow:0 3px 10px rgba(0, 0, 0, .18);
}

body.dark .topbar .topbar-account-trigger:hover,
body.dark .topbar .topbar-account-trigger:focus-visible {
    border-color:#69c8b4;
    box-shadow:0 5px 13px rgba(0, 0, 0, .26);
}

@media (prefers-reduced-motion: reduce) {
    #appSidebar .menu-link,
    .main-content .btn,
    .main-content .dashboard-card,
    .main-content .kpi-card,
    .main-content .quick-menu-modern,
    .main-content .table tbody tr,
    .sidebar,
    .main-content,
    .topbar,
    .topbar .sidebar-toggle i,
    :is(html.sidebar-is-collapsed, body.sidebar-is-collapsed) #appSidebar .menu-link::after {
        transition: none;
    }
}

/* =========================================================
   GLOBAL THEME SYSTEM
   The dark class is applied by index.php on every route. These
   fallbacks cover shared application, public, and auth surfaces
   while page-specific dark rules retain their visual identity.
========================================================= */

html[data-theme-mode='dark'],
html.dark {
    background: #0e1420;
    color-scheme: dark;
}

body.dark {
    background: #0e1420 !important;
    color: #e7edf7;
}

body.dark .page-shell {
    color: #e7edf7;
}

body.dark .main-content {
    background-color: #151126;
}

body.dark .main-content :is(.bg-white, .bg-light, .bg-body, .list-group-item, .accordion-item, .offcanvas, .modal-content, .dropdown-menu) {
    border-color: #2d3a4c !important;
    background-color: #172131 !important;
    color: #e7edf7 !important;
}

body.dark .main-content :is(.form-control, .form-select, textarea, .modern-input, .modern-select, .input-group-text) {
    border-color: #354556 !important;
    background-color: #111b27 !important;
    color: #edf4f7 !important;
}

body.dark .main-content :is(.form-control, .form-select, textarea, .modern-input, .modern-select)::placeholder {
    color: #8393a5 !important;
}

body.dark .main-content :is(.table, .table-responsive, .dataTables_wrapper) {
    color: #dce7ee;
}

body.dark .main-content :is(.table thead th, .table tbody td, .table tbody tr, .dataTables_wrapper label, .dataTables_info) {
    border-color: #2a3948 !important;
    color: #dce7ee;
}

body.dark .main-content :is(.table-striped > tbody > tr:nth-of-type(odd) > *, .table-hover > tbody > tr:hover > *) {
    color: #edf4f7;
    background-color: #1d2a38 !important;
}

body.dark .main-content :is(.nav-tabs, .nav-pills, .pagination) {
    --bs-nav-link-color: #a9c2d1;
    --bs-nav-link-hover-color: #ffffff;
    --bs-pagination-color: #cfe0ea;
    --bs-pagination-bg: #182331;
    --bs-pagination-border-color: #2b3b4c;
    --bs-pagination-hover-bg: #243447;
    --bs-pagination-hover-color: #ffffff;
}

/* Login and registration are rendered inside .auth-page instead of .main-content. */
body.dark .auth-page,
body.dark .auth-page :is(.login-page, .register-page) {
    background: #0d1421 !important;
    color: #e8eef8;
}

body.dark .auth-page :is(.login-card, .register-card, .modern-alert, .access-info) {
    border-color: #2b3a4d !important;
    background: #172131 !important;
    color: #e8eef8 !important;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.24);
}

body.dark .auth-page :is(.form-label, .login-link, .register-link, .access-info, .auth-page p) {
    color: #c4d0df !important;
}

body.dark .auth-page :is(.modern-input, .textarea-modern) {
    border-color: #354556 !important;
    background: #101925 !important;
}

body.dark .auth-page :is(.modern-input input, .modern-input select, .textarea-modern textarea) {
    background: transparent !important;
    color: #edf4f7 !important;
}

/* Public landing sections have their own markup, so supply deliberate dark surfaces. */
body.dark .page-landing {
    background: #0e1420;
    color: #e8eef8;
}

body.dark .page-landing :is(.gis-section, .fitur-section, .stats-section, .keunggulan-section) {
    background: #111a28 !important;
}

body.dark .page-landing :is(.gis-card, .fitur-card, .stats-card, .keunggulan-box) {
    border-color: #2d3d50 !important;
    background: #182331 !important;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.2) !important;
}

body.dark .page-landing :is(.section-title, .gis-info h2, .fitur-card h3, .stats-card h3, .stats-card h4, .keunggulan-section h2) {
    color: #f1f6ff !important;
}

body.dark .page-landing :is(.section-subtitle, .gis-info p, .fitur-card p, .stats-card p, .keunggulan-box) {
    color: #b7c6d8 !important;
}

/* Public detail pages and simple cards inherit a legible dark fallback. */
body.dark .page-shell:not(.main-content):not(.auth-page) :is(.card, .glass-panel, .content-card, .feature-card, .info-card, .regulasi-card, .about-card, .contact-card, .table-responsive) {
    border-color: #2b3b4d !important;
    background: #172131 !important;
    color: #e8eef8 !important;
}

body.dark .page-shell:not(.main-content):not(.auth-page) :is(h1, h2, h3, h4, h5, h6) {
    color: #f1f6ff;
}

body.dark .page-shell:not(.main-content):not(.auth-page) :is(p, .text-muted, .lead) {
    color: #b7c6d8 !important;
}

@media (prefers-reduced-motion: reduce) {
    body.dark *,
    body.dark *::before,
    body.dark *::after {
        scroll-behavior: auto !important;
    }
}

/* =========================================================
   GLOBAL TYPOGRAPHY CONTRAST
   Semantic colors keep copy legible when the saved theme changes.
   Component-specific colors remain free to override these fallbacks.
========================================================= */
:root {
    --sppk-text-strong: #182230;
    --sppk-text-default: #334155;
    --sppk-text-muted: #5e6e86;
    --sppk-text-subtle: #73829a;
    --sppk-input-text: #1f2b44;
    --sppk-input-placeholder: #71809a;
    --sppk-status-success: #087f5b;
    --sppk-status-primary: #1d63b7;
    --sppk-status-warning: #9a6100;
    --sppk-status-danger: #bf2433;
}

body.dark {
    --sppk-text-strong: #f3f7ff;
    --sppk-text-default: #dce7f3;
    --sppk-text-muted: #b7c5d6;
    --sppk-text-subtle: #91a3b8;
    --sppk-input-text: #f3f7ff;
    --sppk-input-placeholder: #9aabbd;
    --sppk-status-success: #78e5b8;
    --sppk-status-primary: #8dcaff;
    --sppk-status-warning: #ffd166;
    --sppk-status-danger: #ff9eaa;
}

/* Default inherited color for application content. It repairs legacy text
   that does not declare a color without changing the page structure. */
body .main-content,
body .auth-page {
    color: var(--sppk-text-default);
}

body .main-content :is(h1, h2, h3, h4, h5, h6, .card-title, .modal-title, .offcanvas-title, .section-title, .page-title, .table-title),
body .auth-page :is(h1, h2, h3, h4, h5, h6, .card-title, .page-title) {
    color: var(--sppk-text-strong);
}

body .main-content :is(.card, .glass-panel, .modal-content, .offcanvas, .dropdown-menu, .table-responsive, .form-panel),
body .auth-page :is(.login-card, .register-card, .auth-card, .card, .modal-content) {
    color: var(--sppk-text-default);
}

body .main-content :is(.card, .glass-panel, .modal-content, .offcanvas, .dropdown-menu, .table-responsive, .form-panel) :is(h1, h2, h3, h4, h5, h6, .card-title, .modal-title, .offcanvas-title, .section-title, .table-title),
body .auth-page :is(.login-card, .register-card, .auth-card, .card, .modal-content) :is(h1, h2, h3, h4, h5, h6, .card-title, .modal-title) {
    color: var(--sppk-text-strong) !important;
}

body .main-content :is(.card, .glass-panel, .modal-content, .offcanvas, .dropdown-menu, .table-responsive, .form-panel) :is(p, small, .text-muted, .form-text, .description, .subtitle):not(.text-success):not(.text-primary):not(.text-warning):not(.text-danger),
body .auth-page :is(.login-card, .register-card, .auth-card, .card, .modal-content) :is(p, small, .text-muted, .form-text, .description, .subtitle):not(.text-success):not(.text-primary):not(.text-warning):not(.text-danger) {
    color: var(--sppk-text-muted) !important;
}

body .main-content :is(label, .form-label, .form-check-label, th, td, .dropdown-item, .nav-link, .pagination .page-link),
body .auth-page :is(label, .form-label, .form-check-label) {
    color: var(--sppk-text-default);
}

body .main-content :is(input, select, textarea, .form-control, .form-select, .modern-input, .modern-select),
body .auth-page :is(input, select, textarea, .form-control, .form-select) {
    color: var(--sppk-input-text) !important;
}

body .main-content :is(input, textarea, .form-control, .modern-input)::placeholder,
body .auth-page :is(input, textarea, .form-control)::placeholder {
    color: var(--sppk-input-placeholder) !important;
    opacity: 1;
}

/* Bootstrap utility colors may otherwise stay too dark after a dark-mode
   switch. Status messages retain their meaning while gaining contrast. */
body .main-content :is(.text-dark, .text-body),
body .auth-page :is(.text-dark, .text-body) {
    color: var(--sppk-text-strong) !important;
}

body .main-content :is(.text-muted, .text-secondary),
body .auth-page :is(.text-muted, .text-secondary) {
    color: var(--sppk-text-muted) !important;
}

body .main-content .text-success,
body .auth-page .text-success {
    color: var(--sppk-status-success) !important;
}

body .main-content .text-primary,
body .auth-page .text-primary {
    color: var(--sppk-status-primary) !important;
}

body .main-content .text-warning,
body .auth-page .text-warning {
    color: var(--sppk-status-warning) !important;
}

body .main-content .text-danger,
body .auth-page .text-danger {
    color: var(--sppk-status-danger) !important;
}

/* Dashboard masuk sebagai satu workspace utuh. Kelas awal diberikan oleh
   server sebelum CSS dimuat agar kartu, chart, dan panel tidak sempat muncul
   terpisah atau berubah posisi pada frame pertama. */
html.dashboard-view-is-entering .page-shell.page-dashboard .dashboard-workspace {
    opacity: 0;
    pointer-events: none;
    transform: translate3d(0, 8px, 0);
    transition: opacity 180ms ease-out, transform 220ms cubic-bezier(0.2, 0.72, 0.28, 1);
}

html.dashboard-view-is-ready .page-shell.page-dashboard .dashboard-workspace {
    opacity: 1;
    pointer-events: auto;
    transform: translate3d(0, 0, 0);
    transition: opacity 180ms ease-out, transform 220ms cubic-bezier(0.2, 0.72, 0.28, 1);
}

/* =========================================================
   DASHBOARD ONE-SCREEN PREVIEW GATE
   Seluruh fitur Dashboard tetap dirender. Kelas berikut hanya membatasi
   scroll sampai pengguna memilih "Lihat lebih banyak".
========================================================= */
html.dashboard-preview-is-locked,
html.dashboard-preview-is-locked body {
    width: 100%;
    height: 100%;
    overflow: hidden !important;
    overscroll-behavior: none;
}

html.dashboard-preview-is-locked,
html.dashboard-preview-is-expanded {
    scrollbar-gutter: stable;
}

html.dashboard-preview-is-locked .page-shell.page-dashboard {
    height: 100vh;
    height: 100dvh;
    overflow: hidden !important;
}

.page-shell.page-dashboard .dashboard-preview-gate {
    position: fixed;
    right: 0;
    bottom: 0;
    left: var(--admin-sidebar-width);
    z-index: 1020;
    display: flex;
    min-height: 112px;
    align-items: flex-end;
    justify-content: center;
    padding: 22px 18px 18px;
    background: transparent;
    opacity: 0;
    pointer-events: none;
    transform: translate3d(0, 12px, 0);
    transition: left 220ms ease, opacity 220ms ease, transform 260ms cubic-bezier(0.2, 0.72, 0.28, 1);
}

:is(html.sidebar-is-collapsed, body.sidebar-is-collapsed) .page-shell.page-dashboard .dashboard-preview-gate {
    left: var(--admin-sidebar-collapsed-width);
}

html.dashboard-preview-is-locked .page-shell.page-dashboard .dashboard-preview-gate {
    opacity: 1;
    pointer-events: none;
    transform: translate3d(0, 0, 0);
}

.page-shell.page-dashboard .dashboard-preview-trigger {
    display: inline-flex;
    min-width: 202px;
    min-height: 52px;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 8px 9px 8px 17px;
    border: 1px solid rgba(106, 79, 213, 0.25);
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 13px 32px rgba(47, 34, 104, 0.2);
    color: #25314a !important;
    pointer-events: auto;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.page-shell.page-dashboard .dashboard-preview-trigger:hover,
.page-shell.page-dashboard .dashboard-preview-trigger:focus-visible {
    border-color: rgba(105, 75, 223, 0.58);
    box-shadow: 0 16px 37px rgba(47, 34, 104, 0.27);
    transform: translateY(-2px);
}

.page-shell.page-dashboard .dashboard-preview-trigger:focus-visible {
    outline: 3px solid rgba(113, 80, 231, 0.2);
    outline-offset: 3px;
}

.page-shell.page-dashboard .dashboard-preview-trigger-copy {
    display: grid;
    gap: 1px;
    text-align: left;
}

.page-shell.page-dashboard .dashboard-preview-trigger-copy > span {
    color: #17243a !important;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.01em;
}

.page-shell.page-dashboard .dashboard-preview-trigger-copy small {
    color: #66758c !important;
    font-size: 9px;
    font-weight: 650;
    letter-spacing: 0.025em;
}

.page-shell.page-dashboard .dashboard-preview-trigger-icon {
    display: grid;
    width: 35px;
    height: 35px;
    flex: 0 0 35px;
    place-items: center;
    border-radius: 11px;
    background: linear-gradient(135deg, #6847da 0%, #3d77df 100%);
    box-shadow: 0 7px 16px rgba(91, 66, 190, 0.3);
    color: #ffffff !important;
}

.page-shell.page-dashboard .dashboard-preview-trigger-icon i {
    color: inherit !important;
    font-size: 14px;
    animation: dashboard-more-arrow-nudge 1.8s ease-in-out infinite;
}

html.dashboard-preview-is-expanded .page-shell.page-dashboard .dashboard-preview-gate,
html.dashboard-preview-is-opening .page-shell.page-dashboard .dashboard-preview-gate {
    opacity: 0;
    pointer-events: none;
    transform: translate3d(0, 14px, 0);
}

:is(body.dark, html.dark) .page-shell.page-dashboard .dashboard-preview-gate {
    background: transparent;
}

:is(body.dark, html.dark) .page-shell.page-dashboard .dashboard-preview-trigger {
    border-color: rgba(160, 136, 255, 0.34);
    background: #171e2f;
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.4);
    color: #f4f7ff !important;
}

:is(body.dark, html.dark) .page-shell.page-dashboard .dashboard-preview-trigger-copy > span {
    color: #f5f7ff !important;
}

:is(body.dark, html.dark) .page-shell.page-dashboard .dashboard-preview-trigger-copy small {
    color: #b4c0d4 !important;
}

@keyframes dashboard-more-arrow-nudge {
    0%, 100% { transform: translateY(-1px); }
    50% { transform: translateY(3px); }
}

@media (max-width: 575.98px) {
    .page-shell.page-dashboard .dashboard-preview-gate {
        left: 0;
        min-height: 96px;
        padding: 18px 12px 12px;
    }

    .page-shell.page-dashboard .dashboard-preview-trigger {
        min-width: 190px;
        min-height: 48px;
        border-radius: 14px;
    }
}

@media (min-width: 576px) and (max-width: 767.98px) {
    .page-shell.page-dashboard .dashboard-preview-gate,
    :is(html.sidebar-is-collapsed, body.sidebar-is-collapsed) .page-shell.page-dashboard .dashboard-preview-gate {
        left: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    :root {
        scroll-behavior: auto;
    }

    html.dashboard-view-is-entering .page-shell.page-dashboard .dashboard-workspace,
    html.dashboard-view-is-ready .page-shell.page-dashboard .dashboard-workspace {
        opacity: 1;
        pointer-events: auto;
        transform: none;
        transition: none;
    }

    .page-shell.page-dashboard .dashboard-preview-gate,
    .page-shell.page-dashboard .dashboard-preview-trigger,
    .page-shell.page-dashboard .dashboard-preview-trigger-icon i {
        transition: none !important;
        animation: none !important;
    }
}
