:root {
    --bg: #f3f6fa;
    --surface: #ffffff;
    --line: #dbe3ef;
    --text: #162033;
    --muted: #667085;
    --primary: #0f5ea8;
    --primary-dark: #0a477f;
    --nav: #0b2545;
    --nav-soft: #123a68;
    --gold: #d99a2b;
    --green: #16a34a;
    --yellow: #f59e0b;
    --amber-soft: #fff7ed;
    --gray-status: #64748b;
    --red: #dc2626;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background:
        linear-gradient(180deg, rgba(15, 94, 168, 0.08), rgba(238, 243, 248, 0) 260px),
        var(--bg);
    color: var(--text);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 14px;
}

a {
    color: var(--primary);
    text-decoration: none;
}

.topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10;
    display: flex;
    justify-content: space-between;
    gap: 16px;
    min-height: 72px;
    padding: 14px 28px;
    background: linear-gradient(135deg, var(--nav), var(--primary));
    color: #fff;
    box-shadow: 0 8px 26px rgba(11, 37, 69, 0.22);
}

.topbar strong {
    display: block;
    font-size: 20px;
    letter-spacing: 0;
}

.brand-logo {
    float: left;
    width: 42px;
    height: 42px;
    object-fit: contain;
    margin-right: 12px;
    border-radius: 6px;
    background: #fff;
    padding: 4px;
}

.topbar span {
    color: #d5dfef;
    font-size: 12px;
}

.userbar {
    display: flex;
    align-items: center;
    gap: 14px;
    white-space: nowrap;
}

.userbar a {
    color: #fff;
    font-weight: 700;
}

.sidebar {
    position: fixed;
    top: 72px;
    left: 0;
    bottom: 0;
    width: 248px;
    padding: 18px 14px;
    background: var(--nav);
    border-right: 1px solid rgba(255,255,255,0.08);
}

.sidebar a {
    display: block;
    padding: 12px 14px;
    border-radius: 6px;
    color: #d8e6f5;
    font-weight: 700;
    margin-bottom: 5px;
}

.sidebar a:hover {
    background: var(--nav-soft);
    color: #fff;
}

.sidebar a.active {
    background: #e8f2ff;
    color: var(--nav);
}

.content {
    margin-left: 248px;
    padding: 98px 28px 36px;
}

.login-content {
    max-width: 460px;
    margin: 0 auto;
    padding: 110px 20px;
}

h1 {
    margin: 0 0 18px;
    font-size: 28px;
    color: #102033;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.breadcrumb a {
    color: var(--primary);
}

h2 {
    margin: 0 0 14px;
    font-size: 17px;
}

.panel,
.login-card,
.kpi {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: 0 12px 32px rgba(16, 32, 51, 0.07);
}

.panel,
.login-card {
    padding: 18px;
    margin-bottom: 18px;
}

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(190px, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.kpi-grid.compact-kpi {
    grid-template-columns: repeat(3, minmax(190px, 1fr));
}

.kpi {
    padding: 18px;
    border-top: 4px solid var(--primary);
}

.kpi span {
    display: block;
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.kpi strong {
    font-size: 25px;
    color: #0b2545;
}

.kpi.success {
    border-left: 5px solid var(--green);
}

.kpi.warning {
    border-left: 5px solid var(--yellow);
}

.kpi.danger {
    border-left: 5px solid var(--red);
}

.chart-grid {
    display: grid;
    grid-template-columns: minmax(260px, 0.8fr) minmax(360px, 1.2fr);
    gap: 18px;
}

.filters,
.grid-form {
    display: grid;
    grid-template-columns: repeat(4, minmax(160px, 1fr));
    gap: 12px;
    align-items: end;
    margin-bottom: 18px;
}

.sticky-action {
    position: sticky;
    top: 86px;
    z-index: 4;
    box-shadow: 0 12px 28px rgba(16, 32, 51, 0.12);
}

.inline-form {
    display: flex;
    gap: 8px;
    align-items: center;
}

.checkline {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
}

.checkline input {
    width: auto;
    min-height: auto;
}

.check-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(160px, 1fr));
    gap: 8px 16px;
    margin: 12px 0 18px;
}

.check-grid.compact {
    grid-template-columns: repeat(2, minmax(170px, 1fr));
}

.danger-zone {
    border-color: rgba(220, 38, 38, 0.35);
    border-top: 4px solid var(--red);
}

.operation-grid,
.guide-grid,
.split-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(260px, 1fr));
    gap: 16px;
}

.operation-card,
.formula-grid div,
.example-box {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 14px;
    background: #fbfdff;
}

.operation-card h3,
.split-grid h3,
.note-card h3 {
    margin: 0 0 10px;
    font-size: 15px;
}

.mini-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 26px;
    min-height: 22px;
    margin-left: auto;
    padding: 2px 7px;
    border-radius: 999px;
    background: #e6eef8;
    color: #0b2545;
    font-size: 12px;
    font-weight: 800;
}

.guide-hero {
    border-top: 4px solid var(--primary);
}

.compliance-hero {
    display: flex;
    justify-content: space-between;
    gap: 22px;
    align-items: stretch;
    border-top: 4px solid var(--primary);
    background:
        linear-gradient(135deg, rgba(15, 94, 168, 0.08), rgba(255,255,255,0)),
        var(--surface);
}

.compliance-hero h2 {
    font-size: 22px;
}

.simulation-result {
    border: 1px solid var(--line);
    border-left: 5px solid var(--primary);
    border-radius: 8px;
    padding: 14px;
    background: #f8fbff;
}

.simulation-result p {
    margin: 10px 0 0;
    color: var(--muted);
    line-height: 1.6;
}

.validation-panel {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: flex-start;
    border-top: 4px solid var(--primary);
}

.validation-hero {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: center;
    border-top: 4px solid var(--primary);
    background:
        linear-gradient(135deg, rgba(15, 94, 168, 0.08), rgba(255, 255, 255, 0)),
        var(--surface);
}

.hero-status {
    white-space: nowrap;
}

.strong-table th {
    background: #edf4fb;
    color: #0b2545;
    border-bottom: 2px solid #c9d7e8;
}

.strong-table td {
    vertical-align: top;
}

.reason-box {
    min-width: 210px;
    padding: 10px;
    border: 1px solid var(--line);
    border-left: 4px solid var(--primary);
    border-radius: 8px;
    background: #f8fbff;
}

.reason-box summary {
    cursor: pointer;
    color: #0b2545;
    font-weight: 800;
}

.reason-box p {
    margin: 10px 0 0;
    color: var(--muted);
    line-height: 1.55;
}

.validation-card-form {
    display: grid;
    gap: 8px;
    margin-top: 10px;
    min-width: 220px;
}

.validation-card-form input,
.validation-card-form select {
    min-height: 36px;
}

.validation-form {
    flex-wrap: wrap;
    justify-content: flex-end;
    min-width: min(100%, 520px);
}

.validation-form input {
    min-width: 230px;
}

.guide-list {
    margin: 0;
    padding-left: 20px;
    line-height: 1.75;
}

.formula-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(180px, 1fr));
    gap: 12px;
}

.formula-grid strong {
    display: block;
    margin-bottom: 6px;
    color: var(--nav);
}

.formula-grid span,
.status-row span {
    color: var(--muted);
    line-height: 1.5;
}

.status-row {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 8px 12px;
    align-items: center;
    margin-top: 16px;
}

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

.note-card {
    border: 1px solid var(--line);
    border-left: 5px solid var(--primary);
    border-radius: 8px;
    padding: 14px;
    background: #fff;
}

.note-card.tinggi {
    border-left-color: var(--red);
}

.note-card .badge.tinggi {
    background: var(--red);
}

.note-card .badge.normal {
    background: var(--yellow);
}

.note-card .badge.rendah {
    background: var(--green);
}

.note-card.normal {
    border-left-color: var(--yellow);
}

.note-card.rendah {
    border-left-color: var(--green);
}

.note-card-head {
    display: flex;
    gap: 10px;
    align-items: center;
}

.note-card-head input {
    font-weight: 800;
}

.note-card-meta {
    margin: 8px 0 12px;
    color: var(--muted);
    font-size: 12px;
}

.note-card-controls {
    display: grid;
    grid-template-columns: repeat(3, minmax(110px, 1fr));
    gap: 8px;
    margin-bottom: 10px;
}

.recommend-list {
    margin: 0;
    padding-left: 20px;
    line-height: 1.8;
}

.grid-form .wide {
    grid-column: span 2;
}

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

input,
select,
textarea {
    width: 100%;
    min-height: 40px;
    border: 1px solid #c9d6e5;
    border-radius: 6px;
    padding: 9px 10px;
    background: #fff;
    color: var(--text);
    font: inherit;
}

input:focus,
select:focus,
textarea:focus {
    outline: 3px solid rgba(15, 94, 168, 0.16);
    border-color: var(--primary);
}

textarea {
    min-height: 86px;
    resize: vertical;
}

button,
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 9px 14px;
    border: 0;
    border-radius: 6px;
    background: linear-gradient(180deg, var(--primary), var(--primary-dark));
    color: #fff;
    font-weight: 700;
    cursor: pointer;
}

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

.button.small {
    min-height: 30px;
    padding: 5px 10px;
    font-size: 12px;
}

button:disabled,
.button:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.danger-button {
    background: linear-gradient(180deg, var(--red), #991b1b);
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

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

th {
    background: #eef5fb;
    color: #344054;
    font-size: 12px;
    text-transform: uppercase;
}

tbody tr:hover {
    background: #f8fbff;
}

.badge {
    display: inline-block;
    min-width: 86px;
    border-radius: 999px;
    padding: 4px 9px;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    text-align: center;
}

.badge.approval-final-aktif {
    background: var(--green);
}

.badge.review-teknis {
    background: var(--primary);
}

.badge.hijau,
.badge.selesai {
    background: var(--green);
}

.badge.kuning,
.badge.dalam.proses {
    background: var(--yellow);
}

.badge.merah,
.badge.belum.selesai {
    background: var(--red);
}

.badge.berhasil {
    background: var(--green);
}

.badge.gagal {
    background: var(--red);
}

.badge.sesuai,
.badge.boleh {
    background: var(--green);
}

.badge.tidak-sesuai,
.badge.tidak-boleh,
.badge.melebihi-batas,
.badge.ditolak,
.badge.risiko-tinggi {
    background: var(--red);
}

.badge.perlu-review,
.badge.review,
.badge.batas-perlu-hitung,
.badge.batas,
.badge.wajib,
.badge.lemah,
.badge.belum-direview,
.badge.perlu-perbaikan,
.badge.perlu-review {
    background: var(--yellow);
}

.badge.terhubung {
    background: var(--green);
}

.badge.disetujui {
    background: var(--green);
}

.badge.aman-sementara {
    background: var(--green);
}

.badge.ada,
.badge.lengkap,
.badge.pilot,
.badge.final {
    background: var(--green);
}

.badge.parsial,
.badge.diproses,
.badge.berjalan,
.badge.draft,
.badge.perlu-revisi {
    background: var(--yellow);
}

.badge.kurang,
.badge.tertunda,
.badge.ditunda {
    background: var(--red);
}

.badge.non-pilot,
.badge.arsip,
.badge.baru {
    background: #64748b;
}

.badge.rekomendasi-disetujui {
    background: var(--primary);
}

.badge.tidak-terhubung {
    background: var(--red);
}

.badge.aktif {
    background: var(--green);
}

.badge.nonaktif {
    background: #64748b;
}

.badge.belum,
.badge.belum-diverifikasi {
    background: var(--gray-status);
}

.badge.tinggi,
.badge.rutin {
    background: var(--green);
}

.badge.normal {
    background: var(--yellow);
}

.badge.sedang,
.badge.perlu-dipantau,
.badge.mendesak {
    background: var(--yellow);
}

.badge.rendah,
.badge.sangat-mendesak {
    background: var(--red);
}

.badge.rendah {
    background: var(--green);
}

.badge.sedang {
    background: var(--yellow);
}

.badge.tinggi {
    background: var(--red);
}

.badge.belum-ada {
    background: #64748b;
}

.note {
    margin: 0 0 14px;
    color: var(--muted);
    line-height: 1.55;
}

.alert {
    padding: 11px 12px;
    border-radius: 6px;
    margin-bottom: 14px;
    background: #ecfdf3;
    color: #027a48;
    font-weight: 700;
}

.alert.error {
    background: #fef3f2;
    color: #b42318;
}

.hint {
    margin-top: 14px;
    color: var(--muted);
    line-height: 1.6;
}

.profile-hero {
    display: flex;
    justify-content: space-between;
    gap: 22px;
    margin-bottom: 18px;
    padding: 22px;
    border-radius: 12px;
    background:
        linear-gradient(135deg, rgba(11, 37, 69, 0.95), rgba(15, 94, 168, 0.92)),
        #0b2545;
    color: #fff;
    box-shadow: 0 16px 36px rgba(11, 37, 69, 0.22);
}

.profile-hero h2 {
    margin: 5px 0 8px;
    color: #fff;
    font-size: 24px;
}

.profile-hero p {
    margin: 0;
    color: #dbeafe;
}

.eyebrow {
    color: #ffd37a;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.profile-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(96px, 1fr));
    gap: 10px;
    min-width: 340px;
}

.profile-metrics div {
    padding: 14px;
    border-radius: 8px;
    background: rgba(255,255,255,0.12);
}

.profile-metrics span {
    display: block;
    color: #cfe3ff;
    font-size: 12px;
    font-weight: 700;
}

.profile-metrics strong {
    display: block;
    margin-top: 5px;
    font-size: 22px;
}

code {
    background: #edf2f7;
    border-radius: 4px;
    padding: 2px 5px;
}

@media (max-width: 900px) {
    .topbar {
        position: static;
        flex-direction: column;
    }

    .sidebar {
        position: static;
        display: flex;
        width: auto;
        overflow-x: auto;
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .content {
        margin-left: 0;
        padding: 20px;
    }

    .kpi-grid,
    .chart-grid,
    .filters,
    .grid-form,
    .operation-grid,
    .guide-grid,
    .split-grid,
    .formula-grid,
    .note-board,
    .note-card-controls {
        grid-template-columns: 1fr;
    }

    .grid-form .wide {
        grid-column: auto;
    }

    .profile-hero {
        flex-direction: column;
    }

    .profile-metrics {
        min-width: 0;
        grid-template-columns: 1fr;
    }
}
