:root {
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-2: #f8fafb;
  --border: #e3e7eb;
  --text: #1c2730;
  --muted: #64717d;
  --brand: #0b6e83;
  --brand-dark: #08505f;
  --brand-soft: #e3f2f5;
  --sidebar: #0f2a33;

  --green: #15803d;
  --green-bg: #dcfce7;
  --green-border: #86efac;
  --red: #c62828;
  --red-bg: #fde4e4;
  --red-border: #f5a3a3;
  --overdue: #a11a1a;
  --grey: #6b7680;
  --grey-bg: #eceff2;
  --amber: #a15c07;
  --amber-bg: #fdf0d5;

  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 32, 40, .06), 0 2px 8px rgba(16, 32, 40, .05);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  font-family: "Public Sans", "Segoe UI", system-ui, sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  display: flex;
  min-height: 100vh;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--brand); }
h1 { font-size: 22px; margin: 0; letter-spacing: -.01em; }
h2 { font-size: 16px; margin: 0 0 12px; }
h3 { font-size: 14px; margin: 0 0 8px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }

/* Layout ------------------------------------------------------------------ */
.sidebar {
  width: 228px;
  flex-shrink: 0;
  background: var(--sidebar);
  color: #cfe2e7;
  display: flex;
  flex-direction: column;
  padding: 18px 12px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; color: #fff; padding: 4px 8px 22px; font-size: 15px; }
.brand svg { color: #5fd0e6; }
.sidebar nav { display: flex; flex-direction: column; gap: 2px; }
.sidebar nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: 8px;
  color: #cfe2e7; text-decoration: none; font-weight: 500;
}
.sidebar nav a svg { width: 18px; height: 18px; fill: currentColor; opacity: .8; }
.sidebar nav a:hover { background: rgba(255, 255, 255, .06); }
.sidebar nav a.active { background: rgba(95, 208, 230, .16); color: #fff; }
.sidebar-foot { margin-top: auto; font-size: 12px; padding: 10px; border-radius: 8px; background: rgba(255, 255, 255, .05); line-height: 1.45; }
.sidebar-foot .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }
.logout {
  display: flex; align-items: center; gap: 10px; margin-top: 6px;
  padding: 9px 10px; border: 0; border-radius: 8px; background: none;
  color: #cfe2e7; font-weight: 500; cursor: pointer; text-align: left;
}
.logout svg { width: 18px; height: 18px; fill: currentColor; opacity: .8; }
.logout:hover { background: rgba(255, 255, 255, .06); }

/* Login page */
.login-page { align-items: center; justify-content: center; background: var(--sidebar); padding: 16px; }
.login-card { width: 100%; max-width: 360px; display: flex; flex-direction: column; gap: 14px; padding: 26px; }
.login-card .brand { color: var(--text); padding: 0 0 4px; }
.login-card .brand svg { color: var(--brand); }
.login-card .error { color: var(--red); font-size: 13px; margin: 0; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; gap: 12px; align-items: center;
  padding: 14px 28px; background: var(--surface); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 20;
}
#view { padding: 24px 28px 48px; max-width: 1400px; width: 100%; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* Search ------------------------------------------------------------------ */
.search { position: relative; flex: 1; max-width: 560px; }
.search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 18px; fill: var(--muted); }
.search input {
  width: 100%; padding: 9px 12px 9px 36px; border: 1px solid var(--border);
  border-radius: 8px; background: var(--surface-2);
}
.search input:focus { outline: 2px solid var(--brand-soft); border-color: var(--brand); background: #fff; }
.search-results {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0;
  background: #fff; border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 10px 30px rgba(16, 32, 40, .14);
  max-height: 420px; overflow: auto; z-index: 30;
}
.search-results button {
  display: block; width: 100%; text-align: left; border: 0; background: none;
  padding: 10px 14px; cursor: pointer; border-bottom: 1px solid var(--border);
}
.search-results button:last-child { border-bottom: 0; }
.search-results button:hover, .search-results button.focused { background: var(--brand-soft); }
.search-results .r-name { font-weight: 600; }
.search-results .r-meta { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* Buttons & form controls ---------------------------------------------------- */
.btn {
  border: 1px solid var(--border); background: #fff; border-radius: 8px;
  padding: 8px 14px; cursor: pointer; font-weight: 500; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 6px; text-decoration: none; color: var(--text);
}
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-dark); }
.btn.danger { color: var(--red); }
.btn.green { background: var(--green); border-color: var(--green); color: #fff; }
.btn.sm { padding: 5px 10px; font-size: 13px; }
.btn:disabled { opacity: .55; cursor: default; }
.btn-group { display: inline-flex; }
.btn-group .btn { border-radius: 0; margin-left: -1px; }
.btn-group .btn:first-child { border-radius: 8px 0 0 8px; margin-left: 0; }
.btn-group .btn:last-child { border-radius: 0 8px 8px 0; }

label.field { display: flex; flex-direction: column; gap: 5px; font-weight: 500; font-size: 13px; }
label.field span.hint { font-weight: 400; color: var(--muted); font-size: 12px; }
input[type=text], input[type=password], input[type=email], input[type=tel], input[type=date], input[type=number], select, textarea {
  border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; background: #fff; width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand-soft); border-color: var(--brand); }
textarea { resize: vertical; line-height: 1.5; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }

/* Cards & stats ------------------------------------------------------------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.stats { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; margin-bottom: 18px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.stat .label { color: var(--muted); font-size: 12px; font-weight: 500; text-transform: uppercase; letter-spacing: .04em; }
.stat .value { font-size: 28px; font-weight: 700; margin-top: 4px; }
.stat.green .value { color: var(--green); }
.stat.red .value { color: var(--red); }
.stat.dark .value { color: var(--overdue); }



/* Status pills & chips -------------------------------------------------------- */
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.booked { background: var(--green-bg); color: var(--green); }
.pill.unbooked { background: var(--red-bg); color: var(--red); }
.pill.overdue { background: var(--overdue); color: #fff; }
.pill.completed { background: var(--grey-bg); color: var(--grey); }
.pill.upcoming { background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }
.pill.sent { background: var(--green-bg); color: var(--green); }
.pill.failed { background: var(--red-bg); color: var(--red); }
.pill.plain::before { display: none; }

.legend { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }

/* Calendar ------------------------------------------------------------------- */
.dash-grid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 18px; }
/* height:0 + min-height:100% lets the calendar set the row height; the lists scroll inside it. */
.dash-side { display: flex; flex-direction: column; gap: 18px; height: 0; min-height: 100%; }
.dash-side .card { display: flex; flex-direction: column; min-height: 0; padding-bottom: 6px; }
.dash-side .card.grow { flex: 1 1 0; }
.dash-side .card .list { overflow-y: auto; min-height: 0; margin: 0 -18px; padding: 0 18px; }
.dash-side .section-title h2 { margin-bottom: 6px; }
.calendar { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--border); border-left: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.calendar .dow { background: var(--surface-2); font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; padding: 8px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.calendar .day { min-height: 104px; padding: 6px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); background: #fff; display: flex; flex-direction: column; gap: 4px; }
.calendar .day.other { background: var(--surface-2); }
.calendar .day.other .num { color: #b3bcc4; }
.calendar .day.today { background: #f2fafc; box-shadow: inset 0 0 0 2px var(--brand); }
.calendar .num { font-size: 12px; font-weight: 600; color: var(--muted); }
.calendar .day.today .num { color: var(--brand); }
.chip {
  display: block; width: 100%; text-align: left; border: 1px solid; border-radius: 6px;
  padding: 3px 6px; font-size: 12px; font-weight: 500; cursor: pointer;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.chip.booked { background: var(--green-bg); border-color: var(--green-border); color: #14532d; }
.chip.unbooked { background: var(--red-bg); border-color: var(--red-border); color: #7f1d1d; }
.chip.overdue { background: var(--overdue); border-color: var(--overdue); color: #fff; }
.chip.upcoming { background: #fff; border-color: var(--border); color: var(--muted); border-style: dashed; }
.chip.completed { background: var(--grey-bg); border-color: var(--border); color: var(--grey); text-decoration: line-through; }
.chip:hover { filter: brightness(.96); }

/* Lists ---------------------------------------------------------------------- */
.list { display: flex; flex-direction: column; }
.list-item { display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--border); }
.list-item:last-child { border-bottom: 0; }
.list-item .who { min-width: 0; }
.list-item .who .name { font-weight: 600; cursor: pointer; }
.list-item .who .name:hover { color: var(--brand); text-decoration: underline; }
.list-item .who .meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.list-item .acts { display: flex; gap: 6px; flex-shrink: 0; }
.side-list .list-item { flex-direction: column; align-items: stretch; gap: 8px; }
.side-list .list-item .acts { flex-wrap: wrap; }
.section-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.empty { color: var(--muted); padding: 14px 0; text-align: center; }

/* Table ---------------------------------------------------------------------- */
.table-wrap { overflow: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
table.grid { border-collapse: collapse; width: 100%; font-size: 13px; }
table.grid th, table.grid td { padding: 9px 12px; border-bottom: 1px solid var(--border); border-right: 1px solid #eef1f3; text-align: left; vertical-align: top; }
table.grid th:last-child, table.grid td:last-child { border-right: 0; }
table.grid th { background: var(--surface-2); font-weight: 600; font-size: 12px; color: var(--muted); position: sticky; top: 0; cursor: pointer; user-select: none; white-space: nowrap; }
table.grid th:hover { color: var(--text); }
table.grid th .arrow { opacity: .5; margin-left: 4px; }
table.grid tbody tr { cursor: pointer; }
table.grid tbody tr:nth-child(even) { background: #fbfcfd; }
table.grid tbody tr:hover { background: var(--brand-soft); }
table.grid td.num { text-align: center; font-variant-numeric: tabular-nums; }
.filters { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.filters input[type=search] { width: 300px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; }

.dots { display: inline-flex; gap: 3px; }
.dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--brand); display: inline-block; }
.dots i.used { background: #d4dbe0; }

/* Modal ---------------------------------------------------------------------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(12, 28, 34, .45); display: flex; align-items: flex-start; justify-content: center; padding: 48px 16px; z-index: 50; overflow: auto; }
.modal-backdrop[hidden] { display: none; }
.modal { background: #fff; border-radius: 14px; width: 100%; max-width: 860px; padding: 26px 28px; position: relative; box-shadow: 0 20px 60px rgba(0, 0, 0, .25); }
.modal.narrow { max-width: 460px; }
.modal.wide { max-width: 1180px; }
.modal-close { position: absolute; top: 14px; right: 16px; border: 0; background: none; font-size: 26px; line-height: 1; cursor: pointer; color: var(--muted); }
.modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 18px; padding-right: 28px; }
.modal-foot { display: flex; justify-content: space-between; gap: 8px; margin-top: 20px; flex-wrap: wrap; }

.cust-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 18px; }
.cust-summary > div { background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; }
.cust-summary .k { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
.cust-summary .v { font-size: 18px; font-weight: 700; margin-top: 3px; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.tabs button { border: 0; background: none; padding: 9px 14px; cursor: pointer; font-weight: 500; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button.active { color: var(--brand); border-bottom-color: var(--brand); }

.timeline { display: flex; flex-direction: column; gap: 8px; }
.tl-row { display: grid; grid-template-columns: 90px 1fr auto; gap: 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; }
.tl-row.booked { background: #f3fcf6; border-color: var(--green-border); }
.tl-row.unbooked { background: #fff7f7; border-color: var(--red-border); }
.tl-row.overdue { background: #fdf0f0; border-color: var(--overdue); }
.tl-row.completed { background: var(--surface-2); }
.tl-row .n { font-weight: 700; }
.tl-row .acts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.year-label { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin: 14px 0 4px; }

/* Emails --------------------------------------------------------------------- */
.banner { display: flex; gap: 12px; align-items: flex-start; padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; border: 1px solid; }
.banner.ok { background: var(--green-bg); border-color: var(--green-border); color: #14532d; }
.banner.warn { background: var(--amber-bg); border-color: #f3cf8a; color: #6b3d05; }
.banner code { background: rgba(0, 0, 0, .06); padding: 1px 5px; border-radius: 4px; }
.email-row td.body-cell { white-space: pre-wrap; font-size: 13px; background: var(--surface-2); color: var(--text); cursor: default; }
.settings-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.placeholders { display: flex; gap: 6px; flex-wrap: wrap; }
.placeholders button { border: 1px dashed var(--brand); color: var(--brand); background: var(--brand-soft); border-radius: 6px; font-size: 12px; padding: 3px 8px; cursor: pointer; font-family: ui-monospace, Consolas, monospace; }
.email-preview { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.email-preview .hdr { background: var(--surface-2); padding: 12px 16px; border-bottom: 1px solid var(--border); font-size: 13px; }
.email-preview .bdy { padding: 18px 16px; white-space: pre-wrap; line-height: 1.6; font-size: 14px; }

/* Import ------------------------------------------------------------------- */
.dropzone {
  display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center;
  padding: 34px 20px; border: 2px dashed #b9d7de; border-radius: 12px; background: #f6fbfc;
  cursor: pointer; color: var(--brand); transition: background .15s, border-color .15s;
}
.dropzone:hover, .dropzone.over { background: var(--brand-soft); border-color: var(--brand); }
.dropzone strong { color: var(--text); font-size: 15px; }
.import-help { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 20px; margin-top: 20px; }
.import-help ul { margin: 0 0 10px; padding-left: 18px; line-height: 1.7; }
.template-box { background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 16px; align-self: start; }
.template-box p { margin: 6px 0 12px; }
.import-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 24px; margin-bottom: 16px; }
.map-grid { display: flex; flex-direction: column; gap: 6px; }
.map-row { display: grid; grid-template-columns: 170px 210px minmax(0, 1fr); gap: 10px; align-items: center; }
.map-row select { padding: 6px 8px; }
.map-row.missing select { border-color: var(--red); background: var(--red-bg); }
.map-label { font-weight: 500; font-size: 13px; }
.map-sample { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.req { color: var(--red); }
.import-summary { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 6px 0 10px; }
.import-table { max-height: 380px; }
.import-table table.grid tbody tr { cursor: default; }
.import-table tr.row-error { background: #fff7f7 !important; }
.issue { font-size: 12px; line-height: 1.4; color: var(--muted); }
.issue.err { color: var(--red); font-weight: 500; }
.issue.warn { color: var(--amber); }
.import-done { text-align: center; padding: 8px 0 4px; }
.import-done .tick { width: 56px; height: 56px; border-radius: 50%; background: var(--green-bg); color: var(--green); display: inline-flex; align-items: center; justify-content: center; font-size: 28px; margin-bottom: 10px; }

/* Google Calendar ------------------------------------------------------------ */
.gcal-status { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 6px; }
.gcal-status .k, .gcal-changes .k { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; font-weight: 600; margin-bottom: 4px; }
.gcal-changes { margin-top: 14px; padding: 10px 12px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; display: flex; flex-direction: column; gap: 3px; }
.setup-steps { margin: 8px 0; padding-left: 20px; line-height: 1.6; }
.setup-steps code.copy { cursor: pointer; display: inline-block; margin-top: 2px; }
.gcal-tag { font-size: 11px; color: var(--brand); font-weight: 500; }

/* Booking editor --------------------------------------------------------------- */
.book-editor { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 8px; width: 100%; padding: 10px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; }
.book-editor label { display: flex; flex-direction: column; gap: 3px; font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.book-editor input[type=date], .book-editor input[type=time] { padding: 6px 8px; font-size: 13px; text-transform: none; }
.book-editor input:disabled { opacity: .45; }
.book-editor > label { min-width: 0; }
.book-editor input { min-width: 0; }
/* Narrow places (side lists, small popups): date on its own row, start/end below. */
.side-list .book-editor, .modal.narrow .book-editor { grid-template-columns: 1fr 1fr; }
.side-list .book-editor > label:first-child, .modal.narrow .book-editor > label:first-child { grid-column: 1 / -1; }
.book-editor-foot { grid-column: 1 / -1; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.book-editor label.no-time { flex-direction: row; align-items: center; gap: 5px; text-transform: none; letter-spacing: 0; font-weight: 500; color: var(--text); }
.tl-row .acts:has(.book-editor), .list-item .acts:has(.book-editor) { flex: 1 1 100%; }
.tl-row:has(.book-editor) { grid-template-columns: 90px 1fr; }
.tl-row:has(.book-editor) .acts { grid-column: 1 / -1; }
/* "Mark done" form: one line per recommendation, then the note (and follow-up date) full width. */
.done-editor { grid-template-columns: 1fr; }
.side-list .done-editor, .modal.narrow .done-editor { grid-template-columns: 1fr; }
.done-editor .done-title { font-size: 13px; font-weight: 600; }
.done-editor .done-title .muted { font-weight: 400; }
.done-editor label.rec { flex-direction: row; align-items: center; gap: 8px; text-transform: none; letter-spacing: 0; font-size: 13px; font-weight: 500; color: var(--text); }
.done-editor label.rec select { margin-left: auto; flex: none; width: auto; padding: 4px 6px; font-size: 13px; }
.done-editor label.rec select:disabled { opacity: .45; }
.done-editor input[type=text], .done-editor textarea { padding: 6px 8px; font-size: 13px; text-transform: none; letter-spacing: 0; font-weight: 400; color: var(--text); }
.done-editor .hint { text-transform: none; letter-spacing: 0; font-weight: 400; }
.rec-note { margin-top: 3px; padding: 4px 8px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--border); }
.private-note { background: #fff8e1; border: 1px dashed #d9b75a; }
.chip .t { font-weight: 700; margin-right: 3px; }
.time { font-variant-numeric: tabular-nums; }

.appt-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) auto; gap: 16px; align-items: start; }
@media (max-width: 900px) { .appt-grid { grid-template-columns: 1fr; } }

/* WhatsApp, one-off jobs, online bookings ------------------------------------------ */
.btn.wa { background: #e7f9ee; border-color: #9fe0b8; color: #11743d; }
.btn.wa:hover { background: #d3f4e0; }
.chip .tag { display: inline-block; margin-left: 4px; padding: 0 4px; border-radius: 4px; background: rgba(0, 0, 0, .08); font-size: 10px; font-weight: 700; }
.chip.oneoff.booked { background: #e6f0fb; border-color: #a9c6ea; color: #1d4370; }
.oneoff-key { display: inline-grid !important; place-items: center; width: auto !important; padding: 0 3px; font-size: 9px; font-style: normal; font-weight: 700; background: #e6f0fb; border: 1px solid #a9c6ea; color: #1d4370; }
.badge { display: inline-block; padding: 1px 6px; border-radius: 4px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; vertical-align: 1px; }
.badge.online { background: #fff1d6; color: #8a5300; }
.badge.link { background: var(--brand-soft); color: var(--brand-dark); }
.online-banner { background: #fff8e8; border-color: #f1d58f; color: #6b4705; }
.online-banner a { color: inherit; font-weight: 600; }
.money-tag { font-weight: 600; color: var(--text); }

/* One-off job form in the customer profile */
.oneoff-form { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; padding: 12px; margin: 6px 0 10px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; }
.oneoff-foot { grid-column: 1 / -1; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
@media (max-width: 760px) { .oneoff-form { grid-template-columns: 1fr 1fr; } }

/* Settings: booking link, price list, WhatsApp preview */
.booking-link { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; padding: 14px 16px; border-radius: 10px; background: var(--brand-soft); border: 1px solid #bfe0e7; }
.booking-link .k { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
.booking-link code { display: inline-block; font-size: 15px; font-weight: 600; margin: 2px 0 4px; }
.svc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.svc-edit { display: flex; flex-direction: column; gap: 10px; padding: 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); }
.price-table td { padding: 4px 8px; }
.price-table input { padding: 5px 8px; max-width: 140px; }
.wa-preview { white-space: pre-wrap; background: #dcf8c6; border-radius: 10px 10px 10px 2px; padding: 10px 12px; font-size: 14px; line-height: 1.5; max-width: 420px; box-shadow: 0 1px 1px rgba(0, 0, 0, .08); }
@media (max-width: 1100px) { .svc-grid { grid-template-columns: 1fr; } }

/* Toasts --------------------------------------------------------------------- */
.toasts { position: fixed; bottom: 20px; right: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 80; }
.toast { background: #12262d; color: #fff; padding: 11px 16px; border-radius: 9px; box-shadow: 0 8px 24px rgba(0, 0, 0, .2); max-width: 380px; font-size: 13px; animation: slide .2s ease-out; }
.toast.error { background: var(--red); }
.toast.success { background: var(--green); }
.toast.warn { background: var(--amber); }
@keyframes slide { from { transform: translateY(8px); opacity: 0; } }

@media (max-width: 1300px) { .stats { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 1100px) {
  .dash-grid, .settings-grid, .import-grid, .import-help { grid-template-columns: 1fr; }
  .dash-side { height: auto; min-height: 0; }
  .dash-side .card .list { max-height: 420px; }
  .stats { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 760px) {
  body { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; flex-direction: row; align-items: center; padding: 8px 12px; overflow-x: auto; }
  .brand { padding: 0 8px 0 0; }
  .brand span, .sidebar-foot { display: none; }
  .sidebar nav { flex-direction: row; }
  .logout { margin: 0 0 0 auto; }
  .logout span { display: none; }
  .topbar, #view { padding-left: 16px; padding-right: 16px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .calendar .day { min-height: 64px; }
  .chip { font-size: 10px; padding: 2px 4px; }
  .form-grid, .cust-summary { grid-template-columns: 1fr 1fr; }
  .filters input[type=search] { width: 100%; }
  .tl-row { grid-template-columns: 1fr; }
  .map-row { grid-template-columns: 1fr 1fr; }
  .gcal-status { grid-template-columns: 1fr; }
  .map-sample { grid-column: 1 / -1; }
}

/* Google Calendar import ------------------------------------------------------------------ */
.banner.info { background: var(--surface-2); border-color: var(--border); }
.import-range { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 12px; }
.import-range .field { width: auto; }
.import-table td { vertical-align: top; }
.import-table select { min-width: 170px; }
.import-table .nowrap { white-space: nowrap; }
.import-notes { white-space: pre-line; margin-top: 3px; max-width: 360px; }
.import-match { margin-top: 3px; color: var(--green); }
.import-table .new-cust { display: grid; gap: 4px; margin-top: 6px; }
.import-table .new-cust input { padding: 4px 6px; font-size: 13px; }
.import-table tr.skipped td { opacity: .55; }
.import-foot { display: flex; gap: 10px; align-items: center; margin-top: 12px; }
.history-item { padding: 10px 0; border-bottom: 1px solid var(--border); }
.history-when { font-weight: 600; font-size: 13px; margin-bottom: 4px; }
.history-notes { white-space: pre-line; font-size: 13px; }
.import-details { margin-top: 3px; }
.import-conflict { margin-top: 3px; color: var(--red); }
.address-note { background: #fff8e1; border-color: #e6cf8f; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.badge-diff { display: inline-block; margin-left: 4px; padding: 0 6px; border-radius: 999px; background: #fff8e1; border: 1px solid #e6cf8f; color: #6b3d05; font-size: 11px; font-weight: 600; }
.overdue-text { color: var(--overdue); font-weight: 600; }
.day.day-off { background: repeating-linear-gradient(135deg, var(--surface-2), var(--surface-2) 6px, #eef1f4 6px, #eef1f4 12px); }
.off-label { margin-left: 6px; font-size: 10px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.day-off-form { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) auto; gap: 12px; margin-top: 14px; } @media (max-width: 900px) { .day-off-form { grid-template-columns: 1fr; } }
.properties-block { margin-top: 18px; padding-top: 12px; border-top: 1px solid var(--border); }
.backup-row { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.pill.removed { background: var(--grey-bg); color: var(--grey); text-decoration: line-through; }
.chip.removed { background: transparent; border: 1px dashed var(--border); color: var(--grey); text-decoration: line-through; }
.tl-row.removed { opacity: .65; }
.merge-box { padding: 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); width: 100%; }
