/* css/style.css — lengkap, theme-aware, form-justified, date fixes */

/* -------------------------
   Theme tokens
   ------------------------- */
:root{
  --bg:#f3f4f6;
  --card:#fff;
  --muted:#6b7280;
  --accent:#2563eb;
  --ok:#16a34a;
  --gray:#6b7280;
  --input-border:#e5e7eb;
  --btn-bg:var(--accent);
  --form-section-bg: #f8fafc; /* subtle off-white */
  --form-section-border: rgba(2,6,23,0.06);
  --form-section-left: rgba(2,6,23,0.12);
  --section-1-left: #0ea5e9; /* sky-500 */
  --section-2-left: #8b5cf6; /* violet-500 */
  --section-3-left: #16a34a; /* green-500 */
  --section-4-left: #111827; /* strong neutral for confirm section */
  --section-5-left: #f59e0b; /* amber-500 for payment summary */
  --section-steps-left: #06b6d4; /* cyan-500 for Panduan Penghantaran */

  /* form text tokens (defaults) */
  --form-text: #111827;
  /* placeholder text: neutral grey for better contrast */
  --form-placeholder: #b8c2cf; /* lighter neutral grey for placeholders */

  /* additional tokens */
  --bg-page:#f3f4f6;
  --surface:#ffffff;
  --text-900:#0f172a;
  --text-muted:#6b7280;
  --accent-alt:#7c3aed;
  --success:#16a34a;
  --warning:#f59e0b;
  --danger:#ef4444;
  --input-focus-shadow: 0 6px 18px rgba(37,99,235,0.08);

  --radius-sm:6px;
  --radius:8px;
  --radius-pill:999px;
  --label-col-width: 200px; /* used to align form fields in the grid */

  --elev-1: 0 1px 3px rgba(2,6,23,0.06);
  --elev-2: 0 6px 18px rgba(2,6,23,0.08);

  --font-ui: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-label: var(--font-ui);
  /* explicit label color for consistent contrast */
  --label-color: #000000;
}

/* Skip-link: visible when focused for keyboard users */
.skip-link:focus { position: static !important; clip: auto !important; width: auto !important; height: auto !important; left: auto !important; top: auto !important; overflow: visible !important; padding: 8px 12px; background: #111827; color: #fff; border-radius: 6px; z-index: 9999; text-decoration: none; }
/* Defensive: ensure .hidden works even if Tailwind isn't loaded */
.hidden { display: none !important; }
html.dark{
  --bg:#0b1220;
  --card:#071024;
  --muted:#93a2bf;
  --accent:#7c3aed;
  --ok:#bbf7d0;
  --gray:#93a2bf;
  --input-border:#243449;
  --btn-bg:var(--accent);

  /* form text tokens for dark */
  --form-text: #e6eef8;
  --form-placeholder: #dddddd;
  --label-color: #000000;
}

/* -------------------------
   Reset / base
   ------------------------- */
*{box-sizing:border-box}
html,body{height:100%}
body{
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  background:var(--bg-page);
  margin:0;
  color:var(--form-text);
  padding:18px;
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
}
/* Utility for screen-reader only text */
.sr-only { position:absolute !important; width:1px !important; height:1px !important; padding:0 !important; margin:-1px !important; overflow:hidden !important; clip:rect(0,0,0,0) !important; white-space:nowrap !important; border:0 !important; }
.container{padding:18px 16px;max-width:1100px;margin:0 auto}
.card{
  background:var(--surface);
  border-radius:var(--radius);
  padding:16px;
  box-shadow:var(--elev-1);
  box-sizing:border-box;
}

/* Fancy submit buttons (animated check) */
.fancy-submit {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 160px;
  min-height: 44px;
  padding: 10px 14px;
  border-radius: 24px;
  border: 2px solid var(--accent, #2563eb);
  background: #fff;
  color: var(--accent, #2563eb);
  font-weight: 700;
  line-height: 1.1;
  transition: all 0.32s cubic-bezier(0.13, 0.71, 0.57, 1.29);
  box-shadow: 0 10px 25px rgba(37, 99, 235, 0.18);
}
.btn.fancy-submit { background: #fff !important; color: var(--accent, #2563eb) !important; border-color: var(--accent, #2563eb) !important; box-shadow: 0 10px 25px rgba(37, 99, 235, 0.18) !important; }
.fancy-submit--primary {
  background: linear-gradient(90deg, #2563eb, #1d4ed8);
  border-color: #1d4ed8;
  color: #fff;
  box-shadow: 0 10px 25px rgba(37, 99, 235, 0.28);
}
.btn.fancy-submit--primary { background: linear-gradient(90deg, #2563eb, #1d4ed8) !important; border-color: #1d4ed8 !important; color: #fff !important; box-shadow: 0 10px 25px rgba(37, 99, 235, 0.28) !important; }
.fancy-submit--ghost {
  background: #fff;
  color: var(--accent, #2563eb);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.08);
}
.btn-ghost.fancy-submit--ghost { background: #fff !important; color: var(--accent, #2563eb) !important; border: 1px solid var(--input-border, #e5e7eb) !important; box-shadow: 0 6px 16px rgba(37, 99, 235, 0.08) !important; }
.fancy-submit.btn-disabled,
.fancy-submit[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none !important;
}
.fancy-submit::before {
  content: "";
  position: absolute;
  inset: 0;
  background: #57dab2;
  border-radius: 24px;
  transform: scale(0);
  opacity: 0;
  transition: all 0.35s cubic-bezier(0.13, 0.71, 0.57, 1.29);
}
.fancy-submit__label {
  position: relative;
  z-index: 1;
  transition: transform 0.3s, opacity 0.3s;
  text-align: center;
}
.fancy-submit__check {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 20px;
  height: 20px;
  transform: rotate(-45deg);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.13, 0.71, 0.57, 1.29);
}
.fancy-submit__check span {
  position: absolute;
  display: block;
  background: #fff;
  border-radius: 2px;
}
.fancy-submit__check span:nth-child(1) {
  width: 4px;
  height: 12px;
  top: 4px;
  left: 9px;
}
.fancy-submit__check span:nth-child(2) {
  width: 4px;
  height: 6px;
  top: 12px;
  left: 3px;
  transform: rotate(-55deg);
}
.fancy-submit.is-active {
  width: 46px;
  min-width: 46px;
  border-radius: 50%;
  border-color: #57dab2;
  color: #fff;
  box-shadow: 0 10px 25px rgba(87, 218, 178, 0.35);
}
.fancy-submit.is-active::before {
  transform: scale(1);
  opacity: 1;
}
.fancy-submit.is-active .fancy-submit__label {
  opacity: 0;
  transform: scale(0.65) rotate(8deg);
}
.fancy-submit.is-active .fancy-submit__check {
  opacity: 1;
  transform: rotate(0deg);
}

/* Loader-style submit button (Langkah 1) */
.btn.loader-btn {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 190px;
  min-height: 48px;
  padding: 10px 18px;
  border-radius: 999px;
  border: 2px solid var(--accent, #2563eb) !important;
  background: #fff !important;
  color: var(--accent, #2563eb) !important;
  font-weight: 800;
  letter-spacing: 0.25px;
  box-shadow: 0 10px 22px rgba(37, 99, 235, 0.18) !important;
  transition: all 0.25s ease, width 0.25s ease;
}
.btn.loader-btn:hover {
  background: linear-gradient(120deg, #2563eb, #1d4ed8) !important;
  color: #fff !important;
  box-shadow: 0 12px 28px rgba(37, 99, 235, 0.24) !important;
}
.btn.loader-btn:active { letter-spacing: 0.6px; transform: translateY(0px) scale(0.99); }
.btn.loader-btn .loader-label { transition: opacity 0.2s ease, transform 0.2s ease; }
.btn.loader-btn .loader-complete {
  position: absolute;
  inset: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  letter-spacing: 0.2px;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.24s ease, transform 0.24s ease;
  color: inherit;
}
.btn.loader-btn .loader-check {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%) scale(0.7);
  transition: opacity 0.2s ease, transform 0.2s ease;
  color: inherit;
  margin-left: 8px;
}
.btn-ghost.loader-btn {
  background: #fff !important;
  color: var(--accent, #2563eb) !important;
  border: 1px solid var(--input-border, #e5e7eb) !important;
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.12) !important;
}
.btn-ghost.loader-btn:hover {
  background: linear-gradient(120deg, #2563eb, #1d4ed8) !important;
  color: #fff !important;
  box-shadow: 0 12px 26px rgba(37, 99, 235, 0.2) !important;
}
.btn-ghost.loader-btn.loader-btn--ghost {
  border-color: var(--input-border, #e5e7eb) !important;
}
.btn.loader-btn.is-loading {
  width: 56px;
  background: #fff !important;
  color: transparent !important;
  border-color: rgba(37, 99, 235, 0.35) !important;
  border-left-color: #2563eb !important;
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.12) !important;
  animation: loader-spin 0.9s linear infinite;
}
.btn.loader-btn.is-loading .loader-label { opacity: 0; transform: translateY(6px); }
.btn.loader-btn.is-success {
  width: 190px;
  background: linear-gradient(135deg, #16a34a, #22c55e) !important;
  border-color: #16a34a !important;
  color: #fff !important;
  box-shadow: 0 12px 26px rgba(34, 197, 94, 0.32) !important;
  animation: none;
}
.btn.loader-btn.is-success .loader-label { opacity: 0; transform: translateY(6px); }
.btn.loader-btn.is-success .loader-check { opacity: 1; transform: translateY(-50%) scale(1); }
.btn.loader-btn.is-success .loader-complete { opacity: 1; transform: translateY(0); }

/* Payment summary card (align typography with other sections) */
.payment-summary {
  padding: 12px;
  margin-top: 8px;
  line-height: 1.55;
  font-size: 14px;
  color: var(--text-900, #111827);
}
.payment-summary * {
  font-size: 14px;
  line-height: 1.55;
}
.payment-summary .muted-small {
  font-size: 14px;
  color: var(--muted, #6b7280);
}
.payment-summary .small,
.payment-summary .muted,
.payment-summary .muted-small,
.payment-summary .arrears-payment-list li {
  font-size: 14px;
  line-height: 1.55;
}

.pay-head {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px 10px;
  align-items: center;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--input-border);
}

.pay-title {
  font-size: 14px;
  font-weight: 800;
  color: #111;
}

.pay-unit {
  grid-column: 1 / 2;
  font-size: 14px;
  color: #111;
}

.pay-category {
  grid-column: 2 / 3;
  justify-self: end;
  font-size: 12px;
  font-weight: 700;
  color: #1f2937;
  border: 1px solid #9ca3af;
  border-radius: 999px;
  padding: 2px 8px;
  background: #f3f4f6;
}

.pay-grid {
  display: grid;
  gap: 6px;
  margin-bottom: 10px;
}

.pay-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  font-size: 13px;
}

.pay-row span {
  color: #4b5563;
}

.pay-row strong {
  color: #111;
  text-align: right;
}

.pay-breakdown {
  border: 1px solid var(--input-border);
  border-radius: 10px;
  padding: 8px 10px;
  background: #fff;
  margin-bottom: 10px;
}

.pay-breakdown-title {
  font-size: 12px;
  font-weight: 700;
  color: #374151;
  margin-bottom: 6px;
}

.pay-daily-list {
  margin: 0;
  padding-left: 18px;
}

.pay-daily-list li {
  margin-bottom: 3px;
}

.pay-plate-day-list {
  list-style: none;
  margin: 4px 0 0;
  padding-left: 0;
}

.pay-plate-day-list li {
  margin: 2px 0;
}

.pay-total-wrap {
  border: 1px solid #d1d5db;
  border-radius: 10px;
  padding: 8px 10px;
  background: #f9fafb;
  display: grid;
  gap: 6px;
  margin-top: 6px;
}

.pay-total-details {
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #ffffff;
}

.pay-total-details summary {
  cursor: pointer;
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 700;
  color: #1f2937;
  list-style: none;
}

.pay-total-details summary::-webkit-details-marker {
  display: none;
}

.pay-total-details summary::after {
  content: "";
  float: right;
  margin-top: 2px;
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform 180ms ease;
}

.pay-total-details[open] summary::after {
  transform: rotate(-135deg);
}

.pay-total-details-body {
  border-top: 1px solid #e5e7eb;
  padding: 8px 10px;
  display: grid;
  gap: 6px;
}

.pay-charge-box {
  border: 1px solid var(--input-border);
  border-radius: 9px;
  background: var(--surface);
  overflow: hidden;
}

.pay-charge-box summary {
  cursor: pointer;
  list-style: none;
  padding: 9px 10px;
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 10px;
  background: var(--form-section-bg);
}

.pay-charge-box summary::-webkit-details-marker {
  display: none;
}

.pay-charge-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-900);
}

.pay-charge-amount {
  font-size: 14px;
  font-weight: 800;
  color: var(--accent);
  justify-self: end;
}

.pay-charge-box summary::after {
  content: "";
  justify-self: end;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--text-muted);
  border-bottom: 2px solid var(--text-muted);
  transform: rotate(45deg);
  transition: transform 170ms ease;
  margin-left: 6px;
  flex: 0 0 auto;
}

.pay-charge-box[open] summary::after {
  transform: rotate(-135deg);
}

.pay-charge-box[open] summary {
  background: #eef4ff;
}

.pay-charge-body {
  border-top: 1px solid var(--input-border);
  padding: 8px 10px;
  display: grid;
  gap: 6px;
  background: var(--surface);
}

.pay-total-line,
.pay-note-line {
  font-size: 13px;
  color: #111;
}

.pay-equation-block {
  border: 1px solid #cfd8e3;
  border-radius: 8px;
  background: #fcfdff;
  padding: 6px 8px;
  display: grid;
  gap: 0;
}

.pay-eq-row {
  display: grid;
  grid-template-columns: 1fr 20px auto;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #111111;
  padding: 6px 2px;
}

.pay-eq-row + .pay-eq-row {
  border-top: 1px dashed #dbe3ec;
}

.pay-eq-label {
  color: #374151;
}

.pay-eq-op {
  text-align: center;
  font-weight: 900;
  font-size: 15px;
  color: #111;
  line-height: 1;
}

.pay-eq-amount {
  font-weight: 800;
  letter-spacing: 0.1px;
}

.pay-mini-details {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
}

.pay-mini-details summary {
  cursor: pointer;
  padding: 7px 9px;
  font-size: 12px;
  font-weight: 700;
  color: #1f2937;
  list-style: none;
}

.pay-mini-details summary::-webkit-details-marker {
  display: none;
}

.pay-mini-details summary::after {
  content: "";
  float: right;
  margin-top: 3px;
  width: 7px;
  height: 7px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform 160ms ease;
}

.pay-mini-details[open] summary::after {
  transform: rotate(-135deg);
}

.pay-mini-body {
  border-top: 1px solid #eef2f7;
  padding: 7px 9px;
  display: grid;
  gap: 6px;
}

.pay-grand-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  font-size: 16px;
  font-weight: 800;
  color: #0f172a;
  border: 1px solid #111827;
  border-radius: 8px;
  background: #eef6ff;
  padding: 8px 10px;
}

.pay-grand-total strong {
  margin-left: auto;
  text-align: right;
}

.pay-collection-details {
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #ffffff;
}

.pay-collection-details summary {
  cursor: pointer;
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 700;
  color: #1f2937;
  list-style: none;
}

.pay-collection-details summary::-webkit-details-marker {
  display: none;
}

.pay-collection-details summary::after {
  content: "";
  float: right;
  margin-top: 3px;
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform 160ms ease;
}

.pay-collection-details[open] summary::after {
  transform: rotate(-135deg);
}

.pay-collection-body {
  border-top: 1px solid #e5e7eb;
  padding: 8px 10px;
  display: grid;
  gap: 8px;
}

.pay-collection-total-note {
  font-size: 12px;
  color: #111827;
}

.pay-collection-grid {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.pay-collection-qr {
  display: grid;
  gap: 6px;
  justify-items: start;
}

.pay-qr-preview-trigger {
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0;
  cursor: zoom-in;
  border-radius: 8px;
}

.pay-qr-image {
  width: 120px;
  height: 120px;
  object-fit: contain;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #f8fafc;
}

.pay-qr-download {
  width: 100%;
  text-align: center;
  padding: 6px 8px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
}

.pay-collection-bank {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.pay-collection-bank div {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 6px 8px;
  align-items: start;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 7px 8px;
  background: #f8fafc;
}

.pay-collection-bank span {
  font-size: 11px;
  color: #6b7280;
  font-weight: 700;
  line-height: 1.25;
}

.pay-collection-bank strong {
  font-size: 13px;
  color: #111827;
  line-height: 1.35;
  overflow-wrap: break-word;
  word-break: normal;
}

.pay-qr-overlay {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: grid;
  place-items: center;
}

.pay-qr-overlay.hidden {
  display: none;
}

.pay-qr-overlay-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, 0.72);
}

.pay-qr-overlay-dialog {
  position: relative;
  z-index: 1;
  max-width: min(92vw, 560px);
  max-height: 92vh;
  padding: 14px;
  border-radius: 12px;
  background: #ffffff;
  border: 1px solid #d1d5db;
  box-shadow: 0 18px 40px rgba(2, 6, 23, 0.35);
}

.pay-qr-overlay-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid #d1d5db;
  background: #ffffff;
  color: #111827;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}

.pay-qr-overlay-image {
  display: block;
  width: min(82vw, 520px);
  height: auto;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 8px;
}

@media (max-width: 520px) {
  .pay-collection-grid {
    grid-template-columns: 1fr;
  }

  .pay-collection-bank div {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .pay-collection-qr {
    justify-items: start;
  }
}

@media (max-width: 760px) {
  .pay-collection-grid {
    grid-template-columns: 1fr;
  }

  .pay-collection-bank div {
    grid-template-columns: 1fr;
    gap: 3px;
  }
}

.pay-alert {
  font-size: 13px;
  color: #374151;
  padding: 8px 10px;
  border: 1px solid var(--input-border);
  border-radius: 8px;
  background: #fff;
}

.payment-update-note {
  margin-top: 8px;
  border: 1px solid #b91c1c;
  border-radius: 10px;
  background: #fff5f5;
  overflow: hidden;
}

.payment-update-note summary {
  cursor: pointer;
  list-style: none;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 700;
  color: #111111;
  display: flex;
  align-items: center;
  gap: 8px;
}

.payment-update-note summary::-webkit-details-marker {
  display: none;
}

.payment-update-note summary::after {
  content: "";
  margin-left: auto;
  width: 9px;
  height: 9px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform 180ms ease;
}

.payment-update-note[open] summary::after {
  transform: rotate(-135deg);
}

.payment-update-note[open] summary {
  border-bottom: 1px solid rgba(185, 28, 28, 0.25);
}

.payment-update-note-body {
  padding: 10px 12px 12px;
  color: #111111;
  font-size: 12px;
  font-weight: 700;
  font-style: italic;
  line-height: 1.55;
  text-align: justify;
}

.payment-update-note-body p {
  margin: 0 0 10px;
}

.payment-update-note-body p:last-child {
  margin-bottom: 0;
}

.payment-update-note-body ul {
  margin: 0 0 10px 18px;
  padding: 0;
}

.payment-update-note-body li {
  margin: 0 0 4px;
}

/* Registration steps box (below Pengesahan) */
.registration-steps {
  padding: 12px;
  margin: 0;
  border: 1px solid var(--input-border, #e5e7eb);
  border-radius: 10px;
  background: var(--surface, #f9fafb);
  line-height: 1.5;
  font-size: 14px;
  color: var(--text-900, #111827);
  box-shadow: var(--elev-1, 0 6px 20px rgba(0,0,0,0.04));
}

@keyframes loader-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Section card visual for forms (subtle grouping) */
.card .section-title{
  font-size:16px;
  font-weight:700;
  margin:0 0 10px 0;
  color:var(--text-900);
}
/* Parking week view styles */
.parking-week-table { border-collapse: collapse; margin-top: 8px; }
.parking-week-table td { vertical-align: top; padding: 12px; border-top: 1px solid var(--input-border); }
.pw-date-cell { width: 220px; min-width:160px; max-width:260px; }
.pw-date-cell .pw-day-header { font-weight:700; }
.pw-items-cell .pw-vehicle-list { display:flex; flex-direction:column; gap:6px; }
.pw-vehicle-item { padding:6px 8px; border-radius:8px; background:var(--surface); border:1px solid rgba(0,0,0,0.04); display:flex; align-items:center; justify-content:space-between; gap:12px; cursor:pointer; position:relative; }
.pw-vehicle-item .dup-icon { display:none !important; }
.pw-vehicle-duplicate { position:relative; padding-left:8px; }
/* Ensure duplicate items do not have a colored background; keep only the left border accent */
.pw-vehicle-item.pw-vehicle-duplicate { background: var(--surface) !important; }
.pw-vehicle-duplicate::before { display:none !important; }
.pw-vehicle-duplicate[data-dup-count]:after { content: attr(data-dup-count); display:inline-block; font-size:11px; margin-left:8px; color:var(--muted); background:transparent; border-radius:8px; padding:0 4px; vertical-align:middle; }
.pw-vehicle-duplicate.pw-dup-long[data-dup-count]:after { color:#b91c1c; font-weight:700; background:rgba(185,28,28,0.08); }

/* color mapping will be applied inline at render-time via style.background or border-color; fallback */
.pw-vehicle-duplicate { border-left: 4px solid var(--dup-color, rgba(0,0,0,0.06)); }
.pw-vehicle-duplicate .dup-icon { display:inline-block; width:14px; text-align:center; }
/* duplicate submission (same-data) - visually distinct from plate-across-days duplicates */
/* mark submission duplicates (same-data) visually, but do not show the right-side exclamation icon */
.pw-submission-duplicate { border-left: 4px solid var(--warning); position:relative; }
/* show a small exclamation icon pinned on the right of the box */

.pw-vehicle-list.multi-cols { display:grid; grid-template-columns:repeat(5, 1fr); gap:8px; }
/* On small screens, fall back to 2 columns for readability */
@media (max-width: 700px) { .pw-vehicle-list.multi-cols { grid-template-columns: repeat(2, 1fr); } }

/* left area: dot, rounded badge, plate text */
.pw-vehicle-left { display:flex; align-items:center; gap:8px; min-width:0; }
.pw-left-dot { display:none !important; }
.pw-veh-badge { display:none !important; }
.pw-plate-text { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; font-weight:700; }
.pw-vehicle-item:hover { background: rgba(37,99,235,0.04); }

/* Make parking vehicle item text denser specifically in the Parking page (web page mode) */
#pageParking .pw-vehicle-item { font-size: 12px; }

/* Confirmation modal tweaks */
#confirmModal .card { max-width: 560px; }
#confirmModal .small.muted { margin-top: 8px; }
#confirmModal .btn-ghost { background: transparent; }
#confirmModal .btn { min-width: 96px; }
#confirmModal .btn.danger { background: #dc2626; color: #fff; border-color: transparent; }

/* Emphasize each pw-vehicle-item as a visible box when viewing the Parking page */
#pageParking .pw-vehicle-item {
  border: 1px solid #000 !important;
  background: var(--surface);
  color: var(--form-text);
  box-shadow: none;
}

/* Stack date column above items column for the weekly parking view when used as a dedicated page
   We render each table row as a block so the date appears above and the item column flows below.
   This keeps the layout tidy regardless of how many columns or grid styles are used for items. */
#pageParking .parking-week-table tr {
  display: block;
  margin-bottom: 12px;
  border-bottom: none;
  /* render each week-row as a single visible card/box */
  border: 1px solid #000;
  border-radius: 10px;
  padding: 10px;
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(250,250,250,0.98));
}
#pageParking .parking-week-table td {
  display: block;
  width: 100%;
  padding: 10px 12px;
  border-top: none;
}
#pageParking .pw-date-cell {
  /* visually separate the date block so it stands out */
  background: #E6F4FF; /* calming blue */
  border: 1px solid var(--input-border);
  border-radius: 8px;
  padding: 8px 12px;
  margin-bottom: 6px;
  /* explicitly widen the date block in page view to make it more prominent */
  width: 724px; min-width: 724px; max-width: 724px;
  /* on page view make the date-block slightly bolder so it reads like the box title */
  box-shadow: none;
}
#pageParking .pw-date-cell {
  /* visually separate the date block so it stands out; make wider for page mode */
  width: 724px; min-width: 724px; max-width: 724px;
  background: #E6F4FF; /* calming blue — chosen */
  color: #0F172A; /* dark slate for readable contrast */
  border: 1px solid var(--input-border);
  border-radius: 8px;
  padding: 8px 12px;
  margin-bottom: 6px;
  /* on page view make the date-block slightly bolder so it reads like the box title */
  box-shadow: none;
}
#pageParking .pw-items-cell {
  padding: 0 12px 12px 12px;
}
#pageParking .pw-vehicle-item.pw-week-duplicate {
  background: linear-gradient(180deg, rgba(251, 113, 133, 0.1), rgba(255, 255, 255, 0.95));
  border: 1px solid rgba(251, 113, 133, 0.4);
  border-radius: 10px;
}

#pageParking .pw-vehicle-item.pw-consecutive {
  border-left: 6px solid rgba(14, 165, 233, 0.55);
  background: linear-gradient(180deg, rgba(14,165,233,0.08), rgba(255,255,255,0.96));
}

#pageParking .pw-vehicle-item.pw-duplicate:not(.pw-week-duplicate) {
  /* if it's a duplicate for submission reasons only, highlight with amber left border */
  border-left: 6px solid rgba(245,158,11,0.6);
  padding-left: 8px;
}



/* -------------------------
   Typography & small utilities
   ------------------------- */
h1,h2,h3{font-weight:700;color:var(--text-900)}
h1{margin-top:0; font-size:20px}
h2{font-size:16px}
h3{font-size:14px}
label{font-family:var(--font-ui);font-weight:600;font-size:14px;color:var(--label-color)}
.small{font-size:10px;color:var(--muted)}
.muted{color:var(--muted)}
.muted-small{font-size:13px;color:var(--text-muted)}
.helper{font-size:12px;color:var(--text-muted)}

/* -------------------------
  Controls: inputs, selects, buttons
  ------------------------- */
input, select, textarea, button {
  font-family:var(--font-ui);
  font-size:15px;
  color:var(--text-900);
  box-sizing:border-box;

  padding:8px;
  border-radius:6px;
  border:1px solid var(--input-border);
  background:var(--card);
  -webkit-text-fill-color: var(--form-text);
}
input, select, textarea {
  width:100%;
  min-height:44px;
  padding:10px 12px;
  border-radius:var(--radius);
  border:1px solid var(--input-border);
  background:var(--surface);
  transition: border-color .12s, box-shadow .12s;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: var(--input-focus-shadow);
}
/* input error state (visual) */
.input-error {
  border-color: var(--danger) !important;
  box-shadow: 0 8px 28px rgba(239,68,68,0.12) !important;
}
.input-error:focus {
  box-shadow: 0 8px 28px rgba(239,68,68,0.18) !important;
  outline: 3px solid rgba(239,68,68,0.08);
}

/* small status box next to unit input */
.unit-status {
  width:28px; height:28px; min-width:28px; display:inline-flex; align-items:center; justify-content:center;
  border-radius:6px; font-weight:800; color:#fff; font-size:13px;
  background: transparent; border:1px solid transparent; cursor:default;
}
.unit-status svg { width: 14px; height: 14px; display:block; fill: currentColor; }
.unit-status.ok { background: #16a34a; border-color: rgba(16,163,74,0.12); }
.unit-status.err { background: #ef4444; border-color: rgba(239,68,68,0.12); }
.unit-status.hidden { display:none !important; }


button{
  cursor:pointer;
  border:0;
  border-radius:8px;
  padding:10px 14px;
  font-weight:700;
  min-height:44px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  background:var(--btn-bg) !important;
  color:#fff !important;
}
.btn, button.primary{ background:var(--accent) !important; color:#fff !important; }
.btn-ghost, button.ghost{ background:transparent !important; color:var(--text-900) !important; border:1px solid var(--input-border) !important; }
button.btn-edit{ background:var(--warning) !important; color:#fff !important; border:0 !important; }
.actions .btn,
.actions .btn-ghost{
  padding:6px 8px;
  min-height:30px;
  font-size:10px !important;
  line-height:1.2;
  border-radius:8px;
}

/* Re-assert fancy button skins after legacy .btn/.btn-ghost rules */
.btn.fancy-submit { background: #fff !important; color: var(--accent, #2563eb) !important; border-color: var(--accent, #2563eb) !important; box-shadow: 0 10px 25px rgba(37, 99, 235, 0.18) !important; }
.btn.fancy-submit--primary { background: linear-gradient(120deg, #4f46e5 0%, #06b6d4 55%, #22c55e 100%) !important; border-color: #1d4ed8 !important; color: #fff !important; box-shadow: 0 12px 28px rgba(6, 182, 212, 0.26) !important; }
.btn-ghost.fancy-submit--ghost { background: #fff !important; color: var(--accent, #2563eb) !important; border: 1px solid var(--input-border, #e5e7eb) !important; box-shadow: 0 8px 18px rgba(37, 99, 235, 0.12) !important; }
.fancy-submit.btn-disabled,
.fancy-submit[disabled] {
  box-shadow: none !important;
}

/* Unit category badge used in registration table */
.unit-cat-badge { display:inline-block; padding:6px 8px; border-radius:8px; background:linear-gradient(180deg, #f3f4f6, #fff); border:1px solid var(--input-border); font-weight:700; font-size:10px; }

/* Arrears-specific badge colors */
.unit-cat-badge.unit-cat-arrears-2 { background: #fbbf24; color: #000; border-color: rgba(0,0,0,0.06); }
.unit-cat-badge.unit-cat-arrears-3 { background: #f472b6; color: #fff; border-color: rgba(0,0,0,0.06); }
.unit-cat-badge.unit-cat-kategori-1 { background: #10b981; color: #fff; border-color: rgba(0,0,0,0.06); }

/* Admin parking panel styles */
#parkingAdmin { margin-top:8px; }
#parkingAdmin input[type="file"] { background:transparent; padding:6px; border:1px dashed var(--input-border); }
#unitsListArea table { width:100%; border-collapse:collapse; }
#unitsListArea table td, #unitsListArea table th { padding:6px; border-bottom:1px solid var(--input-border); }
#csvPreviewArea pre { white-space:pre-wrap; font-size:13px; }
button[disabled]{ opacity:.6; cursor:not-allowed; }

/* -------------------------
   Layout helpers
   ------------------------- */
.row{display:flex;gap:8px;align-items:center}
.table{ width:100%; border-collapse:collapse; font-size:14px; }
.table th, .table td { padding:10px; border-bottom:1px solid var(--input-border); text-align:left; vertical-align:middle; }
.table th:nth-child(5), .table td:nth-child(5) { text-align:center; }
.table th:last-child, .table td:last-child { text-align:center; }
.table td .actions{ align-items:center; }
.actions{ display:flex; flex-direction:column; gap:6px; align-items:flex-start; justify-content:flex-start; }
.registration-table{ table-layout:fixed; }
.registration-table th, .registration-table td{ width:10%; word-break:break-word; }
.timestamp-cell { vertical-align:top; white-space:nowrap; width:120px; min-width:100px; padding-right:8px; }
.timestamp-cell .ts-date{ display:block; font-weight:700; font-style:italic; font-size:11px; line-height:1.1; color:var(--muted); }
.timestamp-cell .ts-time{ display:block; font-weight:700; font-style:italic; font-size:11px; color:var(--muted); line-height:1.1; }
.arrears-cell{ font-size:11px; line-height:1.2; }
.arrears-cell .line-strong{ font-weight:700; }
.arrears-cell .line-muted{ color:var(--muted); }
.payment-block{ font-size:11px; line-height:1.2; margin-top:4px; }
.payment-block .line-strong{ font-weight:700; }
.eta-etd-cell{ text-align:center; }
.eta-etd-cell .eta-pill,
.eta-etd-cell .etd-pill{ display:inline-block; min-width:88px; padding:6px 10px; border-radius:10px; font-weight:700; font-size:11px; line-height:1.1; border:1px solid var(--input-border); margin:2px 0; }
.eta-etd-cell .eta-pill{ background:linear-gradient(180deg, rgba(34,197,94,0.12), rgba(34,197,94,0.06)); color:#000; }
.eta-etd-cell .etd-pill{ background:linear-gradient(180deg, rgba(59,130,246,0.12), rgba(59,130,246,0.06)); color:#000; }
.table-wrap{ overflow-x:auto; -webkit-overflow-scrolling:touch; }

/* Parking report should use the same readable sizing as the registration list */
.parking-report { font-size: 14px; }
.parking-report .small { font-size: 13px; }
.parking-report .chip { font-size: 13px; }
.parking-report .pw-vehicle-item, .parking-report .pw-vehicle-list .pw-vehicle-item { font-size: 14px; padding: 8px 10px; }

/* compact lot list (single column) */
.lot-list { display:flex; flex-wrap:wrap; gap:8px; margin-top:8px; }
.lot-chip { padding:8px 10px; border-radius:8px; border:1px solid var(--input-border); background:var(--card); cursor:pointer; font-weight:700; }
.lot-chip.filled { border-color: rgba(0,0,0,0.06); background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(250,250,250,0.98)); }

/* 3-column -> responsive fallback: two columns on medium, one on small */
@media (max-width: 900px) {
  .pw-vehicle-list.multi-cols { grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 520px) {
  .pw-vehicle-list.multi-cols { grid-template-columns: 1fr; }
}

/* small devices: reduce padding */
@media (max-width:640px){
  .table th, .table td { padding:8px; font-size:13px; }
}

/* -------------------------
   Status pills, toast, misc
   ------------------------- */
.status-pill{ padding:6px 8px; border-radius:8px; font-weight:700; font-size:10px; display:inline-block; border:1px solid var(--input-border); background:linear-gradient(180deg, #f3f4f6, #fff); }
.pill-pending{ background:#fef3c7;color:#92400e; border-color: rgba(146,64,14,0.18); }
.pill-in{ background:#bbf7d0;color:#065f46; border-color: rgba(6,95,70,0.18); }
.pill-out{ background:#e5e7eb;color:#374151; border-color: rgba(55,65,81,0.18); }
.msg{ padding:8px; border-radius:6px; background:#ecfccb; color:#064e3b; }
.login-box{ max-width:360px; }

/* conflict highlight */
tr.conflict td{ background: rgba(255,243,205,0.6) }

/* -------------------------
   Form justify / alignment
   ------------------------- */
form .form-row{
  display: grid !important;
  grid-template-columns: 200px 1fr !important;
  gap: 6px 12px !important;
  align-items: center !important;
  margin-bottom: 6px !important;
}
form .form-row.span-2{
  grid-column: 1 / -1 !important;
  grid-template-columns: 200px 1fr !important;
}
@media (max-width: 640px){
  form .form-row{ grid-template-columns: 1fr !important; }
  form .form-row label{ justify-self: start !important; margin-bottom: 4px !important; }
}
form .form-row label{
  font-family: var(--label-font) !important;
  font-weight:700;
  font-size:14px;
  color:var(--label-color);
  justify-self: end;
  padding-right: 6px;
}
form .form-row label.required::after{
  content: " *";
  color: #ef4444;
  margin-left: 4px;
  font-weight:700;
}
form .form-row input,
form .form-row select,
form .form-row textarea,
form .form-row input[type=date],
form .form-row select.form-control,
form .form-row input.form-control{
  width:100% !important;
  min-height:42px !important;
  padding:8px 10px !important;
  border-radius:8px !important;
  border:1px solid var(--input-border) !important;
  background:var(--card) !important;
  color:var(--form-text) !important;
  box-sizing:border-box !important;
  font-family:Inter, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif !important;
  transition: border-color .12s, box-shadow .12s;
}
form .form-row input:focus,
form .form-row select:focus,
form .form-row textarea:focus{
  outline:none !important;
  border-color:var(--accent) !important;
  box-shadow:0 6px 18px rgba(37,99,235,0.08) !important;
}
form .form-row .field-note{
  grid-column: 2 / 3;
  font-size:12px;
  color:var(--muted);
  margin-top:4px;
}
.form-actions{
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 0 12px;
  align-items: start;
}
.form-actions .actions{ justify-self: start; display:flex; flex-direction: column; gap:8px; align-items: stretch; width: 100%; }
.form-actions .actions > div { width: 100%; }
.form-actions .actions .loader-btn { width: 100%; min-width: 0; }
.form-actions .actions button { width: 100%; }

.unit-update-info {
  padding: 8px 10px;
  border-radius: 10px;
  margin-bottom: 8px;
  border: 1px solid var(--input-border);
  background: rgba(148,163,184,0.06);
}

/* Inline two-column helper */
.inline-two { display: grid !important; grid-template-columns: 1fr 1fr !important; gap:8px !important; align-items:start !important; }
.inline-two .form-row {
  display: grid !important;
  grid-template-columns: 200px 1fr !important;
  gap: 6px 12px !important;
  align-items: center !important;
  margin: 0 0 6px 0 !important;
}
.inline-two .form-row label { justify-self: end; grid-column: 1 / 2; padding-right: 6px; margin: 0; }
.inline-two .form-row input,
.inline-two .form-row select,
.inline-two .form-row .autocomplete-wrap { grid-column: 2 / 3; width: 100% !important; box-sizing: border-box !important; }
.inline-two .autocomplete-wrap { width: 100% !important; display: block !important; grid-column: 2 / 3; }
@media (max-width: 720px) {
  .inline-two { grid-template-columns: 1fr !important; }
  .inline-two .form-row { grid-template-columns: 1fr !important; }
  .inline-two .form-row label { justify-self: start; margin-bottom: 6px; grid-column: 1 / -1; }
  .inline-two .form-row input, .inline-two .form-row select { grid-column: 1 / -1; }
}

/* -------------------------
   Theme-aware form control colors (overrides)
   ------------------------- */
input, select, textarea {
  color: var(--text-900) !important; /* solid color for user-entered values */
  background: var(--card) !important;
  -webkit-text-fill-color: var(--text-900) !important;
  opacity: 1 !important;
}
input::placeholder,
textarea::placeholder {
  color: var(--form-placeholder) !important;
  -webkit-text-fill-color: var(--form-placeholder) !important;
  font-style: italic !important;
  opacity: 1 !important;
}
form .form-row select, select {
  color: var(--form-text) !important;
  background: var(--card) !important;
  -webkit-appearance: menulist-button;
}
option { color: var(--form-text) !important; background: var(--card) !important; }

/* Date input fixes */
input[type="date"] {
  color: var(--form-text) !important;
  background: var(--card) !important;
  border: 1px solid var(--input-border) !important;
  min-height: 42px;
  padding: 8px 10px;
  border-radius: 8px;
  -webkit-text-fill-color: var(--form-text) !important;
  opacity: 1 !important;
}
input[type="date"]::placeholder { color: var(--form-placeholder) !important; }
input[type="date"]::-webkit-datetime-edit { color: var(--form-text) !important; background: transparent !important; }
input[type="date"]::-webkit-datetime-edit-text,
input[type="date"]::-webkit-datetime-edit-day-field,
input[type="date"]::-webkit-datetime-edit-month-field,
input[type="date"]::-webkit-datetime-edit-year-field {
  color: var(--form-text) !important; -webkit-text-fill-color: var(--form-text) !important;
}
input[type="date"]::-webkit-calendar-picker-indicator { filter: none !important; opacity: 1 !important; }
.flatpickr-calendar, .react-datepicker-popper { z-index: 9999 !important; }
.flatpickr-calendar, .flatpickr-day { background: var(--card) !important; color: var(--form-text) !important; }

input, select, textarea { transform: none !important; }
:root { --form-placeholder: #b8c2cf; }
/* dark mode placeholder: slightly lighter but still neutral */
/* dark mode placeholder: use the same neutral grey so contrast is stable */
html.dark { --form-placeholder: #DDDDDD; }

input[placeholder]::placeholder,
textarea[placeholder]::placeholder { color: var(--form-placeholder) !important; font-style: italic !important; opacity: 1 !important; }
input[placeholder]::-webkit-input-placeholder,
textarea[placeholder]::-webkit-input-placeholder { color: var(--form-placeholder) !important; font-style: italic !important; -webkit-text-fill-color: var(--form-placeholder) !important; }
input[placeholder]::-moz-placeholder,
textarea[placeholder]::-moz-placeholder { color: var(--form-placeholder) !important; font-style: italic !important; }
input[placeholder]:-ms-input-placeholder,
textarea[placeholder]:-ms-input-placeholder { color: var(--form-placeholder) !important; font-style: italic !important; }
input[placeholder]:placeholder-shown,
textarea[placeholder]:placeholder-shown { color: var(--form-placeholder) !important; font-style: italic !important; }
select option[value=""] { color: var(--form-placeholder) !important; font-style: italic !important; }
select:invalid, select:not([value]) { color: var(--form-placeholder) !important; font-style: italic !important; }

/* Safety: ensure dynamically added inputs inherit styles */
.vehicle-list input[placeholder],
form input[placeholder],
form textarea[placeholder] {
  font-style: italic !important;
  color: var(--form-placeholder) !important;
}

/* Mobile-first stacking for forms */
@media (max-width: 640px) {
  form .form-row { display: flex !important; flex-direction: column !important; align-items: stretch !important; gap: 6px !important; margin-bottom: 12px !important; }
  form .form-row label { font-weight: 600; font-size: 14px; color: var(--label-color); margin-bottom: 4px; }
  form .form-row input, form .form-row select, form .form-row textarea { width: 100% !important; min-height: 44px !important; padding: 10px 12px !important; border-radius: 8px !important; font-size: 14px !important; box-sizing: border-box !important; }
  form .form-row .field-note { font-size: 12px; color: var(--muted); margin-top: 4px; }

  #vehicleList .vehicle-row { align-items: stretch !important; }
  #vehicleList .vehicle-row input { min-height: 44px !important; }
  #vehicleList .vehicle-row button { padding: 10px 12px !important; border-radius: 8px !important; }

  .form-actions { display: flex !important; flex-direction: column !important; align-items: center !important; gap: 12px !important; margin-top: 16px !important; }
  .form-actions .actions { display: flex !important; flex-direction: column !important; width: 100% !important; gap: 8px !important; }
  .form-actions .actions button { width: 100% !important; min-height: 44px !important; font-size: 16px !important; font-weight: 600 !important; border-radius: 8px !important; }
  #statusMsg { text-align: center !important; margin-top: 4px !important; }
}

/* Mobile / touch friendly adjustments */
@media (max-width: 720px) {
  .card { padding: 20px; border-radius: 12px; }
  h1, h2, h3 { letter-spacing: -0.01em; }
  .form-row { gap: 10px !important; }
  input, select, textarea { padding: 12px 14px; border-radius: 10px; }
  label { font-size: 14px; }
  .field-note { font-size: 13px; }
}

/* Section separators for better visual grouping */
  /* Use a thin hairline accent for section grouping; color will be per-section via --section-* variables */
  .form-section { padding: 14px; border-radius: 12px; background: var(--form-section-bg); margin-bottom: 18px; box-shadow: var(--elev-1); border: 1px solid var(--form-section-border); }
  .form-section { border-left: 0.5px solid var(--form-section-left); padding-left: 12px; }

  /* per-section colors (hairline) */
  .form-section.section-1 { border-left-color: var(--section-1-left); }
  .form-section.section-2 { border-left-color: var(--section-2-left); }
  .form-section.section-3 { border-left-color: var(--section-3-left); }
  .form-section.section-4 { border-left-color: var(--section-4-left); }
  .form-section.section-5 { border-left-color: var(--section-5-left); }
  .form-section.section-steps { border-left-color: var(--section-steps-left); }
.form-section + .form-section { margin-top: 8px; }
.form-section-header { display:flex; align-items:center; gap:8px; margin-bottom:8px; }
.form-section-header .icon { width:36px; height:36px; border-radius:8px; display:inline-flex; align-items:center; justify-content:center; background:transparent; color:var(--accent); font-size:18px; }
.form-section.section-1 .form-section-header .icon { background: linear-gradient(180deg, rgba(14,165,233,0.12), rgba(14,165,233,0.06)); color: var(--section-1-left); }
.form-section.section-2 .form-section-header .icon { background: linear-gradient(180deg, rgba(139,92,246,0.12), rgba(139,92,246,0.06)); color: var(--section-2-left); }
.form-section.section-3 .form-section-header .icon { background: linear-gradient(180deg, rgba(22,163,74,0.12), rgba(22,163,74,0.06)); color: var(--section-3-left); }
.form-section.section-4 .form-section-header .icon { background: linear-gradient(180deg, rgba(17,24,39,0.12), rgba(17,24,39,0.06)); color: var(--section-4-left); }
.form-section.section-5 .form-section-header .icon { background: linear-gradient(180deg, rgba(245,158,11,0.16), rgba(245,158,11,0.08)); color: var(--section-5-left); }
.form-section.section-steps .form-section-header .icon { background: linear-gradient(180deg, rgba(6,182,212,0.16), rgba(6,182,212,0.08)); color: var(--section-steps-left); }
.form-section-header { padding: 8px 10px; border-radius: 8px; }
.form-section.section-1 .section-title { color: var(--section-1-left); }
.form-section.section-2 .section-title { color: var(--section-2-left); }
.form-section.section-3 .section-title { color: var(--section-3-left); }
.form-section.section-4 .section-title { color: var(--section-4-left); }
.form-section.section-5 .section-title { color: var(--section-5-left); }
.form-section.section-steps .section-title { color: var(--section-steps-left); }

/* Context note inside a form section (used for Bahagian 2) */
.section-note {
  margin: 0 0 12px 0;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--input-border);
  border-left: 4px solid var(--section-2-left);
  background: rgba(139, 92, 246, 0.06);
  color: var(--text-900);
  font-size: 13px;
  line-height: 1.55;
}
.section-note strong { color: var(--section-2-left); }
.section-note-list { margin: 6px 0 0 0; padding-left: 18px; }
.section-note-list li { margin: 2px 0; }

/* Clock card (date/time header) */
#visitorClockWrap.clock-card {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  padding: 8px 10px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(59,130,246,0.08), rgba(14,165,233,0.08));
  border: 1px solid rgba(59,130,246,0.12);
  box-shadow: var(--elev-1, 0 6px 20px rgba(0,0,0,0.04));
  min-width: 140px;
}
#visitorClockWrap .clock-date {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-900, #0f172a);
  letter-spacing: 0.2px;
}
#visitorClockWrap .clock-time {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-900, #0f172a);
}

/* Autofill the autocomplete suggestion items to be easier to tap */
.autocomplete-item { padding: 12px 14px; font-size: 15px; }
.autocomplete-header { padding: 8px 10px; font-weight:700; color:var(--muted); }

/* Toast styles: floating and non-blocking */
.toast, .msg { padding: 12px 18px; border-radius: 12px; box-shadow: 0 8px 30px rgba(6,6,15,0.12); display:flex; align-items:center; gap:12px; font-weight:700; min-width: 220px; max-width: min(92%, 640px); }
.toast.ok, .msg.ok{ background:var(--ok); color:#042e17; }
.toast.err, .msg.err{ background:var(--danger); color:#fff; }
.toast { transition: transform .22s ease, opacity .22s ease; padding-right: 10px; }
.toast.show { opacity: 1; transform: translateY(0); }
.toast.fade, .msg.fade { opacity: 0; transform: translateY(20px); }

/* toast container: stack messages so they don't overlap */
#toastContainer { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); display:flex; flex-direction: column-reverse; gap:10px; align-items:center; z-index:24000; pointer-events: none; width:100%; max-width:960px; padding: 0 12px; box-sizing: border-box; }
#toastContainer .msg, #toastContainer .toast { pointer-events: auto; }
/* toast content and close button */
.toast .toast-content { flex: 1; padding-right: 6px; }
.toast .toast-close { background: transparent; border: 0; color: inherit; font-size: 20px; padding: 6px 8px; cursor: pointer; line-height: 1; border-radius: 8px; }
.toast .toast-close:focus { outline: none; box-shadow: 0 0 0 3px rgba(37,99,235,0.12); }

/* Vehicle row improvements */
.vehicle-primary-group {
  margin-top: 8px;
  margin-bottom: 10px;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid #4ade80;
  background: #dcfce7;
  box-shadow: none;
}

.vehicle-primary-group .form-row {
  margin-bottom: 8px !important;
}

.vehicle-primary-group .form-row:last-child {
  margin-bottom: 0 !important;
}

.vehicle-primary-date-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.vehicle-primary-group #etaWrap,
.vehicle-primary-group #etdWrap {
  display: grid;
  gap: 4px;
}

.vehicle-primary-group #etdNote {
  margin-top: 6px;
}

@media (max-width: 720px) {
  .vehicle-primary-date-wrap {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

#vehicleSingleWrap {
  margin-top: 0;
  margin-bottom: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

#vehicleSingleWrap label {
  justify-self: end !important;
  font-size: 13px;
  font-weight: 800;
  color: #111;
}

#vehicleSingleWrap input {
  background: #fff !important;
}

#vehicleList .vehicle-row {
  margin-top: 8px;
  margin-bottom: 8px;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid #9ca3af;
  background: #e5e7eb;
  box-shadow: none;
  display: grid;
  gap: 8px;
}

.vehicle-visitor-meta {
  margin-top: 6px;
  margin-bottom: 8px;
  padding: 8px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #f8fafc;
  font-size: 12px;
  color: #0f172a;
  display: grid;
  gap: 4px;
}
.vehicle-row-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.vehicle-row-heading {
  font-size: 13px;
  font-weight: 800;
  color: #111;
}
.vehicle-field-group {
  display: grid;
  gap: 4px;
}
.vehicle-field-label {
  font-size: 11px;
  font-weight: 700;
  color: #111;
}
#vehicleList .vehicle-input,
#vehicleList .vehicle-extra-start,
#vehicleList .vehicle-extra-end,
#vehicleList .vehicle-visitor-name-input,
#vehicleList .vehicle-visitor-phone-input {
  background: #fff !important;
}
.vehicle-remove { background: #f8fafc; border: 1px solid #cbd5e1; color: #111; min-width: 36px; padding: 8px; font-size:18px; border-radius:8px; }
.vehicle-remove:hover { background: #eef2f7; }
.vehicle-extra-date-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  width: 100%;
}

.vehicle-date-sync {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  box-sizing: border-box;
  padding: 8px 10px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #eff6ff;
  font-size: 12px;
  font-weight: 600;
  color: #111827;
  cursor: pointer;
}

form .form-row .vehicle-date-sync .vehicle-date-sync-check {
  position: absolute !important;
  opacity: 0 !important;
  width: 1px !important;
  height: 1px !important;
  min-height: 1px !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  clip: rect(0, 0, 0, 0) !important;
  clip-path: inset(50%) !important;
  overflow: hidden !important;
  white-space: nowrap !important;
  pointer-events: none !important;
}

.vehicle-date-sync-switch {
  display: inline-block;
  width: 36px;
  height: 20px;
  border-radius: 999px;
  background: #cbd5e1;
  position: relative;
  flex: 0 0 36px;
  margin: 0;
  vertical-align: middle;
  align-self: center;
  transition: background 180ms ease;
}

.vehicle-date-sync-switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
  transition: transform 180ms ease;
}

.vehicle-date-sync-check:checked + .vehicle-date-sync-switch {
  background: #2563eb;
}

.vehicle-date-sync-check:checked + .vehicle-date-sync-switch::after {
  transform: translateX(16px);
}

.vehicle-date-sync-check:focus-visible + .vehicle-date-sync-switch {
  outline: 3px solid rgba(37,99,235,0.22);
  outline-offset: 2px;
}

.vehicle-date-sync-text {
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  font-weight: 700;
  line-height: 20px;
  color: #111827;
  white-space: nowrap;
  margin: 0;
}

.vehicle-date-sync.is-locked {
  opacity: 0.78;
  cursor: not-allowed;
}

@media (max-width: 720px) {
  .vehicle-date-sync {
    gap: 6px;
    padding: 7px 8px;
  }

  .vehicle-date-sync-switch {
    width: 32px;
    height: 18px;
    flex: 0 0 32px;
  }

  .vehicle-date-sync-switch::after {
    top: 1px;
    left: 1px;
    width: 14px;
    height: 14px;
  }

  .vehicle-date-sync-check:checked + .vehicle-date-sync-switch::after {
    transform: translateX(14px);
  }

  .vehicle-date-sync-text {
    font-size: 11px;
    line-height: 18px;
  }
}
.vehicle-extra-date-wrap input {
  min-height: 40px !important;
  font-size: 13px !important;
}

/* Make primary actions more obvious on mobile */
@media (max-width: 720px) {
  .card { padding: 20px; border-radius: 12px; }
  .btn-ghost { border-radius: 12px; padding: 12px; }
  .form-row { gap: 10px !important; }
  .vehicle-extra-date-wrap { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }

/* Typography: Inter for body and labels + monospace for technical fields */
:root{
  --ui-font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --label-font: var(--font-ui);
  --mono-font: ui-monospace, SFMono-Regular, Menlo, Monaco, "Roboto Mono", "Courier New", monospace;
}
html, body {
  font-family: var(--ui-font) !important;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
form .form-row label {
  font-family: var(--font-ui) !important;
  font-weight: 600 !important;
  letter-spacing: -0.01em;
  color: var(--label-color) !important;
}
form .form-row input,
form .form-row select,
form .form-row textarea {
  font-family: var(--ui-font) !important;
  font-weight: 400 !important;
  font-size: 14px !important;
  color: var(--form-text) !important;
}
#vehicleNo,
#vehicleList .vehicle-input,
input.vehicle-mono,
input.mono {
  font-family: var(--mono-font) !important;
  letter-spacing: 0.02em !important;
  font-size: 14px !important;
  font-variant-numeric: tabular-nums !important;
}
.force-mono { font-family: var(--mono-font) !important; font-variant-numeric: tabular-nums !important; }

/* Standardise form-row visuals */
.form-row input,
.form-row select,
.form-row .autocomplete-wrap input {
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--input-border, #e5e7eb);
  background: var(--card, #fff);
  font: inherit;
  margin: 0;
}
.autocomplete-wrap { width: 100%; display: block; box-sizing: border-box; }
.autocomplete-wrap input { width: 100%; }
.form-row label { display: block; margin-bottom: 6px; }
.form-row { align-items: start; }
.autocomplete-list { left: 0; right: 0; width: auto; max-width: 100%; box-sizing: border-box; }
@media (max-width: 720px) { .inline-two .form-row { flex: 1 1 100%; } }

/* Accessibility & focus outlines */
:focus{ outline: none; }
button:focus, input:focus, select:focus, textarea:focus{
  box-shadow: var(--input-focus-shadow);
  outline: 3px solid rgba(37,99,235,0.08);
  outline-offset: 2px;
}

/* Sidebar & nav */
.sidebar { width:100%; }
.nav-item { display:block; text-align:left; padding:8px 10px; border-radius:8px; border:1px solid transparent; background:transparent; color:var(--text-900); font-weight:600; transition: background .12s, color .12s; }
.nav-item:active { transform: translateY(1px); }
.nav-item.active{ background:var(--accent); color:#fff; border-color:var(--accent); }

/* KPI chips */
.kpi .chip { background:var(--surface); border:1px solid var(--input-border); padding:8px 10px; border-radius:8px; font-weight:700; }

/* WhatsApp tel link */
.tel-link{ color:var(--accent); text-decoration:none; font-weight:600; }
.tel-link:hover{ text-decoration:underline; }

/* Modal polished */
.modal{ position:fixed; inset:0; display:flex; align-items:center; justify-content:center; z-index:12000; background: rgba(6,8,15,0.35); }
.modal .card{ width:460px; max-width:96%; box-shadow:var(--elev-2); padding:18px; max-height:90vh; overflow:auto; }
.modal.hidden{ display:none !important; }
.modal input, .modal select{ min-height:44px; }

/* Sticky action bar helper for mobile */
@media (max-width:600px){
  .sticky-action-bar{
    position:fixed; left:0; right:0; bottom:0; padding:12px;
    background:linear-gradient(180deg, transparent, rgba(243,244,246,0.95));
    box-shadow:0 -4px 24px rgba(2,6,23,0.08);
  }
  .sticky-action-bar .actions{ display:flex; gap:8px; }
}

.form-progress {
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid var(--input-border);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(37,99,235,0.04), rgba(37,99,235,0.01));
}
.form-progress-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.form-progress-track {
  width: 100%;
  height: 8px;
  background: rgba(148,163,184,0.28);
  border-radius: 999px;
  overflow: hidden;
}
.form-progress-bar {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #0ea5e9, #2563eb);
  transition: width 220ms ease;
}

.repeat-mode-wrap {
  width: 100%;
}

.repeat-mode-control {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
  min-height: 30px;
  position: relative;
  border-radius: 10px;
  border: 1px solid var(--input-border);
  background: rgba(37,99,235,0.03);
}

.repeat-mode-main {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
  cursor: pointer;
}

.repeat-mode-control input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

.repeat-mode-switch {
  width: 36px;
  height: 20px;
  border-radius: 999px;
  background: #cbd5e1;
  position: relative;
  flex: 0 0 36px;
  transition: background 180ms ease;
}

.repeat-mode-switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
  transition: transform 180ms ease;
}

.repeat-mode-control input[type="checkbox"]:checked + .repeat-mode-switch {
  background: #2563eb;
}

.repeat-mode-control input[type="checkbox"]:checked + .repeat-mode-switch::after {
  transform: translateX(16px);
}

.repeat-mode-control input[type="checkbox"]:focus-visible + .repeat-mode-switch {
  outline: 3px solid rgba(37,99,235,0.22);
  outline-offset: 2px;
}

.repeat-mode-text {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 0;
}

.repeat-mode-text strong {
  font-size: 13px;
  line-height: 1.15;
  font-weight: 600;
}

.repeat-mode-text .muted-small {
  display: none;
}

.repeat-mode-info-btn {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid var(--input-border);
  background: #fff;
  color: var(--muted, #6b7280);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.repeat-mode-info-btn:focus-visible {
  outline: 3px solid rgba(37,99,235,0.22);
  outline-offset: 2px;
}

.repeat-mode-hint {
  display: none;
}

.repeat-mode-control:hover .repeat-mode-hint,
.repeat-mode-control:focus-within .repeat-mode-hint,
.repeat-mode-wrap.is-hint-open .repeat-mode-hint {
  display: block;
  position: absolute;
  left: 8px;
  top: calc(100% + 6px);
  z-index: 30;
  max-width: 300px;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid var(--input-border);
  background: #ffffff;
  color: var(--muted, #6b7280);
  line-height: 1.25;
  box-shadow: 0 6px 16px rgba(2,6,23,0.12);
}

.repeat-mode-hint[hidden] {
  display: none !important;
}

@media (max-width: 640px) {
  .form-progress-head {
    flex-direction: column;
    align-items: flex-start;
  }
  .repeat-mode-control {
    align-items: center;
  }
  .form-actions {
    position: static;
    margin-top: 14px;
    padding: 0;
    border-radius: 0;
    background: transparent;
    backdrop-filter: none;
    box-shadow: none;
  }
}

/* -------------------------
   Autocomplete normalisation
   ------------------------- */
.inline-two .form-row .autocomplete-wrap { display:block !important; width:100% !important; box-sizing:border-box !important; }
.inline-two .form-row .autocomplete-wrap input,
.form-row .autocomplete-wrap input {
  width:100% !important;
  min-height:44px !important;
  padding:10px 12px !important;
  border-radius:8px !important;
  border:1px solid var(--input-border) !important;
  background:var(--card) !important;
  color:var(--form-text) !important;
  font-family:var(--ui-font, Inter) !important;
  font-size:14px !important;
  box-sizing:border-box !important;
}
.autocomplete-wrap[style] { width: auto !important; }
.inline-two .form-row .field-note,
.form .form-row .field-note { grid-column: 2 / 3; margin-top: 4px; }
.autocomplete-list[hidden] { display: none !important; }
.input-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, "Roboto Mono", monospace !important; letter-spacing:0.02em; }
@media (max-width: 640px) {
  .inline-two .form-row, form .form-row { display: flex !important; flex-direction: column !important; align-items: stretch !important; gap: 6px !important; }
  .inline-two .form-row label, form .form-row label { justify-self: start !important; display: block !important; margin-bottom: 6px !important; }
  .inline-two .form-row .autocomplete-wrap, .form-row .autocomplete-wrap { display: block !important; width: 100% !important; box-sizing: border-box !important; margin: 0 !important; }
  .inline-two .form-row .autocomplete-wrap input, .form-row .autocomplete-wrap input {
    width: 100% !important; min-height: 44px !important; padding: 10px 12px !important; border-radius: 8px !important; border: 1px solid var(--input-border) !important; background: var(--card) !important; color: var(--form-text) !important; font-family: var(--ui-font, Inter) !important; font-size: 14px !important; box-sizing: border-box !important; margin: 0 !important;
  }
  .inline-two .form-row .field-note, .form-row .field-note { grid-column: auto !important; margin-top: 6px !important; }
  .autocomplete-wrap[style] { width: 100% !important; display:block !important; }
}

/* Home gallery cards */
.home-header { display:flex; justify-content:space-between; align-items:center; gap:12px; margin-bottom:12px; }
.brand { display:flex; gap:12px; align-items:center; }
.site-title { margin:0; font-size:18px; font-weight:700; }
.site-sub { margin:0; font-size:13px; color:var(--muted); }
.grid-cards { display:grid; gap:14px; grid-template-columns: 1fr; margin: 8px 0 16px 0; }
@media (min-width:720px) { .grid-cards { grid-template-columns: 1fr 1fr; } }
@media (min-width:1100px) { .grid-cards { grid-template-columns: repeat(3,1fr); } }
.img-card {
  display:block; background:var(--card); border-radius:10px; overflow:hidden; text-decoration:none; color:inherit; box-shadow:0 6px 18px rgba(2,6,23,0.06);
  transition: transform .12s ease, box-shadow .12s ease; border:1px solid transparent; min-height:72px;
}
.img-wrap { width:100%; aspect-ratio:16/9; overflow:hidden; background:linear-gradient(180deg, rgba(0,0,0,0.03), rgba(0,0,0,0.02)); }
.img-wrap img { width:100%; height:100%; object-fit:cover; display:block; transition: transform .22s ease; }
.img-meta { padding:12px 14px; }
.img-title { margin:0 0 4px 0; font-size:15px; font-weight:700; color:var(--form-text); }
.img-sub { margin:0; font-size:13px; color:var(--muted); }
.img-card:hover, .img-card:focus { transform: translateY(-4px); box-shadow:0 12px 36px rgba(2,6,23,0.10); border-color: rgba(37,99,235,0.08); }
.img-card:focus-visible { outline:3px solid rgba(37,99,235,0.12); outline-offset:2px; }
.img-card:hover .img-wrap img, .img-card:focus .img-wrap img { transform:scale(1.03); }
.img-card, .img-card .img-meta { min-height:56px; padding-bottom: 8px; }
.img-meta .link-hint { margin-left:8px; font-size:13px; color:var(--accent); }
.img-wrap { background:var(--muted); }

/* -------------------------
   Kategori badge untuk table
   ------------------------- */
.cat-badge {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:6px 8px;
  border-radius:8px;
  font-size:10px;
  font-weight:700;
  color:#0f172a;
  text-transform:none;
  border:1px solid rgba(0,0,0,0.08);
  line-height:1.2;
  box-shadow:0 1px 3px rgba(15,23,42,0.12);
  background:#e5e7eb;
  min-height:28px;
  min-width:96px;
  max-width:110px;
  text-align:center;
  white-space:nowrap;
  user-select:none;
  -webkit-user-select:none;
}
.cat-pelawat { background:#2563eb !important; color:#fff !important; }        /* biru */
.cat-kontraktor { background:#f59e0b !important; color:#000 !important; }     /* oren */

/* Arrears category label shown in unit notice modal */
.arrears-category {
  color: #b91c1c; /* solid red */
  font-weight: 700;
  display: inline-block;
}

/* Payment breakdown inside arrears modal */
.arrears-payment { margin-top: 8px; }
.arrears-payment-list { margin-left: 16px; margin-top: 6px; }
.arrears-payment-total { margin-top: 8px; font-weight: 700; }

/* Memo category colors */
.memo-cat-1 { color: #0ea5a0; font-weight:700; } /* teal/green */
.memo-cat-2 { color: #b45309; font-weight:700; } /* amber/yellow-ish */
.memo-cat-3 { color: #be185d; font-weight:700; } /* pink/magenta */

/* small text in parking report */
.parking-report .small { font-size: 10px; }
.cat-pindah { background:#ef4444 !important; color:#fff !important; }         /* merah */
.cat-pelawat-khas { background:#6d28d9 !important; color:#fff !important; }   /* ungu */
.cat-penghantaran { background:#10b981 !important; color:#fff !important; }   /* hijau */
.cat-lain { background:#6b7280 !important; color:#fff !important; }           /* kelabu fallback */
.td-category-small { color:var(--muted); font-size:13px; font-weight:600; }
.cat-stack { display:flex; flex-direction:column; gap:4px; align-items:flex-start; }
.subcat-badge { display:inline-flex; align-items:center; justify-content:center; padding:6px 8px; border-radius:8px; font-size:10px !important; font-weight:600; line-height:1.2; background:#e0f2fe; color:#075985; border:1px solid #bfdbfe; box-shadow:0 1px 3px rgba(9,30,66,0.12); min-height:28px; min-width:96px; max-width:110px; text-align:center; white-space:nowrap; }

/* -------------------------
   Parking report styles
   ------------------------- */
.card-tight { padding: 16px !important; border-radius: 10px !important; }

.parking-header {
  display:flex; gap:12px; align-items:flex-end; flex-wrap:wrap; margin-bottom:12px;
}
.parking-header .ph-item { display:flex; flex-direction:column; gap:4px; }
.parking-header .ph-value { font-weight:800; font-size:15px; }
.parking-header .ph-grow { flex:1; min-width:220px; }
.parking-header input { min-height:42px; }



/* Visitor form mobile-first refinement */
.visitor-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 12px;
}

.visitor-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.page-title {
  margin: 6px 0 0 0;
  line-height: 1.2;
}

.page-subtitle {
  margin: 6px 0 0 0;
}

.section-title {
  margin: 0;
}

.section-spacing-top {
  margin-top: 12px;
}

.section-divider {
  border: none;
  border-top: 1px solid var(--input-border);
  margin: 12px 0;
}

.vehicle-multi-actions {
  margin-top: 8px;
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.add-vehicle-btn {
  padding: 6px 10px;
  border-radius: 8px;
}

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

.confirm-copy {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.45;
  margin-bottom: 8px;
}

.confirm-copy p {
  margin: 0;
}

.confirm-details {
  margin-top: 6px;
  border: 1px solid var(--input-border);
  border-radius: 10px;
  padding: 8px 10px;
  background: rgba(148, 163, 184, 0.06);
}

.confirm-details summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--text-900);
}

.confirm-details ol {
  margin: 8px 0 0 18px;
  padding: 0;
}

.registration-steps p {
  margin: 0 0 10px 0;
}

.steps-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 8px;
}

.steps-list li {
  display: grid;
  gap: 2px;
}

.steps-list li span {
  color: var(--muted);
}

.form-actions {
  margin-top: 12px;
  align-items: stretch;
}

.action-meta {
  display: grid;
  gap: 8px;
}

.action-buttons {
  justify-self: stretch;
}

.action-block {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-start;
}

.secondary-actions {
  display: grid;
  gap: 8px;
}

.status-message {
  align-self: center;
  margin-left: 8px;
}

@media (max-width: 720px) {
  .visitor-header {
    flex-direction: column;
    align-items: stretch;
  }

  .visitor-header-actions {
    width: 100%;
    justify-content: flex-start;
  }

  #visitorClockWrap.clock-card {
    width: 100%;
    align-items: flex-start;
  }

  .page-title {
    font-size: 1.3rem;
  }

  .form-section {
    padding: 12px;
  }

  .form-section-header {
    padding: 6px 8px;
  }

  .section-title {
    font-size: 1rem;
    line-height: 1.3;
  }

  .confirm-details {
    padding: 8px;
  }

  .vehicle-multi-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }

  .vehicle-hint {
    margin-left: 0;
  }

  .form-actions {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 10px;
  }

  .action-buttons {
    gap: 10px !important;
  }

  .action-block {
    align-items: stretch;
  }

  .secondary-actions {
    grid-template-columns: 1fr 1fr;
  }

  .status-message {
    margin-left: 0;
    text-align: left;
  }
}

@media (max-width: 420px) {
  .container {
    padding: 12px 8px;
  }

  .card {
    padding: 12px;
  }

  .secondary-actions {
    grid-template-columns: 1fr;
  }
}

/* Visitor UI symmetry and color polish */
:root {
  --visitor-shell-max: 980px;
  --visitor-label-col: 168px;
}

.container {
  max-width: var(--visitor-shell-max);
  margin-inline: auto;
}

.card {
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.form-section {
  border: 1px solid rgba(15, 23, 42, 0.08) !important;
  border-left-width: 1px !important;
  padding: 14px !important;
}

.form-section.section-1 {
  background: linear-gradient(180deg, rgba(14,165,233,0.07), rgba(255,255,255,0.95));
  border-color: #0284c7 !important;
}

.form-section.section-2 {
  background: linear-gradient(180deg, rgba(99,102,241,0.08), rgba(255,255,255,0.95));
  border-color: #4f46e5 !important;
}

.form-section.section-3 {
  background: linear-gradient(180deg, rgba(16,185,129,0.08), rgba(255,255,255,0.95));
  border-color: #059669 !important;
}

.form-section.section-4 {
  background: linear-gradient(180deg, rgba(71,85,105,0.08), rgba(255,255,255,0.95));
  border-color: #334155 !important;
}

.form-section.section-5 {
  background: linear-gradient(180deg, rgba(245,158,11,0.1), rgba(255,255,255,0.95));
  border-color: #d97706 !important;
}

.form-section.section-steps {
  background: linear-gradient(180deg, rgba(6,182,212,0.09), rgba(255,255,255,0.95));
  border-color: #0891b2 !important;
}

.form-section-header {
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(255,255,255,0.76);
}

.form-section-header .icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08);
}

.section-title {
  font-size: 1.02rem;
  line-height: 1.25;
  letter-spacing: 0.01em;
}

form .form-row,
form .form-row.span-2,
.inline-two .form-row {
  grid-template-columns: var(--visitor-label-col) minmax(0, 1fr) !important;
}

form .form-row label,
.inline-two .form-row label {
  justify-self: start !important;
  text-align: left !important;
  padding-right: 0 !important;
}

.form-actions {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
  gap: 10px 14px !important;
}

.action-meta {
  align-content: start;
}

.section-note-collapse {
  margin: 0 0 12px 0;
  border: 1px solid var(--input-border);
  border-radius: 10px;
  background: rgba(99, 102, 241, 0.1);
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 0fr;
  transition: grid-template-rows 220ms ease, box-shadow 220ms ease, border-color 220ms ease;
}

.section-note-collapse summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  font-weight: 800;
  font-size: 0.95rem;
  color: #312e81;
  border-bottom: 1px solid transparent;
}

.section-note-collapse summary::-webkit-details-marker {
  display: none;
}

.section-note-collapse summary::after {
  content: "";
  margin-left: auto;
  width: 11px;
  height: 11px;
  border-right: 3px solid currentColor;
  border-bottom: 3px solid currentColor;
  transform: rotate(45deg);
  transition: transform 200ms ease;
}

.section-note-collapse:hover {
  border-color: rgba(49, 46, 129, 0.45);
}

.section-note-collapse summary:focus-visible {
  outline: 3px solid rgba(49, 46, 129, 0.28);
  outline-offset: -2px;
}

.section-note-collapse[open] summary {
  border-bottom-color: rgba(15, 23, 42, 0.08);
  background: rgba(255,255,255,0.9);
}

.section-note-collapse[open] {
  grid-template-rows: auto 1fr;
  box-shadow: 0 8px 20px rgba(49, 46, 129, 0.14);
}

.section-note-collapse[open] summary::after {
  transform: rotate(-135deg);
}

.section-note-collapse .section-note {
  margin: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  overflow: hidden;
  padding: 0 12px;
}

.section-note-collapse[open] .section-note-panel {
  padding: 10px 12px 12px;
}

@media (max-width: 720px) {
  :root {
    --visitor-label-col: 1fr;
  }

  .card {
    padding: 14px !important;
  }

  .page-title {
    font-size: clamp(1.12rem, 4.8vw, 1.32rem);
    line-height: 1.22;
  }

  .page-subtitle {
    font-size: 0.82rem;
    line-height: 1.35;
  }

  .section-title {
    font-size: 0.98rem;
    line-height: 1.3;
  }

  .section-note-collapse summary {
    padding: 13px 14px;
    font-size: 0.98rem;
  }

  .section-note-collapse summary::after {
    width: 12px;
    height: 12px;
    border-right-width: 3px;
    border-bottom-width: 3px;
  }

  .form-section-header .icon {
    width: 32px;
    height: 32px;
    font-size: 16px;
  }

  .form-progress {
    position: sticky;
    top: 8px;
    z-index: 20;
    backdrop-filter: blur(4px);
    background: rgba(255,255,255,0.92);
  }

  form .form-row,
  form .form-row.span-2,
  .inline-two .form-row {
    grid-template-columns: 1fr !important;
    gap: 6px !important;
  }

  .form-actions {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  .action-buttons {
    width: 100% !important;
  }

  .action-buttons .loader-btn,
  .secondary-actions .btn-ghost {
    min-height: 48px !important;
  }
}

/* Final header box uniformity: same size, same text, solid black line */
.form-section-header {
  min-height: 54px;
  padding: 10px 12px !important;
  border: 2px solid #000 !important;
  border-radius: 10px;
  background: #ffffff !important;
  box-shadow: none !important;
  gap: 10px;
}

.form-section-header .icon {
  width: 30px !important;
  height: 30px !important;
  font-size: 15px !important;
  border: 0 !important;
  border-radius: 8px;
  background: #ffffff !important;
  color: #111 !important;
  box-shadow: none !important;
  flex: 0 0 30px;
}

.form-section .section-title,
.form-section.section-1 .section-title,
.form-section.section-2 .section-title,
.form-section.section-3 .section-title,
.form-section.section-4 .section-title,
.form-section.section-5 .section-title,
.form-section.section-steps .section-title {
  margin: 0;
  color: #111 !important;
  font-size: 1rem !important;
  font-weight: 700 !important;
  line-height: 1.2;
  letter-spacing: 0;
}

.form-section.section-1 .form-section-header .icon,
.form-section.section-2 .form-section-header .icon,
.form-section.section-3 .form-section-header .icon,
.form-section.section-4 .form-section-header .icon,
.form-section.section-5 .form-section-header .icon,
.form-section.section-steps .form-section-header .icon {
  background: #ffffff !important;
  color: #111 !important;
}

@media (max-width: 720px) {
  .form-section-header {
    min-height: 52px;
  }
}

/* Custom palette for Langkah buttons (non-default blue/white) */
#submitBtn.loader-btn {
  background: linear-gradient(120deg, #81ecec, #67dada) !important;
  border-color: #4fc3c3 !important;
  color: #083344 !important;
  box-shadow: 0 10px 22px rgba(79, 195, 195, 0.28) !important;
}

#submitBtn.loader-btn:hover {
  background: linear-gradient(120deg, #67dada, #55c8c8) !important;
  border-color: #39b2b2 !important;
  color: #062a36 !important;
}

#waBtn.loader-btn {
  background: linear-gradient(120deg, #16a34a, #15803d) !important;
  border-color: #166534 !important;
  color: #ffffff !important;
  box-shadow: 0 10px 22px rgba(22, 101, 52, 0.26) !important;
}

#waBtn.loader-btn:hover {
  background: linear-gradient(120deg, #15803d, #166534) !important;
  border-color: #14532d !important;
  color: #ffffff !important;
}

#waBtn.loader-btn:disabled,
#waBtn.loader-btn.btn-disabled {
  background: linear-gradient(120deg, #86efac, #4ade80) !important;
  border-color: #22c55e !important;
  color: #14532d !important;
  box-shadow: none !important;
}
