/* ==========================================
   FILE: style.css
   ========================================== */
:root {
    --primary: #2563eb; --bg: #f8fafc; --card-bg: #ffffff;
    --text: #334155; --success: #10b981; --danger: #ef4444; 
    --warning: #f59e0b; --subtle: #94a3b8;
    --font-stack: 'Inter', sans-serif;
}

* { box-sizing: border-box; }
body, input, select, button, table { 
    font-family: var(--font-stack); font-size: 14px; color: var(--text); 
}
body { 
    margin: 0; 
    padding-bottom: 90px; 
    padding-top: 10px; 
    -webkit-tap-highlight-color: transparent; 
    
    /* --- DESAIN BACKGROUND GAMBAR LOKAL (Sudah diubah ke WebP) --- */
    background-image: 
        linear-gradient(rgba(248, 250, 252, 0.3), rgba(248, 250, 252, 0.3)),
        url('foto.webp'); 
    
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
}

/* Navbar */
.navbar {
    background: rgba(255,255,255,0.98); border-top: 1px solid #e2e8f0;
    position: fixed; bottom: 0; left: 0; right: 0;
    display: flex; justify-content: space-around; padding: 10px 0; z-index: 1000;
}
.nav-btn { 
    background: none; border: none; color: var(--subtle); font-size: 0.7rem; 
    font-weight: 600; display: flex; flex-direction: column; align-items: center; 
    width: 100%; cursor: pointer; transition: color 0.2s; 
}
.nav-btn .material-icons-round { font-size: 24px; margin-bottom: 2px; }
.nav-btn.active { color: var(--primary); }

/* Layout */
.container { max-width: 600px; margin: 0 auto; padding: 0 16px; }
.section { display: none; animation: fadeUp 0.2s; }
.section.active { display: block; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

h2 { font-size: 1.1rem; font-weight: 700; margin-bottom: 10px; color: #1e293b; margin-top: 20px; }
.card { 
    background: var(--card-bg); border-radius: 12px; padding: 16px; 
    margin-bottom: 12px; box-shadow: 0 1px 3px rgba(0,0,0,0.05); 
    border: 1px solid #e2e8f0; 
}
.amount { font-size: 1.3rem; font-weight: 700; }
.text-green { color: var(--success); } 
.text-red { color: var(--danger); }
.text-blue { color: var(--primary); }
.text-orange { color: var(--warning); }

/* Stok Tabungan Cards */
.stok-card {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 2px solid #bae6fd;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    position: relative;
    transition: transform 0.2s, box-shadow 0.2s;
}
.stok-card:active { transform: scale(0.98); }
.stok-card.siap-beli {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border-color: #86efac;
}
.stok-card-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 12px;
}
.stok-nama { font-weight: 700; font-size: 1.1rem; color: #0c4a6e; }
.stok-badge {
    background: #0ea5e9; color: white; padding: 4px 10px;
    border-radius: 20px; font-size: 0.75rem; font-weight: 600;
}
.stok-badge.siap { background: var(--success); }

.stok-saldo {
    font-size: 1.5rem; font-weight: 700; color: #0369a1;
    margin-bottom: 4px;
}
.stok-saldo.siap { color: var(--success); }

.stok-info {
    font-size: 0.85rem; color: #64748b;
    display: flex; gap: 12px; flex-wrap: wrap;
}

.stok-actions {
    display: flex; gap: 8px; margin-top: 14px;
}
.btn-stok {
    padding: 10px; border-radius: 10px;
    font-weight: 700; font-size: 0.85rem; cursor: pointer;
    border: none; display: flex; align-items: center; justify-content: center; gap: 6px;
    transition: all 0.2s ease;
}
.btn-stok:active { transform: scale(0.95); }

.btn-stok-beli { 
    background: var(--success); /* Menggunakan warna hijau utama (#10b981) yang lebih solid */
    color: white; 
    flex: 1; 
    opacity: 1; 
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.25); /* Tambahan bayangan tipis agar tombol lebih menonjol */
}

.btn-stok-beli:disabled {
    background: #cbd5e1 !important; opacity: 0.6 !important; cursor: not-allowed;
}
.btn-stok-tambah { 
    background: white; color: var(--primary); border: 1.5px solid var(--primary); flex: 1; 
}
.btn-stok-kurangi { 
    background: #ffe4e6; color: #f43f5e; flex: 0 0 44px; padding: 0; 
}

.btn-add-stok {
    width: 100%; padding: 14px; background: #eff6ff;
    color: var(--primary); border: 2px dashed var(--primary);
    border-radius: 12px; font-weight: 600; cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: 8px;
}

/* Forms */
.form-group { margin-bottom: 14px; }
label { display: block; margin-bottom: 5px; font-weight: 600; font-size: 0.85rem; color: #475569; }
input, select { 
    width: 100%; padding: 12px; border: 1px solid #cbd5e1; 
    border-radius: 10px; outline: none; background: #fff; 
    transition: 0.2s; font-size: 1rem;
}
input:focus, select:focus { border-color: var(--primary); box-shadow: 0 0 0 2px #bfdbfe; }

.input-row { display: flex; gap: 10px; }
.input-row input, .input-row select { flex: 1; }

.btn-save { 
    width: 100%; padding: 14px; background: var(--primary); 
    color: white; border: none; border-radius: 10px; 
    font-weight: 600; cursor: pointer; font-size: 1rem;
}
.btn-save:disabled { opacity: 0.6; cursor: not-allowed; }

/* Split Display */
.split-container { background: #f8fafc; border-radius: 10px; padding: 12px; margin-bottom: 12px; }
.split-item { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px dashed #e2e8f0; }
.split-item:last-child { border-bottom: none; }
.split-stok { display: flex; align-items: center; gap: 8px; }
.split-dot { width: 8px; height: 8px; border-radius: 50%; }
.split-amount { font-weight: 600; color: var(--primary); }
.split-edit { background: none; border: none; color: var(--subtle); cursor: pointer; padding: 4px; }

/* Shift Cards */
.shift-card { background: #ffffff; border: 1px solid #e2e8f0; border-radius: 12px; padding: 20px; margin-bottom: 16px; box-shadow: 0 2px 6px rgba(0,0,0,0.02); transition: all 0.3s ease; }
.shift-header { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; font-weight: 700; font-size: 1.05rem; color: #475569; }
.shift-badge { background: #cbd5e1; color: white; padding: 4px 12px; border-radius: 20px; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.5px; transition: 0.3s; }
.shift-card.active { border: 2px solid #3b82f6; background: #f0f9ff; }
.shift-card .shift-header .icon-pagi { color: #94a3b8; transition: 0.3s; }
.shift-card.active .shift-header .icon-pagi { color: #2563eb; }
.shift-card.active .shift-badge { background: #3b82f6; }
.shift-card.sore.active { border: 2px solid #f59e0b; background: #fffbeb; }
.shift-card .shift-header .icon-sore { color: #94a3b8; transition: 0.3s; }
.shift-card.sore.active .shift-header .icon-sore { color: #f59e0b; }
.shift-card.sore.active .shift-badge { background: #f59e0b; }
.shift-card.online.active { border: 2px solid #8b5cf6; background: #f5f3ff; }
.shift-card .shift-header .icon-online { color: #94a3b8; transition: 0.3s; }
.shift-card.online.active .shift-header .icon-online { color: #8b5cf6; }
.shift-card.online.active .shift-badge { background: #8b5cf6; }
.shift-card .form-group label { color: #475569; font-weight: 600; }
.shift-card input { border: 1px solid #cbd5e1; border-radius: 12px; padding: 14px; font-size: 1.1rem; background: white; }
.shift-card input:focus { box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1); border-color: #3b82f6; }

/* Custom Toast Notification */
#toast-container { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); z-index: 3000; display: flex; flex-direction: column; gap: 10px; pointer-events: none; }
.toast-custom { background: white; border-radius: 12px; padding: 16px 20px; box-shadow: 0 10px 25px rgba(0,0,0,0.15); display: flex; align-items: center; gap: 12px; min-width: 300px; max-width: 400px; animation: slideDown 0.3s ease; pointer-events: auto; border-left: 4px solid var(--primary); }
.toast-custom.success { border-left-color: var(--success); }
.toast-custom.error { border-left-color: var(--danger); }
.toast-custom.warning { border-left-color: var(--warning); }
.toast-custom .icon { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.toast-custom.success .icon { background: #dcfce7; color: var(--success); }
.toast-custom.error .icon { background: #fee2e2; color: var(--danger); }
.toast-custom.warning .icon { background: #fef3c7; color: var(--warning); }
.toast-custom .content { flex: 1; }
.toast-custom .title { font-weight: 700; font-size: 0.95rem; color: #1e293b; margin-bottom: 2px; }
.toast-custom .message { font-size: 0.85rem; color: #64748b; }
.toast-custom .close { background: none; border: none; color: #94a3b8; cursor: pointer; padding: 4px; margin: -4px; }
@keyframes slideDown { from { opacity: 0; transform: translateY(-20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideUp { from { opacity: 1; transform: translateY(0); } to { opacity: 0; transform: translateY(-20px); } }
.toast-custom.hiding { animation: slideUp 0.3s ease forwards; }

/* Custom Confirm Modal */
#confirm-modal { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 2500; display: none; align-items: center; justify-content: center; backdrop-filter: blur(2px); }
#confirm-modal.show { display: flex; }
.confirm-box { background: white; border-radius: 16px; padding: 24px; max-width: 320px; width: 90%; text-align: center; box-shadow: 0 20px 40px rgba(0,0,0,0.2); animation: scaleIn 0.2s ease; }
@keyframes scaleIn { from { transform: scale(0.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.confirm-icon { width: 64px; height: 64px; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 16px; font-size: 32px; }
.confirm-icon.warning { background: #fef3c7; color: #f59e0b; }
.confirm-icon.danger { background: #fee2e2; color: #ef4444; }
.confirm-title { font-size: 1.2rem; font-weight: 700; color: #1e293b; margin-bottom: 8px; }
.confirm-message { font-size: 0.9rem; color: #64748b; margin-bottom: 20px; line-height: 1.5; }
.confirm-actions { display: flex; gap: 12px; }
.confirm-btn { flex: 1; padding: 12px; border-radius: 10px; font-weight: 600; cursor: pointer; border: none; font-size: 0.95rem; }
.confirm-btn.cancel { background: #f1f5f9; color: #475569; }
.confirm-btn.confirm { color: white; }
.confirm-btn.confirm.warning { background: #f59e0b; }
.confirm-btn.confirm.danger { background: #ef4444; }

/* Modals & Utils */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 2000; display: flex; align-items: flex-end; justify-content: center; visibility: hidden; opacity: 0; transition: 0.3s; backdrop-filter: blur(2px); }
.modal-overlay.show { visibility: visible; opacity: 1; }
.modal-sheet { background: white; width: 100%; max-width: 600px; border-radius: 20px 20px 0 0; padding: 24px; transform: translateY(100%); transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1); max-height: 90vh; overflow-y: auto; }
.modal-overlay.show .modal-sheet { transform: translateY(0); }
#loading { position: fixed; inset: 0; background: rgba(255,255,255,0.8); z-index: 2500; display: none; place-items: center; font-weight: 600; color: var(--primary); }
#loading.show { display: grid; }
.empty-state { text-align: center; padding: 40px 20px; color: #94a3b8; }
.empty-state .material-icons-round { font-size: 64px; margin-bottom: 16px; opacity: 0.5; }
.date-control { display: flex; gap: 8px; }
.btn-nav { background: #fff; border: 1px solid #cbd5e1; border-radius: 8px; width: 44px; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.date-control input { text-align: center; font-weight: 600; flex: 1; }
.summary-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.summary-card { background: white; border-radius: 12px; padding: 16px; border: 1px solid #e2e8f0; text-align: center; }
.summary-label { font-size: 0.75rem; color: #64748b; font-weight: 700; text-transform: uppercase; margin-bottom: 4px; }
.summary-value { font-size: 1.2rem; font-weight: 700; }
.rentang-card { background: #f8fafc; border-radius: 12px; padding: 16px; margin-bottom: 16px; }
.rentang-inputs { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.rentang-rekap { background: white; border-radius: 10px; padding: 16px; margin-top: 12px; }
.rekap-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid #f1f5f9; }
.rekap-row:last-child { border-bottom: none; font-weight: 700; font-size: 1.1rem; padding-top: 12px; margin-top: 4px; border-top: 2px solid #e2e8f0; }

/* Riwayat List & Tabs */
.tabs { display: flex; background: #f1f5f9; padding: 6px; border-radius: 14px; margin-bottom: 20px; }
.tab-btn { flex: 1; padding: 12px; border: none; background: transparent; border-radius: 10px; font-weight: 600; color: #64748b; cursor: pointer; transition: all 0.3s ease; }
.tab-btn.active { background: white; color: var(--primary); box-shadow: 0 2px 8px rgba(0,0,0,0.05); }
.section-header { display: flex; align-items: center; gap: 14px; background: #ffffff; padding: 16px; border-radius: 16px; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03); border: 1px solid #e2e8f0; margin-bottom: 24px; margin-top: 10px; }
.section-header .header-icon { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; color: white; box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); }
.section-header .header-icon .material-icons-round { font-size: 24px; }
.section-header h2 { margin: 0; font-size: 1.25rem; color: #1e293b; font-weight: 700; letter-spacing: -0.01em; }
.info-box { background: #fffbeb; border: 1px solid #fde68a; border-radius: 12px; padding: 16px; color: #92400e; font-size: 0.85rem; line-height: 1.6; display: flex; gap: 12px; align-items: flex-start; margin-top: 16px; margin-bottom: 16px; }
.info-box .material-icons-round { color: #b45309; font-size: 22px; }
.riwayat-item { padding: 16px; border: 1px solid #e2e8f0; border-radius: 12px; margin-bottom: 12px; background: #ffffff; transition: 0.2s; }
.riwayat-item:active { background: #f8fafc; }
.riwayat-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; font-size: 1rem; }
