:root {
    color-scheme: light;
    --ink: #193047;
    --muted: #718195;
    --line: #e5ebf0;
    --paper: #ffffff;
    --canvas: #f4f7f9;
    --navy: #102c43;
    --teal: #00a88f;
    --teal-dark: #008c79;
    --orange: #ed9d3b;
    --red: #c94c55;
    --shadow: 0 16px 48px rgba(26, 54, 78, .08);
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--canvas); color: var(--ink); font: 15px/1.55 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
h1, h2, h3, .brand-name { font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; letter-spacing: -.035em; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button, .button { cursor: pointer; }
.shell { min-height: 100vh; }
.topbar { height: 76px; padding: 0 max(28px, calc((100vw - 1240px) / 2)); display: flex; align-items: center; justify-content: space-between; background: var(--paper); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark { width: 38px; height: 38px; display: grid; place-items: center; color: white; background: var(--teal); border-radius: 12px; font-weight: 800; letter-spacing: -.08em; }
.brand-name { font-size: 16px; font-weight: 800; }
.brand-caption { display: block; color: var(--muted); font-size: 11px; letter-spacing: .1em; }
.top-actions, .user-chip { display: flex; align-items: center; gap: 14px; }
.user-chip { color: var(--muted); font-size: 13px; }
.avatar { width: 35px; height: 35px; display: grid; place-items: center; border-radius: 50%; background: #e2f5f1; color: var(--teal-dark); font-weight: 700; }
.nav { display: flex; gap: 5px; margin-left: auto; margin-right: 34px; }
.nav a { padding: 9px 13px; color: #627489; border-radius: 9px; font-weight: 600; font-size: 13px; }
.nav a:hover, .nav a.active { color: var(--teal-dark); background: #eaf8f5; }
.page { max-width: 1184px; margin: 0 auto; padding: 42px 24px 72px; }
.page-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.eyebrow { display: block; color: var(--teal-dark); font-size: 11px; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; }
h1 { margin: 6px 0 5px; font-size: clamp(27px, 4vw, 36px); line-height: 1.2; }
.subtitle { margin: 0; color: var(--muted); }
.button { min-height: 42px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 16px; border: 1px solid transparent; border-radius: 9px; font-weight: 700; font-size: 13px; transition: .15s ease; }
.button-primary { color: white; background: var(--teal); box-shadow: 0 5px 12px rgba(0,168,143,.16); }
.button-primary:hover { background: var(--teal-dark); transform: translateY(-1px); }
.button-secondary { color: var(--ink); background: white; border-color: var(--line); }
.button-secondary:hover { border-color: #bfcbd5; background: #fbfcfd; }
.button-danger { color: #ad3944; background: #fff3f3; border-color: #f4d4d6; }
.button-small { min-height: 34px; padding: 0 11px; font-size: 12px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 22px; }
.stat-card, .card { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 3px 12px rgba(26,54,78,.025); }
.stat-card { padding: 19px 20px; }
.stat-label { color: var(--muted); font-size: 12px; font-weight: 600; }
.stat-value { margin-top: 8px; font: 800 29px/1 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
.stat-note { margin-top: 9px; color: #95a2b0; font-size: 11px; }
.card { padding: 22px; }
.card-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 17px; }
.card-heading h2, .card h2 { margin: 0; font-size: 17px; }
.filter-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.field { display: grid; gap: 6px; }
.field label { color: #586d81; font-size: 12px; font-weight: 700; }
.field small, .hint { color: var(--muted); font-size: 11px; }
.control { width: 100%; min-height: 42px; padding: 9px 12px; color: var(--ink); background: white; border: 1px solid #dce4ea; border-radius: 8px; outline: none; }
.control:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(0,168,143,.12); }
textarea.control { min-height: 104px; resize: vertical; }
.filter-row .control { width: auto; min-width: 145px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; white-space: nowrap; }
th { padding: 11px 13px; color: #8291a0; border-bottom: 1px solid var(--line); text-align: left; font-size: 10px; letter-spacing: .09em; text-transform: uppercase; }
td { padding: 14px 13px; border-bottom: 1px solid #edf1f4; font-size: 13px; }
tbody tr:last-child td { border-bottom: 0; }
.table-primary { font-weight: 700; }
.table-secondary { margin-top: 3px; color: var(--muted); font-size: 11px; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 5px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.badge:before { width: 6px; height: 6px; content: ""; border-radius: 50%; background: currentColor; }
.status-draft { color: #738293; background: #eff2f5; }
.status-diajukan { color: #a66b10; background: #fff5df; }
.status-disetujui { color: #137d70; background: #e6f6f2; }
.status-selesai { color: #347446; background: #e9f5e9; }
.status-ditolak { color: #b3424b; background: #fff0f0; }
.empty { padding: 48px 16px; text-align: center; color: var(--muted); }
.empty strong { display: block; margin: 5px 0; color: var(--ink); font-size: 15px; }
.alert { margin: 0 0 20px; padding: 12px 15px; border: 1px solid; border-radius: 9px; font-size: 13px; }
.alert-success { color: #167362; background: #eaf8f4; border-color: #c9eee5; }
.alert-error { color: #a43d46; background: #fff0f0; border-color: #f2d2d4; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.form-grid .span-2 { grid-column: span 2; }
.section-title { display: flex; align-items: center; justify-content: space-between; margin: 28px 0 14px; padding-bottom: 11px; border-bottom: 1px solid var(--line); }
.section-title h2 { margin: 0; font-size: 17px; }
.repeat-item { position: relative; margin-bottom: 12px; padding: 17px; border: 1px solid var(--line); border-radius: 11px; background: #fcfdfd; }
.repeat-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 13px; color: var(--teal-dark); font-size: 12px; font-weight: 700; }
.repeat-item .form-grid { gap: 12px; }
.form-actions { display: flex; justify-content: space-between; gap: 10px; margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line); }
.action-group { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
.detail-main, .detail-side { display: grid; gap: 16px; }
.detail-meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 20px; }
.meta-label { color: var(--muted); font-size: 11px; }
.meta-value { margin-top: 4px; font-weight: 700; }
.activity { padding: 15px 0; border-top: 1px solid #edf1f4; }
.activity:first-of-type { border-top: 0; }
.activity h3 { margin: 3px 0; font-size: 15px; }
.activity p { margin: 6px 0; color: #506478; font-size: 13px; white-space: pre-line; }
.activity-category { color: var(--teal-dark); font-size: 11px; font-weight: 700; text-transform: uppercase; }
.timeline-item { position: relative; padding: 0 0 18px 18px; border-left: 1px solid #dae6e9; }
.timeline-item:last-child { padding-bottom: 0; border-left-color: transparent; }
.timeline-item:before { position: absolute; top: 4px; left: -5px; width: 9px; height: 9px; content: ""; background: var(--teal); border: 2px solid white; border-radius: 50%; box-shadow: 0 0 0 1px #bfe8df; }
.timeline-item strong { font-size: 12px; }
.timeline-item p { margin: 4px 0; color: #5d7082; font-size: 12px; white-space: pre-line; }
.timeline-item time { color: #94a0ad; font-size: 10px; }
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: 1fr minmax(380px, 480px); background: white; }
.login-aside { display: flex; flex-direction: column; justify-content: space-between; padding: 42px 8vw; color: white; background: radial-gradient(circle at 85% 15%, rgba(0,168,143,.35), transparent 35%), linear-gradient(145deg, #102c43, #164e5b); }
.login-aside .brand-mark { color: var(--navy); background: white; }
.login-message { max-width: 530px; margin: auto 0; }
.login-message h1 { margin: 15px 0; font-size: clamp(38px, 5vw, 58px); }
.login-message p { color: #d1e0e5; font-size: 16px; }
.login-aside .eyebrow { color: #68ddc7; }
.login-foot { color: #bbd0d7; font-size: 11px; }
.login-panel { display: grid; align-content: center; padding: 52px clamp(30px, 7vw, 82px); }
.login-panel h2 { margin: 0 0 6px; font-size: 27px; }
.login-panel > p { margin: 0 0 28px; color: var(--muted); font-size: 13px; }
.login-form { display: grid; gap: 16px; }
.login-form .button { margin-top: 8px; width: 100%; }
.error-page { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.error-card { width: min(100%, 480px); padding: 34px; background: white; border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); }
.error-card h1 { font-size: 28px; }
.error-card p { color: var(--muted); }
.footer-note { margin-top: 18px; color: #9aa7b3; text-align: center; font-size: 11px; }
@media (max-width: 780px) {
    .topbar { height: auto; min-height: 70px; flex-wrap: wrap; padding: 12px 18px; gap: 10px; }
    .nav { order: 3; width: 100%; margin: 0; overflow: auto; }
    .top-actions { margin-left: auto; }
    .user-chip span:not(.avatar) { display: none; }
    .page { padding: 28px 16px 50px; }
    .stats { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .stat-card { padding: 15px; }
    .stat-value { font-size: 25px; }
    .page-heading { align-items: start; flex-direction: column; }
    .detail-grid { grid-template-columns: 1fr; }
    .detail-meta { grid-template-columns: repeat(2, 1fr); }
    .login-wrap { grid-template-columns: 1fr; }
    .login-aside { min-height: 250px; padding: 25px; }
    .login-message { margin: 35px 0; }
    .login-message h1 { font-size: 36px; }
    .login-foot { display: none; }
    .login-panel { padding: 35px 25px 50px; }
}
@media (max-width: 520px) {
    .form-grid { grid-template-columns: 1fr; }
    .form-grid .span-2 { grid-column: auto; }
    .filter-row, .filter-row .control { width: 100%; }
    .form-actions { flex-direction: column-reverse; }
    .form-actions .button { width: 100%; }
}
