:root {
  --bg: #eef3f8;
  --bg-soft: #f7fafc;
  --panel: #ffffff;
  --text: #12263a;
  --muted: #5b6b7c;
  --line: #d7e0ea;
  --head: #f0f5fa;
  --primary: #1a56db;
  --primary-dark: #1341a8;
  --primary-soft: #e8f0ff;
  --accent: #0e8f7a;
  --danger: #b42318;
  --ok-soft: #eef4ff;
  --ok: #027a48;
  --ok-bg: #ecfdf3;
  --warn: #b54708;
  --warn-bg: #fffaeb;
  --shadow: 0 10px 30px rgba(18, 38, 58, 0.08);
  --shadow-sm: 0 4px 14px rgba(18, 38, 58, 0.06);
  --radius: 16px;
  --radius-sm: 12px;
  --font: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.45;
  background:
    linear-gradient(180deg, rgba(238, 243, 248, 0.92), rgba(238, 243, 248, 0.98)),
    url("/public/images/hero-office.jpg") center top / cover no-repeat fixed;
}

/* ---- Header ---- */
.app-header {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 12px 28px;
  border-bottom: 1px solid rgba(215, 224, 234, 0.9);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  box-shadow: 0 2px 16px rgba(18, 38, 58, 0.04);
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-width: 0;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.user-bar {
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-chip {
  display: grid;
  gap: 1px;
  padding: 6px 12px;
  border-radius: 999px;
  background: #f0f5ff;
  border: 1px solid #d6e4ff;
  min-width: 0;
  max-width: 180px;
}

.user-chip strong,
.user-chip span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-chip strong {
  font-size: 0.82rem;
  line-height: 1.2;
}

.user-chip span {
  font-size: 0.72rem;
  color: var(--muted);
}

.nav-logout {
  min-height: 34px !important;
  padding: 4px 12px !important;
  font-size: 0.82rem;
}

.nav-logout-mobile {
  display: none !important;
}

/* hamburger (mobile only) */
.nav-toggle-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.nav-toggle-btn {
  display: none;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  font-weight: 700;
  font-size: 0.84rem;
  cursor: pointer;
  user-select: none;
}

.nav-toggle-bars {
  position: relative;
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  box-shadow: 0 -6px 0 currentColor, 0 6px 0 currentColor;
}

.nav-toggle-input:checked + .nav-toggle-btn {
  background: var(--primary-soft);
  border-color: #b7ccf5;
  color: var(--primary);
}

.nav-toggle-input:checked + .nav-toggle-btn .nav-toggle-bars {
  background: transparent;
  box-shadow: none;
}

.nav-toggle-input:checked + .nav-toggle-btn .nav-toggle-bars::before,
.nav-toggle-input:checked + .nav-toggle-btn .nav-toggle-bars::after {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
}

.nav-toggle-input:checked + .nav-toggle-btn .nav-toggle-bars::before {
  transform: rotate(45deg);
}

.nav-toggle-input:checked + .nav-toggle-btn .nav-toggle-bars::after {
  transform: rotate(-45deg);
}

/* =========================================================
   Login page — gaya 21st.dev login-1 (card + gradient + animasi)
   ========================================================= */
.login-body {
  min-height: 100vh;
  margin: 0;
  background: #070b14;
  color: #e8eef8;
  font-family: var(--font);
}

.auth-shell {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px 16px;
  overflow: hidden;
  background:
    linear-gradient(115deg, rgba(7, 11, 20, 0.82) 0%, rgba(10, 18, 34, 0.72) 42%, rgba(8, 24, 40, 0.55) 100%),
    radial-gradient(900px 500px at 15% 10%, rgba(56, 189, 248, 0.18), transparent 55%),
    radial-gradient(700px 420px at 90% 85%, rgba(52, 211, 153, 0.12), transparent 50%),
    url("/public/images/login-bg.jpg") center center / cover no-repeat fixed;
}

/* soft floating light accents over photo */
.auth-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.35;
  pointer-events: none;
  animation: auth-float 14s ease-in-out infinite;
  mix-blend-mode: screen;
}

.auth-glow-a {
  width: 260px;
  height: 260px;
  left: 6%;
  top: 14%;
  background: rgba(56, 189, 248, 0.4);
}

.auth-glow-b {
  width: 300px;
  height: 300px;
  right: 4%;
  bottom: 8%;
  background: rgba(129, 140, 248, 0.28);
  animation-delay: -4s;
}

.auth-glow-c {
  width: 180px;
  height: 180px;
  left: 48%;
  bottom: 18%;
  background: rgba(45, 212, 191, 0.2);
  animation-delay: -7s;
}

@keyframes auth-float {
  0%,
  100% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  50% {
    transform: translate3d(10px, -14px, 0) scale(1.05);
  }
}

/* slightly stronger card glass over photo */
.auth-card {
  background: linear-gradient(165deg, rgba(12, 18, 32, 0.88), rgba(8, 14, 26, 0.9)) !important;
  border: 1px solid rgba(148, 163, 184, 0.22) !important;
  box-shadow:
    0 28px 70px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.07) !important;
  backdrop-filter: blur(20px) saturate(1.15) !important;
}

@media (max-width: 720px) {
  .auth-shell {
    background-attachment: scroll;
  }
}

.auth-card-wrap {
  position: relative;
  z-index: 1;
  width: min(420px, 100%);
}

.auth-card {
  position: relative;
  overflow: hidden;
  padding: 32px 28px 26px;
  border-radius: 22px;
  background: linear-gradient(165deg, rgba(18, 26, 43, 0.92), rgba(12, 18, 32, 0.94));
  border: 1px solid rgba(148, 163, 184, 0.18);
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(18px);
}

.auth-card-shine {
  position: absolute;
  inset: -40% -20% auto;
  height: 180px;
  background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.08), transparent);
  transform: rotate(-8deg);
  pointer-events: none;
}

.auth-brand {
  text-align: center;
  margin-bottom: 22px;
}

.auth-logo-ring {
  width: 72px;
  height: 72px;
  margin: 0 auto 14px;
  padding: 3px;
  border-radius: 20px;
  background: linear-gradient(135deg, #38bdf8, #818cf8 45%, #34d399);
  box-shadow: 0 10px 28px rgba(56, 189, 248, 0.28);
}

.auth-logo-ring img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 17px;
  display: block;
  background: #0b1220;
}

.auth-kicker {
  margin: 0 0 6px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #7dd3fc;
}

.auth-brand h1 {
  margin: 0 0 6px;
  font-size: 1.55rem;
  font-weight: 780;
  letter-spacing: -0.03em;
  color: #f8fafc;
}

.auth-sub {
  margin: 0;
  font-size: 0.9rem;
  color: #94a3b8;
  line-height: 1.45;
}

.auth-error {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0 0 16px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(248, 113, 113, 0.12);
  border: 1px solid rgba(248, 113, 113, 0.35);
  color: #fecaca;
  font-size: 0.9rem;
}

.auth-error-icon {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(248, 113, 113, 0.25);
  font-weight: 800;
  font-size: 0.75rem;
  flex-shrink: 0;
}

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

.auth-field {
  display: grid;
  gap: 7px;
}

.auth-field > span {
  font-size: 0.84rem;
  font-weight: 650;
  color: #cbd5e1;
}

/* Spotlight border (AppInput style dari login-1) */
.auth-spotlight {
  --mx: 50%;
  --my: 50%;
  position: relative;
  border-radius: 16px;
  padding: 1px;
  background: rgba(148, 163, 184, 0.18);
  transition: background 0.15s ease;
}

.auth-spotlight::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  opacity: 0;
  transition: opacity 0.18s ease;
  background: radial-gradient(
    140px circle at var(--mx) var(--my),
    rgba(56, 189, 248, 0.95),
    rgba(129, 140, 248, 0.55) 35%,
    transparent 65%
  );
  pointer-events: none;
}

.auth-spotlight.is-hovering::before,
.auth-spotlight:focus-within::before {
  opacity: 1;
}

.auth-input-wrap {
  position: relative;
  border-radius: 15px;
  background: rgba(15, 23, 42, 0.92);
}

.auth-input-icon {
  position: absolute;
  left: 13px;
  top: 50%;
  width: 18px;
  height: 18px;
  transform: translateY(-50%);
  color: #64748b;
  pointer-events: none;
  transition: color 0.15s ease;
  z-index: 1;
}

.auth-input-wrap input {
  width: 100%;
  min-height: 48px;
  padding: 12px 44px 12px 42px;
  border-radius: 15px;
  border: 1px solid transparent;
  background: transparent;
  color: #f1f5f9;
  font: inherit;
  outline: none;
}

.auth-input-wrap input::placeholder {
  color: #64748b;
}

.auth-input-wrap:focus-within .auth-input-icon,
.auth-spotlight.is-hovering .auth-input-icon {
  color: #38bdf8;
}

.auth-eye {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.auth-eye svg {
  width: 18px;
  height: 18px;
}

.auth-eye:hover,
.auth-eye.is-on {
  color: #e2e8f0;
  background: rgba(148, 163, 184, 0.12);
}

.auth-submit {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 50px;
  margin-top: 6px;
  border: 0;
  border-radius: 14px;
  padding: 12px 16px;
  font: inherit;
  font-weight: 750;
  letter-spacing: 0.01em;
  color: #04101f;
  cursor: pointer;
  overflow: hidden;
  isolation: isolate;
  background: #0b1220;
  box-shadow: 0 12px 28px rgba(56, 189, 248, 0.22);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.auth-submit-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(120px circle at var(--mx, 50%) var(--my, 50%), rgba(255, 255, 255, 0.35), transparent 45%),
    linear-gradient(110deg, #38bdf8 0%, #818cf8 48%, #34d399 100%);
  background-size: auto, 180% 180%;
  animation: auth-gradient 6s ease infinite;
}

.auth-submit-label,
.auth-submit svg {
  position: relative;
  z-index: 1;
}

.auth-submit svg {
  width: 18px;
  height: 18px;
}

.auth-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 34px rgba(129, 140, 248, 0.35);
}

.auth-submit:active {
  transform: translateY(0);
}

@keyframes auth-gradient {
  0% {
    background-position: 0 0, 0% 50%;
  }
  50% {
    background-position: 0 0, 100% 50%;
  }
  100% {
    background-position: 0 0, 0% 50%;
  }
}

/* Card mouse spotlight */
.auth-card[data-spotlight] {
  --mx: 50%;
  --my: 20%;
}

.auth-card[data-spotlight]::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
  background: radial-gradient(
    320px circle at var(--mx) var(--my),
    rgba(56, 189, 248, 0.1),
    transparent 55%
  );
}

.auth-card[data-spotlight].is-hovering::after {
  opacity: 1;
}

.auth-divider {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  margin: 20px 0 14px;
}

.auth-divider span {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(148, 163, 184, 0.35), transparent);
}

.auth-divider em {
  font-style: normal;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #64748b;
  white-space: nowrap;
}

.auth-social {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 14px;
}

.auth-social-btn {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(15, 23, 42, 0.65);
  color: #94a3b8;
  transition: border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.auth-social-btn svg {
  width: 18px;
  height: 18px;
}

.auth-social-btn:hover {
  border-color: rgba(56, 189, 248, 0.45);
  color: #e2e8f0;
  transform: translateY(-1px);
}

.auth-footnote {
  margin: 0;
  text-align: center;
  font-size: 0.8rem;
  color: #64748b;
  line-height: 1.45;
}

@media (max-width: 480px) {
  .auth-card {
    padding: 26px 18px 22px;
    border-radius: 18px;
  }

  .auth-brand h1 {
    font-size: 1.35rem;
  }
}

.subhead {
  margin: 8px 0 12px;
  font-size: 0.95rem;
}

.inline-form {
  display: inline;
  margin: 0;
}

.button.danger-btn,
button.danger-btn {
  background: linear-gradient(135deg, #d92d20, #f04438) !important;
  box-shadow: 0 4px 12px rgba(217, 45, 32, 0.22) !important;
  min-height: 32px !important;
  padding: 4px 10px !important;
  font-size: 0.8rem;
}

.btn-sm {
  min-height: 32px !important;
  padding: 4px 10px !important;
  font-size: 0.8rem;
}

/* ---- Table actions (Rekod Terbaru / Carian) — tinggi & jarak seragam ---- */
.records-table th,
.records-table td {
  vertical-align: middle;
}

.records-table td {
  padding-top: 10px;
  padding-bottom: 10px;
}

.actions-cell {
  width: 1%;
  white-space: nowrap;
}

.row-actions {
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.row-action-form {
  display: inline-flex;
  margin: 0;
  padding: 0;
  border: 0;
  vertical-align: middle;
}

.btn-table,
a.btn-table,
button.btn-table {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  height: 36px;
  min-height: 36px !important;
  min-width: 72px;
  padding: 0 12px !important;
  margin: 0 !important;
  border-radius: 10px !important;
  border: 1px solid transparent;
  font: inherit;
  font-size: 0.8rem !important;
  font-weight: 700 !important;
  line-height: 1 !important;
  text-decoration: none !important;
  white-space: nowrap;
  cursor: pointer;
  transform: none !important;
  box-shadow: none !important;
}

.btn-table-secondary,
a.btn-table-secondary {
  background: #fff !important;
  color: var(--primary) !important;
  border-color: #b7ccf5 !important;
}

.btn-table-secondary:hover,
a.btn-table-secondary:hover {
  background: var(--primary-soft) !important;
  filter: none !important;
}

.btn-table-danger,
button.btn-table-danger {
  background: #fff !important;
  color: #b42318 !important;
  border-color: #fecdca !important;
}

.btn-table-danger:hover,
button.btn-table-danger:hover {
  background: #fff3f2 !important;
  filter: none !important;
}

.muted-dash {
  color: var(--muted);
  font-weight: 600;
}

.status-cell {
  min-width: 168px;
  max-width: 200px;
  position: relative;
  z-index: 3;
  overflow: visible;
  pointer-events: auto;
}

.status-form {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  margin: 0;
  position: relative;
  z-index: 4;
  pointer-events: auto;
}

.status-form-compact {
  width: 100%;
}

.status-select-label {
  display: block;
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
  pointer-events: auto;
}

.status-form select,
.status-select {
  display: block;
  width: 100%;
  height: 36px;
  min-height: 36px;
  min-width: 0;
  padding: 0 10px;
  border-radius: 10px;
  border: 1px solid #cbd5e1;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 650;
  color: var(--text);
  background: #fff;
  cursor: pointer;
  pointer-events: auto;
  appearance: auto;
  -webkit-appearance: menulist;
  line-height: 1.2;
}

.status-form-compact .status-select {
  min-width: 148px;
}

.status-form select:hover,
.status-select:hover {
  border-color: var(--primary);
}

.status-form select:focus,
.status-select:focus {
  outline: 3px solid rgba(26, 86, 219, 0.25);
  border-color: var(--primary);
}

.status-form button,
.status-save-btn {
  flex-shrink: 0;
  pointer-events: auto;
  position: relative;
  z-index: 5;
}

@media (max-width: 760px) {
  .row-actions {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .btn-table,
  a.btn-table,
  button.btn-table {
    min-width: 64px;
  }

  .status-form-compact .status-select {
    min-width: 120px;
  }
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.table-wrap {
  overflow-x: auto;
  overflow-y: visible;
  position: relative;
  z-index: 1;
}

/* Pastikan dropdown status tidak tertutup elemen lain */
.panel .table-wrap table {
  position: relative;
  z-index: 1;
}

.panel .table-wrap tr:hover {
  z-index: 2;
  position: relative;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1 1 auto;
}

.brand-text {
  min-width: 0;
}

.brand-logo {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  object-fit: cover;
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}

.brand h1 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 750;
  letter-spacing: -0.02em;
  color: #0f2744;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: min(420px, 48vw);
}

/* Desktop nav: horizontal row under/beside top bar */
.app-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  justify-content: flex-start;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(215, 224, 234, 0.7);
}

.app-nav a,
.button,
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 14px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: 0.15s ease;
}

.app-nav a {
  color: var(--muted);
  background: transparent;
}

.app-nav a:hover {
  color: var(--primary);
  background: var(--primary-soft);
}

.app-nav a.active {
  color: #fff;
  background: linear-gradient(135deg, var(--primary), #3b7cff);
  box-shadow: 0 6px 16px rgba(26, 86, 219, 0.28);
}

/* Wide desktop: brand + nav + user on one visual band */
@media (min-width: 1100px) {
  .app-header {
    flex-direction: row;
    align-items: center;
    gap: 18px;
    padding: 12px 28px;
  }

  .header-top {
    flex: 0 1 auto;
    max-width: 340px;
  }

  .app-nav {
    flex: 1 1 auto;
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
    justify-content: center;
  }

  .header-actions {
    margin-left: auto;
  }
}

.button,
button {
  background: linear-gradient(135deg, var(--primary), #3b7cff);
  color: #fff;
  box-shadow: 0 6px 16px rgba(26, 86, 219, 0.22);
}

.button:hover,
button:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
}

.button.secondary {
  background: #fff;
  color: var(--primary);
  border: 1px solid #b7ccf5;
  box-shadow: none;
}

/* ---- Layout ---- */
main {
  width: min(1160px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 24px 0 56px;
}

/* ---- Hero ---- */
.hero {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1.2fr 0.9fr;
  gap: 20px;
  align-items: center;
  min-height: 210px;
  margin-bottom: 20px;
  padding: 28px 30px;
  border-radius: calc(var(--radius) + 4px);
  border: 1px solid rgba(255, 255, 255, 0.55);
  background:
    linear-gradient(105deg, rgba(12, 36, 68, 0.88) 0%, rgba(18, 70, 130, 0.72) 48%, rgba(14, 120, 110, 0.45) 100%),
    url("/public/images/hero-office.jpg") right center / cover no-repeat;
  color: #fff;
  box-shadow: var(--shadow);
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto -40px -50px auto;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.18), transparent 70%);
  pointer-events: none;
}

.hero-copy {
  position: relative;
  z-index: 1;
}

.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.hero h2 {
  margin: 0 0 8px;
  font-size: clamp(1.45rem, 2.4vw, 1.9rem);
  font-weight: 780;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.hero p {
  margin: 0;
  max-width: 46ch;
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.98rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.hero-actions .button {
  background: #fff;
  color: #1341a8;
  box-shadow: none;
}

.hero-actions .button.ghost {
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.45);
}

.hero-aside {
  position: relative;
  z-index: 1;
  display: none;
}

@media (min-width: 860px) {
  .hero-aside {
    display: block;
    justify-self: end;
    width: min(280px, 100%);
    aspect-ratio: 4/3;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02)),
      url("/public/images/hero-office.jpg") center / cover no-repeat;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.22);
  }
}

/* ---- Page banner (forms/search) ---- */
.page-banner {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
  padding: 18px 20px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background:
    linear-gradient(100deg, rgba(255, 255, 255, 0.95) 35%, rgba(255, 255, 255, 0.72)),
    url("/public/images/hero-office.jpg") right center / cover no-repeat;
  box-shadow: var(--shadow-sm);
}

.page-banner img {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  object-fit: cover;
  box-shadow: var(--shadow-sm);
}

.page-banner h2 {
  margin: 0;
  font-size: 1.25rem;
}

.page-banner p {
  margin: 4px 0 0;
  color: var(--muted);
}

/* ---- Metrics ---- */
.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.metric {
  position: relative;
  overflow: hidden;
  padding: 16px 16px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow-sm);
}

.metric::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--accent-bar, var(--primary));
}

.metric-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.metric-icon {
  width: 54px;
  height: 40px;
  border-radius: 10px;
  object-fit: cover;
  background: var(--bg-soft);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.04);
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 650;
}

.metric strong {
  display: block;
  font-size: 1.85rem;
  font-weight: 780;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.metric.sm { --accent-bar: #2e90fa; }
.metric.sk { --accent-bar: #12b76a; }
.metric.pending { --accent-bar: #f79009; }
.metric.done { --accent-bar: #7a5af8; }

a.metric-link {
  display: block;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

a.metric-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(18, 38, 58, 0.12);
  border-color: #b7ccf5;
}

a.metric-link:focus-visible {
  outline: 3px solid rgba(26, 86, 219, 0.35);
  outline-offset: 2px;
}

a.metric-link:active {
  transform: translateY(0);
}

.metric-hint {
  display: block;
  margin-top: 8px;
  font-style: normal;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--primary);
  opacity: 0.85;
}

a.metric-link:hover .metric-hint {
  opacity: 1;
  text-decoration: underline;
}

/* ---- Panels ---- */
.panel {
  padding: 20px;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow-sm);
}

.panel.narrow {
  width: min(720px, 100%);
  margin-left: auto;
  margin-right: auto;
}

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

.panel h2 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 750;
}

.table-wrap {
  overflow-x: auto;
  overflow-y: visible;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}

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

th {
  background: linear-gradient(180deg, #f7fafc, #eef3f8);
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #475467;
  white-space: nowrap;
}

td {
  min-width: 90px;
}

tbody tr:hover {
  background: #f8fbff;
}

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

/* ---- Status chips ---- */
.chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  background: #eef2f6;
  color: #344054;
}

.chip.masuk,
.chip.baru { background: #e0f2fe; color: #026aa2; }
.chip.keluar,
.chip.selesai,
.chip.telah-dihantar { background: #d1fadf; color: #027a48; }
.chip.dalam-tindakan,
.chip.untuk-semakan { background: #fef0c7; color: #b54708; }
.chip.draft,
.chip.arkib { background: #f2f4f7; color: #475467; }

/* ---- Notices ---- */
.notice,
.error {
  display: grid;
  gap: 6px;
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
}

.notice {
  background: var(--ok-soft);
  border: 1px solid #b2ccff;
}

.notice.ok {
  background: var(--ok-bg);
  border: 1px solid #abefc6;
  color: var(--ok);
}

.error {
  color: var(--danger);
  background: #fff3f2;
  border: 1px solid #fecdca;
}

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

label {
  display: grid;
  gap: 6px;
}

label span {
  font-weight: 700;
  color: #344054;
  font-size: 0.9rem;
}

.full,
.form-actions {
  grid-column: 1 / -1;
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid #c9d5e3;
  border-radius: 10px;
  padding: 9px 12px;
  font: inherit;
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: #84adff;
  box-shadow: 0 0 0 4px rgba(26, 86, 219, 0.12);
}

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

.form-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-start;
  margin-top: 4px;
}

.search-form {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
}

.search-bar {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) 180px 110px;
  gap: 10px;
}

.search-bar-main {
  grid-template-columns: minmax(180px, 1.4fr) minmax(140px, 0.8fr) minmax(160px, 1fr);
}

.search-bar-dates {
  grid-template-columns: minmax(130px, 0.9fr) minmax(110px, 0.7fr) minmax(140px, 0.9fr) minmax(140px, 0.9fr) auto;
  align-items: end;
}

.search-date-field {
  display: grid;
  gap: 4px;
  margin: 0;
}

.search-date-field span {
  font-size: 0.78rem;
  font-weight: 650;
  color: var(--muted);
}

.search-date-field input {
  min-height: 42px;
}

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

.search-result-count {
  margin: 0 0 10px;
  font-weight: 650;
  color: var(--text);
}

.detail {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 10px 16px;
}

.detail dt {
  color: var(--muted);
}

.detail dd {
  margin: 0;
  font-weight: 700;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 4px 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: #f5f9ff;
  border: 1px solid #d7e6ff;
}

.check-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  min-height: 18px;
}

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

/* ---- Success illustration ---- */
.success-hero {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}

.success-hero img {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  object-fit: cover;
}

/* ---- Settings preview ---- */
.settings-preview {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.settings-preview h3 {
  margin: 0 0 10px;
  font-size: 0.95rem;
}

.settings-preview-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #fff, #f7fafc);
}

.settings-preview-card img {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  object-fit: cover;
}

.settings-preview-card strong {
  display: block;
  font-size: 1rem;
}

.settings-preview-card span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.86rem;
}

/* ---- Footer ---- */
.app-footer {
  width: min(1160px, calc(100vw - 32px));
  margin: 0 auto 28px;
  padding: 0 8px;
  color: var(--muted);
  font-size: 0.8rem;
  text-align: center;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 12px;
}

.version-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: #475467;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
}

.app-footer-login {
  position: relative;
  z-index: 2;
  margin: -8px auto 24px;
  color: #94a3b8;
}

.app-footer-login .version-badge {
  background: rgba(15, 23, 42, 0.72);
  border-color: rgba(148, 163, 184, 0.28);
  color: #cbd5e1;
}

/* ---- Responsive ---- */
@media (max-width: 900px) {
  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1099px) {
  .nav-toggle-btn {
    display: inline-flex;
  }

  /* Collapsed by default on tablet/phone */
  .app-nav {
    display: none;
    width: 100%;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .app-header:has(.nav-toggle-input:checked) .app-nav {
    display: grid;
  }

  .app-nav a {
    width: 100%;
    min-height: 44px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: #f8fafc;
    font-size: 0.9rem;
    padding: 10px 12px;
  }

  .app-nav a.active {
    border-color: transparent;
  }

  .nav-logout {
    display: none !important;
  }

  .nav-logout-mobile {
    display: inline-flex !important;
    grid-column: 1 / -1;
    background: #fff !important;
    color: var(--primary) !important;
    border: 1px solid #b7ccf5 !important;
    box-shadow: none !important;
  }
}

@media (max-width: 760px) {
  .app-header {
    padding: 10px 14px 12px;
  }

  .brand-logo {
    width: 42px;
    height: 42px;
    border-radius: 12px;
  }

  .brand h1 {
    font-size: 1rem;
  }

  .brand p {
    font-size: 0.75rem;
    max-width: 46vw;
  }

  .user-chip {
    max-width: 112px;
    padding: 5px 8px;
  }

  .user-chip strong {
    font-size: 0.72rem;
  }

  .user-chip span {
    font-size: 0.66rem;
  }

  .nav-toggle-text {
    display: none;
  }

  .nav-toggle-btn {
    min-width: 42px;
    padding: 8px 10px;
    justify-content: center;
  }

  .hero,
  .metrics,
  .form-grid,
  .search-bar,
  .search-bar-main,
  .search-bar-dates {
    grid-template-columns: 1fr;
  }

  .search-actions {
    width: 100%;
  }

  .search-actions .button,
  .search-actions button {
    flex: 1 1 auto;
  }

  .hero {
    padding: 22px 18px;
  }

  main {
    width: min(1160px, calc(100vw - 20px));
  }

  .panel {
    padding: 16px;
  }

  .search-bar {
    gap: 8px;
  }
}

@media (max-width: 400px) {
  .user-bar .user-chip span {
    display: none;
  }

  .brand p {
    display: none;
  }
}


/* ---- Confirm delete dialog ---- */
.app-confirm-dialog {
  border: none;
  border-radius: 16px;
  padding: 0;
  max-width: min(420px, calc(100vw - 32px));
  width: 100%;
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.28);
  background: transparent;
}

.app-confirm-dialog::backdrop {
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(2px);
}

.app-confirm-card {
  background: #fff;
  border-radius: 16px;
  padding: 22px 22px 18px;
  border: 1px solid #fecdca;
  text-align: center;
}

.app-confirm-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 12px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 1.4rem;
  font-weight: 800;
  color: #b42318;
  background: #fff3f2;
  border: 2px solid #fecdca;
}

.app-confirm-title {
  margin: 0 0 8px;
  font-size: 1.15rem;
  color: #b42318;
}

.app-confirm-message {
  margin: 0 0 12px;
  color: #344054;
  font-size: 0.98rem;
  line-height: 1.45;
}

.app-confirm-details {
  margin: 0 0 16px;
  padding: 12px 14px 12px 28px;
  text-align: left;
  background: #fffbfa;
  border: 1px solid #fecdca;
  border-radius: 10px;
  color: #5d2b28;
  font-size: 0.88rem;
  line-height: 1.45;
}

.app-confirm-details li + li {
  margin-top: 6px;
}

.app-confirm-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.app-confirm-actions .button,
.app-confirm-actions button {
  min-width: 120px;
}

@media (max-width: 480px) {
  .app-confirm-actions {
    flex-direction: column-reverse;
  }
  .app-confirm-actions .button,
  .app-confirm-actions button {
    width: 100%;
  }
}
