:root {
  --ink: #18212f;
  --muted: #6b7280;
  --line: #d9dee8;
  --paper: #f6f8fb;
  --panel: #ffffff;
  --blue: #246bfe;
  --green: #16885f;
  --amber: #b7791f;
  --red: #c24141;
  --shadow: 0 18px 50px rgba(24, 33, 47, 0.09);
}

html.dark-theme {
  --ink: #f8fafc;
  --muted: #a8b3c7;
  --line: #2f3a4d;
  --paper: #050814;
  --panel: #111827;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  display: grid;
  grid-template-columns: 260px 1fr;
}

html.dark-theme body {
  background: var(--paper);
  color: var(--ink);
}

html.dark-theme input,
html.dark-theme select,
html.dark-theme textarea {
  background: #0b1220;
  color: var(--ink);
  border-color: var(--line);
}

html.dark-theme .panel,
html.dark-theme .metrics article,
html.dark-theme .booking-card,
html.dark-theme .job-card,
html.dark-theme .vehicle-card,
html.dark-theme .invoice-preview,
html.dark-theme .empty-state,
html.dark-theme .drop-off-booking {
  background: var(--panel);
  border-color: var(--line);
}

.theme-toggle {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 80;
  width: 62px;
  height: 32px;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  padding: 0 8px;
  background: #eef2ff;
  color: #111827;
  box-shadow: var(--shadow);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  overflow: hidden;
}

.theme-icon {
  position: relative;
  z-index: 2;
  width: 18px;
  line-height: 1;
  font-size: 15px;
  text-align: center;
}

.theme-knob {
  position: absolute;
  left: 4px;
  top: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.22);
  transition: transform 0.18s ease;
}

html.dark-theme .theme-toggle {
  background: #111827;
  color: #f8fafc;
  border-color: #334155;
}

html.dark-theme .theme-knob {
  transform: translateX(30px);
  background: #f8fafc;
}

body:not(.login-page):not(.public-repair-page) .topbar {
  padding-right: 160px;
}

body.login-page {
  min-height: 100vh;
  display: block;
  background:
    radial-gradient(circle at 12% 14%, rgba(22, 136, 95, 0.16), transparent 32%),
    radial-gradient(circle at 88% 12%, rgba(36, 107, 254, 0.14), transparent 28%),
    linear-gradient(135deg, #eef3f8 0%, #f8fafc 48%, #e8edf4 100%);
}

button,
input,
select,
textarea {
  font: inherit;
}

.sidebar {
  min-height: 100vh;
  background: #111827;
  color: white;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  position: sticky;
  top: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: var(--blue);
  display: grid;
  place-items: center;
  font-weight: 800;
}

.brand-mark.small {
  width: 38px;
  height: 38px;
  font-size: 14px;
}

.brand span,
.sidebar-note span,
.eyebrow {
  color: #9ca3af;
  display: block;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0;
}

.nav {
  display: grid;
  gap: 8px;
}

.nav a {
  color: #d1d5db;
  text-decoration: none;
  padding: 11px 12px;
  border-radius: 8px;
}

.nav a.active,
.nav a:hover {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

.sidebar-note {
  margin-top: auto;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
}

.logout-link {
  display: inline-block;
  color: white;
  margin-top: 12px;
  font-size: 14px;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px;
}

.login-card {
  width: min(1040px, 100%);
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 0;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  min-height: 560px;
  margin: 0 auto;
}

.login-panel {
  background:
    linear-gradient(135deg, rgba(17, 24, 39, 0.96), rgba(16, 86, 73, 0.88)),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.08) 0 1px, transparent 1px 72px),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.06) 0 1px, transparent 1px 72px);
  background-size: cover;
  background-position: center;
  color: white;
  padding: 36px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 34px;
}

.login-brand {
  color: white;
}

.login-copy {
  max-width: 460px;
}

.login-copy h1 {
  margin: 10px 0 14px;
  font-size: 42px;
  line-height: 1.05;
}

.login-copy p:not(.eyebrow) {
  color: #d1d5db;
  font-size: 17px;
  line-height: 1.55;
  margin: 0;
}

.login-highlights {
  display: grid;
  gap: 10px;
}

.login-highlights span {
  display: block;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  padding: 12px 13px;
  color: #f9fafb;
}

.login-form-panel {
  padding: 42px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: #ffffff;
}

.login-form-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 30px;
}

.login-form-head strong {
  display: block;
}

.login-form-head span {
  color: var(--muted);
  font-size: 13px;
}

.login-form-panel h2 {
  margin: 0 0 20px;
  font-size: 30px;
}

.login-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: var(--red);
  border-radius: 8px;
  padding: 11px 12px;
  margin-bottom: 14px;
}

.login-notice {
  background: #eefaf5;
  border: 1px solid #b8ead5;
  color: #0f6b4c;
  border-radius: 8px;
  padding: 11px 12px;
  margin-bottom: 14px;
  font-size: 14px;
  font-weight: 700;
}

.login-form-panel input {
  height: 48px;
  margin-bottom: 4px;
}

.login-form-panel .primary-btn {
  height: 50px;
  margin-top: 4px;
  font-size: 16px;
}

.service-login-page {
  background:
    linear-gradient(90deg, rgba(15, 23, 42, 0.05) 1px, transparent 1px),
    linear-gradient(0deg, rgba(15, 23, 42, 0.05) 1px, transparent 1px),
    radial-gradient(circle at 18% 18%, rgba(22, 136, 95, 0.16), transparent 30%),
    radial-gradient(circle at 82% 24%, rgba(36, 107, 254, 0.14), transparent 28%),
    #eef3f7;
  background-size: 44px 44px, 44px 44px, auto, auto, auto;
}

.service-login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 34px;
}

.service-login-layout {
  width: min(1120px, 100%);
  min-height: 650px;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(390px, 0.85fr);
  background: #ffffff;
  border: 1px solid rgba(148, 163, 184, 0.36);
  border-radius: 8px;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.14);
  overflow: hidden;
}

.service-login-hero {
  position: relative;
  isolation: isolate;
  padding: 42px;
  color: white;
  background:
    linear-gradient(145deg, rgba(15, 23, 42, 0.98), rgba(14, 68, 61, 0.94)),
    linear-gradient(90deg, rgba(255, 255, 255, 0.07) 1px, transparent 1px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 28px;
}

.service-login-hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0 auto;
  width: 360px;
  height: 360px;
  background: radial-gradient(circle, rgba(20, 184, 166, 0.22), transparent 65%);
  z-index: -1;
}

.service-login-brand {
  color: white;
}

.service-login-brand .brand-mark {
  background: #1f2937;
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.service-login-copy {
  max-width: 560px;
}

.service-login-copy h1 {
  margin: 12px 0 16px;
  font-size: 46px;
  line-height: 1.04;
}

.service-login-copy p:not(.eyebrow) {
  margin: 0;
  color: #dbe7e6;
  font-size: 17px;
  line-height: 1.6;
  max-width: 500px;
}

.repair-visual {
  position: relative;
  min-height: 220px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03)),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.05) 0 1px, transparent 1px 34px);
  overflow: hidden;
}

.repair-laptop {
  position: absolute;
  left: 44px;
  bottom: 36px;
  width: 270px;
}

.repair-screen {
  height: 150px;
  border: 10px solid #0f172a;
  border-radius: 8px 8px 3px 3px;
  background: linear-gradient(135deg, #c7f9f1, #eef6ff);
  padding: 18px;
  display: grid;
  gap: 10px;
  align-content: center;
}

.repair-screen span {
  display: block;
  height: 11px;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.24);
}

.repair-screen span:nth-child(2) {
  width: 72%;
}

.repair-screen span:nth-child(3) {
  width: 48%;
  background: rgba(22, 136, 95, 0.42);
}

.repair-base {
  height: 18px;
  background: #cbd5e1;
  border-radius: 0 0 8px 8px;
  box-shadow: inset 0 6px 0 rgba(15, 23, 42, 0.12);
}

.repair-tablet,
.repair-phone {
  position: absolute;
  background: #111827;
  border: 2px solid rgba(255, 255, 255, 0.24);
  box-shadow: 0 18px 35px rgba(0, 0, 0, 0.24);
}

.repair-tablet {
  right: 76px;
  bottom: 34px;
  width: 118px;
  height: 160px;
  border-radius: 8px;
  padding: 14px;
}

.repair-tablet span,
.repair-phone span {
  display: block;
  height: 100%;
  border-radius: 6px;
  background:
    linear-gradient(135deg, rgba(36, 107, 254, 0.55), rgba(20, 184, 166, 0.65)),
    #dff7f3;
}

.repair-tablet strong,
.repair-phone strong {
  position: absolute;
  left: 50%;
  bottom: 6px;
  width: 26px;
  height: 3px;
  transform: translateX(-50%);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.48);
}

.repair-phone {
  right: 32px;
  bottom: 54px;
  width: 64px;
  height: 124px;
  border-radius: 8px;
  padding: 9px;
}

.repair-status-card {
  position: absolute;
  left: 28px;
  top: 24px;
  width: 160px;
  padding: 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  box-shadow: 0 18px 38px rgba(15, 23, 42, 0.18);
}

.repair-status-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.repair-status-card strong {
  display: block;
  margin-top: 4px;
  color: var(--green);
}

.service-login-features {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.service-login-features span {
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  padding: 10px;
  color: #e8f4f2;
  background: rgba(255, 255, 255, 0.08);
  font-size: 13px;
}

.service-login-form-card {
  padding: 46px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background:
    linear-gradient(180deg, #ffffff, #f8fafc);
}

.service-form-title {
  margin-bottom: 22px;
}

.service-form-title h2 {
  margin: 8px 0 0;
  font-size: 32px;
  line-height: 1.15;
}

.service-login-form-card form {
  display: grid;
  gap: 14px;
}

.service-login-form-card input {
  height: 50px;
  margin-top: 7px;
}

.service-login-form-card .primary-btn {
  height: 52px;
  margin-top: 4px;
  background: #111827;
  border-color: #111827;
  font-size: 16px;
}

.service-login-form-card .primary-btn:hover {
  background: #0f172a;
}

.app {
  padding: 28px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 24px;
}

.topbar h1 {
  margin: 6px 0 0;
  max-width: 780px;
  font-size: 36px;
  line-height: 1.08;
}

.primary-btn,
.secondary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 8px;
  padding: 12px 16px;
  cursor: pointer;
  font-weight: 700;
  text-decoration: none;
}

.primary-btn {
  background: var(--blue);
  color: white;
}

.secondary-btn {
  background: #edf2ff;
  color: var(--blue);
}

.full {
  width: 100%;
}

.top-action {
  min-width: 140px;
  white-space: nowrap;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

.metrics article,
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.metrics article {
  padding: 18px;
}

.metrics span {
  color: var(--muted);
  font-size: 14px;
}

.metrics strong {
  display: block;
  font-size: 30px;
  margin-top: 8px;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(320px, 0.8fr);
  gap: 18px;
  margin-bottom: 18px;
}

.service-board {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
  gap: 18px;
  margin-bottom: 18px;
}

.pipeline-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
}

.pipeline-grid article {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #f8fafc;
}

.pipeline-grid span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.pipeline-grid strong {
  display: block;
  margin-top: 8px;
  font-size: 26px;
}

.service-actions {
  display: grid;
  gap: 10px;
}

.bottom-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.panel {
  padding: 18px;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  margin-bottom: 16px;
}

.panel h2 {
  margin: 4px 0 0;
  font-size: 20px;
}

select,
input,
textarea {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 11px;
  background: white;
  color: var(--ink);
  min-width: 0;
}

textarea {
  width: 100%;
  resize: vertical;
  line-height: 1.5;
}

form {
  display: grid;
  gap: 12px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.booking-list,
.job-list,
.vehicle-list {
  display: grid;
  gap: 12px;
}

.single-page {
  max-width: 860px;
}

.single-page.wide {
  max-width: 1180px;
}

.booking-form-panel {
  padding: 22px;
}

.search-result {
  margin-top: 14px;
}

.empty-result {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 13px;
  color: var(--muted);
  background: #f8fafc;
}

.quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.public-link-box {
  display: grid;
  gap: 12px;
}

.public-link-box input[readonly] {
  background: #f8fafc;
}

.marketing-workspace {
  grid-template-columns: minmax(340px, 0.85fr) minmax(0, 1.15fr);
  align-items: start;
}

.marketing-channel-toggle {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.marketing-channel-toggle button,
.marketing-tools button {
  border: 0;
  border-radius: 8px;
  padding: 8px 10px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
  cursor: pointer;
}

.marketing-channel-toggle button.active {
  background: #111827;
  color: white;
}

.marketing-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  margin-bottom: 14px;
}

.marketing-tools button {
  border: 1px solid var(--line);
  background: white;
  color: var(--ink);
}

.marketing-contact-list {
  display: grid;
  gap: 10px;
  max-height: 640px;
  overflow: auto;
  padding-right: 4px;
}

.marketing-contact-card {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
  color: var(--ink);
  font-size: 14px;
}

.marketing-contact-card input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  padding: 0;
}

.marketing-contact-card strong,
.marketing-contact-card small,
.marketing-contact-card em {
  display: block;
}

.marketing-contact-card small {
  margin-top: 3px;
  color: var(--muted);
}

.marketing-contact-card em {
  margin-top: 5px;
  color: var(--muted);
  font-style: normal;
  font-size: 12px;
}

.marketing-compose-form {
  gap: 14px;
}

.marketing-consent {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  color: var(--ink);
  font-weight: 700;
}

.marketing-consent input {
  width: 18px;
  height: 18px;
  padding: 0;
}

.marketing-note {
  border: 1px solid #fde68a;
  border-radius: 8px;
  padding: 12px;
  background: #fffbeb;
  color: #92400e;
  font-size: 13px;
  line-height: 1.5;
}

.vehicle-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.mot-summary {
  border-top: 1px solid var(--line);
  padding-top: 10px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
}

.mot-summary span {
  color: var(--muted);
}

.mot-list {
  display: grid;
  gap: 6px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  font-size: 13px;
}

.mot-list span {
  color: var(--muted);
}

.mot-list.danger {
  background: #fef2f2;
  border-color: #fecaca;
}

button:disabled {
  cursor: wait;
  opacity: 0.7;
}

.booking-card,
.job-card,
.vehicle-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  display: grid;
  gap: 10px;
}

.booking-main {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.booking-main strong,
.job-card strong,
.vehicle-card strong {
  display: block;
  margin-bottom: 4px;
}

.booking-date-line {
  display: block;
  margin-top: 4px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.muted {
  color: var(--muted);
  font-size: 13px;
}

.badge {
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  align-self: flex-start;
}

.booking-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.payment-badge {
  background: #f3f4f6;
  color: #111827;
  border: 1px solid #d1d5db;
}

.cash-paid-badge {
  background: #e9f8f1;
  color: var(--green);
  border-color: #b8ead5;
}

.repair-accepted-badge {
  background: #e9f8f1;
  color: var(--green);
  border: 1px solid #b8ead5;
}

.warranty-badge {
  background: #fff7ed;
  color: #9a3412;
  border: 1px solid #fed7aa;
}

.device-queue-badge {
  background: #eef2ff;
  color: #1e40af;
  border: 1px solid #bfdbfe;
}

.no-warranty-badge {
  background: #f3f4f6;
  color: #4b5563;
  border-color: #d1d5db;
}

.warranty-countdown-badge {
  background: #ecfeff;
  color: #155e75;
  border: 1px solid #a5f3fc;
}

.warranty-expired-badge {
  background: #fef2f2;
  color: var(--red);
  border-color: #fecaca;
}

.danger-status-badge {
  background: #fef2f2;
  color: var(--red);
  border: 1px solid #fecaca;
}

.infidel-client-badge {
  background: #111827;
  color: #ffffff;
  border: 1px solid #111827;
}

.booking-time-badge {
  background: #eef2ff;
  color: #1e40af;
  border: 1px solid #c7d2fe;
}

.collected-time-badge {
  background: #f3f4f6;
  color: #374151;
  border: 1px solid #d1d5db;
}

.collection-booked-badge {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.ready-marked-badge {
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.Booked {
  background: #e8f0ff;
  color: var(--blue);
}

.Sent {
  background: #e8f0ff;
  color: var(--blue);
}

.Pending-approval {
  background: #edf2ff;
  color: var(--blue);
}

.In-progress {
  background: #fff7e6;
  color: var(--amber);
}

.Diagnosing,
.Repairing,
.Full-cleaning-in-progress {
  background: #fff7e6;
  color: var(--amber);
}

.Waiting-parts {
  background: #fef2f2;
  color: var(--red);
}

.Motherboard-Failure-Non-Repairable,
.Unrepairable,
.Price-not-accepted-please-collect {
  background: #fef2f2;
  color: var(--red);
}

.Ready {
  background: #e9f8f1;
  color: var(--green);
}

.Accepted {
  background: #e9f8f1;
  color: var(--green);
}

.Collected {
  background: #f3f4f6;
  color: var(--muted);
}

.Cancelled,
.Rejected,
.Email-failed {
  background: #fef2f2;
  color: var(--red);
}

.card-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.card-actions button {
  border: 1px solid var(--line);
  background: white;
  border-radius: 8px;
  padding: 8px 10px;
  cursor: pointer;
}

.card-actions .primary-btn {
  background: #111827;
  border-color: #111827;
  color: white;
}

.card-actions .danger-btn {
  background: #dc2626;
  border-color: #dc2626;
  color: white;
}

.card-actions .warning-btn {
  background: #fff7e6;
  border-color: #f59e0b;
  color: #92400e;
}

.card-actions .cash-btn {
  background: #e9f8f1;
  border-color: #b8ead5;
  color: var(--green);
}

.card-actions .cash-btn:disabled {
  cursor: default;
  opacity: 1;
}

.card-actions .danger-btn:hover {
  background: #b91c1c;
  border-color: #b91c1c;
}

.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.pagination:empty {
  display: none;
}

.pagination-summary {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.pagination-buttons {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.pagination-buttons button {
  min-width: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: white;
  color: var(--ink);
  font-weight: 800;
  cursor: pointer;
}

.pagination-buttons button.active {
  background: #111827;
  border-color: #111827;
  color: white;
}

.pagination-buttons button:disabled {
  cursor: default;
  opacity: 0.45;
}

.empty-state {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 22px;
  color: var(--muted);
  background: #f8fafc;
  text-align: center;
}

.appointment-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.56);
}

.appointment-modal {
  width: min(420px, 100%);
  display: grid;
  gap: 18px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.24);
}

.appointment-modal h2 {
  margin: 4px 0 6px;
  font-size: 24px;
}

.appointment-modal label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-weight: 700;
}

.appointment-modal input {
  width: 100%;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  font: inherit;
  color: var(--text);
}

.appointment-modal-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.appointment-modal-actions button {
  min-height: 42px;
  border-radius: 8px;
  border: 1px solid var(--line);
  padding: 0 14px;
  font-weight: 800;
  cursor: pointer;
}

.open-link {
  border: 1px solid var(--line);
  background: white;
  border-radius: 8px;
  color: var(--ink);
  padding: 8px 10px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
}

.edit-booking-form .primary-btn {
  background: #111827;
  color: white;
}

body.public-repair-page {
  display: block;
  min-height: 100vh;
  background:
    linear-gradient(90deg, rgba(15, 23, 42, 0.05) 1px, transparent 1px),
    linear-gradient(0deg, rgba(15, 23, 42, 0.05) 1px, transparent 1px),
    radial-gradient(circle at 18% 16%, rgba(22, 136, 95, 0.18), transparent 30%),
    radial-gradient(circle at 84% 20%, rgba(36, 107, 254, 0.12), transparent 28%),
    #eef3f7;
  background-size: 44px 44px, 44px 44px, auto, auto, auto;
}

.public-repair-shell {
  width: min(1180px, calc(100% - 48px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 28px 0 42px;
  display: grid;
  align-content: center;
  gap: 22px;
}

.public-repair-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.public-repair-brand {
  color: var(--ink);
}

.public-repair-brand span {
  color: var(--muted);
}

.public-repair-layout {
  display: grid;
  grid-template-columns: minmax(300px, 0.82fr) minmax(0, 1.18fr);
  min-height: 680px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--panel);
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.14);
}

.public-repair-intro {
  background:
    linear-gradient(145deg, rgba(15, 23, 42, 0.98), rgba(14, 68, 61, 0.94)),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.08) 0 1px, transparent 1px 76px),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.06) 0 1px, transparent 1px 76px);
  color: white;
  padding: 44px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 22px;
}

.public-repair-hero-logo {
  display: inline-flex;
  align-items: center;
  gap: 13px;
  width: fit-content;
  margin-bottom: 28px;
  padding: 10px 14px 10px 10px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.22);
}

.public-repair-hero-logo span {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 8px;
  background: #2563eb;
  color: #020617;
  font-size: 20px;
  font-weight: 900;
}

.public-repair-hero-logo strong {
  color: #f8fafc;
  font-size: 15px;
  line-height: 1;
}

.public-repair-intro .eyebrow {
  color: #b8f1df;
}

.public-repair-intro h1 {
  margin: 0;
  font-size: 42px;
  line-height: 1.06;
}

.public-repair-intro p:not(.eyebrow) {
  margin: 0;
  color: #dbe7e6;
  font-size: 16px;
  line-height: 1.65;
}

.public-repair-points {
  display: grid;
  gap: 10px;
  margin-top: 8px;
}

.public-repair-points span {
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  padding: 12px 13px;
  color: #f8fafc;
  font-size: 14px;
}

.emergency-pay-panel {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid #fde68a;
  border-radius: 8px;
  background: #fffbeb;
}

.emergency-pay-panel p {
  margin: 0;
  color: #92400e;
  font-size: 13px;
  line-height: 1.45;
}

.stripe-pay-wrap {
  position: relative;
  display: flex;
  justify-content: center;
  width: 100%;
}

.stripe-pay-wrap.is-disabled {
  opacity: 0.45;
}

.stripe-pay-wrap.is-disabled::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  cursor: not-allowed;
}

.emergency-pay-btn {
  width: fit-content;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #ffffff;
  border-radius: 8px;
  padding: 0 18px;
  background: #ffffff;
  color: #111827;
  font-weight: 900;
  text-decoration: none;
  cursor: pointer;
}

.emergency-pay-btn:hover {
  background: #e5e7eb;
}

.emergency-pay-btn:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.emergency-pay-confirm {
  display: grid;
  gap: 10px;
  padding-top: 8px;
  border-top: 1px solid #fde68a;
}

.emergency-pay-confirm[hidden] {
  display: none;
}

.emergency-pay-confirm span {
  color: #78350f;
  font-size: 13px;
  line-height: 1.45;
}

.emergency-pay-confirm button {
  width: fit-content;
  min-height: 42px;
  border: 1px solid #111827;
  border-radius: 8px;
  padding: 0 14px;
  background: #111827;
  color: white;
  font-weight: 900;
  cursor: pointer;
}

.public-repair-form {
  border: 0;
  border-radius: 0;
  box-shadow: none;
  padding: 44px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.public-repair-form form {
  gap: 14px;
}

.drop-off-booking {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 16px;
  display: grid;
  gap: 12px;
}

.drop-off-booking h3 {
  margin: 4px 0 0;
  font-size: 17px;
  line-height: 1.35;
}

.booking-date-warning {
  border: 1px solid #fed7aa;
  border-radius: 8px;
  padding: 10px 11px;
  background: #fff7ed;
  color: #9a3412;
  font-size: 13px;
  font-weight: 800;
}

.public-repair-form input,
.public-repair-form select {
  height: 46px;
}

.public-repair-form .primary-btn {
  background: #111827;
  border-color: #111827;
}

.terms-acceptance {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 13px 14px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.45;
}

.terms-acceptance input {
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  flex: 0 0 auto;
}

.terms-acceptance a {
  color: #111827;
  text-decoration: underline;
  text-underline-offset: 3px;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.site-footer {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
  text-align: center;
}

body:not(.public-repair-page) .site-footer {
  margin-top: 18px;
}

.public-site-footer {
  padding: 0 12px;
}

.terms-page-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
}

.terms-panel {
  width: min(680px, 100%);
  padding: 34px;
}

.terms-panel h1 {
  margin: 8px 0 14px;
  font-size: 32px;
  line-height: 1.12;
}

.terms-panel p:not(.eyebrow) {
  margin: 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.6;
}

.estimate-box {
  display: grid;
  gap: 12px;
}

.checkbox-row {
  display: flex;
  grid-template-columns: none;
  align-items: center;
  gap: 9px;
  color: var(--ink);
  font-weight: 700;
}

.checkbox-row input {
  width: 18px;
  height: 18px;
  padding: 0;
}

.invoice-workspace {
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.9fr);
}

.invoice-lines {
  display: grid;
  gap: 10px;
}

.invoice-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 90px 120px;
  gap: 10px;
}

.invoice-preview {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  display: grid;
  gap: 16px;
  background: #fbfcfe;
}

.invoice-preview-head,
.invoice-customer,
.invoice-totals {
  display: grid;
  gap: 5px;
}

.invoice-preview-head {
  grid-template-columns: 1fr auto;
  align-items: center;
}

.invoice-preview-lines {
  display: grid;
  gap: 8px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 12px 0;
}

.invoice-preview-lines div {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 12px;
  align-items: center;
}

.invoice-totals {
  justify-items: end;
}

.invoice-totals span {
  display: flex;
  gap: 16px;
}

.grand-total {
  font-size: 18px;
  color: var(--ink);
}

.invoice-pay-btn {
  background: #111827;
  color: white;
  margin-top: 2px;
}

.invoice-choice-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.invoice-choice-row .primary-btn,
.invoice-choice-row .secondary-btn {
  justify-content: center;
  text-align: center;
}

.invoice-cash-btn {
  min-height: 44px;
  cursor: default;
}

.estimate-items {
  display: grid;
  gap: 10px;
}

.estimate-items-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-weight: 700;
}

.estimate-item-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 140px auto;
  gap: 10px;
  align-items: center;
}

.estimate-item-row input {
  width: 100%;
}

.estimate-item-row button {
  border: 1px solid var(--line);
  background: white;
  border-radius: 8px;
  padding: 10px 12px;
  cursor: pointer;
}

.estimate-item-row button:disabled {
  opacity: 0.45;
  cursor: default;
}

.estimate-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.estimate-total {
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.estimate-total strong {
  font-size: 24px;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  background: #111827;
  color: white;
  padding: 13px 15px;
  border-radius: 8px;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: 0.2s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 980px) {
  body {
    grid-template-columns: 1fr;
  }

  .sidebar {
    min-height: auto;
    position: static;
  }

  .nav {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  }

  .metrics,
  .workspace,
  .marketing-workspace,
  .service-board,
  .bottom-grid {
    grid-template-columns: 1fr 1fr;
  }

  .pipeline-grid {
    grid-template-columns: 1fr 1fr;
  }

  .login-card {
    grid-template-columns: 1fr;
  }

  .service-login-layout {
    grid-template-columns: 1fr;
  }

  .service-login-hero {
    min-height: 610px;
  }

  .login-panel {
    min-height: 360px;
  }

  .public-repair-layout {
    grid-template-columns: 1fr;
  }

  .public-repair-intro {
    min-height: 360px;
  }
}

@media (max-width: 680px) {
  .app,
  .sidebar {
    padding: 18px;
  }

  .topbar,
  .booking-main,
  .pagination {
    display: grid;
  }

  .pagination-buttons {
    justify-content: flex-start;
  }

  .topbar h1 {
    font-size: 28px;
  }

  .metrics,
  .workspace,
  .marketing-workspace,
  .service-board,
  .bottom-grid,
  .nav,
  .form-row,
  .invoice-line,
  .estimate-item-row,
  .invoice-workspace {
    grid-template-columns: 1fr;
  }

  .marketing-tools {
    grid-template-columns: 1fr;
  }

  .login-shell {
    padding: 16px;
  }

  .login-panel,
  .login-form-panel {
    padding: 24px;
  }

  .login-copy h1 {
    font-size: 31px;
  }

  .service-login-shell {
    padding: 16px;
  }

  .service-login-hero,
  .service-login-form-card {
    padding: 24px;
  }

  .service-login-hero {
    min-height: 680px;
  }

  .service-login-copy h1 {
    font-size: 34px;
  }

  .repair-visual {
    min-height: 250px;
  }

  .repair-laptop {
    left: 18px;
    width: 215px;
  }

  .repair-tablet {
    right: 42px;
    width: 88px;
    height: 130px;
  }

  .repair-phone {
    right: 16px;
    width: 52px;
    height: 105px;
  }

  .repair-status-card {
    left: 16px;
    top: 16px;
  }

  .service-login-features {
    grid-template-columns: 1fr 1fr;
  }

  .vehicle-facts {
    grid-template-columns: 1fr;
  }

  .pipeline-grid {
    grid-template-columns: 1fr;
  }

  .public-repair-shell {
    width: min(100% - 24px, 1180px);
    padding: 16px 0 28px;
    align-content: start;
  }

  .public-repair-layout {
    min-height: auto;
  }

  .public-repair-intro,
  .public-repair-form {
    padding: 24px;
  }

  .public-repair-intro h1 {
    font-size: 32px;
  }
}

html.dark-theme .app,
html.dark-theme .single-page,
html.dark-theme .workspace,
html.dark-theme .service-board,
html.dark-theme .bottom-grid {
  color: var(--ink);
}

html.dark-theme .panel,
html.dark-theme .metrics article,
html.dark-theme .booking-card,
html.dark-theme .job-card,
html.dark-theme .vehicle-card,
html.dark-theme .invoice-preview,
html.dark-theme .empty-state,
html.dark-theme .drop-off-booking,
html.dark-theme .marketing-note,
html.dark-theme .mot-list,
html.dark-theme .search-result,
html.dark-theme .public-link-box input[readonly],
html.dark-theme .appointment-modal,
html.dark-theme .invoice-line,
html.dark-theme .estimate-box,
html.dark-theme .emergency-pay-panel,
html.dark-theme .terms-acceptance {
  background: var(--panel);
  border-color: var(--line);
  color: var(--ink);
}

html.dark-theme .muted,
html.dark-theme label,
html.dark-theme .metrics span,
html.dark-theme .panel .eyebrow,
html.dark-theme .booking-date-line,
html.dark-theme .pagination-summary,
html.dark-theme .invoice-preview span,
html.dark-theme .marketing-contact-card small,
html.dark-theme .marketing-contact-card em,
html.dark-theme .mot-summary span,
html.dark-theme .mot-list span,
html.dark-theme .terms-panel p:not(.eyebrow) {
  color: var(--muted);
}

html.dark-theme strong,
html.dark-theme h1,
html.dark-theme h2,
html.dark-theme h3,
html.dark-theme .booking-main strong,
html.dark-theme .job-card strong,
html.dark-theme .vehicle-card strong,
html.dark-theme .grand-total,
html.dark-theme .invoice-totals strong,
html.dark-theme .estimate-total strong {
  color: var(--ink);
}

html.dark-theme input,
html.dark-theme select,
html.dark-theme textarea,
html.dark-theme .marketing-tools button,
html.dark-theme .card-actions button,
html.dark-theme .pagination-buttons button,
html.dark-theme .estimate-item-row button,
html.dark-theme .open-link,
html.dark-theme .secondary-btn {
  background: #0b1220;
  color: var(--ink);
  border-color: var(--line);
}

html.dark-theme input::placeholder,
html.dark-theme textarea::placeholder {
  color: #778398;
}

html.dark-theme .booking-card,
html.dark-theme .job-card,
html.dark-theme .vehicle-card,
html.dark-theme .marketing-contact-card,
html.dark-theme .pipeline-grid article {
  background: #0b1220;
  border-color: var(--line);
  color: var(--ink);
}

html.dark-theme .sidebar {
  background: #020617;
  border-right: 1px solid var(--line);
}

html.dark-theme .public-repair-form,
html.dark-theme .login-form-panel,
html.dark-theme .service-login-form-card,
html.dark-theme .terms-panel {
  background: var(--panel);
  color: var(--ink);
}

html.dark-theme .login-card,
html.dark-theme .service-login-layout,
html.dark-theme .public-repair-layout {
  background: var(--panel);
  border-color: var(--line);
}

html.dark-theme .login-error,
html.dark-theme .mot-list.danger {
  background: #3b1115;
  border-color: #7f1d1d;
  color: #fecaca;
}

html.dark-theme .login-notice {
  background: #052e25;
  border-color: #115e59;
  color: #99f6e4;
}

html.dark-theme .marketing-note,
html.dark-theme .emergency-pay-panel {
  background: #322408;
  border-color: #854d0e;
  color: #fde68a;
}

html.dark-theme .primary-btn,
html.dark-theme .card-actions .primary-btn {
  background: #2563eb;
  border-color: #2563eb;
  color: #ffffff;
}

html.dark-theme .card-actions .warning-btn {
  background: #33220a;
  border-color: #b45309;
  color: #fbbf24;
}

html.dark-theme .card-actions .cash-btn {
  background: #052e25;
  border-color: #0f766e;
  color: #5eead4;
}

html.dark-theme .toast {
  background: #f8fafc;
  color: #111827;
}

html.dark-theme .booking-date-warning {
  background: #431407;
  border-color: #9a3412;
  color: #fed7aa;
}

.calendar-actions-panel {
  display: grid;
  grid-template-columns: minmax(0, 0.72fr) minmax(360px, 1.28fr);
  gap: 16px;
  align-items: center;
  margin-bottom: 18px;
  position: sticky;
  top: 12px;
  z-index: 45;
}

.calendar-actions-panel h2 {
  margin: 4px 0 0;
}
.calendar-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 18px;
  align-items: start;
}

.calendar-panel,
.calendar-side {
  display: grid;
  gap: 16px;
}

.calendar-toolbar,
.calendar-block-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.calendar-toolbar button,
.calendar-block-actions button,
.calendar-block-card button {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 11px;
  background: white;
  color: var(--ink);
  font-weight: 800;
  cursor: pointer;
}

.calendar-block-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.calendar-actions-panel .calendar-block-actions {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}
.calendar-block-actions .warning-btn {
  background: #fff7e6;
  border-color: #f59e0b;
  color: #92400e;
}

.calendar-block-actions .secondary-btn {
  background: #edf2ff;
  border-color: #c7d2fe;
  color: #1e40af;
}

.calendar-weekdays,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.calendar-weekdays span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-align: center;
  text-transform: uppercase;
}

.calendar-day {
  min-height: 118px;
  display: grid;
  align-content: start;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  background: #ffffff;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.calendar-day.outside {
  opacity: 0.48;
}

.calendar-day.selected {
  border-color: var(--blue);
  box-shadow: 0 0 0 2px rgba(36, 107, 254, 0.18);
}

.calendar-day.today .calendar-day-number {
  background: var(--blue);
  color: #ffffff;
}

.calendar-day.blocked {
  background: #fff7ed;
  border-color: #fdba74;
}

.calendar-day-number {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-weight: 900;
}

.calendar-booking-pill,
.calendar-block-pill,
.calendar-more {
  display: block;
  width: 100%;
  border-radius: 6px;
  padding: 4px 6px;
  font-size: 11px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-booking-pill {
  background: #eef2ff;
  color: #1e40af;
}

.calendar-block-pill {
  background: #ffedd5;
  color: #9a3412;
  border: 1px solid #fed7aa;
  text-transform: capitalize;
}

.calendar-block-week {
  background: #fef3c7;
  color: #92400e;
}

.calendar-block-month {
  background: #fee2e2;
  color: #991b1b;
}

.calendar-more {
  color: var(--muted);
  padding-left: 0;
}

.calendar-side {
  position: sticky;
  top: 18px;
}

.calendar-day-bookings,
.calendar-block-list {
  display: grid;
  gap: 10px;
}

.calendar-booking-card,
.calendar-block-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px;
  background: #f8fafc;
}

.calendar-booking-card {
  display: grid;
  gap: 4px;
}

.calendar-booking-card span,
.calendar-block-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

html.dark-theme .calendar-toolbar button,
html.dark-theme .calendar-block-actions button,
html.dark-theme .calendar-block-card button,
html.dark-theme .calendar-day,
html.dark-theme .calendar-booking-card,
html.dark-theme .calendar-block-card {
  background: #0b1220;
  color: var(--ink);
  border-color: var(--line);
}

html.dark-theme .calendar-day.blocked {
  background: #322408;
  border-color: #854d0e;
}

html.dark-theme .calendar-booking-pill {
  background: #172554;
  color: #bfdbfe;
}

html.dark-theme .calendar-block-pill {
  background: #431407;
  border-color: #9a3412;
  color: #fed7aa;
}

@media (max-width: 980px) {
  .calendar-actions-panel {
    grid-template-columns: 1fr;
    top: 0;
  }

  .calendar-shell {
    grid-template-columns: 1fr;
  }

  .calendar-side {
    position: static;
  }
}

@media (max-width: 680px) {
  .calendar-weekdays {
    display: none;
  }

  .calendar-actions-panel {
    margin: 0 -18px 14px;
    border-left: 0;
    border-right: 0;
    border-radius: 0;
    padding: 12px 18px;
  }

  .calendar-actions-panel h2 {
    font-size: 18px;
  }

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

  .calendar-block-actions button {
    min-height: 42px;
    padding: 9px 8px;
    font-size: 13px;
  }

  .calendar-grid {
    grid-template-columns: 1fr;
  }

  .calendar-day {
    min-height: auto;
  }
}

@media (max-width: 900px) {
  .public-repair-shell {
    width: min(100% - 28px, 720px);
    min-height: auto;
    padding: 16px 0 28px;
    align-content: start;
  }

  .public-repair-layout {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .public-repair-intro {
    padding: 28px;
    gap: 14px;
  }

  .public-repair-hero-logo {
    margin-bottom: 4px;
  }

  .public-repair-intro h1 {
    max-width: 620px;
    font-size: 34px;
    line-height: 1.12;
  }

  .public-repair-points {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .public-repair-form {
    padding: 28px;
  }
}

@media (max-width: 760px) {
  body.public-repair-page {
    overflow-x: hidden;
    background-size: 32px 32px, 32px 32px, auto, auto, auto;
  }

  .public-repair-shell {
    width: 100%;
    min-height: auto;
    padding: 0;
    gap: 0;
  }

  .public-repair-header {
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.92);
    border-bottom: 1px solid var(--line);
  }

  .public-repair-header .brand {
    min-width: 0;
  }

  .public-repair-header .brand > div:last-child {
    min-width: 0;
  }

  .public-repair-header strong,
  .public-repair-header span {
    overflow-wrap: anywhere;
  }

  .public-repair-layout {
    width: 100%;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    overflow: visible;
  }

  .public-repair-intro {
    min-height: auto;
    padding: 22px 18px 24px;
    gap: 16px;
  }

  .public-repair-hero-logo {
    margin-bottom: 8px;
    padding: 8px 10px 8px 8px;
  }

  .public-repair-hero-logo span {
    width: 38px;
    height: 38px;
    font-size: 17px;
  }

  .public-repair-intro h1 {
    font-size: 28px;
    line-height: 1.12;
  }

  .public-repair-intro p:not(.eyebrow) {
    font-size: 14px;
    line-height: 1.5;
  }

  .public-repair-points {
    grid-template-columns: 1fr;
    gap: 8px;
    margin-top: 0;
  }

  .public-repair-points span {
    padding: 10px 11px;
    font-size: 13px;
  }

  .public-repair-form {
    padding: 20px 16px 24px;
  }

  .public-repair-form .panel-head {
    display: block;
    margin-bottom: 14px;
  }

  .public-repair-form h2 {
    font-size: 22px;
  }

  .public-repair-form form {
    gap: 12px;
  }

  .public-repair-form .form-row,
  .drop-off-booking .form-row {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .public-repair-form input,
  .public-repair-form select,
  .public-repair-form textarea {
    width: 100%;
    min-height: 46px;
    font-size: 16px;
  }

  .drop-off-booking {
    padding: 13px;
  }

  .drop-off-booking h3 {
    font-size: 16px;
  }

  .terms-acceptance {
    padding: 12px;
    gap: 9px;
    font-size: 13px;
    line-height: 1.4;
  }

  .terms-acceptance span {
    min-width: 0;
  }

  .public-repair-form .primary-btn.full {
    min-height: 50px;
    width: 100%;
    white-space: normal;
  }

  .login-error,
  .login-notice,
  .booking-date-warning {
    font-size: 13px;
    line-height: 1.4;
  }
}

@media (max-width: 390px) {
  .public-repair-header {
    padding: 12px;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
  }

  .public-repair-intro,
  .public-repair-form {
    padding-left: 12px;
    padding-right: 12px;
  }

  .public-repair-intro h1 {
    font-size: 25px;
  }
}

@media (max-width: 760px) {
  html,
  body {
    max-width: 100%;
    overflow-x: hidden;
  }

  body:not(.login-page):not(.public-repair-page) {
    display: block;
  }

  body:not(.login-page):not(.public-repair-page) .topbar {
    padding-right: 0;
  }

  .app {
    width: 100%;
    padding: 16px;
  }

  .sidebar {
    min-height: auto;
    position: static;
    padding: 16px;
  }

  .sidebar-note {
    display: none;
  }

  .topbar {
    gap: 12px;
    margin-bottom: 16px;
  }

  .top-action {
    width: 100%;
    min-width: 0;
    text-align: center;
  }

  .panel {
    padding: 14px;
  }

  .panel-head,
  .quick-actions,
  .booking-main {
    display: grid;
    grid-template-columns: 1fr;
  }

  .quick-actions {
    width: 100%;
  }

  .quick-actions a,
  .quick-actions button,
  .card-actions button,
  .card-actions a {
    width: 100%;
    min-height: 42px;
  }

  .booking-badges {
    justify-content: flex-start;
  }

  .metrics {
    gap: 10px;
  }

  .metrics article {
    padding: 14px;
  }

  .metrics strong {
    font-size: 24px;
  }

  .invoice-choice-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 420px) {
  .badge {
    white-space: normal;
  }

  .pagination-buttons button {
    flex: 1 1 auto;
  }
}
.public-booking-calendar {
  width: min(100%, 330px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 8px;
  display: grid;
  gap: 7px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
}

.public-booking-calendar[hidden] {
  display: none;
}

.public-calendar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.public-calendar-head strong {
  font-size: 13px;
}

.public-calendar-head button {
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  color: var(--ink);
  font-size: 18px;
  font-weight: 900;
  cursor: pointer;
}

.public-calendar-weekdays,
.public-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 3px;
}

.public-calendar-weekdays span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 900;
  text-align: center;
  text-transform: uppercase;
}

.public-calendar-day {
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  color: var(--ink);
  display: grid;
  place-items: center;
  gap: 1px;
  padding: 2px;
  cursor: pointer;
  font-size: 11px;
}

.public-calendar-day span {
  font-weight: 900;
}

.public-calendar-day strong {
  font-size: 7px;
  line-height: 1;
  text-transform: uppercase;
}

.public-calendar-day.outside {
  opacity: 0.44;
}

.public-calendar-day.today:not(.full-day) {
  border-color: var(--blue);
  box-shadow: 0 0 0 2px rgba(36, 107, 254, 0.14);
}

.public-calendar-day.selected:not(.full-day) {
  background: #111827;
  border-color: #111827;
  color: #ffffff;
}

.public-calendar-day.full-day {
  background: #dc2626;
  border-color: #b91c1c;
  color: #ffffff;
  cursor: not-allowed;
  opacity: 1;
}

.public-calendar-day:disabled:not(.full-day) {
  background: #f1f5f9;
  color: #94a3b8;
  cursor: not-allowed;
}

html.dark-theme .public-booking-calendar,
html.dark-theme .public-calendar-head button,
html.dark-theme .public-calendar-day {
  background: #0b1220;
  color: var(--ink);
  border-color: var(--line);
}

html.dark-theme .public-calendar-day.selected:not(.full-day) {
  background: #2563eb;
  border-color: #2563eb;
  color: #ffffff;
}

html.dark-theme .public-calendar-day.full-day {
  background: #991b1b;
  border-color: #ef4444;
  color: #ffffff;
}

@media (max-width: 520px) {
  .public-booking-calendar {
    width: 100%;
    padding: 7px;
  }

  .public-calendar-day {
    min-height: 28px;
    font-size: 10px;
  }

  .public-calendar-day strong {
    font-size: 6px;
  }
}
.calendar-hour-editor {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 12px;
  display: grid;
  gap: 10px;
}

.calendar-hour-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.calendar-hour-fields label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.calendar-hour-fields input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  background: #ffffff;
  color: var(--ink);
}

.calendar-hour-block-list {
  display: grid;
  gap: 10px;
}

.calendar-hour-block-pill {
  display: block;
  width: 100%;
  border-radius: 6px;
  padding: 4px 6px;
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
  font-size: 11px;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-day.has-hour-blocks:not(.blocked) {
  border-color: #fca5a5;
  background: #fff1f2;
}

html.dark-theme .calendar-hour-editor,
html.dark-theme .calendar-hour-fields input {
  background: #0b1220;
  color: var(--ink);
  border-color: var(--line);
}

html.dark-theme .calendar-hour-block-pill {
  background: #450a0a;
  border-color: #991b1b;
  color: #fecaca;
}

html.dark-theme .calendar-day.has-hour-blocks:not(.blocked) {
  background: #2f1111;
  border-color: #7f1d1d;
}

@media (max-width: 420px) {
  .calendar-hour-fields {
    grid-template-columns: 1fr;
  }
}
.public-calendar-day.has-hour-blocks:not(.full-day) {
  background: #fff7ed;
  border-color: #f97316;
  color: #9a3412;
}

html.dark-theme .public-calendar-day.has-hour-blocks:not(.full-day) {
  background: #431407;
  border-color: #f97316;
  color: #fed7aa;
}
.public-calendar-day.has-booked-slots:not(.full-day) {
  background: #eef2ff;
  border-color: #6366f1;
  color: #3730a3;
}

html.dark-theme .public-calendar-day.has-booked-slots:not(.full-day) {
  background: #172554;
  border-color: #6366f1;
  color: #c7d2fe;
}
