/*
 * Admin Panel theme on top of Bootstrap 5.3.
 * Plain CSS, no build step: edit this file and refresh the browser.
 *
 * Colours live in CSS variables below. Light and dark mode use the same names,
 * so components only ever use var(--...) and never hard-coded colours.
 */

/* ---------- Light mode (default) ---------- */
:root,
[data-bs-theme="light"] {
    --app-bg: #e9edf5;              /* page background: soft grey-blue, not pure white */
    --app-surface: #f8f9fc;         /* cards */
    --app-surface-2: #eff2f8;       /* table headers, inner boxes */
    --app-border: #d9dfeb;
    --app-text: #1f2937;
    --app-muted: #64708a;

    --app-primary: #5b5bd6;         /* indigo */
    --app-primary-hover: #4a4ac2;
    --app-primary-soft: #e3e3fb;
    --app-primary-rgb: 91, 91, 214;
    --app-check: #16a34a;           /* ticked checkboxes and switches */

    --app-sidebar-bg: linear-gradient(180deg, #f4f3ff 0%, #eef4fb 100%);
    --app-sidebar-border: #dcdff0;
    --app-sidebar-text: #4a5470;
    --app-sidebar-strong: #1f2937;
    --app-sidebar-heading: #8a90b0;
    --app-sidebar-icon: #7c7fd6;
    --app-sidebar-active-bg: #ffffff;
    --app-sidebar-active-text: #4338ca;
    --app-sidebar-active-bar: #5b5bd6;
    --app-sidebar-hover-bg: rgba(91, 91, 214, 0.08);

    /* Table header */
    --app-thead-bg: #e6e6fa;
    --app-thead-text: #4a4aa8;

    /* Focus ring for inputs */
    --app-focus-ring: rgba(91, 91, 214, 0.16);

    /* Soft colour tones used by badges, stat icons and avatars */
    --tone-indigo-bg: #e3e3fb;  --tone-indigo-fg: #4338ca;
    --tone-teal-bg: #d5f3ee;    --tone-teal-fg: #0f766e;
    --tone-green-bg: #dcf3e4;   --tone-green-fg: #15803d;
    --tone-amber-bg: #fcefd2;   --tone-amber-fg: #b45309;
    --tone-red-bg: #fde2e2;     --tone-red-fg: #b91c1c;
    --tone-blue-bg: #dbeafe;    --tone-blue-fg: #1d4ed8;
    --tone-violet-bg: #ede4fd;  --tone-violet-fg: #6d28d9;
    --tone-pink-bg: #fce4f1;    --tone-pink-fg: #be185d;
    --tone-gray-bg: #e5e8ef;    --tone-gray-fg: #4b5568;

    /* Category tiles: saturation / lightness used with each category's hue (like the apps) */
    --cat-tile-s: 70%;  --cat-tile-l: 92%;
    --cat-ink-s: 55%;   --cat-ink-l: 32%;

    /* Banner preview: the Customer App's colours (its green header, the dark fade under words on a picture) */
    --app-brand-green: #1e9a4b;
    --app-brand-green-deep: #178040;
    --app-phone-bg: #f2f2f3;
    --app-phone-frame: #1d1f20;
    --banner-scrim: rgba(10, 14, 20, 0.68);
    --banner-text: #ffffff;
    --banner-button-bg: #ffffff;
    --banner-button-text: #1d1f20;

    --app-shadow: 0 1px 2px rgba(30, 41, 59, 0.06), 0 4px 14px rgba(30, 41, 59, 0.06);
}

/* ---------- Dark mode ---------- */
[data-bs-theme="dark"] {
    --app-bg: #0f1422;
    --app-surface: #171e2f;
    --app-surface-2: #1d2539;
    --app-border: #2a3550;
    --app-text: #e2e6f0;
    --app-muted: #97a1ba;

    --app-primary: #8b8cf6;
    --app-primary-hover: #a3a4f8;
    --app-primary-soft: #2a2d5c;
    --app-primary-rgb: 139, 140, 246;
    --app-check: #22a55a;

    --app-sidebar-bg: linear-gradient(180deg, #161a3d 0%, #10213a 100%);
    --app-sidebar-border: #232a4a;
    --app-sidebar-text: #aab1d6;
    --app-sidebar-strong: #ffffff;
    --app-sidebar-heading: #6f78a8;
    --app-sidebar-icon: #8f93e8;
    --app-sidebar-active-bg: rgba(255, 255, 255, 0.1);
    --app-sidebar-active-text: #ffffff;
    --app-sidebar-active-bar: #f59e0b;
    --app-sidebar-hover-bg: rgba(255, 255, 255, 0.06);

    --app-thead-bg: #222a4d;
    --app-thead-text: #b4b5fb;

    --app-focus-ring: rgba(139, 140, 246, 0.22);

    --tone-indigo-bg: #2a2d5c;  --tone-indigo-fg: #b4b5fb;
    --tone-teal-bg: #123a38;    --tone-teal-fg: #5eead4;
    --tone-green-bg: #143524;   --tone-green-fg: #6ee7a0;
    --tone-amber-bg: #3d2e10;   --tone-amber-fg: #fbbf5a;
    --tone-red-bg: #3f1a1d;     --tone-red-fg: #fca5a5;
    --tone-blue-bg: #172b4f;    --tone-blue-fg: #93c5fd;
    --tone-violet-bg: #2e1f52;  --tone-violet-fg: #c4b5fd;
    --tone-pink-bg: #3d1730;    --tone-pink-fg: #f9a8d4;
    --tone-gray-bg: #252e44;    --tone-gray-fg: #b4bcd0;

    --cat-tile-s: 32%;  --cat-tile-l: 22%;
    --cat-ink-s: 60%;   --cat-ink-l: 76%;

    --app-brand-green: #3ccf74;
    --app-brand-green-deep: #2fae5f;
    --app-phone-bg: #0d0f12;
    --app-phone-frame: #000000;

    --app-shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 4px 14px rgba(0, 0, 0, 0.25);
}

/* ---------- Map our colours onto Bootstrap ---------- */
:root,
[data-bs-theme="light"],
[data-bs-theme="dark"] {
    --bs-body-bg: var(--app-bg);
    --bs-body-color: var(--app-text);
    --bs-secondary-color: var(--app-muted);
    --bs-tertiary-bg: var(--app-surface-2);
    --bs-border-color: var(--app-border);
    --bs-link-color: var(--app-primary);
    --bs-link-hover-color: var(--app-primary-hover);
    --bs-link-color-rgb: var(--app-primary-rgb);
    --bs-link-hover-color-rgb: var(--app-primary-rgb);
    --bs-primary: var(--app-primary);
    --bs-font-sans-serif: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
    --bs-body-font-size: 0.9rem;
    --bs-border-radius: 0.6rem;
    --bs-border-radius-lg: 0.85rem;
    --bs-focus-ring-color: color-mix(in srgb, var(--app-primary) 30%, transparent);
}

body {
    background: var(--app-bg);
    color: var(--app-text);
}

.text-muted,
.text-secondary {
    color: var(--app-muted) !important;
}

a {
    text-decoration: none;
}

/* ---------- Layout ---------- */
.app-sidebar {
    --bs-offcanvas-width: 260px;
    --bs-offcanvas-bg: transparent;
    background: var(--app-sidebar-bg);
    color: var(--app-sidebar-text);
    border-right: 1px solid var(--app-sidebar-border);
}

.app-sidebar-footer {
    border-top: 1px solid var(--app-sidebar-border);
}

.app-sidebar-strong {
    color: var(--app-sidebar-strong);
}

.app-sidebar-muted {
    color: var(--app-sidebar-heading);
}

@media (min-width: 992px) {
    .app-sidebar {
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        width: 260px;
        z-index: 1030;
    }

    .app-main {
        margin-left: 260px;
    }
}

.app-brand {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    color: var(--app-sidebar-strong);
}

.app-brand-logo {
    display: block;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    object-fit: contain;
}

.app-nav-heading {
    margin: 1.1rem 0 0.35rem;
    padding: 0 0.75rem;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--app-sidebar-heading);
}

.app-nav-link {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.5rem 0.75rem;
    border-radius: 0.55rem;
    color: var(--app-sidebar-text);
    font-weight: 500;
}

.app-nav-link:hover {
    background: var(--app-sidebar-hover-bg);
    color: var(--app-sidebar-strong);
}

.app-nav-link.active {
    background: var(--app-sidebar-active-bg);
    color: var(--app-sidebar-active-text);
    box-shadow: inset 3px 0 0 var(--app-sidebar-active-bar), 0 1px 3px rgba(30, 41, 59, 0.06);
    font-weight: 600;
}

.app-nav-link .icon {
    width: 18px;
    height: 18px;
    color: var(--app-sidebar-icon);
}

.app-nav-link.active .icon {
    color: var(--app-sidebar-active-text);
}

.app-nav-count {
    margin-left: auto;
    padding: 0.05rem 0.45rem;
    border-radius: 999px;
    background: #f59e0b;
    color: #1f1300;
    font-size: 0.7rem;
    font-weight: 700;
}

.app-topbar {
    position: sticky;
    top: 0;
    z-index: 1020;
    background: color-mix(in srgb, var(--app-surface) 88%, transparent);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--app-border);
}

.app-content {
    max-width: 1400px;
    padding: 1.5rem 1rem 3rem;
}

@media (min-width: 576px) {
    .app-content {
        padding: 1.75rem 1.5rem 3rem;
    }
}

/* ---------- Cards ---------- */
.card {
    --bs-card-bg: var(--app-surface);
    --bs-card-border-color: var(--app-border);
    --bs-card-cap-bg: transparent;
    --bs-card-spacer-y: 1.1rem;
    --bs-card-spacer-x: 1.25rem;
    box-shadow: var(--app-shadow);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding-top: 0.85rem;
    padding-bottom: 0.85rem;
}

.card-title {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
}

/* ---------- Buttons ---------- */
.btn {
    --bs-btn-font-size: 0.875rem;
    --bs-btn-font-weight: 500;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
}

.btn-sm {
    --bs-btn-font-size: 0.8rem;
}

.btn-primary {
    --bs-btn-bg: var(--app-primary);
    --bs-btn-border-color: var(--app-primary);
    --bs-btn-hover-bg: var(--app-primary-hover);
    --bs-btn-hover-border-color: var(--app-primary-hover);
    --bs-btn-active-bg: var(--app-primary-hover);
    --bs-btn-active-border-color: var(--app-primary-hover);
    --bs-btn-disabled-bg: var(--app-primary);
    --bs-btn-disabled-border-color: var(--app-primary);
}

[data-bs-theme="dark"] .btn-primary {
    --bs-btn-color: #11122b;
    --bs-btn-hover-color: #11122b;
    --bs-btn-active-color: #11122b;
}

/* Neutral button that fits both themes */
.btn-light {
    --bs-btn-bg: var(--app-surface);
    --bs-btn-border-color: var(--app-border);
    --bs-btn-color: var(--app-text);
    --bs-btn-hover-bg: var(--app-surface-2);
    --bs-btn-hover-border-color: var(--app-border);
    --bs-btn-hover-color: var(--app-text);
    --bs-btn-active-bg: var(--app-surface-2);
    --bs-btn-active-border-color: var(--app-border);
}

/* ---------- Forms ---------- */
.form-control,
.form-select {
    background-color: var(--app-surface);
    border-color: var(--app-border);
    font-size: 0.875rem;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.form-control:hover,
.form-select:hover {
    border-color: color-mix(in srgb, var(--app-primary) 35%, var(--app-border));
}

/* Thin, soft focus: coloured border + light 3px ring, background stays the same */
.form-control:focus,
.form-select:focus,
.form-check-input:focus {
    background-color: var(--app-surface);
    border-color: var(--app-primary);
    box-shadow: 0 0 0 3px var(--app-focus-ring);
    outline: 0;
}

/* Search box with an icon: the icon and the input act as one field */
.input-group-text {
    background-color: var(--app-surface);
    border-color: var(--app-border);
    color: var(--app-muted);
}

.input-group:focus-within {
    border-radius: var(--bs-border-radius);
    box-shadow: 0 0 0 3px var(--app-focus-ring);
}

.input-group:focus-within .input-group-text,
.input-group:focus-within .form-control {
    border-color: var(--app-primary);
    box-shadow: none;
}

.input-group:focus-within .input-group-text {
    color: var(--app-primary);
}

.input-group > .input-group-text + .form-control {
    border-left: 0;
    padding-left: 0.25rem;
}

.input-group > .input-group-text:has(+ .form-control) {
    border-right: 0;
}

.form-label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--app-muted);
    margin-bottom: 0.3rem;
}

/* Unticked boxes need a clear edge, especially in dark mode where the default border nearly disappears */
.form-check-input {
    background-color: var(--app-surface);
    border-color: color-mix(in srgb, var(--app-muted) 70%, var(--app-border));
}

.form-check-input:checked {
    background-color: var(--app-check);
    border-color: var(--app-check);
}

/* ---------- Tables ---------- */
/* Keeps absolutely-positioned children (e.g. visually-hidden headers) inside the scroll box on phones. */
.table-responsive {
    position: relative;
}

.table {
    --bs-table-bg: transparent;
    --bs-table-hover-bg: color-mix(in srgb, var(--app-primary) 5%, transparent);
    margin-bottom: 0;
    font-size: 0.875rem;
}

.table > thead th {
    background: var(--app-thead-bg);
    color: var(--app-thead-text);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    white-space: nowrap;
    border-bottom: 0;
}

.table > :not(caption) > * > * {
    padding: 0.7rem 1rem;
    vertical-align: middle;
    border-color: var(--app-border);
}

.table > tbody > tr:last-child > * {
    border-bottom: 0;
}

/* ---------- Tabs ---------- */
.nav-tabs {
    --bs-nav-tabs-border-color: var(--app-border);
    --bs-nav-tabs-link-active-bg: transparent;
    --bs-nav-tabs-link-active-border-color: transparent transparent var(--app-primary);
    --bs-nav-link-color: var(--app-muted);
    --bs-nav-link-hover-color: var(--app-text);
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    gap: 1.25rem;
}

.nav-tabs::-webkit-scrollbar {
    display: none;
}

.nav-tabs .nav-link {
    padding: 0.6rem 0.1rem;
    border: 0;
    border-bottom: 2px solid transparent;
    font-weight: 500;
    white-space: nowrap;
}

.nav-tabs .nav-link.active {
    color: var(--app-primary);
    border-bottom-color: var(--app-primary);
}

/* ---------- Soft badges (work in light and dark) ---------- */
.badge {
    --bs-badge-font-weight: 600;
    --bs-badge-font-size: 0.74rem;
    --bs-badge-padding-y: 0.32em;
    --bs-badge-padding-x: 0.65em;
    border-radius: 999px;
    letter-spacing: 0.01em;
}

/* Status badge (x-badge): coloured dot + thin border in the same colour */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4em;
    padding-left: 0.6em;
    border: 1px solid color-mix(in srgb, currentColor 22%, transparent);
}

.status-badge::before {
    content: "";
    width: 0.45em;
    height: 0.45em;
    border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;
}

.tone-indigo { background: var(--tone-indigo-bg) !important; color: var(--tone-indigo-fg) !important; }
.tone-teal   { background: var(--tone-teal-bg) !important;   color: var(--tone-teal-fg) !important; }
.tone-green  { background: var(--tone-green-bg) !important;  color: var(--tone-green-fg) !important; }
.tone-amber  { background: var(--tone-amber-bg) !important;  color: var(--tone-amber-fg) !important; }
.tone-red    { background: var(--tone-red-bg) !important;    color: var(--tone-red-fg) !important; }
.tone-blue   { background: var(--tone-blue-bg) !important;   color: var(--tone-blue-fg) !important; }
.tone-violet { background: var(--tone-violet-bg) !important; color: var(--tone-violet-fg) !important; }
.tone-pink   { background: var(--tone-pink-bg) !important;   color: var(--tone-pink-fg) !important; }
.tone-gray   { background: var(--tone-gray-bg) !important;   color: var(--tone-gray-fg) !important; }

/* ---------- Small building blocks ---------- */
.icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.icon-chip {
    display: inline-grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    flex-shrink: 0;
}

.icon-chip .icon {
    width: 20px;
    height: 20px;
}

.avatar {
    display: inline-grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: 700;
    flex-shrink: 0;
}

.avatar-sm { width: 28px; height: 28px; font-size: 0.65rem; }
.avatar-lg { width: 52px; height: 52px; font-size: 0.95rem; }

.stat-value {
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1.2;
}

/* Two stat cards per row on phones: tighter padding, smaller number */
@media (max-width: 575.98px) {
    .stat-body {
        padding: 0.85rem;
    }

    .stat-value {
        font-size: 1.25rem;
    }

    .stat-body .icon-chip {
        width: 34px;
        height: 34px;
        border-radius: 10px;
    }
}

.page-title {
    font-size: 1.45rem;
    font-weight: 700;
    margin: 0;
}

.tabular {
    font-variant-numeric: tabular-nums;
}

.min-w-0 {
    min-width: 0;
}

.box {
    background: var(--app-surface-2);
    border: 1px solid var(--app-border);
    border-radius: 0.6rem;
    padding: 0.75rem 0.9rem;
}

/* Simple bar chart used on the dashboard */
.bar-chart {
    display: flex;
    align-items: flex-end;
    gap: 0.6rem;
    height: 200px;
}

.bar-chart .bar-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    gap: 0.4rem;
    height: 100%;
}

.bar-chart .bar {
    width: 100%;
    border-radius: 6px 6px 0 0;
    background: linear-gradient(180deg, #8b8cf6, #5b5bd6);
}

.bar-chart .bar.empty {
    background: var(--app-surface-2);
}

.bar-chart small {
    color: var(--app-muted);
    font-size: 0.7rem;
}

/* Timeline (order detail) */
.timeline {
    list-style: none;
    margin: 0;
    padding: 0;
}

.timeline li {
    position: relative;
    display: flex;
    gap: 0.75rem;
    padding-bottom: 1.1rem;
}

.timeline li:last-child {
    padding-bottom: 0;
}

.timeline li:not(:last-child)::before {
    content: "";
    position: absolute;
    left: 11px;
    top: 26px;
    bottom: 2px;
    width: 2px;
    background: var(--app-border);
}

.timeline li.done:not(:last-child)::before {
    background: var(--app-primary);
}

.timeline .dot {
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid var(--app-border);
    background: var(--app-surface);
    flex-shrink: 0;
}

.timeline li.done .dot {
    border-color: var(--app-primary);
    background: var(--app-primary);
    color: #fff;
}

/* Toasts */
.app-toast {
    position: fixed;
    left: 50%;
    bottom: 1.25rem;
    z-index: 2000;
    transform: translate(-50%, 1rem);
    padding: 0.6rem 1rem;
    border-radius: 0.6rem;
    background: #1f2937;
    color: #fff;
    font-size: 0.875rem;
    box-shadow: var(--app-shadow);
    width: max-content;
    max-width: min(34rem, calc(100vw - 2rem));
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
}

.app-toast.show {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0);
}

[data-bs-theme="dark"] .app-toast {
    background: #e2e6f0;
    color: #111827;
}

/* ---------- Login, forgot / reset password (split: brand panel + form) ---------- */
/* These pages wear the brand green (rule 5A) and the brand fonts; the rest of the panel keeps its own colours. */
.auth-page {
    --app-primary: #1e9a4b;
    --app-primary-hover: #177f3d;
    --app-primary-soft: #dcf3e4;
    --app-primary-rgb: 30, 154, 75;
    --app-focus-ring: rgba(30, 154, 75, 0.18);
    --bs-link-color: #177f3d;
    --bs-link-hover-color: #12663a;
    --bs-link-color-rgb: 23, 127, 61;
    --bs-link-hover-color-rgb: 18, 102, 58;
    --auth-panel-bg: linear-gradient(155deg, #1e9a4b 0%, #157a3b 55%, #0e5a2e 100%);
    --auth-panel-text: #ffffff;
    --auth-panel-muted: rgba(255, 255, 255, 0.82);
    --auth-main-bg: #f6f5ef;
    --auth-input-bg: #ffffff;
    min-height: 100vh;
    background: var(--auth-main-bg);
    font-family: 'Barlow', 'Noto Sans Devanagari', system-ui, -apple-system, 'Segoe UI', sans-serif;
    font-size: 1.0625rem;
}

[data-bs-theme="dark"] .auth-page,
.auth-page[data-bs-theme="dark"] {
    --app-primary: #34c26b;
    --app-primary-hover: #4fd081;
    --app-primary-soft: #173a25;
    --app-primary-rgb: 52, 194, 107;
    --app-focus-ring: rgba(52, 194, 107, 0.22);
    --bs-link-color: #5fd38b;
    --bs-link-hover-color: #7fe0a3;
    --bs-link-color-rgb: 95, 211, 139;
    --bs-link-hover-color-rgb: 127, 224, 163;
    --auth-panel-bg: linear-gradient(155deg, #145f31 0%, #0f4a27 55%, #0a331c 100%);
    --auth-main-bg: #0f1511;
    --auth-input-bg: #18211b;
}

[data-bs-theme="dark"] .auth-page .btn-primary {
    --bs-btn-color: #062712;
    --bs-btn-hover-color: #062712;
    --bs-btn-active-color: #062712;
}

.auth-split {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
}

.auth-brand {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 2rem;
    padding: 3rem clamp(2rem, 5vw, 4.5rem);
    background: var(--auth-panel-bg);
    color: var(--auth-panel-text);
}

/* Soft shapes behind the text: two rings and a dotted "route" */
.auth-brand-art {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at 85% 12%, rgba(255, 255, 255, 0.14) 0 90px, transparent 91px),
        radial-gradient(circle at 85% 12%, transparent 0 140px, rgba(255, 255, 255, 0.08) 141px 142px, transparent 143px),
        radial-gradient(circle at 10% 95%, rgba(244, 167, 44, 0.22) 0 120px, transparent 121px),
        radial-gradient(rgba(255, 255, 255, 0.12) 1.2px, transparent 1.3px) 0 0 / 22px 22px;
    mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, 0.6) 100%);
}

.auth-brand > * {
    position: relative;
}

.auth-brand-logo {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    color: inherit;
    text-decoration: none;
    font-family: 'Barlow Condensed', 'Barlow', sans-serif;
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.auth-brand-logo img {
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
}

.auth-brand-logo:hover {
    color: inherit;
}

.auth-eyebrow {
    display: inline-block;
    margin-bottom: 1rem;
    padding: 0.3rem 0.75rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.16);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.auth-brand-title {
    max-width: 14ch;
    margin-bottom: 1.25rem;
    font-family: 'Barlow Condensed', 'Barlow', sans-serif;
    font-size: clamp(2.4rem, 4.2vw, 3.75rem);
    font-weight: 700;
    line-height: 1.02;
    letter-spacing: -0.01em;
}

.auth-brand-text {
    max-width: 34ch;
    color: var(--auth-panel-muted);
    font-size: 1.15rem;
}

.auth-points {
    list-style: none;
    margin: 1.75rem 0 0;
    padding: 0;
    display: grid;
    gap: 0.85rem;
}

.auth-points li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 500;
}

.auth-points span {
    display: inline-grid;
    place-items: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.16);
}

.auth-brand-foot {
    margin: 0;
    color: var(--auth-panel-muted);
    font-size: 0.95rem;
}

.auth-brand-foot span {
    display: block;
}

.auth-main {
    display: flex;
    flex-direction: column;
    padding: 1.5rem clamp(1.25rem, 5vw, 4.5rem) 2rem;
    background: var(--auth-main-bg);
}

.auth-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.auth-back {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--app-muted);
    text-decoration: none;
    font-weight: 500;
}

.auth-back:hover {
    color: var(--app-primary);
}

.auth-form {
    width: 100%;
    max-width: 440px;
    margin: auto;
    padding: 2.5rem 0;
}

.auth-form h1 {
    font-family: 'Barlow Condensed', 'Barlow', sans-serif;
    font-size: clamp(2.1rem, 3vw, 2.6rem);
    font-weight: 700;
    letter-spacing: -0.01em;
}

.auth-form .form-label {
    font-weight: 600;
    color: var(--app-text);
}

.auth-form .form-control {
    min-height: 3.1rem;
    border-radius: 12px;
    background-color: var(--auth-input-bg);
    font-size: 1.05rem;
}

.auth-form .btn-primary {
    min-height: 3.2rem;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
}

/* Password with the eye button inside the box */
.auth-password {
    position: relative;
}

.auth-password .form-control {
    padding-right: 3.2rem;
}

.auth-password [data-toggle-password] {
    position: absolute;
    top: 0;
    right: 0;
    height: 3.1rem;
    width: 3.1rem;
    border: 0;
    background: transparent;
    color: var(--app-muted);
}

.auth-password [data-toggle-password]:hover {
    color: var(--app-primary);
}

.auth-foot {
    max-width: 440px;
    margin: 0 auto;
    color: var(--app-muted);
    font-size: 0.9rem;
    text-align: center;
}

/* Phone and small tablet: the brand panel becomes a short header */
@media (max-width: 991.98px) {
    .auth-split {
        grid-template-columns: 1fr;
    }

    .auth-brand {
        padding: 1.5rem 1.25rem 1.75rem;
        gap: 1rem;
    }

    .auth-brand-body .auth-eyebrow,
    .auth-brand-text,
    .auth-points,
    .auth-brand-foot {
        display: none;
    }

    .auth-brand-title {
        max-width: none;
        margin: 0;
        font-size: 1.9rem;
    }

    .auth-form {
        padding: 1.75rem 0;
    }
}

/* ---------- Category tiles (Categories, Shop Categories) ---------- */
.cat-tile {
    display: inline-grid;
    place-items: center;
    flex-shrink: 0;
    width: 2.5rem;
    height: 2.5rem;
    overflow: hidden;
    border-radius: 12px;
    background: hsl(var(--h, 140) var(--cat-tile-s) var(--cat-tile-l));
    color: hsl(var(--h, 140) var(--cat-ink-s) var(--cat-ink-l));
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.cat-tile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cat-tile-sm {
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 8px;
    font-size: 0.65rem;
}

.cat-tile-lg {
    width: 4rem;
    height: 4rem;
    border-radius: 16px;
    font-size: 1.1rem;
}

.cat-rule {
    font-size: 0.7rem;
}

/* Category row: open / close button, order number, then the tile */
.cat-toggle {
    display: inline-grid;
    place-items: center;
    flex-shrink: 0;
    width: 1.75rem;
    height: 1.75rem;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--app-muted);
}

.cat-group-head {
    cursor: pointer;
}

.card.is-closed > .card-header {
    border-bottom: 0;
}

button.cat-toggle:hover {
    background: var(--app-surface-2);
    color: var(--app-text);
}

.cat-toggle .icon {
    transition: transform 0.15s ease;
}

.cat-toggle[aria-expanded="true"] .icon {
    transform: rotate(90deg);
}

.cat-no {
    display: inline-grid;
    place-items: center;
    flex-shrink: 0;
    min-width: 1.5rem;
    height: 1.5rem;
    padding: 0 0.3rem;
    border-radius: 999px;
    background: var(--app-surface-2);
    color: var(--app-muted);
    font-size: 0.72rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

/*
 * The wire: subcategories hang from a line that starts under their category's tile.
 * x = cell padding (1rem) + toggle (1.75rem) + gap (0.5rem) + number (1.5rem) + gap (0.5rem) + half the tile (1.25rem) = 6.5rem.
 */
.cat-row,
.cat-sub-row {
    --cat-wire-x: 6.5rem;
    --cat-wire: color-mix(in srgb, var(--app-primary) 45%, var(--app-border));
}

.cat-row > td:first-child,
.cat-sub-row > td:first-child {
    position: relative;
}

.cat-row.is-open > td:first-child::after {
    content: '';
    position: absolute;
    left: var(--cat-wire-x);
    top: calc(50% + 1.25rem);
    bottom: 0;
    border-left: 2px solid var(--cat-wire);
}

.cat-sub-row > td:first-child {
    padding-left: calc(var(--cat-wire-x) + 1.6rem);
}

/* elbow: from the top of the row down to its middle, then right to the tile */
.cat-sub-row > td:first-child::after {
    content: '';
    position: absolute;
    left: var(--cat-wire-x);
    top: 0;
    width: 1.2rem;
    height: 50%;
    border-left: 2px solid var(--cat-wire);
    border-bottom: 2px solid var(--cat-wire);
    border-bottom-left-radius: 0.6rem;
}

/* the line goes on to the next subcategory, except after the last one */
.cat-sub-row:not(.is-last) > td:first-child::before {
    content: '';
    position: absolute;
    left: var(--cat-wire-x);
    top: 50%;
    bottom: 0;
    border-left: 2px solid var(--cat-wire);
}

.cat-sub-row > td {
    border-bottom-style: dashed;
}

.cat-check-group {
    columns: 2 220px;
    column-gap: 1.5rem;
}

.cat-check-group .form-check {
    break-inside: avoid;
}

/* ---------- Products (B4.3) ---------- */
.product-thumb {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    object-fit: cover;
    border: 1px solid var(--app-border);
    background: var(--app-surface-2);
    flex-shrink: 0;
}

.product-photos {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
    gap: 0.75rem;
}

.product-photo {
    position: relative;
    aspect-ratio: 1;
    border-radius: 12px;
    border: 1px solid var(--app-border);
    background: var(--app-surface-2);
    overflow: hidden;
    display: grid;
    place-items: center;
    color: var(--app-muted);
    font-size: 0.8125rem;
    text-align: center;
}

.product-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-photo .badge {
    position: absolute;
    left: 0.375rem;
    bottom: 0.375rem;
}

.product-photo-tools {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 0.75rem;
    margin-top: 0.375rem;
    font-size: 0.8125rem;
}

.size-table input[type="text"],
.size-table input[type="number"] {
    min-width: 68px;
}

.size-table > :not(caption) > * > * {
    padding-left: 0.375rem;
    padding-right: 0.375rem;
}

.size-table > :not(caption) > * > :first-child {
    padding-left: 1rem;
}

.size-table .size-label {
    min-width: 110px;
}

.size-table .size-qty {
    min-width: 150px;
}

.size-table .size-qty .form-select {
    flex: 0 0 68px;
    padding-right: 1.75rem;
}

/* ---------- (i) tooltips: <x-info-tip> ---------- */
.info-tip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin-left: 0.25rem;
    border: 0;
    background: none;
    color: var(--app-muted);
    vertical-align: -0.125em;
    border-radius: 50%;
    cursor: help;
}

.info-tip .icon {
    width: 14px;
    height: 14px;
}

.info-tip:hover,
.info-tip:focus-visible {
    color: var(--app-primary);
}

.info-tip:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--app-focus-ring);
}

.tip-wide {
    --bs-tooltip-max-width: 300px;
    --bs-tooltip-font-size: 0.8125rem;
    text-align: left;
    text-transform: none;
    letter-spacing: normal;
}

/* ---------- Product photos: drop zone and previews ---------- */
.product-photo img {
    object-fit: contain;
}

.photo-drop-zone {
    display: grid;
    justify-items: center;
    gap: 0.25rem;
    padding: 1.5rem 1rem;
    border: 2px dashed var(--app-border);
    border-radius: 14px;
    background: var(--app-surface-2);
    text-align: center;
    cursor: pointer;
    transition: border-color 0.15s, background-color 0.15s;
}

.photo-drop-zone:hover,
.photo-drop.is-over .photo-drop-zone {
    border-color: var(--app-primary);
    background: var(--app-primary-soft);
}

.photo-drop input[type="file"]:focus-visible + .photo-drop-zone {
    box-shadow: 0 0 0 3px var(--app-focus-ring);
}

.photo-preview-meta {
    margin-top: 0.375rem;
    font-size: 0.75rem;
    line-height: 1.35;
    color: var(--app-muted);
    word-break: break-word;
}

.photo-preview-meta .text-danger {
    display: block;
}

.product-photo .photo-remove {
    position: absolute;
    top: 0.375rem;
    right: 0.375rem;
    padding: 0.125rem 0.3rem;
    line-height: 1;
}

/* ---------- Photo viewer (layout modal #photo-viewer, admin.js) ---------- */
.photo-viewer .modal-content { background: var(--app-surface); }
.photo-viewer-stage {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 320px;
    max-height: 72vh;
    border-radius: var(--bs-border-radius-lg);
    background: var(--app-surface-2);
    overflow: hidden;
}
.photo-viewer-stage img {
    display: block;
    max-width: 100%;
    max-height: 72vh;
    object-fit: contain;
    transition: opacity .15s ease;
}
.photo-viewer-stage img.is-loading { opacity: 0; }
.photo-viewer-loading {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--app-muted);
    font-size: .875rem;
}
.photo-viewer-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--app-border);
    border-radius: 50%;
    background: var(--app-surface);
    color: var(--app-text);
    box-shadow: var(--app-shadow);
}
.photo-viewer-nav:hover, .photo-viewer-nav:focus-visible { background: var(--app-surface-2); }
.photo-viewer-nav.prev { left: .75rem; }
.photo-viewer-nav.next { right: .75rem; }
.photo-viewer-nav[hidden] { display: none; }
a[data-photo] { cursor: zoom-in; }

/* ---------- Vendor page: a shop's products (partials/shop-products) ---------- */
.shop-product-list { display: flex; flex-direction: column; }
.shop-product {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .6rem 0;
    border-top: 1px solid var(--app-border);
}
.shop-product:first-child { border-top: 0; padding-top: 0; }
.shop-product .product-thumb { width: 48px; height: 48px; }
.shop-product-status { text-align: end; flex-shrink: 0; }
/* Phones: the status goes under the name, so a long product name is not cut. */
@media (max-width: 575.98px) {
    .shop-product { flex-wrap: wrap; }
    .shop-product > .min-w-0 { flex-basis: calc(100% - 48px - .75rem); }
    .shop-product-status { flex-basis: 100%; padding-left: calc(48px + .75rem); text-align: start; }
    .shop-product-status small { display: inline !important; margin-left: .5rem; }
}

/* ---------- The person's own photo on an app user's page ---------- */
.person-photo { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; border: 1px solid var(--app-border); background: var(--app-surface-2); }

/* ---------- Banners: a banner as the Customer App draws it, and the phone preview on the form ---------- */
.banner-card {
    position: relative;
    aspect-ratio: 2 / 1;
    border-radius: 14px;
    overflow: hidden;
    background: var(--app-surface-2, var(--app-bg));
    border: 1px solid var(--app-border);
}
.banner-card img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* Before a picture is chosen: the hint sits on the right, clear of the words on the left. */
.banner-card-empty {
    position: absolute; inset: 0; display: flex; align-items: flex-end; justify-content: flex-end; gap: .4rem;
    padding: 0 5% 5% 0; color: var(--app-muted); font-size: .8rem;
}
.banner-card-text {
    position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; align-items: flex-start;
    gap: .3rem; padding: 6% 40% 6% 6%;
    background: linear-gradient(90deg, var(--banner-scrim) 0%, transparent 85%);
    color: var(--banner-text);
}
.banner-card-text[hidden] { display: none; }
.banner-card-title { font-size: clamp(1rem, 4.2cqw, 1.45rem); line-height: 1.15; font-weight: 700; }
.banner-card-subtitle { font-size: clamp(.72rem, 2.6cqw, .9rem); line-height: 1.25; opacity: .92; }
.banner-card-button {
    display: inline-flex; align-items: center; gap: .3rem; margin-top: .35rem; padding: .3rem .7rem; border-radius: 8px;
    background: var(--banner-button-bg); color: var(--banner-button-text); font-size: .8rem; font-weight: 600;
}
.banner-card-button .icon { width: 14px; height: 14px; }
.banner-card { container-type: inline-size; }

.banner-preview-sticky { position: sticky; top: 1rem; }
.phone-preview {
    max-width: 360px; margin: 0 auto; border-radius: 28px; overflow: hidden;
    border: 8px solid var(--app-phone-frame); background: var(--app-phone-bg);
}
.phone-preview-header { padding: 1.4rem .9rem .9rem; background: linear-gradient(135deg, var(--app-brand-green), var(--app-brand-green-deep)); }
.phone-preview-search {
    display: flex; align-items: center; gap: .5rem; padding: .55rem .9rem; border-radius: 999px;
    background: var(--app-phone-bg); color: var(--app-muted); font-size: .8rem;
}
.phone-preview-body { padding: .9rem; display: grid; gap: .9rem; }
.phone-preview-tiles { display: flex; gap: .7rem; }
.phone-preview-tiles span { width: 52px; height: 52px; border-radius: 50%; background: var(--app-border); }
