/* ═══════════════════════════════════════════════════════════════════════════
   RMQ CENTRAL STYLE SHEET — the master components.   (Robert, 2026-09-29)

   ONE look for every tile, button, card, pop-up, status label, menu row,
   title, section heading and form field, in RMQ and in RMQ Service.
   Drawn crisp: bright outlines, a solid main button, the color in the words.

   Colors come from rmq-theme.css. No color literals in this file.

   How a page uses it
     * Put the class on the element:   class="rmq-btn"   class="rmq-tile"
     * Say which color it is with --a, three numbers from the central sheet:
           style="--a: var(--green-rgb)"      or, in the page's own styles,
           .tile-call { --a: var(--green-rgb); }
       With no --a, a piece takes the brand color.
     * A page keeps WHERE things sit (its grids, rows, margins, widths).
       It never restates how a component LOOKS.

   Loaded after the page's own styles (partials/rmq_head_end.html), before
   rmq-layout.css.

   Sections:  1 tile   2 main button   3 other button   4 card   5 pop-up
              6 status label   7 menu row   8 page title   9 section heading
              10 form field   11 motion   12 shared widgets   13 the business Menu
   ═══════════════════════════════════════════════════════════════════════════ */

/* A button, field or pop-up takes the brand color unless told otherwise.
   It never borrows the status color of the card it sits in. */
html { --a: var(--red-rgb); }
/* :where() weighs nothing, so a page's own  .tile-call { --a: … }  always wins over this reset. */
:where(.rmq-row) { --a: var(--teal-rgb); }
:where(.rmq-btn, .rmq-modal, .rmq-tile, .rmq-badge, .rmq-card, .rmq-field, input, textarea) { --a: var(--red-rgb); }

/* ── 1. Action tile ───────────────────────────────────────────────────────── */
.rmq-tile {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    display: block;
    width: 100%;
    font: inherit;
    color: var(--text);
    text-decoration: none;
    background: var(--surface-04);
    border: 1px solid rgb(var(--a) / 0.6);
    border-radius: 12px;
    padding: 16px 12px;
    text-align: center;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.18s cubic-bezier(0.2, 0.8, 0.2, 1), background 0.18s, border-color 0.18s, box-shadow 0.18s;
}
.rmq-tile::before {                                  /* the glow that wakes up under your finger */
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.25s;
    background: radial-gradient(120% 90% at 50% 0%, rgb(var(--a) / 0.22), transparent 70%);
}
.rmq-tile:hover, .rmq-tile:focus-visible {
    transform: translateY(-2px);
    border-color: rgb(var(--a));
    box-shadow: 0 8px 24px rgb(var(--a) / 0.18), 0 0 0 1px rgb(var(--a) / 0.12);
    outline: none;
}
.rmq-tile:hover::before, .rmq-tile:focus-visible::before { opacity: 1; }
.rmq-tile:active { transform: translateY(0) scale(0.98); }
.rmq-tile-ico {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    margin: 0 auto 8px;
    border-radius: 11px;
    background: rgb(var(--a) / 0.12);
    border: 1px solid rgb(var(--a) / 0.25);
    font-size: 1.1rem;
    line-height: 1;
    transition: transform 0.18s;
}
.rmq-tile-ico svg { width: 18px; height: 18px; stroke: rgb(var(--a)) !important; }   /* beats the icon's own inline color */
.rmq-tile:hover .rmq-tile-ico { transform: scale(1.08); }
.rmq-tile-lbl { font-size: 0.8rem; font-weight: 600; color: var(--text); }
.rmq-tile-sub { font-size: 0.65rem; color: var(--gray-a0); margin-top: 3px; }

/* the full-width bar that sits in a tile grid (Back to referral) */
.rmq-tile--wide {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 15px;
    color: rgb(var(--a));
    font-size: 0.95rem;
    font-weight: 600;
    background: rgb(var(--a) / 0.08);
    border-color: rgb(var(--a) / 0.35);
}
/* order-entry tile: the same tile, left-aligned, the price in the color */
.rmq-tile--item {
    text-align: left;
    min-height: 90px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-start;
    padding: 12px;
}

/* ── 2. Main button ───────────────────────────────────────────────────────── */
.rmq-btn {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px 18px;
    border-radius: 12px;
    border: 1px solid rgb(var(--a));
    background: rgb(var(--a));
    color: var(--on-accent);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    line-height: 1.2;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.18s cubic-bezier(0.2, 0.8, 0.2, 1), border-color 0.18s, box-shadow 0.18s, background 0.18s, filter 0.18s;
}
.rmq-btn::after {                                    /* a band of light crosses it when you reach for it */
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    transform: translateX(-120%);
    background: linear-gradient(105deg, transparent 35%, rgb(var(--glow-rgb) / 0.35) 50%, transparent 65%);
}
.rmq-btn:hover, .rmq-btn:focus-visible {
    transform: translateY(-1px);
    box-shadow: 0 6px 24px rgb(var(--a) / 0.45), 0 0 0 3px rgb(var(--a) / 0.18);
    outline: none;
    filter: brightness(1.06);
}
.rmq-btn:hover::after, .rmq-btn:focus-visible::after { transform: translateX(120%); transition: transform 0.7s ease; }
.rmq-btn:active { transform: translateY(0) scale(0.985); }
.rmq-btn:disabled, .rmq-btn[aria-disabled="true"] { opacity: 0.4; cursor: not-allowed; transform: none; box-shadow: none; filter: none; }
.rmq-btn svg { stroke: currentColor !important; flex-shrink: 0; }     /* an icon takes the button's own color */
.rmq-btn--block { display: flex; width: 100%; }
.rmq-btn--sm { padding: 8px 14px; font-size: 0.8rem; border-radius: 10px; }
.rmq-btn--xs { padding: 4px 10px; font-size: 0.7rem; border-radius: 8px; font-weight: 600; gap: 4px; }

/* the Action button: the one that OPENS the action menu. Tinted, outlined, the color in the words. */
.rmq-btn--tint {
    background: linear-gradient(135deg, rgb(var(--a) / 0.14), rgb(var(--purple-rgb) / 0.10));
    color: rgb(var(--a));
    border-color: rgb(var(--a) / 0.6);
}
.rmq-btn--tint::after { background: linear-gradient(105deg, transparent 35%, rgb(var(--a) / 0.28) 50%, transparent 65%); }
.rmq-btn--tint:hover, .rmq-btn--tint:focus-visible {
    border-color: rgb(var(--a));
    background: linear-gradient(135deg, rgb(var(--a) / 0.22), rgb(var(--purple-rgb) / 0.16));
    box-shadow: 0 6px 22px rgb(var(--a) / 0.28);
    filter: none;
}

/* ── 3. Other button ──────────────────────────────────────────────────────── */
.rmq-btn--quiet { border-color: var(--line-30); background: transparent; color: var(--text); font-weight: 600; }
.rmq-btn--quiet::after { background: linear-gradient(105deg, transparent 35%, var(--surface-15) 50%, transparent 65%); }
.rmq-btn--quiet:hover, .rmq-btn--quiet:focus-visible { border-color: var(--text); background: var(--surface-06); box-shadow: none; filter: none; }
/* an other button that names its color: outlined in it, the color in the words */
.rmq-btn--line { border-color: rgb(var(--a) / 0.6); background: transparent; color: rgb(var(--a)); font-weight: 600; }
.rmq-btn--line::after { background: linear-gradient(105deg, transparent 35%, rgb(var(--a) / 0.2) 50%, transparent 65%); }
.rmq-btn--line:hover, .rmq-btn--line:focus-visible { border-color: rgb(var(--a)); background: rgb(var(--a) / 0.1); box-shadow: none; filter: none; }

/* ── 4. Card ──────────────────────────────────────────────────────────────── */
.rmq-card {
    background: var(--surface-04);
    border: 1px solid var(--line-20);
    border-radius: 12px;
    transition: border-color 0.18s, box-shadow 0.18s, transform 0.18s;
}
.rmq-card--clip { overflow: hidden; }                /* a card that folds open and shut */
.rmq-card--open { overflow: visible; }
.rmq-card--pad { padding: 16px; }
.rmq-card--edge { border-left: 3px solid rgb(var(--a)); }
.rmq-card--tint { background: rgb(var(--a) / 0.06); border-color: rgb(var(--a) / 0.35); }
.rmq-card--tap { cursor: pointer; }
.rmq-card--tap:hover {
    border-color: rgb(var(--a) / 0.4);
    border-left-color: rgb(var(--a));
    box-shadow: 0 8px 26px rgb(var(--shadow-rgb) / 0.22);
    transform: translateY(-1px);
}

/* ── 5. Pop-up window ─────────────────────────────────────────────────────── */
.rmq-scrim { background: var(--scrim-80); }
.rmq-modal {
    position: relative;
    width: 100%;
    max-width: 360px;
    margin: auto;
    padding: 24px;
    border-radius: 16px;
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    color: var(--text);
    background: linear-gradient(135deg, var(--bg-1) 0%, var(--bg-2) 100%);
    border: 1px solid rgb(var(--a) / 0.6);
    box-shadow: 0 24px 60px rgb(var(--shadow-rgb) / 0.5), 0 0 0 1px rgb(var(--a) / 0.08), 0 0 50px rgb(var(--a) / 0.10);
}
.rmq-modal::before {                                 /* a thin line of light across the top */
    content: '';
    position: absolute;
    left: 24px;
    right: 24px;
    top: 0;
    height: 2px;
    border-radius: 2px;
    background: linear-gradient(90deg, transparent, rgb(var(--a)), transparent);
}
.rmq-modal--wide { max-width: 450px; }
.rmq-modal--flush { padding: 0; }                   /* a pop-up whose header, body and footer bring their own padding */
.rmq-modal-title, .rmq-modal > h3 { font-size: 1.15rem; font-weight: 700; margin-bottom: 6px; }
.rmq-modal-text, .rmq-modal > p { color: var(--gray-a0); font-size: 0.875rem; margin-bottom: 14px; }
.rmq-modal-btns { display: flex; gap: 12px; margin-top: 16px; }
.rmq-modal-btns > .rmq-btn { flex: 1; min-width: 0; white-space: normal; padding-left: 10px; padding-right: 10px; }

/* ── 6. Status label ──────────────────────────────────────────────────────── */
.rmq-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    line-height: 1.2;
    padding: 4px 10px;
    border-radius: 12px;
    color: rgb(var(--a));
    background: rgb(var(--a) / 0.14);
    border: 1px solid rgb(var(--a) / 0.6);
    white-space: nowrap;
}
.rmq-badge--plain { text-transform: none; letter-spacing: 0; font-weight: 600; }
.rmq-badge--wrap { white-space: normal; text-align: center; }   /* a long label in a tight spot */
.rmq-badge svg { flex-shrink: 0; }

/* ── 7. Menu row ──────────────────────────────────────────────────────────── */
.rmq-row {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 11px 10px;
    border-radius: 10px;
    border: 1px solid transparent;
    color: var(--text);
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
.rmq-row:hover, .rmq-row:focus-visible { background: var(--surface-05); border-color: rgb(var(--a) / 0.25); outline: none; }
.rmq-row-ico {
    width: 30px;
    height: 30px;
    flex: none;
    border-radius: 8px;
    display: grid;
    place-items: center;
    background: rgb(var(--a) / 0.10);
    border: 1px solid rgb(var(--a) / 0.22);
}
.rmq-row-text h3, .rmq-row-text h4 { font-size: 0.86rem; font-weight: 600; }
.rmq-row-text p { font-size: 0.68rem; color: var(--gray-77); margin-top: 1px; }
.rmq-row-go { margin-left: auto; color: var(--gray-55); }
.rmq-row--here { opacity: 0.45; pointer-events: none; }

/* ── 8. Page title ────────────────────────────────────────────────────────── */
.rmq-title { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.01em; line-height: 1.2; }
.rmq-under { font-size: 0.875rem; color: var(--gray-a0); margin-top: 4px; }

/* ── 9. Section heading ───────────────────────────────────────────────────── */
.rmq-section {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--gray-77);
}
.rmq-section--color { color: var(--red); }

/* ── 10. Form field ───────────────────────────────────────────────────────── */
/* On a page that is on the master look, every box you type in IS a form field: no class
   needed. .rmq-field is for anything else that should look like one. */
.rmq-field,
[data-rmq-master] input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="file"]):not([type="color"]):not([type="range"]):not([type="submit"]):not([type="button"]),
[data-rmq-master] textarea {
    display: block;
    width: 100%;
    padding: 12px var(--rmq-pad-right, 14px) 12px var(--rmq-pad-left, 14px);   /* a page with an icon or a $ inside the box sets these */
    border-radius: 10px;
    font-family: inherit;
    font-size: 0.9rem;
    color: var(--text);
    background: var(--surface-04);
    border: 1px solid var(--line-30);
    box-shadow: none;
    transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
}
.rmq-field::placeholder,
[data-rmq-master] input::placeholder,
[data-rmq-master] textarea::placeholder { color: var(--gray-60); font-style: normal; }
.rmq-field:hover,
[data-rmq-master] input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="file"]):not([type="color"]):not([type="range"]):not([type="submit"]):not([type="button"]):hover,
[data-rmq-master] textarea:hover { border-color: var(--line-40); }
.rmq-field:focus,
[data-rmq-master] input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="file"]):not([type="color"]):not([type="range"]):not([type="submit"]):not([type="button"]):focus,
[data-rmq-master] textarea:focus {
    outline: none;
    border-color: rgb(var(--a) / 0.8);
    box-shadow: 0 0 0 3px rgb(var(--a) / 0.16);
    background: var(--surface-06);
}
.rmq-field:disabled,
[data-rmq-master] input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="file"]):not([type="color"]):not([type="range"]):not([type="submit"]):not([type="button"]):disabled,
[data-rmq-master] textarea:disabled { opacity: 0.5; cursor: not-allowed; }
[data-rmq-master] textarea { resize: vertical; }
/* a plain drop-down the browser draws (admin pages): a form field that is only as wide as its words */
[data-rmq-master] select:not(.rmq-select) {
    -webkit-appearance: none;
    appearance: none;
    background-image: var(--icon-caret);
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding: 10px 30px 10px 12px;
    border-radius: 10px;
    font-family: inherit;
    font-size: 0.85rem;
    color: var(--text);
    background-color: var(--surface-04);
    border: 1px solid var(--line-30);
}
[data-rmq-master] select:not(.rmq-select):focus { outline: none; border-color: rgb(var(--red-rgb) / 0.8); }
.rmq-field-label { display: block; font-size: 0.875rem; color: var(--gray-c0); margin-bottom: 8px; }
.rmq-field-label .required, .rmq-field-label .req { color: var(--red); }

/* ── 11. Motion ───────────────────────────────────────────────────────────── */
/* Pieces rise into place one after another:  class="rmq-stagger", each child style="--i: 0,1,2…" */
@keyframes rmq-rise {
    from { opacity: 0; transform: translateY(14px) scale(0.97); }
    to { opacity: 1; transform: none; }
}
[data-motion="full"] .rmq-stagger > * {
    animation: rmq-rise 0.45s cubic-bezier(0.2, 0.8, 0.2, 1) both;
    animation-delay: calc(var(--i, 0) * 45ms);
}

/* ── 12. Shared widgets ───────────────────────────────────────────────────── */
/* The drop-down (static/rmq-select.js) draws its own box. On a page that is on the
   master look, it is a form field like any other. */
[data-rmq-master] .rmq-dropdown .rmq-trigger {
    padding: 12px 36px 12px 14px;
    border-radius: 10px;
    font-size: 0.9rem;
    background-color: var(--surface-04);
    border: 1px solid var(--line-30);
    transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
}
[data-rmq-master] .rmq-dropdown .rmq-trigger:hover { border-color: var(--line-40); }
[data-rmq-master] .rmq-dropdown .rmq-trigger:focus,
[data-rmq-master] .rmq-dropdown.open .rmq-trigger {
    border-color: rgb(var(--red-rgb) / 0.8);
    box-shadow: 0 0 0 3px rgb(var(--red-rgb) / 0.16);
}
[data-rmq-master] .rmq-dropdown .rmq-menu {
    border-radius: 10px;
    border: 1px solid var(--line-30);
}

/* ── 13. The business Menu ────────────────────────────────────────────────── */
/* templates/partials/rmq_menu.html. A drawer on a phone; rmq-layout.css turns it into a sidebar. */
.menu-drawer-overlay {
    position: fixed; inset: 0; background: var(--scrim-55);
    opacity: 0; pointer-events: none; transition: opacity .25s ease; z-index: 900;
}
.menu-drawer-overlay.open { opacity: 1; pointer-events: auto; }
.menu-drawer {
    position: fixed; top: 0; right: 0; bottom: 0; width: 312px; max-width: 86vw;
    background: linear-gradient(160deg, var(--bg-1) 0%, var(--bg-2) 100%);
    border-left: 1px solid var(--line-12);
    transform: translateX(100%); transition: transform .25s ease;
    z-index: 901; overflow-y: auto; padding: 18px 14px 30px;
}
.menu-drawer.open { transform: translateX(0); }
.menu-drawer .md-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.menu-drawer .md-biz { font-size: 1rem; font-weight: 700; }
.menu-drawer .md-close { background: none; border: none; color: var(--gray-88); font-size: 1.3rem; cursor: pointer; padding: 4px 8px; }
.menu-drawer .md-sub { margin: 14px 2px 8px; }

/* ── 14. Super search ───────────────────────────────────────────────────────
   One box that finds anything on the page (rmq-search.js). The box is a master
   form field with an icon and a key hint; the results drop under it, grouped,
   exact matches first, matched letters lit (Robert, 2026-10-04). */
.rmq-search { position: relative; flex: 1; min-width: 0; }
.rmq-search > svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--gray-a0); pointer-events: none; }
.rmq-search > input { --rmq-pad-left: 42px; --rmq-pad-right: 56px; font-size: 1rem; }
.rmq-kbd { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-size: .68rem; color: var(--gray-a0); border: 1px solid var(--line-20); border-radius: 6px; padding: 2px 6px; pointer-events: none; }
.rmq-sr { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 40; padding: 6px; max-height: 420px; overflow-y: auto;
          background: var(--bg-1) !important; border-color: var(--line-30); box-shadow: 0 16px 48px rgb(var(--shadow-rgb) / .45); }
.rmq-sr.hidden { display: none; }
.rmq-sr-grp { font-size: .66rem; letter-spacing: .6px; text-transform: uppercase; color: var(--gray-a0); padding: 8px 10px 4px; }
.rmq-sr-hit { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; cursor: pointer; }
.rmq-sr-hit:hover, .rmq-sr-hit.sel { background: var(--surface-06); outline: 1px solid rgb(var(--teal-rgb) / .5); }
.rmq-sr-ico { width: 28px; height: 28px; border-radius: 8px; display: flex; align-items: center; justify-content: center; background: rgb(var(--a) / .14); color: rgb(var(--a)); flex-shrink: 0; }
.rmq-sr-ico svg { width: 15px; height: 15px; stroke: rgb(var(--a)) !important; }
.rmq-sr-t { flex: 1; min-width: 0; }
.rmq-sr-t b { display: block; font-size: .92rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rmq-sr-t small { color: var(--gray-a0); font-size: .76rem; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rmq-sr-hit mark { background: transparent; color: var(--teal); font-weight: 800; }
.rmq-sr-go { color: var(--gray-55); font-size: .72rem; white-space: nowrap; }
.rmq-sr-none { color: var(--gray-a0); padding: 14px; text-align: center; }
/* a filter picked through the search shows as a chip beside the box; × clears it */
.rmq-filter-chip { cursor: pointer; gap: 6px; }
.rmq-filter-chip.hidden { display: none; }
