:root {
  --bg: #f4f9fb;
  --surface: #ffffff;
  --surface-alt: #f8fbfd;
  --border: #dce8ee;
  --border-strong: #bfd3dd;
  --text: #0f172a;
  --text-muted: #334155;
  --text-light: #475569;
  --primary: #0891b2;
  --primary-hover: #0e7490;
  --primary-soft: #e0f7fa;
  --primary-text: #155e75;
  --emerald: #059669;
  --emerald-hover: #047857;
  --emerald-soft: #d1fae5;
  --emerald-text: #065f46;
  --warning: #d97706;
  --warning-soft: #fef3c7;
  --danger: #dc2626;
  --danger-soft: #fee2e2;
  --indigo: #4f46e5;
  --indigo-soft: #e0e7ff;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.05), 0 1px 2px rgba(15, 23, 42, 0.03);
  --shadow-md: 0 10px 28px rgba(8, 145, 178, 0.08), 0 2px 8px rgba(15, 23, 42, 0.05);
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Figtree", "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Loading Splash */
.app-splash {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: linear-gradient(155deg, #f4f9fb 0%, #e0f2fe 100%);
  display: grid;
  place-items: center;
  padding: 24px;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.app-splash.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.app-splash-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
}

.app-splash-logo {
  width: 96px;
  height: 96px;
  border-radius: 22px;
  object-fit: cover;
  background: #fff;
  box-shadow: 0 14px 30px rgba(8, 145, 178, 0.2);
  border: 2px solid rgba(255, 255, 255, 0.9);
  animation: splashPulse 1.5s ease-in-out infinite;
}

.app-splash-title {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--text);
}

.app-splash-sub {
  font-size: 13px;
  color: var(--text-muted);
}

.app-splash-bar {
  width: 150px;
  height: 4px;
  border-radius: 999px;
  background: rgba(8, 145, 178, 0.16);
  overflow: hidden;
  margin-top: 4px;
}

.app-splash-bar span {
  display: block;
  width: 45%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--primary), var(--emerald));
  animation: splashSlide 1.1s ease-in-out infinite;
}

@keyframes splashPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.04); }
}

@keyframes splashSlide {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(240%); }
}

/* Login Split Layout */
.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 10% 15%, rgba(34, 211, 238, 0.18) 0%, transparent 45%),
    radial-gradient(circle at 90% 85%, rgba(5, 150, 105, 0.14) 0%, transparent 45%),
    var(--bg);
}

.login-shell {
  width: 100%;
  max-width: 920px;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.login-aside {
  background: linear-gradient(155deg, #0e7490 0%, #0891b2 55%, #059669 100%);
  color: #ffffff;
  padding: 38px 34px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 24px;
}

.login-brand-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}

.login-brand-logo {
  width: 76px;
  height: 76px;
  border-radius: 18px;
  object-fit: cover;
  background: #ffffff;
  border: 2px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.22);
  flex-shrink: 0;
}

.login-aside .brand-badge {
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  margin-bottom: 0;
}

.login-aside h1 {
  margin: 0 0 10px;
  font-size: 26px;
  line-height: 1.25;
  font-weight: 800;
}

.login-aside p {
  margin: 0;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.9);
}

.login-highlights {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
  font-size: 13.5px;
}

.login-highlights li {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.12);
  padding: 9px 12px;
  border-radius: 10px;
}

.login-card {
  padding: 38px 34px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.login-card h2 {
  margin: 0 0 4px;
  font-size: 21px;
  font-weight: 700;
}

.login-card p.subtitle {
  margin: 0 0 22px;
  font-size: 13.5px;
  color: var(--text-light);
}

.brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--primary-soft);
  color: var(--primary-text);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
  width: fit-content;
}

.password-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.password-wrap input { padding-right: 42px; }

.password-toggle-btn {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  color: var(--text-light);
  cursor: pointer;
  padding: 6px;
  border-radius: 7px;
  display: grid;
  place-items: center;
}

.password-toggle-btn:hover { background: var(--surface-alt); color: var(--text); }

.link-btn {
  border: none;
  background: transparent;
  color: var(--primary);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}

.link-btn:hover { text-decoration: underline; }

/* Account Menu (Unified Name + Logout) */
.account-menu { position: relative; }

.account-trigger {
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.account-trigger:hover { border-color: var(--primary); background: #fff; }

.account-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 230px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.16);
  padding: 8px;
  z-index: 70;
}

.account-dropdown-info {
  padding: 8px 10px 10px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 6px;
}

.account-dropdown-info strong { display: block; font-size: 13.5px; }
.account-dropdown-info small { display: block; font-size: 11.5px; color: var(--text-light); }

.account-dropdown-group {
  padding-bottom: 6px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

.account-dropdown-label {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-light);
  padding: 2px 10px 5px;
}

.account-menu-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s, color 0.15s;
}

.account-menu-item:hover { background: var(--surface-alt); color: var(--primary-text); }
.account-menu-item.active { background: var(--primary-soft); color: var(--primary-text); font-weight: 700; }

.account-logout-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  border: none;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 13px;
  font-weight: 700;
  border-radius: 8px;
  cursor: pointer;
}

.account-logout-btn:hover { filter: brightness(0.96); }

/* Dashboard Admin Hero & Export Actions */
.dashboard-hero {
  background: linear-gradient(135deg, #ffffff 0%, #f0fdfa 100%);
  border: 1px solid #bae6fd;
}

.dashboard-export-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.kpi-card.kpi-teal { border-top-color: #0d9488; }
.kpi-teal .kpi-icon { background: #ccfbf1; color: #115e59; }
.kpi-card.kpi-orange { border-top-color: #ea580c; }
.kpi-orange .kpi-icon { background: #ffedd5; color: #9a3412; }

.demo-accounts {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px dashed var(--border-strong);
  font-size: 12.5px;
  color: var(--text-light);
}

.demo-btn-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 8px;
}

/* App Shell */
.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.list-filter-panel {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 14px;
}

.filter-actions-row {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--border-strong);
}

.list-top-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.active-filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: nowrap;
  background: var(--primary-soft);
  border: 1px solid #a5f3fc;
  color: var(--primary-text);
  border-radius: 8px;
  padding: 6px 10px;
  margin-bottom: 8px;
  font-size: 11.5px;
  line-height: 1.3;
}

.active-filter-info {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  min-width: 0;
  flex: 1;
}

#btn-reset-list-filter {
  flex-shrink: 0;
  min-height: 28px;
  padding: 4px 9px;
  font-size: 11px;
  border-radius: 7px;
  gap: 4px;
}

#btn-reset-list-filter .icon {
  width: 13px;
  height: 13px;
}

.topbar {
  background: linear-gradient(135deg, #0e7490 0%, #0891b2 55%, #0d9488 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 4px 18px rgba(8, 145, 178, 0.22);
  padding: 0 24px;
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 30;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  min-width: 0;
}

.logo-mark {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: #ffffff;
  overflow: hidden;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  border: 2px solid rgba(255, 255, 255, 0.88);
  box-shadow: 0 3px 10px rgba(15, 23, 42, 0.18);
}

.logo-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.topbar-title {
  min-width: 0;
}

.topbar-title h2 {
  margin: 0;
  font-size: 15.5px;
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.2;
  color: #ffffff;
}

.topbar-title span {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.85);
  display: block;
  max-width: 210px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 14px;
  padding: 4px;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
}

.topbar-nav::-webkit-scrollbar { display: none; }

.nav-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid transparent;
  background: transparent;
  color: rgba(255, 255, 255, 0.92);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 13px;
  border-radius: 10px;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.18s, color 0.18s, border-color 0.18s, box-shadow 0.18s;
}

.nav-tab:hover { background: rgba(255, 255, 255, 0.18); color: #ffffff; }
.nav-tab.active {
  background: #ffffff;
  color: #0e7490;
  border-color: transparent;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.16);
}

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

.user-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.9);
  color: var(--text);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.12);
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

#topbar-username {
  max-width: 145px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.role-tag {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
}
.role-tag.penginput { background: var(--primary-soft); color: var(--primary-text); }
.role-tag.admin { background: var(--emerald-soft); color: var(--emerald-text); }

.main-container {
  width: 100%;
  max-width: 1380px;
  margin: 0 auto;
  padding: 24px;
  flex: 1;
}

/* Cards & Grids */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
}

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

.card-header h3 {
  margin: 0;
  font-size: 16.5px;
  font-weight: 700;
}

/* Start Gate (Trigger Awal) */
.start-gate-card {
  background: linear-gradient(135deg, #ffffff 0%, #f0fdfa 100%);
  border: 1px solid #bae6fd;
  padding: 28px;
}

.workflow-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 18px 0 22px;
}

.workflow-step-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.workflow-num {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-text);
  font-weight: 800;
  font-size: 13px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.workflow-step-box strong { display: block; font-size: 13.5px; margin-bottom: 2px; }
.workflow-step-box small { font-size: 12px; color: var(--text-light); }

/* KPI Grid */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 6px;
  border-top: 3px solid var(--primary);
  transition: transform 0.18s, box-shadow 0.18s;
}

.kpi-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.kpi-card.kpi-emerald { border-top-color: var(--emerald); }
.kpi-card.kpi-amber { border-top-color: var(--warning); }
.kpi-card.kpi-rose { border-top-color: var(--danger); }
.kpi-card.kpi-indigo { border-top-color: var(--indigo); }

.kpi-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.kpi-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--primary-soft);
  color: var(--primary-text);
}

.kpi-emerald .kpi-icon { background: var(--emerald-soft); color: var(--emerald-text); }
.kpi-amber .kpi-icon { background: var(--warning-soft); color: #92400e; }
.kpi-rose .kpi-icon { background: var(--danger-soft); color: #991b1b; }
.kpi-indigo .kpi-icon { background: var(--indigo-soft); color: #3730a3; }

.kpi-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.kpi-value {
  font-size: 28px;
  font-weight: 800;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.kpi-sub {
  font-size: 12px;
  color: var(--text-light);
}

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }

/* Forms & Stepper */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 12px;
}

.form-group label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
}

.req { color: var(--danger); }

input, select, textarea {
  width: 100%;
  min-height: 42px;
  padding: 8px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s, background-color 0.15s;
}

select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 34px;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
  background-size: 16px;
}

select:hover, input:hover:not([readonly]), textarea:hover {
  border-color: #94b3c3;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(8, 145, 178, 0.16);
}

input[readonly] {
  background: var(--surface-alt);
  color: var(--text-muted);
  cursor: default;
}

.step-pills {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.step-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  background: var(--surface-alt);
  color: var(--text-muted);
  padding: 10px 12px;
  border-radius: 11px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: all 0.18s;
}

.step-pill:hover { border-color: var(--primary); color: var(--text); }

.step-pill.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 4px 12px rgba(8, 145, 178, 0.24);
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text);
  margin: 22px 0 14px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  background: linear-gradient(90deg, #f0fdfa 0%, #f8fbfd 100%);
}

.form-step > .section-title:first-child { margin-top: 4px; }

.section-title.accent-emerald {
  border-left-color: var(--emerald);
  background: linear-gradient(90deg, #ecfdf5 0%, #f8fbfd 100%);
}

.section-title-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.section-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--primary-soft);
  color: var(--primary-text);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.section-title.accent-emerald .section-icon {
  background: var(--emerald-soft);
  color: var(--emerald-text);
}

.section-icon .icon { width: 16px; height: 16px; }

.section-tag {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 999px;
  background: #ffffff;
  border: 1px solid var(--border);
  color: var(--primary-text);
  white-space: nowrap;
  flex-shrink: 0;
}

.section-title.accent-emerald .section-tag { color: var(--emerald-text); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 40px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.16s, border-color 0.16s, transform 0.1s;
}

.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-emerald { background: var(--emerald); color: #fff; }
.btn-emerald:hover { background: var(--emerald-hover); }
.btn-secondary { background: var(--surface); border-color: var(--border-strong); color: var(--text); }
.btn-secondary:hover { background: var(--surface-alt); }
.btn-accent { background: var(--emerald); color: #fff; }
.btn-accent:hover { background: var(--emerald-hover); }
.btn-danger { background: var(--danger-soft); color: var(--danger); border-color: #fecaca; }
.btn-sm { min-height: 32px; padding: 5px 10px; font-size: 12.5px; }

/* Cek NIK Trigger Button */
.btn-cek-nik {
  background: linear-gradient(135deg, #0891b2 0%, #059669 100%);
  color: #ffffff;
  border: none;
  white-space: nowrap;
  padding: 8px 14px;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(8, 145, 178, 0.28);
  transition: transform 0.16s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.btn-cek-nik:hover {
  transform: translateY(-1px);
  box-shadow: 0 7px 18px rgba(8, 145, 178, 0.38);
  filter: brightness(1.05);
}

.btn-cek-nik:active {
  transform: translateY(1px) scale(0.98);
  box-shadow: 0 2px 8px rgba(8, 145, 178, 0.25);
}

.btn-cek-nik.ready {
  animation: nikPulse 1.6s ease-in-out infinite;
}

.btn-cek-nik.loading {
  opacity: 0.82;
  pointer-events: none;
}

.btn-cek-nik.loading .icon {
  animation: spin 0.8s linear infinite;
}

@keyframes nikPulse {
  0%, 100% { box-shadow: 0 4px 12px rgba(8, 145, 178, 0.28), 0 0 0 0 rgba(5, 150, 105, 0.45); }
  50% { box-shadow: 0 6px 16px rgba(8, 145, 178, 0.4), 0 0 0 6px rgba(5, 150, 105, 0); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
}

.badge-terverifikasi { background: var(--emerald-soft); color: var(--emerald-text); }
.badge-terkirim { background: var(--primary-soft); color: var(--primary-text); }
.badge-revisi { background: var(--danger-soft); color: #991b1b; }
.badge-draft { background: #e2e8f0; color: #334155; }
.badge-warn { background: var(--warning-soft); color: #92400e; }

/* Tables */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
}

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

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

th {
  background: var(--surface-alt);
  font-weight: 700;
  color: var(--text-light);
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

tbody tr:hover { background: #f2f9fb; }
.num { text-align: right; font-variant-numeric: tabular-nums; }

/* Filter Bar */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: end;
  margin-bottom: 16px;
}

.filter-bar .form-group { margin-bottom: 0; min-width: 150px; }

/* Bars & Charts */
.bar-list { display: flex; flex-direction: column; gap: 11px; }
.bar-item-head { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 4px; }
.bar-track { height: 9px; background: #e2eef2; border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; background: linear-gradient(90deg, var(--primary), var(--emerald)); border-radius: 999px; }

.svg-chart-wrap { width: 100%; overflow-x: auto; }

/* Alert / Banner */
.alert {
  padding: 11px 14px;
  border-radius: 10px;
  font-size: 13px;
  margin-bottom: 14px;
}
.alert-info { background: var(--primary-soft); color: var(--primary-text); }
.alert-warn { background: var(--warning-soft); color: #92400e; }
.alert-danger { background: var(--danger-soft); color: #991b1b; }
.alert-success { background: var(--emerald-soft); color: var(--emerald-text); }

/* Native Modal Dialog */
dialog {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 0;
  max-width: 840px;
  width: calc(100% - 32px);
  box-shadow: 0 24px 55px rgba(15, 23, 42, 0.24);
}

dialog::backdrop {
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(3px);
}

.dialog-head {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.dialog-body {
  padding: 20px;
  max-height: 75vh;
  overflow-y: auto;
}

.dialog-foot {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #0f172a;
  color: #fff;
  padding: 12px 18px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 600;
  box-shadow: var(--shadow-md);
  z-index: 100;
}

/* Success Checkmark Center Overlay */
.success-overlay {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.38);
  backdrop-filter: blur(4px);
}

.success-modal-card {
  width: 100%;
  max-width: 340px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 28px 24px;
  text-align: center;
  box-shadow: 0 24px 55px rgba(15, 23, 42, 0.24);
  animation: modalPop 0.28s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.checkmark-svg {
  width: 68px;
  height: 68px;
  margin: 0 auto 14px;
  display: block;
}

.checkmark-circle {
  stroke: var(--emerald);
  stroke-width: 3;
  fill: var(--emerald-soft);
  stroke-dasharray: 166;
  stroke-dashoffset: 166;
  animation: checkStroke 0.45s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.checkmark-tick {
  stroke: var(--emerald-text);
  stroke-width: 3.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  stroke-dasharray: 48;
  stroke-dashoffset: 48;
  animation: checkStroke 0.32s cubic-bezier(0.65, 0, 0.45, 1) 0.28s forwards;
}

.success-modal-card h3 {
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
}

.success-modal-card p {
  margin: 0;
  font-size: 13.5px;
  color: var(--text-light);
}

/* Unified Modern Confirm Dialog */
.confirm-dialog {
  max-width: 440px;
  border-radius: 20px;
  animation: modalPop 0.22s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.confirm-icon-box {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  margin: 0 auto 14px;
}

.confirm-icon-box .icon { width: 28px; height: 28px; }
.confirm-icon-box.type-warning { background: var(--warning-soft); color: var(--warning); }
.confirm-icon-box.type-danger { background: var(--danger-soft); color: var(--danger); }
.confirm-icon-box.type-info { background: var(--primary-soft); color: var(--primary-text); }

@keyframes modalPop {
  from { opacity: 0; transform: scale(0.88); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes checkStroke {
  to { stroke-dashoffset: 0; }
}

/* Modern Searchable Combobox */
.combobox { position: relative; width: 100%; }
.combobox-input-wrap { position: relative; display: flex; align-items: center; }
.combobox-input { padding-right: 54px !important; }

.combobox-clear,
.combobox-toggle {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  color: var(--text-light);
  cursor: pointer;
  padding: 4px 6px;
  font-size: 14px;
  line-height: 1;
  border-radius: 6px;
}

.combobox-clear { right: 28px; font-size: 16px; }
.combobox-toggle { right: 6px; font-size: 11px; }
.combobox-clear:hover,
.combobox-toggle:hover { background: var(--surface-alt); color: var(--text); }

.combobox-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 240px;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 11px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.14);
  z-index: 60;
  padding: 4px;
}

.combobox-option {
  display: block;
  padding: 8px 10px;
  border-radius: 7px;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.combobox-option:hover,
.combobox-option.active {
  background: var(--primary-soft);
  color: var(--primary-text);
}

.combobox-option.selected { font-weight: 700; }
.combobox-option mark { background: #fef08a; color: inherit; border-radius: 2px; padding: 0 1px; }
.combobox-empty { padding: 10px 12px; font-size: 12.5px; color: var(--text-light); text-align: center; }

/* Multi-Select Dropdown Box */
.multiselect {
  position: relative;
  width: 100%;
}

.multiselect-control {
  min-height: 42px;
  padding: 5px 34px 5px 10px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: #fff;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  cursor: pointer;
  position: relative;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.multiselect-control:hover { border-color: #94b3c3; }
.multiselect-control.open,
.multiselect-control:focus-visible {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(8, 145, 178, 0.16);
}

.multiselect-chevron {
  position: absolute;
  right: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-light);
  pointer-events: none;
  display: grid;
  place-items: center;
}

.multiselect-placeholder {
  font-size: 13.5px;
  color: var(--text-light);
  padding: 2px;
}

.multiselect-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 7px;
  background: var(--primary-soft);
  color: var(--primary-text);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
}

.multiselect-tag-remove {
  border: none;
  background: transparent;
  color: var(--primary-text);
  cursor: pointer;
  padding: 0 2px;
  font-size: 14px;
  line-height: 1;
  border-radius: 4px;
}

.multiselect-tag-remove:hover { background: rgba(8, 145, 178, 0.16); }

.multiselect-menu {
  position: absolute;
  top: calc(100% + 5px);
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.15);
  z-index: 65;
  padding: 6px;
}

.multiselect-search {
  min-height: 34px !important;
  padding: 6px 10px !important;
  font-size: 13px !important;
  margin-bottom: 6px;
}

.multiselect-list {
  max-height: 210px;
  overflow-y: auto;
  display: grid;
  gap: 2px;
}

.multiselect-option {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.12s;
}

.multiselect-option:hover { background: var(--surface-alt); }
.multiselect-option.selected { background: var(--primary-soft); color: var(--primary-text); font-weight: 600; }

.multiselect-check {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  border: 1.5px solid var(--border-strong);
  background: #fff;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.multiselect-option.selected .multiselect-check {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.multiselect-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 6px;
  margin-top: 6px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-light);
}

/* Lab Interpretation Cards */
.lab-interp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
  margin: 4px 0 14px;
}

.lab-interp-item {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-alt);
  font-size: 12.5px;
}

.lab-interp-item.level-normal { background: var(--emerald-soft); border-color: #a7f3d0; color: var(--emerald-text); }
.lab-interp-item.level-warn { background: var(--warning-soft); border-color: #fde68a; color: #92400e; }
.lab-interp-item.level-danger { background: var(--danger-soft); border-color: #fecaca; color: #991b1b; }

/* Form Bottom Actions Bar */
.form-actions-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  gap: 12px;
  flex-wrap: wrap;
}

.form-actions-nav,
.form-actions-submit {
  display: flex;
  gap: 8px;
}

@media (max-width: 1140px) {
  .list-filter-panel {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 14px;
}

.filter-actions-row {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--border-strong);
}

.list-top-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.active-filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: nowrap;
  background: var(--primary-soft);
  border: 1px solid #a5f3fc;
  color: var(--primary-text);
  border-radius: 8px;
  padding: 6px 10px;
  margin-bottom: 8px;
  font-size: 11.5px;
  line-height: 1.3;
}

.active-filter-info {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  min-width: 0;
  flex: 1;
}

#btn-reset-list-filter {
  flex-shrink: 0;
  min-height: 28px;
  padding: 4px 9px;
  font-size: 11px;
  border-radius: 7px;
  gap: 4px;
}

#btn-reset-list-filter .icon {
  width: 13px;
  height: 13px;
}

.topbar { padding: 0 16px; gap: 10px; }
  .topbar-title span { max-width: 150px; }
  #topbar-username { max-width: 105px; }
  .nav-tab { padding: 7px 10px; font-size: 12.5px; }
}

@media (max-width: 960px) {
  .login-shell { grid-template-columns: 1fr; }
  .workflow-steps, .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .step-pills { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 768px) {
  .login-page { padding: 14px; }
  .login-aside { padding: 20px; gap: 10px; }
  .login-aside h1 { font-size: 20px; margin-bottom: 4px; }
  .login-highlights { display: none; }
  .login-card { padding: 22px 20px; }

  .list-filter-panel {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 14px;
}

.filter-actions-row {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--border-strong);
}

.list-top-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.active-filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: nowrap;
  background: var(--primary-soft);
  border: 1px solid #a5f3fc;
  color: var(--primary-text);
  border-radius: 8px;
  padding: 6px 10px;
  margin-bottom: 8px;
  font-size: 11.5px;
  line-height: 1.3;
}

.active-filter-info {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  min-width: 0;
  flex: 1;
}

#btn-reset-list-filter {
  flex-shrink: 0;
  min-height: 28px;
  padding: 4px 9px;
  font-size: 11px;
  border-radius: 7px;
  gap: 4px;
}

#btn-reset-list-filter .icon {
  width: 13px;
  height: 13px;
}

.topbar {
    padding: 10px 12px;
    min-height: 0;
    height: auto;
    flex-wrap: wrap;
    gap: 8px;
    background: linear-gradient(135deg, #0e7490 0%, #0891b2 55%, #0d9488 100%);
    box-shadow: 0 4px 14px rgba(8, 145, 178, 0.22);
  }
  .topbar-left { order: 1; flex: 1; min-width: 0; gap: 9px; }
  .logo-mark { width: 34px; height: 34px; border-radius: 10px; }
  .topbar-title h2 { font-size: 14.5px; }
  .topbar-title span { font-size: 11px; max-width: 100%; }
  .topbar-right { order: 2; gap: 6px; }
  #sync-status-pill { padding: 4px 9px; font-size: 11px; white-space: nowrap; }
  #topbar-username { display: none; }
  .user-pill { padding: 4px 8px; gap: 5px; }
  .role-tag { font-size: 10px; padding: 2px 7px; }

  .topbar-nav {
    order: 3;
    position: static;
    width: 100%;
    flex-basis: 100%;
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: 12px;
    padding: 4px;
    display: flex;
    justify-content: space-between;
    gap: 4px;
    box-shadow: none;
  }
  .nav-tab {
    flex: 1 1 0;
    min-width: 0;
    flex-direction: row;
    justify-content: center;
    gap: 5px;
    padding: 7px 6px;
    font-size: 11.5px;
    line-height: 1.2;
    min-height: 36px;
    border-radius: 9px;
    white-space: nowrap;
    text-align: center;
    color: rgba(255, 255, 255, 0.92);
  }
  .nav-tab.active {
    background: #ffffff;
    color: #0e7490;
    border-color: transparent;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.16);
  }
  .nav-tab .icon { width: 15px; height: 15px; }

  .main-container {
    padding: 14px 12px 24px;
    max-width: 100vw;
    overflow-x: hidden;
  }
  .card {
    padding: 16px 14px;
    border-radius: 12px;
    margin-bottom: 14px;
    min-width: 0;
  }
  .grid-2 > *, .grid-3 > *, .grid-4 > * { min-width: 0; }

  input, select, textarea { font-size: 16px; }
  .btn { min-height: 44px; }
  .btn-sm { min-height: 36px; }

  .form-group label {
    font-size: 14px;
    line-height: 1.35;
    color: #334155;
  }
  #exam-form .form-group label {
    font-size: 14.5px;
    color: var(--text);
  }
  input, select, textarea {
    font-size: 15px;
  }

  .step-pills {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 14px;
    padding-bottom: 12px;
  }
  .step-pill {
    justify-content: center;
    text-align: center;
    padding: 9px 8px;
    font-size: 12.5px;
    min-height: 42px;
  }

  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .kpi-card { padding: 12px 13px; }
  .kpi-value { font-size: 22px; }
  .kpi-icon { width: 28px; height: 28px; }

  .dashboard-export-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    gap: 8px;
  }
  .dashboard-export-actions .btn { width: 100%; justify-content: center; font-size: 12px; }

  .filter-bar {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .filter-bar .form-group { min-width: 0; }
  .filter-bar .form-group:has(input[type="search"]) { grid-column: 1 / -1; }

  dialog {
    width: calc(100% - 16px);
    max-height: 92vh;
  }
  .dialog-head, .dialog-body, .dialog-foot { padding: 14px; }
  .dialog-foot { flex-wrap: wrap; }

  .form-actions-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    margin-top: 18px;
    padding-top: 14px;
  }
  .form-actions-nav,
  .form-actions-submit {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    width: 100%;
  }
  .form-actions-bar .btn {
    width: 100%;
    padding: 8px 10px;
    font-size: 13px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

@media print {
  .topbar, .no-print { display: none !important; }
  body { background: #fff; }
  .card { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; }
}
