:root,
[data-theme="light"] {
  --bg: #F8F7F4;
  --surface: #FFFFFF;
  --surface-subtle: #F1EFEA;
  --surface-zebra: #FAF9F6;
  --ink: #18181B;
  --ink-muted: #4B4A45;
  --border: #D6D3C9;
  --border-strong: #78756C;
  --accent: #14532D;
  --accent-hover: #0F3F22;
  --accent-ink: #FFFFFF;
  --accent-soft: #ECFDF3;
  --accent-soft-ink: #14532D;
  --danger: #9F1239;
  --danger-hover: #830E2E;
  --danger-ink: #FFFFFF;
  --danger-soft: #FFF1F2;
  --danger-soft-ink: #9F1239;
  --focus-ring: #14532D;
  --shadow-elevated: 0 10px 28px rgba(24, 24, 27, 0.12);
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 10px;
}

[data-theme="dark"] {
  --bg: #141413;
  --surface: #1E1D1B;
  --surface-subtle: #282623;
  --surface-zebra: #23211E;
  --ink: #F4F3EF;
  --ink-muted: #B5B2A8;
  --border: #3F3C36;
  --border-strong: #8E8B82;
  --accent: #166534;
  --accent-hover: #15803D;
  --accent-ink: #FFFFFF;
  --accent-soft: #14261B;
  --accent-soft-ink: #4ADE80;
  --danger: #BE123C;
  --danger-hover: #9F1239;
  --danger-ink: #FFFFFF;
  --danger-soft: #2E121A;
  --danger-soft-ink: #FDA4AF;
  --focus-ring: #4ADE80;
  --shadow-elevated: 0 12px 32px rgba(0, 0, 0, 0.5);
}

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: clamp(0.9375rem, 0.9rem + 0.2vw, 1rem);
  line-height: 1.55;
  overflow-x: clip;
}

img,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
}

a[href],
button:not(:disabled),
summary,
select:not(:disabled),
label[for],
input[type="checkbox"]:not(:disabled),
input[type="radio"]:not(:disabled),
[role="tab"]:not([aria-disabled="true"]),
[role="button"]:not([aria-disabled="true"]) {
  cursor: pointer;
}

button:disabled,
input:disabled,
select:disabled,
textarea:disabled,
[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.56;
}

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0.5rem;
  z-index: 1000;
  padding: 0.75rem 1rem;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
  border-radius: var(--radius-md);
  text-decoration: none;
}

.skip-link:focus {
  left: 0.75rem;
}

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

.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.hidden {
  display: none !important;
}

.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  max-width: 760px;
  margin: 0 auto;
  padding: 0.75rem 1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.625rem 0.75rem;
}

.topbar-wide .topbar-inner {
  max-width: 1400px;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1 1 200px;
  min-width: 0;
}

.brand-mark {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface-subtle);
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  overflow: hidden;
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 3px;
}

.brand-text {
  min-width: 0;
  flex: 1 1 auto;
}

.brand-kicker {
  margin: 0;
  font-size: 0.75rem;
  color: var(--ink-muted);
  font-weight: 600;
}

.brand-title {
  margin: 0;
  font-size: clamp(0.95rem, 0.9rem + 0.45vw, 1.2rem);
  line-height: 1.25;
  font-weight: 700;
  overflow-wrap: break-word;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
  margin-left: auto;
}

@media (max-width: 639px) {
  .topbar-wide .brand-lockup {
    flex: 1 1 100%;
  }

  .topbar-wide .topbar-actions {
    width: 100%;
    justify-content: flex-end;
    padding-top: 0.375rem;
    border-top: 1px solid var(--border);
  }
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0.625rem 1rem;
  border-radius: var(--radius-lg);
  border: 1px solid transparent;
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease, transform 80ms ease;
}

.btn:active:not(:disabled) {
  transform: translateY(1px);
}

.btn-sm {
  min-height: 36px;
  padding: 0.375rem 0.75rem;
  font-size: 0.8125rem;
  border-radius: var(--radius-md);
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.btn-danger {
  background: var(--danger);
  color: var(--danger-ink);
  border-color: var(--danger);
}

.btn-danger:hover:not(:disabled) {
  background: var(--danger-hover);
  border-color: var(--danger-hover);
}

.btn-secondary {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--border-strong);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--surface-subtle);
}

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--border);
}

.btn-ghost:hover:not(:disabled) {
  background: var(--surface-subtle);
  border-color: var(--border-strong);
}

.btn-block {
  width: 100%;
}

.page-shell {
  max-width: 760px;
  margin: 0 auto;
  padding: 1.25rem 1rem max(3.5rem, env(safe-area-inset-bottom));
}

.activity-banner {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 3px solid var(--ink);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}

.activity-header-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.activity-heading {
  margin: 0 0 0.375rem;
  font-size: clamp(1.375rem, 1.15rem + 1vw, 1.75rem);
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.activity-desc {
  margin: 0;
  color: var(--ink-muted);
  max-width: 56ch;
}

.clock-box {
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.625rem 0.875rem;
  min-width: 168px;
}

.clock-date {
  display: block;
  font-size: 0.8125rem;
  color: var(--ink-muted);
  font-weight: 500;
}

.clock-time {
  display: block;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--ink);
  margin-top: 0.125rem;
}

.choice-section {
  margin-bottom: 1.5rem;
}

.section-lead {
  margin: 0 0 0.75rem;
  font-size: 1rem;
  font-weight: 600;
}

.choice-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.875rem;
}

.choice-btn {
  width: 100%;
  text-align: left;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.375rem;
  padding: 1.25rem;
  min-height: 108px;
  background: var(--surface);
  color: var(--ink);
  border: 2px solid var(--border-strong);
  border-radius: var(--radius-lg);
  font-family: inherit;
  transition: background-color 140ms ease, border-color 140ms ease, transform 80ms ease;
}

.choice-btn:hover:not(:disabled) {
  background: var(--surface-subtle);
}

.choice-btn:active:not(:disabled) {
  transform: translateY(1px);
}

.choice-btn--masuk[aria-pressed="true"],
.choice-btn--masuk:hover:not(:disabled) {
  border-color: var(--accent);
}

.choice-btn--masuk[aria-pressed="true"] {
  background: var(--accent-soft);
  color: var(--accent-soft-ink);
}

.choice-btn--pulang[aria-pressed="true"],
.choice-btn--pulang:hover:not(:disabled) {
  border-color: var(--danger);
}

.choice-btn--pulang[aria-pressed="true"] {
  background: var(--danger-soft);
  color: var(--danger-soft-ink);
}

.choice-tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.1875rem 0.5rem;
  border-radius: var(--radius-sm);
  border: 1px solid currentColor;
}

.choice-title {
  font-size: 1.25rem;
  font-weight: 700;
}

.choice-hint {
  font-size: 0.875rem;
  color: var(--ink-muted);
}

.choice-btn[aria-pressed="true"] .choice-hint {
  color: currentColor;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 1rem;
}

.panel-elevated {
  box-shadow: var(--shadow-elevated);
}

.step-header {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  padding-bottom: 0.75rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.step-num {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--ink-muted);
  flex-shrink: 0;
}

.step-title {
  margin: 0;
  font-size: 1.0625rem;
  font-weight: 700;
}

.field-group {
  margin-bottom: 1rem;
}

.field-group:last-child {
  margin-bottom: 0;
}

.field-label {
  display: block;
  font-size: 0.9375rem;
  font-weight: 600;
  margin-bottom: 0.375rem;
}

.field-help {
  margin: 0.375rem 0 0;
  font-size: 0.8125rem;
  color: var(--ink-muted);
}

.input,
.textarea,
.select {
  width: 100%;
  min-height: 44px;
  padding: 0.625rem 0.875rem;
  background: var(--surface);
  color: var(--ink);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 1rem;
  line-height: 1.4;
}

.textarea {
  min-height: 92px;
  resize: vertical;
}

.input::placeholder,
.textarea::placeholder {
  color: var(--ink-muted);
  opacity: 0.85;
}

.alert {
  padding: 0.875rem 1rem;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border-strong);
  background: var(--surface-subtle);
  color: var(--ink);
  font-size: 0.9375rem;
  margin-bottom: 1rem;
}

.alert-success {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-soft-ink);
}

.alert-error {
  background: var(--danger-soft);
  border-color: var(--danger);
  color: var(--danger-soft-ink);
}

.alert strong {
  display: block;
  margin-bottom: 0.125rem;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.1875rem 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 700;
  border: 1px solid var(--border-strong);
  background: var(--surface-subtle);
  color: var(--ink);
}

.status-badge--ok {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-soft-ink);
}

.status-badge--danger {
  background: var(--danger-soft);
  border-color: var(--danger);
  color: var(--danger-soft-ink);
}

.search-results {
  margin-top: 0.5rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--surface);
  overflow: hidden;
}

.search-result-btn {
  width: 100%;
  text-align: left;
  background: transparent;
  color: var(--ink);
  border: 0;
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 0.875rem;
  min-height: 52px;
  font-family: inherit;
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.search-result-btn:last-child {
  border-bottom: 0;
}

.search-result-btn:hover {
  background: var(--surface-subtle);
}

.search-result-name {
  font-weight: 700;
  font-size: 0.9375rem;
}

.search-result-meta {
  font-size: 0.8125rem;
  color: var(--ink-muted);
}

.profile-ledger {
  border: 1.5px solid var(--accent);
  background: var(--surface-subtle);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-top: 0.875rem;
}

.profile-ledger-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.625rem;
  border-bottom: 1px solid var(--border);
}

.profile-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.625rem 1rem;
  margin: 0;
}

.profile-grid dt {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--ink-muted);
}

.profile-grid dd {
  margin: 0.125rem 0 0;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.camera-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #141413;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.camera-video,
.camera-preview {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.camera-video--mirror {
  transform: scaleX(-1);
}

.camera-placeholder {
  padding: 1.25rem;
  text-align: center;
  color: #F4F3EF;
  font-size: 0.9375rem;
  max-width: 36ch;
}

.media-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.625rem;
  margin-top: 0.75rem;
}

.media-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.625rem;
}

.size-meta {
  font-size: 0.8125rem;
  color: var(--ink-muted);
}

.sig-wrap {
  width: 100%;
  aspect-ratio: 16 / 7;
  min-height: 168px;
  background: #FFFFFF;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-md);
  overflow: hidden;
  position: relative;
}

.sig-canvas {
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: crosshair;
}

.sig-guide {
  position: absolute;
  left: 1rem;
  right: 1rem;
  bottom: 24%;
  border-bottom: 1px dashed #9CA3AF;
  pointer-events: none;
}

.receipt-list {
  margin: 1rem 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--border);
}

.receipt-list li {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.625rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9375rem;
}

.receipt-list span:first-child {
  color: var(--ink-muted);
}

.receipt-list strong {
  text-align: right;
  overflow-wrap: anywhere;
}

.site-footer {
  max-width: 760px;
  margin: 0 auto;
  padding: 1rem 1rem 2rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.8125rem;
  color: var(--ink-muted);
}

.site-footer a {
  color: var(--ink);
  font-weight: 600;
}

/* Admin shell */
.auth-shell {
  max-width: 460px;
  margin: 2.5rem auto;
  padding: 0 1rem 3rem;
}

.admin-layout {
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  min-height: calc(100dvh - 73px);
}

.admin-sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 1.25rem 0.875rem;
}

.admin-nav-group {
  margin-bottom: 1.25rem;
}

.admin-nav-label {
  margin: 0 0 0.5rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--ink-muted);
}

.admin-nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.admin-nav-btn {
  width: 100%;
  min-height: 44px;
  padding: 0.625rem 0.875rem;
  border: 1.5px solid transparent;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--ink);
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 500;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.admin-nav-btn:hover {
  background: var(--surface-subtle);
  border-color: var(--border);
}

.admin-nav-btn[aria-current="page"] {
  background: var(--accent-soft);
  color: var(--accent-soft-ink);
  border-color: var(--accent);
  font-weight: 700;
}

.admin-main {
  padding: 1.25rem 1rem max(3.5rem, env(safe-area-inset-bottom));
  min-width: 0;
}

.admin-section-head {
  margin-bottom: 1.25rem;
}

.admin-section-head h1 {
  margin: 0 0 0.25rem;
  font-size: clamp(1.375rem, 1.15rem + 0.8vw, 1.625rem);
  font-weight: 700;
  line-height: 1.25;
}

.admin-section-head p {
  margin: 0;
  color: var(--ink-muted);
}

.summary-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.summary-cell {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.875rem 1rem;
}

.summary-label {
  font-size: 0.8125rem;
  color: var(--ink-muted);
  display: block;
}

.summary-value {
  font-size: 1.5rem;
  font-weight: 700;
  display: block;
  margin-top: 0.125rem;
}

.qr-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  align-items: start;
}

.qr-poster-card {
  background: var(--surface);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  text-align: center;
}

.qr-canvas-box {
  width: 240px;
  height: 240px;
  margin: 1rem auto;
  padding: 12px;
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
}

.qr-canvas-box canvas {
  width: 216px;
  height: 216px;
}

.url-copy-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.625rem;
  margin-top: 0.5rem;
}

.url-copy-row .input {
  flex: 1 1 240px;
}

.upload-zone {
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--surface-subtle);
  padding: 1.25rem;
}

.radio-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.875rem;
  margin: 0.875rem 0;
}

.radio-option {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0.5rem 0.875rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--surface);
  font-size: 0.9375rem;
  font-weight: 500;
}

.radio-option input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.toolbar-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.875rem;
}

.branding-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

.asset-preview-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  margin-top: 0.5rem;
}

.asset-thumb {
  width: 64px;
  height: 64px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--surface-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.asset-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 4px;
}

.asset-thumb--favicon {
  width: 48px;
  height: 48px;
}

.empty-state {
  padding: 2rem 1.25rem;
  text-align: center;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--surface-subtle);
}

.empty-state h2,
.empty-state h3 {
  margin: 0 0 0.375rem;
  font-size: 1rem;
}

.empty-state p {
  margin: 0 0 1rem;
  color: var(--ink-muted);
  max-width: 44ch;
  margin-inline: auto;
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(20, 20, 19, 0.55);
  z-index: 40;
}

.mobile-menu-trigger {
  display: inline-flex;
}

/* Excel-style Grid & AutoFilter */
.excel-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.excel-toolbar-left,
.excel-toolbar-right {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.excel-search-input {
  width: min(280px, 100%);
}

.excel-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.excel-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.625rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--accent);
  background: var(--accent-soft);
  color: var(--accent-soft-ink);
  font-size: 0.8125rem;
  font-weight: 600;
}

.excel-chip button {
  background: transparent;
  border: 0;
  color: currentColor;
  font-weight: 700;
  padding: 0 0.25rem;
  min-width: 24px;
  min-height: 24px;
  line-height: 1;
}

.excel-scroll {
  width: 100%;
  max-height: 62vh;
  overflow: auto;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.excel-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.85rem;
  min-width: 780px;
}

.excel-table th,
.excel-table td {
  padding: 0.5rem 0.625rem;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: middle;
}

.excel-table th:last-child,
.excel-table td:last-child {
  border-right: 0;
}

.excel-table thead th {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--surface-subtle);
  border-bottom: 2px solid var(--border-strong);
  font-weight: 700;
  white-space: nowrap;
  padding: 0.45rem 0.5rem;
}

.excel-table tbody tr:nth-child(even) td {
  background: var(--surface-zebra);
}

.excel-table tbody tr:hover td {
  background: var(--accent-soft);
}

.excel-rownum {
  width: 44px;
  min-width: 44px;
  text-align: right !important;
  color: var(--ink-muted);
  background: var(--surface-subtle) !important;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  user-select: none;
}

.excel-th-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.375rem;
}

.excel-th-label {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.excel-sort-mark {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--accent-soft-ink);
}

.excel-filter-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  min-height: 28px;
  padding: 0 0.35rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
  flex-shrink: 0;
}

.excel-filter-btn:hover {
  background: var(--surface-subtle);
}

.excel-filter-btn.is-active {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}

.excel-popover {
  position: fixed;
  z-index: 90;
  width: min(304px, calc(100vw - 24px));
  background: var(--surface);
  color: var(--ink);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-elevated);
  padding: 0.75rem;
}

.excel-popover-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.875rem;
  font-weight: 700;
}

.excel-sort-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.375rem;
  margin-bottom: 0.625rem;
}

.excel-sort-btn {
  min-height: 36px;
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
}

.excel-sort-btn:hover {
  background: var(--surface-subtle);
}

.excel-sort-btn[aria-pressed="true"] {
  background: var(--accent-soft);
  color: var(--accent-soft-ink);
  border-color: var(--accent);
}

.excel-pop-search {
  min-height: 38px;
  padding: 0.4rem 0.625rem;
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
}

.excel-select-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.375rem;
  font-size: 0.75rem;
}

.excel-select-bar button {
  background: transparent;
  border: 0;
  padding: 0.25rem 0.375rem;
  color: var(--accent-soft-ink);
  font-weight: 700;
  font-size: 0.75rem;
  text-decoration: underline;
}

.excel-values-list {
  max-height: 200px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.25rem;
  margin-bottom: 0.625rem;
  background: var(--surface-subtle);
}

.excel-val-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.35rem 0.45rem;
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
}

.excel-val-item:hover {
  background: var(--surface);
}

.excel-val-item label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1 1 auto;
  min-width: 0;
}

.excel-val-item input[type="checkbox"] {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  accent-color: var(--accent);
}

.excel-val-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.excel-val-count {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--ink-muted);
  flex-shrink: 0;
}

.excel-popover-foot {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
}

.excel-footer-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

/* Modal Preview Bukti */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(20, 20, 19, 0.62);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-dialog {
  width: min(740px, 100%);
  max-height: 90dvh;
  overflow-y: auto;
  background: var(--surface);
  color: var(--ink);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-elevated);
  padding: 1.25rem;
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.75rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.modal-head h2 {
  margin: 0;
  font-size: 1.125rem;
}

.proof-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.proof-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.75rem;
  background: var(--surface-subtle);
}

.proof-card h3 {
  margin: 0 0 0.5rem;
  font-size: 0.875rem;
}

.proof-img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: contain;
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.proof-img--sig {
  aspect-ratio: 16 / 7;
}

.system-dl {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem 1.25rem;
  margin: 0 0 1rem;
}

.system-dl dt {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--ink-muted);
}

.system-dl dd {
  margin: 0.125rem 0 0;
  font-weight: 600;
  overflow-wrap: anywhere;
}

@media (max-width: 959px) {
  .admin-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(300px, 86vw);
    z-index: 50;
    transform: translateX(-104%);
    transition: transform 180ms ease;
    overflow-y: auto;
    box-shadow: var(--shadow-elevated);
  }

  .admin-sidebar.is-open {
    transform: translateX(0);
  }
}

@media (min-width: 600px) {
  .choice-grid,
  .profile-grid,
  .proof-grid,
  .system-dl {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .page-shell {
    padding: 1.75rem 1.5rem 4rem;
  }

  .admin-main {
    padding: 1.5rem 1.5rem 4rem;
  }
}

@media (min-width: 960px) {
  .mobile-menu-trigger,
  .drawer-backdrop,
  .drawer-close-row {
    display: none !important;
  }

  .admin-layout {
    grid-template-columns: 264px minmax(0, 1fr);
  }

  .admin-main {
    padding: 2rem 2rem 4rem;
  }

  .qr-grid {
    grid-template-columns: 340px minmax(0, 1fr);
  }

  .branding-grid {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.9fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

@media print {
  body {
    background: #FFFFFF !important;
    color: #18181B !important;
  }

  .topbar,
  .admin-sidebar,
  .no-print,
  .admin-section-head,
  .summary-strip {
    display: none !important;
  }

  .admin-layout,
  .admin-main,
  .qr-grid {
    display: block !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .qr-poster-card {
    border: 2px solid #18181B !important;
    max-width: 480px;
    margin: 2rem auto !important;
    box-shadow: none !important;
  }
}
