/* ============================================================================
   Singaf portal — 2026 refresh
   Loaded after the SmartAdmin bundles, so everything here is an override.
   One flat light canvas, white rounded cards, a pill sidebar and a lot of
   white space; colour is kept for the things that carry meaning (money up
   or down, a status, a warning).
   Written by hand: the host has no build step, so no Sass/PostCSS pass.
   ========================================================================= */

:root {
    --sg-canvas: #f1f1f1;
    --sg-surface: #ffffff;
    --sg-surface-2: #f7f7f8;
    --sg-line: #ececee;

    --sg-ink: #16181c;
    --sg-ink-2: #5b6068;
    --sg-ink-3: #9a9fa8;

    --sg-green: #35c47c;
    --sg-green-soft: #e8faf0;
    --sg-green-ink: #1a8f56;
    --sg-red: #f5573f;
    --sg-red-soft: #ffeeeb;
    --sg-amber: #f5a623;
    --sg-amber-soft: #fff5e4;
    --sg-blue: #2f7df6;
    --sg-blue-soft: #eaf1fe;

    --sg-r: 16px;
    --sg-r-lg: 22px;
    --sg-shadow: 0 1px 2px rgba(20, 24, 28, .04), 0 8px 24px -14px rgba(20, 24, 28, .16);
    --sg-shadow-lift: 0 2px 6px rgba(20, 24, 28, .06), 0 18px 36px -20px rgba(20, 24, 28, .28);
}

/* The theme's purple, at the source.
 *
 * SmartAdmin paints its sidebar icons, chevrons and accents from a
 * `--theme-primary` ramp, through selectors carrying three mod-classes that
 * outrank anything written here. Rather than chase each rule, the ramp itself
 * is redefined as the neutral scale this design uses, and every one of those
 * rules turns at once.
 */
:root {
    --theme-primary: #5b6068;
    --theme-primary-50: #f1f1f1;
    --theme-primary-100: #e6e7e9;
    --theme-primary-200: #d3d5d9;
    --theme-primary-300: #b8bcc2;
    --theme-primary-400: #9a9fa8;
    --theme-primary-500: #5b6068;
    --theme-primary-600: #41464e;
    --theme-primary-700: #2b2f35;
    --theme-primary-800: #202329;
    --theme-primary-900: #16181c;
}

/* Links are the one purple the theme writes literally, as `html body a`.
   A link wearing a button keeps the button's colours. */
html body a:not(.btn) { color: var(--sg-ink); }
html body a:not(.btn):hover, html body a:not(.btn):focus { color: var(--sg-green-ink); }

/* The rest of the theme's ramp, pointed at this palette, so a status colour
   means the same thing wherever it is drawn. */
:root {
    --theme-success: #35c47c;
    --theme-success-500: #35c47c;
    --theme-success-700: #1a8f56;
    --theme-danger: #f5573f;
    --theme-danger-500: #f5573f;
    --theme-danger-700: #c6341f;
    --theme-warning: #f5a623;
    --theme-warning-500: #f5a623;
    --theme-warning-700: #9a6200;
    --theme-info: #2f7df6;
    --theme-info-500: #2f7df6;
    --theme-info-700: #1a5fd0;
}

/* The chevrons the theme draws beside a branch and in the header, and the
   account icon: all still the old purple, each from its own literal. */
html body .page-sidebar .collapse-sign,
html body .page-sidebar .collapse-sign em,
html body .page-sidebar .nav-menu li a .collapse-sign em { color: var(--sg-ink-3); }

html body .page-header .fal,
html body .page-header .far,
html body .page-header .fab,
html body .page-header .ni { color: var(--sg-ink-2); }

/* The account icon is drawn by a rule of the theme's own shape, which
   outranks the header rule above. */
html body .header-icon:not(.btn) > [class*="fa-"]:first-child { color: var(--sg-ink-2); }

/* Bootstrap writes these with !important, so they are answered in kind. */
html body .text-primary { color: var(--sg-ink-2) !important; }
html body .text-success { color: var(--sg-green-ink) !important; }
html body .text-danger { color: #c6341f !important; }
html body .text-warning { color: #9a6200 !important; }
html body .text-info { color: #1a5fd0 !important; }

html body [class*="color-primary-"] { color: var(--sg-ink-2); }

/* ── canvas ──────────────────────────────────────────────────────────────── */

/* `html body` because that is the shape the theme uses, and the sign-in
   pages do not load the skin that would otherwise correct it. */
html body, .page-wrapper, .page-content, .page-content-wrapper {
    background: var(--sg-canvas);
}

body {
    color: var(--sg-ink);
    -webkit-font-smoothing: antialiased;
}

.page-content { padding: 18px 20px 40px; }

@media (min-width: 992px) {
    .page-content { padding: 22px 26px 48px; }
}

/* ── sidebar ─────────────────────────────────────────────────────────────── */

.page-sidebar {
    background: var(--sg-surface);
    box-shadow: none;
    border-right: 1px solid var(--sg-line);
}

/* The Arabic pages carry no dir attribute — the RTL bundle turns the page
   round on its own, so lang is the hook that is actually there. */
html[lang="ar"] .page-sidebar { border-right: 0; border-left: 1px solid var(--sg-line); }

.page-sidebar .page-logo {
    background: var(--sg-surface);
    box-shadow: none;
    border-bottom: 1px solid var(--sg-line);
    height: 66px;
}

.page-logo-text { color: var(--sg-ink); font-weight: 700; letter-spacing: -.01em; }

.page-sidebar .primary-nav { padding: 10px 12px 28px; }

.page-sidebar .nav-menu li a {
    color: var(--sg-ink-2);
    border-radius: 12px;
    padding: 10px 12px;
    font-weight: 500;
    font-size: 14px;
    transition: background-color .15s, color .15s;
}

.page-sidebar .nav-menu li a > [class*='fa-'],
.page-sidebar .nav-menu li a > .ni {
    color: var(--sg-ink-3);
    width: 22px;
    font-size: 16px;
    transition: color .15s;
}

.page-sidebar .nav-menu li a:hover {
    background: var(--sg-surface-2);
    color: var(--sg-ink);
}

.page-sidebar .nav-menu li a:hover > [class*='fa-'] { color: var(--sg-ink-2); }

.page-sidebar .nav-menu li.active > a,
.page-sidebar .nav-menu li.active > a:hover {
    background: var(--sg-surface-2);
    color: var(--sg-ink);
    font-weight: 600;
    box-shadow: inset 0 0 0 1px var(--sg-line);
}

.page-sidebar .nav-menu li.active > a > [class*='fa-'] { color: var(--sg-ink); }

/* The little dot SmartAdmin puts on the open branch: keep it, make it green. */
.page-sidebar .nav-menu li.active > a:before,
.page-sidebar .nav-menu li.active > a:after { color: var(--sg-green); }

/* A branch that is open says so with its label, not with a slab behind it —
   the children below are the thing to read. */
.page-sidebar .nav-menu > li.open > a,
.page-sidebar .nav-menu > li.open > a:hover,
.page-sidebar .nav-menu > li.active.open > a,
.page-sidebar .nav-menu > li.active.open > a:hover {
    background: transparent;
    box-shadow: none;
    color: var(--sg-ink);
    font-weight: 600;
}

.page-sidebar .nav-menu > li.open > a > [class*='fa-'] { color: var(--sg-ink); }

.page-sidebar .nav-menu > li > a > .collapse-sign { opacity: .55; font-size: 11px; }

/* Sub-menus read as a quiet indented list: no band behind them, and the
   theme's purple speck beside every child gives way to a plain indent. */
.page-sidebar .nav-menu li ul {
    background: transparent !important;
    padding: 2px 0 6px;
}

.page-sidebar .nav-menu li ul li a {
    font-size: 13.5px;
    font-weight: 500;
    padding: 8px 12px;
    padding-inline-start: 34px;
    border-radius: 10px;
    color: var(--sg-ink-2);
}

.page-sidebar .nav-menu li ul li a::after,
.page-sidebar .nav-menu li ul li a::before { display: none !important; }

.page-sidebar .nav-menu li ul li a:hover { background: var(--sg-surface-2); color: var(--sg-ink); }

.page-sidebar .nav-menu li ul li.active > a,
.page-sidebar .nav-menu li ul li.active > a:hover {
    background: var(--sg-surface-2);
    color: var(--sg-ink);
    font-weight: 600;
}

/* The child you are on keeps one mark: a green edge on its pill. The theme's
   own dot is drawn by a rule too specific to move, so it goes rather than
   fights. */
.page-sidebar .nav-menu li ul li.active > a { box-shadow: inset 3px 0 0 var(--sg-green); }

html[lang="ar"] .page-sidebar .nav-menu li ul li.active > a { box-shadow: inset -3px 0 0 var(--sg-green); }

.page-sidebar .nav-title,
.page-sidebar .nav-menu li.nav-title {
    color: var(--sg-ink-3);
    font-size: 10.5px;
    letter-spacing: .08em;
    text-transform: uppercase;
    font-weight: 600;
    padding: 18px 14px 6px;
}

.page-sidebar .nav-filter { padding: 10px 12px 4px; }

.page-sidebar .nav-filter input {
    background: var(--sg-surface-2);
    border: 1px solid transparent;
    border-radius: 12px;
    height: 38px;
    font-size: 13.5px;
    color: var(--sg-ink);
}

.page-sidebar .nav-filter input:focus {
    background: var(--sg-surface);
    border-color: var(--sg-line);
    box-shadow: 0 0 0 3px rgba(53, 196, 124, .14);
}

.nav-footer, .page-sidebar .info-card { display: none; }

/* ── header ──────────────────────────────────────────────────────────────── */

.page-header {
    background: var(--sg-surface);
    border-bottom: 1px solid var(--sg-line);
    box-shadow: none;
    height: 66px;
    padding-inline: 18px;
}

.page-header .header-icon:not(.btn),
.page-header .btn-header > span > a {
    color: var(--sg-ink-2);
    border-radius: 12px;
}

.page-header .header-icon:not(.btn):hover { color: var(--sg-ink); background: var(--sg-surface-2); }

/* ── page heading ────────────────────────────────────────────────────────── */

.subheader {
    margin-bottom: 18px;
    align-items: flex-start;
}

.subheader-title {
    color: var(--sg-ink);
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -.02em;
    line-height: 1.2;
}

.subheader-title .fw-300, .subheader-title .fw-400 { font-weight: 700 !important; }

.subheader-title small {
    display: block;
    margin-top: 6px;
    font-size: 13.5px;
    font-weight: 400;
    color: var(--sg-ink-2);
    letter-spacing: 0;
}

.subheader-icon { display: none; }

.breadcrumb.page-breadcrumb {
    background: transparent;
    padding: 0 0 10px;
    font-size: 12.5px;
}

.breadcrumb.page-breadcrumb .breadcrumb-item,
.breadcrumb.page-breadcrumb a { color: var(--sg-ink-3); }

.breadcrumb.page-breadcrumb .breadcrumb-item.active { color: var(--sg-ink-2); }

/* ── cards & panels ──────────────────────────────────────────────────────── */

.card, .panel {
    background: var(--sg-surface);
    border: 0;
    border-radius: var(--sg-r-lg);
    box-shadow: var(--sg-shadow);
}

.panel { margin-bottom: 20px; }

.panel-hdr {
    background: transparent;
    border-bottom: 1px solid var(--sg-line);
    border-radius: var(--sg-r-lg) var(--sg-r-lg) 0 0;
    min-height: 58px;
    padding-inline: 20px;
}

.panel-hdr > h2 {
    color: var(--sg-ink);
    font-size: 16px;
    font-weight: 600;
    letter-spacing: -.01em;
    text-transform: none;
}

.panel-content, .card-body { padding: 20px; }

.panel-toolbar .btn { color: var(--sg-ink-3); }

/* A card that is a link should say so when the pointer is on it. */
a.card { transition: transform .15s, box-shadow .15s; }
a.card:hover { transform: translateY(-2px); box-shadow: var(--sg-shadow-lift); text-decoration: none; }

/* ── buttons ─────────────────────────────────────────────────────────────── */

.btn {
    border-radius: 12px;
    font-weight: 600;
    font-size: 13.5px;
    padding: 9px 18px;
    transition: background-color .15s, color .15s, box-shadow .15s, transform .15s;
}

.btn:active { transform: translateY(1px); }

.btn-sm { padding: 6px 12px; font-size: 12.5px; border-radius: 10px; }
.btn-xs { padding: 3px 9px; font-size: 11.5px; border-radius: 8px; }
.btn-lg { padding: 12px 24px; font-size: 15px; border-radius: 14px; }

.btn-primary, .btn-success {
    background: var(--sg-ink);
    border-color: var(--sg-ink);
    color: #fff;
}

.btn-primary:hover, .btn-primary:focus, .btn-primary:not(:disabled):not(.disabled):active,
.btn-success:hover, .btn-success:focus, .btn-success:not(:disabled):not(.disabled):active {
    background: #000;
    border-color: #000;
    color: #fff;
    box-shadow: 0 8px 20px -12px rgba(0, 0, 0, .6);
}

.btn-outline-primary, .btn-outline-default, .btn-outline-secondary {
    background: var(--sg-surface);
    border: 1px solid var(--sg-line);
    color: var(--sg-ink-2);
}

.btn-outline-primary:hover, .btn-outline-default:hover, .btn-outline-secondary:hover {
    background: var(--sg-surface-2);
    border-color: var(--sg-line);
    color: var(--sg-ink);
}

.btn-outline-danger { border-radius: 12px; }

.btn-info { background: var(--sg-ink); border-color: var(--sg-ink); }
.btn-info:hover, .btn-info:focus { background: #000; border-color: #000; }

/* ── form controls ───────────────────────────────────────────────────────── */

.form-control, .custom-select, .select2-container--bootstrap4 .select2-selection {
    border-radius: 12px;
    border-color: var(--sg-line);
    color: var(--sg-ink);
    min-height: 40px;
    font-size: 13.5px;
}

.form-control:focus, .custom-select:focus {
    border-color: #cfd3d8;
    box-shadow: 0 0 0 3px rgba(53, 196, 124, .14);
}

.form-control-sm { min-height: 32px; border-radius: 10px; }

.form-label, label { color: var(--sg-ink-2); font-weight: 500; font-size: 13px; }

.bootstrap-select > .btn.dropdown-toggle {
    border-radius: 12px !important;
    border-color: var(--sg-line);
    background: var(--sg-surface);
    color: var(--sg-ink);
    min-height: 40px;
}

.input-group > .form-control:not(:last-child),
.input-group > .custom-select:not(:last-child) { border-start-end-radius: 0; border-end-end-radius: 0; }

.input-group > .form-control:not(:first-child),
.input-group > .custom-select:not(:first-child) { border-start-start-radius: 0; border-end-start-radius: 0; }

/* ── tables ──────────────────────────────────────────────────────────────── */

.table { color: var(--sg-ink); font-size: 13.5px; }

.table thead th {
    background: transparent;
    border-top: 0;
    border-bottom: 1px solid var(--sg-line);
    color: var(--sg-ink-3);
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
    padding: 10px 12px;
    white-space: nowrap;
}

.table td { border-top: 1px solid var(--sg-line); padding: 12px; vertical-align: middle; }

.table.table-bordered, .table.table-bordered td, .table.table-bordered th { border-left: 0; border-right: 0; }

.table-striped tbody tr:nth-of-type(odd) { background: transparent; }
.table-hover tbody tr:hover, .table-striped tbody tr:hover { background: var(--sg-surface-2); }

.dataTables_wrapper .dataTables_filter input { border-radius: 12px; }

.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
    background: var(--sg-ink) !important;
    border-color: var(--sg-ink) !important;
    border-radius: 9px;
    color: #fff !important;
}

/* Some of the lists render their pager as Bootstrap page items instead, and
   those carry the theme's purple. */
.pagination { gap: 2px; }
.pagination .page-link {
    background: transparent;
    border: 0;
    border-radius: 9px;
    color: var(--sg-ink-2);
    font-size: 13px;
    padding: 6px 12px;
}
.pagination .page-link:hover { background: var(--sg-surface-2); color: var(--sg-ink); }
.pagination .page-item.active .page-link,
.pagination .page-item.active .page-link:hover { background: var(--sg-ink); color: #fff; }
.pagination .page-item.disabled .page-link { color: var(--sg-ink-3); }

/* The theme decorates a summary tile with a 6rem glyph in its corner. On a
   white card that reads as a smudge, so it stays as a hint and no more. */
i.position-absolute.pos-right.pos-bottom {
    font-size: 3.6rem !important;
    opacity: .05 !important;
    color: var(--sg-ink);
}

/* ── badges ──────────────────────────────────────────────────────────────── */

.badge {
    border-radius: 999px;
    font-weight: 600;
    font-size: 11.5px;
    padding: 5px 10px;
    letter-spacing: .01em;
}

.badge-success { background: var(--sg-green-soft); color: var(--sg-green-ink); }
.badge-danger { background: var(--sg-red-soft); color: #c6341f; }
.badge-warning { background: var(--sg-amber-soft); color: #9a6200; }
.badge-primary { background: var(--sg-blue-soft); color: #1a5fd0; }
.badge-secondary, .badge-light { background: var(--sg-surface-2); color: var(--sg-ink-2); }

/* ── alerts ──────────────────────────────────────────────────────────────── */

.alert {
    border: 0;
    border-radius: var(--sg-r);
    font-size: 13.5px;
    padding: 14px 16px;
}

.alert-warning { background: var(--sg-amber-soft); color: #7a4e00; }
.alert-danger { background: var(--sg-red-soft); color: #a52b19; }
.alert-success { background: var(--sg-green-soft); color: var(--sg-green-ink); }
.alert a { color: inherit; text-decoration: underline; }

/* ── modals & popovers ───────────────────────────────────────────────────── */

.modal-content { border: 0; border-radius: var(--sg-r-lg); box-shadow: var(--sg-shadow-lift); }
.modal-header { border-bottom: 1px solid var(--sg-line); padding: 18px 20px; }
.modal-header .modal-title { font-weight: 600; color: var(--sg-ink); }
.modal-footer { border-top: 1px solid var(--sg-line); padding: 14px 20px; }
.dropdown-menu { border: 0; border-radius: var(--sg-r); box-shadow: var(--sg-shadow-lift); padding: 6px; }
.dropdown-item { border-radius: 10px; font-size: 13.5px; padding: 9px 12px; }
.dropdown-item:hover, .dropdown-item:focus { background: var(--sg-surface-2); color: var(--sg-ink); }
.dropdown-item.active, .dropdown-item:active { background: var(--sg-surface-2); color: var(--sg-ink); font-weight: 600; }

/* ============================================================================
   Dashboard
   ========================================================================= */

.sg-grid { display: grid; gap: 20px; }

@media (min-width: 1200px) {
    .sg-dash { grid-template-columns: minmax(0, 1fr) 360px; align-items: start; }
}

.sg-card {
    background: var(--sg-surface);
    border-radius: var(--sg-r-lg);
    box-shadow: var(--sg-shadow);
    padding: 20px;
}

.sg-card-hd {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.sg-card-hd h2 {
    font-size: 16px;
    font-weight: 600;
    color: var(--sg-ink);
    margin: 0;
    letter-spacing: -.01em;
    flex: 1 1 auto;
}

.sg-card-hd .sg-link { font-size: 13px; font-weight: 500; color: var(--sg-ink-3); }
.sg-card-hd .sg-link:hover { color: var(--sg-ink); text-decoration: none; }

/* The stat tiles inside the overview card. */
.sg-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

@media (min-width: 768px) { .sg-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* Queue tiles carry a sentence, so they get room: two across a tablet and a
   narrow desktop column, four only when there is really space. */
.sg-queues { grid-template-columns: repeat(1, minmax(0, 1fr)); }

@media (min-width: 576px) { .sg-queues { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1600px) { .sg-queues { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.sg-stat {
    background: var(--sg-surface-2);
    border-radius: var(--sg-r);
    padding: 16px;
    display: block;
    color: inherit;
    transition: background-color .15s, box-shadow .15s, transform .15s;
}

a.sg-stat:hover {
    background: var(--sg-surface);
    box-shadow: var(--sg-shadow);
    transform: translateY(-2px);
    text-decoration: none;
    color: inherit;
}

.sg-stat-top {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--sg-ink-2);
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 10px;
}

.sg-stat-top i { color: var(--sg-ink-3); font-size: 15px; }

.sg-stat-num {
    font-size: 30px;
    font-weight: 700;
    letter-spacing: -.03em;
    line-height: 1.1;
    color: var(--sg-ink);
    display: block;
}

@media (min-width: 1400px) { .sg-stat-num { font-size: 34px; } }

.sg-stat-sub { font-size: 12px; color: var(--sg-ink-3); margin-top: 6px; display: block; }

/* The green/red "vs last month" pill. */
.sg-trend {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border-radius: 999px;
    padding: 3px 9px;
    font-size: 11.5px;
    font-weight: 600;
    vertical-align: middle;
}

.sg-trend.up { background: var(--sg-green-soft); color: var(--sg-green-ink); }
.sg-trend.down { background: var(--sg-red-soft); color: #c6341f; }
.sg-trend.flat { background: var(--sg-surface-2); color: var(--sg-ink-2); }

/* A queue tile: one number and what it is waiting for. */
.sg-queue {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border-radius: var(--sg-r);
    background: var(--sg-surface-2);
    color: inherit;
    transition: background-color .15s, transform .15s, box-shadow .15s;
}

a.sg-queue:hover { background: var(--sg-surface); box-shadow: var(--sg-shadow); transform: translateY(-2px); text-decoration: none; color: inherit; }

.sg-queue-num { font-size: 22px; font-weight: 700; letter-spacing: -.02em; min-width: 42px; }
.sg-queue-label { font-size: 13px; color: var(--sg-ink-2); font-weight: 500; line-height: 1.35; }

.sg-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.sg-dot.green { background: var(--sg-green); }
.sg-dot.amber { background: var(--sg-amber); }
.sg-dot.red { background: var(--sg-red); }
.sg-dot.blue { background: var(--sg-blue); }
.sg-dot.grey { background: var(--sg-ink-3); }

/* A plain row list: recent orders, top stores, low stock. */
.sg-list { display: flex; flex-direction: column; }

.sg-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 0;
    border-bottom: 1px solid var(--sg-line);
    font-size: 13.5px;
}

.sg-row:last-child { border-bottom: 0; }
.sg-row-main { flex: 1 1 auto; min-width: 0; }
.sg-row-title { color: var(--sg-ink); font-weight: 500; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sg-row-sub { color: var(--sg-ink-3); font-size: 12px; }
.sg-row-end { text-align: end; white-space: nowrap; }
.sg-row-amount { font-weight: 600; color: var(--sg-ink); display: block; }

.sg-thumb {
    width: 38px; height: 38px; border-radius: 12px; flex: none;
    background: var(--sg-surface-2);
    display: grid; place-items: center;
    color: var(--sg-ink-3); font-weight: 600; font-size: 13px;
    overflow: hidden;
}

.sg-thumb img { width: 100%; height: 100%; object-fit: cover; }

.sg-empty { color: var(--sg-ink-3); font-size: 13px; padding: 18px 0; text-align: center; }

/* The welcome line above it all. */
.sg-hello { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.sg-hello h1 { font-size: 26px; font-weight: 700; letter-spacing: -.02em; margin: 0; color: var(--sg-ink); }
.sg-hello h1 span { color: var(--sg-ink-3); font-weight: 500; }
.sg-hello p { margin: 4px 0 0; color: var(--sg-ink-2); font-size: 13.5px; }
.sg-hello-actions { margin-inline-start: auto; display: flex; gap: 8px; flex-wrap: wrap; }

/* Charts sit flush inside their card. */
.sg-chart { width: 100%; height: 240px; }

/* Numbers stay LTR in the Arabic view. */
.sg-stat-num, .sg-queue-num, .sg-row-amount, .sg-trend { direction: ltr; unicode-bidi: isolate; }

/* The theme's mobile menu button is a magenta gradient slab, and the account
   panel opens under a blue-to-purple banner. Neither belongs on a white
   header. */
.page-header .header-btn[data-class="mobile-nav-on"],
.page-header .header-btn[data-class="mobile-nav-on"]:hover,
.page-header .header-btn[data-class="mobile-nav-on"]:focus {
    background-color: var(--sg-surface-2);
    background-image: none;
    border-color: var(--sg-line);
    border-radius: 12px;
    color: var(--sg-ink);
    box-shadow: none;
}

.dropdown-menu .dropdown-header.bg-trans-gradient {
    background-image: none;
    background-color: var(--sg-ink);
}

/* ── phones ──────────────────────────────────────────────────────────────── */

/* Everything below the widest phone in portrait. A 440pt screen still gets
   two stat tiles to a row; one per row wastes the width. */
@media (max-width: 767.98px) {
    .page-content { padding: 14px 12px 32px; }
    .sg-card { padding: 16px; border-radius: var(--sg-r); }
    .sg-grid { gap: 14px; }
    .sg-stats { gap: 10px; }
    .sg-stat { padding: 14px; }
    .sg-stat-num { font-size: 26px; }
    .subheader-title { font-size: 22px; }

    /* The greeting keeps the full width, and its actions sit under it rather
       than squeezing the name into a column. */
    .sg-hello { align-items: flex-start; gap: 12px; margin-bottom: 14px; }
    .sg-hello h1 { font-size: 22px; }
    .sg-hello-actions { margin-inline-start: 0; width: 100%; gap: 8px; }
    .sg-hello-actions .btn { flex: 0 1 auto; justify-content: center; }

    /* The queue label reads straight after its number. */
    .sg-queue { padding: 12px 14px; gap: 10px; }
    .sg-queue-num { font-size: 20px; min-width: 30px; }
    .sg-queue-label { font-size: 12.5px; }

    /* A list that has to fit a phone: nothing spare in it. */
    .sg-card-hd { margin-bottom: 12px; }
    .sg-card-hd h2 { font-size: 15px; }
    .sg-chart { height: 200px; }
    .table { font-size: 12.5px; }
    .table td { padding: 10px 8px; }
    .table thead th { padding: 8px; font-size: 10.5px; }

    /* The alert banners stack their own way; keep them off the edges. */
    .alert { padding: 12px 14px; font-size: 13px; }

    /* A toolbar button that wraps its label onto three lines is taller than
       the row it sits in. */
    .btn-sm { white-space: nowrap; font-size: 12px; padding: 7px 10px; }

    /* The list toolbar is a single nowrap row, so its last control hangs off
       the card. Let it wrap onto a second line instead. */
    .panel-hdr .panel-toolbar,
    .panel-hdr .panel-toolbar > div,
    .panel-hdr .panel-toolbar .d-inline-flex { flex-wrap: wrap; row-gap: 8px; }
    .panel-hdr .panel-toolbar { justify-content: flex-start; }
}

@media (max-width: 380px) {
    .sg-stat-num { font-size: 23px; }
    .sg-stat-top { font-size: 11.5px; }
}

/* The list pages count their orders, products and codes in tiles marked
   col-sm-6, so a phone gets four full-width slabs to scroll past before it
   reaches the filters. Two to a row, with the figure sized to match. */
@media (max-width: 575.98px) {
    .row > [class*="col-sm-6"][class*="col-md-3"] {
        flex: 0 0 50%;
        max-width: 50%;
        padding-left: 6px;
        padding-right: 6px;
    }

    .row > [class*="col-sm-6"][class*="col-md-3"] .card-body { padding: 14px; }
    .row > [class*="col-sm-6"][class*="col-md-3"] .display-4 { font-size: 1.7rem; }
    .row > [class*="col-sm-6"][class*="col-md-3"] .display-4 small { font-size: 11.5px; }

    i.position-absolute.pos-right.pos-bottom { font-size: 2.4rem !important; }
}

/* ── the sign-in pages ───────────────────────────────────────────────────── */

/* One card, held in the middle of the canvas. These pages carry no chrome —
   no sidebar, no header — so the centring is theirs to do. */
.sg-auth {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 18px;
    padding: 32px 16px;
    background: var(--sg-canvas);
}

.sg-auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--sg-surface);
    border-radius: var(--sg-r-lg);
    box-shadow: var(--sg-shadow);
    padding: 32px 28px;
}

.sg-auth-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    margin-bottom: 24px;
}

.sg-auth-brand img { height: 72px; width: auto; }

.sg-auth-brand h1 {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -.02em;
    margin: 0;
    color: var(--sg-ink);
    text-align: center;
}

.sg-auth-sub {
    margin: 6px 0 0;
    font-size: 13.5px;
    color: var(--sg-ink-2);
    text-align: center;
}

.sg-auth-card .form-group { margin-bottom: 16px; }

.sg-auth-card .form-label {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--sg-ink-2);
    margin-bottom: 6px;
    display: block;
}

.sg-auth-card .form-control { height: 46px; }

.sg-auth-card .btn-primary {
    width: 100%;
    height: 46px;
    font-size: 14px;
}

/* The row under the password field: the way out on one side, the other
   language on the other. */
.sg-auth-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 4px 0 20px;
}

.sg-auth-link { font-size: 13px; font-weight: 500; color: var(--sg-ink-2); }
.sg-auth-link:hover { color: var(--sg-ink); text-decoration: none; }

.sg-auth-foot { font-size: 12.5px; color: var(--sg-ink-3); text-align: center; margin: 0; }

.sg-auth .alert { margin-bottom: 18px; text-align: center; }

/* Two ways in: the username and password, or a code on WhatsApp. */
.sg-auth-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    background: var(--sg-surface-2);
    border-radius: 12px;
    padding: 4px;
    margin-bottom: 20px;
}

.sg-auth-tab {
    border: 0;
    background: transparent;
    border-radius: 9px;
    padding: 9px 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--sg-ink-2);
    cursor: pointer;
    transition: background-color .15s, color .15s;
}

.sg-auth-tab.is-on {
    background: var(--sg-surface);
    color: var(--sg-ink);
    box-shadow: 0 1px 2px rgba(20, 24, 28, .06);
}

.sg-auth-note { font-size: 12.5px; color: var(--sg-ink-3); margin: -8px 0 16px; }

/* The number goes in beside its dial code rather than with it. */
.sg-phone-field { display: flex; }

.sg-phone-dial {
    display: flex;
    align-items: center;
    padding: 0 12px;
    height: 46px;
    background: var(--sg-surface-2);
    border: 1px solid var(--sg-line);
    color: var(--sg-ink-2);
    font-size: 13.5px;
    font-weight: 600;
    border-start-start-radius: 12px;
    border-end-start-radius: 12px;
    border-inline-end: 0;
    direction: ltr;
}

.sg-phone-field .form-control {
    border-start-start-radius: 0;
    border-end-start-radius: 0;
    direction: ltr;
    text-align: start;
}

/* The six digits, spaced so they can be checked against the message. */
.sg-code.form-control {
    letter-spacing: .38em;
    text-align: center;
    font-size: 17px;
    font-weight: 600;
    direction: ltr;
}

/* One number, two stores: which one did they mean. */
.sg-auth-pick { display: flex; flex-direction: column; gap: 8px; margin-bottom: 4px; }

.sg-auth-pick button {
    display: block;
    width: 100%;
    text-align: start;
    background: var(--sg-surface);
    border: 1px solid var(--sg-line);
    border-radius: 12px;
    padding: 12px 14px;
    cursor: pointer;
    transition: background-color .15s, border-color .15s;
}

.sg-auth-pick button:hover { background: var(--sg-surface-2); border-color: var(--sg-ink-3); }
.sg-auth-pick .pick-name { display: block; font-size: 14px; font-weight: 600; color: var(--sg-ink); }
.sg-auth-pick .pick-sub { display: block; font-size: 12px; color: var(--sg-ink-3); margin-top: 2px; }

@media (max-width: 575.98px) {
    /* On a phone the keyboard takes the lower half, so the card sits up the
       page rather than dead centre. */
    .sg-auth { justify-content: flex-start; padding: 44px 14px 24px; }
    .sg-auth-card { padding: 24px 18px; border-radius: var(--sg-r); }
    .sg-auth-brand img { height: 60px; }
}