
:root {
    --primary: #16866c;
    --primary-dark: #106b56;
    --primary-light: #e9f6f1;
    --background: #f5f7fa;
    --text: #253342;
    --muted: #84909d;
    --border: #e9edf1;
    --white: #ffffff;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background: var(--background);
    color: var(--text);
    font-size: 13px;
}

a {
    text-decoration: none;
    color: inherit;
}

.app-layout {
    min-height: 100vh;
}

/* SIDEBAR */

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 255px;
    background: var(--white);
    border-right: 1px solid var(--border);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    padding: 22px 16px;
    transition: transform .3s ease;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 4px 8px 28px;
}

.brand-icon {
    width: 43px;
    height: 43px;
    border-radius: 13px;
    background: var(--primary);
    color: white;
    display: grid;
    place-items: center;
    font-size: 20px;
}

.sidebar-brand h5 {
    font-size: 15px;
    font-weight: 800;
    margin: 0;
    letter-spacing: .5px;
}

.sidebar-brand small {
    color: var(--muted);
    font-size: 10px;
}

.sidebar-label {
    font-size: 10px;
    color: #a1aab5;
    font-weight: 700;
    letter-spacing: 1px;
    margin: 19px 10px 9px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 13px;
    border-radius: 9px;
    color: #697685;
    font-weight: 500;
    margin-bottom: 4px;
    transition: .2s;
}

.sidebar-link i {
    width: 19px;
    font-size: 15px;
}

.sidebar-link:hover,
.sidebar-link.active {
    color: var(--primary);
    background: var(--primary-light);
}

.sidebar-link.active {
    font-weight: 600;
}

.sidebar-bottom {
    margin-top: auto;
    padding-top: 15px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.admin-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.admin-avatar,
.profile-icon {
    width: 37px;
    height: 37px;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-weight: 700;
}

.admin-text strong,
.profile-info strong {
    display: block;
    font-size: 11px;
}

.admin-text small,
.profile-info small {
    color: var(--muted);
    font-size: 10px;
}

.logout-link {
    color: #e65d5d;
    padding: 9px;
}

/* MAIN */

.main-content {
    margin-left: 255px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.top-navbar {
    height: 76px;
    background: white;
    border-bottom: 1px solid var(--border);
    padding: 0 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 500;
}

.top-navbar h5 {
    font-size: 15px;
    font-weight: 700;
    margin: 0 0 3px;
}

.top-navbar small {
    color: var(--muted);
    font-size: 10px;
}

.navbar-profile {
    display: flex;
    align-items: center;
    gap: 10px;
}

.hamburger-btn {
    width: 38px;
    height: 38px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: white;
    display: grid;
    place-items: center;
    color: var(--text);
    cursor: pointer;
}

.page-content {
    padding: 27px 30px;
    flex: 1;
}

.page-footer {
    padding: 18px 30px;
    border-top: 1px solid var(--border);
    background: white;
    display: flex;
    justify-content: space-between;
    color: var(--muted);
    font-size: 10px;
}

.sidebar-overlay {
    display: none;
}

/* WELCOME */

.welcome-banner {
    background: linear-gradient(120deg, #116d58, #1caa83);
    color: white;
    padding: 28px 32px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 23px;
    overflow: hidden;
}

.welcome-tag {
    font-size: 9px;
    letter-spacing: 1.5px;
    opacity: .8;
    font-weight: 600;
}

.welcome-banner h2 {
    font-size: 21px;
    font-weight: 700;
    margin: 10px 0;
}

.welcome-banner p {
    font-size: 11px;
    margin: 0;
    opacity: .85;
}

.welcome-icon {
    font-size: 75px;
    opacity: .18;
    padding-right: 20px;
}

/* STATISTICS */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 17px;
    margin-bottom: 22px;
}

.stat-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 13px;
    padding: 19px;
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.stat-icon,
.quick-icon {
    width: 46px;
    height: 46px;
    flex-shrink: 0;
    border-radius: 12px;
    display: grid;
    place-items: center;
    font-size: 17px;
}

.green {
    background: #e7f7ef;
    color: #16866c;
}

.blue {
    background: #e9f1ff;
    color: #477de5;
}

.orange {
    background: #fff2e3;
    color: #e49a3e;
}

.red {
    background: #ffeded;
    color: #e05c5c;
}

.stat-card span {
    font-size: 10px;
    color: var(--muted);
}

.stat-card h3 {
    font-size: 19px;
    font-weight: 700;
    margin: 4px 0;
    overflow-wrap: anywhere;
}

.stat-card small {
    color: var(--muted);
    font-size: 9px;
}

/* CONTENT */

.dashboard-grid {
    display: grid;
    grid-template-columns: 1.7fr 1fr;
    gap: 18px;
}

.content-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 13px;
    padding: 22px;
    min-width: 0;
}

.card-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.card-heading h5,
.quick-card h5 {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 5px;
}

.card-heading p,
.quick-card > p {
    color: var(--muted);
    font-size: 10px;
    margin: 0;
}

.card-heading > i {
    font-size: 20px;
    color: var(--primary);
}

.chart-container {
    position: relative;
    height: 260px;
    width: 100%;
}

.quick-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
}

.quick-link:last-child {
    border: 0;
}

.quick-link strong {
    display: block;
    font-size: 11px;
}

.quick-link small {
    display: block;
    color: var(--muted);
    font-size: 9px;
    margin-top: 3px;
}

.quick-link > i {
    font-size: 10px;
    color: var(--muted);
}

.quick-icon {
    width: 38px;
    height: 38px;
    font-size: 13px;
}

/* TABLE */

.custom-table {
    white-space: nowrap;
    vertical-align: middle;
    font-size: 11px;
    margin: 0;
}

.custom-table thead th {
    background: #f8fafb;
    color: #73808d;
    font-size: 10px;
    font-weight: 600;
    padding: 14px;
    border-bottom: 1px solid var(--border);
}

.custom-table tbody td {
    padding: 14px;
    border-color: var(--border);
}

.custom-table tbody tr:hover {
    background: #fafdfb;
}

/* FORM */

.form-control,
.form-select {
    font-family: inherit;
    font-size: 12px;
    padding: 11px 13px;
    border-color: #e5e9ee;
    border-radius: 8px;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(22,134,108,.10);
}

.form-label {
    font-size: 11px;
    font-weight: 600;
    margin-bottom: 7px;
}

.btn {
    font-size: 11px;
    border-radius: 8px;
    padding: 10px 15px;
    font-weight: 500;
}

.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
}

.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}

.btn-success {
    background: var(--primary);
    border-color: var(--primary);
}

/* LOGIN */

.login-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #e7f5ef, #f5f8fa);
    padding: 20px;
}

.login-wrapper {
    width: 100%;
    max-width: 410px;
}

.login-card {
    background: white;
    padding: 36px;
    border-radius: 18px;
    box-shadow: 0 15px 50px rgba(20,70,50,.09);
}

.login-logo {
    width: 60px;
    height: 60px;
    display: grid;
    place-items: center;
    margin: 0 auto 20px;
    border-radius: 17px;
    background: var(--primary);
    color: white;
    font-size: 25px;
}

.login-card h3 {
    font-size: 21px;
    font-weight: 700;
    text-align: center;
}

.login-card > p {
    text-align: center;
    font-size: 11px;
    margin-bottom: 27px;
}

.password-wrapper {
    position: relative;
}

.password-wrapper input {
    padding-right: 45px;
}

.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    border: 0;
    background: transparent;
    color: var(--muted);
}

.login-footer {
    text-align: center;
    color: var(--muted);
    font-size: 9px;
    margin-top: 25px;
}

/* MOBILE */

@media (max-width: 1100px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .sidebar-overlay.show {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,.35);
        z-index: 900;
    }

    .main-content {
        margin-left: 0;
    }

    .top-navbar {
        padding: 0 15px;
        height: 67px;
    }

    .page-content {
        padding: 18px 14px;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .welcome-banner {
        padding: 22px;
    }

    .welcome-banner h2 {
        font-size: 17px;
    }

    .welcome-icon {
        font-size: 45px;
        padding: 0;
    }

    .stat-card {
        padding: 14px 11px;
        gap: 9px;
    }

    .stat-icon {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }

    .stat-card h3 {
        font-size: 15px;
    }

    .stat-card span {
        font-size: 9px;
    }

    .navbar-profile {
        display: none;
    }

    .page-footer {
        padding: 15px;
        gap: 8px;
        flex-wrap: wrap;
    }

    .content-card {
        padding: 16px;
    }
}

@media (max-width: 400px) {
    .stats-grid {
        gap: 9px;
    }

    .stat-card {
        flex-direction: column;
        align-items: flex-start;
    }

    .welcome-icon {
        display: none;
    }

    .login-card {
        padding: 25px 20px;
    }
}

/* REPORTS AND RECEIPT */

.report-heading {
    padding: 10px 0;
}

.report-heading h4 {
    font-size: 19px;
}

.report-signature {
    min-height: 150px;
}

.receipt-card {
    width: 100%;
}

.receipt-paper {
    color: #253342;
}

.receipt-details {
    margin-top: 25px;
}

@media (max-width: 576px) {
    .receipt-paper {
        padding: 17px !important;
    }

    .receipt-row {
        gap: 10px;
        font-size: 10px;
    }

    .receipt-row strong {
        max-width: 60%;
        overflow-wrap: anywhere;
    }

    .receipt-total h2 {
        font-size: 21px;
    }

    .report-heading h4 {
        font-size: 15px;
    }
}

/* =====================================================
   FIX SIDEBAR SCROLL - DESKTOP, TABLET, MOBILE
===================================================== */

/* Sidebar utama */
#sidebar.sidebar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    bottom: 0 !important;

    width: 260px;
    height: 100vh !important;
    height: 100dvh !important;

    display: flex !important;
    flex-direction: column !important;

    overflow: hidden !important;
    z-index: 1050;

    box-sizing: border-box;
}

/* Header / logo sidebar tetap di atas */
#sidebar .sidebar-brand {
    flex: 0 0 auto !important;
    width: 100%;
}

/* BAGIAN MENU: INI YANG BISA DI-SCROLL */
#sidebar .sidebar-menu {
    flex: 1 1 0 !important;
    min-height: 0 !important;
    height: 0 !important;

    width: 100%;
    overflow-y: auto !important;
    overflow-x: hidden !important;

    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;

    padding-bottom: 15px;
    scrollbar-width: thin;
    scrollbar-color: #bfcbd5 transparent;
}

/* Scrollbar Chrome, Edge, dan Safari */
#sidebar .sidebar-menu::-webkit-scrollbar {
    width: 5px;
}

#sidebar .sidebar-menu::-webkit-scrollbar-track {
    background: transparent;
}

#sidebar .sidebar-menu::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

#sidebar .sidebar-menu::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Bagian informasi pengguna dan logout tetap di bawah */
#sidebar .sidebar-bottom {
    flex: 0 0 auto !important;
    width: 100%;
    position: relative;

    background: #ffffff;
    border-top: 1px solid #e5e7eb;

    padding: 14px;
    padding-bottom: max(14px, env(safe-area-inset-bottom));

    z-index: 2;
}

/* =====================================================
   RESPONSIVE TABLET DAN MOBILE
===================================================== */

@media (max-width: 991px) {

    #sidebar.sidebar {
        width: min(280px, 85vw);
        height: 100vh !important;
        height: 100dvh !important;

        transform: translateX(-100%);
        visibility: hidden;

        transition:
            transform 0.3s ease,
            visibility 0.3s ease;
    }

    #sidebar.sidebar.show {
        transform: translateX(0);
        visibility: visible;
    }

    #sidebar .sidebar-menu {
        overflow-y: auto !important;
        overscroll-behavior: contain;
    }

    .sidebar-overlay {
        position: fixed;
        inset: 0;
        z-index: 1040;
    }

    .sidebar-overlay.show {
        opacity: 1;
        visibility: visible;
    }

}

/* =====================================================
   MOBILE KECIL
===================================================== */

@media (max-width: 576px) {

    #sidebar.sidebar {
        width: min(270px, 88vw);
    }

    #sidebar .sidebar-menu {
        padding-bottom: 10px;
    }

    #sidebar .sidebar-bottom {
        padding: 12px;
        padding-bottom: max(12px, env(safe-area-inset-bottom));
    }

}

/* =========================================
   NAVBAR RESPONSIVE
========================================= */

.top-navbar {
    min-height: 75px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

.navbar-left {
    display: flex;
    align-items: center;
    gap: 15px;
    min-width: 0;
}

.navbar-heading {
    min-width: 0;
}

.navbar-heading h5 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.navbar-heading small {
    display: block;
    margin-top: 3px;
    color: var(--muted);
    font-size: 12px;
}

.hamburger-btn {
    display: none;
    width: 40px;
    height: 40px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--white);
    color: var(--text);
    font-size: 17px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.navbar-profile {
    display: flex;
    align-items: center;
    gap: 10px;
}

@media (max-width: 991px) {

    .hamburger-btn {
        display: flex;
    }

    .navbar-profile {
        display: none;
    }

}

@media (max-width: 576px) {

    .top-navbar {
        min-height: 65px;
        padding: 12px 15px;
    }

    .navbar-heading h5 {
        font-size: 16px;
    }

    .navbar-heading small {
        font-size: 11px;
    }

}
