/* =========================================
   1. RESET & DASAR (GLOBAL)
   ========================================= */
html, body { 
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; 
    background: #f4f4f4; 
    margin: 0;
    padding: 0; /* Padding diatur di wrapper dashboard */
    text-align: center;
    overflow-x:hidden;
    width:100%;
}

.hidden { 
    display: none !important; 
}

button { 
    margin: 5px; 
    padding: 10px 20px; 
    cursor: pointer; 
    border: none; 
    border-radius: 5px; 
    color: white; 
    font-weight: bold;
    transition: opacity 0.2s;
}

button:hover {
    opacity: 0.9;
}

/* =========================================
   2. LAYAR LOGIN
   ========================================= */
#login-screen {
    max-width: 400px;
    margin: 100px auto;
    padding: 30px;
    border: 1px solid #ddd;
    border-radius: 12px;
    background: white;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.login-input { 
    width: 90%; 
    padding: 12px; 
    margin: 10px 0; 
    border: 1px solid #ccc; 
    border-radius: 6px; 
}

.btn-login { 
    width: 95%; 
    background: #2ecc71; 
}

/* =========================================
   3. LAYOUT DASHBOARD (UTAMA)
   ========================================= */
.dashboard-wrapper {
    display: grid;
    grid-template-columns: 280px 1fr 600px;
    gap: 5px;
    padding: 3px;
    align-items: start;
}

.column-side {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.column-main {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.side-card {
    background: #ffffff;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid #e0e0e0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    text-align: left;
}

.side-card h4 {
    margin: 0 0 15px 0;
    text-align: center;
    color: #333;
    border-bottom: 2px solid #f4f4f4;
    padding-bottom: 10px;
    font-size: 1rem;
}

/* =========================================
   4. KOMPONEN OMZET & HISTORY
   ========================================= */
/* Kartu Omzet */
.omzet-box {
    padding: 15px;
    margin-bottom: 12px;
    border-radius: 8px;
    color: white;
    text-align: center;
    transition: transform 0.2s;
}

.omzet-box:hover { transform: translateY(-3px); }
.omzet-box.hari { background: linear-gradient(135deg, #2ecc71, #27ae60); }
.omzet-box.bulan { background: linear-gradient(135deg, #3498db, #2980b9); }
.omzet-box.tahun { background: linear-gradient(135deg, #9b59b6, #8e44ad); }

.omzet-box small { font-weight: bold; opacity: 0.8; font-size: 0.7rem; }
.omzet-box h3 { margin: 5px 0 0 0; font-size: 1.3rem; }

/* History Display */
#log-display {
    max-height: 500px;
    overflow-y: auto;
    font-size: 0.8rem;
    font-family: 'Courier New', Courier, monospace;
}

#log-display div {
    padding: 10px;
    border-bottom: 1px solid #eee;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: all 0.2s ease;
    cursor: pointer;
}

#log-display div:nth-child(even) { background-color: #fff5f7; }

#log-display div:hover {
    background-color: #e8f4fd !important;
    transform: scale(1.01);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.btn-small {
    width: 100%;
    background: #95a5a6;
    font-size: 0.75rem;
}

/* =========================================
   5. STRUK CONTAINER (KOLOM TENGAH)
   ========================================= */
.struk-container { 
    width: 320px; 
    background: white; 
    padding: 15px; 
    border: 1px solid #ddd; 
    box-shadow: 2px 2px 10px rgba(0,0,0,0.1);
    text-align: left;
    font-family: 'Courier New', Courier, monospace;
}

.header { 
    text-align: center; 
    border-bottom: 1px dashed #000; 
    padding-bottom: 10px; 
    margin-bottom: 10px; 
}

.header img { display: block; margin: 0 auto 5px; }

.item { display: flex; justify-content: space-between; margin: 4px 0; }

.total { 
    border-top: 1px dashed #000; 
    margin-top: 10px; 
    padding-top: 5px; 
    font-weight: bold; 
    font-size: 0.95em;
}

.footer { 
    border-top: 1px dashed #000; 
    text-align: center; 
    margin-top: 10px; 
    font-size: 0.85em; 
}

/* Warna Spesifik Tombol */
.btn-add { background: #007bff; }
.btn-reset { background: #dc3545; }
.btn-logout { background: #f54e00; }
.btn-print { background: #28a745; }
.btn-wa { background: #25D366; }
.btn-img { background: #128C7E; }

/* Style Tombol Hapus Kecil di Struk */
.btn-hapus-item {
    background: #ff4d4d;
    color: white;
    border: none;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    line-height: 15px;
    text-align: center;
    font-size: 14px;
    cursor: pointer;
    margin-left: 10px;
    padding: 0;
    font-weight: bold;
}

.btn-hapus-item:hover {
    background: #cc0000;
}

/* Sembunyikan tombol hapus saat klik Cetak Struk */
@media print {
    .btn-hapus-item {
        display: none !important;
    }
}
/* =========================================
   6. RESPONSIVE & PRINT
   ========================================= */
@media (max-width: 720px) {
    .dashboard-wrapper {
        display:block;
        grid-template-columns: 1fr;
        width:100% !important;
        padding: 10px;
        box-sizing:border-box;
        }
    
    .column-main { order: 1;width:100% !important;display:block;box-sizing:border-box; }
    .column-side:first-child { order: 2; width:100% !important;display:block;box-sizing:border-box;}
    .column-side:last-child { order: 3; width:100% !important;display:block;box-sizing:border-box;}
    #areaStruk {
        position: relative; /* Kembali ke aliran dokumen normal */
        margin: 0 auto;    /* Tengahkan struk */
        width: 100%;       /* Biar fleksibel di layar HP */
        max-width: 58mm;   /* Tapi jangan lebih lebar dari ukuran kertas aslinya */
    }
    
    }

@media print {
    body * { visibility: hidden; }
    #areaStruk, #areaStruk * { visibility: visible; }
    #areaStruk { 
        position: absolute; left: 0; top: 0; 
        width:58mm; 
        border: none; box-shadow: none; padding: 0;
        box-sizing:border-box;
    }
    #areaInput, button { display: none !important; }
}