:root {
    --bg: #f6f4f1;
    --surface: #ffffff;
    --surface-alt: #f3f7ff;
    --text: #0f172a;
    --muted: #64748b;
    --accent: #ff6b4a;
    --accent-2: #22d3ee;
    --accent-3: #f59e0b;
    --border: #e2e8f0;
    --shadow: 0 20px 60px rgba(15, 23, 42, 0.12);
    --radius: 18px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Space Grotesk", "Plus Jakarta Sans", "Segoe UI", sans-serif;
    font-size: 17px;
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    color: var(--text);
    min-height: 100vh;
    padding: 20px;
}

body::before,
body::after {
    content: none;
    position: fixed;
    width: 380px;
    height: 380px;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.35;
    z-index: 0;
    pointer-events: none;
}

body::before {
    background: #ffd6c7;
    top: -140px;
    left: -120px;
}

body::after {
    background: #b6f0ff;
    bottom: -160px;
    right: -120px;
}

h1, h2, h3 {
    letter-spacing: -0.02em;
}

h2 {
    margin-bottom: 16px;
    color: var(--text);
}

a {
    color: inherit;
    text-decoration: none;
}

.page {
    max-width: 1600px;
    width: 100%;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.layout {
    display: grid;
    grid-template-columns: 270px 1fr;
    gap: 20px;
    align-items: start;
}

.main {
    min-width: 0;
}

.sidebar-shell {
    position: sticky;
    top: 24px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: var(--shadow);
    padding: 18px;
    display: grid;
    gap: 18px;
}

.sidebar-brand {
    display: grid;
    grid-template-columns: 44px 1fr;
    gap: 12px;
    align-items: center;
}

.sidebar-logo {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    font-weight: 700;
    color: #ffffff;
    background: linear-gradient(135deg, var(--accent), #ff9a62);
}

.sidebar-title {
    font-weight: 700;
    font-size: 14px;
}

.sidebar-sub {
    color: var(--muted);
    font-size: 12px;
}

.sidebar-nav {
    display: grid;
    gap: 10px;
}

.sidebar-link {
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid transparent;
    background: #f8fafc;
    font-size: 14px;
    font-weight: 600;
}

.sidebar-link:hover {
    border-color: var(--border);
    background: #ffffff;
}

.sidebar-link.active {
    background: #fff2eb;
    border-color: #ffd9cc;
    color: #b5472e;
}

.sidebar-footer {
    border-top: 1px solid var(--border);
    padding-top: 12px;
}

.sidebar-link.logout {
    color: #b91c1c;
    background: #fff1f2;
    border-color: #fecdd3;
}

.toolbar {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    margin-top: 18px;
}

.notice {
    padding: 10px 12px;
    border-radius: 10px;
    background: #ecfeff;
    border: 1px solid #a5f3fc;
    color: #0e7490;
    font-size: 13px;
}

.notice.error {
    background: #fef2f2;
    border-color: #fecaca;
    color: #b91c1c;
}

.form-card {
    margin-top: 18px;
    padding: 22px;
    border-radius: 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    max-width: 720px;
}

.form-card.centered {
    margin-left: auto;
    margin-right: auto;
}

.form-grid {
    display: grid;
    gap: 14px;
}

.form-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-secondary {
    background: #ffffff;
    color: var(--text);
    border: 1px solid var(--border);
    box-shadow: none;
}

.btn-danger {
    background: #ef4444;
    color: #ffffff;
    border: 1px solid transparent;
    box-shadow: 0 10px 20px rgba(239, 68, 68, 0.25);
}

.btn-danger:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 26px rgba(239, 68, 68, 0.28);
}

.hero {
    display: grid;
    grid-template-columns: 1fr;
    gap: 28px;
    padding: 28px;
    border-radius: var(--radius);
    background: #ffffff;
    border: 1px solid var(--border);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.hero.compact {
    padding: 26px;
}

.hero-left h1 {
    font-size: 40px;
    margin-top: 8px;
    margin-bottom: 10px;
}

.hero-left p {
    color: var(--muted);
    font-size: 16px;
    margin-bottom: 18px;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 999px;
    background: #fff2eb;
    color: #b5472e;
    border: 1px solid #ffd9cc;
}

.hero-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 18px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    border: 1px solid transparent;
    background: linear-gradient(135deg, var(--accent), #ff9a62);
    color: #ffffff;
    box-shadow: 0 10px 20px rgba(255, 107, 74, 0.25);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 26px rgba(255, 107, 74, 0.28);
}

.btn-ghost {
    background: #ffffff;
    color: var(--text);
    border: 1px solid var(--border);
    box-shadow: none;
}

.btn-ghost:hover {
    box-shadow: 0 10px 20px rgba(15, 23, 42, 0.08);
}

.grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 28px;
    margin-top: 28px;
}

.card.full {
    grid-column: 1 / -1;
}

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 18px;
    margin-top: 24px;
}

.kpi-card {
    background: var(--surface);
    border-radius: 16px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    padding: 18px 20px;
}

.kpi-link {
    display: block;
    color: inherit;
}

.kpi-link .kpi-card {
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.kpi-link:hover .kpi-card {
    transform: translateY(-2px);
    border-color: #cbd5e1;
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
}

.kpi-label {
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.kpi-value {
    font-size: 28px;
    font-weight: 700;
    margin-top: 6px;
}

.kpi-note {
    color: var(--muted);
    font-size: 12px;
    margin-top: 6px;
}

.donut-wrap {
    display: grid;
    gap: 16px;
}

.donut {
    --rahasia: 0%;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    background: conic-gradient(#ff6b4a var(--rahasia), #22d3ee 0);
    display: grid;
    place-items: center;
    margin: 6px auto 0;
    box-shadow: inset 0 0 0 14px #ffffff;
}

.donut-center {
    background: #ffffff;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    text-align: center;
}

.donut-value {
    font-size: 26px;
    font-weight: 700;
}

.donut-label {
    font-size: 12px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.donut-legend {
    display: grid;
    gap: 8px;
    font-size: 13px;
    color: var(--muted);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

.legend-rahasia {
    background: #ff6b4a;
}

.legend-biasa {
    background: #22d3ee;
}

.recent-list {
    display: grid;
    gap: 12px;
    margin-top: 14px;
}

.recent-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: #f8fafc;
}

.recent-title {
    font-weight: 600;
}

.recent-sub {
    font-size: 12px;
    color: var(--muted);
}

.recent-tag {
    font-size: 12px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 999px;
    background: #fff2eb;
    color: #b5472e;
}

.card {
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    padding: 22px;
}

.stat-card {
    display: grid;
    gap: 6px;
    padding: 22px;
    border-radius: 16px;
    background: linear-gradient(135deg, #fff7f2, #ffffff);
    border: 1px solid #ffe3d7;
}

.stat-label {
    color: var(--muted);
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.stat-value {
    font-size: 52px;
    font-weight: 700;
}

.stat-foot {
    color: var(--muted);
    font-size: 14px;
}

.chart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.chart-title {
    font-size: 20px;
    font-weight: 600;
}

.chart-note {
    color: var(--muted);
    font-size: 13px;
}

.chart-wrap {
    background: var(--surface-alt);
    border-radius: 16px;
    padding: 18px;
    border: 1px solid #e6eeff;
}

.chart-legend {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 14px;
    color: var(--muted);
    font-size: 12px;
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

.actions-list {
    display: grid;
    gap: 12px;
    margin-top: 16px;
}

.action-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-radius: 12px;
    background: #f8fafc;
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 15px;
}

.action-item.logout {
    background: #fff1f2;
    border-color: #fecdd3;
    color: #b91c1c;
    padding: 8px 12px;
    font-size: 13px;
    gap: 10px;
}

.action-item.logout span {
    color: #ef4444;
    font-size: 11px;
}

.logout-icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: #fee2e2;
    color: #b91c1c;
    display: grid;
    place-items: center;
    font-size: 14px;
    font-weight: 700;
    flex-shrink: 0;
}

.action-item span {
    color: var(--muted);
    font-size: 13px;
}

.table-container {
    background: var(--surface);
    padding: 12px;
    border-radius: 12px;
    border: 1px solid var(--border);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
    overflow-x: auto;
}

.tab-nav {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.tab-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: #ffffff;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

.tab-link:hover {
    border-color: #ffd9cc;
    background: #fff7f3;
}

.tab-link.active {
    border-color: #ffd9cc;
    background: #fff2eb;
    color: #b5472e;
}

.tab-count {
    display: inline-flex;
    min-width: 26px;
    height: 24px;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: #f1f5f9;
    color: #334155;
    font-size: 12px;
    font-weight: 700;
    padding: 0 8px;
}

.tab-link.active .tab-count {
    background: #ffd9cc;
    color: #9a3412;
}

.rekap-kode-wrap {
    margin-bottom: 14px;
}

.rekap-kode-table td {
    text-align: center;
}

.rekap-kode-table td:nth-child(2) {
    text-align: left;
}

.rekap-kode-table .row-active td {
    background: #fff7f3;
    border-color: #ffd9cc;
}

.list-filter {
    margin-bottom: 18px;
}

.list-filter-grid {
    display: grid;
    grid-template-columns: 1fr 180px 130px 130px;
    gap: 12px;
    align-items: center;
}

.btn-sm {
    padding: 7px 10px;
    border-radius: 9px;
    font-size: 12px;
    box-shadow: none;
}

.btn-sm:hover {
    box-shadow: none;
}

.btn-danger-soft {
    background: #fff1f2;
    color: #b91c1c;
    border: 1px solid #fecdd3;
}

.aksi-cell {
    min-width: 190px;
}

.tag-sifat {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.tag-sifat.rahasia {
    background: #fee2e2;
    color: #991b1b;
}

.tag-sifat.biasa {
    background: #dcfce7;
    color: #166534;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

thead {
    background: #111827;
    color: #ffffff;
}

thead th {
    padding: 12px;
    text-align: center;
    border: 1px solid #1f2937;
}

tbody td {
    padding: 10px;
    border: 1px solid #e5e7eb;
    vertical-align: middle;
}

tbody tr:nth-child(even) {
    background: #f9fafb;
}

tbody tr:hover {
    background: #eef2ff;
}

table a {
    color: #0ea5e9;
    font-weight: 600;
}

input,
select,
textarea {
    width: 100%;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: #ffffff;
    font-family: inherit;
}

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

.back-link {
    display: inline-flex;
    margin-top: 20px;
    color: #0ea5e9;
    font-weight: 600;
}

/* Arsip list page: minimal-modern */
body.list-page {
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
}

.list-shell {
    max-width: 1600px;
}

.list-hero {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.05);
}

.badge-soft {
    background: #ecfeff;
    border-color: #bae6fd;
    color: #0e7490;
}

.list-stats {
    margin-top: 16px;
}

.list-stat {
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.06);
}

.list-panel {
    border-radius: 14px;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.05);
}

.list-filter input,
.list-filter select {
    border-radius: 12px;
    border-color: #dbeafe;
    background: #f8fafc;
}

.list-table thead {
    background: #0f172a;
}

.list-table thead th {
    font-size: 12px;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    border-color: #1e293b;
}

.list-table tbody td {
    font-size: 13px;
}

.rekap-kode-table thead {
    background: #f8fafc;
    color: #334155;
}

.rekap-kode-table thead th {
    border-color: #e2e8f0;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.03em;
}

.rekap-kode-table tbody tr:hover td {
    background: #f8fafc;
}

/* Arsip tambah page: wider form */
body.tambah-page {
    background: linear-gradient(180deg, #f8fafc 0%, #eef2ff 100%);
}

.tambah-shell {
    max-width: 1400px;
}

.tambah-form-wrap {
    margin-top: 14px;
    padding: 22px;
}

.tambah-form {
    width: 100%;
}

.tambah-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.tambah-table td {
    border: none;
    padding: 10px 8px;
    vertical-align: top;
}

.tambah-table td:first-child {
    width: 320px;
    font-weight: 600;
    color: #334155;
    padding-top: 16px;
}

.tambah-table td:last-child {
    width: auto;
}

.tambah-table input,
.tambah-table select,
.tambah-table textarea {
    background: #ffffff;
    border-color: #cbd5e1;
}

@keyframes float-in {
    from {
        transform: translateY(10px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@media (max-width: 900px) {
    body {
        padding: 14px;
    }

    .layout {
        grid-template-columns: 1fr;
    }

    .sidebar-shell {
        position: static;
    }

    .sidebar-nav {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .hero {
        grid-template-columns: 1fr;
    }

    .grid {
        grid-template-columns: 1fr;
    }

    .kpi-grid {
        grid-template-columns: 1fr 1fr;
    }

    .list-filter-grid {
        grid-template-columns: 1fr;
    }

    .aksi-cell {
        min-width: 240px;
    }

    .tambah-form-wrap {
        padding: 14px;
    }

    .tambah-table td {
        display: block;
        width: 100%;
        padding: 6px 0;
    }

    .tambah-table td:first-child {
        width: 100%;
        padding-top: 12px;
    }
}

/* Login page */
.login-page {
    min-height: 100vh;
    margin: 0;
    padding: 24px;
    background: radial-gradient(1200px 500px at 10% -10%, #ffe7dc 0%, transparent 60%),
        radial-gradient(900px 400px at 110% 10%, #dff6ff 0%, transparent 60%),
        linear-gradient(180deg, #faf8f5 0%, #f6f4f1 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-shell {
    width: min(1050px, 100%);
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 28px;
    align-items: stretch;
    position: relative;
    z-index: 1;
    animation: float-in 0.6s ease-out;
}

.login-shell-compact {
    width: min(460px, 100%);
    grid-template-columns: 1fr;
    margin-inline: auto;
    justify-items: center;
    align-items: center;
}

.login-shell-compact .login-card {
    width: 100%;
}

.login-panel {
    background: linear-gradient(160deg, #ffffff 0%, #fff4ee 100%);
    border-radius: 26px;
    padding: 40px;
    border: 1px solid #ffd8c9;
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.12);
    display: grid;
    align-content: start;
    gap: 18px;
}

.login-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: 999px;
    background: #fff2eb;
    color: #b5472e;
    border: 1px solid #ffd9cc;
    width: fit-content;
}

.login-panel h1 {
    font-size: 32px;
    margin: 0;
    letter-spacing: -0.02em;
}

.login-panel p {
    color: var(--muted);
    margin: 0;
    font-size: 15px;
}

.login-highlights {
    display: grid;
    gap: 14px;
    margin-top: 6px;
}

.login-highlight {
    display: grid;
    grid-template-columns: 44px 1fr;
    gap: 12px;
    align-items: center;
    background: #ffffff;
    border-radius: 16px;
    padding: 14px 16px;
    border: 1px solid #ffe3d7;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}

.highlight-icon {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    font-weight: 700;
    color: #ffffff;
    background: linear-gradient(135deg, #ff6b4a, #ff9a62);
}

.highlight-title {
    font-weight: 600;
    font-size: 14px;
}

.highlight-sub {
    font-size: 12px;
    color: var(--muted);
}

.login-footer-note {
    margin-top: auto;
    font-size: 12px;
    color: var(--muted);
}

.login-card {
    border: none;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.18);
    border: 1px solid #e8eef7;
}

.login-card .card-body {
    padding: 36px;
}

.login-title {
    font-weight: 700;
    font-size: 22px;
    letter-spacing: -0.02em;
}

.login-subtitle {
    color: #64748b;
    font-size: 13px;
    margin-bottom: 18px;
}

.login-page .form-control {
    border-radius: 12px;
    padding: 12px 14px;
    border: 1px solid #e2e8f0;
}

.login-page .btn-primary {
    border: none;
    border-radius: 12px;
    padding: 12px;
    font-weight: 600;
    background: linear-gradient(135deg, #ff6b4a, #ff9a62);
    box-shadow: 0 12px 24px rgba(255, 107, 74, 0.25);
}

.login-page .btn-primary:hover {
    background: linear-gradient(135deg, #ff5b36, #ff8f52);
}

.login-security {
    margin-top: 16px;
    font-size: 12px;
    color: var(--muted);
    text-align: center;
}

@media (max-width: 900px) {
    .login-shell {
        grid-template-columns: 1fr;
    }

    .login-panel {
        order: 2;
        padding: 28px;
    }

    .login-card {
        order: 1;
    }
}
