/* assets/css/style.css */
:root {
    --primary: #1565C0;
    --primary-dark: #0D47A1;
    --primary-light: #42A5F5;
    --primary-lighter: #BBDEFB;
    --primary-bg: #E3F2FD;
    --secondary: #1E88E5;
    --accent: #2196F3;
    --success: #4CAF50;
    --warning: #FF9800;
    --danger: #F44336;
    --dark: #1A237E;
    --light: #F5F7FA;
    --white: #FFFFFF;
    --gray: #90A4AE;
    --sidebar-width: 260px;
    --header-height: 65px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--light);
    color: #333;
    overflow-x: hidden;
}

/* ============ LOGIN PAGE ============ */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 50%, var(--primary-light) 100%);
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.login-wrapper::before {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    background: rgba(255,255,255,0.05);
    border-radius: 50%;
    top: -100px;
    right: -100px;
}

.login-wrapper::after {
    content: '';
    position: absolute;
    width: 300px;
    height: 300px;
    background: rgba(255,255,255,0.05);
    border-radius: 50%;
    bottom: -80px;
    left: -80px;
}

.login-card {
    background: var(--white);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    padding: 50px 40px;
    width: 100%;
    max-width: 440px;
    position: relative;
    z-index: 1;
    animation: slideUp 0.6s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-logo {
    text-align: center;
    margin-bottom: 30px;
}

.login-logo img {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    border: 4px solid var(--primary-lighter);
    padding: 5px;
    background: var(--white);
    box-shadow: 0 5px 15px rgba(21,101,192,0.2);
}

.login-logo h2 {
    color: var(--primary-dark);
    font-size: 1.3rem;
    margin-top: 15px;
    font-weight: 700;
    line-height: 1.4;
}

.login-logo p {
    color: var(--gray);
    font-size: 0.9rem;
    margin-top: 5px;
}

.form-floating {
    margin-bottom: 20px;
}

.form-floating .form-control {
    border: 2px solid #E0E0E0;
    border-radius: 12px;
    padding: 18px 15px 8px 45px;
    font-size: 0.95rem;
    transition: all 0.3s;
    height: 55px;
}

.form-floating .form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(21,101,192,0.15);
}

.form-floating label {
    padding-left: 45px;
    color: var(--gray);
}

.input-icon {
    position: relative;
}

.input-icon i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary);
    font-size: 1.1rem;
    z-index: 5;
}

.btn-login {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border: none;
    border-radius: 12px;
    padding: 14px;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--white);
    width: 100%;
    cursor: pointer;
    transition: all 0.3s;
    letter-spacing: 0.5px;
}

.btn-login:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(21,101,192,0.4);
    color: var(--white);
}

/* ============ SIDEBAR ============ */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    background: linear-gradient(180deg, var(--primary-dark) 0%, var(--primary) 100%);
    color: var(--white);
    z-index: 1000;
    transition: transform 0.3s ease;
    overflow-y: auto;
    box-shadow: 4px 0 15px rgba(0,0,0,0.1);
}

.sidebar-header {
    padding: 25px 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.15);
    background: rgba(0,0,0,0.1);
}

.sidebar-header img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 3px solid rgba(255,255,255,0.3);
    margin-bottom: 10px;
}

.sidebar-header h5 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 3px;
}

.sidebar-header small {
    font-size: 0.75rem;
    opacity: 0.7;
}

.sidebar-nav {
    padding: 15px 0;
}

.nav-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    padding: 15px 25px 8px;
    opacity: 0.5;
    font-weight: 600;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    padding: 12px 25px;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.3s;
    border-left: 3px solid transparent;
    gap: 12px;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
    background: rgba(255,255,255,0.15);
    color: var(--white);
    border-left-color: var(--white);
}

.sidebar-nav a i {
    font-size: 1.1rem;
    width: 24px;
    text-align: center;
}

/* ============ MAIN CONTENT ============ */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    transition: margin-left 0.3s;
}

.top-header {
    height: var(--header-height);
    background: var(--white);
    border-bottom: 1px solid #E0E0E0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    position: sticky;
    top: 0;
    z-index: 999;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.top-header .toggle-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--primary);
    cursor: pointer;
}

.page-content {
    padding: 25px 30px;
}

/* ============ CARDS ============ */
.stat-card {
    background: var(--white);
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 3px 15px rgba(0,0,0,0.06);
    transition: transform 0.3s, box-shadow 0.3s;
    border: none;
    position: relative;
    overflow: hidden;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
}

.stat-card .stat-icon {
    width: 55px;
    height: 55px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--white);
}

.stat-card .stat-icon.bg-blue { background: linear-gradient(135deg, #1565C0, #42A5F5); }
.stat-card .stat-icon.bg-green { background: linear-gradient(135deg, #2E7D32, #66BB6A); }
.stat-card .stat-icon.bg-orange { background: linear-gradient(135deg, #E65100, #FF9800); }
.stat-card .stat-icon.bg-purple { background: linear-gradient(135deg, #6A1B9A, #AB47BC); }

.stat-card h3 {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--primary-dark);
    margin: 0;
}

.stat-card p {
    font-size: 0.85rem;
    color: var(--gray);
    margin: 0;
}

/* ============ TABLE ============ */
.card-custom {
    background: var(--white);
    border-radius: 15px;
    box-shadow: 0 3px 15px rgba(0,0,0,0.06);
    border: none;
    overflow: hidden;
}

.card-custom .card-header {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: var(--white);
    padding: 18px 25px;
    border: none;
    font-weight: 600;
    font-size: 1rem;
}

.card-custom .card-body {
    padding: 25px;
}

.table-custom {
    border-collapse: separate;
    border-spacing: 0;
}

.table-custom thead th {
    background: var(--primary-bg);
    color: var(--primary-dark);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 12px 15px;
    border: none;
    white-space: nowrap;
}

.table-custom tbody td {
    padding: 12px 15px;
    vertical-align: middle;
    border-bottom: 1px solid #F0F0F0;
    font-size: 0.9rem;
}

.table-custom tbody tr:hover {
    background: #F8FBFF;
}

/* ============ BUTTONS ============ */
.btn-primary-custom {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border: none;
    border-radius: 10px;
    padding: 10px 20px;
    color: var(--white);
    font-weight: 500;
    transition: all 0.3s;
}

.btn-primary-custom:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    transform: translateY(-1px);
    color: var(--white);
    box-shadow: 0 4px 15px rgba(21,101,192,0.3);
}

.btn-sm-custom {
    padding: 5px 12px;
    font-size: 0.8rem;
    border-radius: 8px;
}

/* ============ POS / KASIR ============ */
.pos-container {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 20px;
    height: calc(100vh - var(--header-height) - 50px);
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
    max-height: calc(100vh - 280px);
    overflow-y: auto;
    padding: 5px;
}

.product-item {
    background: var(--white);
    border-radius: 12px;
    padding: 15px 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    border: 2px solid transparent;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.product-item:hover {
    border-color: var(--primary);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(21,101,192,0.15);
}

.product-item .product-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-item .product-price {
    font-size: 0.85rem;
    color: var(--primary);
    font-weight: 700;
}

.product-item .product-stock {
    font-size: 0.7rem;
    color: var(--gray);
}

.cart-section {
    background: var(--white);
    border-radius: 15px;
    box-shadow: 0 3px 15px rgba(0,0,0,0.08);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.cart-header {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: var(--white);
    padding: 15px 20px;
    font-weight: 600;
}

.cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

.cart-item {
    display: flex;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid #F0F0F0;
    gap: 10px;
}

.cart-item .item-info {
    flex: 1;
}

.cart-item .item-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: #333;
}

.cart-item .item-price {
    font-size: 0.8rem;
    color: var(--primary);
}

.cart-item .qty-control {
    display: flex;
    align-items: center;
    gap: 8px;
}

.cart-item .qty-control button {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid #ddd;
    background: var(--white);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.cart-item .qty-control button:hover {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

.cart-footer {
    padding: 15px 20px;
    border-top: 2px solid #E0E0E0;
    background: #FAFAFA;
}

.cart-total {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary-dark);
    text-align: right;
    margin-bottom: 15px;
}

/* ============ BARCODE LABEL ============ */
.barcode-label {
    width: 50mm;
    height: 25mm;
    border: 1px dashed #ccc;
    padding: 3mm;
    text-align: center;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 2mm;
    font-family: Arial, sans-serif;
}

.barcode-label .product-name-label {
    font-size: 7pt;
    font-weight: bold;
    overflow: hidden;
    max-height: 5mm;
}

.barcode-label .barcode-img {
    margin: 1mm 0;
}

.barcode-label .barcode-number {
    font-size: 7pt;
}

.barcode-label .price-label {
    font-size: 8pt;
    font-weight: bold;
}

/* ============ STRUK THERMAL ============ */
.struk-thermal {
    font-family: 'Courier New', monospace;
    width: 80mm;
    margin: 0 auto;
    padding: 5mm;
    font-size: 9pt;
    line-height: 1.5;
}

.struk-thermal.struk-58mm {
    width: 58mm;
    font-size: 8pt;
}

.struk-thermal .struk-center {
    text-align: center;
}

.struk-thermal .struk-line {
    border-top: 1px dashed #000;
    margin: 3px 0;
}

.struk-thermal .struk-bold {
    font-weight: bold;
}

.struk-thermal table {
    width: 100%;
}

.struk-thermal table td {
    vertical-align: top;
    padding: 1px 0;
}

/* ============ RESPONSIVE ============ */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 999;
}

@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.active {
        transform: translateX(0);
    }
    .sidebar-overlay.active {
        display: block;
    }
    .main-content {
        margin-left: 0;
    }
    .top-header .toggle-btn {
        display: block;
    }
    .pos-container {
        grid-template-columns: 1fr;
        height: auto;
    }
    .product-grid {
        max-height: 50vh;
    }
    .page-content {
        padding: 15px;
    }
}

@media (max-width: 576px) {
    .login-card {
        padding: 35px 25px;
    }
    .stat-card {
        padding: 18px;
    }
    .stat-card h3 {
        font-size: 1.3rem;
    }
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ============ PRINT ============ */
@media print {
    .sidebar, .top-header, .no-print {
        display: none !important;
    }
    .main-content {
        margin-left: 0 !important;
    }
    .page-content {
        padding: 0 !important;
    }
    body {
        background: white;
    }
}

/* ============ ANIMATIONS ============ */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.4s ease-out;
}

/* ============ ALERTS ============ */
.alert-custom {
    border-radius: 12px;
    border: none;
    padding: 15px 20px;
    font-size: 0.9rem;
}

/* ============ SEARCH ============ */
.search-box {
    position: relative;
}

.search-box input {
    border: 2px solid #E0E0E0;
    border-radius: 12px;
    padding: 10px 15px 10px 40px;
    font-size: 0.9rem;
    transition: all 0.3s;
    width: 100%;
}

.search-box input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(21,101,192,0.1);
    outline: none;
}

.search-box i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray);
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: #F0F0F0;
}
::-webkit-scrollbar-thumb {
    background: var(--primary-lighter);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--primary-light);
}

/* Badge */
.badge-stock {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-stock.low {
    background: #FFF3E0;
    color: #E65100;
}

.badge-stock.ok {
    background: #E8F5E9;
    color: #2E7D32;
}

.badge-stock.out {
    background: #FFEBEE;
    color: #C62828;
}

/* KOP Surat */
.kop-surat {
    border-bottom: 3px double var(--primary-dark);
    padding-bottom: 15px;
    margin-bottom: 20px;
    text-align: center;
}

.kop-surat img {
    width: 70px;
    height: 70px;
}

.kop-surat h3 {
    font-size: 1.1rem;
    color: var(--primary-dark);
    font-weight: 700;
    margin: 0;
}

.kop-surat h2 {
    font-size: 1.4rem;
    color: var(--primary-dark);
    font-weight: 800;
    margin: 0;
}

.kop-surat p {
    font-size: 0.8rem;
    color: #555;
    margin: 0;
}
/* ============ KUSTOMISASI LOGIN MOTIF & ROLE ============ */
.login-card {
    padding: 0; /* Reset padding default */
    overflow: hidden;
}

.login-card-body {
    padding: 30px 40px 40px;
}

/* Pita Motif Kotak-kotak */
.pita-motif {
    height: 18px;
    width: 100%;
    background-image: url('../img/motif.jpg');
    background-repeat: repeat-x;
    background-size: contain;
    background-position: center;
    border-bottom: 3px solid var(--primary-dark);
}

/* Pilihan Role (Admin / Kasir) */
.role-selector {
    display: flex;
    background: #F5F7FA;
    border-radius: 15px;
    padding: 6px;
    margin-bottom: 25px;
    border: 1px solid #E0E0E0;
}

.role-btn {
    flex: 1;
    text-align: center;
    padding: 12px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    color: var(--gray);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.95rem;
}

.role-btn i {
    font-size: 1.1rem;
    margin-bottom: 4px;
    display: block;
}

.role-btn:hover {
    color: var(--primary-light);
}

.role-btn.active {
    background: var(--white);
    color: var(--primary);
    box-shadow: 0 4px 15px rgba(21,101,192,0.15);
    transform: scale(1.02);
}

.role-btn.active.admin {
    color: #E65100; /* Warna beda untuk admin */
}

/* Menyesuaikan tombol login sesuai role */
.btn-login.admin-mode {
    background: linear-gradient(135deg, #E65100, #FF9800);
}
.btn-login.admin-mode:hover {
    background: linear-gradient(135deg, #BF360C, #E65100);
    box-shadow: 0 5px 20px rgba(230,81,0,0.4);
}
/* Pita Motif Kotak-kotak (PNG) */
.pita-motif {
    height: 20px; /* Tinggi pita motif */
    width: 100%;
    background-image: url('../img/motif.png'); /* Menggunakan file .png */
    background-repeat: repeat-x; /* Pengulangan horizontal sejajar */
    background-size: auto 100%; /* Menjaga proporsi tinggi motif agar tajam */
    background-position: center;
    border-bottom: 2px solid var(--primary-dark);
}