:root { 
    --primary: #2c3e50; 
    --bg: #f1f2f6; 
    --card-bg: #ffffff; 
    --text: #2d3436; 
    --green: #27ae60; 
    --red: #c0392b; 
    --blue: #2980b9; 
    --border: #dfe6e9; 
}
body { 
    font-family: 'Segoe UI', sans-serif; 
    background-color: var(--bg); 
    color: var(--text); 
    margin: 0;
    padding: 20px; 
}
.web-layout { 
    display: block;
    max-width: 1100px;
    margin: 0 auto;
}
.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.nav-tabs { 
    display: flex; 
    gap: 10px; 
    margin-bottom: 20px; 
    border-bottom: 2px solid #b2bec3; 
    padding-bottom: 10px; 
    flex-wrap: wrap; 
}
.nav-btn { 
    padding: 12px 25px; 
    border: none; 
    background: #dfe6e9; 
    cursor: pointer; 
    border-radius: 6px; 
    font-weight: bold; 
    font-size: 15px; 
    color: #636e72; 
}
.nav-btn.active { 
    background: var(--primary); 
    color: white; 
}
.page { 
    display: none; 
    animation: fadeIn 0.3s; 
}
.page.active { 
    display: block; 
}
@keyframes fadeIn { 
    from { opacity: 0; } 
    to { opacity: 1; } 
}
.card { 
    background: var(--card-bg); 
    padding: 20px; 
    border-radius: 8px; 
    box-shadow: 0 2px 8px rgba(0,0,0,0.05); 
    margin-bottom: 20px; 
}
.grid-2 { 
    display: grid; 
    grid-template-columns: 1fr 1fr; 
    gap: 15px; 
}
h2, h3 { 
    margin-top: 0; 
    color: var(--primary); 
    border-bottom: 1px solid var(--border); 
    padding-bottom: 10px;
}
input, select { 
    width: 100%; 
    padding: 10px; 
    margin-bottom: 10px; 
    border: 1px solid var(--border); 
    border-radius: 5px; 
    box-sizing: border-box; 
}
button { 
    cursor: pointer; 
    padding: 8px 15px; 
    border: none; 
    border-radius: 5px; 
    font-weight: bold; 
    color: white; 
    transition: 0.2s; 
}
button:hover { opacity: 0.9; }
.btn-add { background: var(--blue); width: 100%; }
.btn-excel { background: #218c74; width: 100%; margin-top: 10px; }
.btn-pay { background: var(--green); font-size: 0.85em; padding: 5px 10px; }
.btn-in { background: var(--green); }
.btn-out { background: var(--red); }
.btn-trash { background: #fab1a0; color: #d63031; padding: 8px 12px; margin-left: 5px; border: 1px solid #e17055; }
.btn-reprint { background: #e67e22; color: white; font-size: 0.85em; padding: 5px 10px; }
.btn-finish { 
    background: #2d3436; 
    color: white; 
    width: 100%; 
    padding: 15px; 
    font-size: 1.2em; 
    margin-top: 20px; 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    gap: 10px; 
}
.btn-finish:disabled { background: #b2bec3; cursor: not-allowed; }
table { 
    width: 100%; 
    border-collapse: collapse; 
    font-size: 0.95em; 
}
th, td { 
    padding: 12px; 
    text-align: left; 
    border-bottom: 1px solid var(--border); 
}
th { background: #ecf0f1; color: #2c3e50; }
.stock-row { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    padding: 10px 0; 
    border-bottom: 1px solid #eee; 
}

/* PRINT STYLE */
#receiptArea { display: none; }
.check-box { 
    width: 15px; 
    height: 15px; 
    border: 1px solid #000; 
    display: inline-block; 
}

/* BARU: Style untuk Summary Box */
.summary-box {
    background: #ecf0f1;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 20px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
}
.summary-box div {
    background: var(--card-bg);
    padding: 10px;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.summary-box strong {
    display: block;
    font-size: 1.2em;
    color: var(--primary);
}

/* BARU: Style untuk Filter Bar */
.filter-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    align-items: center;
}
.filter-bar h3 {
    margin: 0;
    border: none;
    padding: 0;
}
.btn-sort {
    background: #6c757d;
    width: auto;
    margin: 0;
}


@media print {
    .web-layout { display: none !important; }
    #receiptArea { 
        display: block !important; 
        position: absolute; 
        left: 0; 
        top: 0; 
        width: 58mm; 
        font-family: 'Courier New', monospace; 
        font-size: 12px; 
        color: black; 
    }
    @page { size: 58mm auto; margin: 0; }
    .receipt-header { 
        text-align: center; 
        border-bottom: 1px dashed black; 
        padding-bottom: 5px; 
        margin-bottom: 5px; 
    }
    .receipt-table { 
        width: 100%; 
        font-size: 11px; 
    }
    .receipt-table th { 
        border-bottom: 1px solid black; 
        padding: 2px 0; 
        text-align: left; 
        font-size: 10px; 
    }
    .receipt-table td { 
        padding: 4px 0; 
        border: none; 
        vertical-align: middle; 
    }
    .receipt-footer { 
        text-align: center; 
        border-top: 1px dashed black; 
        padding-top: 5px; 
        margin-top: 15px; 
        font-size: 10px; 
    }
    .text-right { text-align: right; }
    .text-center { text-align: center; }
}


/* --- Mobile Friendly Styles --- */
@media (max-width: 768px) {
    body {
        padding: 0; 
        -webkit-text-size-adjust: 100%; 
    }
    .web-layout {
        padding: 10px; 
    }
    .main-header {
        flex-direction: column; 
        align-items: flex-start; 
        gap: 10px;
    }
    .main-header button {
        width: 100%; 
    }
    .grid-2 {
        grid-template-columns: 1fr; 
    }
    div.card > table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
    div.card:has(table) {
        padding: 0; 
    }
    div.card:has(table) > table {
        padding: 15px;
        margin-bottom: 0;
    }
    div.card:has(table) > h3 {
        padding: 15px 15px 0 15px;
    }
    .stock-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    .stock-row .stock-actions {
        width: 100%;
        display: flex;
    }
    .stock-row .stock-actions input {
        width: 100%; 
        flex-grow: 1; 
    }
    .stock-row .stock-actions button {
        flex-shrink: 0; 
    }
    .filter-bar {
        flex-direction: column;
        align-items: stretch;
    }
    .filter-bar input {
        width: 100%;
    }
    .btn-sort {
        width: 100%;
    }
}