/* Basildon Delivery shared UI foundations.
 * Loaded before the temporary legacy ui.css and interface stylesheets.
 * Keep only genuinely cross-interface rules in this file.
 */

:root {
  --bg: #f4f7fb;
  --panel: #ffffff;
  --panel-soft: #f8fafc;
  --border: #d9e2ec;
  --border-strong: #bcccdc;
  --text: #102a43;
  --muted: #486581;
  --accent: #186faf;
  --accent-soft: #e8f1fb;
  --success: #1f9254;
  --success-soft: #e8f7ef;
  --warning: #ad6a00;
  --warning-soft: #fff4db;
  --danger: #c93c37;
  --danger-soft: #fdeaea;
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  --radius: 18px;
  --radius-sm: 12px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: linear-gradient(180deg, #eef3f8 0%, var(--bg) 160px);
  color: var(--text);
}
a { color: var(--accent); }
a:hover { text-decoration: none; }
button, input, textarea, select { font: inherit; }
.app-shell {
  width: min(1180px, calc(100% - 28px));
  margin: 0 auto;
  padding: 24px 0 48px;
}
.page-topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.page-kicker {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: 12px;
  font-weight: 700;
  margin: 0 0 8px;
}
.page-title {
  margin: 0;
  font-size: clamp(1.8rem, 4vw, 2.55rem);
  line-height: 1.05;
}
.page-subtitle {
  color: var(--muted);
  margin: 10px 0 0;
  max-width: 72ch;
}
.topbar-actions,
.inline-actions,
.card-actions,
.filter-row,
.stack-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}
.button,
.button-link,
button,
input[type="submit"] {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 11px 15px;
  min-height: 44px;
  text-decoration: none;
  cursor: pointer;
  background: #fff;
  color: var(--text);
  font-weight: 700;
  box-shadow: 0 1px 0 rgba(16, 42, 67, 0.04);
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease, background .12s ease;
}
.button:hover,
.button-link:hover,
button:hover,
input[type="submit"]:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}
.button:disabled,
button:disabled,
.is-loading {
  opacity: .72;
  cursor: wait;
  transform: none !important;
}
.button.primary,
button.primary,
input[type="submit"].primary { background: var(--accent); color: #fff; }
.button.secondary,
button.secondary { background: var(--panel-soft); border-color: var(--border); }
.button.success,
button.success { background: var(--success); color: #fff; }
.button.warning,
button.warning { background: #f59e0b; color: #fff; }
.button.danger,
button.danger { background: var(--danger); color: #fff; }
.button.ghost,
button.ghost { background: transparent; border-color: var(--border); }

.card,
.panel,
.hero {
  background: var(--panel);
  border: 1px solid rgba(188, 204, 220, 0.75);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
}
.hero {
  background: linear-gradient(135deg, #ffffff 0%, #f7fbff 100%);
}
.card + .card,
.panel + .panel { margin-top: 14px; }
.grid {
  display: grid;
  gap: 14px;
}
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 14px;
  margin: 18px 0 24px;
}
.stat-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}
.stat-card .label {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 8px;
}
.stat-card .value {
  font-size: clamp(1.6rem, 4vw, 2.1rem);
  font-weight: 800;
}
.badge,
.status-pill,
.payment-pill,
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 11px;
  border-radius: 999px;
  font-size: 13px;
  line-height: 1;
  font-weight: 800;
  white-space: nowrap;
  border: 1px solid transparent;
}
.status-pill.pending_acceptance { background: #fff3d4; color: #855d00; }
.status-pill.accepted { background: #eef7ff; color: #165381; }
.status-pill.ready { background: #e8f7ef; color: #166c3b; }
.status-pill.pending { background: #fff3d4; color: #855d00; }
.status-pill.assigned { background: #eefcf9; color: #0f766e; }
.status-pill.picked_up { background: #e0f7f3; color: #0f6b63; }
.status-pill.out_for_delivery { background: #d9fbf3; color: #0b625b; }
.status-pill.arrived_at_dropoff { background: #e7fff1; color: #047344; }
.status-pill.delivered { background: #e6f8ed; color: #1b7a44; }
.status-pill.failed { background: #fdeaea; color: #a92828; }
.status-pill.cancelled { background: #eef2f6; color: #52606d; }
.payment-pill.account_due,
.payment-pill.cash_due { background: #fff4db; color: #8a5a00; }
.payment-pill.cash_collected,
.payment-pill.paid { background: #e8f7ef; color: #166c3b; }
.payment-pill.not_applicable { background: #eef2f6; color: #52606d; }
.payment-pill.voided { background: #f4efff; color: #6d28d9; border-color: #d9c8ff; }
.chip.cod { background: #fff0e0; color: #a24e00; }
.chip.live { background: #eaf2ff; color: #234fa5; }
.chip.claimable { background: #e8f7ef; color: #166c3b; }

.filter-card {
  margin-bottom: 20px;
}
.filter-form {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  align-items: end;
}
.filter-form label,
.form-grid label,
.field {
  display: grid;
  gap: 7px;
}
.filter-form label { min-width: 180px; }
input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  padding: 12px 13px;
  background: #fff;
  color: var(--text);
}
textarea { min-height: 110px; resize: vertical; }
input:focus,
textarea:focus,
select:focus {
  outline: 3px solid rgba(24, 111, 175, 0.15);
  border-color: var(--accent);
}
fieldset {
  margin: 0;
  padding: 0;
  border: 0;
}
.form-card h2,
.card h2,
.panel h2,
.section-title {
  margin-top: 0;
  margin-bottom: 14px;
  font-size: 1.15rem;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.form-grid .full { grid-column: 1 / -1; }
.helper,
.muted,
.small,
.live-note {
  color: var(--muted);
}
.live-note {
  margin-top: 8px;
  font-size: 14px;
}
.flash {
  border-radius: 14px;
  padding: 14px 15px;
  margin-bottom: 18px;
  border: 1px solid transparent;
}
.flash.success { background: var(--success-soft); border-color: #bfe7cf; color: #166c3b; }
.flash.warning { background: var(--warning-soft); border-color: #efd39c; color: #7a4b00; }
.flash.error { background: var(--danger-soft); border-color: #f3b7b6; color: #9f2621; }
.flash.info { background: var(--accent-soft); border-color: #c8dbef; color: #165381; }
.empty-state {
  padding: 30px 18px;
  text-align: center;
  color: var(--muted);
}
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: #fff;
  box-shadow: var(--shadow);
}
table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}
th,
td {
  text-align: left;
  padding: 14px 12px;
  border-bottom: 1px solid #edf2f7;
  vertical-align: top;
}
thead th {
  background: #f8fbff;
  color: var(--muted);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
tbody tr:hover { background: #fbfdff; }
.job-list,
.detail-stack,
.timeline,
.history-list {
  display: grid;
  gap: 14px;
}
.job-card {
  display: grid;
  gap: 14px;
}
.job-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  flex-wrap: wrap;
}
.job-title {
  margin: 0;
  font-size: 1.15rem;
}
.job-subtitle { color: var(--muted); margin: 6px 0 0; }
.route-grid,
.kv-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.route-stop,
.kv-card,
.info-box {
  background: var(--panel-soft);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
}
.route-stop h3,
.kv-card h3,
.info-box h3 {
  margin: 0 0 10px;
  font-size: 15px;
}
.meta-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}
.value-stack {
  display: grid;
  gap: 5px;
}
.kv {
  display: grid;
  gap: 4px;
}
.kv .label {
  color: var(--muted);
  font-size: 13px;
}
.kv .value {
  font-weight: 600;
  word-break: break-word;
}
.timeline-item,
.history-item {
  border-left: 3px solid #d8e2eb;
  padding-left: 14px;
}
.timeline-item.is-complete { border-left-color: #5ab57a; }
.timeline-item.is-current {
  border-left-color: var(--accent);
  background: var(--accent-soft);
  border-radius: var(--radius-sm);
  padding-top: 8px;
  padding-right: 12px;
  padding-bottom: 8px;
}
.timeline-item.is-current strong { color: var(--text); }
.timeline-item .time,
.history-item .time {
  color: var(--muted);
  font-size: 13px;
  margin-top: 5px;
}
.history-item .event {
  font-weight: 800;
  margin-bottom: 5px;
}
.note-block {
  white-space: pre-wrap;
  word-break: break-word;
}
.split {
  display: grid;
  gap: 18px;
  grid-template-columns: 2fr 1fr;
}
.sticky-side {
  position: sticky;
  top: 18px;
  align-self: start;
}
.toast-stack {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 1000;
  display: grid;
  gap: 10px;
  width: min(360px, calc(100vw - 28px));
}
.toast {
  border-radius: 14px;
  padding: 14px 15px;
  box-shadow: var(--shadow);
  color: #fff;
  font-weight: 700;
}
.toast.success { background: #177245; }
.toast.error { background: #b5332f; }
.toast.info { background: #165381; }
.loading-note { opacity: .7; }
.mobile-stack { display: none; }
.codeish {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: pre-wrap;
}
hr.soft {
  border: 0;
  border-top: 1px solid #edf2f7;
  margin: 16px 0;
}

@media (max-width: 960px) {
  .split,
  .grid.two,
  .grid.three,
  .grid.four,
  .route-grid,
  .kv-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }
  .sticky-side { position: static; }
  .app-shell { width: min(100% - 20px, 1180px); }
}

@media (max-width: 720px) {
  .page-topbar { align-items: stretch; }
  .topbar-actions,
  .filter-form,
  .stack-actions,
  .inline-actions,
  .card-actions {
    width: 100%;
  }
  .topbar-actions .button,
  .stack-actions .button,
  .inline-actions .button,
  .card-actions .button,
  .filter-form .button,
  .filter-form button,
  .button.full-mobile,
  button.full-mobile {
    width: 100%;
    justify-content: center;
  }
  table { min-width: 620px; }
}

/* Core Phase 2: navigation, utilities and shared operational components. */

/* Shared utility classes and cross-interface payout states. */
.inline-form {
    display: inline;
}

.cart-line-actions {
    display: grid;
    gap: 0.75rem;
}

.cart-line-actions input[type="number"] {
    max-width: 120px;
}

.compact-list .history-item {
    padding: 0.5rem 0;
}

.checkbox-row {
    display: flex;
    gap: 0.65rem;
    align-items: flex-start;
}

.checkbox-row input {
    margin-top: 0.2rem;
}

.option-group-fieldset {
    border: 1px solid var(--line, #d7dfea);
    border-radius: 12px;
    padding: 0.9rem;
}

.success-text {
    color: #166534;
}

.danger-text {
    color: #991b1b;
}

.is-disabled {
    pointer-events: none;
    opacity: 0.55;
}

/* Shared option-selection list used by rider and client order details. */
.selection-list {
  margin: 10px 0 0;
  padding-left: 1.1rem;
  color: var(--muted);
}
.selection-list li + li {
  margin-top: 4px;
}

/* Shared rider/admin payout status pills. */
.payout-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 0.82rem;
  font-weight: 900;
  background: #eef2ff;
  color: #3730a3;
}
.payout-pill.due,
.payout-pill.awaiting_client_payment {
  background: #fff4d7;
  color: #8a5300;
}
.payout-pill.available {
  background: #e8f7ef;
  color: #166c3b;
}
.payout-pill.requested,
.payout-pill.approved {
  background: #eaf3ff;
  color: #075985;
}
.payout-pill.paid {
  background: #e8f7ef;
  color: #166c3b;
}
.payout-pill.not_due {
  background: #eef2f7;
  color: var(--muted);
}

/* Shared public and customer navigation. */
.shop-topnav {
  position: sticky;
  top: 12px;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 12px;
  margin-bottom: 22px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(188, 204, 220, 0.72);
  border-radius: 24px;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.10);
  backdrop-filter: blur(14px);
}

.shop-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  color: var(--text);
  text-decoration: none;
}

.shop-brand:hover { text-decoration: none; }

.platform-brand-image-link {
  display: flex;
  align-items: center;
  flex: 0 1 auto;
  min-width: 0;
  line-height: 0;
  text-decoration: none;
}

.platform-brand-image {
  display: block;
  width: auto;
  height: 92px;
  max-width: min(460px, 66vw);
  object-fit: contain;
}

.platform-public-nav {
  padding: 9px 12px;
}

.shop-nav-shop-context {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 42px;
  max-width: 285px;
  padding: 6px 10px 6px 6px;
  border: 1px solid rgba(188, 204, 220, 0.72);
  border-radius: 999px;
  background: rgba(248, 251, 255, 0.88);
  color: var(--text);
  text-decoration: none;
}

.shop-nav-shop-context:hover {
  border-color: rgba(24, 111, 175, 0.26);
  background: var(--accent-soft);
  text-decoration: none;
}

.shop-nav-shop-context strong,
.shop-nav-shop-context small {
  display: block;
}

.shop-nav-shop-context strong {
  max-width: 185px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.92rem;
}

.shop-nav-shop-context small {
  margin-top: 1px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
}

.shop-brand-mark.compact {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  font-size: 0.95rem;
}

.shop-brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  border-radius: 15px;
  background: linear-gradient(135deg, #102a43, #186faf);
  color: #fff;
  font-weight: 900;
  letter-spacing: -0.04em;
}

.shop-brand strong,
.shop-brand small {
  display: block;
}

.shop-brand strong {
  max-width: 300px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 1.05rem;
}

.shop-brand small {
  color: var(--muted);
  margin-top: 2px;
  font-weight: 700;
}

.shop-nav-links {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: wrap;
}

.shop-nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 9px 12px;
  border-radius: 999px;
  color: var(--muted);
  font-weight: 850;
  text-decoration: none;
  border: 1px solid transparent;
}

.shop-nav-link:hover,
.shop-nav-link.is-active {
  color: var(--text);
  background: var(--accent-soft);
  border-color: rgba(24, 111, 175, 0.18);
  text-decoration: none;
}

.shop-nav-link-strong {
  background: var(--text);
  color: #fff;
}

.shop-nav-link-strong:hover {
  background: var(--accent);
  color: #fff;
}

.shop-nav-count {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
}

.shop-account-count,
.shop-support-count {
  margin-left: 2px;
}

.shop-account-count.is-attention,
.shop-support-count.is-attention {
  background: var(--warning);
  color: #fff;
  box-shadow: 0 0 0 0 rgba(173, 106, 0, 0.32);
  animation: account-attention-pulse 1.45s ease-in-out infinite;
}

.shop-account-link.has-attention {
  border-color: rgba(173, 106, 0, 0.24);
  background: var(--warning-soft);
  color: var(--text);
}


/* Shared navigation attention animation and reduced-motion handling. */
@keyframes account-attention-pulse {
  0% { box-shadow: 0 0 0 0 rgba(173, 106, 0, 0.30); transform: scale(1); }
  55% { box-shadow: 0 0 0 8px rgba(173, 106, 0, 0); transform: scale(1.05); }
  100% { box-shadow: 0 0 0 0 rgba(173, 106, 0, 0); transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .shop-account-count.is-attention,
  .shop-support-count.is-attention,
  .client-support-count.is-attention {
    animation: none;
  }
}

/* Shared informational badge. */
.badge.info {
  background: #e0f2fe;
  color: #075985;
}

/* Shared warnings, controls, PIN and delivery-slot presentation. */
/* Shared warning/danger alert treatments used across public, customer, rider, admin and client pages. */
.shop-alert.warning {
  border-color: rgba(245, 158, 11, 0.35);
  background: linear-gradient(135deg, #fffbeb, #ffffff);
  color: #7c2d12;
}


.shop-alert.danger {
  border-color: rgba(201, 60, 55, 0.42);
  background: linear-gradient(135deg, #fdeaea, #ffffff 62%);
  color: #8f1f1b;
}

.shop-alert.danger strong {
  color: #7f1d1d;
}

.danger-text {
  color: var(--danger);
}

/* Shared legacy overrides retained during the client catalogue split.
   These still affect non-client pages and will be reviewed during core.css migration. */
.danger-text {
  color: var(--danger) !important;
}

.checkbox-row {
  display: flex !important;
  align-items: center;
  gap: 10px !important;
  color: var(--text) !important;
  font-weight: 850 !important;
}

.checkbox-row input {
  width: auto;
}

@media (max-width: 1060px) {
  .sticky-side {
    position: static;
  }
}

/* Delivery PIN verification */
.verification-pin {
    display: inline-block;
    letter-spacing: 0.18em;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    font-size: 1.15em;
    font-weight: 800;
}

/* Shared compact icon button used by rider jobs and client catalogue actions. */
.button.icon-only {
  width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0;
  border-radius: 999px;
  font-size: 1rem;
  font-weight: 900;
}
.button.icon-only:disabled {
  opacity: .32;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Delivery slot foundation */
.client-slot-mini,
.delivery-slot-summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  border: 1px solid rgba(13, 79, 124, 0.18);
  background: #e8f3ff;
  color: #0d4f7c;
  font-weight: 900;
}

.client-slot-mini {
  padding: 5px 8px;
  font-size: 0.8rem;
}

.badge.slot,
.chip.slot {
  border: 1px solid rgba(13, 79, 124, 0.18);
  background: #e8f3ff;
  color: #0d4f7c;
}

.client-slot-mini.rush,
.delivery-slot-summary.rush,
.badge.rush,
.chip.rush {
  border: 1px solid rgba(217, 119, 6, 0.22);
  background: #fff7ed;
  color: #9a3412;
}


.delivery-slot-summary {
  width: fit-content;
  max-width: 100%;
  margin: 8px 0 12px;
  padding: 9px 12px;
  line-height: 1.25;
}

/* Shared operational flags, support choices and form helpers. */
.admin-flag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 31px;
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.84rem;
  font-weight: 900;
  white-space: nowrap;
}
.admin-flag.rush { background: #ffecec; color: #b42318; border-color: #ffc2c2; }
.admin-flag.slot { background: #eef6ff; color: #075985; border-color: #c7ddf2; }
.admin-flag.tip { background: #fff8e6; color: #9a5b00; border-color: #f5d58a; }
.admin-flag.rider { background: #eefcf9; color: #0f766e; border-color: #a7ede2; }
.admin-flag.danger { background: var(--danger-soft); color: var(--danger); border-color: #f3b7b6; }
.admin-flag.success { background: var(--success-soft); color: var(--success); border-color: #bfe7cf; }
.admin-flag.muted { background: #eef2f6; color: var(--muted); border-color: var(--border); }
.admin-flag.blue { background: #eef6ff; color: #075985; border-color: #c7ddf2; }
.admin-flag.purple { background: #f4efff; color: #6d28d9; border-color: #d9c8ff; }
.admin-flag.voided { background: #f4efff; color: #6d28d9; border-color: #d9c8ff; }

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

.support-choice-card {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: rgba(255,255,255,.72);
}

.support-choice-card input {
    width: auto;
    margin-top: 3px;
}

.support-choice-card small {
    display: block;
    margin-top: 3px;
    color: var(--muted);
}
.compact-button {
  min-height: 34px;
  padding: 7px 11px;
  border-radius: 10px;
}
.payment-pill.pending,
.payment-pill.invoiced,
.payment-pill.creating,
.payment-pill.open,
.payment-pill.pending_resolution,
.payment-pill.payment_failed {
  background: var(--warning-soft);
  color: #8a5300;
}
.payment-pill.needs_review {
  background: #fff1f2;
  color: #9f1239;
  border-color: #fecdd3;
}
.payment-pill.card_refunded,
.payment-pill.store_credit_issued,
.payment-pill.succeeded,
.payment-pill.complete {
  background: var(--success-soft);
  color: var(--success);
}

/* Shared form and information helpers retained during the interface split. */
.form-help {
  margin: -4px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.info-text {
  color: #075985;
}

/* Shared accessibility and warning helpers. */
/* Shared accessibility helper retained in the legacy stylesheet while interface CSS is split. */
.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* Shared warning text used by client and admin forms. */
.warning-text {
  color: #92400e;
}

/* Shared navigation responsive behaviour. */
@media (max-width: 760px) {
  .shop-topnav {
    position: static;
    align-items: stretch;
    border-radius: 20px;
  }

  .shop-topnav {
    flex-direction: column;
  }

  .shop-nav-links {
    justify-content: flex-start;
    width: 100%;
  }

  .shop-nav-link {
    flex: 1 1 auto;
  }

  .platform-brand-image-link {
    width: 100%;
  }

  .platform-brand-image {
    height: 56px;
    max-width: min(360px, 100%);
  }

  .shop-nav-shop-context {
    flex: 1 1 100%;
    max-width: none;
  }
}

/* Core Phase 3: shared platform updates, support tickets and messaging. */
/* Platform updates noticeboard shared across client and rider interfaces. */
.platform-updates-empty-card {
  margin-bottom: 18px;
}

.platform-update-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 0 0 9px;
}

.platform-update-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  padding: 5px 9px;
  border: 1px solid rgba(72, 101, 129, 0.18);
  border-radius: 999px;
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0.015em;
  white-space: nowrap;
}

.platform-update-chip.tone-green {
  border-color: rgba(31, 146, 84, 0.22);
  background: var(--success-soft);
  color: var(--success);
}

.platform-update-chip.tone-blue {
  border-color: rgba(24, 111, 175, 0.22);
  background: var(--accent-soft);
  color: var(--accent);
}

.platform-update-chip.tone-amber {
  border-color: rgba(173, 106, 0, 0.24);
  background: var(--warning-soft);
  color: var(--warning);
}

.platform-update-chip.tone-red {
  border-color: rgba(201, 60, 55, 0.22);
  background: var(--danger-soft);
  color: var(--danger);
}

.platform-update-chip.tone-purple {
  border-color: rgba(124, 58, 237, 0.22);
  background: #f3efff;
  color: #6d28d9;
}

.platform-update-chip.tone-muted {
  border-color: rgba(72, 101, 129, 0.18);
  background: #f3f6f9;
  color: var(--muted);
}

.platform-updates-feed {
  display: grid;
  gap: 12px;
}

.platform-update-card,
.platform-update-latest-card {
  border: 1px solid rgba(188, 204, 220, 0.75);
  border-left: 5px solid var(--accent);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
}

.platform-update-card {
  padding: 15px;
  border-radius: 18px;
}

.platform-update-card.is-pinned {
  border-left-color: #7c3aed;
  background: linear-gradient(180deg, #ffffff 0%, #f8f5ff 100%);
}

.platform-update-card-head,
.platform-update-latest-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.platform-update-card h2,
.platform-update-latest-card h2 {
  margin: 0;
  line-height: 1.2;
}

.platform-update-card-head .muted,
.platform-update-latest-card p {
  margin: 6px 0 0;
}

.platform-update-body {
  margin-top: 12px;
  line-height: 1.55;
}

.platform-update-latest-card {
  align-items: center;
  margin-bottom: 16px;
  padding: 15px;
  border-radius: 18px;
}

.platform-update-latest-main {
  display: grid;
  gap: 3px;
  min-width: 0;
}

@media (max-width: 760px) {
  .platform-update-latest-card {
    align-items: flex-start;
  }
}


/* Support tickets */
.support-ticket-panel,
.support-ticket-compose-panel,
.support-ticket-detail-panel,
.support-ticket-cta-panel {
    margin-bottom: 18px;
}

.support-filter-tabs,
.support-ticket-meta-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

.support-ticket-list {
    display: grid;
    gap: 12px;
}

.support-ticket-card {
    display: grid;
    gap: 6px;
    padding: 14px 16px;
    border: 1px solid rgba(15, 23, 42, 0.12);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.88);
    color: inherit;
    text-decoration: none;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
}

.support-ticket-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.12);
}

.support-ticket-card.is-serious {
    border-color: rgba(220, 38, 38, 0.38);
}

.support-ticket-kicker,
.support-ticket-meta {
    color: var(--muted, #64748b);
    font-size: 0.88rem;
}

.support-ticket-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.support-ticket-admin-action {
    display: grid;
    gap: 2px;
    margin: 4px 0;
    padding: 10px 12px;
    border-left: 4px solid #d97706;
    border-radius: 10px;
    background: rgba(245, 158, 11, 0.1);
}

.support-ticket-admin-action.danger {
    border-left-color: #dc2626;
    background: rgba(220, 38, 38, 0.09);
}

.support-ticket-admin-action.info,
.support-ticket-admin-action.success {
    border-left-color: #0f766e;
    background: rgba(13, 148, 136, 0.08);
}

.support-ticket-admin-action small {
    color: var(--muted, #64748b);
}

.support-ticket-detail-head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
    margin-bottom: 16px;
}

.support-message-thread {
    display: grid;
    gap: 12px;
    margin: 16px 0;
}

.support-message {
    border: 1px solid rgba(15, 23, 42, 0.1);
    border-radius: 14px;
    padding: 12px 14px;
    background: rgba(248, 250, 252, 0.95);
}

.support-message.is-customer {
    background: rgba(239, 246, 255, 0.95);
}

.support-message.is-shop {
    background: rgba(240, 253, 244, 0.95);
}

.support-message.is-admin,
.support-message.is-platform {
    background: rgba(250, 245, 255, 0.95);
}

.support-message.is-internal {
    border-style: dashed;
}

.support-message-meta {
    color: var(--muted, #64748b);
    font-size: 0.86rem;
    margin-bottom: 6px;
}

.support-message-body {
    white-space: normal;
    line-height: 1.5;
}

.support-ticket-form,
.support-ticket-reply-form {
    display: grid;
    gap: 14px;
}

.support-ticket-form label,
.support-ticket-reply-form label {
    display: grid;
    gap: 6px;
    font-weight: 700;
}

.support-ticket-form select,
.support-ticket-form textarea,
.support-ticket-reply-form textarea {
    width: 100%;
}

.support-serious-check {
    display: flex !important;
    align-items: flex-start;
    gap: 8px !important;
    font-weight: 600 !important;
}

@media (max-width: 720px) {
    .support-ticket-detail-head {
        display: grid;
    }
}

/* Messaging v1 */
.messaging-ajax-page {
    transition: opacity 0.16s ease, transform 0.16s ease;
}

.messaging-ajax-page.is-updating {
    opacity: 0.66;
    pointer-events: none;
}

.messaging-ajax-page.is-updating .messaging-workspace-panel {
    transform: translateY(1px);
}

.messaging-ajax-page [aria-current="page"] {
    cursor: default;
}

@media (prefers-reduced-motion: reduce) {
    .messaging-ajax-page {
        transition: none;
    }
}

.messaging-workspace-panel {
    overflow: visible;
}

.messaging-workspace {
    display: grid;
    grid-template-columns: minmax(270px, 360px) minmax(0, 1fr);
    gap: 18px;
    align-items: stretch;
}

.messaging-conversation-picker,
.messaging-thread-pane {
    min-width: 0;
    border: 1px solid rgba(15, 23, 42, 0.1);
    border-radius: 22px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(248, 250, 252, 0.9));
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
}

.messaging-conversation-picker {
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr);
    gap: 12px;
    padding: 14px;
}

.messaging-thread-pane {
    padding: 18px;
}

.messaging-picker-head,
.message-thread-card-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.messaging-picker-head h2 {
    margin: 0;
}

.messaging-picker-head .button.compact {
    min-height: 34px;
    padding: 7px 11px;
    border-radius: 999px;
}

.messaging-thread-tabs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 2px 1px 6px;
    scrollbar-width: thin;
}

.messaging-thread-tab {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 10px;
    border: 1px solid rgba(15, 23, 42, 0.12);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.78);
    color: inherit;
    text-decoration: none;
    font-weight: 800;
    font-size: 0.88rem;
    white-space: nowrap;
}

.messaging-thread-tab:hover,
.messaging-thread-tab.is-active {
    border-color: rgba(37, 99, 235, 0.35);
    background: rgba(219, 234, 254, 0.9);
    color: #1d4ed8;
}

.messaging-tab-count {
    min-width: 1.55rem;
    padding: 2px 6px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.08);
    color: var(--muted, #64748b);
    text-align: center;
    font-size: 0.76rem;
}

.messaging-thread-tab.is-active .messaging-tab-count {
    background: rgba(37, 99, 235, 0.14);
    color: #1d4ed8;
}

.messaging-thread-list {
    align-content: start;
    gap: 10px;
}

.message-thread-card {
    gap: 7px;
    padding: 12px 13px;
    border-radius: 18px;
    box-shadow: none;
    background: rgba(255, 255, 255, 0.72);
    transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.message-thread-card:hover {
    background: rgba(255, 255, 255, 0.98);
}

.message-thread-card.is-selected {
    border-color: rgba(37, 99, 235, 0.44);
    background: rgba(239, 246, 255, 0.95);
    box-shadow: inset 4px 0 0 rgba(37, 99, 235, 0.5), 0 12px 28px rgba(37, 99, 235, 0.12);
}

.message-thread-card.has-unread {
    border-color: rgba(59, 130, 246, 0.55);
    background: rgba(239, 246, 255, 0.84);
}

.message-thread-card.has-unread strong::after {
    content: '';
    display: inline-block;
    width: 7px;
    height: 7px;
    margin-left: 7px;
    border-radius: 999px;
    background: #2563eb;
    vertical-align: middle;
}

.message-thread-card-head strong {
    min-width: 0;
    line-height: 1.25;
}

.message-thread-time {
    flex: 0 0 auto;
    color: var(--muted, #64748b);
    font-size: 0.78rem;
    font-weight: 700;
    white-space: nowrap;
}

.message-thread-preview {
    display: -webkit-box;
    overflow: hidden;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.messaging-picker-empty,
.messaging-thread-empty {
    display: grid;
    place-items: center;
    min-height: 220px;
    padding: 24px;
    border: 1px dashed rgba(15, 23, 42, 0.16);
    border-radius: 18px;
    background: rgba(248, 250, 252, 0.8);
    text-align: center;
}

.messaging-picker-empty h3,
.messaging-thread-empty h2 {
    margin: 0 0 6px;
}

.messaging-panel .support-message-thread,
.messaging-message-thread {
    margin-top: 1rem;
}

.messaging-message-thread {
    max-height: 58vh;
    overflow: auto;
    padding-right: 4px;
}

.message-bubble {
    max-width: min(680px, 92%);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.07);
}

.message-bubble.is-own-message {
    margin-left: auto;
    border-color: rgba(34, 197, 94, 0.35);
    background: rgba(240, 253, 244, 0.95);
}

.message-bubble.is-own-message .support-message-meta {
    text-align: right;
}

.messaging-reply-form {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid rgba(15, 23, 42, 0.08);
}

.messaging-start-panel {
    scroll-margin-top: 90px;
}

.messaging-start-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    align-items: start;
}

.messaging-start-grid .support-ticket-reply-form {
    margin: 0;
    padding: 14px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 18px;
    background: rgba(248, 250, 252, 0.72);
}

.messaging-page-shell {
    max-width: 1180px;
    margin: 0 auto;
    padding: 1rem;
}

@media (max-width: 980px) {
    .messaging-workspace {
        grid-template-columns: 1fr;
    }

    .messaging-message-thread {
        max-height: none;
    }
}

@media (max-width: 760px) {
    .messaging-thread-pane,
    .messaging-conversation-picker {
        border-radius: 18px;
        padding: 12px;
    }

    .messaging-start-grid {
        grid-template-columns: 1fr;
    }

    .message-bubble,
    .message-bubble.is-own-message {
        max-width: 100%;
        margin-left: 0;
    }
}

.platform-updates-filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 16px;
}

.platform-updates-section {
  display: grid;
  gap: 12px;
  margin-bottom: 22px;
}

.platform-updates-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  padding: 0 2px;
}

.platform-updates-section-head h2,
.platform-updates-section-head .eyebrow {
  margin: 0;
}

.platform-updates-section-archived {
  margin-top: 26px;
  padding-top: 20px;
  border-top: 1px solid rgba(148, 163, 184, 0.28);
}

.platform-updates-section-archived .platform-update-card {
  border-left-color: rgba(100, 116, 139, 0.55);
  background: rgba(248, 250, 252, 0.94);
}

@media (max-width: 720px) {
  .platform-updates-section-head {
    align-items: flex-start;
    flex-direction: column;
  }
}
