@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@500;600;700;800&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@500;600&display=swap');

:root {
  --navy: #0B2545;
  --navy-soft: #122F5C;
  --blue: #1E5AA8;
  --blue-dark: #14437F;
  --blue-light: #4C82C7;
  --gold: #F0B429;
  --gold-dark: #C8930E;
  --surface: #F4F6FA;
  --surface-card: #FFFFFF;
  --ink: #16212E;
  --ink-soft: #5C6B7A;
  --border: #E1E6ED;
  --success: #1F9D55;
  --success-bg: #E7F7EC;
  --danger: #D64545;
  --danger-bg: #FCEAEA;
  --pending: #C8860B;
  --pending-bg: #FCF1DA;

  /* ---- Tipografi ---- */
  --font-display: 'Plus Jakarta Sans', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --sidebar-w: 232px;
  --topbar-h: 60px;
  --radius: 10px;
  --radius-sm: 7px;
  --shadow-sm: 0 1px 2px rgba(11, 37, 69, 0.06);
  --shadow-md: 0 6px 20px rgba(11, 37, 69, 0.10);
  --shadow-lg: 0 16px 40px rgba(11, 37, 69, 0.18);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-body);
  background: var(--surface);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, .font-display { font-family: var(--font-display); color: var(--navy); margin: 0; }
.mono { font-family: var(--font-mono); }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

button, input, select, textarea { font-family: inherit; font-size: inherit; }

:focus-visible {
  outline: 2px solid var(--blue-light);
  outline-offset: 2px;
}
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--navy);
  padding: 24px;
}

.auth-card {
  width: 100%;
  max-width: 380px;
  background: var(--surface-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 32px 28px;
  animation: rise 0.45s ease;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
}

.auth-brand .crest {
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 800; font-size: 16px;
  box-shadow: var(--shadow-sm);
}

.auth-brand .brand-text { line-height: 1.25; }
.auth-brand .brand-text strong { display: block; font-family: var(--font-display); font-size: 14.5px; color: var(--navy); }
.auth-brand .brand-text span { font-size: 11.5px; color: var(--ink-soft); }

.auth-card h1 { font-size: 19px; margin-bottom: 4px; }
.auth-card .subtitle { color: var(--ink-soft); font-size: 13px; margin-bottom: 22px; }
.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 6px;
}
.field .hint { font-size: 11.5px; color: var(--ink-soft); margin-top: 5px; }
.field .error-text { font-size: 11.5px; color: var(--danger); margin-top: 5px; display: none; }
.field.has-error .error-text { display: block; }
.field.has-error input { border-color: var(--danger); }

.input, select.input, textarea.input {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
.input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(30, 90, 168, 0.12);
  outline: none;
}
textarea.input { resize: vertical; min-height: 80px; }

.input-group-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.password-wrap { position: relative; }
.password-wrap .toggle-pass {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer; color: var(--ink-soft); font-size: 12px;
  padding: 4px;
}
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: none; border-radius: var(--radius-sm);
  padding: 10px 18px; font-weight: 600; font-size: 13.5px;
  cursor: pointer; transition: transform .12s, box-shadow .12s, background .15s;
  font-family: var(--font-body);
}
.btn:active { transform: scale(0.97); }
.btn-block { width: 100%; }
.btn-primary { background: var(--blue); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--blue-dark); box-shadow: var(--shadow-md); }
.btn-gold { background: var(--gold); color: var(--navy); }
.btn-gold:hover { background: var(--gold-dark); }
.btn-ghost { background: transparent; color: var(--navy); border: 1.5px solid var(--border); }
.btn-ghost:hover { background: var(--surface); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #b73a3a; }
.btn-sm { padding: 6px 12px; font-size: 12.5px; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn .spinner { display: none; }
.btn.is-loading .spinner { display: inline-block; }
.btn.is-loading .btn-label { opacity: .75; }

.spinner {
  width: 13px; height: 13px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.4); border-top-color: #fff;
  animation: spin .6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w); flex-shrink: 0;
  background: var(--navy);
  color: #fff;
  display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0; bottom: 0;
  z-index: 40;
  transition: transform .25s ease;
}

.sidebar .brand {
  display: flex; align-items: center; gap: 10px;
  padding: 18px 18px 16px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.sidebar .brand .crest {
  width: 34px; height: 34px; border-radius: 8px;
  color: var(--gold); display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 800; font-size: 14px;
}
.sidebar .brand .brand-text strong { display: block; font-family: var(--font-display); font-size: 13px; }
.sidebar .brand .brand-text span { font-size: 10.5px; color: rgba(255,255,255,.6); }

.sidebar nav { flex: 1; padding: 14px 10px; overflow-y: auto; }
.sidebar nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 8px;
  color: rgba(255,255,255,.78); font-size: 13px; font-weight: 500;
  margin-bottom: 3px; transition: background .15s, color .15s;
}
.sidebar nav a:hover { background: rgba(255,255,255,.07); color: #fff; text-decoration: none; }
.sidebar nav a.active { background: var(--blue); color: #fff; box-shadow: var(--shadow-sm); }
.sidebar nav a .ic { width: 17px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; }
.sidebar nav a .ic svg { display: block; }
.sidebar nav .nav-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; color: rgba(255,255,255,.4); margin: 14px 12px 7px; }

.sidebar .sidebar-footer { padding: 14px; border-top: 1px solid rgba(255,255,255,.08); }
.sidebar .user-chip { display: flex; align-items: center; gap: 9px; }
.sidebar .user-chip .avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--gold); color: var(--navy);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; flex-shrink: 0;
}
.sidebar .user-chip .who strong { display: block; font-size: 12.5px; color: #fff; }
.sidebar .user-chip .who span { font-size: 10.5px; color: rgba(255,255,255,.55); }

.main { flex: 1; margin-left: var(--sidebar-w); display: flex; flex-direction: column; min-width: 0; }

.topbar {
  height: var(--topbar-h);
  background: var(--surface-card);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 22px;
  position: sticky; top: 0; z-index: 30;
}
.topbar h1 { font-size: 16px; }
.topbar .topbar-right { display: flex; align-items: center; gap: 14px; }

.menu-toggle { display: none; align-items: center; justify-content: center; background: none; border: none; cursor: pointer; color: var(--navy); padding: 4px; }

.content { padding: 22px; max-width: 980px; width: 100%; margin: 0 auto; }
.bell-wrap { position: relative; }
.bell-btn {
  width: 36px; height: 36px; border-radius: 50%; border: 1.5px solid var(--border);
  background: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center;
  font-size: 15px; color: var(--navy); position: relative;
}
.bell-btn .dot {
  position: absolute; top: 5px; right: 6px;
  width: 8px; height: 8px; border-radius: 50%; background: var(--danger);
  border: 1.5px solid #fff; display: none;
}
.bell-btn.has-unread .dot { display: block; }

.notif-panel {
  position: absolute; right: 0; top: 44px; width: 320px;
  background: #fff; border-radius: var(--radius); box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  display: none; max-height: 380px; overflow-y: auto; z-index: 50;
}
.notif-panel.open { display: block; animation: rise .2s ease; }
.notif-panel .notif-head { padding: 12px 14px; font-weight: 700; font-size: 12.5px; color: var(--navy); border-bottom: 1px solid var(--border); }
.notif-item { padding: 11px 14px; border-bottom: 1px solid var(--border); font-size: 12.5px; }
.notif-item:last-child { border-bottom: none; }
.notif-item.unread { background: #F0F5FC; }
.notif-item .notif-title { font-weight: 600; color: var(--navy); margin-bottom: 2px; }
.notif-item .notif-time { font-size: 10.5px; color: var(--ink-soft); margin-top: 4px; }
.notif-empty { padding: 26px 14px; text-align: center; color: var(--ink-soft); font-size: 12.5px; }
.card {
  background: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.card-pad { padding: 20px; }
.card-head { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.card-head h2 { font-size: 14.5px; }
.card-head .desc { font-size: 12px; color: var(--ink-soft); margin-top: 2px; }

.section-title {
  font-family: var(--font-display); font-weight: 700; color: var(--navy);
  font-size: 13px; text-transform: uppercase; letter-spacing: .04em;
  margin-bottom: 12px; display: flex; align-items: center; gap: 7px;
}
.section-title .num {
  width: 20px; height: 20px; border-radius: 50%; background: var(--blue); color: #fff;
  font-size: 10.5px; display: flex; align-items: center; justify-content: center; font-family: var(--font-body);
}
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 99px; font-size: 11.5px; font-weight: 700; }
.badge-pending  { background: var(--pending-bg); color: var(--pending); }
.badge-approved { background: var(--success-bg); color: var(--success); }
.badge-rejected { background: var(--danger-bg); color: var(--danger); }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-track { display: flex; align-items: center; margin: 6px 0 2px; }
.status-track .step { display: flex; flex-direction: column; align-items: center; flex: 1; position: relative; }
.status-track .step .dot {
  width: 11px; height: 11px; border-radius: 50%; background: var(--border);
  border: 2px solid var(--border); z-index: 2;
}
.status-track .step .label { font-size: 10px; color: var(--ink-soft); margin-top: 6px; text-align: center; }
.status-track .line { flex: 1; height: 2px; background: var(--border); margin-bottom: 17px; }
.status-track .step.done .dot { background: var(--blue); border-color: var(--blue); }
.status-track .step.done .label { color: var(--blue); font-weight: 600; }
.status-track .line.done { background: var(--blue); }
.status-track.rejected .step.result.done .dot { background: var(--danger); border-color: var(--danger); }
.status-track.rejected .step.result.done .label { color: var(--danger); }
.status-track.rejected .line.done { background: var(--danger); }
.status-track.approved .step.result.done .dot { background: var(--success); border-color: var(--success); }
.status-track.approved .step.result.done .label { color: var(--success); }
.status-track.approved .line.done { background: var(--success); }
.public-page {
  height: 100vh;
  background: var(--navy);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.public-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 22px; flex-wrap: wrap; gap: 10px; flex-shrink: 0;
}
.public-admin-link {
  display: inline-flex; align-items: center; gap: 6px;
  color: rgba(255,255,255,.75); font-size: 12.5px; font-weight: 600;
  padding: 7px 12px; border-radius: 99px; border: 1px solid rgba(255,255,255,.25);
  transition: background .15s, color .15s;
}
.public-admin-link:hover { background: rgba(255,255,255,.1); color: #fff; text-decoration: none; }

.public-content {
  flex: 1; width: 100%; max-width: 880px; margin: 0 auto;
  padding: 6px 20px 18px; display: flex; flex-direction: column;
  min-height: 0;
}
.public-content .card { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.public-content .card-pad { flex: 1; display: flex; flex-direction: column; min-height: 0; overflow-y: auto; }

.lapor-grid {
  display: grid; grid-template-columns: 1fr; gap: 18px;
}
.lapor-col { display: flex; flex-direction: column; gap: 14px; }
.lapor-col .field { margin-bottom: 0; }

.public-footer-note {
  color: rgba(255,255,255,.55); font-size: 11.5px; line-height: 1.5;
}
@media (min-width: 880px) and (min-height: 620px) {
  .lapor-grid { grid-template-columns: 1.05fr 1fr; gap: 28px; }
}

@media (max-width: 600px) {
  .public-page { height: auto; min-height: 100vh; overflow: visible; }
  .public-content { padding: 10px 16px 24px; }
  .public-header { padding: 12px 16px; }
}
.role-card { display: block; cursor: pointer; }
.role-card input[type="radio"] { position: absolute; opacity: 0; pointer-events: none; }
.role-card-inner {
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  padding: 12px 10px; text-align: center; transition: border-color .15s, background .15s;
  height: 100%;
}
.role-card-icon {
  width: 34px; height: 34px; border-radius: 50%; margin: 0 auto 8px;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface); color: var(--ink-soft);
}
.role-card-inner strong { display: block; font-size: 12.5px; color: var(--navy); margin-bottom: 4px; }
.role-card-inner p { font-size: 10.5px; color: var(--ink-soft); margin: 0; line-height: 1.4; }
.role-card.selected .role-card-inner { border-color: var(--blue); background: #EFF5FC; }
.role-card.selected .role-card-icon { background: var(--blue); color: #fff; }
.cal-legend { display: flex; gap: 18px; margin-bottom: 16px; flex-wrap: wrap; }
.cal-legend-item { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-soft); }
.cal-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.cal-dot.badge-pending { background: var(--pending); }
.cal-dot.badge-approved { background: var(--success); }
.cal-dot.badge-rejected { background: var(--danger); }
.cal-weekdays {
  display: grid; grid-template-columns: repeat(7, 1fr);
  text-align: center; font-size: 11px; font-weight: 700; color: var(--ink-soft);
  text-transform: uppercase; letter-spacing: .03em; margin-bottom: 8px;
}
.cal-weekdays div { padding: 4px 0; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-day {
  position: relative; aspect-ratio: 1; border-radius: 9px;
  border: 1.5px solid var(--border); background: #fff;
  padding: 6px; display: flex; flex-direction: column; transition: border-color .15s, background .15s;
}
.cal-day.is-other-month { background: var(--surface); border-color: transparent; }
.cal-day.is-other-month .cal-day-num { color: #C3CBD6; }
.cal-day.is-today { border-color: var(--blue); box-shadow: 0 0 0 2px rgba(30,90,168,.12); }
.cal-day.has-task { cursor: pointer; }
.cal-day.has-task:hover { border-color: var(--blue-light); background: #F7FAFD; }

.cal-day-num { font-size: 12.5px; font-weight: 600; color: var(--navy); }
.cal-day.is-today .cal-day-num {
  background: var(--blue); color: #fff; width: 20px; height: 20px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 11.5px;
}

.cal-day-dots { display: flex; gap: 3px; margin-top: auto; flex-wrap: wrap; }

@media (max-width: 860px) {
  .cal-day { padding: 4px; border-radius: 7px; }
  .cal-day-num { font-size: 11px; }
  .cal-weekdays { font-size: 9.5px; }
}
.dropzone {
  border: 2px dashed var(--border); border-radius: var(--radius);
  padding: 26px 16px; text-align: center; cursor: pointer;
  transition: border-color .15s, background .15s;
  background: #FAFBFD;
}
.dropzone.is-dragover { border-color: var(--blue); background: #EFF5FC; }
.dropzone .dz-icon { color: var(--blue); margin-bottom: 8px; display: flex; justify-content: center; }
.dropzone .dz-title { font-weight: 600; color: var(--navy); font-size: 13px; }
.dropzone .dz-sub { font-size: 11.5px; color: var(--ink-soft); margin-top: 3px; }
.dropzone input[type="file"] { display: none; }

.preview-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: 10px; margin-top: 12px; }
.preview-item { position: relative; aspect-ratio: 1; border-radius: 8px; overflow: hidden; border: 1px solid var(--border); }
.preview-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.preview-item .remove-btn {
  position: absolute; top: 4px; right: 4px; width: 20px; height: 20px; border-radius: 50%;
  background: rgba(11,37,69,.75); color: #fff; border: none; font-size: 11px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.preview-item .size-tag {
  position: absolute; bottom: 0; left: 0; right: 0; background: rgba(11,37,69,.7); color: #fff;
  font-size: 9.5px; padding: 2px 4px; text-align: center;
}
.table-wrap { overflow-x: auto; }
table.data-table { width: 100%; border-collapse: collapse; font-size: 12.8px; }
table.data-table th {
  text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .03em;
  color: var(--ink-soft); padding: 10px 14px; border-bottom: 1.5px solid var(--border); white-space: nowrap;
}
table.data-table td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.data-table tr:hover td { background: #FAFBFD; }
table.data-table .cell-muted { color: var(--ink-soft); font-size: 11.8px; }

.empty-state { text-align: center; padding: 50px 20px; color: var(--ink-soft); }
.empty-state .ic { margin-bottom: 10px; color: var(--border); display: flex; justify-content: center; }
.empty-state .ic svg { width: 34px; height: 34px; }
.overlay {
  position: fixed; inset: 0; background: rgba(11, 37, 69, 0.55);
  display: none; align-items: center; justify-content: center; z-index: 100; padding: 16px;
  backdrop-filter: blur(2px);
}
.overlay.open { display: flex; animation: fadeIn .2s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
  background: #fff; border-radius: var(--radius); box-shadow: var(--shadow-lg);
  max-width: 380px; width: 100%; padding: 26px; text-align: center;
  animation: popIn .25s cubic-bezier(.2,.8,.2,1);
}
@keyframes popIn { from { opacity: 0; transform: scale(.92); } to { opacity: 1; transform: scale(1); } }
.modal.modal-left { text-align: left; }
.modal .modal-icon {
  width: 52px; height: 52px; border-radius: 50%; margin: 0 auto 14px;
  display: flex; align-items: center; justify-content: center; font-size: 22px;
}
.modal .modal-icon.success { background: var(--success-bg); color: var(--success); }
.modal .modal-icon.danger { background: var(--danger-bg); color: var(--danger); }
.modal h3 { font-size: 16px; margin-bottom: 6px; }
.modal p { color: var(--ink-soft); font-size: 13px; margin: 0 0 18px; }
.modal .modal-actions { display: flex; gap: 10px; }
.modal .countdown-bar { height: 3px; background: var(--border); border-radius: 99px; overflow: hidden; margin-top: 16px; }
.modal .countdown-bar .fill { height: 100%; background: var(--gold); width: 100%; transition: width 1s linear; }

.toast-stack { position: fixed; top: 18px; right: 18px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: var(--navy); color: #fff; padding: 12px 16px; border-radius: var(--radius-sm);
  font-size: 12.8px; box-shadow: var(--shadow-md); display: flex; align-items: center; gap: 9px;
  animation: slideIn .25s ease; max-width: 300px;
}
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
@keyframes slideIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }
.form-section { animation: fadeUp .35s ease; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.form-section + .form-section { margin-top: 22px; padding-top: 20px; border-top: 1px dashed var(--border); }
@media (max-width: 860px) {
  .sidebar { transform: translateX(-100%); box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  .menu-toggle { display: flex; }
  .content { padding: 16px; }
  .input-group-2 { grid-template-columns: 1fr; }
  .notif-panel { width: 92vw; right: -8px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}
.role-card { display:block; cursor:pointer; }
.role-card input[type="radio"] { position:absolute; opacity:0; width:0; height:0; }
.role-card-inner {
  border:2px solid var(--border); border-radius:var(--radius); padding:14px 12px;
  text-align:center; transition:border-color .15s, background .15s;
}
.role-card-inner strong { display:block; font-size:13px; color:var(--navy); margin:8px 0 4px; }
.role-card-inner p { font-size:11.5px; color:var(--ink-soft); margin:0; line-height:1.5; }
.role-card-icon { color:var(--blue); display:flex; justify-content:center; margin-bottom:6px; }
.role-card.selected .role-card-inner, .role-card:hover .role-card-inner {
  border-color:var(--blue); background:#F0F5FC;
}
.role-card.selected .role-card-inner strong { color:var(--blue); }