/* ============================================
   Kasir UNASMA Mart - Custom Stylesheet
   Warna: Biru Tua, Biru Muda, Putih, Abu-abu
   ============================================ */

:root {
    --biru-tua: #1a237e;
    --biru-sedang: #283593;
    --biru-muda: #42a5f5;
    --biru-terang: #90caf9;
    --putih: #ffffff;
    --abu-lembut: #f5f7fa;
    --abu-sedang: #e8eaf6;
    --text-dark: #263238;
    --text-light: #607d8b;
    --gradient-primary: linear-gradient(135deg, #1a237e 0%, #42a5f5 100%);
    --gradient-sidebar: linear-gradient(180deg, #1a237e 0%, #283593 50%, #1565c0 100%);
    --shadow-card: 0 4px 15px rgba(26, 35, 126, 0.1);
    --shadow-hover: 0 8px 25px rgba(26, 35, 126, 0.2);
    --border-radius: 12px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--abu-lembut);
    color: var(--text-dark);
    overflow-x: hidden;
}

/* ============ SIDEBAR ============ */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 260px;
    height: 100vh;
    background: var(--gradient-sidebar);
    z-index: 1000;
    transition: transform 0.3s ease, width 0.3s ease;
    overflow-y: auto;
}

/* Sidebar warna per role */
.sidebar-kasir {
    background: linear-gradient(180deg, #1a237e 0%, #283593 50%, #1565c0 100%);
}

.sidebar-admin {
    background: linear-gradient(180deg, #00695c 0%, #00897b 50%, #26a69a 100%);
}

.sidebar-pemilik {
    background: linear-gradient(180deg, #0a1628 0%, #0d2137 50%, #1565c0 100%);
}

.sidebar.collapsed {
    transform: translateX(-260px);
}

.sidebar-brand {
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-brand h3 {
    color: var(--putih);
    font-size: 1.2rem;
    font-weight: 700;
}

.sidebar-brand small {
    color: var(--biru-terang);
    font-size: 0.75rem;
}

.sidebar-menu {
    padding: 15px 0;
    list-style: none;
}

.sidebar-menu li {
    margin: 2px 10px;
}

.sidebar-menu li a {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.sidebar-menu li a:hover,
.sidebar-menu li a.active {
    background: rgba(255,255,255,0.15);
    color: var(--putih);
    transform: translateX(5px);
}

.sidebar-menu li a i {
    width: 20px;
    margin-right: 12px;
    text-align: center;
    font-size: 1rem;
}

.sidebar-menu .menu-header {
    padding: 10px 15px 5px;
    color: rgba(255,255,255,0.4);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

/* ============ MAIN CONTENT ============ */
.main-content {
    margin-left: 260px;
    min-height: 100vh;
    transition: margin-left 0.3s ease;
}

.main-content.expanded {
    margin-left: 0 !important;
}

/* ============ NAVBAR ============ */
.navbar-top {
    background: var(--putih);
    padding: 15px 25px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 999;
}

.navbar-top .page-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-dark);
}

.navbar-top .user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.navbar-top .user-info .avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.85rem;
}

/* Avatar warna per role */
.role-admin .navbar-top .user-info .avatar {
    background: linear-gradient(135deg, #00695c, #26a69a);
}

/* Admin: override semua elemen jadi teal */
.role-admin .btn-primary-custom {
    background: linear-gradient(135deg, #00695c, #26a69a);
}

.role-admin .btn-primary-custom:hover {
    box-shadow: 0 5px 15px rgba(0, 105, 92, 0.4);
}

.role-admin .btn-success-custom {
    background: linear-gradient(135deg, #00695c, #26a69a);
}

.role-admin .btn-success-custom:hover {
    box-shadow: 0 5px 15px rgba(0, 105, 92, 0.4);
}

.role-admin .table thead th {
    background: #e0f2f1;
    color: #00695c;
}

.role-admin .keranjang-total {
    background: linear-gradient(135deg, #00695c, #26a69a);
}

.role-admin .sidebar-menu li a:hover,
.role-admin .sidebar-menu li a.active {
    background: rgba(255,255,255,0.18);
}

/* Admin sidebar font tebal & kentara */
.sidebar-admin .sidebar-brand h3 {
    color: #ffffff;
    font-weight: 800;
    font-size: 1.25rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.sidebar-admin .sidebar-brand small {
    color: rgba(255,255,255,0.9);
    font-weight: 600;
}

.sidebar-admin .sidebar-menu li a {
    color: #ffffff;
    font-weight: 700;
    font-size: 1rem;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.sidebar-admin .sidebar-menu .menu-header {
    color: rgba(255,255,255,0.75);
    font-weight: 700;
    font-size: 0.75rem;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.role-pemilik .navbar-top .user-info .avatar {
    background: linear-gradient(135deg, #0d2137, #1565c0);
}

/* Pemilik: override elemen aksen jadi biru gelap */
.role-pemilik .btn-primary-custom {
    background: linear-gradient(135deg, #0d2137, #1565c0);
}

.role-pemilik .btn-primary-custom:hover {
    box-shadow: 0 5px 15px rgba(21, 101, 192, 0.4);
}

.role-pemilik .table thead th {
    background: #e3f2fd;
    color: #0d2137;
}

.role-pemilik .keranjang-total {
    background: linear-gradient(135deg, #0d2137, #1565c0);
}

/* Pemilik sidebar: font lebih terang & tebal */
.sidebar-pemilik .sidebar-brand h3 {
    color: #ffffff;
    font-weight: 800;
    font-size: 1.3rem;
}

.sidebar-pemilik .sidebar-menu li a {
    color: #ffffff;
    font-weight: 600;
    font-size: 1rem;
}

.sidebar-pemilik .sidebar-menu .menu-header {
    color: rgba(255,255,255,0.7);
    font-weight: 700;
}

.sidebar-pemilik .sidebar-menu li a:hover,
.sidebar-pemilik .sidebar-menu li a.active {
    background: rgba(255,255,255,0.2);
}

.role-kasir .navbar-top .user-info .avatar {
    background: linear-gradient(135deg, #1a237e, #42a5f5);
}

.btn-toggle-sidebar {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--biru-tua);
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 8px;
    transition: all 0.2s;
}

.btn-toggle-sidebar:hover {
    background: var(--abu-sedang);
}

/* Sidebar collapsed state */
.sidebar.collapsed {
    transform: translateX(-260px);
}

.main-content.expanded {
    margin-left: 0;
}

/* ============ CONTENT AREA ============ */
.content-area {
    padding: 25px;
}

/* ============ CARDS ============ */
.card-dashboard {
    background: var(--putih);
    border-radius: var(--border-radius);
    padding: 20px;
    box-shadow: var(--shadow-card);
    transition: all 0.3s ease;
    border: none;
    position: relative;
    overflow: hidden;
}

.card-dashboard:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-3px);
}

.card-dashboard .card-icon {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: white;
    margin-bottom: 12px;
}

.card-dashboard .card-icon.bg-1 { background: linear-gradient(135deg, #1a237e, #42a5f5); }
.card-dashboard .card-icon.bg-2 { background: linear-gradient(135deg, #00897b, #4db6ac); }
.card-dashboard .card-icon.bg-3 { background: linear-gradient(135deg, #e65100, #ff9800); }
.card-dashboard .card-icon.bg-4 { background: linear-gradient(135deg, #4a148c, #ab47bc); }
.card-dashboard .card-icon.bg-5 { background: linear-gradient(135deg, #1b5e20, #66bb6a); }
.card-dashboard .card-icon.bg-6 { background: linear-gradient(135deg, #b71c1c, #ef5350); }

.card-dashboard .card-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-dark);
}

.card-dashboard .card-label {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-top: 3px;
}

/* ============ TABLE ============ */
.table-container {
    background: var(--putih);
    border-radius: var(--border-radius);
    padding: 20px;
    box-shadow: var(--shadow-card);
}

.table-container .table {
    margin-bottom: 0;
}

.table thead th {
    background: var(--abu-sedang);
    color: var(--biru-tua);
    font-weight: 600;
    font-size: 0.85rem;
    border: none;
    padding: 12px 15px;
}

.table tbody td {
    padding: 12px 15px;
    vertical-align: middle;
    font-size: 0.85rem;
    border-color: #f0f0f0;
}

.table tbody tr:hover {
    background: var(--abu-lembut);
}

/* ============ BUTTONS ============ */
.btn-primary-custom {
    background: var(--gradient-primary);
    border: none;
    color: white;
    padding: 8px 20px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-primary-custom:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(26, 35, 126, 0.3);
    color: white;
}

.btn-success-custom {
    background: linear-gradient(135deg, #1b5e20, #66bb6a);
    border: none;
    color: white;
    padding: 8px 20px;
    border-radius: 8px;
    font-size: 0.85rem;
    transition: all 0.3s ease;
}

.btn-success-custom:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(27, 94, 32, 0.3);
    color: white;
}

.btn-danger-custom {
    background: linear-gradient(135deg, #b71c1c, #ef5350);
    border: none;
    color: white;
    padding: 8px 20px;
    border-radius: 8px;
    font-size: 0.85rem;
    transition: all 0.3s ease;
}

.btn-danger-custom:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(183, 28, 28, 0.3);
    color: white;
}

.btn-warning-custom {
    background: linear-gradient(135deg, #e65100, #ff9800);
    border: none;
    color: white;
    padding: 8px 20px;
    border-radius: 8px;
    font-size: 0.85rem;
    transition: all 0.3s ease;
}

.btn-warning-custom:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(230, 81, 0, 0.3);
    color: white;
}

/* ============ BADGE ============ */
.badge-stok-aman {
    background: #e8f5e9;
    color: #2e7d32;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
}

.badge-stok-menipis {
    background: #fbe9e7;
    color: #bf360c;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
}

/* ============ FORM ============ */
.modal {
    z-index: 1060 !important;
}

.modal-backdrop {
    z-index: 1055 !important;
}

.modal-dialog {
    z-index: 1061;
}
.form-control, .form-select {
    border-radius: 8px;
    border: 1.5px solid #e0e0e0;
    padding: 10px 15px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.form-control:focus, .form-select:focus {
    border-color: var(--biru-muda);
    box-shadow: 0 0 0 3px rgba(66, 165, 245, 0.15);
}

.form-label {
    font-weight: 500;
    font-size: 0.85rem;
    color: var(--text-dark);
    margin-bottom: 5px;
}

/* ============ LOGIN PAGE ============ */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-primary);
    padding: 20px;
}

.login-card {
    background: var(--putih);
    border-radius: 16px;
    padding: 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

.login-card h2 {
    color: var(--biru-tua);
    font-weight: 700;
    margin-bottom: 5px;
}

.login-card .subtitle {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 30px;
}

/* ============ STRUK ============ */
.struk-container {
    max-width: 320px;
    margin: 0 auto;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    padding: 20px;
}

.struk-container .header-struk {
    text-align: center;
    border-bottom: 1px dashed #333;
    padding-bottom: 10px;
    margin-bottom: 10px;
}

.struk-container .footer-struk {
    text-align: center;
    border-top: 1px dashed #333;
    padding-top: 10px;
    margin-top: 10px;
}

/* ============ RESPONSIVE ============ */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-260px);
    }

    .sidebar.active {
        transform: translateX(0) !important;
    }

    .main-content {
        margin-left: 0;
    }

    .content-area {
        padding: 15px;
    }

    .card-dashboard .card-value {
        font-size: 1.2rem;
    }

    .navbar-top {
        padding: 12px 15px;
    }

    .table-responsive {
        font-size: 0.8rem;
    }
}

/* Overlay untuk mobile */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 999;
}

.sidebar-overlay.active {
    display: block;
}

/* ============ KASIR PAGE ============ */
.kasir-search {
    position: relative;
}

.kasir-search .search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 100;
    display: none;
    box-shadow: var(--shadow-card);
}

.kasir-search .search-results .item {
    padding: 14px 18px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.2s;
    font-size: 1rem;
}

.kasir-search .search-results .item:hover {
    background: var(--abu-lembut);
}

/* Keranjang */
.keranjang-total {
    background: var(--gradient-primary);
    color: white;
    border-radius: var(--border-radius);
    padding: 25px;
}

.keranjang-total h4 {
    font-size: 2.2rem;
    font-weight: 700;
}

/* ============ KASIR TOUCH-FRIENDLY (TABLET) ============ */
.kasir-page .table-container {
    padding: 20px;
}

.kasir-page #cariBarang {
    font-size: 1.1rem;
    padding: 14px 18px;
    border-radius: 10px;
}

.kasir-page .table thead th {
    font-size: 1rem;
    padding: 14px 12px;
}

.kasir-page .table tbody td {
    font-size: 1rem;
    padding: 14px 12px;
}

.kasir-page .table tbody td small {
    font-size: 0.95rem;
}

.kasir-page .table tbody td small strong {
    font-size: 1.05rem;
}

.kasir-page .btn-qty {
    width: 50px;
    height: 50px;
    font-size: 1.5rem !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    padding: 0 !important;
    font-weight: 700;
    border-width: 2px;
}

.kasir-page .qty-value {
    font-size: 1.5rem;
    font-weight: 700;
    min-width: 40px;
    text-align: center;
}

.kasir-page .btn-hapus-item {
    width: 50px;
    height: 50px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    font-size: 1.2rem;
}

.kasir-page .form-control {
    font-size: 1.1rem;
    padding: 14px 16px;
}

.kasir-page .input-group-text {
    font-size: 1.1rem;
    padding: 14px 16px;
    font-weight: 600;
}

.kasir-page .form-label {
    font-size: 1rem;
    font-weight: 600;
}

.kasir-page .btn-nominal {
    padding: 10px 16px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 8px;
    min-width: 80px;
}

.kasir-page .btn-simpan-trx {
    padding: 16px 20px;
    font-size: 1.15rem;
    font-weight: 600;
    border-radius: 10px;
}

.kasir-page .ringkasan-table td {
    font-size: 1.05rem;
    padding: 10px 8px;
}

.kasir-page h6 {
    font-size: 1.1rem;
}

/* Metode Bayar Toggle */
.kasir-page .metode-btn {
    padding: 12px 24px;
    font-size: 1.05rem;
    font-weight: 600;
    border-radius: 10px;
    min-width: 120px;
    transition: all 0.3s ease;
}

.kasir-page .metode-btn.active {
    background: var(--gradient-primary) !important;
    border-color: var(--biru-tua) !important;
    color: white !important;
    box-shadow: 0 4px 12px rgba(26, 35, 126, 0.3);
}

/* Print */
@media print {
    .sidebar, .navbar-top, .no-print {
        display: none !important;
    }
    .main-content {
        margin-left: 0 !important;
    }
    .content-area {
        padding: 0 !important;
    }
}
