/* ========================================
   TOKO MUTIARA - CSS (UPDATED VERSION)
   ======================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-white: #ffffff;
    --primary-black: #1a1a1a;
    --secondary-black: #2a2a2a;
    --primary-gold: #FFD700;
    --secondary-gold: #FFA500;
    --dark-gold: #B8860B;
    --text-light: #f5f5f5;
    --text-dark: #333;
    --bg-white: #ffffff;
    --bg-light: #f8f9fa;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--primary-white);
    color: var(--text-dark);
    min-height: 100vh;
    padding: 20px;
}

/* ==========================================
   LOGIN/REGISTER PAGE
   ========================================== */

.auth-container {
    max-width: 450px;
    margin: 100px auto;
    background: var(--bg-white);
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(255, 215, 0, 0.3);
    overflow: hidden;
    border: 3px solid var(--primary-gold);
}

.auth-header {
    background: linear-gradient(135deg, var(--primary-black) 0%, var(--secondary-black) 100%);
    padding: 40px 30px;
    text-align: center;
    border-bottom: 3px solid var(--primary-gold);
}

.auth-header h1 {
    font-size: 2em;
    color: var(--primary-gold);
    margin-bottom: 5px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.auth-header p {
    color: var(--text-light);
    font-size: 0.9em;
}

.auth-tabs {
    display: flex;
    background: var(--bg-light);
    border-bottom: 2px solid var(--primary-gold);
}

.auth-tabs button {
    flex: 1;
    padding: 15px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    color: #666;
    transition: all 0.3s;
}

.auth-tabs button:hover {
    background: rgba(255, 215, 0, 0.1);
}

.auth-tabs button.active {
    background: var(--bg-white);
    color: var(--primary-black);
    border-bottom: 3px solid var(--primary-gold);
}

.auth-content {
    padding: 30px;
}

.auth-form {
    display: none;
}

.auth-form.active {
    display: block;
}

.auth-form .btn {
    width: 100%;
    /* Full width */
    text-align: center;
    /* Text di tengah */
    margin-top: 10px;
    /* Spacing */
}


/* Input dengan format ribuan */
.input-ribuan {
    text-align: right;
    font-weight: 600;
    color: #1e3c72;
    font-family: 'Courier New', monospace;
}

.input-ribuan:focus {
    background: #fffacd;
}
/* ==========================================
   FORM ELEMENTS
   ========================================== */

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-dark);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s;
    background: var(--bg-white);
    color: var(--text-dark);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-gold);
    box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.2);
}

/* ==========================================
   BUTTONS
   ========================================== */

.btn {
    padding: 14px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;

}

.btn-primary {
    background: var(--primary-gold);
    color: var(--primary-black);
    font-weight: 700;
    text-shadow: none;
}

.btn-primary:hover {
    background: var(--secondary-gold);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 215, 0, 0.4);
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover {
    background: #218838;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

.btn-warning {
    background: #ffc107;
    color: var(--text-dark);
}

.btn-warning:hover {
    background: #e0a800;
    transform: translateY(-2px);
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
    transform: translateY(-2px);
}

.btn-info {
    background: #17a2b8;
    color: white;
}

.btn-info:hover {
    background: #138496;
    transform: translateY(-2px);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
    width: auto;
    display: inline-block;
}

/* ==========================================
   ALERTS
   ========================================== */

.alert {
    padding: 12px 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
}

.alert-danger {
    background: #f8d7da;
    color: #721c24;
    border-left: 4px solid #dc3545;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border-left: 4px solid #28a745;
}

/* ==========================================
   MAIN APP CONTAINER
   ========================================== */

.app-container {
    display: none;
    max-width: 1400px;
    margin: 0 auto;
    background: var(--bg-white);
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(255, 215, 0, 0.3);
    overflow: hidden;
    border: 3px solid var(--primary-gold);
}

.app-container.active {
    display: block;
}

/* ==========================================
   HEADER - NORMAL SIZE UNTUK LAPTOP/DESKTOP
   ========================================== */
.header {
    background: linear-gradient(135deg, var(--primary-black) 0%, var(--secondary-black) 100%);
    border-bottom: 4px solid var(--primary-gold);
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.logo-img {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    border: 3px solid var(--primary-gold);
    object-fit: cover;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.4);
}

.header-text h1 {
    font-size: 1.8em;
    color: var(--primary-gold);
    margin: 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.header-text p {
    color: #ccc;
    margin: 5px 0 0 0;
    font-size: 0.9em;
}

.header-right {
    position: relative;
}

/* ==========================================
   HAMBURGER MENU (HIDDEN DI DESKTOP)
   ========================================== */
.hamburger-btn {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: transparent;
    border: 2px solid var(--primary-gold);
    padding: 10px;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
}

.hamburger-btn span {
    width: 25px;
    height: 3px;
    background: var(--primary-gold);
    border-radius: 2px;
    transition: all 0.3s;
}

.hamburger-btn:hover {
    background: rgba(255, 215, 0, 0.1);
}

.hamburger-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.hamburger-btn.active span:nth-child(2) {
    opacity: 0;
}

.hamburger-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* ==========================================
   OVERLAY BACKDROP
   ========================================== */
.nav-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

.nav-overlay.active {
    display: block;
}

/* ==========================================
   USER DROPDOWN
   ========================================== */

.user-dropdown {
    position: relative;
}

.user-info-compact {
    background: rgba(255, 215, 0, 0.1);
    padding: 10px 15px;
    border-radius: 8px;
    border: 2px solid var(--primary-gold);
    cursor: pointer;
    transition: all 0.3s;
}

.user-info-compact:hover {
    background: rgba(255, 215, 0, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.3);
}

.user-info-compact strong {
    font-size: 14px;
    color: var(--primary-gold);
}

.dropdown-arrow {
    font-size: 12px;
    color: var(--primary-gold);
    transition: transform 0.3s;
}

.user-dropdown.active .dropdown-arrow {
    transform: rotate(180deg);
}

.role-badge {
    display: inline-block;
    padding: 4px 12px;
    background: var(--primary-gold);
    color: var(--primary-black);
    border-radius: 20px;
    font-size: 12px;
    margin-top: 5px;
    font-weight: 700;
}

.profile-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    background: var(--bg-white);
    border-radius: 10px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    min-width: 250px;
    z-index: 1000;
    border: 2px solid var(--primary-gold);
    overflow: hidden;
}

.profile-dropdown.active {
    display: block;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.profile-header {
    background: linear-gradient(135deg, var(--primary-black) 0%, var(--secondary-black) 100%);
    padding: 15px;
    color: var(--primary-gold);
    border-bottom: 2px solid var(--primary-gold);
}

.profile-header strong {
    display: block;
    font-size: 16px;
    margin-bottom: 5px;
}

.dropdown-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 12px 15px;
    border: none;
    background: var(--bg-white);
    text-align: left;
    cursor: pointer;
    color: var(--text-dark);
    font-size: 14px;
    transition: background 0.2s;
}

.dropdown-btn:hover {
    background: rgba(255, 215, 0, 0.1);
}

.dropdown-btn span {
    font-size: 16px;
}

.btn-logout-dropdown {
    border-top: 1px solid #ddd;
    color: #dc3545 !important;
    font-weight: 600;
}

.btn-logout-dropdown:hover {
    background: #ffe6e6 !important;
}

/* ========== CAMERA SCANNER STYLING ========== */
#barcodeScanner {
    width: 100%;
    max-width: 640px;
    height: 480px;
    border: 3px solid var(--primary-gold);
    border-radius: 10px;
    background: #000;
    position: relative;
    overflow: hidden;
}

#barcodeScanner video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#barcodeScanner canvas {
    position: absolute;
    top: 0;
    left: 0;
}

#scannerStatus {
    padding: 12px;
    border-radius: 8px;
    text-align: center;
    font-weight: 600;
    background: #d1ecf1;
    border: 2px solid #17a2b8;
}

/* Responsive */
@media (max-width: 768px) {
    #barcodeScanner {
        height: 300px;
    }
}

@media (max-width: 480px) {
    #barcodeScanner {
        height: 240px;
    }
}

/* ==========================================
   NAVIGATION TABS - CENTER DAN SCROLL
   ========================================== */
.nav-tabs {
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    gap: 5px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 3px solid var(--primary-gold);
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-gold) #f1f1f1;
    flex-wrap: nowrap !important;

    /* TRICK: Center kalau muat, scroll kalau ga muat */
    justify-content: center;
}

/* Hide scrollbar tapi tetap bisa scroll */
.nav-tabs::-webkit-scrollbar {
    height: 6px;
}

.nav-tabs::-webkit-scrollbar-track {
    background: transparent;
}

.nav-tabs::-webkit-scrollbar-thumb {
    background: var(--primary-gold);
    border-radius: 3px;
}

.nav-tabs::-webkit-scrollbar-thumb:hover {
    background: var(--dark-gold);
}

.nav-tabs button {
    flex-shrink: 0;
    /* PENTING: Jangan shrink */
    min-width: fit-content;
    /* Width otomatis sesuai text */
    padding: 15px 25px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    color: #666;
    transition: all 0.3s;
    white-space: nowrap;
    border-bottom: 3px solid transparent;
}

.nav-tabs button:hover {
    background: rgba(255, 215, 0, 0.1);
    color: var(--text-dark);
}

.nav-tabs button.active {
    background: var(--primary-white);
    color: var(--primary-gold);
    border-bottom: 3px solid var(--primary-gold);
    font-weight: 700;
}

.nav-tabs button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Scrollbar untuk nav tabs di desktop */
.nav-tabs::-webkit-scrollbar {
    height: 4px;
}

.nav-tabs::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.nav-tabs::-webkit-scrollbar-thumb {
    background: var(--primary-gold);
    border-radius: 10px;
}

.nav-tabs::-webkit-scrollbar-thumb:hover {
    background: var(--dark-gold);
}

/* ==========================================
   TAB CONTENT
   ========================================== */

.tab-content {
    display: none;
    padding: 30px;
    animation: fadeIn 0.3s;
    background: var(--bg-white);
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================
   FORM SECTIONS
   ========================================== */

.form-section {
    background: var(--bg-light);
    padding: 25px;
    border-radius: 10px;
    margin-bottom: 30px;
    border: 2px solid rgba(255, 215, 0, 0.2);
}

.form-section h3 {
    color: var(--primary-black);
    margin-bottom: 20px;
    font-size: 1.5em;
    border-bottom: 2px solid var(--primary-gold);
    padding-bottom: 10px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

/* ==========================================
   TABLES
   ========================================== */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    background: var(--bg-white);
    border-radius: 10px;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-white);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

table thead {
    background: var(--primary-white);
    color: var(--primary-gold);
    border-bottom: 3px solid var(--primary-black);
}

table th {
    padding: 15px 20px;
    text-align: left;
    color: var(--primary-black) !important;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.5px;
    white-space: nowrap;
    vertical-align: middle;
}

table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #ddd;
    vertical-align: middle;
    color: var(--text-dark);
}

table tbody tr {
    background: var(--bg-white);
    transition: background 0.2s;
}

table tbody tr:hover {
    background: #fff8dc;
}

table td:last-child,
table th:last-child {
    white-space: nowrap !important;
    text-align: center;
}

.table-input {
    border: 1px solid #ddd;
    padding: 6px 8px;
    border-radius: 4px;
    font-size: 13px;
    width: 100%;
    background: var(--bg-white);
    color: var(--text-dark);
}

.table-input:focus {
    outline: none;
    border-color: var(--primary-gold);
    box-shadow: 0 0 0 2px rgba(255, 215, 0, 0.2);
}

.new-row {
    background-color: #fff9e6 !important;
}

.new-row:hover {
    background-color: #fff3cd !important;
}

/* ==========================================
   ACTION BUTTONS
   ========================================== */

.action-buttons {
    display: flex !important;
    gap: 5px;
    align-items: center;
    justify-content: center;
    flex-wrap: nowrap !important;
    flex-direction: row !important;
}

.action-buttons .btn {
    margin: 0 !important;
    white-space: nowrap;
}

/* ==========================================
   STATUS BADGES
   ========================================== */

.status-badge {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
}

.status-lunas {
    background: #d4edda;
    color: #155724;
}

.status-belum {
    background: #f8d7da;
    color: #721c24;
}

.status-cicil {
    background: #fff3cd;
    color: #856404;
}

.status-disimpan {
    background: #cce5ff;
    color: #004085;
}

.status-diambil {
    background: #d4edda;
    color: #155724;
}

/* ==========================================
   STATISTICS CARDS
   ========================================== */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    padding: 25px;
    border-radius: 10px;
    color: white;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.stat-card h4 {
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 10px;
}

.stat-card .value {
    font-size: 28px;
    font-weight: bold;
    margin-bottom: 5px;
}

.stat-card .label {
    font-size: 12px;
    opacity: 0.8;
}

/* ==========================================
   FILTER SECTION
   ========================================== */

.filter-section {
    background: var(--bg-light);
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    border: 2px solid var(--primary-gold);
}

/* ==========================================
   MODALS
   ========================================== */

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-white);
    padding: 30px;
    border-radius: 15px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    border: 3px solid var(--primary-gold);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--primary-gold);
}

.modal-header h3 {
    color: var(--primary-black);
    font-size: 1.5em;
}

.close-modal {
    font-size: 28px;
    cursor: pointer;
    color: #999;
    background: none;
    border: none;
    transition: color 0.2s;
}

.close-modal:hover {
    color: var(--primary-black);
}

/* ==========================================
   TRANSAKSI HARIAN TABLE - FIT ONE PAGE
   ========================================== */
#tab-transaksi .table-responsive {
    max-height: calc(100vh - 450px);
    overflow-y: auto;
    position: relative;
}

#tab-transaksi table {
    font-size: 13px;
    table-layout: auto;
}

#tab-transaksi th,
#tab-transaksi td {
    padding: 10px 12px;
    white-space: nowrap;
    vertical-align: middle;
}

#tab-transaksi th {
    font-size: 12px;
    padding: 12px 12px;
}

#tab-transaksi td:nth-child(2),
#tab-transaksi td:nth-child(4),
#tab-transaksi td:nth-child(5),
#tab-transaksi td:nth-child(6),
#tab-transaksi td:nth-child(7),
#tab-transaksi td:nth-child(8),
#tab-transaksi td:nth-child(9),
#tab-transaksi td:nth-child(10),
#tab-transaksi td:nth-child(13) {
    text-align: right;
    font-family: 'Courier New', monospace;
}

#tab-transaksi td:nth-child(3) {
    text-align: center;
}

#tab-transaksi td:last-child,
#tab-transaksi th:last-child {
    min-width: 120px;
    max-width: 120px;
    width: 120px;
    white-space: nowrap !important;
    text-align: center !important;
    position: sticky;
    right: 0;
    background: var(--bg-white);
    box-shadow: -2px 0 5px rgba(0, 0, 0, 0.05);
}

#tab-transaksi th:last-child {
    background: var(--primary-white) !important;
    color: var(--primary-black) !important;
    z-index: 10;
}

#tab-transaksi tbody tr:hover td:last-child {
    background: #fff8dc !important;
}

#tab-transaksi .new-row td:last-child {
    background: #fff9e6 !important;
}

#tab-transaksi .new-row:hover td:last-child {
    background: #fff3cd !important;
}

#tab-transaksi .table-input {
    padding: 6px 8px;
    font-size: 13px;
    width: 100%;
}

#tab-transaksi select.table-input {
    padding: 5px 6px;
}

#tab-transaksi thead th {
    position: sticky;
    top: 0;
    z-index: 5;
    background: var(--primary-white);
    color: var(--primary-black) !important;
}

/* ==========================================
   KASIR - INFO BARANG SCAN
   ========================================== */
#hasilScan {
    background: #f8f9fa;
    border: 2px solid #1e3c72;
    border-radius: 10px;
    padding: 25px;
    margin-top: 30px;
}

#hasilScan h4 {
    color: #1e3c72 !important;
    text-align: center;
    margin-bottom: 20px;
}

#hasilScan strong {
    color: #1a1a1a !important;
}

#hasilScan span {
    color: #333 !important;
}

/* CAMERA SCANNER SECTION */
#cameraScannerSection {
    margin-top: 20px;
}

#barcodeScanner {
    width: 100%;
    max-width: 640px;
    height: 480px;
    margin: 0 auto;
    border: 3px solid var(--primary-gold);
    border-radius: 10px;
    overflow: hidden;
    background: #000;
}

#scannerStatus {
    margin-top: 15px;
    padding: 12px;
    border-radius: 8px;
    text-align: center;
    font-weight: 600;
}

.scanner-controls {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 15px;
}

/* ==========================================
   EMPTY STATE
   ========================================== */

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.empty-state h3 {
    font-size: 1.5em;
    margin-bottom: 10px;
    color: var(--text-dark);
}

/* ==========================================
   HARGA EMAS RESPONSIVE
   ========================================== */
#hargaEmasDisplay {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}

/* ==========================================
   RESPONSIVE - TABLET (max-width: 1024px)
   ========================================== */
@media (max-width: 1024px) {
    .header {
        padding: 15px 20px;
    }

    .logo-img {
        width: 60px;
        height: 60px;
    }

    .header-text h1 {
        font-size: 1.5em;
    }

    .header-text p {
        font-size: 0.85em;
    }

    .nav-tabs button {
        font-size: 14px;
        padding: 12px 15px;
        min-width: 120px;
    }
}

/* ==========================================
   RESPONSIVE - TABLET & MOBILE (≤768px)
   ========================================== */
@media (max-width: 768px) {

    /* Tampilkan hamburger button di mobile */
    .hamburger-btn {
        display: flex !important;
        position: static;
        transform: none;
        margin-left: auto;
        padding: 8px;
        border-color: var(--primary-gold);
    }

    .hamburger-btn span {
        width: 22px;
        height: 2.5px;
        background: var(--primary-gold);
    }

    .hamburger-btn:hover {
        background: rgba(255, 215, 0, 0.15);
    }

    /* Navigation tabs jadi sidebar */
    .nav-tabs {
        display: none;
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        background: var(--primary-white);
        flex-direction: column;
        border-left: 3px solid var(--primary-gold);
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.2);
        z-index: 1000;
        transition: right 0.3s ease;
        overflow-y: auto;
        padding-top: 20px;
        flex-wrap: nowrap !important;
    }

    .nav-tabs.active {
        display: flex !important;
        right: 0;
    }

    .nav-tabs button {
        flex: none;
        width: 100%;
        min-width: auto;
        padding: 15px 20px;
        text-align: left;
        border-bottom: 1px solid #ddd;
        font-size: 15px;
    }

    .nav-tabs button.active {
        border-left: 4px solid var(--primary-gold);
        border-bottom: 1px solid #ddd;
        background: rgba(255, 215, 0, 0.1);
    }

    /* Header jadi grid 3 kolom: Logo | User | Hamburger */
    .header {
        padding: 12px 15px;
        display: grid;
        grid-template-columns: 1fr auto auto;
        gap: 10px;
        align-items: center;
    }

    .header-left {
        gap: 10px;
        min-width: 0;
    }

    .logo-img {
        width: 45px;
        height: 45px;
    }

    .header-text h1 {
        font-size: 1em;
        white-space: nowrap;
    }

    .header-text p {
        display: none;
    }

    /* User dropdown compact */
    .header-right {
        position: static;
    }

    .user-info-compact {
        padding: 6px 10px;
        max-width: 140px;
    }

    .user-info-compact strong {
        font-size: 11px;
        max-width: 100px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        display: block;
    }

    .role-badge {
        font-size: 9px;
        padding: 2px 6px;
    }

    .dropdown-arrow {
        font-size: 10px;
    }

    .profile-dropdown {
        min-width: 200px;
        right: 0;
        top: calc(100% + 5px);
    }

    /* Responsive untuk harga emas - scroll horizontal */
    #hargaEmasDisplay {
        display: flex;
        overflow-x: auto;
        gap: 12px;
        padding-bottom: 10px;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
    }

    #hargaEmasDisplay>div {
        flex: 0 0 160px;
        scroll-snap-align: start;
        padding: 12px;
    }

    #hargaEmasDisplay>div>div:first-child {
        font-size: 12px;
    }

    #hargaEmasDisplay>div>div:nth-child(2) {
        font-size: 16px;
    }

    #hargaEmasDisplay>div>div:last-child {
        font-size: 10px;
    }

    /* Responsive untuk form & stats */
    .form-grid {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    /* Responsive untuk table */
    table {
        font-size: 11px;
    }

    table th,
    table td {
        padding: 8px 6px;
    }

    /* Responsive untuk modal */
    .modal-content {
        width: 95%;
        padding: 20px;
    }

    /* Tab content padding lebih kecil */
    .tab-content {
        padding: 15px;
    }

    .form-section {
        padding: 15px;
    }

    /* Transaksi table responsive */
    #tab-transaksi .table-responsive {
        overflow-x: auto;
        max-height: 60vh;
    }

    #tab-transaksi table {
        min-width: 1200px;
    }

    /* Camera scanner responsive */
    #barcodeScanner {
        height: 300px;
    }
}

/* ==========================================
   RESPONSIVE - HP KECIL (≤480px)
   ========================================== */
@media (max-width: 480px) {
    body {
        padding: 10px;
    }

    .auth-container {
        margin: 50px auto;
    }

    /* Header lebih compact */
    .header {
        padding: 10px 12px;
    }

    .logo-img {
        width: 40px;
        height: 40px;
    }

    .header-text h1 {
        font-size: 0.9em;
    }

    /* User dropdown lebih kecil */
    .user-info-compact {
        max-width: 120px;
        padding: 5px 8px;
    }

    .user-info-compact strong {
        font-size: 10px;
        max-width: 80px;
    }

    .role-badge {
        font-size: 8px;
        padding: 2px 5px;
    }

    /* Hamburger lebih kecil */
    .hamburger-btn {
        padding: 6px;
    }

    .hamburger-btn span {
        width: 20px;
    }

    /* Sidebar lebih kecil */
    .nav-tabs {
        width: 250px;
    }

    /* Harga emas card lebih kecil */
    #hargaEmasDisplay>div {
        flex: 0 0 140px;
        padding: 10px;
    }

    #hargaEmasDisplay>div>div:first-child {
        font-size: 11px;
    }

    #hargaEmasDisplay>div>div:nth-child(2) {
        font-size: 14px;
    }

    /* Button lebih kecil */
    .btn {
        font-size: 14px;
        padding: 12px;
    }

    /* Camera scanner mobile */
    #barcodeScanner {
        height: 240px;
    }
}

/* ==========================================
   SCROLLBAR STYLING
   ========================================== */

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-light);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-gold);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--dark-gold);
}

/* Scrollbar untuk harga emas */
#hargaEmasDisplay::-webkit-scrollbar {
    height: 6px;
}

#hargaEmasDisplay::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

#hargaEmasDisplay::-webkit-scrollbar-thumb {
    background: var(--primary-gold);
    border-radius: 10px;
}

#hargaEmasDisplay::-webkit-scrollbar-thumb:hover {
    background: var(--dark-gold);
}

/* ==========================================
   LOADING ANIMATION
   ========================================== */

.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 215, 0, 0.3);
    border-radius: 50%;
    border-top-color: var(--primary-gold);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ==========================================
   PRINT STYLES
   ========================================== */

@media print {
    body {
        background: white;
        color: black;
    }

    .header,
    .nav-tabs,
    .btn,
    .action-buttons {
        display: none !important;
    }

    .app-container {
        border: none;
        box-shadow: none;
    }

    table {
        border: 1px solid #000;
    }

    table th {
        background: #ddd !important;
        color: #000 !important;
    }
}

@keyframes blink {

    0%,
    100% {
        background-color: #fff3cd;
    }

    50% {
        background-color: #ffc107;
    }
}

/* Toast Notification Animations */
@keyframes slideInRight {
    from {
        transform: translateX(400px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

/* Row highlight animation */
tr.new-row {
    animation: rowFadeIn 0.5s ease-out;
}

@keyframes rowFadeIn {
    from {
        background-color: #fff3cd;
        transform: translateX(-20px);
        opacity: 0;
    }

    to {
        background-color: transparent;
        transform: translateX(0);
        opacity: 1;
    }
}

/* ==========================================
   UTILITY CLASSES
   ========================================== */

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-gold {
    color: var(--primary-gold);
}

.text-black {
    color: var(--primary-black);
}

.bg-gold {
    background: var(--primary-gold);
}

.bg-black {
    background: var(--primary-black);
}

.mt-10 {
    margin-top: 10px;
}

.mt-20 {
    margin-top: 20px;
}

.mb-10 {
    margin-bottom: 10px;
}

.mb-20 {
    margin-bottom: 20px;
}

.hidden {
    display: none !important;
}

.visible {
    display: block !important;
}