/* ==========================================================================
   FleetSquad — Reusable components
   Buttons · Cards · Badges · Forms · Tables · Modals · Dropdowns · Tabs
   Steppers · Toasts · Avatars · Stars · Uploads · Empty states · Pagination
   ========================================================================== */

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: 12px 22px;
  border-radius: var(--r-sm);
  font-size: var(--fs-base);
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  border: 1px solid transparent;
  transition: background var(--transition), color var(--transition),
              border-color var(--transition), box-shadow var(--transition),
              transform var(--transition);
}
.btn:active { transform: translateY(1px); }
.btn:disabled,
.btn[aria-disabled="true"] { opacity: .5; pointer-events: none; }
.btn svg { width: 18px; height: 18px; flex: none; }

.btn-primary {
  background: var(--blue-600);
  color: #fff;
  box-shadow: 0 2px 8px rgba(18, 114, 240, .25);
}
.btn-primary:hover { background: var(--blue-700); color: #fff; }

.btn-navy { background: var(--navy-700); color: #fff; }
.btn-navy:hover { background: var(--navy-600); color: #fff; }

.btn-dark { background: var(--navy-800); color: #fff; }
.btn-dark:hover { background: var(--navy-700); color: #fff; }

.btn-outline {
  background: transparent;
  color: var(--navy-800);
  border-color: var(--line);
}
.btn-outline:hover { border-color: var(--blue-600); color: var(--blue-600); background: var(--blue-050); }

.btn-outline-light {
  background: transparent;
  color: #fff;
  border-color: rgba(255, 255, 255, .38);
}
.btn-outline-light:hover { background: rgba(255, 255, 255, .12); color: #fff; }

.btn-ghost { background: transparent; color: var(--ink-600); }
.btn-ghost:hover { background: var(--surface-3); color: var(--ink-900); }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #b91c1c; color: #fff; }

.btn-success { background: var(--ok); color: #fff; }
.btn-success:hover { background: #15803d; color: #fff; }

.btn-lg { padding: 15px 34px; font-size: var(--fs-lg); border-radius: var(--r-sm); }
.btn-sm { padding: 8px 14px; font-size: var(--fs-sm); border-radius: var(--r-xs); }
.btn-xs { padding: 5px 10px; font-size: var(--fs-xs); border-radius: var(--r-xs); gap: 4px; }
.btn-xs svg { width: 14px; height: 14px; }
.btn-block { display: flex; width: 100%; }

/* Square icon-only button, used across dashboard toolbars. */
.btn-icon {
  width: 38px; height: 38px;
  padding: 0;
  border-radius: var(--r-sm);
  color: var(--ink-600);
  border: 1px solid var(--line);
  background: var(--surface);
  display: inline-flex; align-items: center; justify-content: center;
}
.btn-icon:hover { background: var(--surface-3); color: var(--ink-900); }
.btn-icon svg { width: 18px; height: 18px; }
.btn-icon--bare { border-color: transparent; background: transparent; }

/* --------------------------------------------------------------------------
   Cards
   -------------------------------------------------------------------------- */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-xs);
}
.card-pad { padding: var(--sp-6); }
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  padding: var(--sp-5) var(--sp-6);
  border-bottom: 1px solid var(--line-soft);
}
.card-head h3, .card-head h4 { font-size: var(--fs-lg); margin: 0; }
.card-body { padding: var(--sp-6); }
.card-foot {
  padding: var(--sp-4) var(--sp-6);
  border-top: 1px solid var(--line-soft);
  background: var(--surface-2);
  border-radius: 0 0 var(--r-lg) var(--r-lg);
}
.card-hover { transition: box-shadow var(--transition), transform var(--transition); }
.card-hover:hover { box-shadow: var(--sh-md); transform: translateY(-2px); }

/* --------------------------------------------------------------------------
   Badges & status pills
   -------------------------------------------------------------------------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border-radius: var(--r-pill);
  font-size: var(--fs-xs);
  font-weight: 700;
  line-height: 1.5;
  white-space: nowrap;
}
.badge::before {
  content: "";
  width: 7px; height: 7px;
  border-radius: 50%;
  background: currentColor;
  flex: none;
}
.badge--plain::before { display: none; }

/* Order lifecycle — these six colours are mandated by the spec. */
.badge--open      { color: var(--st-open);     background: #f1f3f6; }
.badge--assigned  { color: var(--st-assigned); background: #e8f7ee; }
.badge--waiting   { color: var(--st-waiting);  background: #e6efff; }
.badge--completed { color: var(--st-complete); background: #e4ecfd; }
.badge--canceled  { color: var(--st-canceled); background: #fdecec; }
.badge--manager   { color: var(--st-manager);  background: #fdf3e3; }

/* "Completed waiting payment" blinks so it is impossible to miss in a table. */
.badge--waiting          { animation: fs-blink-soft 1.05s ease-in-out infinite; }
.badge--waiting::before  { animation: fs-blink 1.05s steps(1, end) infinite; }
@keyframes fs-blink      { 0%, 49% { opacity: 1 } 50%, 100% { opacity: 0 } }
@keyframes fs-blink-soft { 0%, 49% { background: #e6efff } 50%, 100% { background: #cfe0ff } }

/* Generic semantic badges */
.badge--ok      { color: var(--ok);      background: var(--ok-bg); }
.badge--warn    { color: var(--warn);    background: var(--warn-bg); }
.badge--danger  { color: var(--danger);  background: var(--danger-bg); }
.badge--info    { color: var(--info);    background: var(--info-bg); }
.badge--neutral { color: var(--ink-600); background: var(--surface-3); }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: var(--r-pill);
  background: var(--surface-3);
  border: 1px solid var(--line);
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--ink-600);
}
/* FS.icon() emits an unsized <svg>, so without this a chip icon falls back to
   the browser's 300x150 default and tears the pill apart. */
.chip svg { width: 15px; height: 15px; flex: none; }
.chip--active { background: var(--blue-050); border-color: var(--blue-100); color: var(--blue-600); }

/* --------------------------------------------------------------------------
   Partner card logo
   A fixed box with contain, so an uploaded logo of any proportion sits on the
   same baseline as the rest of the row.
   -------------------------------------------------------------------------- */

.partner-logo {
  display: block;
  height: 56px;
  width: auto;
  max-width: 78%;
  object-fit: contain;
  margin: 0 auto var(--sp-5);
  opacity: .62;
}
.partner-logo--empty {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  border-radius: var(--r-md);
  background: var(--surface-3);
  color: var(--ink-400);
  font-weight: 800;
  opacity: 1;
}

/* --------------------------------------------------------------------------
   Forms
   -------------------------------------------------------------------------- */

.field { display: block; margin-bottom: var(--sp-5); }
#createCustomerCompany[hidden] { display: none; }
.field:last-child { margin-bottom: 0; }

.label {
  display: block;
  margin-bottom: 7px;
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--ink-800);
}
.label .req { color: var(--danger); }

.input,
.select,
.textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--ink-200);
  border-radius: var(--r-sm);
  background: var(--surface);
  font-size: var(--fs-base);
  color: var(--ink-900);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.input::placeholder, .textarea::placeholder { color: var(--ink-400); }

.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: var(--blue-600);
  box-shadow: 0 0 0 3px rgba(18, 114, 240, .14);
}
.input:disabled, .select:disabled, .textarea:disabled {
  background: var(--surface-3);
  color: var(--ink-400);
  cursor: not-allowed;
}
.input[readonly] { background: var(--surface-3); color: var(--ink-600); }

.textarea { min-height: 118px; resize: vertical; line-height: 1.55; }

.select {
  appearance: none;
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7890' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
  background-size: 17px;
}

/* Filter pills. These live here rather than in dashboard.css because the
   public reviews page uses them too, and it never loads dashboard.css. */
/* Filter pill row */
.filters { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }
.filter-pill {
  padding: 7px 14px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--ink-600);
  white-space: nowrap;
  transition: all var(--transition);
}
.filter-pill:hover { border-color: var(--blue-500); color: var(--blue-600); }
.filter-pill.is-active { background: var(--navy-800); border-color: var(--navy-800); color: #fff; }

/* A button that has to read as a select (the gated homepage range picker). */
.select-btn { text-align: left; cursor: pointer; }

.hint { margin-top: 6px; font-size: var(--fs-xs); color: var(--ink-400); }
.hint svg { width: 13px; height: 13px; vertical-align: -2px; }
.error-text { margin-top: 6px; font-size: var(--fs-xs); color: var(--danger); font-weight: 600; }
.input.is-error, .select.is-error, .textarea.is-error { border-color: var(--danger); }

.field-row { display: grid; gap: var(--sp-4); grid-template-columns: 1fr; }
@media (min-width: 640px) {
  .field-row-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .field-row-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* Input with a leading icon (search boxes, phone fields). */
.input-icon { position: relative; }
.input-icon > svg,
.input-icon > i[data-icon] {
  position: absolute;
  left: 13px; top: 50%;
  transform: translateY(-50%);
  width: 18px; height: 18px;
  color: var(--ink-400);
  pointer-events: none;
}
.input-icon > i[data-icon] > svg { width: 100%; height: 100%; }
.input-icon .input { padding-left: 42px; }

/* Checkbox / radio */
.check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: var(--fs-base);
  cursor: pointer;
}
.check input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--blue-600); flex: none; cursor: pointer; }

/* Card-style radio used by the Get Estimate + New Sale flows. */
.opt-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border: 1.5px solid var(--line);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
}
.opt-card:hover { border-color: var(--blue-500); }
.opt-card input { accent-color: var(--blue-600); margin-top: 3px; flex: none; }
.opt-card.is-selected { border-color: var(--blue-600); background: var(--blue-050); }
.opt-card strong { display: block; color: var(--ink-900); font-size: var(--fs-base); }
.opt-card span { font-size: var(--fs-sm); color: var(--ink-500); }
.opt-card-contact { display: block; font-size: var(--fs-xs); color: var(--ink-400); margin-top: 2px; }

/* --------------------------------------------------------------------------
   Search box above a list (assign-mechanic step, and anywhere else a roster
   needs narrowing before you pick from it)
   -------------------------------------------------------------------------- */

.list-search { position: relative; display: block; }
.list-search .input { padding-left: 40px; padding-right: 108px; }
.list-search-ico {
  position: absolute; left: 13px; top: 50%;
  transform: translateY(-50%);
  display: flex;
  color: var(--ink-400);
  pointer-events: none;
}
.list-search-ico svg { width: 17px; height: 17px; }
.list-search-count {
  position: absolute; right: 13px; top: 50%;
  transform: translateY(-50%);
  font-size: var(--fs-xs);
  color: var(--ink-400);
  pointer-events: none;
  white-space: nowrap;
}
/* Safari draws its own clear button on type="search"; hide it so it does not
   collide with the count. */
.list-search .input::-webkit-search-cancel-button { display: none; }

.empty-state--sm { padding: var(--sp-6) var(--sp-5); }
.empty-state--sm svg { width: 28px; height: 28px; }

/* --------------------------------------------------------------------------
   Google Maps embed
   A plain iframe in a fixed frame — no API key and no script to load.
   -------------------------------------------------------------------------- */

.map-embed {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface-3);
  overflow: hidden;
}
.map-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; }
@supports not (aspect-ratio: 4 / 3) { .map-embed { height: 320px; } }
@media (min-width: 768px) {
  .map-embed { aspect-ratio: 16 / 6; }
  @supports not (aspect-ratio: 16 / 6) { .map-embed { height: 420px; } }
}

/* Toggle switch */
.switch { position: relative; display: inline-block; width: 42px; height: 24px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span {
  position: absolute; inset: 0;
  background: var(--ink-300);
  border-radius: var(--r-pill);
  transition: background var(--transition);
  cursor: pointer;
}
.switch span::before {
  content: "";
  position: absolute;
  height: 18px; width: 18px;
  left: 3px; bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform var(--transition);
}
.switch input:checked + span { background: var(--blue-600); }
.switch input:checked + span::before { transform: translateX(18px); }

/* --------------------------------------------------------------------------
   File upload (drop zone + thumbnail grid)
   -------------------------------------------------------------------------- */

.upload {
  border: 2px dashed var(--ink-200);
  border-radius: var(--r-md);
  padding: var(--sp-7) var(--sp-5);
  text-align: center;
  background: var(--surface-2);
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
}
.upload:hover, .upload.is-drag { border-color: var(--blue-600); background: var(--blue-050); }
.upload > i[data-icon] { display: flex; justify-content: center; margin-bottom: var(--sp-3); }
.upload svg { width: 34px; height: 34px; margin: 0 auto var(--sp-3); color: var(--blue-600); }
.upload > i[data-icon] > svg { margin: 0; }
.upload strong { display: block; color: var(--ink-900); }
.upload small { color: var(--ink-400); }

.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: var(--sp-3); margin-top: var(--sp-4); }
.thumb {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--r-sm);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface-3);
  display: flex; align-items: center; justify-content: center;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb .thumb-fallback { font-size: 10px; color: var(--ink-400); padding: 6px; text-align: center; word-break: break-all; }
.thumb-x {
  position: absolute; top: 4px; right: 4px;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: rgba(11, 18, 32, .7);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; line-height: 1;
}
.thumb-x:hover { background: var(--danger); }

/* --------------------------------------------------------------------------
   Tables
   -------------------------------------------------------------------------- */

.table-wrap {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  overflow: hidden;
}

.table { width: 100%; border-collapse: collapse; font-size: var(--fs-base); }
.table th {
  text-align: left;
  padding: 13px var(--sp-5);
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--ink-500);
  text-transform: uppercase;
  letter-spacing: .05em;
  white-space: nowrap;
}
.table td {
  padding: 15px var(--sp-5);
  border-bottom: 1px solid var(--line-soft);
  color: var(--ink-700);
  vertical-align: middle;
}
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background var(--transition); }
.table tbody tr:hover { background: var(--surface-2); }
.table .td-strong { color: var(--ink-900); font-weight: 700; }
.table .td-actions { white-space: nowrap; text-align: right; }
/* Short values that must not break mid-way — a PO number, a city and state. */
.table .td-nowrap { white-space: nowrap; }
.table--compact td, .table--compact th { padding: 10px var(--sp-4); }

.table-empty { padding: var(--sp-9) var(--sp-5); text-align: center; color: var(--ink-400); }

/* On narrow screens each row becomes a stacked card driven by data-label. */
@media (max-width: 767px) {
  .table--stack thead { display: none; }
  .table--stack tr {
    display: block;
    padding: var(--sp-4);
    border-bottom: 1px solid var(--line);
  }
  .table--stack tr:last-child { border-bottom: 0; }
  .table--stack td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--sp-4);
    padding: 6px 0;
    border: 0;
    text-align: right;
  }
  .table--stack td::before {
    content: attr(data-label);
    font-size: var(--fs-xs);
    font-weight: 700;
    color: var(--ink-500);
    text-transform: uppercase;
    letter-spacing: .05em;
    text-align: left;
    flex: none;
  }
  .table--stack .td-actions { justify-content: flex-end; }
}

/* --------------------------------------------------------------------------
   Dropdown menu (click to open — used by tables and the dashboard topbar)
   -------------------------------------------------------------------------- */

.dropdown { position: relative; display: inline-block; }
/* A menu is placed when it opens (core.js): fixed, anchored to its button,
   so a table's scroll wrapper or a card's rounded-corner clipping cannot cut
   off the last rows' menus. Closed, it takes no space at all — a wrapper
   never grows scrollable to fit menus nobody can see. */
.dropdown-menu {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  min-width: 190px;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--sh-lg);
  z-index: 100;
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity var(--transition), transform var(--transition);
}
.dropdown.is-open .dropdown-menu { display: block; opacity: 1; transform: translateY(0); }
/* The fade-in from display:none, on browsers that animate that. */
@starting-style {
  .dropdown.is-open .dropdown-menu { opacity: 0; transform: translateY(-6px); }
}
.dropdown-menu button,
.dropdown-menu a {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  border-radius: var(--r-xs);
  font-size: var(--fs-base);
  color: var(--ink-700);
  text-align: left;
}
.dropdown-menu button:hover,
.dropdown-menu a:hover { background: var(--surface-3); color: var(--ink-900); }
.dropdown-menu svg { width: 16px; height: 16px; flex: none; color: var(--ink-400); }
.dropdown-menu .is-danger { color: var(--danger); }
.dropdown-menu .is-danger:hover { background: var(--danger-bg); color: var(--danger); }
.dropdown-sep { height: 1px; background: var(--line-soft); margin: 5px 0; }

/* --------------------------------------------------------------------------
   Modal — bottom sheet on phones, centred dialog from 640px up
   -------------------------------------------------------------------------- */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(3, 12, 28, .55);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 200;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition), visibility var(--transition);
}
.modal-backdrop.is-open { opacity: 1; visibility: visible; }

.modal {
  width: 100%;
  max-width: 560px;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  box-shadow: var(--sh-lg);
  transform: translateY(24px);
  transition: transform var(--transition);
}
.modal-backdrop.is-open .modal { transform: translateY(0); }
.modal--lg { max-width: 860px; }
.modal--sm { max-width: 420px; }

@media (min-width: 640px) {
  .modal-backdrop { align-items: center; padding: var(--sp-6); }
  .modal { border-radius: var(--r-xl); max-height: 88vh; }
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-4);
  padding: var(--sp-5) var(--sp-6);
  border-bottom: 1px solid var(--line-soft);
}
.modal-head h3 { font-size: var(--fs-xl); margin: 0; }
.modal-head p { margin: 4px 0 0; font-size: var(--fs-sm); color: var(--ink-500); }
.modal-close {
  width: 34px; height: 34px;
  border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-400);
  flex: none;
}
.modal-close:hover { background: var(--surface-3); color: var(--ink-900); }
.modal-close svg { width: 18px; height: 18px; }

.modal-body { padding: var(--sp-6); overflow-y: auto; flex: 1 1 auto; }
.modal-foot {
  display: flex;
  gap: var(--sp-3);
  justify-content: flex-end;
  padding: var(--sp-5) var(--sp-6);
  border-top: 1px solid var(--line-soft);
  background: var(--surface-2);
}
.modal-foot .btn { flex: 1 1 auto; }
@media (min-width: 640px) { .modal-foot .btn { flex: 0 0 auto; } }

body.modal-open { overflow: hidden; }

/* --------------------------------------------------------------------------
   Tabs
   -------------------------------------------------------------------------- */

.tabs {
  display: flex;
  gap: var(--sp-2);
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  padding: 11px 16px;
  font-size: var(--fs-base);
  font-weight: 600;
  color: var(--ink-500);
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition: color var(--transition), border-color var(--transition);
}
.tab:hover { color: var(--ink-900); }
.tab.is-active { color: var(--blue-600); border-bottom-color: var(--blue-600); }
.tab-panel { display: none; padding-top: var(--sp-6); }
.tab-panel.is-active { display: block; }

/* --------------------------------------------------------------------------
   Stepper (multi-step forms)
   -------------------------------------------------------------------------- */

.stepper { display: flex; align-items: flex-start; margin-bottom: var(--sp-7); }
.step { flex: 1 1 0; text-align: center; position: relative; min-width: 0; }
.step::before {
  content: "";
  position: absolute;
  top: 17px; left: -50%;
  width: 100%; height: 2px;
  background: var(--line);
  z-index: 0;
}
.step:first-child::before { display: none; }
.step-dot {
  position: relative;
  z-index: 1;
  width: 34px; height: 34px;
  margin: 0 auto 8px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--line);
  color: var(--ink-400);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: var(--fs-sm);
  transition: all var(--transition);
}
.step-dot svg { width: 16px; height: 16px; }
.step-label {
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--ink-400);
  padding-inline: 4px;
  overflow-wrap: anywhere;
}
.step.is-active .step-dot { border-color: var(--blue-600); background: var(--blue-600); color: #fff; }
.step.is-active .step-label { color: var(--blue-600); }
.step.is-done .step-dot { border-color: var(--ok); background: var(--ok); color: #fff; }
.step.is-done::before,
.step.is-active::before { background: var(--blue-500); }
.step.is-done .step-label { color: var(--ink-700); }
@media (max-width: 599px) { .step-label { display: none; } .stepper { margin-bottom: var(--sp-6); } }

/* --------------------------------------------------------------------------
   Toast notifications
   -------------------------------------------------------------------------- */

.toast-host {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 300;
  width: calc(100% - 32px);
  max-width: 400px;
  pointer-events: none;
}
@media (min-width: 640px) {
  .toast-host { left: auto; right: 24px; bottom: 24px; transform: none; }
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 13px 16px;
  border-radius: var(--r-md);
  background: var(--navy-900);
  color: #fff;
  box-shadow: var(--sh-lg);
  font-size: var(--fs-base);
  pointer-events: auto;
  animation: fs-toast-in .24s cubic-bezier(.2, .8, .3, 1);
}
.toast.is-out { animation: fs-toast-out .2s ease forwards; }
.toast svg { width: 19px; height: 19px; flex: none; margin-top: 1px; }
.toast--ok svg     { color: #4ade80; }
.toast--warn svg   { color: #fbbf24; }
.toast--danger svg { color: #f87171; }
.toast--info svg   { color: var(--blue-500); }
.toast strong { display: block; font-weight: 700; }
.toast small { color: rgba(255, 255, 255, .72); font-size: var(--fs-sm); }
@keyframes fs-toast-in  { from { opacity: 0; transform: translateY(14px); } }
@keyframes fs-toast-out { to   { opacity: 0; transform: translateY(8px); } }

/* --------------------------------------------------------------------------
   Avatars, stars, progress, misc
   -------------------------------------------------------------------------- */

.avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--blue-050);
  color: var(--blue-600);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: var(--fs-sm);
  flex: none;
}
.avatar--sm { width: 30px; height: 30px; font-size: var(--fs-xs); }
.avatar--lg { width: 52px; height: 52px; font-size: var(--fs-md); }
.avatar--navy { background: var(--navy-800); color: #fff; }

.stars { display: inline-flex; gap: 2px; color: #f5a524; }
.stars svg { width: 16px; height: 16px; }
.stars--lg svg { width: 26px; height: 26px; }
.stars .is-empty { color: var(--ink-200); }

/* Interactive rating input */
.star-input { display: inline-flex; gap: 4px; }
.star-input button { color: var(--ink-200); transition: color var(--transition), transform var(--transition); }
.star-input button svg { width: 32px; height: 32px; }
.star-input button:hover { transform: scale(1.12); }
.star-input button.is-on { color: #f5a524; }

.progress { height: 8px; border-radius: var(--r-pill); background: var(--line); overflow: hidden; }
.progress span { display: block; height: 100%; border-radius: inherit; background: var(--blue-600); transition: width .4s ease; }

.empty-state { padding: var(--sp-9) var(--sp-5); text-align: center; }
.empty-state svg { width: 46px; height: 46px; color: var(--ink-300); margin: 0 auto var(--sp-4); }
.empty-state h4 { margin-bottom: 6px; }
.empty-state p { color: var(--ink-500); max-width: 380px; margin-inline: auto; }

.pagination { display: flex; align-items: center; justify-content: center; gap: 6px; padding: var(--sp-5); }
.pagination button {
  min-width: 34px; height: 34px;
  padding: 0 9px;
  border-radius: var(--r-xs);
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--ink-600);
}
.pagination button:hover:not(:disabled) { border-color: var(--blue-600); color: var(--blue-600); }
.pagination button.is-active { background: var(--blue-600); border-color: var(--blue-600); color: #fff; }
.pagination button:disabled { opacity: .4; cursor: not-allowed; }

/* Definition list used on every "details" screen. */
.dl { display: grid; gap: var(--sp-4); grid-template-columns: 1fr; }
@media (min-width: 640px) { .dl--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 900px) { .dl--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.dl dt { font-size: var(--fs-xs); font-weight: 700; color: var(--ink-500); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 3px; }
.dl dd { margin: 0; color: var(--ink-900); font-weight: 600; font-size: var(--fs-base); }

.divider { height: 1px; background: var(--line-soft); margin: var(--sp-5) 0; }

/* Inline alert / callout */
.alert {
  display: flex;
  gap: 11px;
  padding: 13px 16px;
  border-radius: var(--r-md);
  font-size: var(--fs-base);
  border: 1px solid transparent;
}
.alert svg { width: 19px; height: 19px; flex: none; margin-top: 1px; }
.alert--info   { background: var(--info-bg);   border-color: #cfe0ff; color: #1e40af; }
.alert--ok     { background: var(--ok-bg);     border-color: #bfead0; color: #14653a; }
.alert--warn   { background: var(--warn-bg);   border-color: #f6dfb4; color: #92400e; }
.alert--danger { background: var(--danger-bg); border-color: #f7cccc; color: #991b1b; }

/* Skeleton shimmer for simulated loading */
.skeleton {
  background: linear-gradient(90deg, var(--surface-3) 25%, #eef1f6 37%, var(--surface-3) 63%);
  background-size: 400% 100%;
  animation: fs-shimmer 1.3s ease infinite;
  border-radius: var(--r-xs);
}
@keyframes fs-shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* --------------------------------------------------------------------------
   Address autocomplete — Google Places suggestions
   -------------------------------------------------------------------------- */

.autocomplete { position: relative; }
.phone-segments {
  display: flex;
  align-items: center;
  gap: .3rem;
  min-height: 46px;
  width: 100%;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  font: inherit;
  color: var(--ink-900);
}
.phone-segments:focus-within { border-color: var(--blue-600); box-shadow: 0 0 0 3px rgba(18,114,240,.13); }
.phone-segment {
  min-width: 0;
  padding: 8px 2px;
  border: 0;
  outline: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  letter-spacing: .05em;
  text-align: center;
}
.phone-segment--3 { width: 3.6ch; }
.phone-segment--4 { width: 4.8ch; }
.phone-segment[aria-invalid="true"] { color: var(--danger); }
.autocomplete-list {
  position: absolute;
  top: calc(100% + 4px);
  left: 0; right: 0;
  z-index: 50;
  max-height: 260px;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  box-shadow: var(--sh-lg);
  display: none;
}
.autocomplete-list.is-open { display: block; }
.autocomplete-list button {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  width: 100%;
  padding: 11px 14px;
  text-align: left;
  border-bottom: 1px solid var(--line-soft);
}
.autocomplete-list button:last-child { border-bottom: 0; }
.autocomplete-list button:hover,
.autocomplete-list button.is-cursor { background: var(--blue-050); }
.autocomplete-list svg { width: 17px; height: 17px; color: var(--ink-400); flex: none; margin-top: 2px; }
.autocomplete-list strong { display: block; font-size: var(--fs-base); color: var(--ink-900); font-weight: 600; }
.autocomplete-list small { color: var(--ink-400); font-size: var(--fs-sm); }
.autocomplete-foot {
  padding: 7px 14px;
  font-size: 11px;
  color: var(--ink-400);
  border-top: 1px solid var(--line-soft);
  text-align: right;
}

/* --------------------------------------------------------------------------
   Confirmation / success panel
   -------------------------------------------------------------------------- */

.success-hero { text-align: center; padding: var(--sp-8) 0 var(--sp-6); }
.success-mark {
  width: 76px; height: 76px;
  margin: 0 auto var(--sp-5);
  border-radius: 50%;
  background: var(--ok-bg);
  color: var(--ok);
  display: flex; align-items: center; justify-content: center;
  animation: fs-pop .4s cubic-bezier(.2, .9, .3, 1.4);
}
.success-mark svg { width: 38px; height: 38px; }
@keyframes fs-pop { from { transform: scale(.5); opacity: 0; } }

.ref-badge {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 14px 30px;
  border-radius: var(--r-md);
  background: var(--navy-900);
  color: #fff;
}
.ref-badge small { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .1em; color: rgba(255, 255, 255, .6); font-weight: 700; }
.ref-badge strong { font-size: 1.6rem; letter-spacing: .02em; font-family: var(--font-mono); }

/* Inline "read next" list inside an article body. */
.inline-links { display: grid; gap: 8px; }
.inline-links li { display: flex; gap: 9px; }
.inline-links li::before { content: "→"; color: var(--blue-600); flex: none; }
.inline-links a { color: var(--blue-600); font-weight: 600; }
.inline-links a:hover { text-decoration: underline; }

/* --------------------------------------------------------------------------
   Simulated SMS / email preview
   The prototype has no mail server, so anything it would have sent is shown
   in a modal instead. Raised from the admin, the portals and — the reason it
   lives here rather than in dashboard.css — the public login page's password
   reset, which loads only this bundle.
   -------------------------------------------------------------------------- */
.msg-preview {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
  font-size: var(--fs-sm);
}
.msg-preview-head {
  padding: 9px 14px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line-soft);
  font-weight: 700;
  color: var(--ink-600);
  display: flex; align-items: center; gap: 8px;
}
.msg-preview-head svg { width: 15px; height: 15px; flex: none; }
.msg-preview-body { padding: 14px; white-space: pre-line; color: var(--ink-700); line-height: 1.6; background: var(--surface); }
