/* ============================================================
   POS SaaS Admin — production design system
   A cohesive theme layered over Bootstrap. Tokens first, then
   the app shell, then components. Light, professional, calm.
   ============================================================ */

:root {
    /* palette */
    --bg:          #f4f6fb;   /* app content ground (cool off-white) */
    --surface:     #ffffff;
    --surface-2:   #f8fafc;
    --ink:         #0f172a;    /* slate-900 */
    --ink-soft:    #334155;    /* slate-700 */
    --muted:       #64748b;    /* slate-500 */
    --faint:       #94a3b8;    /* slate-400 */
    --line:        #e6e9f0;
    --line-strong: #d5dae5;

    --primary:      #4f46e5;   /* indigo-600 */
    --primary-600:  #4338ca;
    --primary-700:  #3730a3;
    --primary-tint: #eef2ff;
    --primary-ring: rgba(79,70,229,.35);

    --primary-2:    #7c73f0;               /* second stop of accent gradients (avatar, brand mark) */
    --primary-glow: rgba(79,70,229,.5);    /* shadow under accent elements */
    --primary-line: #c7d2fe;               /* borders of tinted accent surfaces */

    --staff:        #f59e0b;   /* amber accent for provider staff */

    --sidebar-1:  #1e293b;
    --sidebar-2:  #0f172a;
    --sidebar-ink:     #cbd5e1;            /* nav text */
    --sidebar-muted:   #64748b;            /* section headings */
    --nav-hover:       rgba(148,163,184,.14);
    --nav-active-1:    rgba(79,70,229,.35);
    --nav-active-2:    rgba(79,70,229,.16);
    --nav-active-bar:  var(--primary);
    --topbar-accent:   transparent;        /* 3px strip at the top of the header */

    /* sign-in / registration backdrop */
    --shell-1: #0f172a; --shell-2: #1e293b; --shell-3: #263449;
    --shell-glow-1: rgba(79,70,229,.22);
    --shell-glow-2: rgba(245,158,11,.14);

    --ok:      #059669; --ok-bg:   #d1fae5; --ok-ink:  #065f46;
    --warn:    #d97706; --warn-bg: #fef3c7; --warn-ink:#92400e;
    --danger:  #dc2626; --danger-bg:#fee2e2; --danger-ink:#991b1b;
    --neutral-bg:#eef1f6; --neutral-ink:#475569;

    --radius:    12px;
    --radius-sm: 9px;
    --radius-xs: 6px;
    --shadow-sm: 0 1px 2px rgba(15,23,42,.06), 0 1px 1px rgba(15,23,42,.04);
    --shadow:    0 4px 14px rgba(15,23,42,.08);
    --shadow-lg: 0 18px 50px rgba(15,23,42,.22);

    --sidebar-w: 248px;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    font-family: var(--font);
    font-size: 14.5px;
    color: var(--ink);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

h1 { font-size: 1.5rem;  font-weight: 700; letter-spacing: -.01em; margin: 0; }
h2 { font-size: 1.15rem; font-weight: 600; margin: 0; }
h3 { font-size: 1rem;    font-weight: 600; margin: 0 0 .75rem; }
a  { color: var(--primary-600); text-decoration: none; }
a:hover { color: var(--primary-700); text-decoration: underline; }
.mono  { font-family: ui-monospace, 'Cascadia Code', 'JetBrains Mono', Consolas, monospace; font-size: .85em; }
.muted { color: var(--muted); }
.text-muted { color: var(--muted) !important; }

/* ---------------- app shell ---------------- */
.page { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--sidebar-w);
    flex: 0 0 var(--sidebar-w);
    background: linear-gradient(180deg, var(--sidebar-1) 0%, var(--sidebar-2) 100%);
    color: var(--sidebar-ink);
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }

.top-row {
    height: 60px;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0 1.5rem !important;
    position: sticky;
    top: 0;
    z-index: 10;
}
.top-row .topright { margin-inline-start: auto; color: var(--muted); font-size: .85rem; }

.content { padding: 1.75rem 1.75rem 3rem !important; max-width: 1280px; width: 100%; }

/* ---------------- sidebar nav (NavMenu) ---------------- */
.navbar-brand {
    display: flex; align-items: center; gap: .6rem;
    font-weight: 700; font-size: 1.05rem; color: #fff !important;
    padding: 1.15rem 1.25rem; letter-spacing: -.01em;
}
.brand-mark {
    width: 30px; height: 30px; border-radius: 8px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-2) 100%);
    display: grid; place-items: center; color: #fff; font-weight: 700; font-size: .95rem;
    box-shadow: 0 2px 8px var(--primary-glow);
}
/* POS Line brand lockup (sidebar) and "Powered by LuxoraSoft" */
.brand-lockup { flex-direction: column; align-items: flex-start; gap: .35rem; padding: 1.1rem 1.25rem .9rem; text-decoration: none !important; }
.brand-lockup .brand-logo { width: 176px; height: auto; display: block; }
.brand-lockup .brand-app {
    font-size: .68rem; font-weight: 600; text-transform: uppercase; letter-spacing: .1em; color: var(--brand-app-ink, #94a3b8);
    padding-inline-start: 2px;
}
.powered-by {
    display: flex; align-items: center; gap: .5rem; padding: 1rem 1.25rem 1.25rem;
    border-top: 1px solid rgba(148,163,184,.14); margin: 0 .75rem;
    font-size: .68rem; color: #94a3b8; text-transform: uppercase; letter-spacing: .08em;
}
.powered-by img { height: 20px; width: auto; display: block; }
.powered-by a { display: flex; align-items: center; }
.nav-scrollable { padding: .25rem .75rem 2rem; }
.nav-section {
    text-transform: uppercase; font-size: .68rem; font-weight: 600;
    letter-spacing: .09em; color: var(--sidebar-muted); padding: 1.25rem .75rem .4rem;
}
.nav-item { padding: 0 !important; margin: 2px 0; }
.nav-item .nav-link, .nav-logout {
    display: flex; align-items: center; gap: .7rem;
    color: var(--sidebar-ink) !important; font-size: .9rem; font-weight: 500;
    padding: .55rem .75rem !important; border-radius: 9px;
    width: 100%; background: none; border: none; text-align: start; cursor: pointer;
    transition: background .12s ease, color .12s ease;
}
.nav-item .nav-link:hover, .nav-logout:hover { background: var(--nav-hover); color: #fff !important; }
.nav-item .nav-link.active {
    background: linear-gradient(90deg, var(--nav-active-1), var(--nav-active-2));
    color: #fff !important;
    box-shadow: inset 3px 0 0 var(--nav-active-bar);
}
.nav-item .nav-link .oi { font-size: .8rem; opacity: .85; width: 1rem; text-align: center; }

/* ---------------- page header ---------------- */
.page-head {
    display: flex; align-items: flex-start; justify-content: space-between;
    gap: 1rem; margin-bottom: 1.5rem; flex-wrap: wrap;
}
.page-head h1 { line-height: 1.2; }
.subhead { display: flex; align-items: center; gap: .6rem; margin-top: .45rem; }

/* ---------------- buttons ---------------- */
.btn {
    font-family: var(--font); font-weight: 600; font-size: .88rem;
    border-radius: var(--radius-sm); padding: .5rem .95rem;
    border: 1px solid transparent; transition: all .12s ease; line-height: 1.2;
}
.btn:focus, .btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--primary-ring); }
.btn-sm { padding: .32rem .6rem; font-size: .8rem; border-radius: 7px; }

.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-600); border-color: var(--primary-600); color:#fff; }
.btn-dark { background: var(--sidebar-1); border-color: var(--sidebar-1); color: #fff; }
.btn-dark:hover { background: var(--sidebar-2); color:#fff; }
.btn-success { background: var(--ok); border-color: var(--ok); color:#fff; }
.btn-success:hover { filter: brightness(.94); color:#fff; }
.btn-warning { background: var(--warn); border-color: var(--warn); color:#fff; }
.btn-warning:hover { filter: brightness(.94); color:#fff; }
.btn-outline-secondary { background:#fff; border-color: var(--line-strong); color: var(--ink-soft); }
.btn-outline-secondary:hover { background: var(--surface-2); border-color: var(--faint); color: var(--ink); }
.btn-outline-primary { background:#fff; border-color: var(--primary); color: var(--primary-600); }
.btn-outline-primary:hover { background: var(--primary-tint); color: var(--primary-700); }
.btn-outline-danger { background:#fff; border-color: #f1b0b0; color: var(--danger); }
.btn-outline-danger:hover { background: var(--danger-bg); color: var(--danger-ink); }
.btn-outline-success { background:#fff; border-color:#8fd6bb; color: var(--ok); }
.btn-outline-success:hover { background: var(--ok-bg); color: var(--ok-ink); }

/* ---------------- cards ---------------- */
.card {
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius); padding: 1.35rem;
    box-shadow: var(--shadow-sm); margin-bottom: 1.25rem;
}
.card h3 { margin-top: 0; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1.25rem; }

/* ---------------- stat cards ---------------- */
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; margin-top: .25rem; }
.stat-card {
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius); padding: 1.2rem 1.35rem; box-shadow: var(--shadow-sm);
    position: relative; overflow: hidden;
}
.stat-card::before { content:""; position:absolute; inset-inline-start:0; top:0; bottom:0; width:4px; background: var(--primary); opacity:.9; }
.stat-card.stat-ok::before   { background: var(--ok); }
.stat-card.stat-warn::before { background: var(--warn); }
.stat-card.stat-muted::before{ background: var(--faint); }
.stat-card.stat-bad::before  { background: var(--danger); }
.stat-value { font-size: 2rem; font-weight: 700; line-height: 1; color: var(--ink); font-variant-numeric: tabular-nums; }
.stat-label { color: var(--muted); font-size: .82rem; margin-top: .45rem; font-weight: 500; }

/* ---------------- filter bar ---------------- */
.filter-bar { display: flex; gap: .6rem; margin-bottom: 1.25rem; flex-wrap: wrap; align-items: center; }
.filter-bar .form-control { max-width: 380px; }
.filter-bar .form-select { max-width: 210px; }

/* ---------------- forms ---------------- */
.form-control, .form-select {
    font-family: var(--font); font-size: .9rem; color: var(--ink);
    border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
    padding: .55rem .75rem; background: var(--surface); transition: border-color .12s, box-shadow .12s;
}
.form-control:focus, .form-select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-ring); outline: none; }
.form-control::placeholder { color: var(--faint); }
.form-label { font-size: .82rem; font-weight: 600; color: var(--ink-soft); margin-bottom: .3rem; }
.field { margin-bottom: .9rem; display: flex; flex-direction: column; gap: .3rem; }
.field > label { font-size: .82rem; font-weight: 600; color: var(--ink-soft); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: .85rem; }
@media (max-width: 640px) { .field-row { grid-template-columns: 1fr; } }
.form-check-input:checked { background-color: var(--primary); border-color: var(--primary); }

/* ---------------- tables ---------------- */
.table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
table.table { margin: 0; font-size: .88rem; color: var(--ink-soft); border-collapse: separate; border-spacing: 0; width: 100%; }
.table thead th {
    background: var(--surface-2); color: var(--muted);
    font-size: .72rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
    padding: .7rem 1rem; border-bottom: 1px solid var(--line); white-space: nowrap; position: sticky; top: 0;
}
.table tbody td { padding: .7rem 1rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: var(--primary-tint); }
.table .num { text-align: end; font-variant-numeric: tabular-nums; }
tr.clickable { cursor: pointer; }
.row-warn td { background: var(--warn-bg); }
.empty { padding: 3rem 1rem; text-align: center; color: var(--muted); background: var(--surface); border: 1px dashed var(--line-strong); border-radius: var(--radius); }

/* ---------------- pills ---------------- */
.pill {
    display: inline-flex; align-items: center; gap: .3rem;
    font-size: .72rem; font-weight: 600; letter-spacing: .02em;
    padding: .2rem .6rem; border-radius: 999px; white-space: nowrap; text-transform: capitalize;
}
.pill::before { content:""; width:6px; height:6px; border-radius:50%; background: currentColor; opacity:.9; }
.pill-ok    { background: var(--ok-bg);      color: var(--ok-ink); }
.pill-warn  { background: var(--warn-bg);    color: var(--warn-ink); }
.pill-bad   { background: var(--danger-bg);  color: var(--danger-ink); }
.pill-muted { background: var(--neutral-bg); color: var(--neutral-ink); }

/* ---------------- detail lists ---------------- */
.detail-list { display: grid; grid-template-columns: auto 1fr; gap: .5rem 1.25rem; margin: 0; }
.detail-list dt { color: var(--muted); font-size: .85rem; }
.detail-list dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.action-buttons { display: flex; gap: .5rem; flex-wrap: wrap; }
.quicklinks { display: flex; gap: .5rem; flex-wrap: wrap; }

/* ---------------- alerts ---------------- */
.alert { border-radius: var(--radius-sm); border: 1px solid transparent; padding: .75rem 1rem; font-size: .88rem; }
.alert-secondary { background: var(--surface-2); border-color: var(--line); color: var(--ink-soft); }
.alert-info    { background: var(--primary-tint); border-color: var(--primary-line); color: var(--primary-700); }
.alert-success { background: var(--ok-bg); border-color: #a7f3d0; color: var(--ok-ink); }
.alert-warning { background: var(--warn-bg); border-color: #fde68a; color: var(--warn-ink); }
.alert-danger  { background: var(--danger-bg); border-color: #fecaca; color: var(--danger-ink); }

/* ---------------- tenant switcher (topbar) ---------------- */
.tenant-switch { display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; }
.ts-label { font-size: .85rem; color: var(--muted); }
.ts-name  { font-weight: 600; color: var(--ink); }
.ts-badge {
    display: inline-flex; align-items: center; gap: .5rem;
    background: var(--primary-tint); color: var(--primary-700);
    border: 1px solid var(--primary-line); border-radius: 999px; padding: .25rem .5rem .25rem .75rem; font-weight: 600; font-size: .85rem;
}

/* ============================================================
   Auth screens — portal chooser & logins
   ============================================================ */
.auth-shell {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    padding: 2rem 1rem;
    background:
        radial-gradient(1200px 600px at 15% -10%, var(--shell-glow-1), transparent 60%),
        radial-gradient(1000px 500px at 100% 110%, var(--shell-glow-2), transparent 55%),
        linear-gradient(160deg, var(--shell-1) 0%, var(--shell-2) 60%, var(--shell-3) 100%);
}
.auth-card {
    width: 100%; max-width: 420px; background: var(--surface);
    border-radius: 18px; box-shadow: var(--shadow-lg); padding: 2.25rem 2rem;
}
.auth-brand { display: flex; align-items: center; gap: .65rem; margin-bottom: 1.5rem; }
.auth-brand .auth-logo { width: 230px; max-width: 100%; height: auto; display: block; }
.auth-powered {
    display: flex; align-items: center; justify-content: center; gap: .55rem;
    margin-top: 1.25rem; font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .08em;
}
.auth-powered img { height: 22px; width: auto; display: block; }
.auth-shell-powered { margin-top: 1.25rem; }
.auth-shell-powered img { height: 22px; }
.auth-brand .brand-mark { width: 34px; height: 34px; font-size: 1rem; }
.auth-brand .brand-name { font-weight: 700; font-size: 1.05rem; color: var(--ink); letter-spacing: -.01em; }
.auth-card h1 { font-size: 1.4rem; margin-bottom: .3rem; }
.auth-sub { color: var(--muted); font-size: .9rem; margin: 0 0 1.5rem; }
.auth-card .field { margin-bottom: 1rem; }
.auth-card .btn { width: 100%; padding: .65rem; font-size: .95rem; }
.auth-foot { margin-top: 1.35rem; padding-top: 1.1rem; border-top: 1px solid var(--line); font-size: .88rem; color: var(--muted); display: flex; flex-direction: column; gap: .4rem; }
.auth-foot a { font-weight: 600; }
.auth-badge {
    display: inline-block; font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em;
    padding: .2rem .55rem; border-radius: 999px; margin-bottom: 1rem;
}
.auth-badge.customer { background: var(--primary-tint); color: var(--primary-700); }
.auth-badge.staff    { background: #fef3c7; color: #92400e; }

/* portal chooser */
.portal-shell {
    min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2.25rem;
    padding: 2.5rem 1rem;
    background:
        radial-gradient(1200px 600px at 15% -10%, var(--shell-glow-1), transparent 60%),
        radial-gradient(1000px 500px at 100% 110%, var(--shell-glow-2), transparent 55%),
        linear-gradient(160deg, var(--shell-1) 0%, var(--shell-2) 60%, var(--shell-3) 100%);
}
.portal-head { text-align: center; color: #e2e8f0; }
.portal-head .brand-mark { width: 44px; height: 44px; font-size: 1.25rem; margin: 0 auto .9rem; }
.portal-head h1 { color: #fff; font-size: 1.9rem; }
.portal-head p { color: #94a3b8; margin: .5rem 0 0; }
.portal-cards { display: flex; gap: 1.5rem; flex-wrap: wrap; justify-content: center; }
.portal-card {
    width: 320px; background: var(--surface); border-radius: 16px; padding: 1.9rem;
    text-decoration: none; color: var(--ink); box-shadow: var(--shadow-lg);
    transition: transform .14s ease, box-shadow .14s ease; border-top: 3px solid var(--primary);
    display: flex; flex-direction: column; gap: .35rem;
}
.portal-card:hover { transform: translateY(-5px); text-decoration: none; }
.portal-card.staff { border-top-color: var(--staff); }
.portal-ico { font-size: 2rem; }
.portal-card h2 { font-size: 1.2rem; margin: .5rem 0 .15rem; }
.portal-card p { color: var(--muted); font-size: .9rem; margin: 0 0 1rem; line-height: 1.5; }
.portal-cta { font-weight: 600; color: var(--primary-600); margin-top: auto; }
.portal-card.staff .portal-cta { color: #b45309; }
.portal-foot { color: #94a3b8; font-size: .95rem; }
.portal-foot a { color: #fff; font-weight: 600; }

/* ---------------- error UI (framework) ---------------- */
#blazor-error-ui {
    background: #1e293b; color:#fff; bottom: 0; box-shadow: 0 -1px 10px rgba(0,0,0,.3);
    display: none; left: 0; padding: .8rem 1.25rem; position: fixed; width: 100%; z-index: 1000; font-size: .9rem;
}
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; inset-inline-end: 1rem; top: .6rem; }
.blazor-error-boundary { background: var(--danger-bg); padding: 1rem; color: var(--danger-ink); border-radius: var(--radius-sm); }

/* ---------------- responsive sidebar (NavToggle + js/portal-nav.js) ----------------
   wide > 900px: full sidebar, logo button collapses it to an icon rail (html.nav-compact)
   tablet 641-900px: icon rail, logo button opens the full menu over the page (html.nav-open)
   phone <= 640px: off-canvas menu, logo button slides it in (html.nav-open)                */
:root { --rail-w: 72px; }

.nav-toggle {
    flex: 0 0 auto; width: 42px; height: 42px; display: inline-grid; place-items: center; padding: 0;
    background: var(--surface); border: 1px solid var(--line); border-radius: 12px; cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: background .12s ease, border-color .12s ease, box-shadow .12s ease, transform .12s ease;
}
.nav-toggle:hover { background: var(--primary-tint); border-color: var(--primary-line); box-shadow: 0 2px 10px var(--primary-glow); }
.nav-toggle:active { transform: scale(.96); }
.nav-toggle:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.nav-toggle-logo { width: 26px; height: auto; display: block; pointer-events: none; }
.nav-backdrop { display: none; }

.sidebar { transition: width .18s ease, flex-basis .18s ease, transform .2s ease; overflow-x: hidden; }
.sidebar .nav-link { position: relative; }

/* ---- icon rail ---- */
html.nav-compact .sidebar { width: var(--rail-w); flex-basis: var(--rail-w); }
html.nav-compact .sidebar .brand-lockup,
html.nav-compact .sidebar .powered-by,
html.nav-compact .sidebar .app-version,
html.nav-compact .sidebar .nav-hint { display: none !important; }
html.nav-compact .sidebar .nav-scrollable { padding: .9rem .6rem 2rem; height: 100vh; }
html.nav-compact .sidebar .nav-section {
    font-size: 0; height: 0; padding: 0; margin: .55rem .5rem; border-top: 1px solid rgba(255, 255, 255, .12);
}
html.nav-compact .sidebar .nav-item .nav-link,
html.nav-compact .sidebar .nav-logout {
    font-size: 0; gap: 0; justify-content: center; padding: .7rem 0 !important; white-space: nowrap;
}
html.nav-compact .sidebar .nav-item .nav-link .oi,
html.nav-compact .sidebar .nav-logout .oi { font-size: 1.05rem; width: auto; opacity: .95; }
html.nav-compact .sidebar .nav-link .pill {
    position: absolute; top: 3px; inset-inline-end: 5px; margin: 0 !important;
    font-size: .6rem; padding: 0 .32rem; line-height: 1.35;
}
html.nav-compact .sidebar .nav-link .pill::before { display: none; }

/* ---- tablet: rail in the layout, full menu as an overlay ---- */
@media (min-width: 641px) and (max-width: 900px) {
    html.nav-open .sidebar {
        position: fixed; top: 0; inset-inline-start: 0; height: 100vh; z-index: 40;
        width: var(--sidebar-w); box-shadow: 0 0 48px rgba(15, 23, 42, .45);
    }
    html.nav-open main { margin-inline-start: var(--rail-w); }   /* keep the page where it was */
    .content { padding: 1.25rem !important; }
}

/* ---- phone: off-canvas ---- */
@media (max-width: 640px) {
    .sidebar {
        position: fixed; top: 0; inset-inline-start: 0; height: 100vh; z-index: 40;
        width: min(var(--sidebar-w), 85vw); transform: translateX(-100%);
    }
    html.nav-open .sidebar { transform: none; box-shadow: 0 0 48px rgba(15, 23, 42, .45); }
    .content { padding: 1rem !important; }
    .top-row { padding: 0 .75rem !important; gap: .6rem; }
    .top-row .ts-label { display: none; }
}

@media (max-width: 900px) {
    html.nav-open .nav-backdrop { display: block; position: fixed; inset: 0; z-index: 35; background: rgba(15, 23, 42, .45); }
}
/* ---------------- public registration ---------------- */
.register-wrapper {
    min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 2.5rem 1rem;
    background:
        radial-gradient(1200px 600px at 15% -10%, var(--shell-glow-1), transparent 60%),
        radial-gradient(1000px 500px at 100% 110%, var(--shell-glow-2), transparent 55%),
        linear-gradient(160deg, var(--shell-1) 0%, var(--shell-2) 60%, var(--shell-3) 100%);
}
.register-card { width: 100%; max-width: 620px; background: var(--surface); border-radius: 18px; box-shadow: var(--shadow-lg); padding: 2.25rem 2.25rem 2rem; }
.register-brand { margin-bottom: 1.25rem; }
.register-brand img { width: 210px; max-width: 100%; height: auto; display: block; }
.register-head h1 { font-size: 1.5rem; margin-bottom: .3rem; }
.register-head p { color: var(--muted); margin: 0 0 1.5rem; font-size: .92rem; }
.reg-section { text-transform: uppercase; font-size: .72rem; letter-spacing: .08em; color: var(--faint); font-weight: 700; margin: 1.4rem 0 .75rem; padding-top: .9rem; border-top: 1px solid var(--line); }
.register-footer { text-align: center; margin-top: 1.35rem; color: var(--muted); font-size: .9rem; }
.register-done { text-align: center; padding: 1rem .5rem; }
.register-done .tick { width: 60px; height: 60px; border-radius: 50%; background: var(--ok-bg); color: var(--ok); font-size: 2rem; line-height: 60px; margin: 0 auto 1.1rem; }
.register-done h2 { margin-bottom: .6rem; }
.register-done p { color: var(--ink-soft); margin-bottom: 1.4rem; line-height: 1.55; }
.register-card .btn { padding: .6rem 1.1rem; }
.register-card .w-100 { width: 100%; }

/* ---------------- topbar user chip ---------------- */
.user-chip { display: inline-flex; align-items: center; gap: .55rem; }
.user-avatar {
    width: 34px; height: 34px; border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-2) 100%);
    color: #fff; font-weight: 600; font-size: .8rem; display: grid; place-items: center;
}
.user-meta { display: flex; flex-direction: column; line-height: 1.15; }
.user-name { font-weight: 600; font-size: .85rem; color: var(--ink); }
.user-role { font-size: .72rem; color: var(--muted); }
.ts-badge .btn { margin-inline-start: .1rem; padding: .12rem .5rem; }
@media (max-width: 640px) { .user-meta { display: none; } }

/* ---------------- app boot (session restore) ---------------- */
.app-boot { position: fixed; inset: 0; display: grid; place-items: center; background: var(--bg); }
.app-boot-spinner {
    width: 40px; height: 40px; border-radius: 50%;
    border: 3px solid var(--line-strong); border-top-color: var(--primary);
    animation: app-spin .8s linear infinite;
}
@keyframes app-spin { to { transform: rotate(360deg); } }

/* ---------------- OTP verification ---------------- */
.otp-input { font-size: 1.6rem; letter-spacing: .6rem; text-align: center; font-weight: 600; font-family: ui-monospace, Consolas, monospace; }
.btn-link { background: none; border: none; color: var(--primary-600); font-weight: 600; cursor: pointer; padding: 0; font: inherit; }
.btn-link:hover:not(:disabled) { text-decoration: underline; color: var(--primary-700); }
.btn-link:disabled { color: var(--faint); cursor: default; }

/* ---------------- About page + version labels ---------------- */
.about-hero { display: flex; flex-direction: row; align-items: center; gap: 2rem; flex-wrap: wrap; }   /* .card is a bootstrap flex column */
.about-hero .about-logo { width: 240px; max-width: 100%; height: auto; display: block; }
.about-hero-text { display: flex; flex-direction: column; gap: .3rem; }
.about-app { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--primary-700); }
.about-version { font-size: 1.75rem; font-weight: 700; color: var(--ink); line-height: 1.1; font-variant-numeric: tabular-nums; }
.about-powered img { height: 26px; }
.app-version {
    display: block; padding: 0 1.25rem 1rem; margin: -.6rem .75rem 0;
    font-size: .68rem; color: var(--sidebar-muted); letter-spacing: .04em; text-decoration: none;
}
.app-version:hover { color: #fff; text-decoration: none; }
.auth-version { text-align: center; margin-top: .5rem; font-size: .7rem; color: var(--faint); letter-spacing: .04em; }

/* ---------------- language switcher (Customer Portal) ---------------- */
.lang-switch { display: inline-flex; align-items: center; gap: .25rem; }
.lang-link {
    display: inline-flex; align-items: center; gap: .35rem; background: none; border: 1px solid var(--line);
    border-radius: 999px; padding: .28rem .7rem; font: inherit; font-size: .8rem; font-weight: 600;
    color: var(--ink-soft); cursor: pointer; white-space: nowrap;
}
.lang-link:hover { border-color: var(--primary-line); color: var(--primary-700); background: var(--primary-tint); }
.lang-link .oi { font-size: .75rem; top: 0; }
.auth-lang { display: flex; justify-content: flex-end; margin-bottom: .75rem; }

/* ---------------- country pricing, coupons and renewals ---------------- */

/* Coupon entry in the basket. */
.coupon-box { margin-top: .85rem; }
.coupon-row { display: flex; gap: .5rem; align-items: stretch; max-width: 26rem; }
.coupon-row .form-control { flex: 1 1 auto; text-transform: uppercase; }
.coupon-ok    { margin-top: .4rem; font-size: .85rem; font-weight: 600; color: var(--ok-ink); }
.coupon-error { margin-top: .4rem; font-size: .85rem; color: var(--danger-ink); }
.coupon-suggest { margin-top: .45rem; font-size: .85rem; color: var(--ink-soft); display: flex; flex-wrap: wrap; gap: .35rem; align-items: baseline; }

/* "Prices are shown in EGP for Egypt" under the store heading. */
.price-context {
    display: inline-flex; align-items: center; gap: .4rem; padding: .2rem .6rem; border-radius: 999px;
    background: var(--neutral-bg); color: var(--neutral-ink); font-size: .8rem; font-weight: 600;
}

/* A discounted total: the amount before the coupon, struck through. */
.was-price { color: var(--muted); text-decoration: line-through; font-weight: 400; margin-inline-end: .4rem; }
.discount-line { color: var(--ok-ink); }

/* Renewal urgency on the dashboard tile and the renewals board. */
.renew-due       { color: var(--warn-ink); }
.renew-overdue   { color: var(--danger-ink); font-weight: 600; }
.renew-suspended { color: var(--danger-ink); font-weight: 700; }

/* Staff: a currency switched on whose price list is not finished yet. */
.currency-warning { font-size: .8rem; color: var(--warn-ink); }

/* One revenue tile per currency — totals are never added across currencies. */
.currency-tiles { display: flex; flex-wrap: wrap; gap: .75rem; }
.currency-tiles .stat-card { min-width: 12rem; }

/* A subhead that is a paragraph of prose (the store intro) rather than a row of chips. */
.subhead.subhead-prose { display: block; line-height: 1.5; }
.subhead.subhead-prose .price-context { margin-top: .35rem; }

/* ---------- Printing (report pages: Print button → window.posPrint) ----------
   The shell, filters and buttons disappear; tables print in full width. The paper
   orientation comes from the @page rule the button injects (portrait or landscape
   from the number of columns). */
.print-only { display: none; }
@media print {
    .sidebar, .top-row, .nav-backdrop, .filter-bar, .action-buttons, .no-print, .lang-switch, .app-version, .nav-toggle { display: none !important; }
    .print-only { display: block !important; }
    html, body { background: #fff !important; color: #000 !important; }
    .page { display: block !important; }
    main { margin: 0 !important; padding: 0 !important; }
    .content, article.content { padding: 0 !important; margin: 0 !important; max-width: none !important; }
    .page-head h1 { font-size: 16pt; margin: 0 0 4pt 0; }
    .print-header { border-bottom: 1px solid #000; padding-bottom: 4pt; margin-bottom: 8pt; font-size: 9pt; }
    .print-header strong { font-size: 11pt; }
    .card, section.card { box-shadow: none !important; border: 0 !important; padding: 0 !important; margin: 0 0 10pt 0 !important; background: none !important; break-inside: auto; }
    .card h3, section.card h3 { font-size: 11pt; margin: 8pt 0 4pt 0; break-after: avoid; }
    .stat-row { display: flex !important; flex-wrap: wrap; gap: 6pt; margin: 0 0 8pt 0; }
    .stat-card { border: 1px solid #999 !important; box-shadow: none !important; padding: 4pt 8pt !important; min-width: 0 !important; background: none !important; }
    .stat-value { font-size: 11pt !important; }
    .stat-label { font-size: 8pt !important; }
    .table-scroll { overflow: visible !important; max-height: none !important; }
    table.table { width: 100% !important; border-collapse: collapse; font-size: 8.5pt; }
    table.table th, table.table td { padding: 2pt 4pt !important; border: 1px solid #bbb !important; color: #000 !important; }
    table.table thead th { background: #eee !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    table.table thead { display: table-header-group; }
    table.table tfoot { display: table-footer-group; }
    table.table tr { break-inside: avoid; }
    .pill { border: 1px solid #999; background: none !important; color: #000 !important; }
    a[href]::after { content: none !important; }
}
