/* Bissda Admin Dashboard: desktop-first layout with a left sidebar. Builds on /shared/bissda.css. */
body { background: #f6f3f0; font-size: 15px; }

/* ---------- sign-in ---------- */
.login { min-height: calc(100vh - 30px); display: grid; place-items: center; padding: 24px 16px; background:
  radial-gradient(1200px 500px at 110% -10%, var(--brand-soft), transparent 60%), radial-gradient(800px 400px at -10% 110%, #fde9dc, transparent 60%); }
.login-box { width: min(100%, 420px); }
.login-box .logo { margin-bottom: 20px; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 228px minmax(0, 1fr); min-height: 100vh; }
.side { background: #1f1a17; color: #f3ece6; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.side-top { padding: 18px 18px 10px; }
.side .logo { color: #fff; }
.side .logo small { color: #c9bdb3; }
.role-badge { display: inline-block; margin-top: 6px; padding: 2px 10px; border-radius: 999px; font-size: .78rem; font-weight: 600; color: #fff; background: #4a3f38; }
.role-super_admin { background: #e8590c; } .role-admin { background: #4a3f38; } .role-finance { background: #0f6e56; } .role-support { background: #185fa5; }
.role-operations { background: #6b4fbb; } .role-marketing { background: #b3346b; } .role-viewer { background: #5f5e5a; }
.side nav { flex: 1; overflow-y: auto; padding: 8px 10px; }
.nav-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.nav-list a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: #e6dcd3; text-decoration: none; font-weight: 600; font-size: .93rem; }
.nav-list a:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav-list a[aria-current=page] { background: var(--brand); color: #fff; }
.nav-list a:focus-visible { box-shadow: 0 0 0 3px #fff; }
.side-user { border-top: 1px solid rgba(255,255,255,.12); padding: 14px 16px 16px; display: grid; gap: 8px; }
.side-user .who { display: grid; line-height: 1.3; }
.side-user .who .tiny { color: #c9bdb3; overflow-wrap: anywhere; }
.user-more { display: grid; gap: 8px; }
.me-btn { display: none; }
.side-user .signout { color: #fff; border-color: rgba(255,255,255,.3); justify-self: start; }
.side-user .signout:hover { background: rgba(255,255,255,.1); }
.content { min-width: 0; }
.main { padding: 22px 28px 48px; max-width: 1560px; outline: none; }

.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head h1 { margin: 0; font-size: 1.55rem; letter-spacing: -.01em; outline: none; }
.toolbar { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .field { margin: 0; }
.toolbar input[type=search], .toolbar input[type=text] { min-width: 260px; }
.toolbar select { min-width: 170px; }
.section-title { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 24px 0 10px; }
.section-title h2 { margin: 0; font-size: 1.1rem; }

/* ---------- cards / kpis ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin-bottom: 18px; }
.kpi-card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.kpi-card .kpi { font-size: 1.45rem; }
.kpi-label { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; }
.kpi-card.warn { border-color: #f0cf85; background: #fffaf0; } .kpi-card.bad { border-color: #f2b8b3; background: #fff8f7; } .kpi-card.brand { border-color: #f5c2a3; background: #fff8f3; }
.card.tight { padding: 0; overflow: hidden; }
.card.flat { box-shadow: none; }
.two-col { display: grid; grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr); gap: 16px; align-items: start; }
.zone-cols { grid-template-columns: minmax(0, 1.3fr) minmax(440px, 1fr); }
.cards-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }

/* ---------- tables ---------- */
.table-wrap table { font-size: .9rem; }
.table-wrap th, .table-wrap td { padding: 9px 12px; vertical-align: middle; }
.table-wrap thead th { background: var(--surface-2); position: sticky; top: 0; }
.table-wrap tbody th { font-weight: 600; text-transform: none; letter-spacing: 0; color: var(--ink); font-size: .9rem; }
.table-wrap tbody tr:hover { background: #fdfaf7; }
.table-wrap tr.row-warn { background: #fffaf0; } .table-wrap tr.row-bad { background: #fff6f5; }
.table-wrap td .row { gap: 6px; flex-wrap: wrap; }
.cell-sub { display: block; color: var(--muted); font-size: .8rem; font-weight: 400; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; }
.expired { color: var(--bad); font-weight: 700; }
a.code { font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---------- key/value ---------- */
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; font-size: .92rem; }
.kv dt { color: var(--muted); font-weight: 600; }
.kv dd { margin: 0; overflow-wrap: anywhere; }

/* ---------- drawer ---------- */
dialog.drawer { margin: 0; margin-inline-start: auto; width: min(100vw, 720px); max-width: 100vw; height: 100vh; max-height: 100vh; border-radius: 0; border-start-start-radius: 18px; border-end-start-radius: 18px; display: flex; flex-direction: column; }
dialog.drawer:not([open]) { display: none; }
.drawer-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.drawer-body { padding: 16px 20px 32px; overflow-y: auto; flex: 1; }
.drawer-body h3 { margin: 20px 0 8px; font-size: .95rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-2); }
.drawer-body h3:first-child { margin-top: 0; }
.drawer-actions { display: flex; gap: 8px; flex-wrap: wrap; padding: 12px; background: var(--surface-2); border-radius: 12px; margin-bottom: 16px; }
.mini-card { border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: #fff; }
.mini-card h4 { margin: 0 0 6px; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.money-table td, .money-table th { padding: 5px 0; border: 0; font-size: .92rem; text-transform: none; letter-spacing: 0; color: var(--ink); font-weight: 400; }
.money-table tr.total th, .money-table tr.total td { font-weight: 800; border-top: 1px solid var(--line); padding-top: 8px; }
.money-table td { text-align: end; font-variant-numeric: tabular-nums; }
.timeline { list-style: none; margin: 0; padding: 0; padding-inline-start: 14px; border-inline-start: 2px solid var(--line); }
.timeline li { position: relative; padding: 4px 0 10px; padding-inline-start: 12px; font-size: .9rem; }
.timeline li::before { content: ''; position: absolute; inset-inline-start: -20px; top: 9px; width: 10px; height: 10px; border-radius: 50%; background: var(--brand); border: 2px solid #fff; }
.timeline .when { color: var(--muted); font-size: .8rem; }

/* forms in dialogs */
.form-foot { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 14px; margin-top: 6px; }
.req { color: var(--bad); }
.with-prefix { display: flex; align-items: center; gap: 0; }
.with-prefix > span { padding: 0 10px; min-height: 44px; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--line-2); border-inline-end: 0; border-radius: 0; border-start-start-radius: var(--radius-sm); border-end-start-radius: var(--radius-sm); font-weight: 600; color: var(--ink-2); }
.with-prefix input { border-radius: 0; border-start-end-radius: var(--radius-sm); border-end-end-radius: var(--radius-sm); }
/* "$ 12.50", "km 5": the unit and the amount keep left-to-right order in Arabic too */
[dir=rtl] .with-prefix { direction: ltr; }
[dir=rtl] .with-prefix input { text-align: left; }
.inline-field { display: flex; align-items: center; gap: 8px; }
.inline-field input { width: 120px; }

/* ---------- live ---------- */
.live-map { height: 520px; }
.map-legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: .82rem; color: var(--ink-2); padding: 8px 2px 0; }
.legend-dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; vertical-align: -1px; margin-inline-end: 6px; border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.25); }
.alerts-panel { max-height: 560px; overflow-y: auto; }
.alert-list { list-style: none; margin: 0; padding: 0; }
.alert-list li { padding: 10px 0; border-bottom: 1px solid var(--line); display: grid; gap: 4px; }
.alert-list li:last-child { border-bottom: 0; }
.pin { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 800; color: #fff; border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.4); }
.pin.rest { background: #1f1a17; border-radius: 8px; }
.pin.drop { background: #1e4e79; }
.pin.busy { background: var(--brand); }
.pin.free { background: var(--ok); }
.pin.vertex { width: 14px; height: 14px; background: var(--brand); }
.map-msg { display: grid; place-items: center; height: 100%; color: var(--muted); padding: 16px; text-align: center; }

/* ---------- support ---------- */
.convo { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.convo li { padding: 10px 12px; border-radius: 12px; background: var(--surface-2); max-width: 90%; }
.convo li.staff { background: var(--brand-soft); justify-self: end; }
.convo .meta { font-size: .78rem; color: var(--muted); margin-bottom: 2px; }
.convo .body { white-space: pre-wrap; overflow-wrap: anywhere; }
.auth-img { margin: 8px 0; }
.auth-img img { max-height: 340px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); }
.secret { font-family: ui-monospace, Consolas, monospace; background: var(--surface-2); padding: 10px 12px; border-radius: 8px; overflow-wrap: anywhere; user-select: all; }

/* ---------- zones ---------- */
.zone-map { height: 560px; cursor: crosshair; }
.zone-map.viewing { cursor: grab; }
.draw-bar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 10px; }
/* Settings: two columns side by side; each setting has its name on the left, value and unit on the right. */
.fees-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 32px; }
.fees-grid > .field { display: grid; grid-template-columns: minmax(0, 1fr) 190px; column-gap: 20px; align-items: center; margin: 0; padding: 10px 0; border-bottom: 1px solid var(--line); }
@media (max-width: 900px) { .fees-grid { grid-template-columns: 1fr; } }
.fees-grid > .field > label { grid-column: 1; grid-row: 1 / span 2; margin: 0; }
.fees-grid > .field > :not(label):not(.hint) { grid-column: 2; }
.fees-grid > .field > .hint { grid-column: 2; margin-top: 2px; }
@media (max-width: 640px) { .fees-grid > .field { grid-template-columns: 1fr; } .fees-grid > .field > label { grid-row: auto; } .fees-grid > .field > * { grid-column: 1 !important; } }
pre.details { margin: 0; white-space: pre-wrap; font: .82rem/1.4 ui-monospace, Consolas, monospace; }

/* ---------- smaller screens ---------- */
@media (max-width: 1180px) { .two-col { grid-template-columns: 1fr; } .alerts-panel { max-height: none; } }
@media (max-width: 960px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { min-width: 0; position: sticky; top: 0; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; z-index: 30; }
  .side-top { padding: 10px 14px; }
  .side nav { order: 3; flex-basis: 100%; overflow-x: auto; padding: 0 8px 8px; }
  .nav-list { display: flex; gap: 4px; }
  .nav-list a { white-space: nowrap; padding: 8px 10px; }
  .side-user { border: 0; padding: 8px 14px; margin-inline-start: auto; display: flex; align-items: center; gap: 10px; }
  .side-user .who .tiny { display: none; }
  .user-more { display: flex; align-items: center; gap: 10px; }
  .main { padding: 18px 16px 40px; }
  .live-map, .zone-map { height: 420px; }
  .toolbar input[type=search], .toolbar input[type=text] { min-width: 0; width: 100%; }
  .toolbar .field.grow { flex: 1 1 100%; }
}

/* phones: name, language, Change password and Sign out fold behind one round button; the menu is one swipeable line */
@media (max-width: 640px) {
  .side { flex-wrap: wrap; }
  .side-top { padding: 8px 14px; }
  .side-top .logo small { display: none; }
  .side-user { position: relative; padding: 6px 12px; }
  .me-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; border: 2px solid rgba(255,255,255,.35); background: var(--brand); color: #fff; font: 700 .9rem var(--font); cursor: pointer; }
  .me-btn:focus-visible { box-shadow: 0 0 0 3px #fff; outline: none; }
  .user-more { display: none; position: absolute; inset-inline-end: 8px; top: calc(100% + 4px); z-index: 40; width: min(300px, calc(100vw - 16px)); background: #1f1a17; border: 1px solid rgba(255,255,255,.15); border-radius: 14px; padding: 14px; box-shadow: 0 12px 32px rgba(0,0,0,.35); flex-direction: column; align-items: stretch; gap: 10px; }
  .side-user.open .user-more { display: flex; }
  .side-user .who .tiny { display: block; }
  .side nav { padding: 0 6px 6px; scrollbar-width: none; -webkit-mask-image: linear-gradient(to right, #000 85%, transparent); mask-image: linear-gradient(to right, #000 85%, transparent); }
  [dir=rtl] .side nav { -webkit-mask-image: linear-gradient(to left, #000 85%, transparent); mask-image: linear-gradient(to left, #000 85%, transparent); }
  .side nav::-webkit-scrollbar { display: none; }
  .nav-list a { padding: 7px 10px; font-size: .88rem; }
  .nav-list a[aria-current=page] { scroll-margin-inline: 40px; }
}

/* toasts sit bottom-right so they don't cover tables */
#toasts { left: auto; right: auto; inset-inline-end: 20px; transform: none; width: min(92vw, 380px); }
h1[tabindex="-1"]:focus, h1[tabindex="-1"]:focus-visible { box-shadow: none; outline: none; }

/* tables: wrap long values at word boundaries, never mid-word */
table th, table td { overflow-wrap: break-word; }

/* ---------- order types, meal plans, home chefs ---------- */
.badge.s-requested { background: var(--warn-soft); color: var(--warn); }
.badge.s-scheduled { background: var(--info-soft); color: var(--info); }
.toolbar-check { align-self: flex-end; min-height: 44px; align-items: center; padding: 0 4px; white-space: nowrap; }
.toolbar-check input { margin-top: 0; }
.nowrap { white-space: nowrap; }
.special-card { margin-bottom: 16px; border-color: #f5c2a3; background: #fffaf6; }
.special-card .spread { margin-bottom: 6px; }
.special-card h4 { margin: 0; }
.paused-reason { display: block; min-width: 230px; max-width: 300px; margin-top: 4px; padding: 4px 8px; border-radius: 8px; background: var(--warn-soft); color: var(--warn); font-size: .82rem; font-weight: 600; }
.table-wrap tr.row-highlight { background: #fff3e8; box-shadow: inset 4px 0 0 var(--brand); }
[dir=rtl] .table-wrap tr.row-highlight { box-shadow: inset -4px 0 0 var(--brand); }
.badge-row { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; }
.cert-ok { color: var(--ok); font-weight: 600; } .cert-soon { color: var(--warn); font-weight: 700; } .cert-bad { color: var(--bad); font-weight: 700; }
.table-wrap tr.has-after > th, .table-wrap tr.has-after > td { border-bottom: 0; padding-bottom: 4px; }
.table-wrap tr.row-after > td { padding-top: 2px; padding-bottom: 12px; }
.table-wrap tr.row-after:hover { background: inherit; }
.rest-actions-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.act-sep { width: 1px; height: 22px; background: var(--line); margin: 0 4px; }

/* language picker: sign-in screens and sidebar */
.login-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.login-box .login-top .logo { margin-bottom: 0; }
.side-user .lang-picker { justify-self: start; color: #f3ece6; }
.side-user .lang-picker select { max-width: 100%; color: var(--ink); background-color: #fff; }
.chips { flex-wrap: wrap; }

/* right-to-left (Arabic): names, addresses, phone numbers and ABNs in details and tables keep their own order */
[dir=rtl] .kv dd, [dir=rtl] .table-wrap td:not(.num) { unicode-bidi: plaintext; text-align: right; }

/* Finance summary: headline figures, where the money went, grouped lists, checks */
.fin-head { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.fin-bar h3, .fin-group h3, .fin-checks h3 { font-size: 1rem; margin: 0 0 10px; }
.fin-bar .bar { display: flex; height: 28px; border-radius: 6px; overflow: hidden; margin: 4px 0 10px; background: var(--line); }
.fin-bar .bar > div { height: 100%; }
.fin-bar .legend { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 4px 16px; font-size: .88rem; }
.fin-bar .dot { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.fin-groups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 14px; }
@media (max-width: 900px) { .fin-groups { grid-template-columns: 1fr; } }
.fin-row { display: flex; justify-content: space-between; gap: 16px; align-items: baseline; padding: 8px 0; border-bottom: 1px solid var(--line); }
.fin-row:last-of-type { border-bottom: 0; }
.fin-row strong { white-space: nowrap; }
.fin-checks { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.fin-check { display: flex; gap: 8px; padding: 4px 0; }
.fin-check.ok > span:first-child { color: var(--ok, #2e7d32); font-weight: 800; }
.fin-check.bad > span:first-child { color: var(--bad, #c62828); font-weight: 800; }

/* Activity log: When, Who, Action and About stay on one line; Details wraps. */
.activity-table th, .activity-table td { vertical-align: top; }
.activity-table tr > :nth-child(-n+4) { white-space: nowrap; }
.activity-table .cell-sub { display: block; }
.activity-table tr > :nth-child(5) { min-width: 280px; }

/* Finance: trips held because delivery money doesn't balance */
.fin-held { border: 2px solid var(--bad, #c0392b); background: color-mix(in srgb, var(--bad, #c0392b) 6%, transparent); margin-bottom: 16px; }
.fin-held h3 { margin: 0 0 6px; color: var(--bad, #c0392b); }
.money-alert { display: block; padding: 8px 10px; margin-bottom: 8px; border-radius: 8px; font-weight: 600; color: var(--bad, #c0392b); background: color-mix(in srgb, var(--bad, #c0392b) 8%, transparent); text-decoration: none; }
/* Approved kitchens list (Restaurants page) */
.plain-list { list-style: none; padding: 0; margin: 8px 0 10px; }
.kitchen-row { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.kitchen-row .actions { display: flex; gap: 6px; flex-wrap: wrap; }
@media (max-width: 700px) { .kitchen-row { grid-template-columns: 1fr; } }
/* Referral rewards: tiles double as status filters */
.kpi-btn { all: unset; cursor: pointer; display: block; border-radius: var(--radius-sm); }
.kpi-btn:focus-visible { outline: 2px solid var(--brand, #1e4e79); outline-offset: 2px; }
.kpi-btn[aria-pressed="true"] .kpi-card { box-shadow: inset 0 0 0 2px var(--info); }

/* Viewer (read only): change buttons are greyed out and can't be pressed. Search, Show and the own-password dialog still work. */
.read-only-strip { margin: 0 0 0; border-radius: 0; text-align: center; font-weight: 600; }
body.read-only .btn.primary:not([data-read]), body.read-only .btn.danger, body.read-only .btn.ok {
  opacity: .4; pointer-events: none; cursor: not-allowed;
}
body.read-only dialog:has(input[autocomplete="current-password"]) .btn { opacity: 1; pointer-events: auto; cursor: pointer; }

/* ---------- agents: Needs you, waiting for a driver, Agents page, payout review, checks ---------- */
.stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.needs-you { margin-bottom: 18px; display: flex; flex-direction: column; gap: 10px; }
.ny-list { display: flex; flex-direction: column; }
.ny-list .ny-item { flex-direction: row; align-items: flex-start; gap: 14px; border: 0; border-top: 1px solid var(--line); border-radius: 0; padding: 12px 2px; }
.ny-list .ny-item:first-child { border-top: 0; }
.ny-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.ny-body { color: var(--muted); }
.ny-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; flex: none; max-width: 340px; }
.ny-list .ny-media { width: 96px; max-height: 150px; object-fit: cover; border-radius: 8px; background: #1f1a17; flex: none; }
@media (max-width: 720px) { .ny-list .ny-item { flex-wrap: wrap; } .ny-actions { justify-content: flex-start; max-width: none; width: 100%; } }
.review-line { display: flex; align-items: center; gap: 12px; background: #fdecea; color: #8c1d18; border: 1px solid #f5c2bd; border-radius: 10px; padding: 10px 14px; margin-bottom: 14px; text-decoration: none; font-weight: 600; }
.review-line[hidden], .nav-count[hidden] { display: none; }
.review-line .rl-text { flex: 1; min-width: 0; }
.review-line .rl-link { text-decoration: underline; white-space: nowrap; }
.nav-count { margin-left: auto; background: #b42318; color: #fff; border-radius: 999px; font-size: 11px; font-weight: 700; padding: 1px 7px; line-height: 1.5; }
.ny-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.ny-item { border: 1px solid var(--line); border-radius: 10px; padding: 12px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ny-suggest { background: var(--brand-soft); border-radius: 8px; padding: 6px 8px; }
.wd-item { border: 1px solid var(--line); border-radius: 10px; padding: 10px; display: flex; flex-direction: column; gap: 4px; margin-bottom: 8px; }
.wd-bar { height: 6px; background: #f4efea; border-radius: 3px; overflow: hidden; }
.wd-fill { height: 6px; border-radius: 3px; background: #1b7a3d; }
.wd-fill.s2 { background: #8a5a00; } .wd-fill.s3, .wd-fill.s4 { background: #b42318; }
.agent-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; align-items: start; }
.agent-card { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.agent-card.mode-acting { border-top: 4px solid #1b7a3d; } .agent-card.mode-suggest { border-top: 4px solid #8a5a00; } .agent-card.mode-off { border-top: 4px solid var(--line-2); }
.agent-card.planned { background: #f4efea; border-style: dashed; box-shadow: none; }
.kv.tight { gap: 2px 12px; font-size: .86rem; margin: 0; }
.review-card { border: 2px solid var(--brand); margin: 14px 0; display: flex; flex-direction: column; gap: 12px; }
.table-wrap tr.row-muted { opacity: .65; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.check-card { display: flex; flex-direction: column; gap: 8px; }
.check-card.ok { border-top: 4px solid #1b7a3d; } .check-card.bad { border-top: 4px solid #b42318; }
@media (max-width: 720px) { .ny-grid, .agent-grid, .check-grid { grid-template-columns: 1fr; } }
.limit-list { margin: 0; display: flex; flex-direction: column; gap: 4px; font-size: .86rem; }
.limit-list > div { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px dashed var(--line); padding: 2px 0; }
.limit-list dt { color: var(--muted); min-width: 0; } .limit-list dd { margin: 0; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
a.chip { text-decoration: none; display: inline-flex; align-items: center; color: inherit; } a.chip[aria-pressed="true"] { color: #fff; }
dialog.drawer.wide { width: min(980px, 100vw); max-width: 100vw; }
.sum-card { display: flex; flex-direction: column; gap: 6px; margin: 12px 0; }
.sum-row { display: flex; justify-content: space-between; gap: 12px; font-variant-numeric: tabular-nums; }
.sum-row.total { border-top: 2px solid var(--line); padding-top: 8px; font-size: 1.05rem; }
.table-wrap tr.row-bad td { background: #fdecea; }
.ny-staff { margin-top: 10px; }
.ny-staff > summary { cursor: pointer; font-weight: 600; font-size: 14px; color: var(--muted, #6d625a); padding: 4px 0; }
.ny-staff .ny-grid { margin-top: 8px; opacity: .92; }
.mh-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; margin-top: 12px; }
.mh-tile { border: 1px solid var(--line, #e0dcd4); border-left-width: 4px; border-radius: 10px; padding: 10px 12px; display: grid; gap: 2px; }
.mh-tile.ok { border-left-color: #1a7f43; } .mh-tile.warn { border-left-color: #c58a00; } .mh-tile.bad { border-left-color: #b3261e; }
.mh-name { font-weight: 600; }

/* Social media page */
.sm-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 14px; overflow-x: auto; }
.sm-tab { font: inherit; background: none; border: none; border-bottom: 2px solid transparent; padding: 9px 12px; font-weight: 600; color: var(--muted); cursor: pointer; white-space: nowrap; }
.sm-tab[aria-selected="true"] { color: var(--brand, #e8590c); border-bottom-color: var(--brand, #e8590c); }
.sm-cal { display: grid; gap: 6px; min-width: 900px; font-size: 12px; }
.sm-h { font-weight: 600; color: var(--muted); padding: 4px; }
.sm-slot { border: 1px solid var(--line); border-left: 4px solid var(--line); border-radius: 8px; padding: 6px 8px; display: flex; flex-direction: column; gap: 4px; min-height: 66px; cursor: pointer; background: var(--surface, #fff); }
.sm-slot[draggable="true"] { cursor: grab; } .sm-slot:focus-visible { outline: 2px solid var(--brand, #e8590c); outline-offset: 2px; }
.sk-customers { border-left-color: #2c5aa0; } .sk-restaurants { border-left-color: #a85f00; } .sk-drivers { border-left-color: #b3261e; } .sk-promo { border-left-color: #2f7d4f; }
.badge.sk-customers, .badge.sk-restaurants, .badge.sk-drivers, .badge.sk-promo { border-left-width: 3px; border-left-style: solid; }
.sm-card { display: grid; grid-template-columns: 150px 1fr; gap: 14px; align-items: start; }
.sm-media { width: 100%; max-width: 220px; aspect-ratio: 9 / 16; object-fit: cover; border-radius: 10px; background: #111; display: block; }
img.sm-media { aspect-ratio: 4 / 5; }
.sm-empty { display: grid; place-items: center; color: #bbb; font-size: 12px; text-align: center; padding: 8px; }
.sm-caption { background: var(--bg, #faf8f6); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-size: 13px; white-space: pre-line; }
.sm-lib { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.sm-tpl { display: flex; flex-direction: column; gap: 6px; }
.sm-bar { display: grid; grid-template-columns: 110px 1fr 120px; gap: 8px; align-items: center; font-size: 13px; }
.sm-bar-track { height: 12px; background: var(--line); border-radius: 6px; overflow: hidden; } .sm-bar-fill { height: 100%; background: var(--brand, #e8590c); }
.ny-media { width: 140px; max-width: 100%; border-radius: 8px; background: #111; }
@media (max-width: 640px) { .sm-card { grid-template-columns: 1fr; } }

/* ---------- Manual review: summary tiles, one section per kind of work, due chips ---------- */
.mr { display: flex; flex-direction: column; gap: 14px; }
.mr-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.mr-tile { display: flex; flex-direction: column; gap: 2px; background: var(--surface, #fff); border: 1px solid var(--line); border-top: 4px solid #8a817a; border-radius: 10px; padding: 10px 14px; text-decoration: none; color: inherit; }
.mr-tile:hover { border-color: var(--line-2); }
.mr-tl { font-size: 12px; color: var(--muted); } .mr-tn { font-size: 26px; font-weight: 700; line-height: 1.2; }
.s-money.mr-tile, .s-money.mr-sec { border-top-color: #b42318; } .s-orders.mr-tile, .s-orders.mr-sec { border-top-color: #e8590c; }
.s-signups.mr-tile, .s-signups.mr-sec { border-top-color: #1e4e79; } .s-social.mr-tile, .s-social.mr-sec { border-top-color: #b07a12; }
.s-other.mr-tile, .s-other.mr-sec, .s-info.mr-tile, .s-info.mr-sec { border-top-color: #8a817a; }
.mr-agents { margin-top: -4px; }
.mr-sec { border-top: 4px solid #8a817a; padding-top: 12px; scroll-margin-top: 12px; }
.mr-sh { display: flex; align-items: center; gap: 8px; } .mr-sh h2 { margin: 0; font-size: 1.05rem; }
.mr-cnt { background: #f4efea; border-radius: 999px; padding: 0 9px; font-size: 12px; font-weight: 700; }
.mr-why { margin: 2px 0 4px; }
.mr-row { display: flex; align-items: center; gap: 12px; border-top: 1px solid var(--line); padding: 10px 2px; }
.mr-row:first-child { border-top: 0; }
.mr-row.done { opacity: .85; }
.mr-thumb { width: 44px; height: 58px; object-fit: cover; border-radius: 6px; background: #1f1a17; flex: none; cursor: pointer; }
.mr-due { font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 6px; white-space: nowrap; flex: none; background: #f4efea; color: #6d625a; }
.mr-due.red { background: #fdecea; color: #8c1d18; } .mr-due.amber { background: #fff4dc; color: #7a4f00; }
.mr-sug { color: var(--muted); font-style: italic; }
.mr-cap > summary { cursor: pointer; color: var(--muted); }
.mr-done { margin-top: 0; }
@media (max-width: 720px) { .mr-row { flex-wrap: wrap; } .mr-row .ny-main { flex-basis: calc(100% - 60px); } }
.mr-more { position: relative; } .mr-more > summary { list-style: none; } .mr-more > summary::-webkit-details-marker { display: none; }
.mr-more-list { position: absolute; right: 0; top: calc(100% + 4px); z-index: 5; background: var(--surface, #fff); border: 1px solid var(--line); border-radius: 10px; padding: 6px; display: flex; flex-direction: column; gap: 6px; box-shadow: 0 6px 18px rgba(0,0,0,.12); min-width: 130px; }

.field[hidden] { display: none; }

/* Finance → Bissda fees, grouped by who pays */
.fee-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 14px; margin-top: 10px; }
.fee-group { padding: 12px 14px; }
.fee-group h3 { font-size: 1rem; margin: 0 0 2px; }
.fee-group > p { margin: 0 0 6px; }
.fee-row { display: grid; grid-template-columns: minmax(0, 1fr) max-content; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.fee-name { font-weight: 600; font-size: .9rem; }
.fee-row .hint { margin-top: 1px; }
.fee-ctl { justify-self: end; }
.fee-row input.fee-input { width: 96px; max-width: 96px; min-width: 0; text-align: right; }
.fee-pair input.fee-input { width: 74px; max-width: 74px; }
.fee-tag { white-space: nowrap; }
.fee-pair { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.fee-link { font-size: .85rem; font-weight: 600; white-space: nowrap; }
.fee-tag { display: inline-block; font-size: .72rem; font-weight: 600; padding: 1px 8px; border-radius: 999px; margin-inline-start: 6px; vertical-align: 1px; }
.fee-tag.info { background: #e7f1fb; color: #185fa5; }
.fee-tag.muted { background: var(--surface-2); color: var(--muted); }
@media (max-width: 520px) { .fee-groups { grid-template-columns: 1fr; } .fee-row { grid-template-columns: 1fr; } .fee-ctl { justify-self: start; } }

/* Onboarding checker on a pending restaurant */
.ob-panel { margin: 2px 0 8px; padding: 8px 12px; border-radius: 10px; background: var(--surface-2, #f4efea); }
.ob-head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 4px; }
.ob-pill { font-size: 12px; font-weight: 600; padding: 2px 10px; border-radius: 999px; }
.ob-pill.ok { background: var(--ok-soft); color: var(--ok); }
.ob-pill.wait { background: var(--warn-soft); color: var(--warn); }
.ob-pill.you { background: var(--info-soft); color: var(--info); }
.ob-branch { color: var(--ink-2); }
.ob-checks { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 2px 18px; font-size: 13px; }
.ob-checks .ob-ok { color: var(--ink-2); } .ob-checks .ob-ok span { color: var(--ok); }
.ob-checks .ob-wait { color: var(--warn); } .ob-checks .ob-fail { color: var(--bad); }
.ob-line { margin: 2px 0 6px; }

/* Payout review: what the Money agent found, and the person's tick */
.agent-notes { display: grid; gap: 4px; border-left: 3px solid #e7e1da; padding: 2px 0 2px 10px; max-width: 900px; }
.agent-notes p { margin: 0; }
.agent-head { text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }
.agent-suggest { font-weight: 600; color: #18794e; }
.agent-suggest.bad, .bad-text { color: #b42318; font-weight: 600; }
.good-text { color: var(--ok); } .info-text { color: var(--info); } .warn-text { color: var(--warn); font-weight: 600; }
.pay-group > summary::-webkit-details-marker { display: none; }
.pay-group.warn { background: var(--warn-soft); border-radius: 10px; padding: 8px 10px; margin-top: 6px; }
.checked-line { margin: 0; color: #18794e; font-weight: 600; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.btn.small.tick { border-color: #18794e; color: #18794e; background: #fff; }
.kpi-card.good { border-color: #a6dcbf; background: #f1faf5; }
/* On a phone the payout table scrolls sideways: keep the agent's notes in view at the left edge */
@media (max-width: 760px) { .agent-notes, .checked-line { position: sticky; left: 0; max-width: calc(100vw - 72px); } }

/* Social media: thumbnail with a full-size preview button, and the preview itself */
.sm-thumb { display: grid; gap: 8px; align-content: start; max-width: 220px; }
.sm-preview { display: grid; grid-template-columns: minmax(0, auto) minmax(0, 1fr); gap: 18px; align-items: start; }
.sm-big { display: block; max-height: 72vh; max-width: min(100%, 405px); aspect-ratio: 9 / 16; object-fit: contain; background: #111; border-radius: 12px; }
img.sm-big { aspect-ratio: auto; }
@media (max-width: 640px) { .sm-preview { grid-template-columns: 1fr; } .sm-big { max-height: 62vh; margin: 0 auto; } }

/* Social media → Comments */
.sm-modes { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 8px; }
.sm-mode { display: grid; gap: 4px; text-align: left; font: inherit; border: 1px solid #e7e1da; background: #fff; border-radius: 12px; padding: 10px 12px; cursor: pointer; color: inherit; }
.sm-mode.on { border-color: #ea5a1c; background: #fff6f0; box-shadow: inset 0 0 0 1px #ea5a1c; }
.sm-mode:focus-visible { outline: 3px solid #ea5a1c; outline-offset: 2px; }
.sm-comment { display: grid; gap: 8px; }
.sm-quote { margin: 0; padding: 8px 12px; border-left: 3px solid #e7e1da; background: #faf8f6; border-radius: 0 8px 8px 0; white-space: pre-wrap; }
.sm-try-out { display: grid; gap: 6px; margin-top: 4px; }
.sm-comment textarea, #sm-try { width: 100%; box-sizing: border-box; }
/* Sign-up deals and new-driver bonus rows: several boxes in one row wrap instead of overflowing. */
.fee-pair { flex-wrap: wrap; justify-content: flex-end; row-gap: 6px; max-width: 360px; }
.deal-month { margin-top: 8px; padding: 8px 10px; border-radius: 8px; background: var(--bg-soft, #f5f2ef); font-size: .85rem; }
/* Postcode zone dialog */
.chips-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.chips-row .chip { min-height: 30px; padding: 0 6px 0 12px; display: inline-flex; align-items: center; gap: 2px; cursor: default; font-weight: 500; }
.chip-x { border: 0; background: none; cursor: pointer; padding: 2px 6px; font-size: .8rem; color: var(--muted, #6b625b); }
/* Rows with an on/off switch and several boxes: the boxes go under the text so the text keeps its width. */
.fee-row:has(.fee-pair.wide) { grid-template-columns: 1fr; }
.fee-row:has(.fee-pair.wide) .fee-ctl { justify-self: start; }
.fee-pair.wide { justify-content: flex-start; max-width: none; }

/* Reports (20 Nov 2026) */
.table-wrap tfoot tr.total th, .table-wrap tfoot tr.total td { border-top: 2px solid var(--text, #1b1b1b); padding-top: 8px; }
.bas-l { color: var(--brand, #e8590c); display: inline-block; min-width: 30px; }
@media print { .sidebar, .sm-tabs, .toolbar button, .topbar { display: none !important; } }
/* A ticket that came from Bissda Help: the chat before the handover, as a conversation. */
.help-handover { margin: 12px 0 4px; }
.help-handover .banner ul { font-weight: 400; }
.help-handover .hc-me .hc-who { color: rgba(255,255,255,.85); }
.help-handover .hc-refused { background: var(--surface-2); border: 1px dashed var(--line); }
.help-handover .hc-card { width: 100%; font-size: .85rem; border-collapse: collapse; }
.help-handover .hc-card caption { text-align: left; font-weight: 600; }
.help-handover .hc-card td { padding: 2px 0; } .help-handover .hc-card td.num { text-align: right; white-space: nowrap; padding-left: 12px; }
.help-handover .hc-total td { font-weight: 600; border-top: 1px solid var(--line); }
.help-handover .hc-divider { align-self: center; padding: 4px 0; }
/* Website: the page beside the designer. */
.site-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.site-bar .badge { margin-right: auto; }
.site-bar .seg { display: inline-flex; gap: 4px; }
.site-work { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(300px, 1fr); gap: 16px; align-items: start; }
@media (max-width: 1100px) { .site-work { grid-template-columns: 1fr; } }
.site-right { display: grid; gap: 12px; }
.site-frame { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: #fff; height: 78vh; min-height: 560px; margin: 0 auto; transition: max-width .2s; }
.site-frame[data-size="desktop"] { max-width: 100%; }
.site-frame[data-size="phone"] { max-width: 400px; border-radius: 28px; border-width: 8px; border-color: #2a201a; }
[aria-pressed="true"].btn { background: var(--ink); color: #fff; border-color: var(--ink); }
.designer { display: grid; gap: 10px; }
.dz-list { display: flex; flex-direction: column; gap: 8px; max-height: 46vh; overflow-y: auto; padding: 2px; }
.dz-msg { padding: 8px 11px; border-radius: 12px; font-size: .92rem; max-width: 92%; white-space: pre-wrap; }
.dz-me { align-self: flex-end; background: var(--brand); color: #fff; }
.dz-bot { align-self: flex-start; background: var(--surface-2, #f4efe9); border: 1px solid var(--line); }
.dz-refused { border-color: #e0a100; background: #fff8e1; }
.dz-msg ul { margin: 6px 0 0; padding-left: 18px; }
.designer-ask { display: flex; gap: 8px; align-items: flex-end; }
.designer-ask textarea { flex: 1; resize: vertical; }
.site-right details.card summary { cursor: pointer; font-weight: 600; }

/* Support in two languages */
.tr-preview { border: 1px dashed var(--line, #d6cfc4); border-radius: 8px; padding: 8px 10px; margin: 6px 0 10px; background: var(--card, #fff); }
.tr-original { margin-top: 4px; padding: 6px 8px; border-left: 3px solid var(--line, #d6cfc4); font-size: .92em; opacity: .85; }
.linklike { background: none; border: 0; padding: 0; color: inherit; font: inherit; text-decoration: underline; cursor: pointer; }

/* A button that opens a <details> (e.g. "Preview the posts"): same size and line as the buttons beside it. */
.btn-details > summary.btn { display: inline-flex; align-items: center; list-style: none; cursor: pointer; }
.btn-details > summary.btn::-webkit-details-marker { display: none; }
.btn-details > summary.btn::marker { content: ''; }

/* Campaigns → Preview the posts: each post with its picture or video. */
.btn-details[open] { flex-basis: 100%; }
.camp-posts { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-top: 6px; }
.camp-post { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.camp-post img, .camp-post video, .camp-post-empty { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); }
.camp-post-empty { display: flex; align-items: center; justify-content: center; text-align: center; padding: 8px; }

/* Ask AI: Discuss/Change and Claude/GPT/Both switches, both AIs side by side (stacked on a phone), previews */
.ai-seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: var(--radius-sm); overflow: hidden; }
.ai-seg button { border: 0; border-inline-end: 1px solid var(--line-2); background: var(--surface); color: var(--ink); padding: 8px 14px; min-height: 40px; font: inherit; cursor: pointer; }
.ai-seg button:last-child { border-inline-end: 0; }
.ai-seg button.on { background: var(--brand); color: #fff; font-weight: 600; }
.ai-seg button:disabled { color: var(--muted); cursor: not-allowed; opacity: .6; }
.ai-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 860px) { .ai-two { grid-template-columns: minmax(0, 1fr); } }
.ai-convo { margin-bottom: 14px; }
.ai-side { min-width: 0; }
.ai-claude .ai-who { color: #b3541e; }
.ai-gpt .ai-who { color: #0f7b5f; }
.ai-msg { margin: 4px 0; padding: 8px 10px; border-radius: 8px; max-width: 92%; white-space: pre-wrap; overflow-wrap: anywhere; background: var(--surface-2); }
.ai-msg.me { margin-inline-start: auto; background: var(--info-soft); }
.ai-preview { margin: 8px 0; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px; background: var(--surface); }
.ai-preview figcaption { font-weight: 600; margin-bottom: 6px; }
.ai-preview iframe { width: 100%; height: 520px; border: 0; border-radius: 6px; background: #fff; }
.ai-preview img, .ai-preview video { max-width: 100%; max-height: 520px; display: block; margin: 0 auto; border-radius: 6px; }
.ai-diff { white-space: pre-wrap; word-break: break-word; font-size: 12px; background: var(--surface-2); padding: 8px; border-radius: 8px; max-height: 360px; overflow: auto; }
.ai-row { display: flex; justify-content: space-between; gap: 8px; width: 100%; text-align: start; margin-bottom: 6px; cursor: pointer; }
.ai-row-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-examples .chip { white-space: normal; text-align: start; max-width: 100%; height: auto; }
