/* ---------------------------------------------------------------
   outlet branding survey - design tokens + core layout
   sibling design system (mirror of project.bizplan-java.com)
   --------------------------------------------------------------- */

:root {
  /* palette matching sibling app */
  --navy:      #0F2A5F;
  --navy-dk:   #0A1F47;
  --navy-lt:   #1D3E7A;
  --bp:        #2563EB;   /* primary blue */
  --bp-dk:     #1D4ED8;
  --ink:       #0F172A;
  --ink-2:     #334155;
  --mute:      #64748B;
  --mute-lt:   #94A3B8;
  --line:      #E2E8F0;
  --line-2:    #CBD5E1;
  --bg:        #F8FAFC;
  --card:      #FFFFFF;

  /* semantic status colors (colorblind-safe assignment) */
  --sc-draft:      #94A3B8;   /* neutral grey */
  --sc-submitted:  #0F2A5F;   /* navy, in queue */
  --sc-in-review:  #F59E0B;   /* amber-yellow, pending action */
  --sc-approved:   #10B981;   /* teal-green */
  --sc-rejected:   #DC2626;   /* red */

  --sc-draft-bg:      #F1F5F9;
  --sc-submitted-bg:  #DBEAFE;
  --sc-in-review-bg:  #FEF3C7;
  --sc-approved-bg:   #D1FAE5;
  --sc-rejected-bg:   #FEE2E2;

  --radius-sm: 8px;
  --radius:    12px;
  --radius-lg: 16px;

  --sh-1: 0 1px 2px rgba(15,23,42,.05);
  --sh-2: 0 4px 12px rgba(15,23,42,.08);
  --sh-3: 0 10px 40px rgba(15,23,42,.07);

  --font-heading: 'Poppins', system-ui, sans-serif;
  --font-body:    'Prompt', system-ui, sans-serif;
}

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

html, body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  font-size: 16px;
  line-height: 1.5;
}

@supports(padding: max(0px)) {
  body {
    padding-bottom: max(0px, env(safe-area-inset-bottom));
  }
}

h1, h2, h3, h4 { font-family: var(--font-heading); font-weight: 700; letter-spacing: -.01em; margin: 0; }
h1 { font-size: 22px; }
h2 { font-size: 18px; }
h3 { font-size: 16px; }
p  { margin: 0; }

a { color: var(--bp); text-decoration: none; }
a:hover { text-decoration: underline; }

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

/* focus */
:focus-visible {
  outline: 2px solid var(--bp);
  outline-offset: 2px;
}

/* ---- utility ---- */
.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;
}
.hidden { display: none !important; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row   { display: flex; align-items: center; gap: 8px; }
.grow  { flex: 1 1 auto; }
.right { margin-left: auto; }

/* ---- login page ---- */
body.page-login {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background:
    #F8FAFC
    radial-gradient(1100px 480px at 50% -10%, rgba(37,99,235,.09), transparent 60%);
}

.lg-card {
  width: 100%; max-width: 384px;
  background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 34px 32px;
  box-shadow: var(--sh-3);
  animation: lgin .35s ease both;
}
@keyframes lgin { from { opacity:0; transform: translateY(8px); } to { opacity:1; transform:none; } }
@media (prefers-reduced-motion: reduce) { .lg-card { animation:none; } }

.lg-brand { display:flex; align-items:center; gap:10px; justify-content:center; margin-bottom:18px; }
.lg-brand-badge {
  width: 34px; height: 34px; border-radius: var(--radius-sm);
  background: var(--navy); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-heading); font-weight: 700; font-size: 14px;
}
.lg-brand b { font-family: var(--font-heading); font-weight: 700; font-size: 15px; }
.lg-brand span { display: block; font-size: 11px; color: var(--mute); font-weight: 500; }
.lg-title { font-size: 22px; margin: 2px 0 2px; }
.lg-sub { color: var(--mute); font-size: 13px; margin-bottom: 20px; }

.lg-label {
  font-family: var(--font-heading); font-size: 11px; font-weight: 600; letter-spacing: .03em;
  text-transform: uppercase; color: var(--mute); margin-bottom: 6px; display: block;
}

.lg-input {
  width: 100%; height: 46px;
  border: 1px solid var(--line); border-radius: 10px;
  padding: 0 14px; font-family: var(--font-body); font-size: 15px;
  color: var(--ink); background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
.lg-input::placeholder { color: var(--mute-lt); }
.lg-input:focus { outline: none; border-color: var(--bp); box-shadow: 0 0 0 3px rgba(37,99,235,.15); }
.lg-input.is-invalid { border-color: #DC2626; }
.lg-input.is-invalid:focus { box-shadow: 0 0 0 3px rgba(220,38,38,.13); }

.lg-field { margin-bottom: 16px; position: relative; }
.lg-invalid { display: none; align-items: center; gap: 5px; margin-top: 6px; font-size: 12px; color: #991B1B; }
.lg-invalid.show { display: flex; }

.lg-pwtoggle {
  position: absolute; right: 8px; top: 32px; height: 32px; width: 32px;
  border: none; background: none; color: var(--mute); border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
}
.lg-pwtoggle:hover { color: var(--ink); background: #F1F5F9; }

.lg-row { display:flex; align-items:center; justify-content:space-between; margin:2px 0 18px; }
.lg-forgot { font-size:13px; font-weight:600; color: var(--bp); }

.lg-btn {
  width: 100%; height: 46px; border: none; border-radius: 10px;
  background: var(--navy); color: #fff;
  font-family: var(--font-heading); font-weight: 600; font-size: 15px;
  transition: background .15s, transform .1s;
}
.lg-btn:hover { background: var(--navy-dk); }
.lg-btn:active { transform: translateY(1px); }
.lg-btn:disabled { opacity: .7; cursor: default; }

.lg-alert {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px; border-radius: 10px; font-size: 13px; margin-bottom: 16px;
}
.lg-alert.err { background: #FEE2E2; color: #991B1B; }
.lg-alert.ok  { background: #D1FAE5; color: #065F46; }
.lg-alert.info{ background: #DBEAFE; color: #1E40AF; }

.lg-foot { text-align: center; margin-top: 18px; font-size: 12px; color: var(--mute); line-height: 1.6; }

/* ---- app chrome (post-login) ---- */
.app-shell { min-height: 100vh; display: flex; flex-direction: column; background: var(--bg); }

.app-header {
  position: sticky; top: 0; z-index: 30;
  background: var(--navy); color: #fff;
  padding: 12px 16px;
  display: flex; align-items: center; gap: 12px;
  box-shadow: var(--sh-2);
}
.app-header .app-title {
  font-family: var(--font-heading); font-weight: 600; font-size: 15px;
  letter-spacing: -.01em;
}
.app-header .app-title small { display: block; font-size: 11px; color: rgba(255,255,255,.75); font-weight: 400; }
.app-header .app-menu-btn {
  width: 40px; height: 40px; border: none; background: transparent; color: #fff;
  border-radius: 8px; display: inline-flex; align-items: center; justify-content: center;
}
.app-header .app-menu-btn:hover { background: rgba(255,255,255,.08); }
.app-header .app-back-btn {
  width: 40px; height: 40px; border: none; background: transparent; color: #fff;
  border-radius: 8px; display: inline-flex; align-items: center; justify-content: center;
}
.app-header .app-back-btn:hover { background: rgba(255,255,255,.08); }
.app-header .app-user {
  margin-left: auto; display: flex; align-items: center; gap: 8px; font-size: 13px;
}
.app-header .app-user-name { display: none; }
@media (min-width: 640px) { .app-header .app-user-name { display: inline; } }

.app-main { flex: 1 1 auto; padding: 16px; padding-bottom: 96px; max-width: 1240px; width: 100%; margin: 0 auto; }
@media (min-width: 900px) { .app-main { padding: 24px; } }

/* ---- cards ---- */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; box-shadow: var(--sh-1);
}
.card-hd { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.card-hd h2 { font-size: 15px; color: var(--ink); }

/* ---- kpi counter cards ---- */
.kpi-grid {
  display: grid; gap: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.kpi-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 12px; box-shadow: var(--sh-1);
  display: flex; flex-direction: column; gap: 4px;
  min-height: 88px;
  cursor: pointer;
  transition: box-shadow .15s, border-color .15s;
  text-align: left;
  font: inherit;
  color: inherit;
  width: 100%;
}
.kpi-card:hover { border-color: var(--line-2); box-shadow: var(--sh-2); }
.kpi-card.active { border: 2px solid var(--bp); box-shadow: var(--sh-2); padding: 13px 11px; }
.kpi-label { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--mute); font-weight: 600; }
.kpi-value { font-family: var(--font-heading); font-weight: 700; font-size: 26px; color: var(--ink); font-variant-numeric: tabular-nums; }
.kpi-value.approved { color: var(--sc-approved); }
.kpi-value.pending  { color: var(--sc-in-review); }
.kpi-value.rejected { color: var(--sc-rejected); }
@media (min-width: 640px) { .kpi-value { font-size: 30px; } }

/* ---- primary cta (bottom fixed on wizard, big on dashboard) ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px;
  border-radius: 10px; border: 1px solid transparent;
  font-family: var(--font-heading); font-weight: 600; font-size: 15px;
  text-decoration: none; cursor: pointer;
  transition: background .15s, border-color .15s, color .15s, transform .1s;
}
.btn-primary { background: var(--navy); color: #fff; border-color: var(--navy); }
.btn-primary:hover { background: var(--navy-dk); border-color: var(--navy-dk); text-decoration: none; color: #fff; }
.btn-primary:disabled { opacity: .55; cursor: not-allowed; }
.btn-secondary { background: #fff; color: var(--ink); border-color: var(--line-2); }
.btn-secondary:hover { background: #F1F5F9; text-decoration: none; color: var(--ink); }
.btn-danger { background: #fff; color: var(--sc-rejected); border-color: #FCA5A5; }
.btn-danger:hover { background: var(--sc-rejected-bg); }
.btn-approve { background: var(--sc-approved); color: #fff; border-color: var(--sc-approved); }
.btn-approve:hover { background: #059669; border-color: #059669; color: #fff; }
.btn-lg { min-height: 52px; padding: 0 24px; font-size: 16px; }
.btn-block { display: flex; width: 100%; }
.btn-icon-only { min-height: 44px; min-width: 44px; padding: 0; }

/* ---- fixed bottom cta bar for wizard ---- */
.cta-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  background: #fff; border-top: 1px solid var(--line);
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -4px 16px rgba(15,23,42,.05);
}
.cta-bar .btn { width: 100%; }

/* ---- status chip (icon + text, colorblind-safe) ---- */
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  height: 26px; padding: 0 8px;
  border-radius: 999px;
  font-size: 11px; font-weight: 600; letter-spacing: .01em; text-transform: uppercase;
  border: 1px solid transparent;
  white-space: nowrap;
}
.chip svg { width: 12px; height: 12px; flex-shrink: 0; }
.chip.draft     { color: var(--sc-draft);     background: var(--sc-draft-bg);     border-color: transparent; }
.chip.submitted { color: var(--sc-submitted); background: var(--sc-submitted-bg); border-color: transparent; }
.chip.in_review { color: #92400E;             background: var(--sc-in-review-bg); border-color: transparent; }
.chip.approved  { color: #065F46;             background: var(--sc-approved-bg);  border-color: transparent; }
.chip.rejected  { color: #991B1B;             background: var(--sc-rejected-bg);  border-color: transparent; }

/* ---- submission list row (surveyor dashboard) ---- */
.sublist { display: flex; flex-direction: column; gap: 8px; }
.sub-row {
  display: flex; align-items: stretch; gap: 12px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 10px; text-decoration: none; color: inherit;
  position: relative; overflow: hidden;
  min-height: 88px;
  transition: border-color .15s, box-shadow .15s;
}
.sub-row:hover { border-color: var(--line-2); box-shadow: var(--sh-1); text-decoration: none; color: inherit; }
.sub-row .status-stripe {
  position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: var(--sc-draft);
}
.sub-row.draft     .status-stripe { background: var(--sc-draft); }
.sub-row.submitted .status-stripe { background: var(--sc-submitted); }
.sub-row.in_review .status-stripe { background: var(--sc-in-review); }
.sub-row.approved  .status-stripe { background: var(--sc-approved); }
.sub-row.rejected  .status-stripe { background: var(--sc-rejected); }
.sub-row .thumb {
  width: 72px; height: 72px; border-radius: 8px; background: #F1F5F9;
  flex-shrink: 0; margin-left: 4px;
  background-size: cover; background-position: center;
  display: flex; align-items: center; justify-content: center;
  color: var(--mute); font-size: 11px;
}
.sub-row .body { flex: 1 1 auto; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.sub-row .body .title { font-weight: 600; color: var(--ink); font-size: 14px; line-height: 1.3;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sub-row .body .meta { font-size: 12px; color: var(--mute); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.sub-row .body .footer-row { margin-top: auto; display: flex; align-items: center; gap: 8px; justify-content: space-between; }

/* ---- day-group header ---- */
.day-hd {
  font-family: var(--font-heading); font-weight: 600; font-size: 12px;
  text-transform: uppercase; letter-spacing: .05em; color: var(--mute);
  padding: 8px 4px 4px;
}

/* ---- wizard progress bar ---- */
.wizard-hd {
  padding: 12px 16px 4px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 56px; z-index: 20;
}
.wizard-hd .label { font-size: 13px; color: var(--ink-2); margin-bottom: 6px; }
.wizard-hd .bar { display: flex; gap: 4px; height: 6px; }
.wizard-hd .bar .seg { flex: 1 1 0; background: var(--line); border-radius: 3px; }
.wizard-hd .bar .seg.done { background: var(--sc-approved); }
.wizard-hd .bar .seg.active { background: var(--navy); }

/* ---- form controls ---- */
.form-group { margin-bottom: 14px; }
.form-label { font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 4px; display: block; }
.form-help  { font-size: 12px; color: var(--mute); margin-top: 4px; }
.form-input, .form-select, .form-textarea {
  width: 100%; min-height: 44px; border: 2px solid var(--line);
  border-radius: 10px; padding: 8px 14px;
  font-family: var(--font-body); font-size: 15px; color: var(--ink); background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
.form-textarea { min-height: 84px; padding: 10px 14px; }
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none; border-color: var(--bp); box-shadow: 0 0 0 3px rgba(37,99,235,.15);
}
.form-input.is-invalid { border-color: var(--sc-rejected); }
.form-input:disabled, .form-select:disabled, .form-textarea:disabled { background: #F8FAFC; color: var(--mute); cursor: not-allowed; }

/* radio card */
.radio-card {
  display: flex; align-items: center; gap: 14px;
  min-height: 72px; padding: 14px;
  border: 1px solid var(--line-2); border-radius: 10px;
  background: #fff; cursor: pointer;
  transition: border-color .15s, background .15s;
}
.radio-card:hover { border-color: var(--navy); }
.radio-card input { position: absolute; opacity: 0; pointer-events: none; }
.radio-card .rc-icon {
  width: 40px; height: 40px; border-radius: 8px; background: #F1F5F9;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--navy); flex-shrink: 0;
}
.radio-card .rc-body { flex: 1 1 auto; }
.radio-card .rc-body .rc-title { font-weight: 600; font-size: 14px; color: var(--ink); }
.radio-card .rc-body .rc-desc  { font-size: 12px; color: var(--mute); }
.radio-card .rc-check {
  width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line-2);
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.radio-card.selected { border: 2px solid var(--navy); background: rgba(15,42,95,.03); padding: 13px; }
.radio-card.selected .rc-check { border-color: var(--navy); background: var(--navy); color: #fff; }
.radio-card.selected .rc-check svg { display: block; }
.radio-card .rc-check svg { display: none; width: 12px; height: 12px; }

/* photo slot */
.photo-slot {
  border: 2px dashed var(--line-2); border-radius: var(--radius);
  aspect-ratio: 4 / 3; background: #F8FAFC;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; color: var(--mute);
  position: relative; overflow: hidden;
}
.photo-slot.filled { border-style: solid; border-color: var(--line); background: #fff; }
.photo-slot img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.photo-slot .slot-label { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.photo-slot .slot-helper { font-size: 11px; color: var(--mute); text-align: center; padding: 0 8px; }
.photo-slot .retake {
  position: absolute; top: 8px; right: 8px;
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(15,42,95,.9); color: #fff; border: none;
  display: none; align-items: center; justify-content: center;
}
.photo-slot.filled .retake { display: inline-flex; }
.photo-slot.center { border-color: var(--navy); border-width: 2px; }
.photo-slot.uploading::after {
  content: ''; position: absolute; inset: 0; background: rgba(15,42,95,.15);
  border-radius: inherit;
}
.photo-slot .upload-progress {
  position: absolute; left: 0; right: 0; bottom: 0; height: 4px;
  background: rgba(15,42,95,.15); overflow: hidden;
  display: none;
}
.photo-slot.uploading .upload-progress { display: block; }
.photo-slot .upload-progress > i {
  display: block; height: 100%; background: var(--bp); width: 0;
  transition: width .2s;
}
.photo-slot .slot-status {
  position: absolute; bottom: 8px; left: 8px;
  padding: 4px 8px; border-radius: 999px; font-size: 11px; font-weight: 600;
  background: rgba(255,255,255,.9);
}
.photo-slot .slot-status.ok { color: var(--sc-approved); }
.photo-slot .slot-status.err { color: var(--sc-rejected); }

.photo-triptych { display: flex; flex-direction: column; gap: 12px; }
@media (min-width: 900px) { .photo-triptych { flex-direction: row; align-items: flex-start; } }

/* ---- typeahead combobox ---- */
.outlet-picker {
  display: flex; align-items: center; gap: 10px;
  border: 2px solid var(--line); border-radius: 10px;
  padding: 10px 14px; background: #fff; min-height: 60px;
  cursor: pointer;
}
.outlet-picker:hover { border-color: var(--line-2); }
.outlet-picker.selected { border-color: var(--navy); }
.outlet-picker .op-content { flex: 1 1 auto; min-width: 0; }
.outlet-picker .op-placeholder { color: var(--mute); font-size: 14px; }
.outlet-picker .op-name { font-weight: 600; color: var(--ink); font-size: 14px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.outlet-picker .op-id { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; color: var(--mute); }

/* outlet search modal */
.outlet-modal {
  position: fixed; inset: 0; z-index: 60;
  display: none; flex-direction: column;
  background: #fff;
}
.outlet-modal.open { display: flex; }
.outlet-modal-hd { display: flex; align-items: center; gap: 8px; padding: 12px; border-bottom: 1px solid var(--line); }
.outlet-modal-hd input { flex: 1 1 auto; height: 44px; border: 1px solid var(--line); border-radius: 8px; padding: 0 14px; font-size: 15px; }
.outlet-modal-hd input:focus { outline: none; border-color: var(--bp); box-shadow: 0 0 0 3px rgba(37,99,235,.15); }
.outlet-modal-hd .close-btn { width: 44px; height: 44px; border: none; background: transparent; color: var(--mute); border-radius: 8px; }
.outlet-modal-hd .close-btn:hover { background: #F1F5F9; }
.outlet-modal .progress-line {
  height: 2px; background: transparent; overflow: hidden;
}
.outlet-modal .progress-line.loading > i {
  display: block; height: 100%; background: var(--navy);
  animation: progress-slide 1s infinite linear;
}
@keyframes progress-slide {
  0%   { margin-left: -30%; width: 30%; }
  100% { margin-left: 100%;  width: 30%; }
}
.outlet-modal-body { flex: 1 1 auto; overflow-y: auto; padding: 8px 0; }
.outlet-result {
  display: flex; flex-direction: column; gap: 2px;
  padding: 12px 16px; border-bottom: 1px solid var(--line);
  cursor: pointer; text-decoration: none; color: inherit;
  min-height: 72px;
}
.outlet-result:hover { background: #F8FAFC; }
.outlet-result .or-name { font-weight: 600; font-size: 15px; }
.outlet-result .or-id { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; color: var(--mute); }
.outlet-result .or-loc { font-size: 12px; color: var(--mute); }
.outlet-result mark { background: transparent; color: inherit; border-bottom: 2px solid #FBBF24; }
.outlet-modal .empty { padding: 40px 16px; text-align: center; color: var(--mute); }

/* app modal system (replaces native alert/confirm/prompt) */
.app-modal-overlay {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(15,23,42,.5);
  display: flex; align-items: flex-end; justify-content: center;
  opacity: 0; transition: opacity .15s ease;
}
.app-modal-overlay.open { opacity: 1; }
.app-modal-overlay.closing { opacity: 0; }
.app-modal {
  background: #fff; border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  width: 100%; max-width: 480px; max-height: 88vh;
  display: flex; flex-direction: column;
  transform: translateY(16px); transition: transform .15s ease;
  box-shadow: 0 -10px 40px rgba(15,23,42,.2);
}
.app-modal-overlay.open .app-modal { transform: translateY(0); }
.app-modal-hd {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 16px; background: var(--navy); color: #fff;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.app-modal-title { font-weight: 600; font-size: 16px; }
.app-modal-close {
  width: 32px; height: 32px; border: none; background: rgba(255,255,255,.12);
  color: #fff; border-radius: 8px; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.app-modal-close:hover { background: rgba(255,255,255,.22); }
.app-modal-danger {
  border-left: 3px solid var(--sc-rejected, #DC2626);
}
.app-modal-body { padding: 16px; overflow-y: auto; font-size: 14px; color: var(--ink); }
.app-modal-body p { margin: 0 0 12px; line-height: 1.5; }
.app-modal-body p:last-child { margin-bottom: 0; }
.app-modal-body .form-input, .app-modal-body input, .app-modal-body textarea, .app-modal-body select {
  width: 100%; border: 1px solid var(--line); border-radius: 8px;
  padding: 10px 12px; font-size: 14px; color: var(--ink); background: #fff;
}
.app-modal-body .form-input:focus, .app-modal-body input:focus, .app-modal-body textarea:focus, .app-modal-body select:focus {
  outline: none; border-color: var(--bp); box-shadow: 0 0 0 3px rgba(37,99,235,.15);
}
.app-modal-form .form-group { margin-bottom: 14px; }
.app-modal-form .form-group:last-child { margin-bottom: 0; }
.app-modal-err {
  font-size: 12px; color: var(--sc-rejected, #DC2626); margin-top: 4px; display: none;
}
.app-modal-err.show { display: block; }
.app-modal-ft {
  display: flex; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--line);
  padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
}
.app-modal-ft .btn { flex: 1 1 0; }
body.modal-open { overflow: hidden; }

@media (min-width: 640px) {
  .app-modal-overlay { align-items: center; }
  .app-modal { border-radius: var(--radius-lg); max-height: 80vh; transform: translateY(8px) scale(.98); }
  .app-modal-hd { border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
  .app-modal-overlay.open .app-modal { transform: translateY(0) scale(1); }
  .app-modal-ft .btn { flex: 0 0 auto; min-width: 100px; }
  .app-modal-ft { justify-content: flex-end; }
}

/* data pendukung read-only card */
.data-pendukung { background: #F8FAFC; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.data-pendukung dl { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; margin: 0; }
.data-pendukung dt { font-size: 11px; color: var(--mute); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; margin: 0; }
.data-pendukung dd { font-size: 13px; color: var(--ink); margin: 0; word-break: break-word; }

/* review drawer (admin) */
.review-drawer {
  position: fixed; top: 0; right: -100%; bottom: 0; width: 100%; max-width: 720px;
  background: #fff; border-left: 1px solid var(--line);
  box-shadow: -10px 0 40px rgba(15,23,42,.15);
  transition: right .25s ease; z-index: 50; overflow: hidden;
  display: flex; flex-direction: column;
}
.review-drawer.open { right: 0; }
.review-drawer .drawer-hd { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.review-drawer .drawer-body { flex: 1 1 auto; overflow-y: auto; padding: 16px; }
.review-drawer .drawer-ft { display: flex; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--line); background: #fff; }
.review-drawer .drawer-ft .btn { flex: 1 1 0; }

/* review triptych */
.triptych {
  display: grid; grid-template-columns: 1fr 1.5fr 1fr; gap: 8px;
  margin-bottom: 16px;
}
.triptych .tp-cell { position: relative; }
.triptych .tp-cell img { width: 100%; height: auto; border-radius: 8px; display: block; }
.triptych .tp-cell .tp-cap { font-size: 11px; color: var(--mute); margin-top: 4px; text-align: center; }
@media (max-width: 640px) {
  .triptych { grid-template-columns: 1fr; }
}

/* offline banner */
.offline-banner {
  position: sticky; top: 56px; z-index: 25;
  background: var(--sc-rejected-bg); color: #991B1B;
  padding: 6px 16px; font-size: 13px; text-align: center;
  display: none;
  border-bottom: 1px solid #FCA5A5;
}
.offline-banner.show { display: block; }

/* upload sheet (persistent bottom) */
.upload-sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 55;
  background: #fff; border-top: 1px solid var(--line);
  box-shadow: 0 -10px 40px rgba(15,23,42,.1);
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
  transform: translateY(100%); transition: transform .25s ease;
}
.upload-sheet.show { transform: translateY(0); }
.upload-sheet .row { justify-content: space-between; }
.upload-sheet .title { font-weight: 600; font-size: 14px; }
.upload-sheet .subtitle { font-size: 12px; color: var(--mute); }
.upload-sheet .progress {
  height: 4px; background: #F1F5F9; border-radius: 2px; overflow: hidden;
  margin-top: 8px;
}
.upload-sheet .progress > i { display: block; height: 100%; background: var(--navy); width: 0; transition: width .2s; }

/* ---- table (admin) ---- */
.data-table-wrap {
  overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
}
table.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th, .data-table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
.data-table thead th { background: #F8FAFC; font-family: var(--font-heading); font-size: 12px; color: var(--mute); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.data-table tbody tr:hover { background: #F8FAFC; cursor: pointer; }
.data-table tbody tr.selected { background: rgba(37,99,235,.08); }

/* filter chips */
.filter-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.filter-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px; background: #fff; border: 1px solid var(--line-2); border-radius: 999px;
  font-size: 12px; color: var(--ink-2);
}
.filter-chip button {
  border: none; background: transparent; color: var(--mute);
  width: 16px; height: 16px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
}
.filter-chip button:hover { background: #F1F5F9; color: var(--ink); }

/* ---- admin dashboard grid ---- */
.dash-grid { display: grid; gap: 16px; }
@media (min-width: 900px)  { .dash-grid.two   { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1200px) { .dash-grid.kpi4  { grid-template-columns: repeat(4, minmax(0,1fr)); } }

/* skeleton loaders */
.skeleton {
  background: linear-gradient(90deg, #F1F5F9 25%, #E2E8F0 50%, #F1F5F9 75%);
  background-size: 200% 100%;
  animation: sk 1.4s ease-in-out infinite;
  border-radius: 6px;
}
@keyframes sk { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.sk-line { height: 12px; margin: 6px 0; }
.sk-block { height: 200px; }

/* ---- toast ---- */
.toast-wrap { position: fixed; bottom: 20px; right: 20px; z-index: 70; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--navy); color: #fff; padding: 10px 14px; border-radius: 8px; font-size: 13px; box-shadow: var(--sh-2); max-width: 320px; }
.toast.err { background: var(--sc-rejected); }
.toast.ok  { background: var(--sc-approved); }

/* print */
@media print {
  .app-header, .cta-bar, .review-drawer, .upload-sheet, .filter-chips { display: none !important; }
  .card { box-shadow: none; border: 1px solid #000; }
  * { color: #000 !important; background: #fff !important; }
}
