
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

/* =====================================================
   GLOBAL
===================================================== */

:root {
    --primary: #2563eb;
    --primary-dark: #142b4a;
    --primary-light: #eff6ff;
    --background: #f5f8fd;
    --text: #1e293b;
    --muted: #718096;
    --border: #e8edf5;

    --sidebar-width: 260px;
    --admin-sidebar-width: 260px;
}

* {
    font-family: 'Plus Jakarta Sans', sans-serif;
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    background: var(--background);
    color: var(--text);
    min-height: 100vh;
    margin: 0;
}

/* =====================================================
   NAVBAR UMUM
===================================================== */

.topbar {
    background: linear-gradient(120deg, #142b4a, #1d4f91);
    padding: 14px 0;
    box-shadow: 0 4px 20px rgba(20,43,74,.12);
}

.navbar-brand {
    font-weight: 800;
    letter-spacing: -.4px;
}

.navbar .nav-link {
    color: #dbeafe !important;
    font-size: 13px;
    font-weight: 600;
    padding: 10px 13px !important;
    border-radius: 9px;
    transition: .2s;
}

.navbar .nav-link:hover {
    background: rgba(255,255,255,.12);
    color: #fff !important;
}

/* =====================================================
   MAIN CONTENT UMUM
===================================================== */

.container-fluid {
    width: 100%;
}

.page-title {
    font-size: 25px;
    font-weight: 800;
    letter-spacing: -.8px;
    color: #142b4a;
}

.sub-title {
    font-size: 13px;
    color: var(--muted);
}

/* =====================================================
   CARDS
===================================================== */

.stat-card,
.panel {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 17px;
    box-shadow: 0 5px 22px rgba(31,55,90,.035);
    transition: .25s ease;
}

.stat-card {
    padding: 22px;
    height: 100%;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(31,55,90,.09);
}

.panel {
    padding: 25px;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #eff6ff;
    color: #2563eb;
    font-size: 21px;
}

.stat-number {
    font-size: 30px;
    font-weight: 800;
    color: #142b4a;
    letter-spacing: -1px;
    margin-top: 5px;
}

/* =====================================================
   BUTTONS
===================================================== */

.btn {
    border-radius: 10px;
    font-size: 13px;
    font-weight: 700;
    padding: 10px 17px;
    transition: .2s;
}

.btn-primary {
    background: #2563eb;
    border-color: #2563eb;
    box-shadow: 0 4px 12px rgba(37,99,235,.16);
}

.btn-primary:hover {
    background: #1d4ed8;
    border-color: #1d4ed8;
    transform: translateY(-1px);
}

/* =====================================================
   FORM
===================================================== */

.form-control,
.form-select {
    min-height: 44px;
    border: 1px solid #dfe7f1;
    border-radius: 10px;
    font-size: 13px;
    padding: 10px 13px;
}

.form-control:focus,
.form-select:focus {
    border-color: #60a5fa;
    box-shadow: 0 0 0 3px rgba(37,99,235,.09);
}

.form-label {
    font-size: 13px;
    font-weight: 700;
    color: #334155;
    margin-bottom: 8px;
}

/* =====================================================
   TABLE
===================================================== */

.table {
    vertical-align: middle;
    margin-bottom: 0;
}

.table thead th {
    background: #f7f9fd;
    color: #718096;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .6px;
    padding: 15px 13px;
    border-bottom: 1px solid #e8edf5;
    white-space: nowrap;
}

.table tbody td {
    padding: 15px 13px;
    font-size: 13px;
    border-bottom: 1px solid #f0f3f8;
}

.table tbody tr:hover {
    background: #f8fbff;
}

/* =====================================================
   BADGES
===================================================== */

.badge {
    padding: 7px 11px;
    border-radius: 7px;
    font-weight: 700;
    font-size: 11px;
}

.badge-soft {
    background: #eaf2ff;
    color: #2563eb;
}

/* =====================================================
   SCANNER
===================================================== */

.scanner-wrap {
    max-width: 650px;
    margin: auto;
}

.scan-frame {
    background: #111827;
    border-radius: 16px;
    overflow: hidden;
    min-height: 280px;
}

#reader {
    width: 100%;
    border: none !important;
}

#reader video {
    border-radius: 12px;
    object-fit: cover;
}

/* =====================================================
   LOGIN
===================================================== */

.login-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background:
        radial-gradient(circle at 10% 20%, #dbeafe, transparent 35%),
        radial-gradient(circle at 90% 80%, #bfdbfe, transparent 35%),
        #f5f8fd;
}

.login-card {
    width: 100%;
    max-width: 440px;
    padding: 38px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 22px;
    box-shadow: 0 20px 60px rgba(20,43,74,.09);
}

/* =====================================================
   ALERT
===================================================== */

.alert {
    border: none;
    border-radius: 11px;
    font-size: 13px;
}

/* =====================================================
   FOOTER UMUM
===================================================== */

.footer {
    font-size: 12px;
    color: #94a3b8;
    padding: 20px;
}

/* =====================================================
   ADMIN LAYOUT
   Sesuai struktur functions.php
===================================================== */

/* SIDEBAR */

.admin-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;

    width: var(--admin-sidebar-width);
    height: 100vh;
    height: 100dvh;

    display: flex;
    flex-direction: column;

    background: #173e78;
    color: #fff;

    z-index: 1050;
    overflow: hidden;

    transition: transform .3s ease;
}

/* BRAND */

.admin-brand {
    min-height: 90px;
    padding: 16px 18px;

    display: flex;
    align-items: center;
    gap: 12px;

    border-bottom: 1px solid rgba(255,255,255,.12);
    flex-shrink: 0;
}

.admin-brand img {
    display: block;
    width: 52px !important;
    height: 52px !important;
    max-width: 52px !important;
    max-height: 52px !important;

    object-fit: contain;

    background: #fff;
    border-radius: 10px;
    padding: 3px;

    flex-shrink: 0;
}

.admin-brand-title {
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    line-height: 1.5;
}

.admin-brand-subtitle {
    color: rgba(255,255,255,.65);
    font-size: 10px;
    margin-top: 3px;
}

/* MENU */

.admin-menu {
    flex: 1;
    min-height: 0;

    padding: 18px 12px;

    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
}

.admin-menu-label {
    padding: 8px 12px;
    margin-bottom: 7px;

    color: rgba(255,255,255,.48);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1px;
}

.admin-menu-label-secondary {
    margin-top: 20px;
}

.admin-menu a {
    display: flex;
    align-items: center;
    gap: 12px;

    padding: 12px 13px;
    margin-bottom: 5px;

    color: rgba(255,255,255,.75);
    font-size: 12px;
    font-weight: 600;

    text-decoration: none;
    border-radius: 9px;

    transition: .2s;
}

.admin-menu a i {
    width: 20px;
    flex-shrink: 0;
    text-align: center;
    font-size: 17px;
}

.admin-menu a:hover,
.admin-menu a.active {
    background: rgba(255,255,255,.14);
    color: #fff;
}

.admin-menu::-webkit-scrollbar {
    width: 4px;
}

.admin-menu::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,.25);
    border-radius: 10px;
}

/* SIDEBAR FOOTER */

.admin-sidebar-footer {
    padding: 15px;
    border-top: 1px solid rgba(255,255,255,.12);
    flex-shrink: 0;
}

.admin-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 13px;
    min-width: 0;
}

.admin-avatar {
    width: 38px;
    height: 38px;

    display: flex;
    align-items: center;
    justify-content: center;

    background: rgba(255,255,255,.15);
    color: #fff;

    border-radius: 10px;
    font-size: 18px;
    flex-shrink: 0;
}

.admin-profile-info {
    min-width: 0;
}

.admin-profile-name {
    color: #fff;
    font-size: 11px;
    font-weight: 800;

    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-profile-role {
    color: rgba(255,255,255,.6);
    font-size: 10px;
    margin-top: 3px;
}

.admin-logout {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    width: 100%;
    padding: 10px;

    background: rgba(255,255,255,.10);
    color: #fff;

    border-radius: 9px;
    text-decoration: none;

    font-size: 11px;
    font-weight: 700;
    transition: .2s;
}

.admin-logout:hover {
    background: #dc4545;
    color: #fff;
}

/* ADMIN MAIN */

.admin-main {
    width: calc(100% - var(--admin-sidebar-width));
    min-height: 100vh;
    min-height: 100dvh;

    margin-left: var(--admin-sidebar-width);

    display: flex;
    flex-direction: column;

    min-width: 0;
    background: #f5f8fd;
    overflow-x: hidden;
}

/* TOPBAR */

.admin-topbar {
    position: sticky;
    top: 0;
    z-index: 100;

    width: 100%;
    height: 68px;
    min-height: 68px;

    padding: 0 25px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    background: #fff;
    border-bottom: 1px solid #e8edf5;
}

.admin-topbar-left {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.admin-topbar-title {
    color: #253653;
    font-size: 15px;
    font-weight: 800;
}

.admin-topbar-user {
    display: flex;
    align-items: center;
    gap: 8px;

    color: #718096;
    font-size: 12px;
    font-weight: 700;
}

.admin-topbar-user i {
    color: #3978d5;
    font-size: 19px;
}

/* HAMBURGER */

.admin-toggle {
    width: 40px;
    height: 40px;

    display: none;
    align-items: center;
    justify-content: center;

    border: 1px solid #e5eaf0;
    border-radius: 9px;

    background: #fff;
    color: #3978d5;

    font-size: 21px;
    cursor: pointer;
    flex-shrink: 0;
}

.admin-toggle:hover {
    background: #edf4ff;
}

/* ADMIN CONTENT */

.admin-content {
    width: 100%;
    max-width: none !important;

    min-width: 0;
    flex: 1;

    padding: 25px !important;
}

/* ADMIN FOOTER */

.admin-main .footer {
    width: 100%;
    margin-top: auto;
    padding: 18px;

    background: #fff;
    border-top: 1px solid #e8edf5;

    color: #94a3b8;
    font-size: 11px;
}

/* ADMIN OVERLAY */

.admin-overlay {
    position: fixed;
    inset: 0;

    z-index: 1040;

    background: rgba(15,23,42,.50);

    opacity: 0;
    visibility: hidden;

    transition: .3s;
    display: none;
}

.admin-overlay.show {
    opacity: 1;
    visibility: visible;
}

body.admin-sidebar-open {
    overflow: hidden;
}

/* =====================================================
   RESPONSIVE TABLET & MOBILE
===================================================== */

@media (max-width: 991px) {

    .page-title {
        font-size: 22px;
    }

    .panel {
        padding: 20px;
    }

    .stat-card {
        padding: 18px;
    }

}

/* ADMIN MOBILE */

@media (max-width: 767px) {

    .admin-sidebar {
        width: min(280px, 85vw);
        transform: translateX(-100%);
        box-shadow: none;
    }

    .admin-sidebar.show {
        transform: translateX(0);
        box-shadow: 8px 0 30px rgba(0,0,0,.15);
    }

    .admin-main {
        width: 100%;
        margin-left: 0;
    }

    .admin-topbar {
        height: 62px;
        min-height: 62px;
        padding: 0 15px;
    }

    .admin-toggle {
        display: flex;
    }

    .admin-topbar-title {
        font-size: 13px;
    }

    .admin-content {
        padding: 17px 13px !important;
    }

    .admin-overlay {
        display: block;
    }

    .admin-topbar-user span {
        display: none;
    }

    .page-title {
        font-size: 21px;
    }

    .panel {
        padding: 17px;
        border-radius: 14px;
    }

    .stat-card {
        padding: 17px;
    }

    .stat-number {
        font-size: 25px;
    }

    .login-card {
        padding: 25px;
    }

    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .table {
        min-width: 650px;
    }

    .navbar .nav-link {
        padding: 10px !important;
    }
}

/* MOBILE KECIL */

@media (max-width: 480px) {

    .stat-number {
        font-size: 22px;
    }

    .stat-icon {
        width: 42px;
        height: 42px;
    }

    .admin-content {
        padding: 14px 10px !important;
    }

    .admin-topbar {
        padding: 0 10px;
    }

    .admin-topbar-title {
        font-size: 12px;
    }

    .login-card {
        padding: 22px;
    }

}
