/*
  The few things this admin needs that Platform's own stylesheet does not have.

  tqplatform.css is copied from TQPlatform.Web verbatim, as docs/design.md §7
  says to, and is not edited here — so that re-copying it when Platform's
  changes is one command and not a merge. Anything this service needs on top
  goes in this file, and should stay short: a page that needs much more than
  this is probably not using Platform's classes where it could.
*/

/* A secret shown once and never again: an enrolment code, a new password. Meant
   to be read off a screen and typed into a handheld, so it is set large, spaced,
   and in the brand tint rather than looking like body copy. */
.tq-secret {
    display: block;
    padding: 13px 16px;
    background: var(--tq-orange-tint);
    border: 1px dashed var(--tq-orange);
    border-radius: var(--radius);
    font-family: "Cascadia Mono", Consolas, ui-monospace, monospace;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--text);
    word-break: break-all;
}

/* Identifiers that are read and compared rather than prose: outlet IDs, hashes,
   organisation codes. */
.tq-mono {
    font-family: "Cascadia Mono", Consolas, ui-monospace, monospace;
    font-size: 12px;
}

/* The counts at the top of the overview. */
.tq-stat {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 15px 18px;
}

.tq-stat-n {
    font-size: 26px;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.tq-stat-l {
    font-size: 12px;
    color: var(--muted);
    margin-top: 2px;
}

/* A table that has nothing in it yet. */
.tq-empty {
    padding: 26px 16px;
    text-align: center;
    color: var(--muted);
    font-size: 13px;
}

/* The logo preview on an outlet's page, and the placeholder before there is one. */
.tq-logo-frame {
    width: 190px;
    height: 118px;
    display: grid;
    place-items: center;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    padding: 8px;
}

.tq-logo-frame.empty {
    border-style: dashed;
    color: var(--muted-2);
    font-size: 12px;
}

/* Fills the frame and scales down inside it, whatever its shape. max-width and
   max-height alone are not enough here: in a grid the row grows to the image, so a
   tall or large logo spilled out of the box instead of shrinking into it. */
.tq-logo-frame {
    overflow: hidden;
}

.tq-logo-frame img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* The preview on the handheld's sign-in background (#171717), so a white logo
   shows. A light toggle on the outlet page removes it. */
.tq-logo-frame.tq-logo-dark {
    background: #171717;
    border-color: #171717;
}

/* ── An outlet's page ──────────────────────────────────────────────────────
   A row of chips saying, at a glance, whether the outlet can trade, then its
   settings in tabs. */
.tq-status-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tq-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    background: var(--surface);
    color: var(--text-sub);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.3;
}

    .tq-chip .bi { font-size: 13px; color: var(--muted); }
    .tq-chip.ok { background: var(--tq-green-tint); border-color: var(--tq-green-tint-2); color: var(--text); }
    .tq-chip.ok .bi { color: var(--tq-green); }
    .tq-chip.warn { background: var(--tq-orange-tint); border-color: var(--tq-orange-tint-2); color: var(--text); }
    .tq-chip.warn .bi { color: var(--tq-orange); }
    .tq-chip.bad { background: var(--tq-coral-tint); border-color: var(--tq-coral-tint-2); color: var(--text); }
    .tq-chip.bad .bi { color: var(--tq-coral); }

    /* A chip that is a problem opens the tab it is fixed in. */
    button.tq-chip { cursor: pointer; }
    button.tq-chip:hover { border-color: var(--border-strong); }
    button.tq-chip.warn:hover { border-color: var(--tq-orange); }
    button.tq-chip.bad:hover { border-color: var(--tq-coral); }

/* A card header with something on its right: a count, a button. */
.tq-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    min-height: 49px;
    padding-top: 8px;
    padding-bottom: 8px;
}

    .tq-card-head form { margin: 0; }
    .tq-card-head .tq-chip { padding: 3px 10px; }

.tq-card-head-meta {
    margin-left: 8px;
    font-weight: 600;
    color: var(--muted);
}

/* What is still stopping an outlet trading: one row per step, each with the
   tab it is done in on the right. */
.tq-steps {
    list-style: none;
    margin: 0;
    padding: 0;
}

.tq-step {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 9px 20px;
    border-bottom: 1px solid var(--border);
}

    .tq-step:last-child { border-bottom: 0; }
    .tq-step .btn { flex-shrink: 0; }
    .tq-step .btn .bi { font-size: 11px; }

.tq-step-n {
    flex-shrink: 0;
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--tq-orange-tint);
    color: var(--tq-orange);
    font-size: 12px;
    font-weight: 700;
}

.tq-step-text { flex: 1; min-width: 0; }

.tq-step-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
}

.tq-step-detail {
    font-size: 12px;
    color: var(--muted);
}

.tq-step-who {
    flex-shrink: 0;
    font-size: 12px;
    font-weight: 600;
    color: var(--muted-2);
}

@media (max-width: 575.98px) {
    .tq-step { flex-wrap: wrap; align-items: flex-start; row-gap: 8px; }
    .tq-step-text { flex-basis: calc(100% - 38px); }
    .tq-step .btn, .tq-step-who { margin-left: 38px; }
}

/* An alert with its icon beside the text rather than above it. */
.tq-alert-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

    .tq-alert-row > .bi { font-size: 15px; line-height: 1.3; }
    .tq-alert-row .tq-mono { word-break: break-word; }

/* An empty state that says what is missing, not just that nothing is there. */
.card-body > .tq-empty { padding: 14px 16px 6px; }

.tq-empty-icon {
    display: block;
    margin-bottom: 6px;
    font-size: 26px;
    color: var(--muted-2);
}

.tq-empty-title {
    margin-bottom: 2px;
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
}

.tq-tabs {
    border-bottom: 1px solid var(--border);
    gap: 2px;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
}

    .tq-tabs .nav-link {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        white-space: nowrap;
        border: 0;
        border-bottom: 2px solid transparent;
        border-radius: 0;
        background: none;
        padding: 10px 14px;
        color: var(--muted);
        font-size: 13px;
        font-weight: 600;
    }

        .tq-tabs .nav-link:hover { color: var(--text); border-bottom-color: var(--border-strong); }

        .tq-tabs .nav-link.active {
            color: var(--text);
            background: none;
            border-bottom-color: var(--tq-orange);
        }

        /* A tab's count, and the dot on a tab that needs attention. */
        .tq-tab-count {
            min-width: 20px;
            padding: 1px 7px;
            border-radius: var(--radius-pill);
            background: var(--surface-2);
            border: 1px solid var(--border);
            color: var(--muted);
            font-size: 11px;
            font-weight: 700;
            text-align: center;
        }

        .tq-tabs .nav-link.active .tq-tab-count { color: var(--text); }

        .tq-tab-dot {
            width: 7px;
            height: 7px;
            border-radius: 50%;
            background: var(--tq-orange);
        }

            .tq-tab-dot.bad { background: var(--tq-coral); }

.tq-tab-content {
    padding-top: 16px;
}

/* On/off settings, each with a line underneath saying what it does. */
.tq-switches {
    display: grid;
    gap: 14px;
}

    .tq-switches .form-check { padding-left: 3em; margin: 0; }
    .tq-switches .form-check-input { margin-left: -3em; width: 2.3em; height: 1.25em; }
    .tq-switches .form-check-input:checked { background-color: var(--tq-orange); border-color: var(--tq-orange); }
    .tq-switches .form-check-label { font-size: 13px; }

/* The read-only IDs at the bottom of a card. */
.tq-card-foot {
    border-top: 1px solid var(--border);
    background: var(--surface-2);
    padding: 10px 20px;
    font-size: 12px;
    color: var(--muted);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.tq-page-foot {
    margin: 18px 0 0;
    font-size: 12px;
    color: var(--muted);
}

.tq-icon-btn {
    color: var(--muted);
    line-height: 1;
    text-decoration: none;
}

    .tq-icon-btn:hover { color: var(--tq-orange); }

/* Organisation › outlet, above a page's title. */
.tq-crumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
}

    .tq-crumbs a { color: var(--muted); text-decoration: none; }
    .tq-crumbs a:hover { color: var(--tq-orange); }
    .tq-crumbs .bi { font-size: 10px; color: var(--muted-2); }

/* An organisation's heading in a list of outlets grouped under it. */
.tq-table tr.tq-group-row td {
    background: var(--surface-2);
    border-top: 1px solid var(--border);
    padding-top: 9px;
    padding-bottom: 9px;
}

    .tq-group-row a {
        display: inline-flex;
        align-items: center;
        gap: 7px;
        font-weight: 700;
        color: var(--text);
        text-decoration: none;
    }

    .tq-group-row a:hover { color: var(--tq-orange); }
    .tq-group-row .bi { color: var(--muted); }

.tq-group-count {
    margin-left: 8px;
    font-size: 12px;
    color: var(--muted);
}

/* Sign-in and the other pages with no shell around them (_AuthLayout). Platform
   keeps these rules inline in its own _AuthLayout; they are here so that
   tqplatform.css stays a verbatim copy. */
.auth-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    position: relative;
    overflow: hidden;
}

.auth-page::before {
    content: "";
    position: fixed;
    inset: 0;
    background-image: url('/images/Platform_BG.jpg');
    background-size: cover;
    background-position: center 30%;
    background-repeat: no-repeat;
    z-index: 0;
}

.auth-page::after {
    content: "";
    position: fixed;
    inset: 0;
    background: linear-gradient(135deg, rgba(8, 10, 16, .82) 0%, rgba(18, 22, 30, .68) 100%);
    z-index: 1;
}

.auth-card,
.auth-footer {
    position: relative;
    z-index: 2;
}

.auth-card {
    width: 100%;
    max-width: 400px;
    background: rgba(255, 255, 255, .97);
    border: 1px solid rgba(255, 255, 255, .2);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 8px 48px rgba(0, 0, 0, .40), 0 2px 8px rgba(0, 0, 0, .18);
    /* Light whatever the theme, so the text and buttons stay readable over the photo. */
    color-scheme: light;
    --text: #0f1117;
    --muted: #6b7280;
    --border: #e5e7eb;
    --surface: #ffffff;
}

.auth-logo-banner {
    background: #ffffff;
    padding: 22px 32px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-logo-banner img {
    height: 52px;
    width: auto;
    display: block;
}

.auth-body {
    padding: 28px 32px 32px;
}

.auth-product-label {
    font-size: 13px;
    font-weight: 900;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--text);
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.auth-footer {
    margin-top: 20px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 0, 0, .45);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 999px;
    padding: 6px 16px;
    font-size: 13px;
    font-weight: 500;
    color: rgba(255, 255, 255, .85);
}

.auth-footer-dot {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .4);
    flex-shrink: 0;
}

/* ── Shared by the list and form pages ─────────────────────────────────────── */

/* A list page's count, search and main button on one line above its table. */
.tq-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.tq-toolbar-count {
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
}

/* A second line in a table cell: an ID under a name. */
.tq-sub {
    margin-top: 1px;
    color: var(--muted);
    font-size: 11px;
}

/* The buttons at the end of a table row or a card foot. */
.tq-row-actions {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
    align-items: center;
    margin: 0;
}

    .tq-row-actions form { margin: 0; }

/* A card foot with a note on the left and its buttons on the right. */
.tq-card-foot-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

/* ── Handhelds (support) ───────────────────────────────────────────────────
   The status list and a handheld's own page. */
.tq-nowrap { white-space: nowrap; }

a.tq-stat { display: block; color: inherit; text-decoration: none; }
a.tq-stat:hover { border-color: var(--border-strong); }
a.tq-stat.active { border-color: var(--tq-orange); box-shadow: 0 0 0 1px var(--tq-orange); }

.tq-kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; font-size: 13px; margin: 0; }
.tq-kv dt { color: var(--muted); font-weight: 500; }
.tq-kv dd { margin: 0; word-break: break-word; }

.tq-spark { width: 100%; height: 90px; display: block; }
.tq-spark .grid { stroke: var(--border); stroke-width: 1; }
.tq-spark .line { fill: none; stroke: var(--tq-green); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.tq-spark .charge { fill: var(--tq-green-tint); }
.tq-spark text { fill: var(--muted); font-size: 10px; }

/* ── A handheld's page ───────────────────────────────────────────────────────
   Tiles that answer "is it all right" at a glance, the day as a chart, a list
   of checks, then everything the handheld reported, then the remote actions. */
.tq-hh-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 16px;
}

.tq-hh-tile {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 14px 18px 16px;
    font-size: 13px;
    min-width: 0;
}

.tq-hh-tile-head {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--tq-orange);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.tq-hh-tile-main { font-size: 15px; font-weight: 700; color: var(--text); }
.tq-hh-tile-main.tq-mono { font-size: 14px; }
.tq-hh-tile-lines { min-width: 0; line-height: 1.5; }

.tq-hh-ring { width: 72px; height: 72px; flex: none; }
.tq-hh-ring circle { fill: none; stroke-width: 7; }
.tq-hh-ring .track { stroke: var(--border); }
.tq-hh-ring .fill { stroke: var(--tq-green); stroke-linecap: round; }
.tq-hh-ring.warn .fill { stroke: var(--tq-orange); }
.tq-hh-ring.bad .fill { stroke: var(--tq-coral); }
.tq-hh-ring text { font-size: 16px; font-weight: 800; fill: var(--text); font-family: Inter, sans-serif; }

.tq-hh-bars { display: inline-flex; align-items: flex-end; gap: 4px; height: 44px; flex: none; padding: 0 6px; }
.tq-hh-bars i { width: 9px; border-radius: 3px; background: var(--border); }
.tq-hh-bars.ok i.on { background: var(--tq-green); }
.tq-hh-bars.warn i.on { background: var(--tq-orange); }
.tq-hh-bars.bad i.on { background: var(--tq-coral); }

.tq-hh-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 4px; background: var(--muted); }
.tq-hh-dot.ok { background: var(--tq-green); box-shadow: 0 0 0 4px var(--tq-green-tint); }
.tq-hh-dot.bad { background: var(--tq-coral); box-shadow: 0 0 0 4px var(--tq-coral-tint); }

.tq-hh-split { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 10px; }
.tq-hh-n { font-size: 22px; font-weight: 800; line-height: 1.1; letter-spacing: -0.02em; color: var(--text); }
.tq-hh-n.bad { color: var(--tq-coral); }
.tq-hh-l { font-size: 12px; color: var(--muted); margin-top: 2px; }

.tq-hh-meter-row + .tq-hh-meter-row { margin-top: 10px; }
.tq-hh-meter { height: 8px; border-radius: 4px; background: var(--border); overflow: hidden; margin-top: 4px; }
.tq-hh-meter span { display: block; height: 100%; border-radius: 4px; background: var(--tq-gradient); }
.tq-hh-meter.warn span { background: var(--tq-coral); }

.tq-hh-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.tq-hh-stats > div { padding: 10px 14px; background: var(--bg); border-radius: var(--radius); }

.tq-hh-legend { display: inline-flex; gap: 14px; font-size: 12px; font-weight: 500; color: var(--muted); flex-wrap: wrap; }
.tq-hh-legend span { display: inline-flex; align-items: center; gap: 5px; }
.tq-hh-legend i { display: inline-block; width: 12px; height: 10px; border-radius: 2px; }
.tq-hh-legend i.line { height: 3px; background: var(--tq-green); }
.tq-hh-legend i.charge { background: var(--tq-green-tint); }
.tq-hh-legend i.sleep { background: repeating-linear-gradient(45deg, rgba(43,43,43,.10) 0 2px, transparent 2px 5px); border: 1px solid var(--border); }

.tq-hh-chart { position: relative; padding-left: 38px; }
.tq-hh-chart-plot { position: relative; height: 180px; }
.tq-hh-chart-plot svg { width: 100%; height: 100%; display: block; overflow: visible; }
.tq-hh-chart .grid { stroke: var(--border); stroke-width: 1; vector-effect: non-scaling-stroke; }
.tq-hh-chart .line { fill: none; stroke: var(--tq-green); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.tq-hh-chart .area { fill: url(#tqBatteryFill); }
.tq-hh-chart .charge { fill: var(--tq-green-tint); opacity: .7; }
.tq-hh-chart-y { position: absolute; left: 0; top: 0; height: 180px; width: 34px; }
.tq-hh-chart-y span { position: absolute; right: 0; transform: translateY(-50%); font-size: 11px; color: var(--muted); }
.tq-hh-chart-x { position: relative; height: 18px; margin-top: 4px; }
.tq-hh-chart-x span { position: absolute; transform: translateX(-50%); font-size: 11px; color: var(--muted); white-space: nowrap; }
.tq-hh-chart-x span:last-child { transform: translateX(-100%); }
.tq-hh-chart-guide { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--text-sub); opacity: .4; pointer-events: none; }
.tq-hh-chart-tip {
    position: absolute; top: -6px; transform: translate(-50%, -100%);
    background: var(--tq-grey); color: #fff; font-size: 12px; line-height: 1.4;
    padding: 6px 10px; border-radius: 6px; white-space: nowrap; pointer-events: none;
}
.tq-hh-signal { position: relative; height: 8px; margin-top: 8px; border-radius: 4px; background: var(--bg); overflow: hidden; }
.tq-hh-signal i { position: absolute; top: 0; bottom: 0; }
.tq-hh-signal .s4 { background: var(--tq-green); }
.tq-hh-signal .s3 { background: var(--tq-green-tint-2); }
.tq-hh-signal .s2 { background: var(--tq-orange-tint-2); }
.tq-hh-signal .s1 { background: var(--tq-orange); }
.tq-hh-signal .s0 { background: var(--tq-coral); }

.tq-hh-checks { list-style: none; margin: 0; padding: 4px 0; }
.tq-hh-checks li { display: flex; align-items: center; gap: 12px; padding: 9px 20px; font-size: 13px; }
.tq-hh-checks li + li { border-top: 1px solid var(--border); }
.tq-hh-check-icon {
    width: 30px; height: 30px; flex: none; border-radius: 8px;
    display: grid; place-items: center; font-size: 15px;
    background: var(--tq-green-tint); color: var(--tq-green);
}
.tq-hh-checks li.warn .tq-hh-check-icon { background: var(--tq-orange-tint); color: var(--tq-orange); }
.tq-hh-checks li.bad .tq-hh-check-icon { background: var(--tq-coral-tint); color: var(--tq-coral); }
.tq-hh-check-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.35; }
.tq-hh-check-text span { color: var(--muted); font-size: 12px; }
.tq-hh-check-mark { font-size: 15px; color: var(--tq-green); }
.tq-hh-checks li.warn .tq-hh-check-mark { color: var(--tq-orange); }
.tq-hh-checks li.bad .tq-hh-check-mark { color: var(--tq-coral); }

.tq-hh-subhead { font-size: 12px; font-weight: 700; color: var(--text); margin: 16px 0 6px; padding-top: 12px; border-top: 1px solid var(--border); }
.tq-hh-subhead span { font-weight: 500; color: var(--muted); }
.tq-hh-apps { list-style: none; margin: 0; padding: 0; font-size: 13px; }
.tq-hh-apps li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 8px; padding: 3px 0; }

.tq-copy {
    border: 0; background: none; padding: 0 0 0 6px; color: var(--muted);
    font-size: 12px; line-height: 1; vertical-align: baseline; cursor: pointer;
}
.tq-copy:hover { color: var(--tq-orange); }

.tq-hh-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.tq-hh-action { border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; font-size: 13px; display: flex; flex-direction: column; }
.tq-hh-action > form, .tq-hh-action > .tq-hh-action-form { margin-top: auto; }
.tq-hh-action-head { display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 700; margin-bottom: 14px; color: var(--text); }
.tq-hh-action-icon {
    width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center;
    background: var(--tq-orange-tint); color: var(--tq-orange); font-size: 16px;
}
.tq-hh-action-form { display: flex; gap: 8px; }
.tq-hh-pending { color: var(--text-sub); margin-bottom: 12px; }
.tq-hh-pending .bi { color: var(--tq-orange); }
.tq-hh-action-desc { color: var(--text-sub); line-height: 1.5; margin: -4px 0 14px; }

@media (max-width: 767.98px) {
    .tq-hh-stats { grid-template-columns: repeat(2, 1fr); }
    .tq-hh-chart-plot, .tq-hh-chart-y { height: 140px; }
    .tq-hh-legend { display: none; }
}

/* ── Dashboard pieces shared by every page ─────────────────────────────────
   The handheld page's look (tiles with an orange label, rings, meters, a list
   of checks with tinted icons, chips) as classes any page can use. The .tq-hh-*
   rules above are the handheld page's own copies of the same and can move onto
   these. Drawn by Admin/Ui.cs where the markup has logic in it. */

/* The row of chips on the left and buttons on the right, above a page's tiles. */
.tq-page-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

    .tq-page-bar > .tq-page-bar-actions { margin-left: auto; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
    .tq-page-bar form { margin: 0; }

/* Tiles: a heading in orange capitals, then a number, ring or meter. */
.tq-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.tq-tile {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 14px 18px 16px;
    font-size: 13px;
    min-width: 0;
    color: var(--text);
}

a.tq-tile, button.tq-tile { display: block; text-align: left; text-decoration: none; width: 100%; transition: border-color .15s, box-shadow .15s; }
button.tq-tile { font: inherit; display: flex; flex-direction: column; justify-content: flex-start; }
a.tq-tile:hover, button.tq-tile:hover { color: var(--text); border-color: var(--border-strong); box-shadow: var(--shadow); }
a.tq-tile.active, button.tq-tile.active { border-color: var(--tq-orange); box-shadow: 0 0 0 1px var(--tq-orange); }

.tq-tile-head {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 10px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--tq-orange);
}

.tq-tile-body { display: flex; align-items: center; gap: 16px; min-width: 0; }
.tq-tile-lines { min-width: 0; line-height: 1.5; color: var(--text-sub); }
.tq-tile-main { font-size: 15px; font-weight: 700; color: var(--text); }

/* A big number and what it counts. */
.tq-n { font-size: 26px; font-weight: 800; line-height: 1.1; letter-spacing: -0.02em; color: var(--text); }
.tq-n.ok { color: var(--tq-green); }
.tq-n.warn { color: var(--tq-orange); }
.tq-n.bad { color: var(--tq-coral); }
.tq-n small { font-size: 14px; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.tq-l { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* Two or three small counts side by side under a tile's main line. */
.tq-split { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 12px; margin-top: 12px; }
.tq-split .tq-n { font-size: 20px; }

/* A ring: how much of something is done or full. */
.tq-ring { width: 64px; height: 64px; flex: none; }
.tq-ring circle { fill: none; stroke-width: 7; }
.tq-ring .track { stroke: var(--border); }
.tq-ring .fill { stroke: var(--tq-green); stroke-linecap: round; }
.tq-ring.warn .fill { stroke: var(--tq-orange); }
.tq-ring.bad .fill { stroke: var(--tq-coral); }
.tq-ring text { font-size: 15px; font-weight: 800; fill: var(--text); font-family: Inter, sans-serif; }

/* A bar: how full. The brand gradient unless it is a warning. */
.tq-meter { height: 8px; border-radius: 4px; background: var(--border); overflow: hidden; }
.tq-meter > span { display: block; height: 100%; border-radius: 4px; background: var(--tq-gradient); }
.tq-meter.ok > span { background: var(--tq-green); }
.tq-meter.warn > span { background: var(--tq-orange); }
.tq-meter.bad > span { background: var(--tq-coral); }
.tq-meter-row + .tq-meter-row { margin-top: 10px; }
.tq-meter-row .tq-meter { margin-top: 4px; }
.tq-meter-label { display: flex; justify-content: space-between; gap: 8px; }
.tq-meter-label span:last-child { color: var(--muted); }

/* A short meter beside a number in a table cell. */
.tq-mini { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.tq-mini .tq-meter { width: 52px; height: 6px; }

/* Signal bars. */
.tq-bars { display: inline-flex; align-items: flex-end; gap: 2px; height: 12px; vertical-align: -1px; }
.tq-bars i { width: 3px; border-radius: 1px; background: var(--border-strong); }
.tq-bars.ok i.on { background: var(--tq-green); }
.tq-bars.warn i.on { background: var(--tq-orange); }
.tq-bars.bad i.on { background: var(--tq-coral); }

/* A status dot with a soft halo. */
.tq-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; background: var(--muted-2); vertical-align: 1px; }
.tq-dot.ok { background: var(--tq-green); box-shadow: 0 0 0 3px var(--tq-green-tint); }
.tq-dot.warn { background: var(--tq-orange); box-shadow: 0 0 0 3px var(--tq-orange-tint); }
.tq-dot.bad { background: var(--tq-coral); box-shadow: 0 0 0 3px var(--tq-coral-tint); }

/* A tinted square holding an icon: the start of a check, a table row, a card. */
.tq-ico {
    width: 30px; height: 30px; flex: none; border-radius: 8px;
    display: inline-grid; place-items: center; font-size: 15px; font-style: normal;
    background: var(--tq-orange-tint); color: var(--tq-orange);
}
.tq-ico.ok { background: var(--tq-green-tint); color: var(--tq-green); }
.tq-ico.warn { background: var(--tq-orange-tint); color: var(--tq-orange); }
.tq-ico.bad { background: var(--tq-coral-tint); color: var(--tq-coral); }
.tq-ico.muted { background: var(--panel); color: var(--muted); }
.tq-ico.round { border-radius: 50%; font-size: 12px; font-weight: 800; }
.tq-ico.lg { width: 36px; height: 36px; font-size: 17px; }

/* A name with its icon and a second line, in a table cell. */
.tq-who { display: flex; align-items: center; gap: 11px; min-width: 0; }
.tq-who > div { min-width: 0; }
.tq-who a, .tq-who strong { font-weight: 600; color: var(--text); }
.tq-who a:hover { color: var(--tq-orange); }

/* The list of checks: icon, what, detail, and a tick or a warning. Rows can be links. */
.tq-checks { list-style: none; margin: 0; padding: 4px 0; }
.tq-checks > li + li { border-top: 1px solid var(--border); }
.tq-checks > li > .tq-check { display: flex; align-items: center; gap: 12px; padding: 9px 20px; font-size: 13px; color: var(--text); text-decoration: none; }
.tq-checks > li > a.tq-check:hover { background: var(--surface-2); }
.tq-check-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.35; }
.tq-check-text > span { color: var(--muted); font-size: 12px; }
.tq-check-mark { font-size: 15px; color: var(--tq-green); }
.tq-check-mark.warn { color: var(--tq-orange); }
.tq-check-mark.bad { color: var(--tq-coral); }
.tq-check-more { padding: 9px 20px; font-size: 12px; color: var(--muted); }

/* A card header with an icon: "<i> Outlets", and a count or link on the right. */
.card-header > .bi:first-child, .tq-card-head > span > .bi:first-child { color: var(--muted); margin-right: 6px; }

/* A chip small enough for a table cell. */
.tq-chip.sm { padding: 2px 9px; font-size: 11px; gap: 5px; }
.tq-chip.sm .bi { font-size: 11px; }

/* A table whose rows open something. */
.tq-table tr[data-href] { cursor: pointer; }

@media (max-width: 767.98px) {
    .tq-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .tq-tile { padding: 12px 14px; }
    .tq-tile-body { gap: 10px; flex-wrap: wrap; }
    .tq-ring { width: 52px; height: 52px; }
    .tq-n { font-size: 22px; }
    .tq-page-bar > .tq-page-bar-actions { margin-left: 0; }
}

/* A long ID under a name stays on one line, cut short, with the whole of it in the title. */
.tq-who .tq-sub.tq-mono { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 240px; }
