:root {
  color-scheme: light;
  --navy: #0f172a;
  --navy-2: #1e293b;
  --blue: #2563eb;
  --blue-dark: #1d4ed8;
  --blue-soft: #eff6ff;
  --gold: #f59e0b;
  --red: #b91c1c;
  --red-soft: #fef2f2;
  --green: #166534;
  --green-soft: #f0fdf4;
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-500: #64748b;
  --gray-700: #334155;
  --white: #ffffff;
  --shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
}

* { box-sizing: border-box; }

html { min-height: 100%; background: var(--gray-50); }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100%;
  background: var(--gray-50);
  color: var(--navy);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.65; }

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px max(20px, calc((100vw - 1120px) / 2));
  background: var(--navy);
  color: var(--white);
}

.brand { display: flex; align-items: center; gap: 13px; }
.header-actions { display: flex; align-items: center; gap: 8px; }
.icon-button.employee-active { border-color: #86efac; background: rgba(22, 101, 52, 0.35); color: #dcfce7; }
.brand-mark {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: rgba(255,255,255,0.1);
  color: #93c5fd;
}
.brand-mark svg { width: 34px; height: 34px; }
.brand h1 { margin: 0; font-size: clamp(1.05rem, 4vw, 1.35rem); }
.brand p { margin: 2px 0 0; color: #cbd5e1; font-size: 0.85rem; }

.tabs {
  display: flex;
  gap: 4px;
  padding: 8px max(16px, calc((100vw - 1120px) / 2));
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  position: sticky;
  top: 0;
  z-index: 5;
}
.tab {
  border: 0;
  border-radius: 10px;
  background: transparent;
  padding: 10px 14px;
  color: var(--gray-500);
  font-weight: 700;
}
.tab.active { background: var(--blue-soft); color: var(--blue-dark); }
.count-pill {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  margin-left: 5px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--gray-200);
  color: var(--gray-700);
  font-size: 0.75rem;
}
.tab.active .count-pill { background: #dbeafe; color: var(--blue-dark); }

main { width: min(1120px, calc(100% - 32px)); margin: 0 auto; padding: 28px 0 60px; }
.view { display: none; }
.view.active { display: block; }

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}
.section-heading h2 { margin: 0; font-size: clamp(1.5rem, 5vw, 2rem); }
.eyebrow { margin: 0 0 4px; color: var(--blue-dark); font-size: 0.75rem; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; }
.status-badge, .order-status {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue-dark);
  padding: 6px 10px;
  font-size: 0.8rem;
  font-weight: 800;
}

.panel {
  margin-bottom: 18px;
  padding: 22px;
  border: 1px solid var(--gray-200);
  border-radius: 18px;
  background: var(--white);
  box-shadow: var(--shadow);
}
.panel-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 18px; }
.panel-heading h3 { margin: 0; font-size: 1.08rem; }
.panel-heading p { margin: 4px 0 0; color: var(--gray-500); font-size: 0.9rem; }

.form-grid { display: grid; gap: 16px; }
.two-column { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.three-column { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.full-width { grid-column: 1 / -1; }

label > span, .label-row label { display: block; margin-bottom: 7px; font-size: 0.88rem; font-weight: 700; color: var(--gray-700); }
label b, .label-row b { color: var(--red); }
input, textarea, select {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--gray-300);
  border-radius: 12px;
  background: var(--white);
  color: var(--navy);
  padding: 10px 12px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
textarea { resize: vertical; line-height: 1.45; }
input:focus, textarea:focus, select:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12); }
input.invalid, textarea.invalid { border-color: var(--red); box-shadow: 0 0 0 4px rgba(185, 28, 28, 0.1); }

.vin-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 14px; }
.vin-field input { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: 0.06em; text-transform: uppercase; }
.vin-actions { display: flex; gap: 8px; }
.field-message { min-height: 20px; margin: 8px 0 16px; color: var(--gray-500); font-size: 0.84rem; }
.field-message.success { color: var(--green); }
.field-message.error { color: var(--red); }

.primary-button, .secondary-button, .danger-button, .icon-button {
  min-height: 44px;
  border-radius: 11px;
  padding: 10px 15px;
  font-weight: 800;
}
.primary-button { border: 1px solid var(--blue); background: var(--blue); color: var(--white); }
.primary-button:hover { background: var(--blue-dark); border-color: var(--blue-dark); }
.secondary-button { border: 1px solid var(--gray-300); background: var(--white); color: var(--gray-700); }
.secondary-button:hover { background: var(--gray-100); }
.danger-button { border: 1px solid #fecaca; background: var(--red-soft); color: var(--red); }
.icon-button { border: 1px solid rgba(255,255,255,0.28); background: transparent; color: inherit; }
.large { min-width: 220px; min-height: 52px; }

.repair-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.choice-card {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  min-height: 112px;
  padding: 16px;
  border: 1px solid var(--gray-300);
  border-radius: 14px;
  background: var(--white);
  transition: border-color 0.15s, background 0.15s;
}
.choice-card:has(input:checked) { border-color: var(--blue); background: var(--blue-soft); }
.choice-card input { width: 20px; min-height: 20px; margin: 2px 0 0; accent-color: var(--blue); }
.choice-copy { display: grid; gap: 5px; }
.choice-copy strong { color: var(--navy); }
.choice-copy small { color: var(--gray-500); line-height: 1.35; }
.other-repair { margin-top: 18px; }
.label-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.label-row span { color: var(--gray-500); font-size: 0.8rem; }

.photo-heading { align-items: center; }
.photo-count { color: var(--gray-500); font-size: 0.85rem; font-weight: 800; }
.upload-zone {
  min-height: 150px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 5px;
  border: 2px dashed var(--gray-300);
  border-radius: 16px;
  background: var(--gray-50);
  text-align: center;
  padding: 20px;
  cursor: pointer;
}
.upload-zone:hover { border-color: var(--blue); background: var(--blue-soft); }
.upload-zone input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.upload-zone small { color: var(--gray-500); }
.upload-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; background: #dbeafe; color: var(--blue-dark); font-size: 1.5rem; }
.photo-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.photo-card { margin: 0; overflow: hidden; border: 1px solid var(--gray-200); border-radius: 14px; background: var(--white); }
.photo-card img { width: 100%; aspect-ratio: 4 / 3; display: block; object-fit: cover; background: var(--gray-100); }
.photo-card figcaption { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 9px; }
.photo-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--gray-500); font-size: 0.75rem; }
.remove-photo { border: 0; background: transparent; color: var(--red); font-size: 0.75rem; font-weight: 800; }

.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.alert { margin-bottom: 16px; border: 1px solid #fecaca; border-radius: 12px; background: var(--red-soft); color: var(--red); padding: 12px 14px; font-weight: 700; }

.orders-heading { align-items: end; }
.orders-toolbar { display: grid; grid-template-columns: 2fr 1fr; gap: 14px; margin-bottom: 18px; }
.orders-list { display: grid; gap: 12px; }
.order-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  border: 1px solid var(--gray-200);
  border-radius: 16px;
  background: var(--white);
  padding: 18px;
  box-shadow: var(--shadow);
}
.order-card h3 { margin: 0; font-size: 1rem; }
.order-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 7px; color: var(--gray-500); font-size: 0.84rem; }
.order-number { color: var(--blue-dark); font-weight: 900; }
.order-card-actions { display: grid; justify-items: end; gap: 9px; }
.order-status select { min-height: 36px; border: 0; padding: 0 4px; background: transparent; color: inherit; font-weight: 800; }
.empty-state { text-align: center; padding: 70px 20px; border: 1px dashed var(--gray-300); border-radius: 16px; background: var(--white); }
.empty-state[hidden] { display: none; }
.empty-state h3 { margin: 10px 0 4px; }
.empty-state p { margin: 0; color: var(--gray-500); }
.empty-icon { font-size: 2rem; color: var(--gray-500); }

.scanner-dialog, .order-dialog, .employee-dialog {
  width: min(760px, calc(100% - 24px));
  max-height: calc(100vh - 24px);
  overflow: auto;
  border: 0;
  border-radius: 20px;
  padding: 22px;
  background: var(--white);
  color: var(--navy);
  box-shadow: 0 24px 80px rgba(15,23,42,.35);
}
dialog::backdrop { background: rgba(15, 23, 42, 0.7); }
.dialog-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; margin-bottom: 16px; }
.dialog-header h2 { margin: 0; }
.dialog-header p:not(.eyebrow) { margin: 4px 0 0; color: var(--gray-500); }
.close-button { width: 42px; min-height: 42px; padding: 0; border-color: var(--gray-300); color: var(--navy); font-size: 1.6rem; line-height: 1; }
.scanner-frame { position: relative; overflow: hidden; aspect-ratio: 4 / 3; border-radius: 16px; background: #020617; }
.scanner-frame video { width: 100%; height: 100%; object-fit: cover; }
.scan-guide { position: absolute; inset: 28% 8%; border: 3px solid rgba(255,255,255,.88); border-radius: 12px; box-shadow: 0 0 0 999px rgba(0,0,0,.22); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.dialog-actions.wrap { flex-wrap: wrap; }

.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.detail-card { border: 1px solid var(--gray-200); border-radius: 14px; padding: 14px; }
.detail-card.full { grid-column: 1 / -1; }
.detail-label { margin-bottom: 5px; color: var(--gray-500); font-size: .76rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.detail-value { white-space: pre-wrap; overflow-wrap: anywhere; }
.detail-photos { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 10px; margin-top: 8px; }
.detail-photos img { width: 100%; aspect-ratio: 4/3; border-radius: 10px; object-fit: cover; border: 1px solid var(--gray-200); }

@media (max-width: 800px) {
  .three-column, .repair-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .photo-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .vin-row { grid-template-columns: 1fr; }
  .vin-actions { justify-content: stretch; }
  .vin-actions button { flex: 1; }
}

@media (max-width: 600px) {
  .app-header { padding: 14px 16px; }
  .brand-mark { width: 42px; height: 42px; }
  .brand p { display: none; }
  main { width: min(100% - 24px, 1120px); padding-top: 20px; }
  .panel { padding: 17px; border-radius: 15px; }
  .two-column, .three-column, .repair-grid, .orders-toolbar, .detail-grid { grid-template-columns: 1fr; }
  .photo-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .order-card { grid-template-columns: 1fr; }
  .order-card-actions { justify-items: stretch; }
  .order-card-actions .secondary-button { width: 100%; }
  .form-actions { flex-direction: column-reverse; }
  .form-actions button { width: 100%; }
  .large { min-width: 0; }
  .section-heading { align-items: flex-start; }
  .detail-card.full { grid-column: auto; }
  .detail-photos { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media print {
  body > *:not(dialog[open]) { display: none !important; }
  dialog[open] { position: static; width: 100%; max-height: none; box-shadow: none; padding: 0; }
  dialog::backdrop, .dialog-actions, .close-button { display: none; }
}


/* Document and request workflow */
.workflow-section + .workflow-section { margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--gray-200); }
.panel-heading.compact { margin-bottom: 12px; }
.panel-heading h4, .employee-panel-heading h4 { margin: 0; font-size: 1rem; }
.panel-heading.compact p { max-width: 720px; }
.document-upload-zone { min-height: 126px; }
.document-list, .detail-document-list { display: grid; gap: 9px; }
.document-row, .detail-document-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  padding: 11px 12px;
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  background: var(--white);
}
.document-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: var(--blue-soft);
  color: var(--blue-dark);
  font-size: .68rem;
  font-weight: 900;
  letter-spacing: .04em;
}
.document-copy { min-width: 0; display: grid; gap: 3px; }
.document-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .9rem; }
.document-copy small { color: var(--gray-500); }
.document-actions { display: flex; align-items: center; gap: 8px; }
.document-link, .remove-document, .remove-detail-document {
  border: 0;
  background: transparent;
  color: var(--blue-dark);
  font-size: .78rem;
  font-weight: 800;
  text-decoration: none;
}
.remove-document, .remove-detail-document { color: var(--red); padding: 6px; }
.request-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.request-card {
  width: 100%;
  min-height: 128px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border: 2px solid var(--gray-300);
  border-radius: 16px;
  background: var(--gray-100);
  color: var(--gray-500);
  padding: 16px;
  text-align: left;
  transition: border-color .15s, background .15s, color .15s, transform .15s;
}
.request-card:disabled { opacity: 1; cursor: not-allowed; }
.request-card.ready { border-color: var(--blue); background: var(--blue-soft); color: var(--navy); }
.request-card.ready:hover { transform: translateY(-1px); }
.request-card.requested { border-color: #16a34a; background: var(--green-soft); color: var(--navy); }
.request-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--gray-200);
  color: var(--gray-500);
  font-weight: 900;
}
.request-card.ready .request-icon { background: #dbeafe; color: var(--blue-dark); }
.request-card.requested .request-icon { background: #dcfce7; color: var(--green); }
.request-copy { min-width: 0; display: grid; gap: 5px; }
.request-copy strong { color: inherit; font-size: 1rem; }
.request-copy small { color: inherit; opacity: .82; line-height: 1.35; }
.request-state { align-self: start; border-radius: 999px; background: var(--gray-200); color: var(--gray-700); padding: 5px 8px; font-size: .72rem; font-weight: 900; }
.request-card.ready .request-state { background: #dbeafe; color: var(--blue-dark); }
.request-card.requested .request-state { background: #dcfce7; color: var(--green); }
.employee-panel, .employee-detail-panel {
  margin-top: 24px;
  padding: 18px;
  border: 1px solid #93c5fd;
  border-radius: 16px;
  background: var(--blue-soft);
}
.employee-detail-panel { margin-top: 0; }
.employee-panel-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.employee-badge { border-radius: 999px; background: var(--navy); color: var(--white); padding: 5px 9px; font-size: .72rem; font-weight: 900; }
.bypass-control {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 14px;
  padding: 14px;
  border: 1px solid #93c5fd;
  border-radius: 13px;
  background: var(--white);
}
.bypass-control input { width: 20px; min-height: 20px; margin: 2px 0 0; accent-color: var(--blue); }
.bypass-control span { display: grid; gap: 4px; }
.bypass-control strong { font-size: .92rem; }
.bypass-control small { color: var(--gray-500); line-height: 1.35; }
.compact-upload { min-height: 110px; }
.detail-request-grid { margin-top: 6px; }
.mini-badge-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.mini-badge { border-radius: 999px; background: var(--blue-soft); color: var(--blue-dark); padding: 5px 8px; font-size: .72rem; font-weight: 900; }
.employee-dialog { width: min(520px, calc(100% - 24px)); }
.employee-dialog input { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .14em; }

@media (max-width: 800px) {
  .request-grid { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .app-header { align-items: flex-start; }
  .header-actions { flex-direction: column; align-items: stretch; }
  .header-actions .icon-button { min-height: 38px; padding: 7px 10px; font-size: .78rem; }
  .document-row, .detail-document-row { grid-template-columns: auto minmax(0, 1fr); }
  .document-actions { grid-column: 1 / -1; justify-content: flex-end; border-top: 1px solid var(--gray-200); padding-top: 8px; }
  .request-card { grid-template-columns: auto minmax(0, 1fr); }
  .request-state { grid-column: 2; justify-self: start; }
}

@media print {
  .document-actions, .employee-detail-panel, .detail-request button { display: none !important; }
}

/* Customer Scrub document access */
.customer-scrub-section {
  margin-top: 24px;
  padding: 18px;
  border: 1px solid var(--gray-200);
  border-radius: 14px;
  background: var(--gray-50);
}
.customer-document-status {
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--gray-200);
  color: var(--gray-600);
  padding: 6px 10px;
  font-size: .72rem;
  font-weight: 900;
}
.customer-document-status.available {
  background: var(--green-soft);
  color: var(--green);
}
.customer-document-empty {
  padding: 14px;
  border: 1px dashed var(--gray-300);
  border-radius: 12px;
  color: var(--gray-500);
  background: var(--white);
  font-size: .9rem;
}
.detail-helper {
  margin: -2px 0 10px;
  color: var(--gray-500);
  font-size: .82rem;
  line-height: 1.45;
}

/* Midwest Precision Theme */
:root {
  --navy: #171b20;
  --navy-2: #252c33;
  --blue: #c92a2a;
  --blue-dark: #991b1b;
  --blue-soft: #fff1f0;
  --gold: #f0a202;
  --red: #b42318;
  --red-soft: #fff1f0;
  --green: #18794e;
  --green-soft: #edf9f2;
  --gray-50: #f5f6f7;
  --gray-100: #eceff1;
  --gray-200: #d9dee3;
  --gray-300: #bcc4cc;
  --gray-500: #66717d;
  --gray-600: #505b66;
  --gray-700: #333d47;
  --white: #ffffff;
  --carbon: #101419;
  --steel: #46515c;
  --amber-soft: #fff7df;
  --shadow: 0 14px 34px rgba(19, 25, 31, 0.09);
}

html {
  background: #eef0f2;
}

body {
  background-color: #f3f4f5;
  background-image:
    linear-gradient(rgba(23, 27, 32, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23, 27, 32, 0.025) 1px, transparent 1px);
  background-size: 28px 28px;
}

.app-header {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(115deg, rgba(255,255,255,.035) 25%, transparent 25%) 0 0 / 18px 18px,
    linear-gradient(135deg, #0f1317 0%, #252c33 58%, #151a1f 100%);
  border-bottom: 3px solid var(--gold);
  box-shadow: 0 10px 26px rgba(16, 20, 25, .22);
}

.app-header::after {
  content: "";
  position: absolute;
  right: -65px;
  bottom: -110px;
  width: 260px;
  height: 260px;
  border: 2px solid rgba(255,255,255,.055);
  border-radius: 50%;
  box-shadow: 0 0 0 28px rgba(255,255,255,.025), 0 0 0 56px rgba(255,255,255,.018);
  pointer-events: none;
}

.brand, .header-actions {
  position: relative;
  z-index: 1;
}

.brand-mark {
  border: 1px solid rgba(255,255,255,.18);
  background: linear-gradient(145deg, #303943, #161b20);
  color: #ffb21a;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.12), 0 8px 18px rgba(0,0,0,.24);
}

.brand h1 {
  letter-spacing: .015em;
}

.brand p {
  color: #cfd5db;
  letter-spacing: .03em;
}

.icon-button {
  border-color: rgba(255,255,255,.3);
  background: rgba(255,255,255,.055);
  backdrop-filter: blur(8px);
}

.icon-button:hover {
  border-color: rgba(255,178,26,.75);
  background: rgba(255,178,26,.12);
}

.tabs {
  gap: 8px;
  padding-top: 10px;
  padding-bottom: 10px;
  border-bottom-color: #cfd5da;
  box-shadow: 0 5px 16px rgba(23,27,32,.06);
}

.tab {
  position: relative;
  border-radius: 9px;
  color: #5c6670;
}

.tab.active {
  background: var(--blue-soft);
  color: var(--blue-dark);
  box-shadow: inset 0 -3px 0 var(--blue);
}

.tab.active .count-pill,
.count-pill {
  background: #e2e6e9;
  color: #3c4650;
}

.tab.active .count-pill {
  background: #f8d8d5;
  color: var(--blue-dark);
}

.section-heading h2 {
  letter-spacing: -.025em;
}

.eyebrow {
  color: var(--blue-dark);
}

.status-badge,
.order-status {
  border: 1px solid #f3c7c4;
  background: var(--blue-soft);
  color: var(--blue-dark);
}

.panel {
  position: relative;
  overflow: hidden;
  border-color: #d5dade;
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.panel::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(180deg, var(--blue), var(--gold));
  opacity: .75;
}

.panel-heading h3,
.panel-heading h4,
.employee-panel-heading h4 {
  color: #1a2026;
  letter-spacing: -.01em;
}

input,
textarea,
select {
  border-color: #bfc6cc;
  background: #fcfcfd;
  color: #171b20;
}

input:hover,
textarea:hover,
select:hover {
  border-color: #8e98a2;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(201, 42, 42, .13);
  background: #ffffff;
}

.primary-button {
  border-color: var(--blue-dark);
  background: linear-gradient(180deg, #d83a34, #b91f25);
  color: #fff;
  box-shadow: 0 6px 14px rgba(153, 27, 27, .18), inset 0 1px 0 rgba(255,255,255,.2);
}

.primary-button:hover {
  border-color: #7f1717;
  background: linear-gradient(180deg, #bd2627, #941b1b);
}

.secondary-button {
  border-color: #b9c1c8;
  background: linear-gradient(180deg, #ffffff, #f0f2f4);
  color: #303943;
}

.secondary-button:hover {
  border-color: #89939d;
  background: #e9ecef;
}

.choice-card {
  border-color: #c6cdd3;
  background: linear-gradient(180deg, #ffffff, #fafbfb);
}

.choice-card:hover {
  border-color: #929ca5;
}

.choice-card:has(input:checked) {
  border-color: var(--blue);
  background: linear-gradient(135deg, #fff7f6, #fff1f0);
  box-shadow: inset 4px 0 0 var(--blue);
}

.choice-card input,
.bypass-control input {
  accent-color: var(--blue);
}

.upload-zone {
  border-color: #aeb7bf;
  background:
    linear-gradient(rgba(255,255,255,.82), rgba(255,255,255,.82)),
    repeating-linear-gradient(135deg, #e9ecef 0 10px, #f7f8f9 10px 20px);
}

.upload-zone:hover {
  border-color: var(--blue);
  background: var(--blue-soft);
}

.upload-icon {
  border: 1px solid #f0c46c;
  background: var(--amber-soft);
  color: #9a6200;
}

.photo-card,
.document-row,
.detail-document-row,
.order-card,
.detail-card {
  border-color: #d2d8dd;
}

.document-icon {
  border: 1px solid #f0c9c5;
  background: var(--blue-soft);
  color: var(--blue-dark);
}

.document-link,
.order-number {
  color: var(--blue-dark);
}

.request-card {
  border-color: #c2c9cf;
  background: #eceff1;
  color: #67727c;
}

.request-card.ready {
  border-color: var(--blue);
  background: linear-gradient(135deg, #fff8f7, #fff0ef);
  color: var(--navy);
  box-shadow: inset 4px 0 0 var(--blue);
}

.request-card.ready .request-icon,
.request-card.ready .request-state {
  background: #f8d8d5;
  color: var(--blue-dark);
}

.request-card.requested {
  border-color: #2a8c5f;
  background: var(--green-soft);
  box-shadow: inset 4px 0 0 #2a8c5f;
}

.employee-panel,
.employee-detail-panel {
  border-color: #e1b24e;
  background: linear-gradient(135deg, #fff9e9, #fff4d4);
}

.employee-badge {
  background: var(--carbon);
  color: #ffd477;
}

.bypass-control {
  border-color: #e4c375;
}

.customer-scrub-section {
  border-color: #cbd1d6;
  background: linear-gradient(180deg, #f7f8f9, #eef0f2);
}

.scanner-dialog,
.order-dialog,
.employee-dialog {
  border: 1px solid #69737d;
  background: #fbfbfc;
  box-shadow: 0 28px 90px rgba(10,14,18,.45);
}

dialog::backdrop {
  background: rgba(10, 13, 17, .78);
  backdrop-filter: blur(3px);
}

.scanner-frame {
  border: 2px solid #3c4650;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.05);
}

.scan-guide {
  border-color: #ffbd35;
  box-shadow: 0 0 0 999px rgba(0,0,0,.30), 0 0 22px rgba(255,189,53,.25);
}

.empty-state {
  border-color: #bdc5cc;
  background: rgba(255,255,255,.86);
}

@media (max-width: 600px) {
  .app-header::after { opacity: .55; }
  .panel::before { width: 3px; }
}


/* Mobile compatibility: Android, iPhone, and iPad */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overscroll-behavior-y: none;
}

body {
  padding-bottom: env(safe-area-inset-bottom, 0px);
  -webkit-tap-highlight-color: rgba(190, 43, 32, .16);
}

.app-header {
  padding-top: max(18px, env(safe-area-inset-top));
  padding-left: max(20px, env(safe-area-inset-left));
  padding-right: max(20px, env(safe-area-inset-right));
}

.tabs {
  padding-left: max(16px, env(safe-area-inset-left));
  padding-right: max(16px, env(safe-area-inset-right));
}

main {
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
  padding-bottom: max(60px, calc(32px + env(safe-area-inset-bottom)));
}

button,
input,
textarea,
select,
.document-link {
  touch-action: manipulation;
}

button,
.primary-button,
.secondary-button,
.danger-button,
.icon-button,
.tab,
.document-link {
  min-height: 44px;
}

input,
textarea,
select {
  font-size: 16px;
}

input[type="checkbox"] {
  min-height: 22px;
}

.visually-hidden-file {
  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;
}

.install-dialog {
  width: min(520px, calc(100% - 24px));
}

.install-steps {
  display: grid;
  gap: 14px;
  margin: 18px 0;
  padding: 0;
  list-style: none;
}

.install-steps li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.install-step-number {
  display: grid;
  place-items: center;
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--blue);
  color: var(--white);
  font-weight: 900;
}

.install-note {
  margin: 0;
  padding: 12px 14px;
  border: 1px solid #e4c375;
  border-radius: 12px;
  background: var(--amber-soft);
  color: var(--gray-700);
  font-size: .9rem;
}

.dialog-fallback-open {
  position: fixed;
  inset: 12px;
  z-index: 100;
  display: block;
  margin: auto;
  max-height: calc(100% - 24px);
  overflow: auto;
}

@supports (-webkit-touch-callout: none) {
  dialog {
    max-height: calc(100dvh - 24px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  }

  .scanner-frame {
    min-height: 240px;
  }

  .photo-card img {
    -webkit-user-drag: none;
  }
}

@media (display-mode: standalone) {
  .app-header {
    padding-top: max(18px, calc(env(safe-area-inset-top) + 8px));
  }
}

@media (max-width: 600px) {
  .dialog-actions > button {
    flex: 1 1 100%;
  }

  .scanner-dialog,
  .order-dialog,
  .employee-dialog,
  .install-dialog {
    width: calc(100% - 16px);
    max-height: calc(100dvh - 16px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    padding: 18px;
  }
}

/* First-access login gate */
body.auth-locked {
  overflow: hidden;
}

body.auth-locked > :not(#authGate):not(#contactUsDialog) {
  display: none !important;
}

body:not(.auth-locked) > #authGate {
  display: none !important;
}

.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 1000;
  min-height: 100dvh;
  overflow-y: auto;
  display: grid;
  place-items: center;
  padding:
    max(24px, env(safe-area-inset-top))
    max(18px, env(safe-area-inset-right))
    max(24px, env(safe-area-inset-bottom))
    max(18px, env(safe-area-inset-left));
  background:
    radial-gradient(circle at 80% 15%, rgba(240, 162, 2, .13), transparent 28%),
    radial-gradient(circle at 15% 85%, rgba(201, 42, 42, .14), transparent 32%),
    linear-gradient(145deg, #0c1014, #252c33 56%, #101419);
}

.auth-card {
  width: min(560px, 100%);
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 22px;
  background: #fbfbfc;
  box-shadow: 0 28px 90px rgba(0,0,0,.45);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 24px;
  border-bottom: 3px solid var(--gold);
  background:
    linear-gradient(115deg, rgba(255,255,255,.035) 25%, transparent 25%) 0 0 / 18px 18px,
    linear-gradient(135deg, #0f1317, #252c33);
  color: var(--white);
}

.auth-brand-mark {
  flex: 0 0 58px;
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 17px;
  background: linear-gradient(145deg, #303943, #161b20);
  color: #ffb21a;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.12), 0 8px 18px rgba(0,0,0,.24);
}

.auth-brand-mark svg {
  width: 42px;
  height: 42px;
}

.auth-brand h1 {
  margin: 0;
  font-size: clamp(1.35rem, 5vw, 1.75rem);
  letter-spacing: -.02em;
}

.auth-brand .eyebrow {
  color: #ffd477;
}

.auth-brand p:not(.eyebrow) {
  margin: 5px 0 0;
  color: #d4d9de;
  font-size: .9rem;
  line-height: 1.45;
}

.auth-panel {
  display: grid;
  gap: 15px;
  padding: 24px 24px 12px;
}

.auth-panel-heading h2 {
  margin: 0;
  color: #1a2026;
  font-size: 1.2rem;
}

.auth-panel-heading p {
  margin: 5px 0 0;
  color: var(--gray-500);
  font-size: .88rem;
  line-height: 1.45;
}

.auth-submit {
  width: 100%;
  min-height: 52px;
  margin-top: 2px;
}

.auth-message {
  min-height: 22px;
  margin: 2px 24px 0;
  color: var(--gray-500);
  font-size: .86rem;
  font-weight: 700;
}

.auth-message.error {
  color: var(--red);
}

.auth-message.success {
  color: var(--green);
}

.auth-security-note {
  margin: 10px 24px 24px;
  padding: 12px 14px;
  border: 1px solid #e4c375;
  border-radius: 12px;
  background: var(--amber-soft);
  color: var(--gray-700);
  font-size: .8rem;
  line-height: 1.45;
}

@media (max-width: 600px) {
  .auth-gate {
    place-items: start center;
    padding-top: max(14px, env(safe-area-inset-top));
    padding-left: max(10px, env(safe-area-inset-left));
    padding-right: max(10px, env(safe-area-inset-right));
  }

  .auth-card {
    border-radius: 18px;
  }

  .auth-brand {
    align-items: flex-start;
    padding: 20px;
  }

  .auth-brand-mark {
    flex-basis: 50px;
    width: 50px;
    height: 50px;
    border-radius: 14px;
  }

  .auth-brand-mark svg {
    width: 36px;
    height: 36px;
  }

  .auth-panel {
    padding: 20px 18px 10px;
  }

  .auth-message {
    margin-left: 18px;
    margin-right: 18px;
  }

  .auth-security-note {
    margin: 10px 18px 20px;
  }
}

@media print {
  #authGate,
  #logoutButton {
    display: none !important;
  }
}

.auth-panel[hidden] {
  display: none !important;
}

/* Multi-customer account management */
.header-session {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  min-width: 0;
}

.organization-context {
  min-width: 190px;
}

.organization-context > span {
  margin-bottom: 4px;
  color: #d7dde2;
  font-size: .7rem;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.organization-context select {
  min-height: 40px;
  border-color: rgba(255,255,255,.28);
  background: rgba(255,255,255,.08);
  color: #fff;
  padding: 7px 34px 7px 10px;
}

.organization-context select option {
  color: #171b20;
  background: #fff;
}

.session-identity {
  min-width: 0;
  padding: 7px 10px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 10px;
  background: rgba(0,0,0,.14);
  text-align: right;
}

.session-identity strong,
.session-identity span {
  display: block;
}

.session-identity strong {
  overflow: hidden;
  max-width: 220px;
  color: #fff;
  font-size: .84rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.session-identity span {
  margin-top: 2px;
  color: #cfd5db;
  font-size: .7rem;
}

.scope-name {
  margin: 5px 0 0;
  color: var(--gray-500);
  font-size: .9rem;
}

.account-actions {
  justify-content: flex-end;
  margin-top: 18px;
}

.accounts-list {
  display: grid;
  gap: 10px;
}

.account-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
  padding: 14px;
  border: 1px solid #d2d8dd;
  border-radius: 13px;
  background: #fff;
}

.account-card.account-disabled {
  background: #f1f2f3;
  opacity: .7;
}

.account-avatar {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid #efc3c0;
  border-radius: 12px;
  background: var(--blue-soft);
  color: var(--blue-dark);
  font-weight: 900;
}

.account-copy {
  min-width: 0;
}

.account-copy strong,
.account-copy span,
.account-copy small {
  display: block;
  overflow-wrap: anywhere;
}

.account-copy strong {
  color: #1a2026;
}

.account-copy span {
  margin-top: 2px;
  color: var(--gray-700);
  font-size: .88rem;
}

.account-copy small {
  margin-top: 3px;
  color: var(--gray-500);
  font-size: .78rem;
}

.compact-empty {
  padding: 22px;
}

.alert.success {
  border-color: #86c9a7;
  background: var(--green-soft);
  color: var(--green);
}

@media (max-width: 860px) {
  .app-header {
    align-items: flex-start;
  }

  .header-session {
    max-width: 54%;
    flex-wrap: wrap;
  }

  .organization-context {
    flex: 1 1 100%;
    min-width: 0;
  }

  .session-identity {
    flex: 1 1 180px;
  }
}

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

  .header-session {
    max-width: none;
    justify-content: stretch;
  }

  .session-identity {
    order: -1;
    flex: 1 1 100%;
    text-align: left;
  }

  .session-identity strong {
    max-width: none;
  }

  .header-actions {
    flex: 1 1 100%;
    flex-direction: row;
  }

  .header-actions .icon-button {
    flex: 1;
  }

  .tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .tab {
    flex: 0 0 auto;
  }

  .account-card {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .account-card > .secondary-button,
  .account-card > .mini-badge {
    grid-column: 1 / -1;
    justify-self: stretch;
    text-align: center;
  }
}

/* Customer access requests */
.auth-secondary-actions {
  display: flex;
  justify-content: center;
  margin-top: -2px;
}

.auth-link-button {
  min-height: 44px;
  padding: 8px 14px;
  border: 0;
  background: transparent;
  color: var(--blue-dark);
  font: inherit;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.auth-link-button:hover {
  color: var(--red);
}

.access-requests-list {
  display: grid;
  gap: 12px;
}

.access-request-card {
  padding: 15px;
  border: 1px solid #d2d8dd;
  border-radius: 14px;
  background: #fff;
}

.access-request-heading {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 13px;
}

.access-request-message {
  margin: 13px 0 0;
  padding: 11px 13px;
  border-left: 4px solid var(--gold);
  border-radius: 8px;
  background: var(--amber-soft);
  color: var(--gray-700);
  font-size: .88rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.access-request-actions {
  display: grid;
  grid-template-columns: minmax(170px, 1fr) auto auto;
  align-items: end;
  gap: 10px;
  margin-top: 14px;
}

.access-request-actions label span {
  display: block;
  margin-bottom: 6px;
  color: var(--gray-700);
  font-size: .78rem;
  font-weight: 800;
}

@media (max-width: 600px) {
  .access-request-actions {
    grid-template-columns: 1fr;
  }

  .access-request-actions button {
    width: 100%;
  }
}


/* Expanded business access request */
.auth-request-panel {
  width: min(760px, 100%);
}

.auth-fieldset {
  margin: 0;
  padding: 16px;
  border: 1px solid #cfd6dc;
  border-radius: 14px;
  background: rgba(255, 255, 255, .72);
}

.auth-fieldset legend {
  padding: 0 8px;
  color: var(--gray-900);
  font-weight: 900;
}

.auth-request-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px;
}

.auth-request-grid .full-span {
  grid-column: 1 / -1;
}

.auth-request-panel small {
  color: var(--gray-500);
  font-size: .76rem;
  font-weight: 700;
}

.multi-location-toggle {
  padding: 13px 14px;
  border: 1px solid #cfd6dc;
  border-radius: 12px;
  background: #fff;
}

.additional-locations {
  display: grid;
  gap: 12px;
}

.additional-locations-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.additional-locations-heading h3,
.additional-locations-heading p {
  margin: 0;
}

.additional-locations-heading p {
  margin-top: 4px;
  color: var(--gray-600);
  font-size: .84rem;
  line-height: 1.45;
}

.access-location-list {
  display: grid;
  gap: 12px;
}

.access-location-card {
  padding: 14px;
  border: 1px solid #cfd6dc;
  border-radius: 14px;
  background: #fff;
}

.access-location-card-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 13px;
}

.access-location-card-heading div {
  display: grid;
  gap: 2px;
}

.access-location-card-heading span {
  color: var(--gray-600);
  font-size: .8rem;
}

.location-remove-button {
  min-height: 42px;
  padding: 8px 12px;
  border: 1px solid #d7b9b9;
  border-radius: 10px;
  background: #fff7f7;
  color: var(--red);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.access-request-business-details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
  padding: 13px;
  border: 1px solid #d9dee3;
  border-radius: 12px;
  background: var(--gray-50);
}

.access-request-business-details > div {
  display: grid;
  gap: 3px;
}

.access-request-business-details .full-detail {
  grid-column: 1 / -1;
}

.detail-label {
  color: var(--gray-600);
  font-size: .74rem;
  font-weight: 900;
  letter-spacing: .03em;
  text-transform: uppercase;
}

.access-request-locations-summary {
  margin-top: 12px;
  padding: 13px;
  border: 1px solid #d9dee3;
  border-radius: 12px;
  background: #fff;
}

.access-request-locations-summary ul {
  display: grid;
  gap: 9px;
  margin: 9px 0 0;
  padding: 0;
  list-style: none;
}

.access-request-locations-summary li {
  display: grid;
  gap: 2px;
  padding-top: 9px;
  border-top: 1px solid #e2e6e9;
}

.access-request-locations-summary li:first-child {
  padding-top: 0;
  border-top: 0;
}

.access-request-locations-summary li span,
.access-request-locations-summary li small {
  color: var(--gray-600);
  overflow-wrap: anywhere;
}

@media (max-width: 600px) {
  .auth-request-grid,
  .access-request-business-details {
    grid-template-columns: 1fr;
  }

  .auth-request-grid .full-span,
  .access-request-business-details .full-detail {
    grid-column: auto;
  }

  .additional-locations-heading,
  .access-location-card-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .additional-locations-heading button,
  .location-remove-button {
    width: 100%;
  }
}

.auth-gate.request-mode .auth-card { width: min(820px, 100%); }
.additional-locations[hidden] { display: none !important; }

/* Address-based administrator routing */
.readonly-role {
  display: grid;
  align-content: start;
  gap: 5px;
  min-height: 48px;
  padding: 11px 13px;
  border: 1px solid #cfd6dc;
  border-radius: 12px;
  background: var(--gray-50);
}

.readonly-role > span {
  color: var(--gray-700);
  font-size: .78rem;
  font-weight: 800;
}

.readonly-role > strong {
  color: var(--gray-900);
}

.existing-admin-redirect {
  display: grid;
  gap: 13px;
  padding: 16px;
  border: 1px solid #e0b75d;
  border-radius: 14px;
  background: var(--amber-soft);
}

.existing-admin-redirect[hidden] {
  display: none;
}

.existing-admin-redirect h3,
.existing-admin-redirect p {
  margin: 0;
}

.existing-admin-redirect > div:first-child > p:last-child {
  margin-top: 5px;
  color: var(--gray-700);
  font-size: .88rem;
  line-height: 1.5;
}

.existing-admin-redirect-list {
  display: grid;
  gap: 10px;
}

.existing-admin-card {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px;
  padding: 13px;
  border: 1px solid #dfc98f;
  border-radius: 12px;
  background: #fff;
}

.existing-admin-card > div {
  display: grid;
  gap: 3px;
}

.existing-admin-contact {
  grid-column: 1 / -1;
}

.existing-admin-contact a {
  width: fit-content;
  color: var(--blue-dark);
  font-weight: 800;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.approval-role-note {
  display: grid;
  align-content: center;
  gap: 3px;
  min-height: 48px;
  padding: 9px 11px;
  border: 1px solid #d9dee3;
  border-radius: 11px;
  background: var(--gray-50);
}

.approval-role-note small {
  color: var(--gray-600);
}

@media (max-width: 600px) {
  .existing-admin-card {
    grid-template-columns: 1fr;
  }

  .existing-admin-contact {
    grid-column: auto;
  }
}

/* Administrator replacement and Midwest account management */
.admin-replacement-option {
  display: grid;
  gap: 10px;
  padding: 15px;
  border: 1px solid #d9a95a;
  border-radius: 14px;
  background: #fff8e8;
}
.admin-replacement-option[hidden] { display: none; }
.admin-replacement-option > p { margin: 0; color: var(--gray-700); font-size: .88rem; line-height: 1.5; }
.replacement-warning { display: grid; gap: 3px; padding: 11px 13px; border-left: 4px solid var(--red); border-radius: 9px; background: #fff; }
.replacement-warning strong { color: var(--red-dark); }
.replacement-warning span { color: var(--gray-700); font-size: .84rem; line-height: 1.45; }
.admin-replacement-request { border-color: #d7a64f; background: #fffdf7; }
.replacement-admin-summary { margin-top: 12px; padding: 12px; border: 1px solid #ead7aa; border-radius: 11px; background: #fff8e8; }
.account-card-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.edit-admin-dialog { width: min(760px, calc(100% - 24px)); max-height: min(88vh, 900px); overflow: auto; }
.edit-admin-dialog input { font-family: inherit; letter-spacing: normal; }
.edit-admin-locations-section { margin-top: 18px; }
.edit-admin-locations-list { display: grid; gap: 12px; }
.admin-edit-location-card { display: grid; gap: 13px; padding: 14px; border: 1px solid #d2d8dd; border-radius: 13px; background: var(--gray-50); }
.admin-edit-location-heading { display: grid; gap: 2px; }
.admin-edit-location-heading span, .empty-admin-locations { color: var(--gray-600); font-size: .85rem; }
.empty-admin-locations { margin: 0; padding: 14px; border: 1px dashed #c4cbd1; border-radius: 12px; background: var(--gray-50); }
@media (max-width: 600px) {
  .account-card-actions { grid-column: 1 / -1; justify-content: stretch; }
  .account-card-actions > * { flex: 1 1 140px; text-align: center; }
  .edit-admin-dialog { width: calc(100% - 16px); }
}

/* Midwest Speedometer staff photo workflow */
.midwest-photo-panel {
  border-color: color-mix(in srgb, var(--accent, #a81f24) 32%, var(--gray-200));
}

.midwest-photo-panel .eyebrow {
  margin: 0 0 4px;
}

.midwest-photo-upload,
.midwest-detail-upload {
  background: linear-gradient(180deg, rgba(168, 31, 36, 0.055), rgba(168, 31, 36, 0.015));
}

.detail-photo-card {
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  background: var(--white);
}

.detail-photo-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  display: block;
  object-fit: cover;
  background: var(--gray-100);
}

.detail-photo-card figcaption {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 9px;
}

.detail-photo-card figcaption span {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.detail-photo-card figcaption strong,
.detail-photo-card figcaption small {
  overflow-wrap: anywhere;
}

.detail-photo-card figcaption small {
  color: var(--gray-600);
  font-size: 0.75rem;
}

.detail-photo-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 4px;
}

.photo-action-link,
.remove-detail-midwest-photo {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--blue-dark);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.photo-action-link:hover,
.photo-action-link:focus-visible {
  background: var(--blue-soft);
}

.remove-detail-midwest-photo {
  color: var(--danger, #a32128);
}

.remove-detail-midwest-photo:hover,
.remove-detail-midwest-photo:focus-visible {
  background: rgba(163, 33, 40, 0.08);
}

.midwest-photo-detail .detail-helper {
  margin-bottom: 12px;
}

.midwest-photo-detail .upload-zone {
  margin-bottom: 12px;
}

@media (max-width: 520px) {
  .detail-photo-card figcaption {
    align-items: stretch;
    flex-direction: column;
  }

  .detail-photo-actions {
    justify-content: flex-start;
  }
}


/* Calibration request completed-repair checklist */
.calibration-repair-dialog {
  width: min(820px, calc(100% - 24px));
  max-height: min(92vh, 980px);
  overflow: auto;
}

.calibration-repair-dialog input,
.calibration-repair-dialog textarea {
  font-family: inherit;
  letter-spacing: normal;
}

.calibration-guidance {
  display: grid;
  gap: 5px;
  margin: 0 0 16px;
  padding: 13px 14px;
  border: 1px solid #d5aa4c;
  border-radius: 13px;
  background: #fff8e6;
  color: #47340d;
}

.calibration-guidance span {
  color: #68551f;
  font-size: .9rem;
  line-height: 1.45;
}

.calibration-repair-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.calibration-repair-option {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  min-height: 100%;
  padding: 13px;
  border: 1px solid var(--gray-300);
  border-radius: 13px;
  background: #fff;
  cursor: pointer;
}

.calibration-repair-option:hover {
  border-color: #aa2a21;
  background: #fff8f7;
}

.calibration-repair-option:has(input:checked) {
  border-color: #a9271f;
  background: #fff0ee;
  box-shadow: inset 3px 0 0 #a9271f;
}

.calibration-repair-option input {
  flex: 0 0 auto;
  width: 19px;
  height: 19px;
  margin: 2px 0 0;
  accent-color: #aa2a21;
}

.calibration-repair-option span {
  display: grid;
  gap: 3px;
}

.calibration-repair-option strong {
  line-height: 1.28;
}

.calibration-repair-option small {
  color: var(--gray-500);
  line-height: 1.38;
}

.calibration-other-wrap {
  margin-top: 14px;
}

.calibration-summary-list {
  display: grid;
  gap: 7px;
  margin: 9px 0 0;
  padding-left: 20px;
}

.calibration-summary-list li {
  padding-left: 2px;
  line-height: 1.45;
}

.calibration-request-detail {
  border-color: #d5aa4c;
  background: #fffaf0;
}

@media (max-width: 700px) {
  .calibration-repair-grid { grid-template-columns: 1fr; }
  .calibration-repair-dialog { width: calc(100% - 16px); padding: 17px; }
}

/* Employee-only Revv ADAS workspace */
.revv-view .section-heading {
  align-items: flex-start;
}

.revv-connection-badge {
  background: var(--amber-soft);
  color: #825400;
  border: 1px solid #e7bd61;
}

.revv-connection-panel::before {
  background: linear-gradient(180deg, var(--gold), var(--blue));
}

.revv-connection-grid,
.revv-vehicle-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.revv-connection-item,
.revv-summary-card {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 15px;
  border: 1px solid #d2d8dd;
  border-radius: 13px;
  background: linear-gradient(180deg, #ffffff, #f6f7f8);
}

.revv-connection-item span,
.revv-summary-card span {
  color: var(--gray-500);
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.revv-connection-item strong,
.revv-summary-card strong {
  overflow-wrap: anywhere;
  color: #1a2026;
}

.revv-connection-item small {
  color: var(--gray-500);
  line-height: 1.4;
}

.revv-vehicle-summary {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 16px;
}

.revv-summary-card:first-child {
  border-color: #e3bd68;
  background: linear-gradient(180deg, #fffdf7, #fff7df);
}

.revv-summary-card:first-child strong {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  letter-spacing: .04em;
}

.revv-handoff-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 4px;
}

.revv-portal-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.revv-security-note {
  display: grid;
  gap: 4px;
  margin-top: 15px;
  padding: 13px 14px;
  border: 1px solid #e2b85a;
  border-radius: 12px;
  background: var(--amber-soft);
  color: #5e420c;
}

.revv-security-note span {
  font-size: .88rem;
  line-height: 1.45;
}

.revv-attachment-section {
  margin-top: 20px;
}

.revv-document-row .document-actions {
  flex-wrap: wrap;
}

.remove-revv-document {
  min-height: 36px;
  border: 1px solid #efb4b0;
  border-radius: 9px;
  background: #fff1f0;
  color: #991b1b;
  padding: 7px 10px;
  font-weight: 800;
}

.date-input-shell {
  display: flex;
  width: 100%;
  min-width: 0;
  min-height: 46px;
  border: 1px solid #bfc6cc;
  border-radius: 12px;
  background: #fcfcfd;
  padding: 10px 12px;
}

.date-input-shell:focus-within {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(201, 42, 42, .13);
  background: #fff;
}

.date-input-shell input[type="date"] {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
  box-shadow: none;
}

@media (max-width: 850px) {
  .revv-vehicle-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .revv-connection-grid,
  .revv-vehicle-summary {
    grid-template-columns: 1fr;
  }

  .revv-handoff-actions > * {
    width: 100%;
  }
}


/* Manual account creation, RO references, Midwest documents, and customer-savable notes */
.auth-manual-account-note {
  margin: 0.9rem 0 0;
  padding: 0.8rem 0.95rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255,255,255,0.04);
  color: var(--gray-500);
  font-size: 0.92rem;
}
.work-order-reference-panel {
  border-left: 4px solid var(--accent);
}
.midwest-document-panel .document-list,
.midwest-document-detail .detail-document-list {
  margin-top: 1rem;
}
.customer-note-panel textarea,
.customer-note-detail textarea {
  width: 100%;
}
.detail-note-text {
  white-space: normal;
  line-height: 1.55;
}
.detail-inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 0.85rem;
}
@media print {
  .detail-inline-actions,
  .midwest-detail-upload,
  .midwest-document-detail .upload-zone {
    display: none !important;
  }
}

/* All-in-one work-order summary PDF */
.summary-pdf-status {
  min-height: 1.25rem;
  margin: 0.75rem 0 0;
}

#downloadSummaryPdfButton[disabled] {
  cursor: not-allowed;
  opacity: 0.62;
}

#downloadSummaryPdfButton.is-building {
  cursor: progress;
  opacity: 0.72;
}

@media print {
  #downloadSummaryPdfButton,
  .summary-pdf-status {
    display: none !important;
  }
}


/* Android Chrome and installed-PWA refinements */
@media (display-mode: standalone) {
  .app-header {
    user-select: none;
  }

  body {
    min-height: 100dvh;
  }
}

@media (max-width: 720px) {
  .header-session,
  .header-actions {
    width: 100%;
  }

  .header-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .header-actions .icon-button {
    width: 100%;
  }
}

@supports (padding: max(0px)) {
  .employee-dialog,
  .order-dialog,
  .scanner-dialog {
    max-height: calc(100dvh - max(24px, env(safe-area-inset-top)) - max(24px, env(safe-area-inset-bottom)));
  }
}
/* Navy, Grey & White Theme */
:root {
  --navy: #0b1f3a;
  --navy-2: #16324f;
  --blue: #1e4e79;
  --blue-dark: #0b2f55;
  --blue-soft: #eaf2f8;
  --gold: #94a3b8;
  --red: #b42318;
  --red-soft: #fff4f2;
  --green: #18794e;
  --green-soft: #edf9f2;
  --gray-50: #f7f9fb;
  --gray-100: #edf1f5;
  --gray-200: #dce3ea;
  --gray-300: #bdc8d3;
  --gray-500: #687787;
  --gray-600: #506070;
  --gray-700: #344454;
  --white: #ffffff;
  --carbon: #08182c;
  --steel: #718096;
  --amber-soft: #edf3f8;
  --accent: #1e4e79;
  --line: #d6dee7;
  --muted: #687787;
  --shadow: 0 14px 34px rgba(11, 31, 58, 0.10);
}

html { background: #edf1f5; }

body {
  background-color: #f7f9fb;
  background-image:
    linear-gradient(rgba(11, 31, 58, 0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(11, 31, 58, 0.022) 1px, transparent 1px);
  background-size: 28px 28px;
  color: var(--navy);
  -webkit-tap-highlight-color: rgba(30, 78, 121, 0.16);
}

.app-header {
  background:
    linear-gradient(115deg, rgba(255,255,255,.04) 25%, transparent 25%) 0 0 / 18px 18px,
    linear-gradient(135deg, #08182c 0%, #0b1f3a 56%, #16324f 100%);
  border-bottom-color: #aeb9c5;
  box-shadow: 0 10px 26px rgba(8, 24, 44, .24);
}

.app-header::after {
  border-color: rgba(255,255,255,.07);
  box-shadow: 0 0 0 28px rgba(255,255,255,.035), 0 0 0 56px rgba(255,255,255,.024);
}

.brand-mark,
.auth-brand-mark {
  border-color: rgba(255,255,255,.24);
  background: linear-gradient(145deg, #244767, #0b1f3a);
  color: #ffffff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.14), 0 8px 18px rgba(3,12,24,.28);
}

.brand p,
.session-identity span,
.auth-brand p:not(.eyebrow) { color: #d5dee7; }

.icon-button {
  border-color: rgba(255,255,255,.34);
  background: rgba(255,255,255,.07);
}

.icon-button:hover {
  border-color: rgba(255,255,255,.72);
  background: rgba(255,255,255,.14);
}

.tabs {
  border-bottom-color: #c8d2dc;
  box-shadow: 0 5px 16px rgba(11,31,58,.07);
}

.tab { color: #617182; }
.tab.active {
  background: #eaf2f8;
  color: #0b2f55;
  box-shadow: inset 0 -3px 0 #1e4e79;
}
.count-pill,
.tab.active .count-pill { background: #dfe7ee; color: #344454; }
.tab.active .count-pill { background: #d5e4f0; color: #0b2f55; }

.eyebrow,
.document-link,
.order-number,
.auth-link-button { color: #0b2f55; }
.auth-link-button:hover { color: #1e4e79; }

.status-badge,
.order-status,
.mini-badge {
  border-color: #b8cad9;
  background: #eaf2f8;
  color: #0b2f55;
}

.panel,
.order-card,
.detail-card,
.photo-card,
.document-row,
.detail-document-row,
.account-card,
.access-request-card,
.revv-connection-item,
.revv-summary-card {
  border-color: #d6dee7;
  background-color: #ffffff;
  box-shadow: var(--shadow);
}

.panel::before,
.work-order-reference-panel {
  background: linear-gradient(180deg, #0b2f55, #8a9aaa);
  border-left-color: #1e4e79;
}

.panel-heading h3,
.panel-heading h4,
.employee-panel-heading h4,
.account-copy strong,
.revv-connection-item strong,
.revv-summary-card strong,
.auth-panel-heading h2 { color: #0b1f3a; }

input,
textarea,
select,
.date-input-shell {
  border-color: #b9c5d0;
  background: #ffffff;
  color: #0b1f3a;
}

input:hover,
textarea:hover,
select:hover { border-color: #8393a3; }

input:focus,
textarea:focus,
select:focus,
.date-input-shell:focus-within {
  border-color: #1e4e79;
  box-shadow: 0 0 0 4px rgba(30, 78, 121, .14);
  background: #ffffff;
}

.primary-button {
  border-color: #082b4d;
  background: linear-gradient(180deg, #245b88, #0b2f55);
  color: #ffffff;
  box-shadow: 0 6px 14px rgba(11,47,85,.22), inset 0 1px 0 rgba(255,255,255,.20);
}

.primary-button:hover {
  border-color: #061f38;
  background: linear-gradient(180deg, #1d4c75, #082b4d);
}

.secondary-button {
  border-color: #b9c5d0;
  background: linear-gradient(180deg, #ffffff, #edf1f5);
  color: #344454;
}
.secondary-button:hover { border-color: #8595a5; background: #e4eaf0; }

.choice-card {
  border-color: #c6d0da;
  background: linear-gradient(180deg, #ffffff, #f8fafc);
}
.choice-card:hover { border-color: #8797a6; }
.choice-card:has(input:checked) {
  border-color: #1e4e79;
  background: linear-gradient(135deg, #f5f9fc, #eaf2f8);
  box-shadow: inset 4px 0 0 #1e4e79;
}
.choice-card input,
.bypass-control input { accent-color: #1e4e79; }

.upload-zone {
  border-color: #aebac6;
  background:
    linear-gradient(rgba(255,255,255,.9), rgba(255,255,255,.9)),
    repeating-linear-gradient(135deg, #e5ebf1 0 10px, #f6f8fa 10px 20px);
}
.upload-zone:hover { border-color: #1e4e79; background: #eaf2f8; }
.upload-icon,
.document-icon,
.account-avatar {
  border-color: #bacbd9;
  background: #eaf2f8;
  color: #0b2f55;
}

.request-card { border-color: #c5cfd9; background: #e9eef3; color: #607080; }
.request-card.ready {
  border-color: #1e4e79;
  background: linear-gradient(135deg, #f6f9fc, #eaf2f8);
  color: #0b1f3a;
  box-shadow: inset 4px 0 0 #1e4e79;
}
.request-card.ready .request-icon,
.request-card.ready .request-state { background: #d5e4f0; color: #0b2f55; }

.employee-panel,
.employee-detail-panel,
.revv-security-note,
.install-note,
.auth-security-note,
.access-request-message,
.calibration-request-detail {
  border-color: #b8c7d5;
  background: linear-gradient(135deg, #f4f7fa, #e8eef4);
  color: #344454;
}

.employee-badge,
.revv-connection-badge {
  border: 1px solid #8fa4b7;
  background: #0b1f3a;
  color: #ffffff;
}

.bypass-control { border-color: #aebdca; }
.customer-scrub-section { border-color: #cbd5df; background: linear-gradient(180deg, #f8fafc, #edf1f5); }

.scanner-dialog,
.order-dialog,
.employee-dialog,
.install-dialog {
  border-color: #627487;
  background: #ffffff;
  box-shadow: 0 28px 90px rgba(8,24,44,.42);
}

dialog::backdrop { background: rgba(4, 15, 29, .78); }
.scanner-frame { border-color: #344d65; }
.scan-guide {
  border-color: #dce6ef;
  box-shadow: 0 0 0 999px rgba(0,0,0,.32), 0 0 22px rgba(220,230,239,.28);
}

.auth-gate {
  background:
    radial-gradient(circle at 80% 15%, rgba(148, 163, 184, .18), transparent 30%),
    radial-gradient(circle at 15% 85%, rgba(30, 78, 121, .22), transparent 34%),
    linear-gradient(145deg, #061426, #0b1f3a 56%, #16324f);
}

.auth-card {
  border-color: rgba(255,255,255,.18);
  background: #ffffff;
  box-shadow: 0 28px 90px rgba(2,12,24,.46);
}

.auth-brand {
  border-bottom-color: #9aa9b7;
  background:
    linear-gradient(115deg, rgba(255,255,255,.04) 25%, transparent 25%) 0 0 / 18px 18px,
    linear-gradient(135deg, #08182c, #16324f);
}
.auth-brand .eyebrow { color: #dce6ef; }
.auth-manual-account-note { background: #edf2f6; color: #5d6d7d; }

.organization-context > span { color: #d7e0e8; }
.organization-context select {
  border-color: rgba(255,255,255,.32);
  background: rgba(255,255,255,.10);
  color: #ffffff;
}
.organization-context select option { color: #0b1f3a; background: #ffffff; }
.session-identity { border-color: rgba(255,255,255,.18); background: rgba(2,12,24,.18); }

.revv-connection-panel::before { background: linear-gradient(180deg, #0b2f55, #8a9aaa); }
.revv-connection-badge { background: #eaf2f8; color: #0b2f55; }
.revv-summary-card:first-child {
  border-color: #b7c8d7;
  background: linear-gradient(180deg, #ffffff, #eaf2f8);
}
.revv-security-note { background: #eef3f7; color: #344454; }

.calibration-summary-list,
.calibration-repair-grid { accent-color: #1e4e79; }

.install-step-number { background: #0b2f55; color: #ffffff; }
.empty-state { border-color: #bdc8d3; background: rgba(255,255,255,.9); }

/* Retain clear semantic colors for destructive actions and success states. */
.danger-button,
.remove-photo,
.remove-revv-document { color: #a51f1f; }
.alert.success,
.request-card.requested,
.customer-document-status.available { color: var(--green); }


/* Calibration appointment scheduling */
.calibration-appointment-detail {
  border-color: var(--navy-200, #b8c8dc);
  background: linear-gradient(180deg, #ffffff 0%, #f4f7fb 100%);
}

.appointment-summary {
  display: grid;
  gap: 12px;
  margin-top: 14px;
  padding: 16px;
  border: 1px solid var(--gray-200);
  border-left: 5px solid var(--navy-700, #173a63);
  border-radius: 14px;
  background: #ffffff;
}

.appointment-summary.cancelled {
  border-left-color: #6b7280;
  background: #f3f4f6;
}

.appointment-status-row,
.appointment-date-time,
.appointment-location,
.appointment-notes {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.appointment-date-time,
.appointment-location,
.appointment-notes {
  flex-direction: column;
  gap: 3px;
}

.appointment-status {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: .82rem;
  font-weight: 800;
  color: #ffffff;
  background: var(--navy-700, #173a63);
}

.appointment-status.cancelled {
  background: #6b7280;
}

.appointment-editor {
  display: grid;
  gap: 14px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--gray-200);
}

.appointment-form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.appointment-form-grid label {
  display: grid;
  gap: 6px;
}

.appointment-location-field {
  grid-column: 1 / -1;
}

.appointment-editor input,
.appointment-editor textarea {
  width: 100%;
}

.appointment-badge {
  background: var(--navy-700, #173a63);
  color: #ffffff;
}

.appointment-badge.cancelled {
  background: #6b7280;
}

@media (max-width: 720px) {
  .appointment-form-grid {
    grid-template-columns: 1fr;
  }

  .appointment-location-field {
    grid-column: auto;
  }

  .appointment-status-row {
    flex-direction: column;
    gap: 6px;
  }
}


/* Owner contact button and dialog */
.auth-contact-button {
  width: 100%;
  margin-top: 12px;
}

.contact-us-dialog {
  width: min(560px, calc(100% - 24px));
}

.contact-owner-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  margin-top: 14px;
  border: 1px solid var(--gray-200);
  border-radius: 16px;
  background: var(--gray-100);
}

.contact-owner-card > div:last-child {
  display: grid;
  gap: 3px;
}

.contact-owner-card span {
  color: var(--gray-500);
  font-size: .9rem;
}

.contact-owner-mark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  border-radius: 50%;
  background: var(--navy-900, #0b1f3a);
  color: #fff;
  font-weight: 800;
  letter-spacing: .04em;
}

.contact-link-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.contact-link {
  display: grid;
  gap: 4px;
  min-height: 118px;
  padding: 16px;
  border: 1px solid var(--gray-200);
  border-radius: 16px;
  background: #fff;
  color: var(--navy);
  text-decoration: none;
  overflow-wrap: anywhere;
}

.contact-link:hover,
.contact-link:focus-visible {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(21, 58, 104, .14);
}

.contact-link-label {
  color: var(--gray-500);
  font-size: .82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.contact-link small {
  color: var(--blue);
  font-weight: 700;
}

.contact-link.is-disabled {
  cursor: not-allowed;
  opacity: .58;
}

.owner-contact-settings input[readonly] {
  background: var(--gray-100);
  color: var(--gray-500);
}

@media (max-width: 560px) {
  .contact-link-list {
    grid-template-columns: 1fr;
  }
}


/* Mobile-service appointment requirements and universal password changes */
.appointment-requirements,.appointment-requirements-editor{padding:12px 14px;border:1px solid var(--navy-200,#b8c8dc);border-radius:12px;background:var(--navy-50,#eef4fb);color:var(--gray-800,#1f2937)}
.appointment-requirements-editor{display:grid;gap:4px}.appointment-requirements span,.appointment-requirements-editor span{line-height:1.5}.change-password-dialog{width:min(92vw,560px)}
@media(max-width:600px){.header-actions{flex-wrap:wrap}.header-actions .icon-button{flex:1 1 calc(50% - 8px)}}

/* Shop signature, password recovery, Google Calendar, and voided records */
.auth-forgot-button {
  align-self: center;
  margin-top: -0.25rem;
}

.shop-signature-panel {
  border-color: #aebccc;
}

.signature-canvas-wrap {
  margin-top: 0.5rem;
  border: 2px solid #8fa1b5;
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
}

#shopSignatureCanvas {
  display: block;
  width: 100%;
  height: 180px;
  background: #fff;
  touch-action: none;
  cursor: crosshair;
}

.signature-mobile,
.signature-desktop {
  margin-top: 0.75rem;
}

.saved-signature {
  display: grid;
  gap: 0.6rem;
}

.saved-signature img {
  width: min(100%, 520px);
  min-height: 120px;
  max-height: 220px;
  object-fit: contain;
  object-position: left center;
  padding: 0.75rem;
  border: 1px solid #bdc8d5;
  border-radius: 10px;
  background: #fff;
}

.saved-signature span,
.appointment-calendar-status span,
.appointment-calendar-status small,
.calendar-connection-card span {
  display: block;
  color: var(--muted-text);
  font-size: 0.9rem;
}

.typed-signature-display {
  display: inline-block;
  min-width: 260px;
  padding: 0.7rem 0.25rem 0.35rem;
  border-bottom: 2px solid #536b84;
  font-family: "Segoe Script", "Bradley Hand", cursive;
  font-size: 1.55rem;
  color: #0b1f3a;
}

.google-calendar-settings .status-badge.success {
  background: #e7eef7;
  color: #123a63;
  border-color: #8fa8c2;
}

.calendar-connection-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  background: var(--soft-panel);
}

.calendar-connection-card > div:first-child {
  min-width: 0;
}

.appointment-calendar-status {
  display: grid;
  gap: 0.2rem;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-color);
}

.appointment-calendar-status a {
  width: fit-content;
  color: var(--accent-color);
  font-weight: 700;
}

.order-card.voided {
  opacity: 0.78;
  border-style: dashed;
}

.voided-badge {
  background: #e5e7eb;
  border-color: #7b8794;
  color: #2f3b48;
  font-weight: 800;
}

.forgot-password-dialog {
  max-width: 520px;
}

@media (max-width: 640px) {
  .calendar-connection-card {
    align-items: stretch;
    flex-direction: column;
  }

  #shopSignatureCanvas {
    height: 190px;
  }
}
