/* === TEMA & DESAIN MODERN === */
:root {
    --bg-body: #f8fafc; --bg-card: #ffffff;
    --primary: #157f5c; --primary-light: #f0fdf4; --primary-border: #bbf7d0;
    --table-head: #18332a; 
    --warning: #f59e0b; 
    --blue-light: #f0f9ff; --blue-border: #bae6fd;
    --text-main: #1f2937; --text-muted: #64748b;
    --border-color: #e2e8f0;
    --radius: 12px;
}

body { font-family: 'Inter', 'Segoe UI', sans-serif; background-color: var(--bg-body); color: var(--text-main); margin: 0; padding: 15px; }
.container { max-width: 900px; margin: auto; }

.app-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 25px; flex-wrap: wrap; gap: 15px; }
.header-left { display: flex; align-items: center; gap: 15px; }
.app-icon { background: var(--primary); color: white; width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 24px; box-shadow: 0 4px 6px rgba(21, 127, 92, 0.2); }
.app-title h1 { margin: 0; font-size: 20px; color: var(--text-main); display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.app-title p { margin: 2px 0 0 0; font-size: 12px; color: var(--text-muted); }
.status-cloud { background: #dcfce7; color: #166534; padding: 4px 12px; border-radius: 20px; font-size: 12px; font-weight: 700; border: 1px solid #86efac; }

.panel { background: var(--bg-card); border-radius: var(--radius); padding: 20px; box-shadow: 0 4px 6px -1px rgba(0,0,0,0.01); margin-bottom: 25px; border: 1px solid var(--border-color); }
.panel-header-action { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; flex-wrap: wrap; gap: 10px; }
h2 { font-size: 18px; margin: 0; color: var(--text-main); display: flex; align-items: center; gap: 8px; }

.summary-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin-bottom: 15px; }
.summary-card { padding: 15px; border-radius: var(--radius); border: 1px solid var(--border-color); background: white; }
.summary-card h3 { margin: 0 0 5px 0; font-size: 12px; color: var(--text-muted); font-weight: 500; }
.summary-card h2 { margin: 0; font-size: 20px; font-weight: 800; }
#total-kas { color: #065f46; } #total-piutang { color: #991b1b; }

form { display: flex; flex-direction: column; gap: 12px; margin-top: 15px; }
input, select, button { padding: 12px 15px; border: 1px solid var(--border-color); border-radius: 8px; font-size: 14px; width: 100%; box-sizing: border-box; background-color: white; outline: none; transition: 0.2s; }
input:focus, select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(21, 127, 92, 0.1); }

.box-keranjang { background-color: var(--primary-light); border: 1px solid var(--primary-border); padding: 15px; border-radius: 8px; display: flex; flex-direction: column; gap: 10px; }
.box-keranjang h4 { margin: 0 0 5px 0; color: var(--primary); font-size: 14px; }
.box-total { background-color: var(--primary-light); border: 1px dashed var(--primary-border); padding: 15px; border-radius: 8px; display: flex; flex-direction: column; gap: 12px; margin-top: 5px; }
.box-total label { font-size: 12px; font-weight: 600; color: var(--text-muted); display: block; margin-bottom: -8px; }
.box-total input { font-size: 16px; font-weight: bold; background: white; }
.kembalian-text { font-size: 16px; font-weight: bold; color: var(--text-main); text-align: right; margin: 5px 0 0 0; }
.kembalian-text span { color: var(--primary); font-size: 18px; }

button { cursor: pointer; font-weight: 600; text-align: center; border: none; color: white; display: flex; align-items: center; justify-content: center; gap: 8px; }
.btn-primary { background-color: var(--primary); } .btn-primary:hover { background-color: #12694b; }
.btn-warning { background-color: var(--warning); color: white; } .btn-warning:hover { background-color: #d97706; }
.btn-preview { background-color: white; color: var(--text-main); border: 1px solid var(--border-color); width: auto; padding: 6px 12px; font-size: 13px; border-radius: 6px; box-shadow: 0 1px 2px rgba(0,0,0,0.05); font-weight: bold; }
.btn-preview:hover { background-color: #f1f5f9; }
.btn-toggle-panel { background: #f1f5f9; color: var(--text-main); font-size: 12px; border: 1px solid var(--border-color); padding: 6px 12px; border-radius: 20px; width: auto; }

.table-wrapper { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border-color); background: white; }
table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; min-width: 500px; }
th { background-color: var(--table-head); color: white; font-weight: 600; text-align: left; padding: 14px 16px; border-bottom: 1px solid var(--border-color); }
td { padding: 12px 16px; border-bottom: 1px solid var(--border-color); vertical-align: middle; background: white; }
tr:nth-child(even) td { background-color: #f8fafc; }
tr:last-child td { border-bottom: none; }

.action-group { display: flex; gap: 5px; }
.btn-kotak { width: 32px; height: 32px; padding: 0; border-radius: 6px; font-size: 16px; font-weight: bold; }
.btn-plus { background-color: var(--primary); } .btn-minus { background-color: var(--warning); }
.btn-del { background-color: #fee2e2; color: #ef4444; width: auto; padding: 6px 10px; font-size: 12px; border-radius: 6px; }
.btn-reprint-row { background-color: #f1f5f9; color: var(--primary); border: 1px solid var(--primary-border); width: auto; padding: 6px 10px; font-size: 11px; border-radius: 6px; }

.input-fisik { width: 80px; padding: 8px; text-align: center; border-radius: 6px; background: #ffffff; border: 1px solid var(--border-color); }
.text-danger { color: #dc2626; font-weight: bold; } .text-success { color: var(--primary); font-weight: bold; }

.autocomplete-wrapper { position: relative; width: 100%; }
.autocomplete-list { display: none; position: absolute; top: 100%; left: 0; right: 0; background: white; border: 1px solid var(--border-color); border-top: none; z-index: 99; max-height: 200px; overflow-y: auto; list-style: none; padding: 0; margin: 0; border-radius: 0 0 8px 8px; box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1); }
.autocomplete-list li { padding: 12px 15px; cursor: pointer; border-bottom: 1px solid #f1f5f9; font-size: 13px; }

.modal-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.6); z-index: 1000; overflow-y: auto; backdrop-filter: blur(2px); }
.modal-content { background: #f8fafc; margin: 5% auto; padding: 20px; width: 90%; max-width: 700px; border-radius: var(--radius); box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1); border: 1px solid var(--border-color); }
.modal-title { margin: 0 0 15px 0; color: var(--text-main); font-size: 18px; display: flex; align-items: center; gap: 8px; }
.modal-actions { display: flex; gap: 10px; margin-top: 20px; flex-wrap: wrap; }

.panel-hidden { max-height: 55px !important; overflow: hidden; }
#area-struk, #area-struk-hutang { display: none; }

/* === DESAIN TABS PENGATURAN === */
.tab-header {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 10px;
}

.tab-btn {
    padding: 12px 22px;
    background: #f1f5f9;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    color: var(--text-main); /* Baris ini yang ditambahkan */
}


.tab-btn.active {
    background: var(--primary);
    color: white;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.rek-item { background: white; border: 1px dashed var(--border-color); padding: 15px; border-radius: 8px; margin-bottom: 10px; position: relative; }
.rek-item .btn-del-rek { position: absolute; top: 10px; right: 10px; background: #fee2e2; color: #ef4444; width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: bold; cursor: pointer; }

/* === DESAIN HALAMAN LOGIN === */
#layar-login { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: var(--primary-light); z-index: 9999; display: flex; justify-content: center; align-items: center; flex-direction: column; padding: 20px; box-sizing: border-box; }
.login-box { background: white; padding: 30px; border-radius: var(--radius); box-shadow: 0 10px 25px rgba(0,0,0,0.05); width: 100%; max-width: 350px; text-align: center; border: 1px solid var(--primary-border); }
.login-box h2 { display: block; text-align: center; color: var(--primary); margin-bottom: 20px; font-size: 22px; }
.login-box input { margin-bottom: 15px; }
#app-utama { display: none; }

/* === TAMBAHAN UNTUK TAMPILAN HP (PENGATURAN MENURUN & TAB RAPI) === */
@media (max-width: 768px) {
    /* Membuat menu pengaturan menurun ke bawah */
    #modal-pengaturan .tab-header {
        flex-direction: column;
        gap: 8px;
        border-bottom: none;
    }
    #modal-pengaturan .tab-btn {
        width: 100%;
        text-align: left;
        border: 1px solid var(--border-color);
        background: white;
    }
    #modal-pengaturan .tab-btn.active {
        background: var(--primary-light);
        border: 1px solid var(--primary);
        border-left: 4px solid var(--primary);
        color: var(--primary);
    }
    
    /* Membuat tab utama (Transaksi, Riwayat, dll) menjadi 2 baris agar tombolnya pas di HP */
    .panel > .tab-header {
        display: grid;
        grid-template-columns: 1fr 1fr; 
    }
    .panel > .tab-header .tab-btn {
        width: 100%;
        margin: 0;
    }
}
