:root {
  --ink: #10234d;
  --muted-ink: #48607e;
  --canvas: #f2f6fc;
  --blue: #1e68d0;
  --blue-deep: #1757b2;
  --blue-soft: #e7f0fc;
  --edge: #dbe5f1;
  font-family: 'Noto Sans Thai', 'Segoe UI', system-ui, sans-serif;
  color: var(--ink);
  background: var(--canvas);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  line-height: 1.5;
}
.sign-in .workspace-bar {
  display: none;
}

.cloud-gate:not([hidden]) {
  display: grid;
  place-items: center;
  min-height: 100svh;
  padding: 24px;
  background: radial-gradient(ellipse at top, #dceeff, #f3f8fd 65%);
}

.cloud-card {
  width: min(100%, 400px);
  padding: clamp(24px, 6vw, 36px);
  border: 1px solid #d3e3ef;
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 14px 42px #143e6514;
  color: #17324b;
  text-align: center;
}

.cloud-card .brand-mark { margin: 0 auto 14px; }
.cloud-card h2 { margin: 0; font-size: 1.75rem; }
.cloud-card > p { margin: 4px 0 24px; color: #48637a; }
.cloud-card form:not([hidden]) { display: grid; gap: 8px; text-align: left; }
.cloud-card label { margin-top: 10px; font-weight: 600; }
.cloud-card input {
  width: 100%;
  min-width: 0;
  min-height: 48px;
  font-size: 1rem;
  border: 1px solid #bfcde0;
  border-radius: 10px;
}
.cloud-card input:focus {
  border-color: #377ff5;
  outline: 2px solid #377ff5;
  outline-offset: -1px;
}
.cloud-password { position: relative; }
.cloud-password input { padding-inline-end: 52px; }
.cloud-password #cloudReveal {
  position: absolute;
  inset-inline-end: 3px;
  top: 50%;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #48637a;
  box-shadow: none;
}
.cloud-password #cloudReveal:hover { color: var(--blue); }
#cloudReveal svg { width: 21px; height: 21px; }
#cloudReveal[aria-pressed="true"] .cloud-eye-slash { display: none; }
.cloud-card button { min-height: 44px; }
#cloudFeedback { min-height: 1.5em; margin: 2px 0; color: #932634; }

.startup-status {
  width: min(450px, calc(100% - 24px));
  margin: 24px auto;
  padding: 16px;
  border: 1px solid var(--edge);
  border-radius: 12px;
  background: white;
}
.startup-status h2 {
  margin-bottom: 6px;
}
.demo-banner {
  margin: 0 0 12px;
  padding: 9px 12px;
  border: 1px solid var(--edge);
  border-radius: 9px;
  background: var(--blue-soft);
  color: var(--ink);
  font-size: 14px;
}
header {
  background: linear-gradient(120deg, #0c4d87, #0aa4b3);
  color: white;
  padding: 24px max(18px, calc((100vw - 1100px) / 2));
}
header h1 {
  margin: 0;
  font-size: 27px;
}
header p {
  opacity: 0.85;
  margin: 5px 0 0;
}
.wrap {
  max-width: 1100px;
  margin: auto;
  padding: 18px;
}
.tabs {
  display: flex;
  gap: 8px;
  overflow: auto;
  margin-bottom: 20px;
}
.tabs button {
  white-space: nowrap;
}
.btn,
button {
  border: 0;
  border-radius: 12px;
  padding: 11px 15px;
  background: var(--blue-soft);
  color: var(--blue-deep);
  font-family: inherit;
  font-weight: 650;
  cursor: pointer;
}
.primary,
.active {
  background: var(--blue) !important;
  color: white !important;
}
.grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.card,
.panel {
  background: white;
  border-radius: 17px;
  padding: 19px;
  box-shadow: 0 3px 14px #1b4b6d0c;
}
.card small {
  color: #64748b;
}
.card strong {
  display: block;
  font-size: 24px;
  margin-top: 7px;
}
.panel {
  margin-top: 15px;
}
h2 {
  font-size: 19px;
  margin: 0 0 15px;
}
h1,
h2,
h3 {
  font-weight: 800;
  line-height: 1.3;
}
a {
  color: var(--blue-deep);
}
:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}
table {
  border-collapse: collapse;
  width: 100%;
  font-size: 14px;
}
td,
th {
  text-align: left;
  padding: 12px 8px;
  border-bottom: 1px solid #e9eef3;
}
th {
  color: #607086;
}
input,
select,
textarea {
  width: 100%;
  padding: 11px;
  border: 1px solid #d5e1eb;
  border-radius: 10px;
  font: inherit;
  background: white;
}
label {
  display: block;
  font-size: 13px;
  color: #50657b;
  margin-bottom: 5px;
}
.form {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.full {
  grid-column: 1/-1;
}
.hidden {
  display: none;
}
.pill {
  border-radius: 20px;
  padding: 4px 9px;
  background: #e5f7ec;
  color: #117a45;
  font-size: 12px;
}
.due {
  background: #fff0e6;
  color: #ae5b17;
}
.danger,
.pill.cancelled {
  background: #fce8e8;
  color: #a22424;
}
.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 15px;
}
.muted {
  color: var(--muted-ink);
  font-size: 13px;
}
.bar {
  height: 12px;
  border-radius: 10px;
  background: #e6edf5;
  overflow: hidden;
}
.bar span {
  display: block;
  background: var(--blue);
  height: 100%;
}
.two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}
.scroll {
  overflow: auto;
}
#toast {
  position: fixed;
  bottom: 22px;
  right: 20px;
  background: #153a56;
  color: white;
  padding: 13px 18px;
  border-radius: 12px;
  display: none;
}
@media (max-width: 760px) {
  .grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .two {
    grid-template-columns: 1fr;
  }
  .card strong {
    font-size: 20px;
  }
  header {
    padding: 20px;
  }
}
.cal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 5px;
  margin-top: 12px;
}
.cal-week {
  text-align: center;
  font-size: 12px;
  color: #64748b;
  padding: 8px 0;
}
.cal-day {
  min-height: 72px;
  padding: 8px 4px;
  border: 1px solid #e1e9f1;
  background: #fff;
  border-radius: 10px;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 14px;
}
.cal-day.selected {
  outline: 2px solid var(--blue);
  background: var(--blue-soft);
}
.cal-day.other {
  opacity: 0.3;
}
.cal-dot {
  font-size: 10px;
  line-height: 1.3;
  color: var(--blue-deep);
  overflow-wrap: anywhere;
}
.cal-detail {
  margin-top: 15px;
  padding: 14px;
  border-radius: 12px;
  background: #f2f7fb;
}
.cal-detail p {
  margin: 8px 0;
}
.cal-head .actions {
  align-items: center;
}
.calendar-month-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}
.calendar-month-controls button {
  min-width: 44px;
  min-height: 44px;
  padding-inline: 9px;
  flex: none;
}
.calendar-export {
  min-height: 44px;
  padding-inline: 10px;
  margin-inline-start: auto;
  border: 1px solid var(--edge);
  background: white;
}
@media (max-width: 600px) {
  .cal-day {
    min-height: 62px;
    font-size: 12px;
  }
  .cal-dot {
    font-size: 9px;
  }
  .cal-grid {
    gap: 3px;
  }
  .cal-head h2 {
    font-size: 17px;
  }
}

.cal-day.is-today {
  border: 2px solid #e38a23;
  background: #fff9ed;
}
.today-tag {
  display: block;
  font-size: 11px;
  color: #a65a00;
  font-weight: 750;
  margin-top: 3px;
}
#todayLabel {
  font-weight: 700;
  color: #9b5700;
  margin: 8px 0 4px;
}
/* Simplified mobile-first navigation */
header {
  background: #fff;
  color: var(--ink);
  border-bottom: 1px solid #e6ebf1;
  padding: 18px max(16px, calc((100vw - 960px) / 2));
}
header h1 {
  font-size: 24px;
}
header p {
  color: #60758a;
}
.wrap {
  max-width: 960px;
  padding: 16px 14px 88px;
}
.tabs {
  position: sticky;
  top: 0;
  z-index: 20;
  background: #fff;
  border: 1px solid #e9edf2;
  border-radius: 16px;
  padding: 6px;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 3px;
  box-shadow: 0 4px 14px #172b4210;
}
.tabs button {
  padding: 12px 4px;
  font-size: 13px;
  white-space: normal;
  line-height: 1.3;
  background: transparent;
  border-radius: 11px;
}
.tabs button.active {
  background: var(--blue-soft) !important;
  color: var(--blue-deep) !important;
}
.panel,
.card {
  box-shadow: 0 2px 12px #19334d0a;
  border: 1px solid #e9eef4;
}
.panel {
  padding: 18px;
}
.grid {
  gap: 9px;
}
.card {
  padding: 15px;
}
.card strong {
  font-size: 21px;
}
.btn,
button {
  min-height: 42px;
}
#jobs > .panel:first-child,
#jobsInner > .panel:first-child {
  display: none !important;
}
#jobsInner .panel {
  margin-top: 14px;
}
#jobForm [name='photo'] {
  display: none;
}
#jobForm [name='photo'] + * {
  display: none;
}
#quick {
  display: none !important;
}
.table-action {
  font-size: 12px;
}
#customers .panel {
  margin-top: 0;
}
.primary {
  background: var(--blue) !important;
  color: white !important;
}
#jobsInner > #historyPanel {
  padding-top: 16px;
}
#jobForm input,
#jobForm select {
  font-size: 16px;
}
@media (max-width: 600px) {
  header {
    padding: 16px;
  }
  .wrap {
    padding: 12px 10px 88px;
  }
  .panel {
    padding: 13px;
  }
  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .card {
    padding: 12px;
  }
  .card strong {
    font-size: 18px;
  }
}
.appointment-card {
  padding: 15px 0;
  border-bottom: 1px solid var(--edge);
}
.appointment-card:last-of-type {
  margin-bottom: 12px;
}
.appointment-title {
  font-weight: 750;
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.appointment-card p {
  margin: 8px 0;
}
.appointment-card .actions {
  margin-top: 10px;
}
.action-link {
  display: inline-flex;
  align-items: center;
  padding: 10px 12px;
  min-height: 42px;
  border-radius: 12px;
  background: var(--blue-soft);
  color: var(--blue-deep);
  font-weight: 650;
  text-decoration: none;
  font-size: 13px;
}
#dashDayDetail .appointment-card {
  background: #fff;
  padding: 14px;
  margin: 12px 0;
  border: 1px solid var(--edge);
  border-radius: 12px;
}

.cal-appt {
  display: block;
  width: 100%;
  font-size: 10px;
  line-height: 1.35;
  color: #164b69;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: left;
}
.cal-more {
  display: block;
  font-size: 10px;
  color: #64748b;
  text-align: left;
}
.cal-day {
  min-height: 92px;
  overflow: hidden;
}
@media (max-width: 600px) {
  .cal-day {
    min-height: 78px;
    padding: 5px 3px;
  }
  .cal-appt {
    font-size: 9px;
  }
}
.flow-guide {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #f0f8fc;
  border: 1px solid #d7e9f4;
  border-radius: 14px;
  padding: 13px;
  margin-bottom: 18px;
}
.flow-step {
  display: flex;
  align-items: center;
  gap: 9px;
  flex: 1;
  min-width: 0;
}
.flow-step b {
  display: block;
  font-size: 13px;
}
.flow-step small {
  display: block;
  color: #59738a;
  font-size: 11px;
  margin-top: 3px;
}
.flow-num {
  flex-shrink: 0;
  background: var(--blue);
  color: white;
  border-radius: 50%;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  font-weight: 800;
}
.flow-arrow {
  color: #7f9bad;
  font-size: 23px;
}
@media (max-width: 600px) {
  .flow-guide {
    gap: 4px;
    padding: 9px;
  }
  .flow-step {
    display: block;
    text-align: center;
  }
  .flow-num {
    margin: 0 auto 6px;
  }
  .flow-step b {
    font-size: 11px;
  }
  .flow-step small {
    font-size: 10px;
  }
  .flow-arrow {
    font-size: 15px;
  }
}

/* Keep date and job status on a single line in job history. */
#jobList {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
#jobList table {
  width: 100%;
  min-width: 790px;
  border-collapse: collapse;
}
#jobList th:first-child,
#jobList td:first-child {
  white-space: nowrap;
  min-width: 112px;
  font-variant-numeric: tabular-nums;
}
#jobList th:nth-child(2),
#jobList td:nth-child(2) {
  min-width: 155px;
}
#jobList th:nth-child(2),
#jobList td:nth-child(2) small {
  white-space: nowrap;
}
#jobList th:nth-child(5),
#jobList td:nth-child(5) {
  white-space: nowrap;
  min-width: 166px;
}
#jobList th:nth-child(3),
#jobList th:nth-child(4),
#jobList td:nth-child(3),
#jobList td:nth-child(4) {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
#jobList td:nth-child(5) .pill {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  max-width: none;
  width: max-content;
}
#jobList td:last-child {
  min-width: 224px;
}
#jobList th {
  background: #f3f7fb;
}
#jobList tbody tr:nth-child(even) {
  background: #f9fbfd;
}
#jobList td {
  vertical-align: top;
  padding-block: 15px;
}
#jobList td strong {
  color: var(--ink);
}
.job-meta,
.job-paid,
.job-balance {
  display: block;
  margin-top: 4px;
  line-height: 1.4;
}
.job-meta {
  color: #52677a;
}
.job-paid {
  color: #117a45;
}
.job-balance {
  color: #a45a1c;
}
.job-actions {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 6px;
}
.job-actions button,
.job-menu summary {
  margin: 0;
  padding: 7px 10px;
  min-height: 36px;
  border-radius: 8px;
  font-size: 13px;
  white-space: nowrap;
}
.job-menu summary {
  display: list-item;
  width: max-content;
  max-width: 100%;
  border: 1px solid var(--edge);
  color: var(--blue-deep);
  background: white;
  font-weight: 650;
  cursor: pointer;
}
.job-menu[open] {
  flex-basis: 100%;
}
.job-menu:not([open]) .job-menu-options {
  display: none;
}
.job-menu-options {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 6px;
  padding: 6px;
  border: 1px solid var(--edge);
  border-radius: 10px;
  background: white;
}
.job-actions .job-delete {
  background: #fce8e8;
  color: #a22424;
}

.form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.form > *,
.two > *,
input,
select,
textarea {
  min-width: 0;
  max-width: 100%;
}
.panel,
.card,
.modal-overlay > * {
  overflow-wrap: anywhere;
}
.modal-overlay {
  align-items: flex-start !important;
  overflow: auto !important;
  overscroll-behavior: contain;
}
.modal-overlay > * {
  min-width: 0;
  max-width: 100%;
  margin-block: auto !important;
}
body:has(.modal-overlay) {
  overflow: hidden;
}
.finish-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 74px 130px 52px;
  gap: 8px;
  align-items: end;
  margin-block: 8px;
  padding: 10px;
  border: 1px solid var(--edge);
  border-radius: 10px;
}
.finish-line label {
  margin: 0;
}
.finish-line .f-remove {
  padding-inline: 0;
  color: #a22424;
  background: #fce8e8;
}
.finish-dialog,
.money-dialog,
.finish-confirmation {
  color: var(--ink);
  border: 1px solid var(--edge);
  border-radius: 16px;
  width: min(680px, calc(100% - 28px));
  max-height: min(850px, calc(100dvh - 24px));
  padding: 0;
  box-shadow: 0 18px 60px #10234d35;
}
.finish-dialog::backdrop,
.money-dialog::backdrop,
.finish-confirmation::backdrop {
  background: #10234d9c;
}
.finish-dialog[open] {
  display: flex;
  overflow: hidden;
}
body:has(.finish-dialog[open], .finish-confirmation[open], .money-dialog[open]) {
  overflow: hidden;
}
.money-dialog {
  padding: clamp(14px, 3vw, 24px);
}
.money-list-heading {
  padding-block: 4px 14px;
}
.finish-shell {
  display: flex;
  flex-direction: column;
  min-width: 0;
  width: 100%;
}
.finish-shell [hidden] {
  display: none;
}
.finish-header,
.finish-body,
.finish-footer {
  padding: 14px 20px;
}
.finish-header {
  border-bottom: 1px solid var(--edge);
}
.finish-header h2,
.finish-body h3 {
  margin: 0 0 5px;
}
.finish-header p,
.finish-body h3 + p {
  margin: 0 0 8px;
}
.finish-header p span {
  color: var(--muted-ink);
}
.finish-steps {
  display: flex;
  gap: 6px;
  padding: 0;
  margin: 0;
  list-style: none;
  font-size: 13px;
}
.finish-steps li {
  flex: 1;
  border-radius: 8px;
  background: var(--canvas);
  color: var(--muted-ink);
  padding: 6px 8px;
}
.finish-steps li[aria-current='step'] {
  color: var(--blue-deep);
  background: var(--blue-soft);
  font-weight: 750;
}
.finish-body {
  overflow: auto;
  overscroll-behavior: contain;
  min-height: 0;
}
.finish-body input,
.finish-body textarea,
.finish-body select {
  font-size: 16px;
}
.finish-body button,
.finish-footer button,
.finish-options summary {
  min-height: 44px;
}
.finish-item-tools {
  display: grid;
  gap: 8px;
  justify-items: start;
}
.finish-options {
  min-width: 0;
  border: 1px solid var(--edge);
  border-radius: 10px;
  background: var(--canvas);
}
.finish-options summary {
  padding: 10px;
  color: var(--blue-deep);
  cursor: pointer;
  font-weight: 700;
}
.finish-catalog {
  width: 100%;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--edge);
  border-radius: 10px;
  background: var(--canvas);
}
.finish-catalog label {
  font-weight: 700;
  color: var(--ink);
}
.finish-catalog-feedback {
  margin: 8px 0 0;
}
.finish-catalog-feedback:empty {
  margin: 0;
}
.finish-catalog-results {
  list-style: none;
  margin: 0;
  padding: 0;
}
.finish-catalog-results li,
.finish-catalog-action {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  align-items: center;
}
.finish-catalog-results li {
  justify-content: space-between;
  padding-block: 7px;
  border-bottom: 1px solid var(--edge);
}
.finish-catalog-results li > div {
  min-width: 0;
  overflow-wrap: anywhere;
}
.finish-catalog-results small {
  display: block;
  color: var(--muted-ink);
}
.finish-catalog-action span {
  font-size: 14px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}
.finish-catalog-action button {
  min-width: 54px;
}
.finish-catalog-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}
.finish-note {
  margin-block: 10px;
}
.finish-note textarea,
.finish-note-label {
  margin-inline: 10px;
}
.finish-note textarea {
  width: calc(100% - 20px);
  margin-bottom: 8px;
}
.finish-review-total,
.finish-totals > div {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 3px 10px;
}
.finish-review-total,
.finish-totals {
  margin: 10px 0 0;
  padding: 10px 12px;
  background: var(--blue-soft);
  border-radius: 10px;
}
.finish-totals dd {
  margin: 0;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.finish-totals > div + div {
  margin-top: 4px;
}
.finish-total-due {
  border-top: 1px solid var(--edge);
  padding-top: 6px;
}
.finish-choices {
  min-width: 0;
  margin: 6px 0 10px;
  padding: 6px;
  border: 1px solid var(--edge);
  border-radius: 10px;
}
.finish-choices legend {
  padding-inline: 4px;
  font-weight: 700;
}
.finish-choices label {
  display: flex;
  gap: 8px;
  align-items: center;
  min-height: 44px;
  margin: 2px 0;
  padding: 5px 8px;
  border-radius: 8px;
  color: var(--ink);
  font-size: 14px;
}
.finish-choices label:has(input:checked) {
  background: var(--blue-soft);
}
.finish-choices label:has(input:disabled) {
  opacity: 0.52;
}
.finish-choices input[type='radio'] {
  width: 17px;
  height: 17px;
  min-height: 0;
  margin: 0;
  accent-color: var(--blue);
}
.finish-overpay,
.finish-warning {
  background: #fff5e8;
  color: #8a4c16;
}
.finish-warning {
  padding: 8px;
  border-radius: 8px;
  font-size: 14px;
}
.finish-footer {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  border-top: 1px solid var(--edge);
}
.finish-footer .primary {
  margin-inline-start: auto;
}
.finish-footer-review {
  display: none;
}
@media (max-width: 600px), (max-height: 730px) {
  .finish-footer-review {
    display: flex;
    flex: 0 0 100%;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 2px 8px;
    font-size: 13px;
  }
  .finish-footer-review small {
    flex-basis: 100%;
    color: #8a4c16;
  }
}
.finish-error,
.finish-shell > .save-feedback {
  margin: 0;
  padding: 7px 20px;
  color: #912929;
  background: #fff0f0;
}
.finish-shell > .save-feedback:empty {
  display: none;
}
.finish-body [aria-invalid='true'] {
  outline: 2px solid #ae3535;
}
.finish-confirmation {
  width: min(430px, calc(100% - 28px));
  padding: 18px;
}
.finish-confirmation h2,
.finish-confirmation p {
  margin: 0 0 6px;
}
.finish-shell button:disabled {
  opacity: 0.55;
  cursor: default;
}

@media (pointer: coarse), (max-width: 880px) {
  button,
  .action-link,
  input:not([type='hidden']),
  select {
    min-height: 44px;
  }
  input,
  select,
  textarea {
    font-size: 16px;
  }
  .job-actions button,
  .job-menu summary {
    min-height: 44px;
  }
  label,
  .muted {
    font-size: 14px;
  }
}

@media (max-width: 880px) {
  .responsive-table,
  #jobList table {
    display: block;
    min-width: 0;
  }
  .responsive-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
  .responsive-table tbody {
    display: grid;
    gap: 10px;
  }
  .responsive-table tbody tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 10px;
    min-width: 0;
    padding: 4px 12px;
    border: 1px solid var(--edge);
    border-radius: 12px;
    background: #f9fbfd;
  }
  .responsive-table td,
  #jobList .responsive-table td {
    display: block;
    min-width: 0;
    padding: 8px 0;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  #jobList .responsive-table td:nth-child(3),
  #jobList .responsive-table td:nth-child(4) {
    white-space: nowrap;
  }
  #jobList .responsive-table td:nth-child(2) small {
    white-space: normal;
  }
  .responsive-table td:last-child {
    border-bottom: 0;
  }
  .responsive-table td[colspan],
  .responsive-table td:last-child,
  #customerList td:nth-child(3),
  #jobList td:nth-child(2),
  #partList td:first-child,
  #partList td:nth-child(4),
  #moneyList td:nth-child(3),
  #moneyList td:nth-child(4) {
    grid-column: 1 / -1;
  }
  #jobList tr:has(td[data-label]) {
    grid-template-areas:
      'date status'
      'customer customer'
      'price paid'
      'actions actions';
  }
  #jobList td:nth-child(1):not([colspan]) {
    grid-area: date;
  }
  #jobList td:nth-child(2) {
    grid-area: customer;
  }
  #jobList td:nth-child(3) {
    grid-area: price;
  }
  #jobList td:nth-child(4) {
    grid-area: paid;
  }
  #jobList td:nth-child(5) {
    grid-area: status;
  }
  #jobList td:nth-child(6) {
    grid-area: actions;
  }
  .responsive-table td[data-label]::before {
    display: block;
    margin-bottom: 3px;
    color: #50657b;
    content: attr(data-label);
    font-size: 12px;
    font-weight: 650;
  }
  .responsive-table td > button {
    margin: 3px 4px 3px 0;
    white-space: normal;
  }
  #jobList td:nth-child(5) .pill {
    max-width: 100%;
    white-space: normal;
  }
}

/* Shared page styling */
header {
  background: #eaf2fe;
  border-bottom-color: #dce9f5;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--blue);
  color: white;
  font-size: 26px;
}
.brand p {
  margin-top: 2px;
  color: #456482;
  font-size: 14px;
}
.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.section-heading h2 {
  margin: 0;
}
#dashDayDetail .appointment-card {
  padding: 12px;
  margin: 0;
  border: 1px solid var(--edge);
  border-radius: 12px;
  background: #f8fbfe;
}
#dashDayDetail .appointment-card {
  margin-block: 10px;
  background: white;
}
.appointment-meta,
.appointment-title {
  display: flex;
  gap: 6px 10px;
  align-items: center;
  flex-wrap: wrap;
}
.appointment-meta {
  color: #4d6d86;
  font-size: 13px;
  font-weight: 650;
  margin-bottom: 5px;
  font-variant-numeric: tabular-nums;
}
.appointment-title {
  justify-content: space-between;
  color: var(--ink);
}
.appointment-card p {
  margin: 4px 0;
  color: #445d73;
  font-size: 14px;
}
.appointment-card .job-actions {
  margin-top: 10px;
}
.appointment-card a,
#customerList a {
  color: var(--blue-deep);
}
.record-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 5px;
  background: #f0f5fa;
  border-radius: 13px;
}
.record-tabs button {
  flex: 1 1 auto;
  background: transparent;
  border-radius: 9px;
}
:is(#records, #reports) form {
  background: #f7fbff;
  border: 1px solid #e0eaf4;
  border-radius: 12px;
  padding: 14px;
}
:is(#records, #reports) label {
  font-weight: 650;
}
#customerList,
#serviceList {
  margin-top: 16px;
}
#customers .responsive-table th,
:is(#records, #reports) .responsive-table th {
  background: #f3f7fb;
  white-space: nowrap;
}
#customers .responsive-table tbody tr:nth-child(even),
:is(#records, #reports) .responsive-table tbody tr:nth-child(even) {
  background: #f9fbfd;
}
#customers .responsive-table td,
:is(#records, #reports) .responsive-table td {
  vertical-align: top;
}
.money-value {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.data-actions {
  border-top: 1px solid #dee8f2;
  margin-top: 24px;
  padding-top: 14px;
  align-items: flex-end;
}
.list-pagination,
.pagination-buttons,
.list-pagination label {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.list-pagination {
  justify-content: space-between;
  margin-top: 12px;
}
.list-pagination label {
  margin: 0;
}
.list-pagination select {
  width: auto;
  min-width: 76px;
}
.pagination-status {
  color: var(--muted-ink);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.pagination-buttons button:disabled {
  opacity: 0.55;
  cursor: default;
}

.workspace-view {
  display: none;
}
.dashboard-schedule > .panel:first-child,
.dashboard-side > .panel:first-child {
  margin-top: 0;
}
.dashboard-side {
  min-width: 0;
}
.calendar-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}
.calendar-summary .card {
  min-width: 0;
  padding: 12px;
}
.calendar-summary small {
  display: block;
  line-height: 1.35;
}
.calendar-summary small:first-child {
  font-weight: 700;
  color: var(--ink);
}
.calendar-summary strong {
  margin-block: 3px;
  font-variant-numeric: tabular-nums;
}
.calendar-summary .calendar-income {
  background: var(--blue-soft);
}
.calendar-summary .calendar-complete {
  background: #eff8f3;
}
.calendar-summary .calendar-summary-period {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 16px;
}
.calendar-summary .calendar-cancelled {
  background: #fff7eb;
}
.finance-panel .section-heading button {
  min-height: 36px;
  padding: 7px 10px;
}
.finance-value {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 3px 10px;
  margin: 14px 0 5px;
  color: #48637a;
  font-size: 13px;
}
.finance-value strong {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.finance-panel .bar {
  height: 8px;
}
.finance-panel .bar span {
  background: var(--blue);
}
.finance-month-bar {
  display: flex;
}
.finance-panel .finance-month-bar span,
.finance-legend i {
  background: #78a9ee;
}
.finance-panel .finance-expense {
  background: #8997a8;
}
.finance-legend {
  margin-top: 6px;
}
.finance-legend i {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-inline-end: 6px;
  border-radius: 50%;
}

@media (min-width: 1120px) {
  :root {
    --workspace-sidebar: 208px;
    --workspace-content: 1450px;
  }
  .workspace-bar {
    position: sticky;
    top: 0;
    z-index: 30;
    margin-inline-start: var(--workspace-sidebar);
    padding: 15px 24px;
    background: white;
  }
  .workspace-bar .brand {
    position: fixed;
    inset: 21px auto auto 14px;
    width: calc(var(--workspace-sidebar) - 28px);
    color: #f4f9ff;
  }
  .workspace-bar .brand h1 {
    font-size: 19px;
    white-space: nowrap;
  }
  .workspace-bar .brand-mark {
    width: 39px;
    height: 39px;
    border-radius: 11px;
    font-size: 22px;
  }
  .workspace-bar .brand p {
    color: #bdcfe0;
    font-size: 12px;
  }
  .workspace-view {
    display: block;
    color: #466782;
    font-weight: 700;
  }
  .workspace-bar:has(.workspace-view:empty) {
    padding-block: 0;
    border-bottom: 0;
  }
  .wrap {
    width: calc(100% - var(--workspace-sidebar));
    max-width: var(--workspace-content);
    margin-inline-start: max(
      var(--workspace-sidebar),
      calc((100% + var(--workspace-sidebar) - var(--workspace-content)) / 2)
    );
    padding: 22px 24px 36px;
  }
  .tabs {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 21;
    width: var(--workspace-sidebar);
    margin: 0;
    padding: 91px 12px 16px;
    border: 0;
    border-radius: 0;
    background: linear-gradient(165deg, #132854, #0d1f45 70%);
    box-shadow: none;
    grid-template-columns: minmax(0, 1fr);
    align-content: start;
    gap: 6px;
  }
  .tabs button {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 10px 12px;
    text-align: start;
    color: #e5f1fa;
    font-size: 14px;
  }
  .tabs button:hover {
    background: #203c68;
  }
  .tabs button.active {
    background: #e1edff !important;
    color: #163d78 !important;
  }
  #historyPanel,
  :is(#records, #reports) form {
    scroll-margin-top: 68px;
  }
}

@media (min-width: 900px) {
  .dashboard-schedule {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
    align-items: start;
    gap: 14px;
  }
}

@media (max-width: 600px) {
  :is(#records, #reports) form {
    padding: 10px;
  }
  .record-tabs button {
    padding-inline: 6px;
    font-size: 13px;
  }
}

@media (min-width: 601px) and (max-width: 880px) {
  .responsive-table tbody {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }
  .responsive-table tr:has(td[colspan]) {
    grid-column: 1 / -1;
  }
}

@media (min-width: 601px) and (max-width: 1024px) {
  #dashCalendar .cal-day {
    min-height: 72px;
  }
  #dashCalendar .cal-appt ~ .cal-appt {
    display: none;
  }
}

@media (min-width: 601px) and (max-height: 480px) {
  .finish-dialog {
    max-height: calc(100dvh - 12px);
  }
  .finish-header {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: baseline;
    gap: 2px 14px;
  }
  .finish-header,
  .finish-body,
  .finish-footer {
    padding-block: 7px;
  }
  .finish-steps {
    grid-column: 1 / -1;
  }
  .finish-choices {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
  }
  .finish-overpay {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  header {
    padding-top: max(16px, env(safe-area-inset-top));
    padding-inline: max(16px, env(safe-area-inset-left))
      max(16px, env(safe-area-inset-right));
  }
  .wrap {
    padding-inline: max(10px, env(safe-area-inset-left))
      max(10px, env(safe-area-inset-right));
    padding-bottom: calc(88px + env(safe-area-inset-bottom));
  }
  .tabs {
    position: fixed;
    inset: auto 0 0;
    margin: 0;
    border-radius: 16px 16px 0 0;
    padding: 4px max(6px, env(safe-area-inset-right))
      calc(4px + env(safe-area-inset-bottom))
      max(6px, env(safe-area-inset-left));
    overflow: visible;
    box-shadow: 0 -4px 20px #172b421a;
  }
  .tabs button {
    min-height: 54px;
    padding: 5px 2px;
    font-size: 12px;
  }
  .tabs button span {
    display: block;
    margin-bottom: 3px;
    font-size: 17px;
  }
  .form {
    grid-template-columns: minmax(0, 1fr);
  }
  .cal-head {
    gap: 8px;
  }
  .cal-head h2 {
    margin-bottom: 0;
  }
  .calendar-month-controls {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    gap: 4px;
  }
  .calendar-month-controls strong {
    text-align: center;
    font-size: 13px;
  }
  .list-pagination {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
  }
  .pagination-status {
    text-align: end;
  }
  .pagination-buttons {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .cal-day {
    min-height: 46px;
    align-items: center;
    justify-content: center;
    gap: 2px;
  }
  .cal-dot {
    min-width: 17px;
    padding: 1px 4px;
    border-radius: 999px;
    background: var(--blue-soft);
    text-align: center;
    font-size: 11px;
  }
  .cal-dot span,
  .cal-appt,
  .cal-more {
    display: none;
  }
  .data-actions > label {
    flex: 0 0 100%;
  }
  #toast {
    z-index: 10060;
    inset: auto 12px calc(68px + env(safe-area-inset-bottom));
  }
  .modal-overlay {
    padding: max(8px, env(safe-area-inset-top))
      max(8px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom))
      max(8px, env(safe-area-inset-left)) !important;
  }
  .modal-overlay > * {
    width: 100% !important;
    max-height: none !important;
    padding: 14px !important;
  }
  .finish-line {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) 48px;
    padding: 10px;
    border: 1px solid var(--edge);
    border-radius: 10px;
  }
  .finish-line label:first-child {
    grid-column: 1 / -1;
  }
  .finish-dialog {
    width: 100%;
    max-width: 100%;
    height: 100dvh;
    max-height: 100dvh;
    margin: 0;
    border: 0;
    border-radius: 0;
  }
  .finish-header,
  .finish-body,
  .finish-footer {
    padding-inline: 12px;
  }
  .finish-header {
    padding-top: max(10px, env(safe-area-inset-top));
  }
  .finish-footer {
    padding-bottom: max(10px, env(safe-area-inset-bottom));
  }
  .finish-body {
    flex: 1;
  }
  #billPreview {
    padding: 12px !important;
  }
  #billPreview th:last-child,
  #billPreview td:last-child {
    padding-left: 8px;
    white-space: nowrap;
  }
}

.report-heading {
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.report-totals {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr));
  gap: 10px;
}
.report-total {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--edge);
  border-radius: 12px;
  background: #edf4ff;
}
.report-total strong {
  display: block;
  margin-block: 4px;
  font-size: clamp(20px, 4vw, 28px);
  overflow-wrap: anywhere;
}
.report-expense {
  background: #fff5e8;
}

.report-summary {
  background: linear-gradient(155deg, #fff 48%, #edf4ff);
}
.report-heading h2 {
  margin-bottom: 0;
}
.report-heading p {
  margin: 4px 0 0;
}
.report-total-primary {
  background: linear-gradient(135deg, #122b58, #235ca6);
  color: white;
}
.report-total-primary .muted {
  color: #d9e9ff;
}
.report-daily-panel {
  padding: clamp(14px, 2vw, 22px);
}
.report-daily-panel .report-heading {
  justify-content: flex-start;
  gap: 8px;
  margin-bottom: 6px;
}
.report-daily-panel #reportDailyMonth:not(:empty)::before {
  content: '·';
  margin-inline-end: 8px;
}
.report-daily-list {
  margin: 0;
  padding: 0;
  list-style: none;
}
.report-daily-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-block: 10px;
  border-bottom: 1px solid var(--edge);
  font-size: 16px;
  overflow-wrap: anywhere;
}
.report-daily-list li:last-child {
  border-bottom: 0;
}
.report-daily-list strong {
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.report-detail-link {
  display: inline-block;
  margin-block: 8px;
  color: var(--blue-deep);
  font-weight: 700;
}
.report-empty {
  padding: 12px;
  border-radius: 10px;
  background: #f7faff;
}

.report-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: 14px;
  margin-block: 14px;
}
.report-grid > .panel {
  min-width: 0;
  margin: 0;
}
.report-job-status {
  background: #fff;
}
.report-job-status dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin: 8px 0 0;
}
.report-job-status dl div {
  padding: 6px;
  border-radius: 8px;
  background: #e9f6ef;
  color: #17563b;
  overflow-wrap: anywhere;
}
.report-job-status dl div + div {
  background: #fff3e3;
  color: #784311;
}
.report-job-status dt {
  font-size: 12px;
}
.report-job-status dd {
  margin: 0;
  font-size: 12px;
}
.report-job-status dd strong {
  display: inline;
  margin: 0;
  font-size: clamp(16px, 2vw, 23px);
}
.report-trend {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
  text-align: center;
}
.report-trend strong {
  display: block;
  overflow-wrap: anywhere;
  font-variant-numeric: tabular-nums;
}
.report-trend time {
  display: block;
  margin-top: 8px;
}
.report-trend-plot {
  height: clamp(112px, 18vw, 200px);
  position: relative;
  margin-top: 8px;
  background: repeating-linear-gradient(to top, #e4edf8 0 1px, transparent 1px 25%);
}
.report-trend-plot::before {
  content: '';
  position: absolute;
  inset-inline: 0;
  bottom: var(--zero);
  height: 1px;
  background: #adbfda;
}
.report-trend-plot span {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: min(58%, 62px);
  bottom: var(--bar-start);
  height: var(--bar-size);
  border-radius: 6px;
  background: #79a8e6;
}
.report-trend-selected .report-trend-plot span {
  background: #1a5db7;
}
.report-trend-selected time {
  color: var(--blue-deep);
  font-weight: 700;
}
.report-ring {
  display: grid;
  place-items: center;
  width: min(148px, 100%);
  aspect-ratio: 1;
  border-radius: 50%;
  margin: 12px auto;
  background: conic-gradient(var(--segments), #a3c9f3 100% 100%);
}
.report-ring strong {
  display: grid;
  place-items: center;
  width: 74%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #fff;
  overflow-wrap: anywhere;
}
.report-breakdown-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.report-breakdown-list li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px 12px;
  padding-block: 6px;
  border-bottom: 1px solid var(--edge);
  overflow-wrap: anywhere;
}
.report-breakdown-list li:last-child {
  border-bottom: 0;
}
.report-breakdown-list i {
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-inline-end: 6px;
  border-radius: 50%;
  background: var(--dot);
}
.report-balance {
  color: #8a4d16;
  font-size: clamp(24px, 4vw, 32px);
}
@media (max-width: 880px) {
  .report-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

