:root {
    color-scheme: light;
    --bg: #f6f7fb;
    --surface: #ffffff;
    --line: #d9dee8;
    --text: #172033;
    --muted: #687386;
    --primary: #1267b1;
    --primary-dark: #0d4f88;
    --danger: #b42318;
    --success-bg: #e8f7ef;
    --success-text: #17613a;
    --error-bg: #fdecec;
    --error-text: #9b1c14;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: Arial, Helvetica, sans-serif;
}

.page {
    width: min(1180px, calc(100% - 32px));
    margin: 32px auto;
}

.topbar {
    align-items: center;
    display: flex;
    gap: 16px;
    justify-content: space-between;
    margin-bottom: 20px;
}

.header-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
}

.eyebrow {
    color: var(--primary);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0;
    margin: 0 0 4px;
    text-transform: uppercase;
}

h1,
h2 {
    margin: 0;
}

h1 {
    font-size: 32px;
}

h2 {
    font-size: 20px;
    margin-bottom: 16px;
}

.button,
button {
    align-items: center;
    background: var(--primary);
    border: 0;
    border-radius: 6px;
    color: #ffffff;
    cursor: pointer;
    display: inline-flex;
    font: inherit;
    font-weight: 700;
    justify-content: center;
    min-height: 40px;
    padding: 0 14px;
    text-decoration: none;
}

.button:hover,
button:hover {
    background: var(--primary-dark);
}

.button.ghost {
    background: #e8edf5;
    color: var(--text);
}

.button.small,
button.small {
    font-size: 13px;
    min-height: 32px;
    padding: 0 10px;
}

button.danger {
    background: var(--danger);
}

.filters,
.panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    margin-bottom: 18px;
    padding: 16px;
}

.filters {
    display: grid;
    gap: 12px;
    grid-template-columns: 1fr 220px 180px auto;
}

.filters-compact {
    grid-template-columns: 1fr auto;
}

input,
select {
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--text);
    font: inherit;
    min-height: 40px;
    padding: 8px 10px;
    width: 100%;
}

label {
    color: var(--muted);
    display: grid;
    font-size: 13px;
    font-weight: 700;
    gap: 6px;
}

.form-grid {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.actions {
    align-items: end;
    display: flex;
    gap: 10px;
}

.table-wrap {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow-x: auto;
}

table {
    border-collapse: collapse;
    min-width: 880px;
    width: 100%;
}

th,
td {
    border-bottom: 1px solid var(--line);
    padding: 12px 14px;
    text-align: left;
    vertical-align: top;
}

th {
    background: #eef2f7;
    color: #39465a;
    font-size: 13px;
}

.muted {
    color: var(--muted);
    display: block;
    font-size: 12px;
    margin-top: 4px;
}

.badge {
    border-radius: 999px;
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    padding: 5px 9px;
    text-transform: capitalize;
}

.badge-aktif {
    background: #daf5e6;
    color: #11683a;
}

.badge-menunggu {
    background: #fff3cd;
    color: #7a4b00;
}

.badge-nonaktif {
    background: #eceff3;
    color: #4a5568;
}

.empty {
    color: var(--muted);
    padding: 28px;
    text-align: center;
}

.alert {
    border-radius: 8px;
    font-weight: 700;
    margin-bottom: 18px;
    padding: 12px 14px;
}

.alert.success {
    background: var(--success-bg);
    color: var(--success-text);
}

.alert.error {
    background: var(--error-bg);
    color: var(--error-text);
}

.row-actions {
    align-items: center;
    display: flex;
    gap: 8px;
}

.row-actions form {
    margin: 0;
}

@media (max-width: 760px) {
    .topbar,
    .row-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .header-actions {
        justify-content: stretch;
    }

    .filters,
    .form-grid {
        grid-template-columns: 1fr;
    }
}
