* { box-sizing: border-box; }

body {
    background: #f1f5f9;
    font-family: 'Plus Jakarta Sans', Segoe UI, Arial, sans-serif;
    margin: 0;
    padding: 0;
}

.container {
    width: 960px;
    max-width: 96%;
    margin: 36px auto;
    background: white;
    padding: 32px;
    border-radius: 18px;
    box-shadow: 0 4px 24px rgba(0,0,0,.09);
}

h2 { color: #0f172a; margin-top: 0; }
h3 { margin-top: 28px; color: #1e293b; }

/* TAB NAV */
.tab-nav {
    display: flex;
    gap: 10px;
    margin-bottom: 28px;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 0;
}
.tab-btn {
    padding: 10px 22px;
    border: none;
    background: transparent;
    font-size: 15px;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    border-radius: 0;
    transition: color .2s, border-color .2s;
}
.tab-btn.active {
    color: #0ea5e9;
    border-bottom-color: #0ea5e9;
}
.tab-content { display: none; }
.tab-content.active { display: block; }

/* RESULT HEADER */
.result-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 22px;
    flex-wrap: wrap;
}
.result-header h2 { margin: 0; }
.badge-qty {
    background: #e0f2fe;
    color: #0284c7;
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

/* TABLE */
table { width: 100%; border-collapse: collapse; }
thead th {
    background: #0f172a;
    color: white;
    padding: 11px 10px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
}
td {
    padding: 9px 10px;
    border-bottom: 1px solid #e2e8f0;
    font-size: 14px;
}
tr:last-child td { border-bottom: none; }
.num { color: #94a3b8; width: 36px; text-align: center; }
.td-right { text-align: right; }
.total-row td { background: #f8fafc; font-weight: 700; }

/* INPUTS */
input[type="text"],
input[type="number"] {
    width: 100%;
    padding: 8px 10px;
    border-radius: 7px;
    border: 1px solid #cbd5e1;
    font-size: 14px;
    font-family: inherit;
    transition: border-color .2s;
}
input:focus { outline: none; border-color: #0ea5e9; box-shadow: 0 0 0 3px #e0f2fe; }

/* CARD */
.card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    margin-top: 20px;
}
.card label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    font-size: 13px;
    color: #475569;
}
.card > div { margin-bottom: 12px; }

/* GRID LAYOUTS */
.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 20px;
}
.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-bottom: 20px;
}
.chart-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* BOXES */
.box {
    border-radius: 12px;
    padding: 18px 16px;
    text-align: center;
    color: white;
}
.box-label { font-size: 12px; opacity: .85; margin-bottom: 6px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; }
.box-value { font-size: 18px; font-weight: 700; }
.box-blue   { background: #0ea5e9; }
.box-green  { background: #22c55e; }
.box-purple { background: #8b5cf6; }
.box-orange { background: #f59e0b; }
.box-red    { background: #ef4444; }

/* BUTTONS */
button { cursor: pointer; font-family: inherit; }

.add {
    background: #22c55e;
    color: white;
    border: none;
    padding: 10px 18px;
    margin-top: 12px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
}
.add:hover { background: #16a34a; }

.hitung {
    margin-top: 24px;
    width: 100%;
    background: #0f172a;
    color: white;
    border: none;
    padding: 15px;
    font-size: 17px;
    font-weight: 700;
    border-radius: 10px;
    transition: background .2s;
}
.hitung:hover { background: #1e293b; }

.btn-del {
    background: #fee2e2;
    color: #dc2626;
    border: none;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 14px;
}
.btn-del:hover { background: #fecaca; }

/* ACTION BAR */
.action-bar {
    display: flex;
    gap: 12px;
    margin: 20px 0;
    flex-wrap: wrap;
}
.btn-edit {
    background: #0ea5e9;
    color: white;
    border: none;
    padding: 11px 22px;
    border-radius: 9px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}
.btn-edit:hover { background: #0284c7; }

.btn-back {
    display: inline-block;
    padding: 11px 22px;
    background: #22c55e;
    color: white;
    text-decoration: none;
    border-radius: 9px;
    font-size: 14px;
    font-weight: 600;
}
.btn-back:hover { background: #16a34a; }

/* EDIT SECTION */
.edit-section {
    background: #fffbeb;
    border: 2px dashed #fcd34d;
    border-radius: 14px;
    padding: 24px;
    margin-bottom: 20px;
}
.edit-section h3 { margin-top: 0; }

/* ALERTS */
.alert-box {
    border-radius: 10px;
    padding: 14px 18px;
    margin-bottom: 20px;
    font-size: 14px;
    line-height: 1.6;
}
.alert-warn { background: #fef3c7; border-left: 4px solid #f59e0b; color: #92400e; }
.alert-ok   { background: #dcfce7; border-left: 4px solid #22c55e; color: #14532d; }

/* COMPARE CARDS */
.compare-card { margin-top: 0; }
.compare-label { font-weight: 700; font-size: 14px; margin-bottom: 12px; color: #475569; }
.compare-table { width: 100%; border-collapse: collapse; }
.compare-table td { padding: 7px 4px; font-size: 14px; border-bottom: 1px solid #e2e8f0; }
.compare-table tr:last-child td { border-bottom: none; }
.new-price { border: 2px solid #0ea5e9; background: #f0f9ff; }

/* BADGES */
.badge-up   { background: #fee2e2; color: #dc2626; padding: 3px 9px; border-radius: 20px; font-size: 12px; font-weight: 700; }
.badge-down { background: #dcfce7; color: #16a34a; padding: 3px 9px; border-radius: 20px; font-size: 12px; font-weight: 700; }
.badge-same { background: #f1f5f9; color: #64748b; padding: 3px 9px; border-radius: 20px; font-size: 12px; font-weight: 700; }

/* INFO BOX */
.info-box {
    background: #e0f2fe;
    border-left: 4px solid #0ea5e9;
    color: #0369a1;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
}

/* CHARTS */
.chart-wrap { position: relative; height: 260px; }

/* RESPONSIVE */
@media (max-width: 700px) {
    .grid-4, .grid-3 { grid-template-columns: 1fr 1fr; }
    .chart-grid { grid-template-columns: 1fr; }
    .container { padding: 18px; }
}
