/* ============================================================
   FILE: assets/css/style.css
   Tujuan: Gaya kustom untuk Aplikasi Kasir Koperasi
   ============================================================ */

/* ===== GLOBAL ===== */
body {
    background-color: #f0f2f5;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 0.92rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ===== NAVBAR ===== */
.navbar {
    position: sticky;
    top: 0;
    z-index: 1030;
}

.navbar-brand {
    letter-spacing: 0.5px;
    font-size: 1.1rem;
}

/* ===== KARTU / CARD ===== */
.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    transition: box-shadow 0.15s ease;
}

.card:hover {
    box-shadow: 0 6px 18px rgba(0,0,0,0.12);
}

.card-header {
    border-radius: 12px 12px 0 0 !important;
    font-weight: 600;
    font-size: 0.95rem;
}

/* ===== DASHBOARD STAT CARDS ===== */
.stat-card {
    border-radius: 14px;
    color: white;
    padding: 1.4rem;
    position: relative;
    overflow: hidden;
}

.stat-card .icon-bg {
    font-size: 3.5rem;
    position: absolute;
    right: 15px;
    bottom: 5px;
    opacity: 0.2;
}

.stat-card h3 {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 2px;
}

.stat-card p {
    font-size: 0.85rem;
    margin: 0;
    opacity: 0.9;
}

/* ===== HALAMAN LOGIN ===== */
.login-wrapper {
    min-height: 100vh;
    background: linear-gradient(135deg, #1d3a6e 0%, #0d6efd 60%, #198754 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-card {
    background: white;
    border-radius: 18px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.25);
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
}

.login-logo {
    font-size: 3rem;
    color: #0d6efd;
}

/* ===== TABEL ===== */
.table th {
    background-color: #f8f9fa;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    border-top: none;
}

.table-hover tbody tr:hover {
    background-color: #edf2ff;
}

.product-thumb {
    width: 48px;
    height: 48px;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #dee2e6;
    background: #f8f9fa;
    display: block;
    transition: none;
}

.img-preview-baru,
#gambarSaatIniPreview {
    width: 80px;
    height: 80px;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    display: block;
    background: #f8f9fa;
}

.cart-qty-input {
    width: 70px;
    min-width: 70px;
}

/* ===== KERANJANG BELANJA (TRANSAKSI) ===== */
#tabel-keranjang td,
#tabel-keranjang th {
    vertical-align: middle;
    font-size: 0.88rem;
}

.badge-sphp {
    background-color: #dc3545;
    color: white;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 8px;
}

.total-belanja-box {
    background: linear-gradient(135deg, #0d6efd, #0d47a1);
    color: white;
    border-radius: 12px;
    padding: 1.2rem 1.5rem;
}

.total-belanja-box .angka {
    font-size: 1.8rem;
    font-weight: 700;
}

/* ===== ALERT ===== */
.alert {
    border-radius: 10px;
    font-size: 0.9rem;
}

/* ===== TOMBOL ===== */
.btn {
    border-radius: 8px;
    font-weight: 500;
}

.btn-sm {
    font-size: 0.8rem;
}

/* ===== FORM ===== */
.form-control,
.form-select {
    border-radius: 8px;
    font-size: 0.9rem;
    border: 1.5px solid #dee2e6;
    transition: border-color 0.2s;
}

.form-control:focus,
.form-select:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.2rem rgba(13,110,253,0.15);
}

/* ===== BADGE ===== */
.badge {
    font-weight: 500;
}

/* ===== NOTA / STRUK ===== */
.nota-box {
    background: white;
    border: 2px dashed #ccc;
    border-radius: 10px;
    padding: 1.5rem;
    max-width: 360px;
    margin: auto;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
}

.nota-box h5 {
    font-size: 1rem;
    font-weight: 700;
}

.nota-separator {
    border-top: 1px dashed #aaa;
    margin: 8px 0;
}

/* ===== PRINT NOTA ===== */
@media print {
    body * { visibility: hidden; }
    .nota-print, .nota-print * { visibility: visible; }
    .nota-print {
        position: absolute;
        left: 0; top: 0;
        width: 80mm;
        font-family: 'Courier New', monospace;
        font-size: 11px;
    }
    .no-print { display: none !important; }
}

/* ===== RESPONSIF ===== */
@media (max-width: 576px) {
    .stat-card h3 { font-size: 1.3rem; }
    .login-card { padding: 1.8rem; }
    .total-belanja-box .angka { font-size: 1.4rem; }
}

/* ===== ANIMASI LOADING ===== */
.spinner-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.3);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}

/* ===== HIGHLIGHT STOK RENDAH ===== */
.stok-rendah {
    color: #dc3545;
    font-weight: 600;
}

.stok-aman {
    color: #198754;
    font-weight: 600;
}

/* ===== FOOTER ===== */
.footer {
    margin-top: auto;
}
