/* Restaurant skin (phase 3.12, direction A: warm cream, terracotta-family brand, 2px dark-brown borders, 14px radius).
   Loaded after design.css + brand.css on every shell. All colours come from tokens that restaurant_brand.design derives from the
   Brand Settings colour (inline <style id="rb-tokens">), so a green or blue brand colour re-skins everything.
   html[data-rb-app] = the React/Vue apps (/pos, /ury/serve, /mosaic). Reversible: remove this file's <link> in inject.py. */

:root { --rb-r-sm: 10px; --rb-r-md: 14px; --rb-r-lg: 14px; --rb-bw: 2px;
  --rb-shadow-card: 0 2px 0 rgba(74, 52, 38, .10), 0 6px 14px rgba(74, 52, 38, .10);
  --rb-shadow-press: 0 1px 0 rgba(74, 52, 38, .12); }

/* ============ React / Vue apps ============ */
html[data-rb-app] body { background: var(--rb-bg); color: var(--rb-ink); }
html[data-rb-app] :is(.bg-white, .bg-card) { background-color: var(--rb-surface); }
html[data-rb-app] :is(.bg-gray-50, .bg-gray-100, .bg-background) { background-color: var(--rb-bg); }
html[data-rb-app] :is(.bg-gray-200, .bg-muted) { background-color: var(--rb-panel); }
html[data-rb-app] :is(.text-gray-900, .text-gray-800, .text-foreground) { color: var(--rb-ink); }
html[data-rb-app] :is(.text-gray-700, .text-gray-600, .text-gray-500, .text-muted-foreground) { color: var(--rb-ink-soft); }
html[data-rb-app] .text-gray-400 { color: var(--rb-ink-faint); }
html[data-rb-app] :is(.bg-blue-50, .bg-blue-100, .bg-primary-50, .bg-primary-100) { background-color: var(--rb-primary-soft); }
html[data-rb-app] :is(.text-blue-500, .text-blue-600, .text-blue-700, .text-primary-600, .text-primary-700) { color: var(--rb-primary); }
html[data-rb-app] :is(.bg-blue-500, .bg-blue-600, .bg-blue-700) { background-color: var(--rb-primary); color: var(--rb-primary-ink); }
html[data-rb-app] :is(.border-blue-500, .border-blue-600, .border-primary-600) { border-color: var(--rb-primary); }
html[data-rb-app] :is(.border-gray-100, .border-gray-200, .border-gray-300) { border-color: var(--rb-line-soft); }

/* ---- buttons: ALWAYS look like buttons (bordered, rounded, visible); solid brand colour for the main action ---- */
html[data-rb-app] button:not(.rb-hint):not(.rb-lang):not(.rb-hints-switch):not(.rb-bare):not([role="menuitem"]):not([role="option"]):not([role="checkbox"]):not([role="switch"]):not([data-state][role="tab"]) {
  border: var(--rb-bw) solid var(--rb-line); border-radius: var(--rb-r-md); box-shadow: var(--rb-shadow-press);
  font-weight: 600; cursor: pointer; }
html[data-rb-app] button:where(:not([class*="bg-"]):not([style*="background"])) { background-color: var(--rb-surface); }
html[data-rb-app] button:not(:disabled):hover { border-color: var(--rb-primary); }
html[data-rb-app] button:not(:disabled):active { transform: translateY(1px) scale(.99); box-shadow: none; background-color: var(--rb-primary-soft); }
html[data-rb-app] button:focus-visible, html[data-rb-app] a:focus-visible, html[data-rb-app] [role="button"]:focus-visible, html[data-rb-app] input:focus-visible {
  outline: 3px solid var(--rb-primary); outline-offset: 2px; }
html[data-rb-app] button:disabled, html[data-rb-app] button[aria-disabled="true"] { opacity: .55; cursor: not-allowed; box-shadow: none; border-style: dashed; }
/* the main action: solid brand colour, brand-dark border, white label */
html[data-rb-app] button:is([class*="bg-primary"], [class*="bg-foreground"], [class*="bg-blue-6"], [class*="bg-blue-5"], [class*="bg-gray-900"], [class*="bg-black"], [class*="bg-slate-900"], [style*="--ac)"]):not(:disabled) {
  background-color: var(--rb-primary) !important; border-color: var(--rb-primary-hover); color: var(--rb-primary-ink) !important; }
html[data-rb-app] button:is([class*="bg-primary"], [class*="bg-foreground"], [class*="bg-blue-6"], [class*="bg-gray-900"]):not(:disabled):hover { background-color: var(--rb-primary-hover) !important; }
html[data-rb-app] button:is([class*="bg-destructive"], [class*="bg-red-"]):not(:disabled) { border-color: rgba(0, 0, 0, .45); }
html[data-rb-app] button:is([class*="bg-green-"], [class*="bg-emerald-6"], [class*="bg-success"]):not(:disabled) { border-color: rgba(0, 0, 0, .4); }
html[data-rb-app] button:has(> svg:only-child), html[data-rb-app] button[aria-label]:not(:has(span, p)):has(svg) { border-radius: var(--rb-r-md); }
html[data-rb-app] button[class*="rounded-full"] { border-radius: 999px; }
/* selected chip / pill / tab: filled with a clear selected state */
html[data-rb-app] button:is([aria-selected="true"], [aria-pressed="true"], [data-state="on"], [data-state="active"]):not([class*="bg-primary"]) {
  background-color: var(--rb-primary) !important; color: var(--rb-primary-ink) !important; border-color: var(--rb-primary-hover); }
html[data-rb-app] button[class*="bg-primary-50"], html[data-rb-app] button[class*="bg-blue-100"] { border-color: var(--rb-primary); color: var(--rb-primary-hover); }

/* ---- tabs / segmented ---- */
html[data-rb-app] [role="tablist"] { gap: 8px; }
html[data-rb-app] [role="tab"] { border: var(--rb-bw) solid var(--rb-line); border-radius: var(--rb-r-md); min-height: var(--rb-touch); padding-inline: 16px; font-weight: 600; background: var(--rb-surface); }

/* ---- cards ---- */
html[data-rb-app] :is(.shadow-sm, .shadow, .shadow-md):is(.rounded-lg, .rounded-xl, .rounded-md, .rounded-2xl):not(button):not(input):not(select) {
  border: var(--rb-bw) solid var(--rb-line); border-radius: var(--rb-r-md); box-shadow: var(--rb-shadow-card); }
html[data-rb-app] div[role="button"].rounded-xl, html[data-rb-app] div[role="button"].rounded-lg { cursor: pointer; transition: transform var(--rb-t), box-shadow var(--rb-t); }
html[data-rb-app] div[role="button"].rounded-xl:active, html[data-rb-app] div[role="button"].rounded-lg:active { transform: scale(.985); }
html[data-rb-app] div.border.rounded-lg, html[data-rb-app] div.border.rounded-xl { border-width: var(--rb-bw); border-color: var(--rb-line); border-radius: var(--rb-r-md); }
html[data-rb-app] [data-outlet-card] { border-inline-start: 6px solid var(--chip); }
/* captain table cards: status colours, but with a dark enough border */
html[data-rb-app] div[role="button"].border-2.border-emerald-300 { border-color: var(--rb-ok); background-color: var(--rb-ok-soft); color: var(--rb-ink); }
html[data-rb-app] div[role="button"].border-2:is(.border-sky-300, .border-blue-300, .border-sky-400, .border-blue-400) { border-color: var(--rb-ink); background-color: var(--rb-primary-soft); color: var(--rb-ink); box-shadow: inset 6px 0 0 var(--rb-primary), var(--rb-shadow-card); }
html[dir="rtl"][data-rb-app] div[role="button"].border-2:is(.border-sky-300, .border-blue-300, .border-sky-400, .border-blue-400) { box-shadow: inset -6px 0 0 var(--rb-primary), var(--rb-shadow-card); }
html[data-rb-app] div[role="button"].border-2:is(.border-amber-300, .border-orange-300, .border-yellow-300) { border-color: var(--rb-warn); background-color: var(--rb-warn-soft); color: var(--rb-ink); }
html[data-rb-app] div[role="button"].border-2:is(.border-red-300, .border-rose-300) { border-color: var(--rb-danger); background-color: var(--rb-danger-soft); color: var(--rb-ink); }
html[data-rb-app] div[role="button"].border-2:is(.border-gray-300, .border-gray-200, .border-slate-300) { border-color: var(--rb-line); background-color: var(--rb-surface); }
html[data-rb-app] :is(.text-emerald-900, .text-emerald-800, .text-emerald-700, .text-sky-900, .text-blue-900, .text-sky-800) { color: var(--rb-ink); }

/* ---- menu item tiles: coloured tile with the initials (no stock photos); colour is stable per category/name (set by brand.js) ---- */
html[data-rb-app] .h-24.shrink-0 > div.bg-gray-200 { color: var(--rb-tile-ink); font-weight: 700; font-size: 1.75rem; letter-spacing: .02em; background: var(--rb-tile-1); }
html[data-rb-app] .h-24.shrink-0 > div.bg-gray-200[data-rb-tile="2"] { background: var(--rb-tile-2); }
html[data-rb-app] .h-24.shrink-0 > div.bg-gray-200[data-rb-tile="3"] { background: var(--rb-tile-3); }
html[data-rb-app] .h-24.shrink-0 > div.bg-gray-200[data-rb-tile="4"] { background: var(--rb-tile-4); }
html[data-rb-app] .h-24.shrink-0 > div.bg-gray-200[data-rb-tile="5"] { background: var(--rb-tile-5); }
html[data-rb-app] .h-24.shrink-0 > div.bg-gray-200[data-rb-tile="6"] { background: var(--rb-tile-6); }
html[data-rb-app] .h-24.shrink-0 img { filter: none !important; }
html[data-rb-app] div[role="button"].h-60 h3 { font-size: 15px; font-weight: 700; color: var(--rb-ink); }
html[data-rb-app] div[role="button"].h-60 span.tabular-nums { color: var(--rb-primary); font-weight: 700; font-size: 15px; }

/* ---- header, rails, panels ---- */
html[data-rb-app] header { background: var(--rb-surface); border-bottom: var(--rb-bw) solid var(--rb-line); }
html[data-rb-app] header a img, html[data-rb-app] header img[alt] { max-height: 36px; width: auto; object-fit: contain; }
html[data-rb-app] aside, html[data-rb-app] nav { border-color: var(--rb-line); }
html[data-rb-app] .border-b, html[data-rb-app] .border-t, html[data-rb-app] .border-s, html[data-rb-app] .border-e { border-color: var(--rb-line-soft); }
html[data-rb-app] .border-b.border-border, html[data-rb-app] .border-t.border-border, html[data-rb-app] .border-s.border-border { border-width: 0; border-style: solid; }
html[data-rb-app] .border-b.border-border { border-bottom-width: var(--rb-bw); border-color: var(--rb-line); }
html[data-rb-app] .border-t.border-border { border-top-width: var(--rb-bw); border-color: var(--rb-line); }
html[data-rb-app] .border-s.border-border { border-inline-start-width: var(--rb-bw); border-color: var(--rb-line); }
/* bottom rail (cashier): bordered tabs, current one filled */
html[data-rb-app] nav a:not(.rb-nav-tile) { border: var(--rb-bw) solid transparent; border-radius: var(--rb-r-md); }
html[data-rb-app] nav a.text-primary:not(.rb-nav-tile), html[data-rb-app] nav a[aria-current="page"]:not(.rb-nav-tile) { border-color: var(--rb-primary); background: var(--rb-primary-soft); color: var(--rb-primary); }
/* totals + pay always visible: the cart footer stays pinned */
html[data-rb-app] .w-96.fixed > :last-child { background: var(--rb-panel); border-top: var(--rb-bw) solid var(--rb-line); }

/* ---- inputs ---- */
html[data-rb-app] :is(input:not([type="checkbox"]):not([type="radio"]):not(.border-0):not([type="range"]), select, textarea) {
  border: var(--rb-bw) solid var(--rb-line); border-radius: var(--rb-r-md); background-color: var(--rb-surface); color: var(--rb-ink); min-height: var(--rb-touch); }
html[data-rb-app] .border-input:not(input):not(button):not(select) { border: var(--rb-bw) solid var(--rb-line); border-radius: var(--rb-r-md); background-color: var(--rb-surface); }
html[data-rb-app] header div.flex-1.max-w-2xl { height: auto; min-height: 44px; padding-block: 2px; }
html[data-rb-app] input.border-0 { min-height: 36px; }
html[data-rb-app] :is(input, textarea)::placeholder { color: var(--rb-ink-soft); opacity: .85; }
html[data-rb-app] :is(input, select, textarea):focus { border-color: var(--rb-primary); outline: 3px solid var(--rb-primary-soft); }

/* ---- dialogs, badges ---- */
html[data-rb-app] [role="dialog"] { border-radius: var(--rb-r-lg); background: var(--rb-surface); box-shadow: 0 0 0 var(--rb-bw) var(--rb-line), 0 18px 48px rgba(43, 29, 20, .35); }
html[data-rb-app] :is([data-sonner-toast], [class*="toast" i], [class*="Toastify"]) button { min-height: 32px; min-width: 32px; border-width: 1.5px; box-shadow: none; border-radius: 10px; }
html[data-rb-app] [role="dialog"] button { min-height: var(--rb-touch); }
html[data-rb-app] .bg-green-100, html[data-rb-app] .bg-emerald-50, html[data-rb-app] .bg-emerald-100 { background-color: var(--rb-ok-soft); }
html[data-rb-app] .text-green-700, html[data-rb-app] .text-green-800, html[data-rb-app] .text-emerald-600 { color: var(--rb-ok); }

/* ---- cart rows: a long item name wraps / clamps to 2 lines, never pushes the stepper, edit/delete buttons or the price out of the row ---- */
html[data-rb-app] div.flex.items-center.justify-between > div.flex-1 { min-width: 0; }
html[data-rb-app] div.flex.items-center.justify-between > div.flex-1 h3, html[data-rb-app] div.flex.items-center.justify-between > div.flex-1 > div > h3 {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; line-height: 1.35; font-size: 15px; font-weight: 700; }
html[data-rb-app] div.flex.items-center.justify-between > div.flex-1 p { overflow-wrap: anywhere; }
html[data-rb-app] div.flex.items-center.justify-between > div.flex.items-center.gap-2 { flex-shrink: 0; }
/* cart row = name + price on the first line (full width), controls on the second line: nothing is squeezed, whatever the name length */
html[data-rb-app] .w-96.fixed .overflow-y-auto div.flex-col > div.flex.items-center.justify-between { flex-wrap: wrap; row-gap: 8px; }
html[data-rb-app] .w-96.fixed .overflow-y-auto div.flex-col > div.flex.items-center.justify-between > div.flex-1 { flex: 1 1 100%; }
html[data-rb-app] .w-96.fixed .overflow-y-auto div.flex-col > div.flex.items-center.justify-between > div.flex.items-center.gap-2 { margin-inline-start: auto; }
/* the cart panel is sized for a 26px strip; give it the strip's real height */
html[data-rb-app] .w-96.fixed { height: calc(100dvh - 3.1rem - var(--rb-h)) !important; }
html[data-rb-app] div.flex.items-center.justify-between { gap: 10px; }
html[data-rb-app] [data-testid="pay-now"] { min-height: 60px; font-size: 18px; font-weight: 700; }
html[data-rb-app] .w-96.fixed .p-4.border-t .text-lg { font-size: 22px; font-weight: 700; }

/* ---- kitchen (Mosaic) ---- */
html[data-rb-app] .masonry-item { border: 3px solid var(--rb-line) !important; border-radius: var(--rb-r-md); box-shadow: var(--rb-shadow-card); overflow: hidden; }
html[data-rb-app] .masonry-item[class*="--am-b"] { border-color: var(--rb-warn) !important; }
html[data-rb-app] .masonry-item[class*="--rd-b"] { border-color: var(--rb-danger) !important; }
html[data-rb-app] .masonry-item[class*="--ac-b"] { border-color: var(--rb-primary) !important; }
html[data-rb-app] .masonry-item button.w-full { min-height: 64px; font-size: 18px; font-weight: 700; border-radius: var(--rb-r-md); background: var(--rb-ok) !important; color: #fff !important; border-color: rgba(0, 0, 0, .4); }
html[data-rb-app] .masonry-item button.w-full:hover { filter: brightness(.92); }
html[data-rb-app] [data-path="mosaic"] .rounded-lg.border { border-width: var(--rb-bw); }

html[data-rb-app] .masonry-item .text-sm.flex-1 > span:first-child { margin-inline-end: .4em; }
html[data-rb-app] nav a:not(.rb-nav-tile) .bg-foreground, html[data-rb-app] nav a:not(.rb-nav-tile) [class*="bg-primary"] { background-color: var(--rb-primary) !important; color: var(--rb-primary-ink) !important; }
/* kitchen landing (units) */
html[data-rb-app] .rounded-lg.cursor-pointer.p-4 { border: var(--rb-bw) solid var(--rb-line) !important; border-radius: var(--rb-r-md); background: var(--rb-surface) !important; box-shadow: var(--rb-shadow-card); }
html[data-rb-app] .rounded-lg.cursor-pointer.p-4:hover { border-color: var(--rb-primary) !important; }
html[data-rb-app] .rounded-md.p-2.text-center { border: 1.5px solid var(--rb-line-soft); border-radius: 10px; }
html[data-rb-app] .rounded-md.p-2.text-center .text-2xl, html[data-rb-app] .rounded-md.p-2.text-center > div:first-child { font-weight: 700; }

/* ============ connection chip + strip (all shells) ============ */
#rb-strip { background: var(--rb-panel, #fbeee2) !important; color: var(--rb-ink-soft, #52606d) !important; border-top: 2px solid var(--rb-line, #573625) !important; min-height: 36px; padding: 3px 10px; gap: 6px 10px; }
#rb-strip a { color: var(--rb-ink, #1f2933); }
#rb-strip .rb-lang, #rb-strip .rb-hints-switch, #rb-strip .rb-conn { appearance: none; position: relative; border: 2px solid var(--rb-line, #475569) !important; background: var(--rb-surface, #fff) !important; color: var(--rb-ink, #334155) !important;
  border-radius: var(--rb-r-md, 14px) !important; padding: 3px 12px !important; min-height: 32px; font: inherit; font-weight: 700; cursor: pointer; }
#rb-strip .rb-lang::after, #rb-strip .rb-hints-switch::after { content: ""; position: absolute; inset: -8px -4px; }   /* touch area >= 48px without a taller strip */
#rb-strip .rb-lang:hover, #rb-strip .rb-hints-switch:hover { border-color: var(--rb-primary, #0f766e) !important; }
#rb-strip .rb-conn { display: inline-flex; align-items: center; gap: 6px; cursor: default; }
#rb-strip .rb-conn i { width: 10px; height: 10px; border-radius: 50%; background: #f59e0b; flex: none; }
#rb-strip .rb-conn[data-rb-conn="green"] i { background: var(--rb-ok, #16a34a); }
#rb-strip .rb-conn[data-rb-conn="red"] { background: var(--rb-danger-soft, #fde3e6) !important; border-color: var(--rb-danger, #b3261e) !important; }
#rb-strip .rb-conn[data-rb-conn="red"] i { background: var(--rb-danger, #dc2626); }

/* outlet tabs + filters: bordered pills with a clear selected state */
div.rb-outlets .rb-chip { border-width: 2px; min-height: var(--rb-touch); box-shadow: none; }
div.rb-outlets .rb-chip[aria-selected="true"] { box-shadow: 0 2px 0 rgba(0, 0, 0, .25); }
@media (max-width: 767px) { html[data-rb-app] .rb-cart-name { -webkit-line-clamp: 2; } }

/* ============ login + Frappe desk (our own tokens only; desk keeps its own light/dark logic) ============ */
:root:not([data-theme="dark"]) .btn-primary, :root:not([data-theme="dark"]) .btn-login { background: var(--rb-primary); border: 2px solid var(--rb-primary-hover); color: var(--rb-primary-ink); border-radius: var(--rb-r-md); font-weight: 600; min-height: 44px; }
:root:not([data-theme="dark"]) .btn-default, :root:not([data-theme="dark"]) .btn-secondary { border: 2px solid var(--rb-line); border-radius: var(--rb-r-md); font-weight: 600; background: var(--rb-surface); }
:root:not([data-theme="dark"]) .form-control, :root:not([data-theme="dark"]) .form-control:not(:disabled) { border: 2px solid var(--rb-line-soft); border-radius: var(--rb-r-md); }
:root:not([data-theme="dark"]) .form-control:focus { border-color: var(--rb-primary); box-shadow: 0 0 0 3px var(--rb-primary-soft); }
body[data-path="login"] { background: var(--rb-bg); }
body[data-path="login"] .login-content.page-card { border: 2px solid var(--rb-line); border-radius: var(--rb-r-lg); background: var(--rb-surface); box-shadow: var(--rb-shadow-card); padding: 24px; max-width: 420px; }
body[data-path="login"] .for-login { border: 0; box-shadow: none; background: transparent; }
body[data-path="login"] .form-control { border: 2px solid var(--rb-line) !important; border-radius: var(--rb-r-md); min-height: 48px; background: var(--rb-surface); }
body[data-path="login"] .form-control:focus { border-color: var(--rb-primary) !important; box-shadow: 0 0 0 3px var(--rb-primary-soft); }
body[data-path="login"] .es-button { background: var(--rb-primary) !important; border: 2px solid var(--rb-primary-hover) !important; color: var(--rb-primary-ink) !important; border-radius: var(--rb-r-md); min-height: 48px; font-weight: 700; font-size: 16px; }
body[data-path="login"] .es-button:hover { background: var(--rb-primary-hover) !important; }
body[data-path="login"] .btn-login-with-email-link, body[data-path="login"] .login-content .btn-login-with-email-link { background: var(--rb-surface) !important; color: var(--rb-ink) !important; border-color: var(--rb-line) !important; }
body[data-path="login"] .page-card-head img, body[data-path="login"] .app-logo { max-height: 48px; width: auto; }

/* 3.13 D2: long category names (the real menus have "ROOQ Omani Bread Corner" ...) wrap instead of being clipped in the cashier's category column */
nav.overflow-y-auto button.w-full { white-space: normal !important; height: auto !important; min-height: 44px; align-items: center; }
nav.overflow-y-auto button.w-full > div:first-child { min-width: 0; flex: 1 1 auto; align-items: center; }
nav.overflow-y-auto button.w-full > div:first-child > span { white-space: normal; overflow-wrap: anywhere; line-height: 1.2; text-align: start; }
nav.overflow-y-auto button.w-full > span:last-child { flex-shrink: 0; margin-inline-start: 6px; }
