@import url("https://cdn.jsdelivr.net/npm/bootstrap-icons@1.13.1/font/bootstrap-icons.min.css");
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap");

/* ==========================================================================
   Theme tokens - monochrome. Reskin by changing these variables only.
   ========================================================================== */
:root {
    --bg: #fafafa;
    --surface: #ffffff;
    --surface-2: #f4f4f5;
    --surface-3: #e4e4e7;
    --border: #e4e4e7;
    --border-strong: #d4d4d8;
    --text: #09090b;
    --text-2: #3f3f46;
    --muted: #71717a;
    --faint: #a1a1aa;
    --primary: #09090b;
    --primary-fg: #fafafa;
    --primary-hover: #27272a;
    --hover: #f4f4f5;
    --active: #ececee;
    --ring: rgba(9, 9, 11, 0.14);
    --overlay: rgba(9, 9, 11, 0.4);
    --bubble-in: #f4f4f5;
    --bubble-out: #18181b;
    --bubble-out-fg: #fafafa;
    --note-bg: #fafafa;
    --chart-1: #18181b;
    --chart-2: #a1a1aa;
    /* Status. Monochrome: success, warning and info are shades of grey and are told apart by their
       icon and outline (solid, dashed, plain). Red is the only colour, kept for failures and
       destructive actions so they can't be missed. */
    --success: #18181b;
    --success-bg: #f4f4f5;
    --success-border: #d4d4d8;
    --warning: #3f3f46;
    --warning-bg: #ffffff;
    --warning-border: #a1a1aa;
    --danger: #b91c1c;
    --danger-bg: #fef2f2;
    --danger-border: #fecaca;
    --info: #52525b;
    --info-bg: #fafafa;
    --info-border: #e4e4e7;
    --whatsapp: #18181b;
    --whatsapp-fg: #fafafa;
    --tick-read: #18181b;
    --shadow-sm: 0 1px 2px rgba(9, 9, 11, 0.05);
    --shadow-md: 0 4px 16px rgba(9, 9, 11, 0.08);
    --shadow-lg: 0 24px 64px rgba(9, 9, 11, 0.18);
    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 14px;
    --sidebar-w: 248px;
    --sidebar-w-collapsed: 68px;
    --topbar-h: 64px;
    --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
    --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    /* Customer buy page: the original WifiPay kiosk palette, the same in light and dark mode. */
    --kiosk-bg: #232424;
    --kiosk-panel: #424242;
    --kiosk-row: #3f3f3f;
    --kiosk-text: #eeeeee;
    --kiosk-label: #d1d1d1;
    --kiosk-faint: #a1a1a1;
    --kiosk-border: #808080;
    --kiosk-light: #ffffff;
    --kiosk-dark: #2b2b2b;
    --kiosk-accent: #ff7900;
    --kiosk-overlay: rgba(0, 0, 0, 0.66);
    color-scheme: light;
}

:root[data-theme="dark"] {
    --bg: #0e0e10;
    --surface: #151517;
    --surface-2: #1c1c1f;
    --surface-3: #2a2a2e;
    --border: #26262a;
    --border-strong: #3f3f46;
    --text: #ededef;
    --text-2: #d4d4d8;
    --muted: #a1a1aa;
    --faint: #71717a;
    --primary: #ededef;
    --primary-fg: #0e0e10;
    --primary-hover: #e4e4e7;
    --hover: #1c1c1f;
    --active: #222225;
    --ring: rgba(250, 250, 250, 0.18);
    --overlay: rgba(0, 0, 0, 0.6);
    --bubble-in: #1c1c1f;
    --bubble-out: #f4f4f5;
    --bubble-out-fg: #09090b;
    --note-bg: #141416;
    --chart-1: #d4d4d8;
    --chart-2: #52525b;
    --success: #ededef;
    --success-bg: #1c1c1f;
    --success-border: #3f3f46;
    --warning: #d4d4d8;
    --warning-bg: transparent;
    --warning-border: #71717a;
    --danger: #f87171;
    --danger-bg: rgba(239, 68, 68, 0.1);
    --danger-border: rgba(248, 113, 113, 0.35);
    --info: #a1a1aa;
    --info-bg: transparent;
    --info-border: #3f3f46;
    --whatsapp: #ededef;
    --whatsapp-fg: #0e0e10;
    --tick-read: #ededef;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 24px 64px rgba(0, 0, 0, 0.7);
    color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg: #0e0e10;
        --surface: #151517;
        --surface-2: #1c1c1f;
        --surface-3: #2a2a2e;
        --border: #26262a;
        --border-strong: #3f3f46;
        --text: #ededef;
        --text-2: #d4d4d8;
        --muted: #a1a1aa;
        --faint: #71717a;
        --primary: #ededef;
        --primary-fg: #0e0e10;
        --primary-hover: #e4e4e7;
        --hover: #1c1c1f;
        --active: #222225;
        --ring: rgba(250, 250, 250, 0.18);
        --overlay: rgba(0, 0, 0, 0.6);
        --bubble-in: #1c1c1f;
        --bubble-out: #f4f4f5;
        --bubble-out-fg: #09090b;
        --note-bg: #141416;
        --chart-1: #d4d4d8;
        --chart-2: #52525b;
    --success: #ededef;
    --success-bg: #1c1c1f;
    --success-border: #3f3f46;
    --warning: #d4d4d8;
    --warning-bg: transparent;
    --warning-border: #71717a;
    --danger: #f87171;
    --danger-bg: rgba(239, 68, 68, 0.1);
    --danger-border: rgba(248, 113, 113, 0.35);
    --info: #a1a1aa;
    --info-bg: transparent;
    --info-border: #3f3f46;
    --whatsapp: #ededef;
    --whatsapp-fg: #0e0e10;
    --tick-read: #ededef;
        --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
        --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.5);
        --shadow-lg: 0 24px 64px rgba(0, 0, 0, 0.7);
        color-scheme: dark;
    }
}

/* ==========================================================================
   Base
   ========================================================================== */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.5;
    color: var(--text);
    background-color: var(--bg);
    -webkit-font-smoothing: antialiased;
    font-feature-settings: "cv11", "ss01";
}

a {
    color: inherit;
    text-decoration: none;
}

h1, h2, h3, h4, p {
    margin: 0;
}

button {
    font: inherit;
    color: inherit;
}

[hidden] {
    display: none !important;
}

::selection {
    background: var(--primary);
    color: var(--primary-fg);
}

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--surface-3);
    border-radius: 10px;
    border: 3px solid transparent;
    background-clip: content-box;
}

::-webkit-scrollbar-thumb:hover {
    background-color: var(--border-strong);
}

.muted {
    color: var(--muted);
}

.small {
    font-size: 12px;
}

.mono {
    font-family: var(--mono);
    font-size: 12px;
}

.nowrap {
    white-space: nowrap;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
}

/* ==========================================================================
   App shell: sidebar + main
   ========================================================================== */
.app {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    position: sticky;
    top: 0;
    width: var(--sidebar-w);
    height: 100vh;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 14px 12px;
    background: var(--surface);
    border-right: 1px solid var(--border);
    transition: width 0.2s ease;
    z-index: 30;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 6px 14px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 6px;
    min-height: 52px;
}

.brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: var(--primary);
    color: var(--primary-fg);
    display: grid;
    place-items: center;
    flex-shrink: 0;
    font-size: 17px;
}

.brand-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.brand-name {
    font-weight: 600;
    font-size: 14px;
    letter-spacing: -0.01em;
}

.brand-sub {
    font-size: 12px;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-collapse {
    margin-left: auto;
}

.nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    overflow-y: auto;
}

.nav-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--faint);
    padding: 14px 10px 6px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    color: var(--text-2);
    font-weight: 500;
    font-size: 13.5px;
    position: relative;
    white-space: nowrap;
}

.nav-item i {
    font-size: 17px;
    width: 20px;
    text-align: center;
    color: var(--muted);
}

.nav-item:hover {
    background: var(--hover);
    color: var(--text);
}

.nav-item.active {
    background: var(--active);
    color: var(--text);
}

.nav-item.active i {
    color: var(--text);
}

.nav-item.is-locked {
    opacity: 0.5;
}

.nav-lock {
    margin-left: auto;
    font-size: 11px !important;
    width: auto !important;
}

.nav-badge {
    margin-left: auto;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 10px;
    background: var(--primary);
    color: var(--primary-fg);
    font-size: 11px;
    font-weight: 600;
    display: inline-grid;
    place-items: center;
}

.sidebar-footer {
    border-top: 1px solid var(--border);
    padding-top: 10px;
    position: relative;
}

.user-button {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px;
    border: 0;
    background: transparent;
    border-radius: 8px;
    cursor: pointer;
    text-align: left;
}

.user-button:hover {
    background: var(--hover);
}

.user-meta {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}

.user-name {
    font-weight: 500;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-size: 12px;
    color: var(--muted);
}

.app.sidebar-collapsed .sidebar {
    width: var(--sidebar-w-collapsed);
}

.app.sidebar-collapsed .brand-text,
.app.sidebar-collapsed .nav-item span,
.app.sidebar-collapsed .nav-label,
.app.sidebar-collapsed .nav-lock,
.app.sidebar-collapsed .user-meta,
.app.sidebar-collapsed .user-button > .bi-chevron-expand {
    display: none;
}

.app.sidebar-collapsed .nav-item {
    justify-content: center;
}

.app.sidebar-collapsed .nav-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    min-width: 16px;
    height: 16px;
    font-size: 10px;
    padding: 0 4px;
}

.app.sidebar-collapsed .brand {
    flex-direction: column;
    gap: 8px;
}

.app.sidebar-collapsed .sidebar-collapse {
    margin-left: 0;
    transform: rotate(180deg);
}

.sidebar-overlay {
    display: none;
}

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

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    min-height: var(--topbar-h);
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 28px;
    background: color-mix(in srgb, var(--bg) 85%, transparent);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}

.topbar-title {
    flex: 1;
    min-width: 0;
}

.topbar-title h1 {
    font-size: 18px;
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.3;
}

.topbar-title p {
    color: var(--muted);
    font-size: 13px;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.drawer-toggle {
    display: none;
}

.page {
    padding: 24px 28px 48px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
    max-width: 1280px;
}

.page-narrow {
    max-width: 880px;
}

.page-full {
    max-width: none;
    padding: 0;
    flex: 1;
    min-height: 0;
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    height: 36px;
    padding: 0 14px;
    border-radius: 8px;
    border: 1px solid transparent;
    font-size: 13.5px;
    font-weight: 500;
    line-height: 1;
    cursor: pointer;
    white-space: nowrap;
    transition: background-color 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s;
    user-select: none;
}

.btn i {
    font-size: 15px;
}

.btn:focus-visible,
.icon-btn:focus-visible,
.nav-item:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--ring);
}

.btn-primary {
    background: var(--primary);
    color: var(--primary-fg);
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-secondary {
    background: var(--surface);
    border-color: var(--border);
    color: var(--text);
    box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
    background: var(--hover);
    border-color: var(--border-strong);
}

.btn-ghost {
    background: transparent;
    color: var(--text-2);
}

.btn-ghost:hover {
    background: var(--hover);
    color: var(--text);
}

.btn-danger {
    background: transparent;
    border-color: var(--border-strong);
    color: var(--text);
}

.btn-danger:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--primary-fg);
}

.btn-sm {
    height: 30px;
    padding: 0 10px;
    font-size: 12.5px;
    border-radius: 7px;
}

.btn-lg {
    height: 42px;
    padding: 0 18px;
    font-size: 14px;
}

.btn-block {
    width: 100%;
}

.btn[disabled],
.btn[aria-disabled="true"] {
    opacity: 0.45;
    pointer-events: none;
}

.icon-btn {
    width: 34px;
    height: 34px;
    display: inline-grid;
    place-items: center;
    border: 1px solid transparent;
    background: transparent;
    border-radius: 8px;
    color: var(--muted);
    cursor: pointer;
    font-size: 17px;
    flex-shrink: 0;
}

.icon-btn:hover {
    background: var(--hover);
    color: var(--text);
}

.icon-btn[disabled] {
    opacity: 0.3;
    pointer-events: none;
}

.icon-btn.bordered {
    border-color: var(--border);
    background: var(--surface);
}

.icon-btn.active {
    background: var(--active);
    color: var(--text);
}

/* ==========================================================================
   Forms
   ========================================================================== */
.form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.form-row-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.field > label,
.label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
}

.form-hint {
    font-size: 12px;
    color: var(--muted);
}

.form-error {
    font-size: 12px;
    color: var(--text);
    font-weight: 500;
    min-height: 16px;
}

.form-error:not(:empty)::before {
    content: "\F33B";
    font-family: "bootstrap-icons";
    margin-right: 5px;
}

.input,
.select,
.textarea {
    width: 100%;
    height: 38px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
    font: inherit;
    font-size: 14px;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
    box-shadow: var(--shadow-sm);
}

.textarea {
    height: auto;
    min-height: 90px;
    padding: 10px 12px;
    resize: vertical;
    line-height: 1.5;
}

.select {
    appearance: none;
    padding-right: 34px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 16 16'%3E%3Cpath fill='%2371717a' d='M8 11L3 6h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}

.input::placeholder,
.textarea::placeholder {
    color: var(--faint);
}

.input:focus,
.select:focus,
.textarea:focus {
    border-color: var(--text);
    box-shadow: 0 0 0 3px var(--ring);
}

.input[readonly] {
    background: var(--surface-2);
    color: var(--text-2);
}

.input-sm,
.select-sm {
    height: 32px;
    font-size: 13px;
    padding: 0 10px;
}

.select-sm {
    padding-right: 30px;
    background-position: right 10px center;
}

.input-group {
    display: flex;
    gap: 8px;
    align-items: center;
}

.input-group .input {
    flex: 1;
}

.input-icon {
    position: relative;
}

.input-icon > i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--faint);
    pointer-events: none;
}

.input-icon .input {
    padding-left: 36px;
}

.input-icon .icon-btn {
    position: absolute;
    right: 3px;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
}

.checkbox {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    cursor: pointer;
    color: var(--text-2);
}

.checkbox input,
.check {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
    cursor: pointer;
    margin: 0;
}

.switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 13px;
}

.switch input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.switch-track {
    width: 36px;
    height: 20px;
    border-radius: 20px;
    background: var(--surface-3);
    position: relative;
    transition: background 0.15s;
    flex-shrink: 0;
}

.switch-track::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--surface);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
    transition: transform 0.15s;
}

.switch input:checked + .switch-track {
    background: var(--primary);
}

.switch input:checked + .switch-track::after {
    transform: translateX(16px);
    background: var(--primary-fg);
}

.switch input:focus-visible + .switch-track {
    box-shadow: 0 0 0 3px var(--ring);
}

.form-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    align-items: center;
}

/* ==========================================================================
   Cards, stats, lists
   ========================================================================== */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    min-width: 0;
}

.card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}

.card-header h2,
.card-header h3 {
    font-size: 15px;
    font-weight: 600;
    letter-spacing: -0.01em;
    flex: 1;
}

.card-header p {
    color: var(--muted);
    font-size: 13px;
}

.card-title-group {
    flex: 1;
    min-width: 0;
}

.card-body {
    padding: 20px;
}

.card-footer {
    padding: 14px 20px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.grid-dashboard {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    gap: 20px;
}

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
}

.stat {
    padding: 16px 18px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.stat-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--muted);
    font-size: 13px;
    font-weight: 500;
}

.stat-top i {
    font-size: 16px;
}

.stat-value {
    font-size: 28px;
    font-weight: 600;
    letter-spacing: -0.03em;
    line-height: 1.1;
}

.stat-sub {
    font-size: 12px;
    color: var(--muted);
}

.list-plain {
    list-style: none;
    margin: 0;
    padding: 0;
}

.list-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border);
}

.list-row:last-child {
    border-bottom: 0;
}

a.list-row:hover {
    background: var(--hover);
}

.list-row-main {
    flex: 1;
    min-width: 0;
}

.list-row-title {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.list-row-sub {
    font-size: 12.5px;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Tables */
.table-wrap {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
}

.table th {
    text-align: left;
    font-weight: 500;
    font-size: 12px;
    color: var(--muted);
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
    background: var(--surface-2);
    white-space: nowrap;
}

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

.table tr:last-child td {
    border-bottom: 0;
}

.table tbody tr:hover {
    background: var(--hover);
}

.table .col-check {
    width: 40px;
    padding-right: 0;
}

.table .col-actions {
    width: 1%;
    white-space: nowrap;
    text-align: right;
}

.cell-main {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.cell-title {
    font-weight: 500;
}

/* Avatars, badges, chips */
.avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--surface-3);
    color: var(--text);
    display: inline-grid;
    place-items: center;
    font-size: 12px;
    font-weight: 600;
    flex-shrink: 0;
    letter-spacing: 0.02em;
}

.avatar-sm {
    width: 24px;
    height: 24px;
    font-size: 10px;
}

.avatar-lg {
    width: 56px;
    height: 56px;
    font-size: 18px;
}

.avatar-dark {
    background: var(--primary);
    color: var(--primary-fg);
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 22px;
    padding: 0 8px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 500;
    white-space: nowrap;
    border: 1px solid var(--border-strong);
    color: var(--text-2);
    background: transparent;
}

.badge i {
    font-size: 10px;
}

.badge-solid {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--primary-fg);
}

.badge-outline {
    border-color: var(--text-2);
    color: var(--text);
}

.badge-dashed {
    border-style: dashed;
    border-color: var(--text-2);
    color: var(--text);
}

.badge-muted {
    background: var(--surface-2);
    border-color: var(--border);
    color: var(--muted);
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 22px;
    padding: 0 8px;
    border-radius: 6px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    font-size: 12px;
    color: var(--text-2);
    white-space: nowrap;
}

.chip button {
    border: 0;
    background: transparent;
    padding: 0;
    margin-left: 2px;
    cursor: pointer;
    color: var(--muted);
    font-size: 13px;
    line-height: 1;
}

.chip button:hover {
    color: var(--text);
}

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.kbd {
    font-family: var(--mono);
    font-size: 11px;
    padding: 1px 5px;
    border-radius: 4px;
    border: 1px solid var(--border-strong);
    background: var(--surface-2);
}

/* Tabs */
.tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
}

.tab {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 10px 12px;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--muted);
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    white-space: nowrap;
    background: transparent;
    border-top: 0;
    border-left: 0;
    border-right: 0;
    cursor: pointer;
}

.tab:hover {
    color: var(--text);
}

.tab.active {
    color: var(--text);
    border-bottom-color: var(--text);
}

.tab .count {
    font-size: 11px;
    color: var(--muted);
    background: var(--surface-2);
    border-radius: 999px;
    padding: 1px 7px;
}

/* Counts that need someone's action (Orders tab, "To process" filter) */
.count.count-strong {
    background: var(--primary);
    color: var(--primary-fg);
}

.segmented .count {
    font-size: 11px;
    color: var(--muted);
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0 6px;
    min-width: 20px;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.segmented .count.count-strong,
.segmented .count.badge-warning {
    border-color: transparent;
}

.segmented .count.count-strong {
    background: var(--primary);
    color: var(--primary-fg);
}

.segmented .count.badge-warning {
    background: var(--warning-bg);
    color: var(--warning);
}

.segmented {
    display: inline-flex;
    padding: 3px;
    gap: 2px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 9px;
}

.segmented button,
.segmented a {
    border: 0;
    background: transparent;
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 12.5px;
    font-weight: 500;
    color: var(--muted);
    cursor: pointer;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.segmented .active {
    background: var(--surface);
    color: var(--text);
    box-shadow: var(--shadow-sm);
}

/* Dropdown menus */
.dropdown {
    position: relative;
    display: inline-flex;
}

.menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 200px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    padding: 5px;
    z-index: 60;
    display: none;
    max-height: 340px;
    overflow-y: auto;
}

.menu.open {
    display: block;
}

.menu.menu-floating {
    position: fixed;
    right: auto;
    bottom: auto;
    z-index: 150;
}

.menu.menu-up {
    top: auto;
    bottom: calc(100% + 6px);
}

.menu.menu-left {
    right: auto;
    left: 0;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 9px;
    width: 100%;
    padding: 7px 9px;
    border: 0;
    background: transparent;
    border-radius: 6px;
    font-size: 13px;
    text-align: left;
    color: var(--text);
    cursor: pointer;
    white-space: nowrap;
}

.menu-item i {
    color: var(--muted);
    font-size: 15px;
    width: 16px;
}

.menu-item:hover,
.menu-item.focused {
    background: var(--hover);
}

.menu-item.selected::after {
    content: "\F633";
    font-family: "bootstrap-icons";
    margin-left: auto;
    font-size: 13px;
}

.menu-sep {
    height: 1px;
    background: var(--border);
    margin: 5px 0;
}

.menu-heading {
    font-size: 11px;
    font-weight: 600;
    color: var(--faint);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 8px 9px 4px;
}

/* Empty states */
.empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 8px;
    padding: 48px 24px;
    color: var(--muted);
}

.empty-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--surface-2);
    display: grid;
    place-items: center;
    font-size: 22px;
    color: var(--text);
    margin-bottom: 4px;
}

.empty h3 {
    color: var(--text);
    font-size: 15px;
    font-weight: 600;
}

.empty p {
    max-width: 380px;
    font-size: 13.5px;
}

.empty .btn {
    margin-top: 8px;
}

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    border-top: 1px solid var(--border);
}

.pagination-label {
    font-size: 13px;
    color: var(--muted);
}

/* Toolbar (search + filters above lists) */
.toolbar {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
}

.toolbar .input-icon {
    flex: 1;
    min-width: 200px;
    max-width: 380px;
}

.toolbar-spacer {
    flex: 1;
}

.bulk-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    background: var(--surface-2);
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}

/* Alerts / callouts */
.callout {
    display: flex;
    gap: 12px;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface-2);
    font-size: 13.5px;
}

.callout > i {
    font-size: 18px;
    flex-shrink: 0;
    margin-top: 1px;
}

.callout-strong {
    background: var(--primary);
    color: var(--primary-fg);
    border-color: var(--primary);
}

.callout-strong .btn-secondary {
    box-shadow: none;
}

.callout-dashed {
    border-style: dashed;
    border-color: var(--border-strong);
    background: transparent;
}

.copy-field {
    display: flex;
    align-items: center;
    gap: 8px;
}

.copy-field .input {
    font-family: var(--mono);
    font-size: 12.5px;
}

/* ==========================================================================
   Modal (native <dialog>), toasts, loader
   ========================================================================== */
.modal {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 0;
    width: min(560px, calc(100vw - 32px));
    max-height: calc(100vh - 48px);
    background: var(--surface);
    color: var(--text);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.modal.modal-lg {
    width: min(760px, calc(100vw - 32px));
}

.modal::backdrop {
    background: var(--overlay);
    backdrop-filter: blur(2px);
}

.modal[open] {
    display: flex;
    flex-direction: column;
    animation: modal-in 0.16s ease-out;
}

@keyframes modal-in {
    from {
        opacity: 0;
        transform: translateY(8px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

/* Most modals wrap header/body/footer in a <form>; it has to pass the height limit down so the
   body (not the whole dialog) scrolls and the footer buttons stay visible. */
.modal > form {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    max-height: inherit;
}

.modal-header,
.modal-footer {
    flex-shrink: 0;
}

.modal-body {
    flex: 1 1 auto;
    min-height: 0;
    overscroll-behavior: contain;
}

.modal-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 18px 20px 14px;
    border-bottom: 1px solid var(--border);
}

.modal-header h2 {
    font-size: 16px;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.modal-header p {
    font-size: 13px;
    color: var(--muted);
    margin-top: 2px;
}

.modal-header .icon-btn {
    margin-left: auto;
    margin-top: -4px;
    margin-right: -6px;
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
}

.modal-footer {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    padding: 14px 20px;
    border-top: 1px solid var(--border);
    background: var(--surface-2);
}

.toasts {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 200;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 260px;
    max-width: 380px;
    padding: 12px 14px;
    border-radius: var(--radius);
    background: var(--primary);
    color: var(--primary-fg);
    box-shadow: var(--shadow-lg);
    font-size: 13.5px;
    pointer-events: auto;
    animation: toast-in 0.2s ease-out;
}

.toast.toast-error {
    background: var(--surface);
    color: var(--text);
    border: 1.5px dashed var(--text);
}

.toast i {
    font-size: 16px;
}

@keyframes toast-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

.loader-overlay {
    position: fixed;
    inset: 0;
    background: var(--overlay);
    display: none;
    place-items: center;
    z-index: 300;
}

.loader-overlay.show {
    display: grid;
}

.spinner {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2.5px solid var(--surface-3);
    border-top-color: var(--primary);
    animation: spin 0.7s linear infinite;
}

.loader-overlay .spinner {
    width: 36px;
    height: 36px;
    border-color: rgba(255, 255, 255, 0.25);
    border-top-color: #ffffff;
}

.spinner-sm {
    width: 16px;
    height: 16px;
    border-width: 2px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.skeleton {
    background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 37%, var(--surface-2) 63%);
    background-size: 400% 100%;
    animation: shimmer 1.3s ease infinite;
    border-radius: 6px;
}

@keyframes shimmer {
    0% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0 50%;
    }
}

/* ==========================================================================
   Auth pages
   ========================================================================== */
.auth-shell {
    flex: 1;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    min-height: 100vh;
}

.auth-aside {
    background: var(--primary);
    color: var(--primary-fg);
    padding: 48px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}

.auth-aside::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image: radial-gradient(color-mix(in srgb, var(--primary-fg) 12%, transparent) 1px, transparent 1px);
    background-size: 22px 22px;
    mask-image: linear-gradient(to bottom, transparent, black 60%);
    pointer-events: none;
}

.auth-aside .brand-mark {
    background: var(--primary-fg);
    color: var(--primary);
}

.auth-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 15px;
}

.auth-pitch {
    position: relative;
    z-index: 1;
}

.auth-pitch h2 {
    font-size: 30px;
    line-height: 1.15;
    letter-spacing: -0.03em;
    font-weight: 600;
    max-width: 440px;
}

.auth-pitch ul {
    list-style: none;
    padding: 0;
    margin: 24px 0 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    font-size: 14px;
    opacity: 0.85;
}

.auth-pitch li {
    display: flex;
    gap: 10px;
    align-items: center;
}

.auth-main {
    display: grid;
    place-items: center;
    padding: 32px 20px;
}

.auth-card {
    width: 100%;
    max-width: 380px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.auth-card-wide {
    max-width: 460px;
}

.auth-card h1 {
    font-size: 24px;
    font-weight: 600;
    letter-spacing: -0.03em;
}

.auth-card .lead {
    color: var(--muted);
    margin-top: 4px;
}

.auth-alt {
    text-align: center;
    font-size: 13.5px;
    color: var(--muted);
}

.auth-alt a {
    color: var(--text);
    font-weight: 500;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.inline-error {
    display: flex;
    gap: 8px;
    align-items: center;
    padding: 10px 12px;
    border: 1.5px dashed var(--text);
    border-radius: 8px;
    font-size: 13px;
}

/* ==========================================================================
   Dashboard
   ========================================================================== */
.chart {
    width: 100%;
    height: auto;
    display: block;
}

.chart text {
    fill: var(--muted);
    font-size: 11px;
    font-family: var(--font);
}

.chart .bar-in {
    fill: var(--chart-2);
}

.chart .bar-out {
    fill: var(--chart-1);
}

.chart .grid-line {
    stroke: var(--border);
    stroke-width: 1;
}

.legend {
    display: flex;
    gap: 14px;
    font-size: 12px;
    color: var(--muted);
}

.legend span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.legend i {
    width: 10px;
    height: 10px;
    border-radius: 3px;
    display: inline-block;
}

.checklist {
    display: flex;
    flex-direction: column;
}

.check-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border);
}

.check-item:last-child {
    border-bottom: 0;
}

.check-dot {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 1.5px dashed var(--border-strong);
    display: grid;
    place-items: center;
    font-size: 12px;
    flex-shrink: 0;
}

.check-item.done .check-dot {
    background: var(--primary);
    border: 0;
    color: var(--primary-fg);
}

.check-item.done .list-row-title {
    color: var(--muted);
    text-decoration: line-through;
}

.progress {
    height: 6px;
    border-radius: 6px;
    background: var(--surface-3);
    overflow: hidden;
    display: flex;
}

.progress > span {
    display: block;
    height: 100%;
    background: var(--primary);
}

.progress > span.light {
    background: var(--faint);
}

/* ==========================================================================
   Settings
   ========================================================================== */
.settings-layout {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 28px;
    align-items: start;
}

.settings-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
    position: sticky;
    top: calc(var(--topbar-h) + 24px);
}

.settings-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 0;
}

.hours-grid {
    display: grid;
    grid-template-columns: 120px 1fr 1fr auto;
    gap: 8px 12px;
    align-items: center;
    font-size: 13px;
}

.hours-grid .head {
    font-size: 12px;
    color: var(--muted);
    font-weight: 500;
}

.connection-status {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.connection-status .automation-icon {
    width: 44px;
    height: 44px;
    font-size: 20px;
}

.steps-guide {
    margin: 0;
    padding-left: 18px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 13px;
    color: var(--text-2);
}

/* ==========================================================================
   Status colours (success / warning / danger / info). Kept after the components
   so they override the monochrome defaults on equal specificity.
   ========================================================================== */
.badge-success {
    background: var(--success-bg);
    border-color: var(--success-border);
    color: var(--success);
}

.badge-warning {
    background: var(--warning-bg);
    border-color: var(--warning-border);
    color: var(--warning);
}

.badge-danger {
    background: var(--danger-bg);
    border-color: var(--danger-border);
    color: var(--danger);
}

.badge-info {
    background: var(--info-bg);
    border-color: var(--info-border);
    color: var(--info);
}

.tab .count.badge-warning {
    background: var(--warning-bg);
    color: var(--warning);
}

.tone-success { background: var(--success-bg); color: var(--success); border-color: var(--success-border); }
.tone-warning { background: var(--warning-bg); color: var(--warning); border-color: var(--warning-border); }
.tone-danger { background: var(--danger-bg); color: var(--danger); border-color: var(--danger-border); }
.tone-info { background: var(--info-bg); color: var(--info); border-color: var(--info-border); }

.banner.tone-warning,
.banner.tone-danger,
.banner.tone-info {
    border-bottom-width: 1px;
    border-bottom-style: solid;
}

.banner-strong.tone-info {
    background: var(--info);
    color: #ffffff;
    border-color: var(--info);
}

/* Errors */
.form-error,
.msg-error,
.msg-meta .bi-exclamation-circle {
    color: var(--danger);
}

.inline-error {
    border: 1px solid var(--danger-border);
    background: var(--danger-bg);
    color: var(--danger);
}

.toast.toast-error {
    background: var(--surface);
    color: var(--danger);
    border: 1px solid var(--danger-border);
    border-left: 4px solid var(--danger);
}

.btn-danger {
    color: var(--danger);
    border-color: var(--danger-border);
}

.btn-danger:hover {
    background: var(--danger);
    border-color: var(--danger);
    color: #ffffff;
}

.msg.failed .bubble {
    outline: 1.5px solid var(--danger-border);
    outline-offset: 1px;
}

/* Inbox */
.tick-read {
    color: var(--tick-read);
}

.unread-dot,
.nav-badge {
    background: var(--success);
    color: #ffffff;
}

:root[data-theme="dark"] .unread-dot,
:root[data-theme="dark"] .nav-badge {
    color: #052e16;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .unread-dot,
    :root:not([data-theme="light"]) .nav-badge {
        color: #052e16;
    }
}

.window-warning {
    color: var(--warning);
    font-weight: 500;
}

.window-shut {
    color: var(--danger);
    font-weight: 500;
}

.window-closed {
    border-color: var(--warning-border);
    background: var(--warning-bg);
    color: var(--text);
}

.window-closed > i {
    color: var(--warning);
}

.conv-meta .bi-robot,
.event-line .bi-robot,
.bubble-label .bi-robot {
    color: var(--info);
}

.msg.out .bubble-label .bi-robot {
    color: inherit;
}

.conv-meta .bi-hourglass-bottom {
    color: var(--warning);
}

/* WhatsApp connection */
.connection-status.is-connected .automation-icon {
    background: var(--success-bg);
    border-color: var(--success-border);
    color: var(--whatsapp);
}

.connection-status.is-error .automation-icon {
    background: var(--danger-bg);
    border-color: var(--danger-border);
    color: var(--danger);
}

.check-item.done .check-dot {
    background: var(--success);
    color: #ffffff;
}

/* Campaign and usage bars */
.progress > span {
    background: var(--success);
}

.progress > span.light {
    background: var(--success-border);
}

/* ==========================================================================
   Billing
   ========================================================================== */
.plan-notice {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 10px 12px;
    margin-bottom: 8px;
    border-radius: 10px;
    border: 1px solid;
    font-size: 12.5px;
    line-height: 1.4;
}

.plan-notice i {
    font-size: 16px;
    margin-top: 1px;
}

.app.sidebar-collapsed .plan-notice span {
    display: none;
}

.meters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px;
}

.meter {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.meter-top {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    font-size: 13px;
    color: var(--text-2);
}

.meter-top i {
    color: var(--muted);
    margin-right: 4px;
}

.meter.is-high .progress > span {
    background: var(--warning);
}

.meter.is-high .meter-top b {
    color: var(--warning);
}

.meter.is-full .progress > span {
    background: var(--danger);
}

.meter.is-full .meter-top b {
    color: var(--danger);
}

.plan-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 14px;
    align-items: start;
}

.plan-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 22px 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.plan-card.is-featured {
    border: 1.5px solid var(--text);
    box-shadow: var(--shadow-md);
}

.plan-card h3 {
    font-size: 16px;
    font-weight: 600;
}

.plan-flag {
    position: absolute;
    top: -11px;
    right: 16px;
}

.plan-price {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.plan-amount {
    font-size: 24px;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.plan-features {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 13px;
    color: var(--text-2);
    flex: 1;
}

.plan-features i {
    color: var(--success);
    margin-right: 4px;
}

/* ==========================================================================
   Platform console - always dark, so operators never mistake it for a workspace
   ========================================================================== */
.sidebar-platform {
    background: #0b0b0d;
    border-right-color: #1f1f23;
    color: #e4e4e7;
}

.sidebar-platform .brand,
.sidebar-platform .sidebar-footer {
    border-color: #1f1f23;
}

.sidebar-platform .brand-mark {
    background: var(--warning);
    color: #0b0b0d;
}

.sidebar-platform .brand-sub,
.sidebar-platform .user-role {
    color: #a1a1aa;
}

.sidebar-platform .nav-item {
    color: #d4d4d8;
}

.sidebar-platform .nav-item i {
    color: #a1a1aa;
}

.sidebar-platform .nav-item:hover,
.sidebar-platform .nav-item.active {
    background: #1c1c20;
    color: #ffffff;
}

.sidebar-platform .nav-item.active i {
    color: var(--warning);
}

.sidebar-platform .avatar {
    background: #27272a;
    color: #fafafa;
}

.nav-badge.nav-badge-warning {
    background: var(--warning);
    color: #0b0b0d;
}

.auth-shell-platform {
    background: #0b0b0d;
    color: #fafafa;
    --surface: #111113;
    --border: #27272a;
    --text: #fafafa;
    --muted: #a1a1aa;
    --primary: #fafafa;
    --primary-fg: #09090b;
    --primary-hover: #e4e4e7;
}

.auth-shell-platform .brand-mark {
    background: var(--warning);
    color: #0b0b0d;
}

/* Operator support view of a workspace: a fixed amber bar that can't be missed */
.support-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 40px;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 16px;
    background: var(--warning);
    color: #1c1917;
    font-size: 13px;
    overflow: hidden;
    white-space: nowrap;
}

.support-bar span {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.support-bar .btn {
    background: #1c1917;
    color: #ffffff;
}

body.support-mode {
    padding-top: 40px;
}

body.support-mode .sidebar {
    top: 40px;
    height: calc(100vh - 40px);
}

body.support-mode .topbar {
    top: 40px;
}

body.support-mode .inbox {
    height: calc(100vh - 40px);
}

.risk-word {
    background: var(--danger-bg);
    color: var(--danger);
    border-radius: 3px;
    padding: 0 2px;
    font-weight: 600;
}

/* Shop */
.product-thumb {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid var(--border);
    background: var(--surface-2);
}

.product-thumb-empty {
    display: inline-grid;
    place-items: center;
    color: var(--faint);
}

/* Support tickets */
.ticket-thread {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ticket-msg {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 14px 16px;
    box-shadow: var(--shadow-sm);
    margin-right: 48px;
}

.ticket-msg.from-support {
    margin-right: 0;
    margin-left: 48px;
    border-color: var(--info-border);
    background: var(--info-bg);
}

.ticket-msg.is-internal {
    margin-left: 48px;
    margin-right: 0;
    border: 1.5px dashed var(--warning-border);
    background: var(--warning-bg);
}

.ticket-msg header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 13px;
}

.ticket-body {
    font-size: 14px;
    line-height: 1.55;
    overflow-wrap: anywhere;
}

/* Coexistence (WhatsApp Business app + Cloud API on one number) */
.connect-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.connect-option {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
}

.connect-option.is-recommended {
    border: 1.5px solid var(--whatsapp);
}

.connect-option h3 {
    font-size: 14px;
    font-weight: 600;
    display: flex;
    gap: 8px;
    align-items: center;
}

.connect-option h3 i {
    color: var(--whatsapp);
    font-size: 18px;
}

.connect-option ul {
    margin: 0;
    padding-left: 18px;
    font-size: 12.5px;
    color: var(--text-2);
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.btn-whatsapp {
    background: var(--whatsapp);
    color: var(--whatsapp-fg);
}

.btn-whatsapp:hover {
    filter: brightness(0.95);
}

.bubble-label .bi-phone {
    color: inherit;
}

/* ==========================================================================
   WifiPay: hotspots, packages, vouchers and the customer buy page
   ========================================================================== */
.plan-card.is-current {
    border: 1.5px solid var(--text);
}

.plan-card ul {
    display: flex;
    flex-direction: column;
    gap: 6px;
    list-style: none;
    font-size: 13px;
    color: var(--text-2);
}

.plan-card .plan-price {
    flex-direction: row;
    align-items: baseline;
    font-size: 22px;
    font-weight: 600;
}

.plan-card .plan-price span {
    font-size: 13px;
    font-weight: 400;
    color: var(--muted);
}

.detail-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px 24px;
}

.detail-list dt {
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 2px;
}

.detail-list dd {
    margin: 0;
    font-size: 14px;
    word-break: break-word;
}

tr[data-href] {
    cursor: pointer;
}

tr[data-href]:hover > td {
    background: var(--hover, rgba(0, 0, 0, .03));
}

.fail-reason {
    max-width: 260px;
    margin-top: 4px;
    font-size: 12px;
    color: var(--danger, #b42318);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.event-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.event-list li {
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr);
    gap: 12px;
    padding: 10px 0;
    border-top: 1px solid var(--border);
    font-size: 14px;
}

.event-list li:first-child {
    border-top: 0;
}

.text-danger {
    color: var(--danger);
}

/* Platform gateways: the IP whitelisting tracker */
.wl-summary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 32px;
    border-bottom: 1px solid var(--border);
}

.wl-summary > div,
.wl-stat {
    display: grid;
    gap: 2px;
}

.wl-summary b {
    font-size: 18px;
    font-variant-numeric: tabular-nums;
}

.wl-stat {
    padding: 6px 10px;
    margin: -6px -10px;
    border-radius: 8px;
    color: inherit;
    text-decoration: none;
}

.wl-stat:hover,
.wl-stat.active {
    background: var(--hover);
}

.wl-detail {
    max-width: 340px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Platform emails: the audience choices, the actions and the live preview */
.audience-options {
    display: grid;
    gap: 8px;
    margin: 0;
    padding: 0;
    border: 0;
}

.audience-option {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.audience-option:has(input:checked) {
    border-color: var(--text);
    box-shadow: 0 0 0 3px var(--ring);
}

.audience-option input {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--primary);
}

.audience-text {
    display: grid;
    gap: 2px;
    font-size: 14px;
}

.audience-count {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.email-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.email-compose {
    align-items: start;
}

.email-preview-card {
    position: sticky;
    top: 20px;
    overflow: hidden;
}

.email-preview {
    display: block;
    width: 100%;
    height: 680px;
    border: 0;
    border-top: 1px solid var(--border);
    background: #f4f2ef;
}

.detail-list-compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 16px;
}

.grid-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 14px;
}

.card-link {
    color: inherit;
    text-decoration: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.card-link:hover {
    border-color: var(--border-strong);
    box-shadow: var(--shadow-md);
}

.card-danger {
    border-color: var(--danger-border);
}

/* Sections reached by #anchor links clear the sticky topbar. */
.card[id] {
    scroll-margin-top: calc(var(--topbar-h) + 16px);
}

.video-embed {
    position: relative;
    width: 100%;
    max-width: 560px;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: var(--surface-2);
    border-radius: var(--radius);
}

.video-embed iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.steps {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-left: 20px;
    font-size: 14px;
    line-height: 1.5;
}

.code-block {
    margin: 0 0 12px;
    padding: 14px;
    overflow-x: auto;
    font-family: var(--mono);
    font-size: 12.5px;
    line-height: 1.6;
    white-space: pre;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.weekday-chips {
    gap: 12px;
}

.input-lg {
    height: 48px;
    font-size: 17px;
}

/* Customer buy page: one column, thumb-friendly, no sidebar. */
.portal-shell {
    min-height: 100vh;
    width: 100%;
    background: var(--bg);
}

.portal {
    display: flex;
    flex-direction: column;
    gap: 18px;
    max-width: 520px;
    margin: 0 auto;
    padding: 28px 16px 40px;
}

.portal-header h1 {
    margin-top: 14px;
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.portal-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
}

.package-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.package-card {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas: "name price" "meta price";
    gap: 2px 12px;
    align-items: center;
    width: 100%;
    padding: 16px 18px;
    text-align: left;
    font: inherit;
    color: inherit;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: border-color 0.15s, transform 0.1s;
}

.package-card:hover {
    border-color: var(--border-strong);
}

.package-card:active {
    transform: scale(0.99);
}

.package-card.is-offer {
    border: 1.5px solid var(--warning-border);
    background: var(--warning-bg);
}

.package-name {
    grid-area: name;
    font-weight: 600;
    font-size: 16px;
}

.package-meta {
    grid-area: meta;
    font-size: 13px;
    color: var(--muted);
}

.package-price {
    grid-area: price;
    font-weight: 700;
    font-size: 16px;
    white-space: nowrap;
}

.portal-actions {
    display: flex;
    justify-content: center;
}

.portal-footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px 16px;
}

.portal-waiting {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 32px 24px;
    text-align: center;
}

.voucher-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 12px;
    padding: 18px;
    border: 1.5px dashed var(--border-strong);
    border-radius: var(--radius-lg);
}

.voucher-package {
    font-weight: 600;
}

.voucher-code {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
}

.voucher-code span {
    font-size: 13px;
    color: var(--muted);
}

.voucher-code b {
    font-family: var(--mono);
    font-size: 22px;
    letter-spacing: 0.04em;
    word-break: break-all;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.history-item:last-child {
    border-bottom: 0;
}

/* Printable voucher cards (/packages/<id>/print/<batch>) */
.print-sheet {
    flex: 1;
    padding: 20px;
}

.print-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

.print-toolbar .btn.active {
    border-color: var(--text);
}

.voucher-sheet {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 10px;
}

.print-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 10px 12px;
    background: #fff;
    color: #09090b;
    border: 1px dashed #a1a1aa;
    border-radius: 8px;
    break-inside: avoid;
}

.print-card.is-used {
    opacity: 0.4;
}

.print-card-head {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    font-size: 11px;
}

.print-card-head span {
    color: #71717a;
}

.print-card-body {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.print-package {
    font-size: 12px;
    font-weight: 600;
}

.print-meta,
.print-foot {
    font-size: 10px;
    color: #71717a;
}

.print-code {
    margin-top: 4px;
    font-family: var(--mono);
    font-size: 19px;
    font-weight: 700;
    letter-spacing: 0.06em;
}

.print-qr svg {
    display: block;
    width: 72px;
    height: 72px;
}

@media print {
    body,
    .app {
        background: #fff;
    }

    .no-print,
    .toasts,
    .sidebar,
    .sidebar-overlay {
        display: none !important;
    }

    .print-sheet {
        padding: 0;
    }

    .voucher-sheet {
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
    }
}

/* ==========================================================================
   Polish: monochrome status shapes, calmer surfaces, readable numbers
   ========================================================================== */
/* Status is carried by shape and icon, not colour: solid = done, dashed = needs attention,
   plain = neutral. Only failures are red. */
.badge-success {
    font-weight: 500;
}

.badge-warning {
    border-style: dashed;
}

/* Numbers line up in columns and tiles. */
.table,
.stat-value,
.num,
.package-price,
.detail-list dd,
.bars-axis {
    font-variant-numeric: tabular-nums;
}

/* The menu button is for small screens only (a later .icon-btn rule would otherwise show it). */
.topbar .drawer-toggle {
    display: none;
}

.stat {
    transition: border-color 0.15s;
}

.stat-top {
    font-weight: 500;
}

.card-header h2 {
    letter-spacing: -0.01em;
}

/* Long URLs: one line, cut with an ellipsis, with the copy button beside them. */
.copy-line {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.truncate {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.copy-line .icon-btn {
    flex: none;
    width: 28px;
    height: 28px;
}

.plan-card ul {
    margin: 0;
    padding: 0;
}

/* Destructive areas are marked by their button, not a red frame. */
.card-danger {
    border-color: var(--border);
}

/* Offers on the buy page: same calm card, with a label instead of a colour. */
.package-card.is-offer {
    background: var(--surface);
    border: 1.5px solid var(--text);
}

.package-tag {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 7px;
    border-radius: 999px;
    background: var(--primary);
    color: var(--primary-fg);
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    vertical-align: 2px;
}

/* Bar charts (core/ui.php renderBarChart) */
.bars {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 10px;
    height: 200px;
}

.bars-axis {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding-bottom: 22px;
    font-size: 11px;
    color: var(--faint);
    text-align: right;
}

.bars-axis span {
    line-height: 1;
    transform: translateY(-50%);
}

.bars-axis span:last-child {
    transform: none;
}

.bars-plot {
    display: flex;
    gap: 4px;
    min-width: 0;
    background-image: linear-gradient(to bottom, var(--border) 1px, transparent 1px);
    background-size: 100% calc((100% - 22px) / 2);
    background-repeat: repeat-y;
}

.bar {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.bar-track {
    flex: 1;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    border-bottom: 1px solid var(--border-strong);
}

.bar-track span {
    display: block;
    width: 100%;
    max-width: 34px;
    background: var(--chart-1);
    opacity: 0.55;
    border-radius: 3px 3px 0 0;
    transition: opacity 0.15s;
}

.bar.is-current .bar-track span,
.bar:hover .bar-track span {
    opacity: 1;
}

.bar small {
    height: 16px;
    font-size: 11px;
    line-height: 16px;
    color: var(--faint);
    text-align: center;
    white-space: nowrap;
}

.bar.is-current small {
    color: var(--text);
    font-weight: 600;
}

/* Sign-in panel: dark in both themes, never a bright white half-screen in dark mode. */
:root[data-theme="dark"] .auth-aside {
    background: var(--surface-2);
    color: var(--text);
}

:root[data-theme="dark"] .auth-aside .brand-mark {
    background: var(--text);
    color: var(--bg);
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .auth-aside {
        background: var(--surface-2);
        color: var(--text);
    }

    :root:not([data-theme="light"]) .auth-aside .brand-mark {
        background: var(--text);
        color: var(--bg);
    }
}

/* ==========================================================================
   Responsive - kept at the end so overrides win on equal specificity
   ========================================================================== */
/* Shop reports */
.grid-split-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
}

.tone-text-warning {
    color: var(--warning);
    font-weight: 600;
}

/* Automation builder: integration steps */
.flow-rows {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: flex-start;
}

.flow-rows > .flow-inline {
    width: 100%;
}

.flow-inline > .icon-btn,
.flow-inline > label,
.flow-inline > .btn {
    flex: 0 0 auto;
    min-width: 0;
}

.textarea-sm {
    font-size: 13px;
    padding: 8px 10px;
}

.callout.small {
    padding: 8px 12px;
    font-size: 12.5px;
}

/* Inbox: deleting stored media */
.media-wrap {
    position: relative;
}

.media-delete {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 0;
    background: rgba(0, 0, 0, .55);
    color: #fff;
    display: grid;
    place-items: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity .15s;
}

.media-wrap:hover .media-delete,
.media-delete:focus-visible {
    opacity: 1;
}

.media-deleted {
    color: var(--muted);
    font-style: italic;
}

/* ==========================================================================
   Customer buy page, classic design (app/portal.php): the original WifiPay
   kiosk - dark card, logo, Purchase / History tabs, package rows with a Buy
   button, and its own pop-up. Every class is kiosk-* so nothing leaks into or
   out of the dashboard styles.
   ========================================================================== */
.kiosk-page {
    position: fixed;
    inset: 0;
    overflow-y: auto;
    background: var(--kiosk-bg);
    color: var(--kiosk-light);
    font-family: Arial, Helvetica, sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 0;
}

.kiosk {
    width: 400px;
    max-width: 100%;
    margin: auto;
    border-radius: 10px;
    box-shadow: 0 0 8px #000;
}

.kiosk-body {
    padding: 20px;
}

.kiosk-heading {
    text-align: center;
    padding-bottom: 5px;
}

.kiosk-heading img {
    display: inline-block;
    width: 50px;
    margin-bottom: 10px;
}

.kiosk-heading h3,
.kiosk-pop h3 {
    margin: 0 0 5px;
    font-size: 18px;
    font-weight: 700;
    color: var(--kiosk-light);
    text-align: center;
}

.kiosk-label {
    color: var(--kiosk-label);
    font-size: 11px;
    text-align: center;
}

.kiosk-tabs {
    text-align: center;
    padding: 10px;
    margin-bottom: 10px;
}

.kiosk-tabs-inner {
    display: inline-flex;
    gap: 10px;
    width: 300px;
    max-width: 100%;
    border-radius: 15px;
    background: var(--kiosk-panel);
}

.kiosk-tab {
    flex: 1;
    padding: 10px;
    font: inherit;
    font-size: 12px;
    color: var(--kiosk-light);
    background: none;
    border: 0;
    border-radius: 15px;
    cursor: pointer;
}

.kiosk-tab.is-active {
    background: var(--kiosk-light);
    color: #000;
}

.kiosk-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 0 0 10px;
    margin: 0;
}

.kiosk-row {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px;
    font-size: 11px;
    color: var(--kiosk-text);
    background: var(--kiosk-row);
    border-radius: 4px;
}

.kiosk-row > i {
    width: 25px;
    flex: none;
}

.kiosk-name {
    flex: 1;
    min-width: 0;
}

.kiosk-row-head {
    font-weight: 700;
}

.kiosk-buy {
    width: 60px;
    flex: none;
    padding: 4px;
    font: inherit;
    font-size: 11px;
    text-align: center;
    color: var(--kiosk-panel);
    background: var(--kiosk-light);
    border: 1px solid var(--kiosk-light);
    border-radius: 4px;
    cursor: pointer;
}

.kiosk-buy:hover {
    background: transparent;
    color: var(--kiosk-light);
}

.kiosk-buy:disabled {
    background: transparent;
    color: var(--kiosk-faint);
    border-color: var(--kiosk-border);
    cursor: not-allowed;
}

.kiosk-row.is-sold-out {
    opacity: 0.6;
}

.kiosk-fieldset {
    padding: 0;
    margin: 10px 0 5px;
    border: 1px solid var(--kiosk-border);
    border-radius: 8px;
    background: var(--kiosk-panel);
    overflow: hidden;
}

.kiosk-fieldset legend {
    margin-left: 0.75em;
    padding-inline: 0.5em;
    font-size: 13px;
}

.kiosk-fieldset .kiosk-row {
    border-radius: 0;
}

.kiosk-box {
    display: flex;
    align-items: center;
}

.kiosk-box i {
    width: 30px;
    text-align: center;
}

.kiosk-box input {
    flex: 1;
    min-width: 0;
    padding: 0.7em 0.5em 0.9em;
    font-size: 13px;
    color: var(--kiosk-light);
    background: transparent;
    border: 0;
}

.kiosk-box input:focus {
    outline: 0;
}

.kiosk-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.kiosk-submit {
    flex: 1;
    padding: 8px;
    font: inherit;
    font-size: 12px;
    color: var(--kiosk-dark);
    background: var(--kiosk-light);
    border: 2px solid var(--kiosk-light);
    border-radius: 8px;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
}

.kiosk-submit:hover {
    background: var(--kiosk-panel);
    color: var(--kiosk-light);
}

.kiosk-submit.is-secondary {
    background: transparent;
    color: var(--kiosk-light);
}

.kiosk-empty {
    text-align: center;
    color: var(--kiosk-light);
    font-size: 18px;
    margin: 20px 0;
}

.kiosk-logos {
    text-align: center;
    padding-top: 10px;
}

.kiosk-logos img {
    display: inline-block;
    width: 30px;
    margin: 0 2px;
    border-radius: 6px;
}

.kiosk-footer {
    margin-top: 10px;
    font-size: 11px;
    color: var(--kiosk-faint);
    text-align: center;
}

/* ads.wifipay.ug (app/ads.php): the old "Login Successful" card - a bit narrower, smaller logo, grey title */
.kiosk-ads {
    width: 350px;
}

.kiosk-ads .kiosk-heading img {
    width: 40px;
    margin-bottom: 0;
}

.kiosk-ads .kiosk-heading h3 {
    font-size: 16px;
    color: var(--kiosk-label);
}

.kiosk-ads .kiosk-list {
    gap: 1.2rem;
}

/* Pop-up (buy form, payment waiting, voucher, history) */
.kiosk-pop-bg {
    position: fixed;
    inset: 0;
    z-index: 97;
    background: var(--kiosk-overlay);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.kiosk-pop-bg[hidden] {
    display: none;
}

.kiosk-pop {
    width: 320px;
    max-width: 100%;
    max-height: 100%;
    overflow-y: auto;
    padding: 20px;
    border-radius: 10px;
    background: var(--kiosk-bg);
    color: var(--kiosk-light);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 13px;
}

.kiosk-pop-close {
    display: block;
    margin-left: auto;
    padding: 0 4px;
    font-size: 18px;
    color: var(--kiosk-light);
    background: none;
    border: 0;
    cursor: pointer;
}

.kiosk-pop h2 {
    margin: 0 0 20px;
    padding-bottom: 5px;
    font-size: 18px;
    font-weight: 700;
    text-align: center;
    border-bottom: 1px solid var(--kiosk-light);
}

.kiosk-code {
    font-size: 16px;
    font-family: var(--mono);
    letter-spacing: 0.04em;
}

.kiosk-voucher {
    padding: 4px 0;
    background: var(--kiosk-bg);
}

.kiosk-link {
    cursor: pointer;
    text-decoration: underline;
}

/* "Transaction initiated" spinner: two discs splitting apart */
.kiosk-spinner {
    display: block;
    margin: 20px 0;
    text-align: center;
}

.kiosk-spinner span {
    position: relative;
    display: inline-block;
    width: 64px;
    height: 48px;
    animation: kiosk-split 1s ease-in infinite alternate;
}

.kiosk-spinner span::before,
.kiosk-spinner span::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--kiosk-accent);
    opacity: 0.75;
    transform: translateX(-10px);
}

.kiosk-spinner span::after {
    left: auto;
    right: 0;
    background: var(--kiosk-light);
    transform: translateX(10px);
}

@keyframes kiosk-split {
    0%, 25% { width: 64px; }
    100% { width: 148px; }
}

@media (max-width: 1280px) {
    .inbox {
        grid-template-columns: 300px minmax(0, 1fr) 280px;
    }

    .inbox.panel-hidden {
        grid-template-columns: 300px minmax(0, 1fr) 0;
    }
}

@media (max-width: 1100px) {
    .inbox,
    .inbox.panel-hidden {
        grid-template-columns: 300px minmax(0, 1fr);
    }

    .contact-panel {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        width: 320px;
        z-index: 45;
        box-shadow: var(--shadow-lg);
        transform: translateX(100%);
        transition: transform 0.2s ease;
    }

    .inbox:not(.panel-hidden) .contact-panel {
        transform: none;
    }

    .inbox.panel-hidden .contact-panel {
        display: block;
    }

    .builder {
        grid-template-columns: minmax(0, 1fr);
    }

    .builder-side {
        position: static;
    }

    .grid-dashboard {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 992px) {
    .email-compose {
        grid-template-columns: minmax(0, 1fr);
    }

    .email-preview-card {
        position: static;
    }

    .sidebar,
    .app.sidebar-collapsed .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        width: 272px;
        transform: translateX(-100%);
        transition: transform 0.22s ease;
        box-shadow: var(--shadow-lg);
        z-index: 50;
    }

    .app.sidebar-collapsed .brand-text,
    .app.sidebar-collapsed .nav-item span,
    .app.sidebar-collapsed .nav-label,
    .app.sidebar-collapsed .user-meta {
        display: revert;
    }

    .app.sidebar-collapsed .nav-item {
        justify-content: flex-start;
    }

    .app.sidebar-collapsed .brand {
        flex-direction: row;
    }

    .app.sidebar-collapsed .nav-badge {
        position: static;
    }

    .sidebar-collapse {
        display: none;
    }

    .app.drawer-open .sidebar {
        transform: none;
    }

    .app.drawer-open .sidebar-overlay {
        display: block;
        position: fixed;
        inset: 0;
        background: var(--overlay);
        z-index: 40;
    }

    .drawer-toggle {
        display: inline-grid;
        margin-left: -6px;
    }

    .topbar {
        padding: 10px 16px;
    }

    .page {
        padding: 16px 16px 40px;
    }

    .settings-layout {
        grid-template-columns: minmax(0, 1fr);
        gap: 16px;
    }

    /* Settings tabs wrap into chips on small screens, so every tab is in view without sideways scrolling. */
    .settings-nav {
        position: static;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 8px;
    }

    .settings-nav .nav-item {
        padding: 8px 12px;
        min-height: 40px;
        border: 1px solid var(--border);
        border-radius: 999px;
        background: var(--surface);
    }

    .settings-nav .nav-item.active {
        border-color: var(--primary);
        background: var(--primary);
        color: var(--primary-fg);
    }

    .settings-nav .nav-item.active i {
        color: var(--primary-fg);
    }

    .grid-2 {
        grid-template-columns: minmax(0, 1fr);
    }

    .auth-shell {
        grid-template-columns: minmax(0, 1fr);
    }

    .auth-aside {
        display: none;
    }
}

@media (max-width: 768px) {
    .inbox,
    .inbox.panel-hidden {
        grid-template-columns: minmax(0, 1fr);
        height: 100dvh;
    }

    .inbox .thread-pane {
        display: none;
    }

    .inbox.thread-open .conv-pane {
        display: none;
    }

    .inbox.thread-open .thread-pane {
        display: flex;
    }

    .thread-back {
        display: inline-grid;
    }

    .contact-panel {
        width: 100%;
    }

    .msg {
        max-width: 88%;
    }

    .messages {
        padding: 16px 12px;
    }

    .form-row,
    .form-row-3 {
        grid-template-columns: minmax(0, 1fr);
    }

    .recipe-grid,
    .connect-options {
        grid-template-columns: minmax(0, 1fr);
    }

    .flow {
        padding: 14px 10px;
    }

    .flow-branches {
        grid-template-columns: minmax(0, 1fr);
    }

    .hours-grid {
        grid-template-columns: 90px 1fr 1fr auto;
        gap: 6px 8px;
    }

    .topbar-title p {
        display: none;
    }

    .toasts {
        left: 16px;
        right: 16px;
        bottom: 16px;
    }

    .toast {
        max-width: none;
    }

    .hide-sm,
    .table .hide-sm {
        display: none;
    }

    .stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .modal-footer {
        flex-wrap: wrap;
    }
}

@media (hover: none) {
    .media-delete {
        opacity: 1;
    }
}

/* Small screens (kept last): menu button back, tighter tiles and charts. */
@media (max-width: 992px) {
    .topbar .drawer-toggle {
        display: inline-grid;
    }
}

@media (max-width: 768px) {
    .stat-value {
        font-size: 21px;
    }

    .bars {
        height: 160px;
    }

    .bars-plot {
        gap: 2px;
    }
}

/* Sold-out packages on the buy page: visible but clearly unavailable. */
.package-card.is-sold-out,
.package-card:disabled {
    cursor: not-allowed;
    opacity: 0.5;
    box-shadow: none;
}

.package-card.is-sold-out .package-price {
    font-weight: 500;
    font-size: 13px;
    color: var(--muted);
}

/* Customer buy page (classic kiosk) on phones */
@media (max-width: 500px) {
    .kiosk {
        width: 95%;
    }

    .kiosk-body {
        padding: 10px;
    }

    .kiosk-pop {
        padding: 14px;
    }

    .kiosk-tabs-inner {
        width: 90%;
    }
}
