:root {
    color-scheme: dark;
    --page: #121619;
    --surface: rgba(26, 32, 36, 0.66);
    --surface-raised: rgba(34, 42, 46, 0.68);
    --surface-hover: rgba(41, 50, 55, 0.76);
    --border: rgba(190, 205, 198, 0.14);
    --border-strong: rgba(190, 205, 198, 0.23);
    --text: #e7ece9;
    --muted: #a2afaa;
    --subtle: #788780;
    --accent: #b6cba3;
    --accent-strong: #c6d9b4;
    --accent-soft: rgba(182, 203, 163, 0.11);
    --danger: #d9918e;
    --danger-soft: rgba(217, 145, 142, 0.11);
    --radius: 16px;
    --shadow: 0 14px 36px rgba(0, 0, 0, 0.18);
    --ease: cubic-bezier(0.2, 0.75, 0.25, 1);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    overflow-x: hidden;
    color: var(--text);
    background: var(--page);
    font-family: 'Inter', 'Segoe UI', sans-serif;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    width: 80px;
    min-height: 100vh;
    padding: 24px 12px;
    overflow: hidden;
    white-space: nowrap;
    background: linear-gradient(180deg, rgba(28, 36, 39, 0.76), rgba(19, 26, 28, 0.64));
    border-right: 1px solid var(--border);
    box-shadow: 12px 0 40px rgba(0, 0, 0, 0.12), inset -1px 0 0 rgba(255, 255, 255, 0.025);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    transition: width 0.32s var(--ease);
}

.sidebar:hover,
.sidebar:focus-within {
    width: 260px;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding: 0 0 20px 8px;
    border-bottom: 1px solid rgba(210, 223, 215, 0.1);
}

.sidebar-brand img {
    width: auto;
    height: 38px;
    object-fit: contain;
    transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
}

.sidebar-brand img:last-child {
    opacity: 0.58;
    transform: scale(0.9);
}

.sidebar:hover .sidebar-brand img:last-child,
.sidebar:focus-within .sidebar-brand img:last-child {
    opacity: 1;
    transform: scale(1);
}

.nav-label {
    margin: 16px 12px 8px;
    color: var(--subtle);
    font-size: 0.7rem;
    font-weight: 650;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    opacity: 0;
    transform: translateX(-6px);
    transition: opacity 0.22s var(--ease), transform 0.22s var(--ease);
}

.sidebar:hover .nav-label,
.sidebar:focus-within .nav-label {
    opacity: 1;
    transform: translateX(0);
}

.nav-link-custom {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    margin-bottom: 4px;
    padding: 11px 12px;
    border-radius: 10px;
    color: var(--muted);
    font-size: 0.92rem;
    font-weight: 550;
    text-decoration: none;
    transition: color 0.2s ease, background-color 0.2s ease, transform 0.2s ease;
}

.nav-link-custom i {
    min-width: 32px;
    margin-right: 12px;
    font-size: 1.2rem;
    text-align: center;
}

.nav-link-custom span {
    display: inline-block;
    opacity: 0;
    transform: translateX(-6px);
    transition: opacity 0.22s var(--ease), transform 0.22s var(--ease);
}

.sidebar:hover .nav-link-custom span,
.sidebar:focus-within .nav-link-custom span {
    opacity: 1;
    transform: translateX(0);
}

.nav-link-custom:hover {
    color: var(--accent-strong);
    background: rgba(182, 203, 163, 0.09);
}

.nav-link-custom:focus-visible,
.btn-action:focus-visible,
.mode-btn:focus-visible,
.page-link:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

.nav-link-custom.active,
.nav-link-custom.active:hover {
    color: var(--accent-strong);
    background: linear-gradient(100deg, rgba(182, 203, 163, 0.16), rgba(182, 203, 163, 0.055));
    box-shadow: inset 0 0 0 1px rgba(182, 203, 163, 0.16);
    font-weight: 650;
}

.nav-link-custom.active::before {
    position: absolute;
    top: 8px;
    bottom: 8px;
    left: 0;
    width: 3px;
    background: var(--accent);
    border-radius: 0 4px 4px 0;
    content: "";
    box-shadow: 0 0 12px rgba(182, 203, 163, 0.35);
}

.nav-link-custom.menu-logout {
    color: var(--danger) !important;
}

.nav-link-custom.menu-logout:hover {
    color: #e7aaa6 !important;
    background: var(--danger-soft) !important;
    transform: translateX(2px);
}

.nav-link-custom.menu-logout:active {
    color: #fff !important;
    background: var(--danger) !important;
    transform: scale(0.98);
}

.main-content {
    width: calc(100% - 80px);
    margin-left: 80px;
    padding: 30px;
}

.header-card,
.stat-card,
.table-container,
.foto-card {
    background: linear-gradient(145deg, rgba(30, 38, 41, 0.64), rgba(22, 29, 32, 0.54));
    border: 1px solid rgba(199, 215, 205, 0.17);
    box-shadow: 0 16px 42px rgba(0, 0, 0, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.045);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
}

.header-card {
    padding: 24px 30px;
    border-radius: 20px;
}

.header-card .text-secondary,
.stat-card .text-secondary {
    color: var(--muted) !important;
}

.header-card .badge.bg-dark {
    color: var(--accent-strong) !important;
    background: rgba(34, 42, 46, 0.62) !important;
    border-color: var(--border-strong) !important;
    border-radius: 10px;
}

.header-card h4,
.table-container h5 {
    letter-spacing: -0.025em;
}

.stat-card {
    padding: 24px;
    border-radius: 18px;
    transition: transform 0.22s var(--ease), border-color 0.22s ease;
}

.stat-card:hover {
    border-color: rgba(199, 215, 205, 0.28);
    transform: translateY(-2px);
}

.chart-card {
    padding: 24px 26px 18px;
    overflow: hidden;
    background: linear-gradient(145deg, rgba(30, 38, 41, 0.66), rgba(22, 29, 32, 0.56));
    border: 1px solid rgba(199, 215, 205, 0.17);
    border-radius: 20px;
    box-shadow: 0 16px 42px rgba(0, 0, 0, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.045);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
}

.chart-card-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 12px;
}

.chart-card-heading h5 {
    color: var(--text);
    letter-spacing: -0.025em;
}

.chart-caption {
    color: var(--muted);
    font-size: 0.84rem;
}

.live-indicator {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    color: var(--accent-strong);
    background: rgba(182, 203, 163, 0.08);
    border: 1px solid rgba(182, 203, 163, 0.16);
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.09em;
}

.live-dot {
    width: 7px;
    height: 7px;
    background: var(--accent);
    border-radius: 50%;
    box-shadow: 0 0 0 4px rgba(182, 203, 163, 0.1), 0 0 12px rgba(182, 203, 163, 0.45);
    animation: live-pulse 1.8s ease-in-out infinite;
}

.chart-canvas-wrap {
    position: relative;
    height: 260px;
}

@keyframes live-pulse {
    50% {
        opacity: 0.55;
        box-shadow: 0 0 0 6px rgba(182, 203, 163, 0.045), 0 0 8px rgba(182, 203, 163, 0.28);
    }
}

.stat-label {
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 0.84rem;
    font-weight: 550;
}

.stat-value {
    margin-bottom: 0;
    color: var(--text);
    font-size: 2.1rem;
    font-weight: 700;
    letter-spacing: -0.035em;
}

.text-neon {
    color: var(--accent);
}

.table-container {
    width: 100%;
    padding: 24px;
    overflow-x: auto;
    border-radius: var(--radius);
}

.custom-table {
    width: 100%;
    margin-bottom: 0;
    color: var(--text);
}

.custom-table thead th {
    padding: 14px;
    color: var(--muted);
    background: var(--surface-raised);
    border-bottom: 1px solid var(--border);
    font-size: 0.75rem;
    font-weight: 650;
    letter-spacing: 0.055em;
    text-transform: uppercase;
}

.custom-table tbody td {
    padding: 15px 14px;
    color: var(--text);
    background: transparent;
    border-bottom: 1px solid var(--border);
}

.custom-table tbody tr:last-child td {
    border-bottom: 0;
}

.badge-masuk,
.badge-keluar {
    display: inline-block;
    padding: 6px 11px;
    border-radius: 999px;
    font-size: 0.83rem;
    font-weight: 600;
}

.badge-masuk {
    color: var(--accent-strong);
    background: var(--accent-soft);
    border: 1px solid rgba(182, 203, 163, 0.24);
}

.badge-keluar {
    color: var(--danger);
    background: var(--danger-soft);
    border: 1px solid rgba(217, 145, 142, 0.24);
}

.btn-action {
    padding: 6px 12px;
    color: var(--accent-strong);
    background: var(--surface-raised);
    border: 1px solid var(--border-strong);
    border-radius: 8px;
    font-size: 0.84rem;
    text-decoration: none;
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.btn-action:hover {
    color: #20271d;
    background: var(--accent);
    border-color: var(--accent);
}

.main-content .btn-success {
    color: #20271d;
    background: var(--accent);
    border-color: var(--accent);
}

.main-content .btn-success:hover,
.main-content .btn-success:focus {
    color: #20271d;
    background: var(--accent-strong);
    border-color: var(--accent-strong);
}

.main-content .btn-outline-danger {
    color: var(--danger);
    border-color: rgba(217, 145, 142, 0.55) !important;
}

.main-content .btn-outline-danger:hover {
    color: #2b1d1c;
    background: var(--danger);
    border-color: var(--danger) !important;
}

.main-content .btn-outline-secondary {
    color: var(--muted);
    border-color: var(--border-strong);
}

.main-content .btn-outline-secondary:hover {
    color: var(--text);
    background: var(--surface-hover);
    border-color: var(--border-strong);
}

.main-content .alert {
    border-radius: 12px;
}

.main-content .alert-success {
    color: var(--accent-strong) !important;
    background: var(--accent-soft) !important;
    border-color: rgba(182, 203, 163, 0.28) !important;
}

.main-content .alert-danger {
    color: var(--danger) !important;
    background: var(--danger-soft) !important;
    border-color: rgba(217, 145, 142, 0.28) !important;
}

.main-content .alert .btn-close {
    filter: none;
    opacity: 0.7;
}

.main-content .alert .btn-close:hover {
    opacity: 1;
}

.search-input,
.form-control,
.form-select,
.pin-input {
    color: var(--text);
    background: rgba(34, 42, 46, 0.62);
    border: 1px solid var(--border-strong);
    border-radius: 9px;
}

.search-input:focus,
.form-control:focus,
.form-select:focus {
    color: var(--text);
    background: rgba(34, 42, 46, 0.78);
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.form-control::placeholder {
    color: var(--subtle);
}

#clock {
    font-family: 'Inter', 'Segoe UI', sans-serif;
    font-size: 1.05rem;
    font-variant-numeric: tabular-nums;
}

.modal-content-dark {
    color: var(--text);
    background: rgba(26, 32, 36, 0.78);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);
}

.modal-content-dark .modal-header,
.modal-content-dark .modal-footer {
    border-color: var(--border) !important;
}

.modal-content-dark .modal-title {
    color: var(--danger) !important;
}

.modal-content-dark .text-secondary {
    color: var(--muted) !important;
}

.modal-content-dark .text-light {
    color: var(--text) !important;
}

.modal-content-dark .btn-outline-secondary {
    color: var(--muted);
    border-color: var(--border-strong);
}

.modal-content-dark .btn-outline-secondary:hover {
    color: var(--text);
    background: var(--surface-hover);
}

.modal-content-dark .btn-danger {
    color: #2b1d1c;
    background: var(--danger);
    border-color: var(--danger);
}

.modal-content-dark .btn-danger:hover {
    background: #e3a09d;
    border-color: #e3a09d;
}

.modal-content-dark .form-label {
    color: var(--text) !important;
}

.pin-input {
    font-size: 1.45rem;
    letter-spacing: 0.45rem;
    text-align: center;
}

.pin-input:focus {
    color: var(--text);
    background: var(--surface-raised);
    border-color: var(--danger);
    box-shadow: 0 0 0 3px var(--danger-soft);
}

.mode-btn {
    padding: 7px 16px;
    color: var(--muted);
    background: var(--surface-raised);
    border: 1px solid var(--border-strong);
    border-radius: 8px;
    font-weight: 650;
    transition: color 0.2s ease, background-color 0.2s ease;
}

.mode-btn.on-in {
    color: #20271d;
    background: var(--accent);
    border-color: var(--accent);
}

.mode-btn.on-out {
    color: #2b1d1c;
    background: var(--danger);
    border-color: var(--danger);
}

.page-link {
    color: var(--accent-strong);
    background: var(--surface-raised);
    border-color: var(--border-strong);
}

.page-link:hover {
    color: var(--text);
    background: var(--surface-hover);
    border-color: var(--border-strong);
}

.page-item.active .page-link {
    color: #20271d;
    background: var(--accent);
    border-color: var(--accent);
}

.page-item.disabled .page-link {
    color: var(--subtle);
    background: var(--surface);
    border-color: var(--border);
}

.foto-card {
    height: 100%;
    overflow: hidden;
    border-radius: 14px;
    transition: transform 0.22s var(--ease), border-color 0.22s ease;
}

.foto-card:hover {
    border-color: var(--border-strong);
    transform: translateY(-2px);
}

.foto-card img {
    display: block;
    width: 100%;
    height: 190px;
    background: var(--page);
    object-fit: cover;
}

@media (max-width: 991px) {
    .sidebar,
    .sidebar:hover,
    .sidebar:focus-within {
        position: relative;
        width: 100%;
        min-height: auto;
    }

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

    .nav-label,
    .nav-link-custom span {
        opacity: 1;
        transform: none;
    }
}

@media (max-width: 575px) {
    .main-content {
        padding: 16px;
    }

    .header-card,
    .table-container {
        padding: 18px;
    }

    .stat-card {
        padding: 20px;
    }

    .chart-card {
        padding: 20px 18px 14px;
    }

    .chart-canvas-wrap {
        height: 220px;
    }

    .stat-value {
        font-size: 1.8rem;
    }

    .header-card {
        align-items: flex-start !important;
    }

    .header-card > .d-flex {
        width: 100%;
        align-items: flex-start !important;
        gap: 12px !important;
    }

    .table-container > .d-flex > .d-flex {
        flex-wrap: wrap;
    }

    .table-container form {
        width: 100%;
    }

    .table-container form .search-input {
        min-width: 0;
        flex: 1 1 auto;
    }
}

/* Final visual polish */
body:has(.sidebar) {
    background-image:
        linear-gradient(180deg, rgba(12, 17, 18, 0.38), rgba(12, 17, 18, 0.56)),
        var(--page-wallpaper);
}

.sidebar {
    background:
        radial-gradient(ellipse at 0 0, rgba(182, 203, 163, 0.09), transparent 42%),
        linear-gradient(180deg, rgba(26, 34, 36, 0.62), rgba(16, 23, 24, 0.48));
    border-right-color: rgba(224, 233, 225, 0.08);
    box-shadow: 14px 0 50px rgba(0, 0, 0, 0.1);
    -webkit-backdrop-filter: blur(26px) saturate(125%);
    backdrop-filter: blur(26px) saturate(125%);
}

.sidebar-brand {
    padding-bottom: 22px;
    border-bottom-color: rgba(224, 233, 225, 0.075);
}

.nav-label {
    color: rgba(191, 204, 194, 0.62);
    letter-spacing: 0.13em;
}

.nav-link-custom {
    min-height: 44px;
    border: 1px solid transparent;
    border-radius: 13px;
    color: rgba(225, 233, 226, 0.72);
    transition:
        color 0.24s ease,
        background-color 0.24s ease,
        border-color 0.24s ease,
        transform 0.24s var(--ease);
}

.nav-link-custom:hover {
    color: #e5eddc;
    background: rgba(205, 222, 187, 0.075);
    border-color: rgba(205, 222, 187, 0.07);
    transform: translateX(2px);
}

.nav-link-custom.active,
.nav-link-custom.active:hover {
    color: #e0ebd4;
    background:
        linear-gradient(105deg, rgba(182, 203, 163, 0.15), rgba(182, 203, 163, 0.035)),
        rgba(255, 255, 255, 0.015);
    border-color: rgba(204, 222, 186, 0.11);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

.nav-link-custom.active::before {
    top: 10px;
    bottom: 10px;
    width: 2px;
    box-shadow: 0 0 10px rgba(182, 203, 163, 0.28);
}

.header-card,
.stat-card,
.table-container,
.foto-card,
.chart-card {
    background:
        radial-gradient(ellipse at 0 0, rgba(211, 227, 199, 0.045), transparent 52%),
        linear-gradient(145deg, rgba(32, 41, 42, 0.48), rgba(19, 26, 27, 0.34));
    border-color: rgba(218, 231, 221, 0.105);
    border-radius: 24px;
    box-shadow:
        0 22px 58px rgba(0, 0, 0, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.055);
    -webkit-backdrop-filter: blur(24px) saturate(125%);
    backdrop-filter: blur(24px) saturate(125%);
}

.header-card,
.table-container,
.chart-card {
    padding: 27px 30px;
}

.header-card {
    position: relative;
    overflow: hidden;
}

.header-card::after {
    position: absolute;
    top: -72px;
    right: -54px;
    width: 210px;
    height: 150px;
    background: radial-gradient(ellipse, rgba(182, 203, 163, 0.085), transparent 72%);
    content: "";
    pointer-events: none;
}

.stat-card {
    min-height: 128px;
    padding: 25px 26px;
    border-radius: 21px;
}

.stat-card:hover,
.foto-card:hover {
    background:
        radial-gradient(ellipse at 0 0, rgba(211, 227, 199, 0.065), transparent 52%),
        linear-gradient(145deg, rgba(37, 47, 47, 0.56), rgba(22, 30, 30, 0.42));
    border-color: rgba(218, 231, 221, 0.18);
    box-shadow:
        0 24px 60px rgba(0, 0, 0, 0.16),
        inset 0 1px 0 rgba(255, 255, 255, 0.065);
    transform: translateY(-2px);
}

.stat-label {
    color: rgba(194, 207, 198, 0.78);
    letter-spacing: 0.045em;
}

.stat-value {
    letter-spacing: -0.045em;
}

.chart-card {
    border-radius: 24px;
}

.chart-card-heading {
    margin-bottom: 18px;
}

.chart-kicker {
    display: block;
    margin-bottom: 8px;
    color: rgba(182, 203, 163, 0.78);
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.13em;
}

.live-indicator {
    background: rgba(182, 203, 163, 0.055);
    border-color: rgba(182, 203, 163, 0.12);
}

.table-container .table-responsive {
    border: 1px solid rgba(218, 231, 221, 0.055);
    background: rgba(13, 19, 20, 0.13);
}

.custom-table thead th {
    background: rgba(220, 232, 223, 0.035);
}

.custom-table tbody tr:hover td {
    background: rgba(220, 232, 223, 0.028);
}

.modal-content-dark {
    background:
        radial-gradient(ellipse at 0 0, rgba(211, 227, 199, 0.055), transparent 55%),
        rgba(22, 30, 31, 0.74);
    border-color: rgba(218, 231, 221, 0.12);
    box-shadow: 0 28px 80px rgba(0, 0, 0, 0.28);
}

.search-input,
.form-control,
.form-select,
.pin-input {
    background: rgba(19, 27, 28, 0.42);
    border-color: rgba(218, 231, 221, 0.12);
}

.search-input:focus,
.form-control:focus,
.form-select:focus,
.pin-input:focus {
    background: rgba(24, 33, 33, 0.62);
}

@media (max-width: 575px) {
    .header-card,
    .table-container,
    .chart-card {
        padding: 21px 19px;
        border-radius: 20px;
    }

    .stat-card {
        min-height: 116px;
        padding: 21px;
        border-radius: 19px;
    }
}

/* Soft, cohesive dashboard finish */
body:has(.sidebar) {
    background-color: #111817;
    background-image:
        linear-gradient(135deg, rgba(13, 20, 19, 0.28), rgba(13, 20, 19, 0.48)),
        var(--page-wallpaper);
}

.sidebar {
    background: linear-gradient(180deg, rgba(24, 34, 33, 0.68), rgba(16, 24, 24, 0.56));
    border-right: 1px solid rgba(220, 232, 223, 0.09);
    box-shadow: 12px 0 42px rgba(0, 0, 0, 0.13);
    -webkit-backdrop-filter: blur(28px) saturate(130%);
    backdrop-filter: blur(28px) saturate(130%);
}

.sidebar-brand {
    margin-bottom: 24px;
    border-bottom-color: rgba(220, 232, 223, 0.075);
}

.nav-label {
    color: rgba(195, 209, 199, 0.58);
    font-size: 0.66rem;
    letter-spacing: 0.14em;
}

.nav-link-custom {
    min-height: 46px;
    border: 1px solid transparent;
    border-radius: 14px;
    color: rgba(225, 233, 227, 0.7);
    transition:
        color 0.25s var(--ease),
        background 0.25s var(--ease),
        border-color 0.25s var(--ease),
        transform 0.25s var(--ease);
}

.nav-link-custom i {
    color: rgba(196, 211, 199, 0.72);
    transition: color 0.25s ease, transform 0.25s var(--ease);
}

.nav-link-custom:hover {
    color: #eef3e9;
    background: rgba(210, 225, 195, 0.07);
    border-color: rgba(210, 225, 195, 0.07);
    transform: translateX(2px);
}

.nav-link-custom:hover i {
    color: var(--accent-strong);
    transform: scale(1.05);
}

.nav-link-custom.active,
.nav-link-custom.active:hover {
    color: #e5efd9;
    background: linear-gradient(105deg, rgba(182, 203, 163, 0.14), rgba(182, 203, 163, 0.035));
    border-color: rgba(210, 226, 194, 0.1);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

.nav-link-custom.active i {
    color: var(--accent-strong);
}

.nav-link-custom.active::before {
    top: 11px;
    bottom: 11px;
    width: 2px;
    box-shadow: 0 0 9px rgba(182, 203, 163, 0.28);
}

.header-card,
.stat-card,
.table-container,
.foto-card,
.chart-card {
    background:
        radial-gradient(ellipse at 5% 0%, rgba(205, 222, 189, 0.055), transparent 48%),
        linear-gradient(145deg, rgba(31, 41, 41, 0.49), rgba(17, 25, 26, 0.36));
    border: 1px solid rgba(222, 234, 224, 0.105);
    box-shadow:
        0 20px 55px rgba(0, 0, 0, 0.13),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    -webkit-backdrop-filter: blur(24px) saturate(130%);
    backdrop-filter: blur(24px) saturate(130%);
}

.header-card,
.table-container,
.chart-card {
    border-radius: 24px;
}

.header-card {
    padding: 26px 30px;
}

.header-card h4,
.table-container h5,
.chart-card-heading h5 {
    letter-spacing: -0.035em;
}

.stat-card {
    min-height: 126px;
    padding: 25px 26px;
    border-radius: 21px;
    transition: transform 0.28s var(--ease), border-color 0.28s ease, box-shadow 0.28s ease;
}

.stat-card:hover,
.foto-card:hover {
    background:
        radial-gradient(ellipse at 5% 0%, rgba(205, 222, 189, 0.075), transparent 48%),
        linear-gradient(145deg, rgba(39, 50, 49, 0.56), rgba(21, 30, 30, 0.44));
    border-color: rgba(222, 234, 224, 0.19);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.17), inset 0 1px 0 rgba(255, 255, 255, 0.07);
    transform: translateY(-3px);
}

.stat-label {
    color: rgba(200, 213, 203, 0.75);
    font-size: 0.72rem;
    letter-spacing: 0.09em;
}

.stat-value {
    font-size: clamp(1.75rem, 2.4vw, 2.15rem);
    letter-spacing: -0.05em;
}

.chart-card {
    padding: 26px 28px 20px;
}

.chart-card-heading {
    margin-bottom: 20px;
}

.chart-kicker {
    margin-bottom: 7px;
    color: rgba(190, 211, 170, 0.74);
    font-size: 0.64rem;
    letter-spacing: 0.15em;
}

.chart-caption {
    color: rgba(197, 209, 201, 0.65);
}

.live-indicator {
    background: rgba(182, 203, 163, 0.045);
    border-color: rgba(182, 203, 163, 0.11);
}

.table-container {
    padding: 26px 28px;
}

.table-container .table-responsive {
    overflow: hidden;
    border: 1px solid rgba(222, 234, 224, 0.06);
    border-radius: 16px;
    background: rgba(13, 19, 20, 0.12);
}

.custom-table thead th {
    padding-top: 15px;
    padding-bottom: 15px;
    background: rgba(220, 232, 223, 0.035);
    border-bottom-color: rgba(222, 234, 224, 0.09);
}

.custom-table tbody td {
    border-bottom-color: rgba(222, 234, 224, 0.065);
}

.custom-table tbody tr {
    transition: background-color 0.2s ease;
}

.custom-table tbody tr:hover td {
    background: rgba(221, 234, 222, 0.028);
}

.search-input,
.form-control,
.form-select,
.pin-input {
    background-color: rgba(20, 29, 29, 0.46);
    border-color: rgba(222, 234, 224, 0.13);
    border-radius: 12px;
}

.search-input:focus,
.form-control:focus,
.form-select:focus,
.pin-input:focus {
    background-color: rgba(25, 35, 34, 0.66);
}

.modal-content-dark {
    background:
        radial-gradient(ellipse at 5% 0%, rgba(205, 222, 189, 0.06), transparent 50%),
        rgba(20, 29, 29, 0.78);
    border: 1px solid rgba(222, 234, 224, 0.13);
    border-radius: 24px;
    box-shadow: 0 28px 80px rgba(0, 0, 0, 0.28);
    -webkit-backdrop-filter: blur(26px) saturate(130%);
    backdrop-filter: blur(26px) saturate(130%);
}

@media (max-width: 575px) {
    .header-card,
    .table-container,
    .chart-card {
        padding: 21px 19px;
        border-radius: 20px;
    }

    .stat-card {
        min-height: 112px;
        padding: 21px;
        border-radius: 19px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}

@media print {
    body {
        color: #000 !important;
        background: #fff !important;
    }

    .sidebar,
    .no-print {
        display: none !important;
    }

    .main-content {
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .table-container,
    .header-card,
    .stat-card {
        color: #000 !important;
        background: #fff !important;
        border: 1px solid #999 !important;
        box-shadow: none !important;
    }

    .custom-table,
    .custom-table td,
    .custom-table th {
        color: #000 !important;
        background: #fff !important;
        border-color: #999 !important;
    }

    .text-neon,
    .text-white,
    .text-secondary {
        color: #000 !important;
    }

    .badge-masuk,
    .badge-keluar {
        color: #000 !important;
        background: #fff !important;
        border: 1px solid #000 !important;
    }
}

.login-page {
    display: grid;
    min-height: 100vh;
    min-height: 100svh;
    margin: 0;
    padding: 28px 20px;
    place-items: center;
    color: #edf0e9;
    background-color: #18201e;
    background-image:
        linear-gradient(120deg, rgba(13, 20, 19, 0.78), rgba(17, 24, 21, 0.5) 52%, rgba(12, 18, 18, 0.72)),
        url("https://images.unsplash.com/photo-1586528116311-ad8dd3c8310d?auto=format&fit=crop&w=2400&q=85");
    background-position: center;
    background-size: cover;
    background-attachment: fixed;
    font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
}

.login-page .box {
    width: min(100%, 390px);
    max-width: 390px;
    margin: 0;
    padding: 36px;
    overflow: hidden;
    color: #edf0e9;
    background: rgba(22, 29, 27, 0.82);
    border: 1px solid rgba(224, 232, 214, 0.16);
    border-radius: 20px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);
}

.login-page .box h5 {
    margin-bottom: 8px !important;
    color: #edf0e9;
    font-size: 1.35rem;
    font-weight: 650;
    letter-spacing: -0.035em;
}

.login-page .box h5::after {
    display: block;
    width: 42px;
    height: 3px;
    margin-top: 16px;
    background: #c4d5ad;
    border-radius: 999px;
    content: "";
}

.login-page .box form {
    margin-top: 24px;
}

.login-page .box .form-control {
    min-height: 48px;
    padding: 12px 14px;
    color: #edf0e9;
    background: rgba(14, 20, 19, 0.64);
    border: 1px solid rgba(224, 232, 214, 0.2);
    border-radius: 10px;
    transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.login-page .box .form-control::placeholder {
    color: rgba(220, 227, 216, 0.62);
}

.login-page .box .form-control:focus {
    color: #fff;
    background: rgba(14, 20, 19, 0.82);
    border-color: #c4d5ad;
    box-shadow: 0 0 0 3px rgba(196, 213, 173, 0.15);
}

.login-page .box .btn-success {
    min-height: 48px;
    color: #20271d;
    background: #c4d5ad;
    border: 1px solid #c4d5ad;
    border-radius: 10px;
    transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.login-page .box .btn-success:hover,
.login-page .box .btn-success:focus-visible {
    color: #20271d;
    background: #d3e1c0;
    border-color: #d3e1c0;
}

.login-page .box .btn-success:active {
    transform: translateY(1px);
}

.login-page .box .alert-danger {
    color: #f0c5c1;
    background: rgba(118, 49, 46, 0.38);
    border: 1px solid rgba(224, 142, 135, 0.3);
    border-radius: 10px;
}

.login-page .box :focus-visible {
    outline: 2px solid #c4d5ad;
    outline-offset: 3px;
}

@media (max-width: 480px) {
    .login-page {
        padding: 20px 16px;
        background-attachment: scroll;
    }

    .login-page .box {
        padding: 28px 24px;
        border-radius: 18px;
    }
}

body:has(.sidebar) {
    --page-wallpaper: url("https://images.unsplash.com/photo-1586528116311-ad8dd3c8310d?auto=format&fit=crop&w=2400&q=85");
    background-color: #121619;
    background-image:
        linear-gradient(rgba(12, 17, 18, 0.52), rgba(12, 17, 18, 0.66)),
        var(--page-wallpaper);
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    background-attachment: fixed;
}

body:has(.sidebar .nav-link-custom.active[href="index.php"]) {
    --page-wallpaper: url("https://images.unsplash.com/photo-1565610222536-ef125c59da2e?auto=format&fit=crop&w=2400&q=85");
}

body:has(.sidebar .nav-link-custom.active[href="data_barang.php"]) {
    --page-wallpaper: url("https://images.unsplash.com/photo-1586864387789-628af9feed72?auto=format&fit=crop&w=2400&q=85");
}

body:has(.sidebar .nav-link-custom.active[href="transaksi_log.php"]) {
    --page-wallpaper: url("https://images.unsplash.com/photo-1566576721346-d4a3b4eaeb55?auto=format&fit=crop&w=2400&q=85");
}

body:has(.sidebar .nav-link-custom.active[href="galeri.php"]) {
    --page-wallpaper: url("https://images.unsplash.com/photo-1587293852726-70cdb56c2866?auto=format&fit=crop&w=2400&q=85");
}

body:has(.sidebar .nav-link-custom.active[href="laporan.php"]) {
    --page-wallpaper: url("https://images.unsplash.com/photo-1460925895917-afdab827c52f?auto=format&fit=crop&w=2400&q=85");
}

body:has(.sidebar .nav-link-custom.active[href="index.php"]),
body:has(.sidebar .nav-link-custom.active[href="data_barang.php"]),
body:has(.sidebar .nav-link-custom.active[href="transaksi_log.php"]),
body:has(.sidebar .nav-link-custom.active[href="galeri.php"]),
body:has(.sidebar .nav-link-custom.active[href="laporan.php"]) {
    background-image:
        linear-gradient(rgba(12, 17, 18, 0.52), rgba(12, 17, 18, 0.66)),
        var(--page-wallpaper);
}

body:has(.sidebar .nav-link-custom.active[href="index.php"]) .header-card,
body:has(.sidebar .nav-link-custom.active[href="index.php"]) .stat-card,
body:has(.sidebar .nav-link-custom.active[href="index.php"]) .table-container,
body:has(.sidebar .nav-link-custom.active[href="data_barang.php"]) .header-card,
body:has(.sidebar .nav-link-custom.active[href="data_barang.php"]) .stat-card,
body:has(.sidebar .nav-link-custom.active[href="data_barang.php"]) .table-container,
body:has(.sidebar .nav-link-custom.active[href="transaksi_log.php"]) .header-card,
body:has(.sidebar .nav-link-custom.active[href="transaksi_log.php"]) .stat-card,
body:has(.sidebar .nav-link-custom.active[href="transaksi_log.php"]) .table-container,
body:has(.sidebar .nav-link-custom.active[href="galeri.php"]) .header-card,
body:has(.sidebar .nav-link-custom.active[href="galeri.php"]) .stat-card,
body:has(.sidebar .nav-link-custom.active[href="galeri.php"]) .table-container,
body:has(.sidebar .nav-link-custom.active[href="galeri.php"]) .foto-card,
body:has(.sidebar .nav-link-custom.active[href="laporan.php"]) .header-card,
body:has(.sidebar .nav-link-custom.active[href="laporan.php"]) .stat-card,
body:has(.sidebar .nav-link-custom.active[href="laporan.php"]) .table-container {
    background-color: rgba(26, 32, 36, 0.58);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
}

@media (max-width: 991px) {
    body:has(.sidebar) {
        background-attachment: scroll;
    }

    body:has(.sidebar .nav-link-custom.active[href="index.php"]),
    body:has(.sidebar .nav-link-custom.active[href="data_barang.php"]),
    body:has(.sidebar .nav-link-custom.active[href="transaksi_log.php"]),
    body:has(.sidebar .nav-link-custom.active[href="galeri.php"]),
    body:has(.sidebar .nav-link-custom.active[href="laporan.php"]) {
        background-attachment: scroll;
    }
}

@media print {
    body:has(.sidebar .nav-link-custom.active[href="index.php"]),
    body:has(.sidebar .nav-link-custom.active[href="data_barang.php"]),
    body:has(.sidebar .nav-link-custom.active[href="transaksi_log.php"]),
    body:has(.sidebar .nav-link-custom.active[href="galeri.php"]),
    body:has(.sidebar .nav-link-custom.active[href="laporan.php"]) {
        background: #fff !important;
    }
}

/* Softer glass surfaces */
.sidebar {
    background: linear-gradient(165deg, rgba(28, 37, 39, 0.68), rgba(17, 24, 26, 0.54));
    border-right-color: rgba(215, 228, 218, 0.1);
    box-shadow: 10px 0 42px rgba(0, 0, 0, 0.1);
    -webkit-backdrop-filter: blur(22px) saturate(115%);
    backdrop-filter: blur(22px) saturate(115%);
}

.sidebar-brand {
    border-bottom-color: rgba(215, 228, 218, 0.08);
}

.nav-link-custom {
    border-radius: 13px;
    color: rgba(215, 224, 218, 0.72);
}

.nav-link-custom:hover {
    background: rgba(210, 226, 194, 0.075);
}

.nav-link-custom.active,
.nav-link-custom.active:hover {
    background: linear-gradient(100deg, rgba(182, 203, 163, 0.14), rgba(182, 203, 163, 0.035));
    box-shadow: inset 0 0 0 1px rgba(210, 226, 194, 0.1);
}

.header-card,
.stat-card,
.table-container,
.foto-card,
.chart-card {
    position: relative;
    isolation: isolate;
    background: linear-gradient(145deg, rgba(35, 44, 46, 0.54), rgba(22, 29, 31, 0.42));
    border: 1px solid rgba(218, 231, 221, 0.11);
    border-radius: 22px;
    box-shadow:
        0 18px 48px rgba(0, 0, 0, 0.13),
        inset 0 1px 0 rgba(255, 255, 255, 0.055);
    -webkit-backdrop-filter: blur(20px) saturate(118%);
    backdrop-filter: blur(20px) saturate(118%);
    transition:
        background-color 0.25s ease,
        border-color 0.25s ease,
        box-shadow 0.25s ease,
        transform 0.25s var(--ease);
}

.header-card,
.table-container,
.chart-card {
    padding: 26px 28px;
}

.stat-card {
    overflow: hidden;
    padding: 25px;
    border-radius: 20px;
}

.stat-card::after {
    position: absolute;
    z-index: -1;
    top: -54px;
    right: -44px;
    width: 140px;
    height: 140px;
    background: radial-gradient(circle, rgba(196, 213, 173, 0.09), transparent 70%);
    content: "";
    pointer-events: none;
}

.stat-card:hover,
.foto-card:hover {
    background: linear-gradient(145deg, rgba(39, 49, 50, 0.62), rgba(24, 32, 33, 0.5));
    border-color: rgba(218, 231, 221, 0.2);
    box-shadow:
        0 22px 54px rgba(0, 0, 0, 0.17),
        inset 0 1px 0 rgba(255, 255, 255, 0.07);
    transform: translateY(-3px);
}

.chart-card {
    padding-bottom: 20px;
}

.table-container {
    overflow: hidden;
}

.table-container .table-responsive {
    border-radius: 14px;
}

.custom-table thead th {
    background: rgba(231, 239, 232, 0.045);
    border-color: rgba(218, 231, 221, 0.09);
}

.custom-table tbody td {
    border-color: rgba(218, 231, 221, 0.075);
}

.custom-table tbody tr {
    transition: background-color 0.18s ease;
}

.custom-table tbody tr:hover td {
    background: rgba(223, 235, 222, 0.035);
}

.modal-content-dark {
    background: rgba(25, 33, 34, 0.76);
    border-color: rgba(218, 231, 221, 0.14);
    border-radius: 22px;
    -webkit-backdrop-filter: blur(22px) saturate(118%);
    backdrop-filter: blur(22px) saturate(118%);
}

.search-input,
.form-control,
.form-select,
.pin-input {
    background-color: rgba(27, 35, 36, 0.54);
    border-color: rgba(218, 231, 221, 0.14);
    border-radius: 12px;
}

.search-input:focus,
.form-control:focus,
.form-select:focus,
.pin-input:focus {
    background-color: rgba(29, 38, 38, 0.72);
}

@media (max-width: 575px) {
    .header-card,
    .table-container,
    .chart-card {
        padding: 20px 18px;
        border-radius: 18px;
    }

    .stat-card {
        padding: 21px;
        border-radius: 18px;
    }
}
