/* ==========================================================================
   HushHive Portal — design system
   ========================================================================== */

:root {
    --primary: #0066cc;
    --primary-dark: #0b2a5b;
    --primary-light: #e6f0fb;
    --accent: #f36c00;
    --bg: #f5f8fc;
    --surface: #ffffff;
    --surface-alt: #f8fafc;
    --text: #0f172a;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --success: #16a34a;
    --success-bg: #dcfce7;
    --danger: #dc2626;
    --danger-bg: #fee2e2;
    --warning: #d97706;
    --warning-bg: #fef3c7;
    --info-bg: #e0f2fe;
    --radius: 0.75rem;
    --radius-sm: 0.5rem;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
    --shadow: 0 4px 16px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.14);
    --sidebar-w: 260px;
    --font: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    --success-text: #166534;
    --warning-text: #92400e;
    --info-text: #0369a1;
    --secondary: #475569;
    --secondary-bg: #e2e8f0;
    --link: #0066cc;
    --link-hover: #0b2a5b;
    --gradient-end: #2f8fff;
    --brand-glow: rgba(0, 102, 204, 0.55);
    --header-bg: #ffffff;
    --header-text: #0f172a;
    --sidebar-bg: #0b2a5b;
    --sidebar-bg-end: #084d9e;
    --sidebar-text: #cbd5f5;
    --sidebar-text-strong: #bfdbfe;
    --sidebar-text-muted: #7a9be0;
    --sidebar-active-bg: #ffffff;
    --sidebar-active-text: #0b2a5b;
    --input-bg: #ffffff;
    --input-border: #e2e8f0;
    --input-focus: #0066cc;
    --input-focus-ring: rgba(0, 102, 204, 0.15);
    --input-placeholder: #94a3b8;
    --button-text: #ffffff;
    --button-border: #e2e8f0;
    --table-header-bg: #f8fafc;
    --table-header-text: #64748b;
    --muted-bg: var(--surface-alt);
    --card-bg: var(--surface);
    --surface-elevated: var(--surface);
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; overflow-x: hidden; overflow-x: clip; }

body {
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.5;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    overflow-x: clip;
}

a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-hover); }

h1, h2, h3, h4 { margin: 0 0 0.5em; font-weight: 600; line-height: 1.25; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }

p { margin: 0 0 1em; }

.container { width: 100%; max-width: 1280px; margin: 0 auto; padding: 0 1.25rem; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.55rem 1rem;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    font-size: 0.9rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s;
    background: none;
    color: var(--text);
    text-decoration: none;
    white-space: nowrap;
}
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    color: var(--button-text);
    border: none;
    box-shadow: 0 2px 6px rgba(0, 102, 204, 0.25);
}
.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
    color: var(--button-text);
    box-shadow: 0 4px 10px rgba(0, 102, 204, 0.35);
}

.btn-secondary { background: var(--surface); border-color: var(--button-border); color: var(--text); }
.btn-secondary:hover:not(:disabled) { background: var(--surface-alt); border-color: #cbd5e1; }

.btn-success {
    background: linear-gradient(135deg, var(--success) 0%, #22c55e 100%);
    color: var(--button-text);
    border: none;
}
.btn-success:hover:not(:disabled) { background: linear-gradient(135deg, #15803d 0%, #16a34a 100%); color: var(--button-text); }

.btn-danger {
    background: linear-gradient(135deg, var(--danger) 0%, #f87171 100%);
    color: var(--button-text);
    border: none;
}
.btn-danger:hover:not(:disabled) { background: linear-gradient(135deg, #b91c1c 0%, #dc2626 100%); color: var(--button-text); }

.btn-danger-outline { background: var(--surface); border-color: var(--danger); color: var(--danger); }
.btn-danger-outline:hover:not(:disabled) { background: var(--danger); color: #fff; }

.btn-sm { padding: 0.35rem 0.7rem; font-size: 0.8rem; }
.btn-block { width: 100%; }

/* ---------- Forms ---------- */
.form-group { margin-bottom: 1.1rem; }
.form-label {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
}
.form-control {
    width: 100%;
    padding: 0.6rem 0.8rem;
    font-size: 0.92rem;
    font-family: inherit;
    color: var(--text);
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: var(--radius-sm);
    transition: border-color 0.15s, box-shadow 0.15s;
}
.form-control:focus {
    outline: none;
    border-color: var(--input-focus);
    box-shadow: 0 0 0 3px var(--input-focus-ring);
}
.form-control.is-invalid { border-color: var(--danger); }
.form-control::placeholder { color: var(--input-placeholder); }
textarea.form-control { resize: vertical; min-height: 90px; }

.form-hint { font-size: 0.78rem; color: var(--text-muted); margin-top: 0.3rem; }

.form-error { font-size: 0.8rem; color: var(--danger); margin-top: 0.3rem; }

.form-check { display: flex; align-items: center; gap: 0.55rem; margin-bottom: 0.6rem; cursor: pointer; }
.form-check input { width: 1.05rem; height: 1.05rem; accent-color: var(--primary); }
.form-check .form-check-label { font-size: 0.88rem; color: var(--text); }

.input-group { display: flex; }
.input-group .form-control:first-child { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.input-group .btn { border-top-left-radius: 0; border-bottom-left-radius: 0; }

.password-wrap { position: relative; }
.password-wrap .form-control { padding-right: 3rem; }
.password-toggle {
    position: absolute; right: 0.2rem; top: 50%; transform: translateY(-50%);
    border: 0; background: none; color: var(--text-muted); cursor: pointer;
    padding: 0.5rem; font-size: 0.9rem;
}

/* ---------- Cards ---------- */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}
.card-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}
.card-header h3 { margin: 0; }
.card-body { padding: 1.25rem; }
.segmented {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    padding: 0.25rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg);
}
.segmented a {
    padding: 0.45rem 0.9rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    border-radius: calc(var(--radius) - 2px);
    text-decoration: none;
    white-space: nowrap;
}
.segmented a:hover { color: var(--text); background: var(--surface); }
.segmented a.active {
    color: #fff;
    background: var(--accent, var(--primary));
}
@media (max-width: 640px) {
    .segmented { width: 100%; }
    .segmented a { flex: 1 1 auto; text-align: center; }
}
.card-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 0.6rem;
}

/* ---------- Stats ----------
   Cards size themselves to their content and share the row: a card with a
   long value (e.g. an email) grows wider instead of clipping text. When a
   row runs out of width, cards flow onto the next line. */
.stats-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.stat-card { flex: 1 1 auto; }

/* clickable stat cards (operator dashboard) */
a.stat-link { text-decoration: none; color: inherit; }

a.stat-link .stat-card {
    height: 100%;
    transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}

a.stat-link:hover .stat-card,
a.stat-link:focus-visible .stat-card {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}
.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.1rem 1.25rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 1rem;
}
.stat-icon {
    width: 3rem; height: 3rem;
    border-radius: var(--radius-sm);
    display: grid; place-items: center;
    font-size: 1.3rem; font-weight: 700;
    flex-shrink: 0;
}
.stat-icon.blue { background: var(--primary-light); color: var(--primary-dark); }
.stat-icon.green { background: var(--success-bg); color: var(--success-text); }
.stat-icon.red { background: var(--danger-bg); color: var(--danger); }
.stat-icon.amber { background: var(--warning-bg); color: var(--warning); }
.stat-icon.sky { background: var(--info-bg); color: var(--info-text); }
.stat-icon.info { background: var(--info-bg); color: var(--info-text); }
.stat-icon.gray { background: var(--surface-alt); color: var(--text-muted); }
.stat-label { font-size: 0.78rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.stat-value {
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.2;
}

/* ---------- Long-text adaptation ----------------------------------------
   Full text always visible: the card grows to fit its value, text is never
   trimmed, never pushed outside its box, and only emergency-wraps when a
   single unbreakable string is wider than the screen itself. ------------ */
.stat-value {
    max-width: 100%;
    white-space: normal;
    overflow-wrap: break-word;
}

.stat-value.sm { font-size: 1.05rem; }

.page-header h1,
.page-header .sub,
.detail-value,
.table th,
.table td {
    overflow-wrap: break-word;
}

.badge {
    max-width: 100%;
    overflow-wrap: break-word;
}

/* ---------- Badges ---------- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.22rem 0.6rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.3;
}
.badge-success { background: var(--success-bg); color: var(--success-text); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-warning { background: var(--warning-bg); color: var(--warning-text); }
.badge-info { background: var(--info-bg); color: var(--info-text); }
.badge-secondary { background: var(--secondary-bg); color: var(--secondary); }
.badge-primary { background: var(--primary-light); color: var(--primary-dark); }

.badge-sm {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.05rem 0.45rem;
    margin-left: 0.4rem;
    vertical-align: middle;
    line-height: 1.4;
}

.badge-dot::before {
    content: ''; width: 0.45rem; height: 0.45rem; border-radius: 50%;
    background: currentColor;
}

/* ---------- Alerts ---------- */
.alert {
    padding: 0.8rem 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
    font-size: 0.9rem;
    line-height: 1.5;
}
.alert-success { background: var(--success-bg); color: var(--success-text); }
.alert-danger { background: var(--danger-bg); color: var(--danger); }
.alert-warning { background: var(--warning-bg); color: var(--warning-text); }
.alert-info { background: var(--info-bg); color: var(--info-text); }

/* ---------- Actions ---------- */
.actions--right { justify-content: flex-end; }

/* ---------- Wallet / money sign ---------- */
.money-credit { color: var(--success); font-weight: 600; }
.money-debit { color: var(--danger); font-weight: 600; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}
.table th {
    text-align: left;
    padding: 0.7rem 1rem;
    color: var(--table-header-text);
    font-weight: 600;
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 1px solid var(--border);
    background: var(--table-header-bg);
    white-space: nowrap;
}
.table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--surface-alt); }
.table .actions { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.table .actions .btn { padding: 0.3rem 0.6rem; font-size: 0.78rem; }
.table .check-col { width: 2.6rem; text-align: center; }
.table .check-col input { accent-color: var(--primary); }

/* ---------- Bulk actions toolbar ---------- */
.bulk-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    padding: 0.8rem 1.25rem;
    border-bottom: 1px solid var(--border);
}
.bulk-bar .select-all-label {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    cursor: pointer;
    user-select: none;
}
.bulk-bar .bulk-selected { font-size: 0.85rem; color: var(--text-muted); }
.bulk-bar .bulk-selected strong { color: var(--text); }
.bulk-bar .btn:disabled { opacity: 0.45; cursor: not-allowed; }


/* ---------- Pagination ---------- */
.pagination {
    display: flex;
    gap: 0.35rem;
    justify-content: flex-end;
    padding: 1rem 0 0;
    flex-wrap: wrap;
}
.pagination a, .pagination span {
    padding: 0.4rem 0.7rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    color: var(--text);
    text-decoration: none;
}
.pagination a:hover { border-color: var(--primary); color: var(--primary); }
.pagination .current { background: var(--primary); border-color: var(--primary); color: #fff; 
}
.pagination .disabled { opacity: 0.5; pointer-events: none; }
.pagination .gap { border: 0; padding: 0.4rem 0.2rem; color: var(--text-muted); }
/* ---------- Layout shell ---------- */
.shell { display: flex; min-height: 100vh; }

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--sidebar-w);
    background: linear-gradient(180deg, var(--sidebar-bg) 0%, var(--sidebar-bg) 55%, var(--sidebar-bg-end) 100%);
    color: #fff;
    display: flex;
    flex-direction: column;
    z-index: 60;
    transition: transform 0.25s ease;
}
.sidebar-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    padding: 1.1rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    text-align: center;
}
.sidebar-brand .brand-mark {
    width: 2.3rem; height: 2.3rem;
    background: #fff;
    color: var(--primary-dark);
    border-radius: 0.6rem;
    display: grid; place-items: center;
    font-weight: 800; font-size: 1.15rem;
}
.sidebar-brand .brand-name { font-weight: 700; font-size: 1.05rem; }
.sidebar-brand .brand-role { font-size: 0.72rem; color: var(--sidebar-text-strong); text-transform: uppercase; letter-spacing: 0.05em; }

.sidebar-nav { flex: 1; overflow-y: auto; padding: 0.8rem 0.75rem; }
.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.6rem 0.85rem;
    border-radius: var(--radius-sm);
    color: var(--sidebar-text);
    font-size: 0.9rem;
    margin-bottom: 0.15rem;
    transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}
.sidebar-nav a:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }
.sidebar-nav a.active { background: var(--sidebar-active-bg); color: var(--sidebar-active-text); font-weight: 600; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.07); }
.sidebar-nav .nav-group-label {
    margin-top: 1.4rem;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--sidebar-text-muted);
    padding: 0 0.85rem 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.sidebar-nav .nav-group-label::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
}
.sidebar-nav > .nav-group-label:first-child { margin-top: 0; }
.sidebar-nav a,
.sidebar-nav .nav-toggle { transition: background-color .18s ease, color .18s ease; }
.sidebar-nav::-webkit-scrollbar { width: 6px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .18); border-radius: 999px; }
.sidebar-nav .nav-group { margin-bottom: 0.15rem; }
.sidebar-nav .nav-toggle {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    width: 100%;
    padding: 0.6rem 0.85rem;
    border: 0;
    background: none;
    cursor: pointer;
    border-radius: var(--radius-sm);
    color: var(--sidebar-text);
    font-size: 0.9rem;
    text-align: left;
    transition: background 0.18s ease, color 0.18s ease;
}
.sidebar-nav .nav-toggle:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }
.sidebar-nav .nav-toggle-label { flex: 1; }
.sidebar-nav .nav-toggle-icon { flex: 0 0 auto; }
.sidebar-nav .nav-toggle-caret {
    font-size: 0.7rem;
    color: #93b4f8;
    transition: transform 0.15s ease;
}
.sidebar-nav .nav-group.open .nav-toggle-caret { transform: rotate(180deg); }
.sidebar-nav .nav-submenu { display: none; padding: 0.1rem 0 0.3rem; }
.sidebar-nav .nav-group.open .nav-submenu { display: block; }
.sidebar-nav .nav-submenu a { padding-left: 2.5rem; font-size: 0.85rem; }
.sidebar-nav .nav-badge {
    margin-left: auto;
    min-width: 1.3rem;
    height: 1.3rem;
    padding: 0 0.4rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 600;
    line-height: 1;
}
.sidebar-nav .nav-badge-hot {
    background: var(--danger);
    color: #fff;
}
.sidebar-nav .nav-badge-balance {
    background: rgba(16, 185, 129, 0.22);
    color: #6ee7b7;
    font-weight: 700;
    font-size: 0.68rem;
}
.sidebar-nav .nav-badge-zero {
    background: rgba(255, 255, 255, 0.14);
    color: #b6c9f2;
    font-weight: 500;
}
.sidebar-foot { padding: 0.9rem 1.25rem; border-top: 1px solid rgba(255, 255, 255, 0.12); font-size: 0.75rem; color: var(--sidebar-text-strong); }

.main { flex: 1; margin-left: var(--sidebar-w); display: flex; flex-direction: column; min-height: 100vh; min-width: 0; }

.topbar {
    background: var(--header-bg);
    color: var(--header-text);
    border-bottom: 1px solid var(--border);
    height: 4rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 50;
}
.menu-toggle {
    display: none;
    border: 0; background: none; cursor: pointer;
    font-size: 1.3rem; color: var(--text);
    padding: 0.3rem;
}
.topbar-title {
    font-size: 1rem;
    font-weight: 600;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.topbar-spacer { flex: 1; }

.notif-wrap { position: relative; }
.notif-btn {
    border: 1px solid var(--border);
    background: var(--surface);
    border-radius: var(--radius-sm);
    padding: 0.45rem 0.65rem;
    cursor: pointer;
    position: relative;
    color: var(--text);
}
.notif-count {
    position: absolute;
    top: -0.35rem; right: -0.35rem;
    min-width: 1.15rem; height: 1.15rem;
    background: var(--danger); color: #fff;
    border-radius: 999px;
    font-size: 0.68rem;
    display: grid; place-items: center;
    padding: 0 0.25rem;
    font-weight: 700;
}
.notif-dropdown {
    display: none;
    position: absolute;
    right: 0; top: calc(100% + 0.4rem);
    width: min(320px, calc(100vw - 2rem));
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    z-index: 70;
}
.notif-dropdown.open { display: block; }
.notif-dropdown-head {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    font-weight: 600; font-size: 0.9rem;
    display: flex; justify-content: space-between; align-items: center;
}
.notif-dropdown-body { max-height: 320px; overflow-y: auto; }
.notif-item {
    display: block;
    padding: 0.7rem 1rem;
    border-bottom: 1px solid var(--border);
    color: var(--text);
}
.notif-item:hover { background: var(--surface-alt); text-decoration: none; color: var(--text); }
.notif-item.unread { background: var(--primary-light); }
.notif-item .notif-title {
    font-weight: 600;
    font-size: 0.85rem;
    overflow-wrap: anywhere;
}
.notif-item .notif-msg {
    font-size: 0.8rem;
    color: var(--text-muted);
    overflow-wrap: anywhere;
}
.notif-item .notif-time { font-size: 0.72rem; color: var(--text-muted); margin-top: 0.2rem; }

.user-menu-wrap { position: relative; }
.user-menu-btn {
    display: flex; align-items: center; gap: 0.6rem;
    border: 0; background: none; cursor: pointer;
    padding: 0.35rem;
    color: var(--text);
    font-family: inherit;
    min-width: 0;
}
/* long operator names must never push the topbar wider */
.user-menu-btn > span:not(.avatar) {
    max-width: clamp(4rem, 30vw, 12rem);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.avatar {
    width: 2.2rem; height: 2.2rem;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: grid; place-items: center;
    font-weight: 700; font-size: 0.85rem;
    flex-shrink: 0;
}
.user-menu {
    display: none;
    position: absolute;
    right: 0; top: calc(100% + 0.4rem);
    width: min(220px, calc(100vw - 2rem));
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 0.4rem;
    z-index: 70;
}
.user-menu.open { display: block; }
.user-menu a, .user-menu button {
    display: flex; align-items: center; gap: 0.6rem;
    width: 100%;
    padding: 0.55rem 0.7rem;
    border: 0; background: none; cursor: pointer;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    color: var(--text);
    font-family: inherit;
    text-decoration: none;
}
.user-menu a:hover, .user-menu button:hover { background: var(--surface-alt); }
.user-menu .menu-divider { border-top: 1px solid var(--border); margin: 0.3rem 0; }

.content { padding: 1.5rem; flex: 1; }

/* Uniform vertical rhythm between top-level blocks of every page
   (page header, filters, stat rows, cards, grids...). Sibling margins
   collapse, so blocks that carry their own bottom margin stay tidy. */
.content > * + * { margin-top: 1.25rem; }

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
}
.page-header h1 { margin: 0; font-size: 1.4rem; }
.page-header .sub { color: var(--text-muted); font-size: 0.88rem; margin-top: 0.15rem; }

/* header action buttons (Back / Credit / Debit etc.) wrap and stretch
   instead of overflowing on narrow screens */
.page-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* ---------- Service intro banner (apply pages) ---------- */
.service-intro {
    display: flex;
    align-items: flex-start;
    gap: 0.9rem;
    padding: 1rem 1.15rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
}
.service-intro-icon {
    width: 2.7rem; height: 2.7rem;
    display: grid; place-items: center;
    flex-shrink: 0;
    background: var(--primary-light);
    color: var(--primary-dark);
    border-radius: 12px;
    font-size: 1.35rem;
    line-height: 1;
}
.service-intro-body { flex: 1; min-width: 0; }
.service-intro-name {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.service-intro-name h2 {
    margin: 0;
    font-size: 1.02rem;
    line-height: 1.25;
    overflow-wrap: anywhere;
}
.service-intro-desc {
    margin: 0.35rem 0 0;
    color: var(--text-muted);
    font-size: 0.88rem;
    line-height: 1.55;
    overflow-wrap: anywhere;
}
.service-intro-extra { flex-shrink: 0; }

/* ---------- Back link ---------- */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin-bottom: 1.25rem;
    padding: 0.5rem 0.95rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    color: var(--text);
    font-size: 0.84rem;
    font-weight: 500;
    line-height: 1;
    text-decoration: none;
    transition: color 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
}
.back-link span[aria-hidden] {
    font-size: 0.95rem;
    transition: transform 0.12s ease;
}
.back-link:hover {
    color: var(--primary-dark);
    border-color: var(--primary);
    box-shadow: 0 2px 8px -2px rgba(0, 102, 204, 0.25);
}
.back-link:hover span[aria-hidden] { transform: translateX(-2px); }
.back-link:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* ---------- Breadcrumb ---------- */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 1rem;
}
.breadcrumb-back {
    width: 2.2rem; height: 2.2rem;
    display: grid; place-items: center;
    flex-shrink: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 50%;
    box-shadow:
        0 1px 2px rgba(15, 23, 42, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.7);
    color: var(--text-muted);
    text-decoration: none;
    transition:
        color 0.14s ease,
        background-color 0.14s ease,
        border-color 0.14s ease,
        box-shadow 0.14s ease,
        transform 0.14s ease;
}
.breadcrumb-back svg {
    width: 1rem; height: 1rem;
    transition: transform 0.14s ease;
}
.breadcrumb-back:hover {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 5px 12px -4px rgba(0, 102, 204, 0.4);
}
.breadcrumb-back:hover svg { transform: translateX(-2px); }
.breadcrumb-back:active {
    transform: translateY(0) scale(0.96);
    box-shadow: 0 1px 3px rgba(0, 102, 204, 0.25);
}
.breadcrumb-back:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.breadcrumb ol {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    list-style: none;
    margin: 0;
    padding: 0;
}
.breadcrumb li {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    line-height: 1.3;
}
.breadcrumb li + li::before { content: '›'; color: #94a3b8; flex-shrink: 0; }
.breadcrumb a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.12s ease;
}
.breadcrumb a:hover { color: var(--primary); text-decoration: underline; }
.breadcrumb a:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 3px; }
.breadcrumb [aria-current='page'] {
    color: var(--text);
    font-weight: 600;
    overflow-wrap: anywhere;
}

/* ---------- Filters bar ---------- */
.filters {
    display: flex;
    gap: 0.7rem;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 1.1rem;
}
.filters .form-control { width: auto; min-width: 180px; }
.filters .form-control.search { flex: 1; min-width: 220px; }
.filters.is-filtering {
    opacity: 0.6;
    pointer-events: none;
    transition: opacity 0.15s ease;
}
.filters.is-filtering .btn { cursor: progress; }

/* ---------- Detail rows ---------- */
.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
}
.detail-item .detail-label {
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    margin-bottom: 0.2rem;
}
.detail-item .detail-value { font-size: 0.95rem; font-weight: 600; }

/* ---------- Searchable select ---------- */
.searchable { position: relative; }
.searchable-list {
    position: absolute;
    top: calc(100% + 0.3rem);
    left: 0; right: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    max-height: 240px;
    overflow-y: auto;
    z-index: 80;
}
.searchable-item {
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    font-size: 0.88rem;
    user-select: none;
    -moz-user-select: none;
}
.searchable-item:hover { background: var(--primary-light); }
.searchable-item.muted { color: var(--text-muted); cursor: default; }

/* ---------- Empty states ---------- */
.empty {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--text-muted);
}
.empty .empty-icon {
    width: 3.5rem; height: 3.5rem;
    margin: 0 auto 0.8rem;
    background: var(--surface-alt);
    border-radius: 50%;
    display: grid; place-items: center;
    font-size: 1.5rem;
}
.empty h3 { color: var(--text); }

/* ---------- Modal ---------- */
.modal-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    z-index: 100;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.modal-backdrop.open { display: flex; }
.modal {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
}
.modal-head {
    padding: 1.1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.modal-head h3 { margin: 0; }
.modal-close { border: 0; background: none; font-size: 1.2rem; cursor: pointer; color: var(--text-muted); }
.modal-body { padding: 1.25rem; }

/* read-only notice viewer (notifications) */
.modal--notice { max-width: 34rem; }

.modal--notice .modal-body { max-height: 60vh; overflow-y: auto; }

.notice-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .5rem;
    margin-bottom: .8rem;
}

.notice-full {
    margin: 0;
    font-size: .92rem;
    line-height: 1.65;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}
.modal-foot {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 0.6rem;
}

/* ---------- Auth (guest) pages ---------- */
.auth-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
background: linear-gradient(160deg, var(--primary-dark) 0%, var(--primary) 55%, var(--gradient-end) 100%);
}
.auth-card {
    width: 100%;
    max-width: 440px;
    background: var(--surface);
    border-radius: 1rem;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}
.auth-head {
    padding: 2rem 2.25rem 0.5rem;
    text-align: center;
}
.auth-head .brand-mark {
    width: 3rem; height: 3rem;
    background: var(--primary);
    color: #fff;
    border-radius: 0.75rem;
    display: inline-grid; place-items: center;
    font-weight: 800; font-size: 1.4rem;
    margin-bottom: 0.75rem;
}
.auth-head h1 { font-size: 1.3rem; margin-bottom: 0.15rem; }
.auth-head p { color: var(--text-muted); font-size: 0.88rem; }
.auth-body { padding: 1.5rem 2.25rem 2.25rem; }

/* Brand logo image (replaces .brand-mark when a site logo is set) */
.brand-logo { object-fit: contain; }
.auth-head .brand-logo {
    max-height: 3rem;
    max-width: 75%;
    margin-bottom: 0.75rem;
}
.sidebar-brand .brand-logo {
    max-height: 3.2rem;
    max-width: 100%;
    border-radius: 0.5rem;
    flex-shrink: 0;
}

/* Logo / favicon previews on the branding settings card */
.brand-preview {
    min-height: 5.5rem;
    display: grid;
    place-items: center;
    padding: 0.75rem;
    margin-bottom: 0.6rem;
    background: var(--surface-alt);
    border: 1px dashed var(--border);
    border-radius: var(--radius-sm);
}
.brand-preview-sm { min-height: 4.5rem; }
.brand-preview img {
    max-width: 180px;
    max-height: 72px;
    object-fit: contain;
}
.brand-preview-sm img { max-width: 48px; max-height: 48px; }

/* Auth method tabs (Password / Mobile OTP) */
.auth-tabs {
    display: flex;
    gap: 0.25rem;
    padding: 0.25rem;
    margin-bottom: 1.25rem;
    background: var(--surface-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}
.auth-tab {
    flex: 1;
    padding: 0.55rem 0.75rem;
    font-size: 0.88rem;
    font-weight: 600;
    font-family: inherit;
    color: var(--text-muted);
    background: transparent;
    border: 0;
    border-radius: calc(var(--radius-sm) - 2px);
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s;
}
.auth-tab:hover { color: var(--text); }
.auth-tab.is-active {
    background: var(--primary);
    color: #fff;
    box-shadow: var(--shadow-sm);
}
.auth-panel[hidden] { display: none; }

.auth-foot {
    padding: 1rem 2.25rem;
    border-top: 1px solid var(--border);
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ---------- Payment (gateway) page ---------- */
.pay-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    background: linear-gradient(160deg, var(--primary-dark) 0%, var(--primary) 60%, var(--gradient-end) 100%);
}
.pay-card {
    width: 100%;
    max-width: 460px;
    background: var(--surface);
    border-radius: 1rem;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}
.pay-head {
    background: linear-gradient(120deg, var(--primary) 0%, var(--accent) 100%);
    color: #fff;
    padding: 1.5rem;
    text-align: center;
}
.pay-head h1 { font-size: 1.15rem; margin: 0; }
.pay-head p { margin: 0.3rem 0 0; font-size: 0.82rem; opacity: 0.9; }
.pay-body { padding: 1.5rem; text-align: center; }
.pay-merchant {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.8rem;
    background: var(--surface-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.7rem 1rem;
    margin-bottom: 1rem;
    text-align: left;
}
.pay-merchant .pay-order-id { font-size: 0.78rem; color: var(--text-muted); }
.pay-amount {
    font-size: 1.9rem;
    font-weight: 800;
    color: var(--primary-dark);
    margin: 0.8rem 0 1.1rem;
}
.pay-qr {
    display: block;
    width: fit-content;
    margin: 0 auto 1rem;
    padding: 0.7rem;
    border: 2px dashed var(--primary);
    border-radius: var(--radius);
    background: #fff;
}
.pay-qr svg, .pay-qr img { display: block; }
.pay-timer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    width: fit-content;
    margin: 0 auto 1rem;
    background: var(--danger-bg);
    color: var(--danger);
    font-weight: 700;
    padding: 0.35rem 0.9rem;
    border-radius: 999px;
    font-size: 0.85rem;
}
.pay-hint { font-size: 0.82rem; color: var(--text-muted); }
.pay-apps { display: flex; gap: 0.6rem; justify-content: center; margin: 1rem 0; flex-wrap: wrap; }
.pay-apps .pay-app {
    padding: 0.4rem 0.8rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 0.78rem;
    color: var(--text-muted);
    background: var(--surface-alt);
}
.pay-actions { display: flex; gap: 0.6rem; justify-content: center; margin-top: 1.1rem; flex-wrap: wrap; }
.pay-loader { text-align: center; padding: 2.5rem 0; }
.spinner {
    width: 2.5rem; height: 2.5rem;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    margin: 0 auto 0.9rem;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Payment page — responsive */
@media (max-width: 640px) {
    .pay-wrap { padding: 0.75rem; align-items: flex-start; }
    .pay-card { max-width: 100%; }
    .pay-head { padding: 1.1rem; }
    .pay-body { padding: 1.15rem; }
    .pay-merchant { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
    .pay-merchant .text-right { text-align: left; width: 100%; }
    .pay-qr { max-width: 100%; padding: 0.6rem; }
    .pay-qr svg, .pay-qr img { max-width: 100%; height: auto; }
    .pay-actions { flex-direction: column; }
    .pay-actions .btn { width: 100%; }
    .pay-apps .pay-app { font-size: 0.72rem; padding: 0.35rem 0.65rem; }
    .pay-amount { font-size: 1.6rem; }
}

/* ---------- Maintenance ---------- */
.maintenance-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: linear-gradient(160deg, var(--primary-dark) 0%, var(--primary) 60%, var(--gradient-end) 100%);
    text-align: center;
}
.maintenance-card { max-width: 480px; }
.maintenance-card .maintenance-icon {
    width: 4.5rem; height: 4.5rem;
    background: var(--primary-light);
    color: var(--primary-dark);
    border-radius: 50%;
    display: grid; place-items: center;
    font-size: 1.8rem;
    margin: 0 auto 1rem;
}

/* ---------- Error pages ---------- */
.error-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    text-align: center;
}
.error-code { font-size: 4.5rem; font-weight: 800; color: var(--primary); line-height: 1; }

/* ---------- Utilities ---------- */
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 0.85rem; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.w-100 { width: 100%; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.hidden { display: none; }

/* ---------- OTP resend row ---------- */
.otp-resend-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
}
.otp-resend-row.justify-between { justify-content: space-between; }
.otp-resend-row.justify-center { justify-content: center; }
.otp-resend-timer {
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}
@media (max-width: 480px) {
    .otp-resend-row .btn-link { flex: 1 1 100%; }
    .otp-resend-timer { flex: 1 1 100%; text-align: center; }
}

/* ---------- Inline OTP verification box ---------- */
.otp-inline-box {
    margin-top: 0.75rem;
    padding: 1rem;
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    background: #f8fafc;
}
.otp-inline-box.hidden { display: none; }
.otp-inline-box .input-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.otp-inline-box .input-group .form-control { flex: 1 1 auto; min-width: 0; }
.btn.is-loading {
    opacity: 0.65;
    pointer-events: none;
}
@media (max-width: 640px) {
    .otp-inline-box .input-group { flex-wrap: wrap; }
    .otp-inline-box .input-group .btn { flex: 1 1 auto; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .main { margin-left: 0; }
    .menu-toggle { display: inline-flex; }
    .backdrop {
        display: none;
        position: fixed; inset: 0;
        background: rgba(15, 23, 42, 0.5);
        z-index: 55;
    }
    .backdrop.open { display: block; }
    .grid-3 { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
    .content { padding: 1rem; }
    .topbar { padding: 0 0.85rem; gap: 0.6rem; }
    .topbar-title { font-size: 0.92rem; }
    .grid-2 { grid-template-columns: 1fr; }
    .stats-grid .stat-value { font-size: 1.1rem; }
    .auth-body { padding: 1.25rem 1.5rem 1.75rem; }
    .auth-head { padding: 1.5rem 1.5rem 0.25rem; }
    .auth-foot { padding: 0.85rem 1.5rem; }
    .table th, .table td { padding: 0.6rem 0.7rem; }
    .pay-card { border-radius: 0.75rem; }

    /* Topbar panels: pin to the viewport on phones. The bell/avatar sit
       inboard of the screen edge, so absolute anchoring can push these
       panels off-screen — fixed positioning makes that impossible.
       They also stay glued below the sticky topbar while scrolling. */
    .notif-dropdown,
    .user-menu {
        position: fixed;
        top: 4.5rem;
        right: 0.75rem;
    }
    .notif-dropdown {
        left: 0.75rem;
        width: auto;
    }
    .user-menu {
        width: min(220px, calc(100vw - 1.5rem));
    }
}

@media (max-width: 480px) {
    .topbar { gap: 0.45rem; }
    /* keep only the avatar on phones — the name lives in the menu */
    .user-menu-btn > span:not(.avatar) { display: none; }
    .notif-btn, .menu-toggle { padding: 0.4rem 0.5rem; }
}

/* ---------- Wallet ---------- */
.wallet-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 1.5rem 1.75rem;
    margin-bottom: 1.25rem;
    border-radius: var(--radius);
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 60%, var(--gradient-end) 100%);
    color: #fff;
}
.wallet-hero-label { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; opacity: 0.85; }
.wallet-hero-balance { font-size: 2.4rem; font-weight: 800; line-height: 1.15; }
.wallet-hero-actions { text-align: right; }
.wallet-hero-actions .btn-primary { background: #fff; color: var(--primary); }
.wallet-hero-actions .btn-primary:hover { background: var(--secondary-bg); }
.wallet-hero .text-muted { color: rgba(255,255,255,0.85); }

.amount-presets { display: flex; gap: 0.6rem; flex-wrap: wrap; margin-bottom: 1rem; }
.amount-preset {
    flex: 1 1 0;
    min-width: 0;
    padding: 0.7rem 0.5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text);
    transition: all 0.15s ease;
}
.amount-preset:hover { border-color: var(--primary); color: var(--primary); }
.amount-preset.active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ==========================================================================
   Services module
   ========================================================================== */

.btn-warning-outline { background: var(--surface); border: 1px solid var(--warning); color: var(--warning); }
.btn-warning-outline:hover:not(:disabled) { background: var(--warning); color: #fff; }
.btn.disabled, .btn[disabled] { opacity: 0.55; pointer-events: none; }
.inline { display: inline; }

.notice-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    border-radius: var(--radius);
    border: 1px solid #fcd34d;
    background: var(--warning-bg);
    color: var(--warning-text);
}
.notice-banner strong { display: block; margin-bottom: 0.15rem; }

.section { margin-bottom: 2rem; }
.section-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 1rem; }
.section-head h2 { margin: 0 0 0.1rem; font-size: 1.15rem; }

.service-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }
.service-card {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1.25rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}
.service-card h3 { margin: 0 0 0.2rem; font-size: 1rem; }
.service-card-icon, .category-card-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 0.6rem;
    background: var(--primary-light);
    color: var(--primary-dark);
    font-weight: 700;
    font-size: 1.05rem;
    text-transform: uppercase;
}
.service-card-body { flex: 1; }
.service-card-actions { margin-top: auto; }

.service-search {
    position: relative;
    display: flex;
    align-items: center;
    max-width: 420px;
    height: 44px;
    margin-bottom: 0;
    padding: 0 0.55rem 0 0.95rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 999px;
    box-shadow: var(--shadow-sm);
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.service-search:focus-within {
    background: var(--surface);
    border-color: var(--border);
    box-shadow: var(--shadow-sm);
}
.service-search-icon {
    flex: 0 0 auto;
    width: 17px;
    height: 17px;
    margin-right: 0.6rem;
    color: var(--text-muted);
    pointer-events: none;
}
.service-search-input {
    flex: 1 1 auto;
    min-width: 0;
    height: 100%;
    padding: 0;
    border: 0;
    background: none;
    font: inherit;
    font-size: 0.9rem;
    color: var(--text);
    outline: none;
}
.service-search-input::placeholder { color: var(--text-muted); opacity: 1; }
.service-search-input::-webkit-search-cancel-button { -webkit-appearance: none; }
.service-search-clear {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    margin-left: 0.35rem;
    border: 0;
    border-radius: 50%;
    background: var(--surface-alt);
    color: var(--text-muted);
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}
.service-search-clear svg { width: 13px; height: 13px; }
.service-search-clear:hover { background: var(--border); color: var(--text); }
.service-search-clear:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.service-search-clear[hidden] { display: none; }
.service-search-count {
    display: block;
    margin-top: 0.45rem;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-muted);
}
.service-search-count[hidden] { display: none; }
.service-grid-empty { grid-column: 1 / -1; }

.category-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }
.category-card {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1.25rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}
.category-card h3 { margin: 0 0 0.2rem; font-size: 1rem; }

/* ---------- Services page icon tiles (no cards, no borders) ---------- */
.tile-section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.4rem 1rem;
    flex-wrap: wrap;
    margin-bottom: 0.9rem;
}
.tile-section-title { margin: 0; font-size: 1.05rem; }
.tile-section-hint { font-size: 0.78rem; color: var(--text-muted); }

.tile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
    gap: 0.5rem;
}

.tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 0.3rem;
    width: 100%;
    padding: 0.7rem 0.35rem;
    background: none;
    border: none;
    border-radius: var(--radius-sm);
    font-family: inherit;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.12s ease, transform 0.12s ease;
}
a.tile:hover, button.tile:hover { background: var(--surface-alt); transform: translateY(-2px); }
button.tile:focus-visible, a.tile:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }

.tile-icon { font-size: 2rem; line-height: 1; }

.tile-label {
    font-size: 0.78rem;
    line-height: 1.25;
    color: var(--text);
    overflow-wrap: anywhere;
}

.tile-tag {
    font-size: 0.62rem;
    font-weight: 600;
    color: var(--info);
    background: var(--info-bg);
    border-radius: 999px;
    padding: 0.08rem 0.45rem;
}

.tile.is-disabled { cursor: default; opacity: 0.55; }
.tile.is-disabled .tile-label { color: var(--text-muted); }

/* ---------- Services page category menu (click-driven dropdown) ---------- */
/* ---------- Service categories menu ----------
   Vertical, in-flow accordion. Category headers are full-width rows; the
   services panel expands beneath the active header and pushes the rest of
   the page down — a proper menu on every screen size (no floating popups). */
.catmenu {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.catmenu-item {
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: border-color 0.16s ease, box-shadow 0.16s ease;
}
.catmenu-item.open {
    border-color: var(--primary);
    box-shadow: 0 12px 28px -18px rgba(0, 102, 204, 0.55), var(--shadow-sm);
}

.catmenu-btn {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    width: 100%;
    padding: 0.8rem 0.95rem;
    background: none;
    border: 0;
    border-radius: 0;
    font-family: inherit;
    font-size: 0.92rem;
    font-weight: 600;
    line-height: 1.3;
    text-align: left;
    color: var(--text);
    cursor: pointer;
    transition: background-color 0.14s ease, color 0.14s ease;
}
.catmenu-item:not(.open) .catmenu-btn:hover { background: var(--surface-alt); }
.catmenu-item:not(.open) .catmenu-btn:active { background: var(--surface-alt); }
.catmenu-btn:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
.catmenu-item.open > .catmenu-btn { background: var(--primary); }

.catmenu-btn-icon {
    flex: 0 0 auto;
    font-size: 1.05rem;
    line-height: 1;
}
.catmenu-btn-label { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }

.catmenu-count-pill {
    flex: 0 0 auto;
    min-width: 1.5rem;
    text-align: center;
    padding: 0.16rem 0.45rem;
    border-radius: 999px;
    background: var(--primary-light);
    color: var(--primary-dark);
    font-size: 0.75rem;
    font-weight: 700;
    transition: background-color 0.14s ease, color 0.14s ease;
}
.catmenu-item.open > .catmenu-btn .catmenu-count-pill { background: rgba(255, 255, 255, 0.24); color: #fff; }

.catmenu-caret {
    flex: 0 0 auto;
    display: inline-flex;
    color: var(--text-muted);
    transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1), color 0.14s ease;
}
.catmenu-item.open .catmenu-caret { transform: rotate(180deg); color: var(--primary); }

/* Expand/collapse via CSS grid rows: 0fr -> 1fr animates the panel height. */
.catmenu-drop {
    display: grid;
    grid-template-rows: 0fr;
    visibility: hidden;
    transition: grid-template-rows 0.28s cubic-bezier(0.16, 1, 0.3, 1),
                visibility 0s linear 0.28s;
}
.catmenu-item.open > .catmenu-drop {
    grid-template-rows: 1fr;
    visibility: visible;
    transition: grid-template-rows 0.28s cubic-bezier(0.16, 1, 0.3, 1),
                visibility 0s linear 0s;
}
.catmenu-drop-body { min-height: 0; overflow: hidden; }

.catmenu-drop-head {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.75rem 0.8rem;
    border-top: 1px solid var(--border);
    background: var(--surface-alt);
}
.catmenu-drop-icon {
    width: 2.5rem; height: 2.5rem;
    display: grid; place-items: center;
    background: linear-gradient(135deg, var(--primary-light), var(--info-bg));
    color: var(--primary-dark);
    border-radius: var(--radius-sm);
    font-size: 1.1rem;
    flex-shrink: 0;
}
.catmenu-drop-meta { flex: 1; min-width: 0; }
.catmenu-drop-name { font-size: 0.92rem; font-weight: 700; color: var(--text); line-height: 1.2; }
.catmenu-drop-desc {
    margin-top: 0.15rem;
    font-size: 0.74rem;
    line-height: 1.35;
    color: var(--text-muted);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.catmenu-drop-count {
    flex-shrink: 0;
    min-width: 1.75rem;
    text-align: center;
    padding: 0.22rem 0.5rem;
    border-radius: 999px;
    background: var(--primary-light);
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--primary-dark);
}

.catmenu-drop-list {
    max-height: min(50vh, 320px);
    overflow-y: auto;
    padding: 0.35rem 0.4rem;
}
.catmenu-link {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    width: 100%;
    padding: 0.55rem 0.6rem;
    border-radius: 10px;
    color: var(--text);
    text-decoration: none;
    font-size: 0.87rem;
    line-height: 1.3;
    transition: background-color 0.13s ease;
}
.catmenu-link:hover { background: var(--primary-light); }
.catmenu-link:focus-visible { outline: none; background: var(--primary-light); box-shadow: inset 0 0 0 2px var(--primary); }
.catmenu-link-icon {
    width: 2.05rem; height: 2.05rem;
    display: grid; place-items: center;
    background: var(--surface-alt);
    border-radius: var(--radius-sm);
    font-size: 1.1rem;
    line-height: 1;
    flex-shrink: 0;
    transition: background-color 0.13s ease;
}
.catmenu-link:hover .catmenu-link-icon { background: #fff; }
.catmenu-link-name { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.catmenu-link.is-disabled { cursor: default; opacity: 0.55; }
.catmenu-link.is-disabled .catmenu-link-name { color: var(--text-muted); }
.catmenu-link.is-disabled .catmenu-link-icon { background: var(--surface-alt); }

.catmenu-empty {
    padding: 0.5rem 0.6rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.catmenu-drop-more {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin: 0 0.4rem 0.5rem;
    padding: 0.55rem 0.65rem;
    border-top: 1px solid var(--border);
    color: var(--primary);
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: 10px;
    transition: background-color 0.13s ease, color 0.13s ease;
}
.catmenu-drop-more:hover { background: var(--primary-light); color: var(--primary-dark); }
.catmenu-drop-more:focus-visible { outline: none; background: var(--primary-light); box-shadow: inset 0 0 0 2px var(--primary); }

@media (max-width: 600px) {
    .catmenu { gap: 0.45rem; }
    .catmenu-btn { padding: 0.75rem 0.85rem; font-size: 0.88rem; }
    .catmenu-drop-list { max-height: min(55vh, 340px); }
    .tile-grid { grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 0.35rem; }
    .tile-icon { font-size: 1.8rem; }
}

.fee-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    padding: 0.8rem 0;
    gap: 0.4rem 1.5rem;
    border-bottom: 1px dashed var(--border);
}
.fee-row:last-child {
    border-bottom: none;
    padding-bottom: 0.25rem;
}
.fee-row > * {
    min-width: 0;
    overflow-wrap: anywhere;
}
.fee-amount { font-size: 1.4rem; font-weight: 700; color: var(--primary-dark); }

/* ---------- Service application layout ----------
   A compact full-width fee strip sits at the top, below it the details form
   fills the wider left column while related services sit on the right. The
   columns collapse into a single stack on smaller screens. */
.service-apply {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    gap: 1.5rem;
    align-items: start;
}

/* fee strip */
.service-fee-card { padding: 0.55rem 0; }

.service-fee-body {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.6rem 1.4rem;
    padding: 0 1.1rem;
}

.fee-item {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.fee-label {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.fee-value {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
}

.fee-value--accent { color: var(--primary-dark); }

.service-related-body {
    padding-top: 0.4rem;
    padding-bottom: 0.6rem;
}

.service-related-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.15rem;
}

.service-related-link {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.6rem 0.5rem;
    border-radius: var(--radius-sm);
    color: var(--text);
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}

.service-related-link:hover {
    background: var(--surface-alt);
    color: var(--primary-dark);
}

.service-related-icon {
    width: 2rem;
    height: 2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: var(--primary-light);
    color: var(--primary-dark);
    border-radius: 9px;
    font-size: 1rem;
}

.service-related-name {
    font-weight: 500;
    font-size: 0.9rem;
    overflow-wrap: anywhere;
}

.service-related-link--disabled {
    cursor: default;
    opacity: 0.55;
}

.service-related-tag {
    margin-inline-start: auto;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

/* OTP verification instructions card */
.service-instructions-card {
    margin-bottom: 0;
    border-left: 4px solid var(--accent);
}

.service-sidebar {
    display: grid;
    gap: 1.5rem;
    align-content: start;
}

.service-instructions-body {
    padding-top: 0.4rem;
    padding-bottom: 0.7rem;
}

.service-instructions-text {
    margin: 0 0 0.6rem;
    font-size: 0.88rem;
    line-height: 1.5;
    color: var(--text);
}

.service-instructions-text:last-child {
    margin-bottom: 0;
}

.service-instructions-phone {
    color: var(--primary-dark);
    font-weight: 700;
    text-decoration: none;
}

.service-instructions-phone:hover {
    text-decoration: underline;
}

.service-instructions-note {
    margin-top: 0.7rem;
    padding: 0.6rem 0.75rem;
    border-radius: var(--radius-sm);
    background: var(--primary-light);
    border: 1px solid var(--primary);
    color: var(--primary-dark);
    font-size: 0.85rem;
    line-height: 1.45;
}

@media (max-width: 640px) {
    .service-apply { grid-template-columns: 1fr; }
    .service-fee-body { align-items: stretch; }
    .service-fee-body .btn { width: 100%; justify-content: center; }
}

/* uploaded-document download rows inside detail values: each document gets
   its own flexible row so the label and button never crowd or overflow */
.doc-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.4rem 1rem;
    padding: 0.55rem 0;
}
.doc-row + .doc-row {
    border-top: 1px dashed var(--border);
    margin-top: 0.4rem;
}
.doc-row > span {
    font-weight: 500;
    overflow-wrap: anywhere;
}
.doc-row .btn {
    flex-shrink: 0;
}

@media (max-width: 640px) {
    .fee-row {
        flex-direction: column;
        align-items: stretch;
        padding: 0.75rem 0;
        gap: 0.2rem;
    }
    .doc-row {
        align-items: flex-start;
    }
    .doc-row .btn {
        width: 100%;
        justify-content: center;
    }
}

.response-pre {
    margin: 0;
    max-height: 340px;
    overflow: auto;
    padding: 0.9rem 1.1rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 0.8rem;
    line-height: 1.55;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.chip-row { display: flex; flex-wrap: wrap; gap: 0.5rem; }

/* ---- workflow stepper (service status tracker) ----------------- */
.workflow-steps {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 0;
}
.workflow-step {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.7rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface-alt);
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
}
.workflow-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--border);
    flex: 0 0 auto;
}
.workflow-step.is-done {
    border-color: var(--success);
    background: var(--success-bg);
    color: var(--success-text);
}
.workflow-step.is-done .workflow-dot { background: var(--success); }
.workflow-step.is-current {
    border-color: var(--primary);
    background: var(--primary-light);
    color: var(--primary-dark);
    box-shadow: 0 0 0 3px var(--primary-light);
}
.workflow-step.is-current .workflow-dot { background: var(--primary); }
.workflow-connector {
    width: 1.1rem;
    height: 2px;
    align-self: center;
    background: var(--border);
    margin: 0 0.15rem;
    flex: 0 0 auto;
}
.workflow-step.is-done + .workflow-connector { background: var(--success); }
.workflow-step.is-current + .workflow-connector { background: var(--primary); }
@media (max-width: 620px) {
    .workflow-step { white-space: normal; }
    .workflow-connector { display: none; }
}

.detail-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.9rem 1.25rem; }
.detail-label { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); margin-bottom: 0.15rem; }
.detail-value { font-size: 0.95rem; font-weight: 600; word-break: break-word; }

.timeline { position: relative; padding-left: 1.4rem; }
.timeline::before {
    content: '';
    position: absolute;
    left: 5px;
    top: 6px;
    bottom: 6px;
    width: 2px;
    background: var(--border);
}
.timeline-item { position: relative; padding-bottom: 1rem; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-dot {
    position: absolute;
    left: -1.4rem;
    top: 5px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--primary);
    border: 2px solid var(--surface);
    box-shadow: 0 0 0 2px var(--primary-light);
}
.timeline-content > div { margin-bottom: 0.25rem; }

.bulk-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.4rem;
    max-height: 260px;
    overflow-y: auto;
    padding: 0.4rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.bulk-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.6rem;
    border-radius: 0.4rem;
    cursor: pointer;
    font-size: 0.9rem;
}
.bulk-option:hover { background: var(--surface-alt); }

@media (max-width: 720px) {
    .detail-grid { grid-template-columns: 1fr; }
    .service-grid, .category-grid { grid-template-columns: 1fr; }
    .service-card-actions .btn { width: 100%; justify-content: center; min-height: 2.75rem; }
}

/* ---------- Responsive helpers ---------- */
.table-wrap .table-lg { min-width: 940px; }
.table-wrap .table-md { min-width: 720px; }

/* ---------- Pricing page ---------- */
.pricing-cards { align-items: start; }
.price-form { justify-content: flex-end; flex-wrap: wrap; }
.price-input { width: 120px; min-width: 0; }
@media (max-width: 900px) {
    .pricing-cards { grid-template-columns: 1fr; }
    .price-form { justify-content: flex-start; }
}
@media (max-width: 600px) {
    .price-input { width: 100%; }
    .price-form .btn { width: 100%; }
}

.pricing-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}
.pricing-stat {
    padding: 0.35rem 0.7rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    font-size: 0.82rem;
    color: var(--text-muted);
}
.pricing-stat strong { color: var(--text); }
.pricing-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    flex-wrap: wrap;
}
.bulk-toolbar {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
    margin-bottom: 0.6rem;
}
.bulk-select-all {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.9rem;
    cursor: pointer;
    user-select: none;
}
.bulk-select-all input { accent-color: var(--primary); }
.bulk-count { font-weight: 600; color: var(--text); }
.pricing-bulk-fields {
    align-items: end;
}
@media (max-width: 600px) {
    .bulk-submit .btn { width: 100%; }
}

@media (max-width: 900px) {
    .hide-md { display: none !important; }
}

@media (max-width: 600px) {
    .hide-sm { display: none !important; }
    .stats-grid { gap: 0.6rem; }
    .stat-card { padding: 0.8rem 0.9rem; gap: 0.6rem; }
    .stat-icon { width: 2.4rem; height: 2.4rem; font-size: 1.05rem; }
    .stat-value { font-size: 1.05rem; }
    .stat-label { font-size: 0.68rem; }
    .filters .form-control { width: 100%; min-width: 100%; }
    .filters .btn { width: 100%; }
    .page-header { flex-direction: column; align-items: stretch; }
    /* equal-size action buttons: uniform grid cells, extra buttons flow
       onto a new row at the same size */
    .page-actions {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(min(140px, 100%), 1fr));
        gap: 0.5rem;
    }
    .page-actions .btn { justify-content: center; white-space: normal; }
}

/* ============================================================
   Auth double-panel (sign in / register) � authx
   ============================================================ */
.auth-wrap--free {
    align-items: center;
    flex-direction: column;
    padding: 2.5rem 1.25rem;
}

.authx {
    display: flex;
    width: min(1060px, 100%);
    margin: 0 auto;
    background: var(--surface);
    border-radius: 1.25rem;
    box-shadow: 0 24px 60px rgba(15, 23, 42, .35);
    overflow: hidden;
    min-height: 640px;
}

.authx-pane {
    flex: 1 1 50%;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* ---- form side -------------------------------------------- */
.authx-pane--form {
    padding: 2.75rem 3rem;
    animation: authxRise .45s ease both;
}

.authx--flip .authx-pane--form {
    animation-name: authxRiseAlt;
}

@keyframes authxRise {
    from { opacity: 0; transform: translateX(14px); }
    to   { opacity: 1; transform: none; }
}

@keyframes authxRiseAlt {
    from { opacity: 0; transform: translateX(-14px); }
    to   { opacity: 1; transform: none; }
}

.authx-head {
    display: flex;
    align-items: center;
    gap: .65rem;
    margin-bottom: 1.4rem;
}

.authx-head .brand-logo { max-height: 2.4rem; width: auto; }

.authx-head .brand-mark {
    width: 2.4rem;
    height: 2.4rem;
    font-size: 1.15rem;
    border-radius: .6rem;
}

.authx-head-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
}

.authx-head-sub {
    font-size: .72rem;
    color: var(--text-muted);
}

.authx-title {
    font-size: 1.45rem;
    font-weight: 800;
    margin: 0 0 .3rem;
    color: var(--text);
    overflow-wrap: break-word;
}

.authx-sub {
    margin: 0 0 1.25rem;
    color: var(--text-muted);
    font-size: .9rem;
    overflow-wrap: break-word;
}

.authx-form { max-width: 30rem; }

.authx-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .6rem;
    margin-top: 1.4rem;
}

.authx-alt-action {
    text-align: center;
    margin-top: 1.1rem;
    font-size: .85rem;
    color: var(--text-muted);
}

.authx-alt-action a,
.authx-alt-action button {
    color: var(--primary);
    font-weight: 600;
}

/* two-factor / otp inline rows */
.otp-row { display: flex; gap: .5rem; }
.otp-row .form-control { flex: 1 1 auto; }

/* file upload boxes */
.file-box {
    position: relative;
    display: flex;
    align-items: center;
    gap: .75rem;
    border: 1.5px dashed var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface-alt);
    padding: .8rem .9rem;
    cursor: pointer;
    transition: border-color .15s ease, background .15s ease;
}

.file-box:hover { border-color: var(--primary); background: var(--primary-light); }

.file-box input[type="file"] {
    position: absolute;
    width: 1px;
    height: 1px
    ;
    opacity: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
}

.file-box-icon {
    flex: 0 0 auto;
    width: 2.3rem;
    height: 2.3rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: .55rem;
    background: var(--primary-light);
    color: var(--primary-dark);
    font-size: 1.05rem;
}

.file-box-text { min-width: 0; }

.file-box-label {
    display: block;
    font-size: .82rem;
    font-weight: 600;
    color: var(--text);
}

.file-box-hint {
    display: block;
    font-size: .72rem;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-box.has-file { border-style: solid; border-color: var(--success); }
.file-box.has-file .file-box-icon { background: var(--success-bg); color: var(--success); }

.form-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: .9rem;
}

/* ---- register mode: compact, sectioned, friendly ----------- */
.form-section-title {
    display: flex;
    align-items: center;
    gap: .6rem;
    margin: 1.15rem 0 .55rem;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.form-section-title::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--border);
}

.authx-form .form-section-title:first-child { margin-top: 0; }

/* ---- multi-step wizard -------------------------------------- */
.authx-steps {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: .25rem;
    margin: 0 0 1.1rem;
    padding: 0;
    list-style: none;
}
.authx-step-dot {
    position: relative;
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .3rem;
    text-align: center;
    padding: 0;
}
.authx-step-dot:not(:last-child)::after {
    content: "";
    position: absolute;
    top: .85rem;
    left: 50%;
    width: 100%;
    height: 2px;
    background: var(--border);
    z-index: 0;
}
.authx-step-dot.is-done:not(:last-child)::after { background: var(--primary); }
.authx-step-num {
    position: relative;
    z-index: 1;
    width: 1.7rem;
    height: 1.7rem;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--surface-alt);
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-size: .78rem;
    font-weight: 700;
    transition: all .18s ease;
}
.authx-step-dot.is-done .authx-step-num,
.authx-step-dot.is-done .authx-step-num::before {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}
.authx-step-dot.is-done .authx-step-num::before {
    content: "\2713";
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    font-size: .8rem;
}
.authx-step-dot.is-done .authx-step-num { color: transparent; }
.authx-step-dot.is-active .authx-step-num {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary-dark);
    box-shadow: 0 0 0 3px var(--primary-light);
}
.authx-step-label {
    font-size: .62rem;
    line-height: 1.1;
    font-weight: 600;
    letter-spacing: .02em;
    color: var(--text-muted);
}
.authx-step-dot.is-active .authx-step-label,
.authx-step-dot.is-done .authx-step-label { color: var(--primary-dark); }

.authx-step-hint {
    margin: 0 0 .75rem;
    font-size: .8rem;
    color: var(--text-muted);
}
.authx-step-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    margin-top: 1.1rem;
    padding-top: .9rem;
    border-top: 1px solid var(--border);
}
.authx-step-nav .btn { flex: 1 1 0; }
.authx-step-nav .btn + .btn { margin-left: 0; }
.authx-step-nav .authx-step-next { max-width: none; }
.authx-step-finish { margin: 0; }

/* Register keeps the SAME compact card size as the sign-in screen; the
   long KYC form scrolls inside its own box instead of stretching the
   page, with the submit action pinned below the scroll area. */
.authx--register { height: 640px; min-height: 0; }
.authx--register .authx-pane--form {
    padding-top: 2rem;
    padding-bottom: 1.75rem;
    justify-content: flex-start;
}
/* the empty CSRF-only form that carries the field attributes */
#registerForm { display: none; }
.authx--register .authx-form {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    min-width: 0;
    max-width: 34rem;
}
.authx-form-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden; /* scroll strictly up-down, never sideways */
    overscroll-behavior: contain;
    padding-right: 1rem;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
    overflow-wrap: break-word; /* inherit: long words wrap instead of clipping */
}
.authx-form-body > :last-child { margin-bottom: .25rem; }
.authx-form-body::-webkit-scrollbar { width: 8px; }
.authx-form-body::-webkit-scrollbar-track { background: transparent; }
.authx-form-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 999px; }
.authx-form-body::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }
.authx-form-foot {
    flex: 0 0 auto;
    margin-top: .75rem;
    padding-top: .9rem;
    border-top: 1px solid var(--border);
}
.authx-form-foot .form-group { margin-bottom: 0; }

/* error summary list inside the auth alert */
.authx-error-list {
    margin: .4rem 0 0;
    padding-left: 1.1rem;
    display: grid;
    gap: .15rem;
    font-size: .84rem;
}
/* long chosen file names must wrap inside the box, never widen it */
.file-box-label,
.file-box-hint {
    display: block;
    overflow-wrap: anywhere;
    word-break: break-word;
}
.authx--register .authx-head { margin-bottom: 1rem; }
.authx--register .authx-title { font-size: 1.3rem; margin-bottom: .2rem; }
.authx--register .authx-sub { margin-bottom: .9rem; font-size: .85rem; }
.authx--register .form-group { margin-bottom: .85rem; }
/* document uploads stack full-width: half-width boxes push the shop
   photo awkwardly toward the card edge */
.authx--register .docs-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
}
.authx--register .docs-grid .file-box { width: 100%; }

/* one-time highlight on the field group the error-scroll lands on */
.authx-flash {
    animation: authxFlash 1.5s ease 1;
    border-radius: var(--radius-sm);
}
@keyframes authxFlash {
    0% { background: rgba(239, 68, 68, .12); box-shadow: 0 0 0 3px rgba(239, 68, 68, .18); }
    100% { background: transparent; box-shadow: none; }
}

/* New Driving Licence apply form extras */
.terms-box {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface-elevated, #fff);
    padding: .85rem 1rem;
    max-height: 210px;
    overflow-y: auto;
    margin-bottom: .9rem;
}
.terms-box ol {
    margin: 0;
    padding-left: 1.15rem;
    display: grid;
    gap: .45rem;
    font-size: .86rem;
    line-height: 1.5;
    color: var(--text-muted, #475569);
}
.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: .55rem;
    font-size: .9rem;
    line-height: 1.5;
    cursor: pointer;
}
.checkbox-label input[type="checkbox"] {
    margin-top: .2rem;
    width: 1rem;
    height: 1rem;
    accent-color: var(--primary, #0066cc);
    flex: none;
}
.ll-eligibility-msg {
    margin-top: .35rem;
    font-size: .82rem;
    line-height: 1.45;
}
.ll-eligibility-valid { color: var(--success, #15803d); }
.ll-eligibility-invalid { color: var(--danger, #dc2626); }
.authx--register .form-label { margin-bottom: .28rem; font-size: .8rem; }
.authx--register .file-box { padding: .62rem .75rem; gap: .55rem; }
.authx--register .file-box-icon { width: 2rem; height: 2rem; font-size: .95rem; }
.authx--register .strength-meter { margin-top: .35rem; }

/* fee / free-registration strip above the submit button */
.reg-fee-note {
    display: flex;
    align-items: center;
    gap: .55rem;
    font-size: .82rem;
    line-height: 1.45;
    color: var(--text);
    background: var(--surface-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: .6rem .8rem;
    margin-bottom: .9rem;
}

.reg-fee-note strong { font-weight: 700; white-space: nowrap; }

.reg-fee-note--free {
    color: var(--success);
    background: var(--success-bg);
    border-color: transparent;
    font-weight: 600;
}

/* ---- resume registration: abandoned setup payment card ---- */
.authx-resume-card {
    display: grid;
    gap: .7rem;
}

.authx-resume-row {
    display: flex;
    align-items: center;
    gap: .8rem;
    padding: .7rem .85rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface-alt);
}

.authx-resume-icon {
    flex: 0 0 auto;
    width: 2.3rem;
    height: 2.3rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: .55rem;
    background: var(--primary-light);
    color: var(--primary-dark);
    font-size: 1.05rem;
}

.authx-resume-label {
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.authx-resume-value {
    font-size: .9rem;
    line-height: 1.45;
    color: var(--text);
}

.authx-resume-note {
    margin-top: .3rem;
    padding: .7rem .85rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--primary);
    background: var(--primary-light);
    color: var(--primary-dark);
    font-size: .85rem;
    line-height: 1.5;
}

/* register brand side: cluster content instead of stretching it
   across a very tall card */
.authx--register .authx-pane--brand {
    justify-content: center;
    gap: 1.3rem;
}

.authx--register .authx-brand-main { margin-top: 0; }
.authx--register .authx-brand-title { font-size: 1.85rem; }
.authx--register .authx-brand-text { font-size: .95rem; }

/* keep long validation text inside the card */
.alert, .form-error, .form-hint {
    overflow-wrap: anywhere;
    word-break: break-word;
}
.input-group { flex-wrap: wrap; }

/* ---- brand side -------------------------------------------- */
.authx-pane--brand {
    position: relative;
    padding: 3rem 2.75rem;
    justify-content: space-between;
    color: #fff;
    background:
        radial-gradient(120% 90% at 100% 0%, var(--brand-glow) 0%, transparent 55%),
        linear-gradient(160deg, var(--primary-dark) 0%, var(--primary) 60%, var(--gradient-end) 100%);
}

.authx-brand-badge {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    align-self: flex-start;
    font-size: .78rem;
    font-weight: 600;
    letter-spacing: .02em;
    background: rgba(255, 255, 255, .14);
    border: 1px solid rgba(255, 255, 255, .25);
    border-radius: 999px;
    padding: .35rem .85rem;
}

.authx-brand-main { margin-top: 1rem; }

.authx-brand-title {
    font-size: 1.7rem;
    font-weight: 800;
    line-height: 1.25;
    margin: 0 0 .7rem;
}

.authx-brand-text {
    margin: 0;
    font-size: .92rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, .88);
}

.authx-brand-list {
    list-style: none;
    margin: 1.5rem 0 0;
    padding: 0;
    display: grid;
    gap: .7rem;
}

.authx-brand-list li {
    display: flex;
    gap: .6rem;
    align-items: flex-start;
    font-size: .86rem;
    color: rgba(255, 255, 255, .92);
}

.authx-brand-list .tick {
    flex: 0 0 auto;
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, .18);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: .7rem;
    margin-top: .1rem;
}

.btn-ghost-light {
    background: rgba(255, 255, 255, .12);
    border: 1.5px solid rgba(255, 255, 255, .7);
    color: #fff;
    align-self: flex-start;
}

.btn-ghost-light:hover {
    background: #fff;
    color: var(--primary-dark);
    border-color: #fff;
}

.authx-brand-foot {
    font-size: .74rem;
    color: rgba(255, 255, 255, .65);
}

/* ---- single card mode (device gate) ------------------------ */
.authx--single {
    width: min(620px, 100%);
    min-height: 0;
    align-items: center;
}

.authx--single .authx-card-single {
    width: 100%;
    background: transparent;
    box-shadow: none;
    border-radius: 0;
}

.authx-card-single {
    width: min(600px, 100%);
    margin: 0 auto;
    background: var(--surface);
    border-radius: 1.25rem;
    box-shadow: 0 24px 60px rgba(15, 23, 42, .35);
    padding: 2.25rem 2.5rem;
    min-width: 0;
    animation: authxPop .35s ease both;
}

@keyframes authxPop {
    from { opacity: 0; transform: translateY(10px) scale(.985); }
    to   { opacity: 1; transform: none; }
}

.device-list { display: grid; gap: .6rem; margin: 1rem 0; }

.device-item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .8rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface-alt);
    padding: .7rem .85rem;
}

.device-icon {
    flex: 0 0 auto;
    width: 2.4rem;
    height: 2.4rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: .55rem;
    background: var(--primary-light);
    font-size: 1.05rem;
}

.device-meta { flex: 1 1 auto; min-width: 0; }

.device-meta strong {
    display: block;
    font-size: .88rem;
    overflow-wrap: anywhere;
}

.device-item form { flex: 0 0 auto; }

.device-meta small {
    display: block;
    color: var(--text-muted);
    font-size: .74rem;
    overflow-wrap: anywhere;
}

/* password strength meter */
.strength-meter {
    height: 4px;
    border-radius: 999px;
    background: var(--border);
    overflow: hidden;
    margin-top: .45rem;
}

.strength-meter span {
    display: block;
    height: 100%;
    width: 0;
    border-radius: inherit;
    background: var(--danger);
    transition: width .25s ease, background-color .25s ease;
}

/* ---- responsive -------------------------------------------- */
@media (max-width: 1024px) {
    .authx-pane--form { padding: 2.25rem 2rem; }
    .authx-pane--brand { padding: 2.25rem 2rem; }
}

@media (max-width: 920px) {
    .auth-wrap--free { padding: 1.25rem .9rem 2rem; }

    /* stack: form first, brand banner below */
    .authx { flex-direction: column; min-height: 0; }

    /* mobile: natural page flow — no fixed card height or inner scroll */
    .authx--register { height: auto; }
    .authx-form-body { overflow: visible; padding-right: 0; }

    .authx-pane--brand {
        padding: 1.35rem 1.5rem 1.6rem;
        gap: .8rem;
        justify-content: flex-start;
    }

    .authx-brand-list,
    .authx-brand-foot,
    .authx-pane--brand .btn-ghost-light { display: none; }
    .authx-brand-main { margin-top: 0; }
    .authx-brand-title { font-size: 1.15rem; margin-bottom: .3rem; }
    .authx-brand-text { font-size: .82rem; }

    .authx-pane--form { padding: 1.6rem 1.4rem 1.75rem; animation: authxPop .35s ease both; justify-content: flex-start; }
}

@media (max-width: 620px) {
    .form-grid-2 { grid-template-columns: 1fr; column-gap: 0; }
}

@media (max-width: 480px) {
    .auth-wrap--free { padding: .9rem .7rem 1.5rem; }
    .authx { border-radius: 1rem; }
    .authx-pane--form { padding: 1.3rem 1rem 1.5rem; }
    .authx-pane--brand { padding: 1.15rem 1.05rem 1.3rem; }
    .authx-card-single { padding: 1.5rem 1.15rem; }
    .device-item { gap: .55rem .7rem; }
    .device-item form { flex: 1 1 100%; }
    .device-item form .btn { width: 100%; }
    .otp-row { flex-wrap: wrap; }
    .input-group { flex-direction: column; align-items: stretch; }
    .input-group .form-control:first-child,
    .input-group .btn { border-radius: var(--radius-sm); }
}

@media (max-width: 360px) {
    .authx-pane--form { padding: 1.1rem .8rem 1.3rem; }
    .file-box { padding: .55rem .65rem; }
}

/* ---------- Global responsive hardening -------------------------------- */
/* never let images or long tokens push a screen wider  */
.content img, .modal-body img, .pay-body img, .wallet-hero img { max-width: 100%; height: auto; }

code { overflow-wrap: anywhere; }

h5 { font-size: .95rem; margin: 0 0 .3rem; }

@media (max-width: 640px) {
    .wallet-hero { padding: 1.25rem 1.1rem; }
    .wallet-hero-balance { font-size: 1.9rem; }
    .wallet-hero-actions { text-align: left; }
    .page-header h1 { font-size: 1.2rem; }
    .section-head { flex-direction: column; gap: .5rem; }
    .card-header, .card-body, .card-footer { padding-left: 1rem; padding-right: 1rem; }
    .modal-foot { flex-wrap: wrap; }
    .modal-foot .btn { flex: 1 1 auto; }
    .modal-body { padding: 1rem; }
}

@media (max-width: 480px) {
    .table th, .table td { padding: .55rem .6rem; font-size: .82rem; }
    .breadcrumb-back { width: 1.9rem; height: 1.9rem; }
    .detail-grid { gap: .75rem 1rem; }
}

/* Modal responsiveness on narrow screens: keep content inside the viewport
   and let long text (e.g. approve/reject notices) wrap cleanly. */
@media (max-width: 480px) {
    .modal-backdrop { padding: .75rem; }
    .modal {
        max-width: 100%;
        max-height: 88vh;
        margin: 0;
    }
    .modal-head { padding: .9rem 1rem; gap: .75rem; }
    .modal-head h3 { font-size: 1rem; }
    .modal-body, .modal-foot { padding-left: 1rem; padding-right: 1rem; }
    .modal-foot { flex-direction: column-reverse; align-items: stretch; }
    .modal-foot .btn { width: 100%; }
}

@media (max-width: 360px) {
    .modal-backdrop { padding: .5rem; }
}

/* ---- vehicle class selection (New Learner Licence) -------- */
.vehicle-classes {
    display: flex;
    flex-wrap: wrap;
    gap: .6rem;
    margin-bottom: .4rem;
}

.vehicle-class {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    padding: .65rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--card-bg, #fff);
    cursor: pointer;
    transition: border-color .15s, background .15s, box-shadow .15s;
    user-select: none;
}

.vehicle-class:hover { border-color: var(--primary); }

.vehicle-class input[type="checkbox"] {
    accent-color: var(--primary);
    cursor: pointer;
}

.vehicle-class.is-selected {
    border-color: var(--primary);
    background: var(--primary-bg, rgba(79, 70, 229, .08));
    box-shadow: 0 0 0 1px var(--primary) inset;
}

.vehicle-class-label { font-weight: 600; font-size: .88rem; }

.vehicle-class-price {
    font-size: .78rem;
    font-weight: 600;
    color: var(--primary);
    background: var(--primary-bg, rgba(79, 70, 229, .08));
    padding: .12rem .5rem;
    border-radius: 999px;
    white-space: nowrap;
}

/* ------ Trans/Hill conditional details (New Learner Licence) -------- */
.trans-hill-fields {
    margin-top: .5rem;
    padding: 1rem 1.1rem;
    border: 1px dashed var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg, #f8f9fc);
}

.trans-hill-fields .form-section-title:first-child { margin-top: 0; }

/* ------ Admin announcements ticker (operator portal) -------- */
.announcement-ticker {
    display: flex;
    align-items: center;
    gap: .8rem;
    margin-bottom: 1.25rem;
    padding: .55rem .9rem;
    border: 1px solid var(--primary-border, rgba(79, 70, 229, .35));
    border-left: 4px solid var(--primary);
    border-radius: var(--radius-sm);
    background: var(--info-bg);
    overflow: hidden;
}

.announcement-ticker-label {
    flex-shrink: 0;
    font-size: .82rem;
    font-weight: 600;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: .04em;
}

.announcement-ticker-viewport {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
}

.announcement-ticker-track {
    display: inline-flex;
    align-items: center;
    will-change: transform;
    animation: announcement-marquee 28s linear infinite;
}

.announcement-ticker-track > .announcement-ticker-item {
    padding-right: 2.6rem;
}

.announcement-ticker-item {
    display: inline-flex;
    align-items: center;
    font-size: .88rem;
    font-weight: 500;
    color: var(--text);
    white-space: nowrap;
}

.announcement-ticker:hover .announcement-ticker-track {
    animation-play-state: paused;
}

@keyframes announcement-marquee {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}

@media (prefers-reduced-motion: reduce) {
    .announcement-ticker-track {
        animation: none;
        flex-wrap: wrap;
    }
}

/* ---------- Support tickets ---------- */
.ticket-panel { overflow: hidden; }

.ticket-panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 1.1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    background: var(--surface-alt);
}

.ticket-panel-user {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    min-width: 0;
}

.ticket-panel-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.ticket-panel-sub {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex-wrap: wrap;
    margin-top: 0.15rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.ticket-panel-sub .sep { color: #cbd5e1; }

.ticket-panel-badges { display: flex; gap: 0.5rem; flex-wrap: wrap; }

.ticket-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem 1.5rem;
    padding: 1.25rem;
}

.ticket-meta-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
}

.ticket-meta-label {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.ticket-meta-item .badge { align-self: flex-start; }

.ticket-panel-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 0.9rem 1.25rem;
    border-top: 1px solid var(--border);
    background: var(--surface-alt);
    border-radius: 0 0 var(--radius) var(--radius);
}

.ticket-status-form {
    display: flex;
    align-items: flex-end;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.ticket-status-form .form-group { min-width: 190px; }

/* ---------- Ticket list ---------- */
.ticket-list { display: flex; flex-direction: column; }

.ticket-row {
    display: flex;
    align-items: stretch;
}

.ticket-row + .ticket-row .ticket-item { border-top: 1px solid var(--border); }

.ticket-check {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    padding: 0 0.15rem 0 1rem;
    cursor: pointer;
}

.ticket-check input { accent-color: var(--primary); }

.ticket-check ~ .ticket-item { flex: 1; min-width: 0; }

.ticket-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.05rem 1.25rem;
    color: var(--text);
    transition: background 0.15s ease;
}

.ticket-item + .ticket-item { border-top: 1px solid var(--border); }

.ticket-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: transparent;
}

.ticket-item--open::before { background: var(--warning); }
.ticket-item--in_progress::before { background: var(--primary); }
.ticket-item--waiting_operator::before { background: #0ea5e9; }
.ticket-item--resolved::before { background: var(--success); }
.ticket-item--closed::before { background: #94a3b8; }

.ticket-item:hover { background: var(--surface-alt); }
.ticket-item:hover .ticket-subject { color: var(--primary); }
.ticket-item:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: -3px;
    border-radius: var(--radius-sm);
}

.ticket-avatar {
    flex: 0 0 auto;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--primary-dark);
    background: var(--primary-light);
    border: 1px solid var(--border);
}

.ticket-avatar--amber { background: var(--warning-bg); color: var(--warning-text); border-color: #fcd34d; }
.ticket-avatar--green { background: var(--success-bg); color: var(--success-text); border-color: #bbf7d0; }
.ticket-avatar--slate { background: var(--secondary-bg); color: var(--secondary); border-color: #cbd5e1; }

.ticket-main {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.ticket-topline {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    min-width: 0;
}

.ticket-no {
    flex: 0 0 auto;
    font-weight: 700;
    font-size: 0.78rem;
    letter-spacing: 0.03em;
    color: var(--text-muted);
    white-space: nowrap;
}

.ticket-subject {
    min-width: 0;
    font-weight: 600;
    font-size: 0.95rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: color 0.12s ease;
}

.ticket-badges {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    justify-content: flex-end;
}

.ticket-count {
    flex: 0 0 auto;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--surface-alt);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0.1rem 0.5rem;
    white-space: nowrap;
}

.ticket-subline {
    display: flex;
    align-items: center;
    gap: 0.4rem 0.75rem;
    flex-wrap: wrap;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.ticket-subline .sep { color: #cbd5e1; }

.ticket-side {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.45rem;
}

.ticket-chevron { color: #94a3b8; font-size: 1.1rem; line-height: 1; }

/* ---------- Chips ---------- */
.chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.16rem 0.6rem;
    border-radius: 999px;
    background: var(--surface-alt);
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.74rem;
    font-weight: 600;
    white-space: nowrap;
}

/* ---------- Conversation (chat bubbles) ---------- */
.conversation {
    max-height: 560px;
    overflow-y: auto;
    overscroll-behavior: contain;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1.25rem;
}

.bubble {
    display: flex;
    flex-direction: column;
    max-width: min(76%, 680px);
}

.bubble--in { align-self: flex-start; align-items: flex-start; }
.bubble--out { align-self: flex-end; align-items: flex-end; }

.bubble-box {
    padding: 0.8rem 1rem;
    background: var(--surface-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.bubble--in .bubble-box { border-top-left-radius: 4px; }
.bubble--out .bubble-box {
    background: linear-gradient(135deg, var(--primary-dark), #123c7a);
    border-color: transparent;
    color: #fff;
    border-top-right-radius: 4px;
}

.bubble-meta {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    flex-wrap: wrap;
    margin-bottom: 0.35rem;
}

.bubble--out .bubble-meta { justify-content: flex-end; }

.bubble-author { font-size: 0.86rem; font-weight: 700; }
.bubble--out .bubble-author { color: #fff; }

.bubble-role {
    font-size: 0.64rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.1rem 0.5rem;
    border-radius: 999px;
    background: var(--secondary-bg);
    color: var(--secondary);
}

.bubble--out .bubble-role { background: rgba(255, 255, 255, 0.22); color: #fff; }

.bubble-time {
    margin-left: auto;
    font-size: 0.72rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.bubble--out .bubble-time { color: rgba(255, 255, 255, 0.72); }

.bubble-text {
    margin: 0;
    font-size: 0.92rem;
    line-height: 1.55;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.message-attachment {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    align-self: flex-start;
    margin-top: 0.55rem;
    padding: 0.4rem 0.75rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--primary-dark);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: background 0.12s ease;
}

.message-attachment:hover {
    border-color: var(--primary);
    text-decoration: none;
}

.bubble--out .message-attachment {
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.4);
}

.bubble--out .message-attachment:hover { background: rgba(255, 255, 255, 0.24); }

/* ---------- Reply composer ---------- */
.reply-box {
    display: flex;
    align-items: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border);
    background: var(--surface-alt);
    border-radius: 0 0 var(--radius) var(--radius);
}

.reply-box .form-control {
    flex: 1 1 auto;
    resize: none;
}

.reply-file {
    display: none;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--primary-dark);
    background: var(--primary-light);
    border: 1px dashed var(--primary);
    border-radius: var(--radius-sm);
    padding: 0.25rem 0.6rem;
}

.reply-file.is-visible { display: inline-flex; }

.reply-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 0 0 auto;
    flex-wrap: wrap;
}

.reply-attach { display: inline-flex; cursor: pointer; }

.reply-errors {
    padding: 0 1.25rem 1rem;
    background: var(--surface-alt);
}

/* ---------- Character counters ---------- */
.char-counter {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0.4rem 0 0;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.char-counter .char-count.is-over { color: var(--danger); font-weight: 700; }

@media (max-width: 620px) {
    .ticket-meta { padding: 1rem; gap: 1rem; }

    .ticket-panel-head { padding: 0.9rem 1rem; }
    .ticket-panel-badges { width: 100%; }
    .ticket-panel-foot { flex-direction: column; align-items: stretch; }
    .ticket-status-form { align-items: stretch; flex-direction: column; }
    .ticket-status-form .btn { width: 100%; }

    .ticket-item { flex-wrap: wrap; padding: 0.9rem 1rem; }
    .ticket-side {
        width: 100%;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
    .ticket-chevron { display: none; }

    .conversation { padding: 0.9rem; gap: 0.85rem; }
    .bubble { max-width: 92%; }

    .reply-box { flex-direction: column; align-items: stretch; padding: 0.9rem 1rem; }
    .reply-actions { justify-content: flex-end; }
}

/* ---------- Admin payments dashboard ---------- */
.admin-dash { display: grid; gap: 1rem; margin-bottom: 1.5rem; }
.admin-dash-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
}
.admin-dash-panel { min-width: 0; }
.admin-dash-panel .card-header h3 { margin: 0; font-size: 0.95rem; }
.stat-sub { font-size: 0.78rem; color: var(--text-muted); margin-top: 0.15rem; }
.stats-grid--sm { gap: 0.6rem; }
.stats-grid--sm .stat-card { padding: 0.7rem 0.85rem; gap: 0.7rem; }
.stats-grid--sm .stat-icon { width: 2.2rem; height: 2.2rem; font-size: 1rem; }
@media (max-width: 640px) {
    .stats-grid--sm .stat-card { flex: 1 1 calc(50% - 0.6rem); }
}

/* ---------- Admin audit log table ---------- */
.avatar--ghost { background: var(--surface-alt); color: var(--text-muted); border: 1px solid var(--border); }
.table .avatar { width: 1.8rem; height: 1.8rem; font-size: 0.72rem; }

.audit-user { display: flex; align-items: center; gap: 0.6rem; }
.audit-user-name { font-weight: 600; font-size: 0.9rem; line-height: 1.2; }
.audit-action { display: flex; align-items: flex-start; gap: 0.6rem; }
.audit-action-icon { font-size: 1.05rem; line-height: 1.3; flex-shrink: 0; }
.audit-action-label { font-weight: 600; font-size: 0.9rem; line-height: 1.2; }
.audit-action code { font-size: 0.72rem; color: var(--text-muted); }

.audit-ip {
    display: inline-block;
    padding: 0.08rem 0.45rem;
    background: var(--surface-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    white-space: nowrap;
}
.audit-time { white-space: nowrap; }

.audit-meta {
    margin: 0.6rem 0 0;
    padding: 0.75rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    line-height: 1.45;
    max-height: 40vh;
    overflow: auto;
    white-space: pre-wrap;
    overflow-wrap: break-word;
}

/* ---------- Wallet figures ---------- */
.money-neutral { color: var(--text-muted); font-weight: 600; }

/* ---------- Responsive dashboard activity feed ---------- */
.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.85rem 1.25rem;
    border-top: 1px solid var(--border);
    transition: background 0.15s ease;
}
.card > .activity-item:first-child { border-top: none; }
.activity-item:hover { background: var(--surface-alt); }

.activity-item-main { flex: 1 1 auto; min-width: 0; }
.activity-item-title {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.45rem;
    font-size: 0.9rem;
    line-height: 1.3;
}
.activity-item-action {
    color: var(--text-muted);
    font-size: 0.85rem;
    white-space: nowrap;
}
.activity-item-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.15rem;
}
.activity-item-meta code { font-size: 0.72rem; color: var(--text-muted); }
.activity-item-ip { white-space: nowrap; }
.activity-item-amount { text-align: right; white-space: nowrap; flex-shrink: 0; }
.activity-item-time { white-space: nowrap; flex-shrink: 0; align-self: center; }

@media (max-width: 600px) {
    .activity-item { flex-wrap: wrap; padding: 0.8rem 1rem; }
    .activity-item-main { flex: 1 1 calc(100% - 3rem); }
    .activity-item-amount,
    .activity-item-time { flex: 1 1 100%; text-align: left; margin-left: 3rem; }
}

svg text { font-family: var(--font); }

/* ---------- Needs attention list ---------- */
.needs-attention-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 1.25rem;
    border-top: 1px solid var(--border);
    transition: background 0.15s ease;
}
.card > .needs-attention-item:first-child { border-top: none; }
.needs-attention-item:hover { background: var(--surface-alt); }
.needs-attention-title { color: var(--text); font-size: 0.9rem; }
.needs-attention-count {
    font-weight: 700;
    font-size: 1rem;
    color: var(--danger);
}

/* ---------- v12: Live operators ---------- */
.live-header-title { display: inline-flex; align-items: center; gap: 0.55rem; }
.live-dot {
    width: 0.55rem; height: 0.55rem; border-radius: 50%;
    background: var(--success); flex-shrink: 0;
    box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.45);
    animation: live-ping 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}
.live-head {
    display: flex; flex-wrap: wrap; gap: 1.5rem 2.5rem;
    padding-bottom: 1rem; margin-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}
.live-count { display: grid; }
.live-count strong {
    font-size: 1.9rem; line-height: 1.1; color: var(--primary-dark);
    font-variant-numeric: tabular-nums;
}
.live-count span {
    font-size: 0.78rem; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 0.05em;
}
.live-roster { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.5rem; }
.live-operator {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 0.7rem 0.85rem;
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    text-decoration: none; color: var(--text);
    transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.live-operator:hover,
.live-operator:focus-visible {
    border-color: var(--primary); box-shadow: var(--shadow-sm); background: var(--surface-alt);
}
.live-operator.is-idle { opacity: 0.72; }
.live-operator-main { flex: 1 1 auto; min-width: 0; display: grid; }
.live-operator-name {
    display: flex; align-items: center; gap: 0.4rem;
    font-weight: 600; font-size: 0.92rem;
}
.live-pulse {
    width: 0.5rem; height: 0.5rem; border-radius: 50%;
    background: var(--success); flex-shrink: 0;
    box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.45);
    animation: live-ping 1.8s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}
.live-operator-meta { display: grid; justify-items: end; gap: 0.25rem; flex-shrink: 0; }
.live-more { padding: 0.5rem 0.25rem 0; font-weight: 600; }
.live-empty { grid-column: 1 / -1; text-align: center; color: var(--text-muted); padding: 0.75rem 0; }

@keyframes live-ping {
    0% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.45); }
    70% { box-shadow: 0 0 0 6px rgba(22, 163, 74, 0); }
    100% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0); }
}
@media (max-width: 900px) {
    .live-roster { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
    .live-count strong { font-size: 1.5rem; }
    .live-operator { flex-wrap: wrap; }
    .live-operator-meta { flex: 1 1 calc(100% - 3.75rem); margin-left: 3.75rem; justify-items: start; }
}

/* ---------- v12: Platform trend ---------- */
.trend-kpis {
    display: flex; flex-wrap: wrap; gap: 1rem;
    margin-bottom: 1.25rem;
}
.trend-kpi {
    flex: 1 1 190px; min-width: 190px;
    display: grid; gap: 0.15rem;
    padding: 0.9rem 1rem;
    background: var(--surface-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}
.trend-kpi-label {
    font-size: 0.75rem; font-weight: 700; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 0.05em;
}
.trend-kpi-value { font-size: 1.5rem; font-weight: 800; line-height: 1.15; color: var(--text); }
.trend-kpi-delta { font-size: 0.78rem; font-weight: 600; }
.trend-kpi-delta.is-up { color: #15803d; }
.trend-kpi-delta.is-down { color: var(--danger); }
.trend-kpi-delta.is-neutral { color: var(--text-muted); font-weight: 500; }

.trend-chart { width: 100%; }

/* ---------- v13: dashboard donut charts ---------- */
.pie-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem;
    align-items: stretch;
}
.pie-grid-item { display: flex; }
.donut-chart {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 1rem 1.15rem;
    background: var(--surface-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}
.donut-chart-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
}
.donut-chart-subtitle {
    font-size: 0.74rem;
    color: var(--text-muted);
    margin: 0.1rem 0 0.9rem;
}
.donut-figure {
    position: relative;
    width: 100%;
    max-width: 240px;
    margin: 0 auto 0.85rem;
}
.donut-svg { display: block; width: 100%; height: auto; }
.donut-segment {
    fill: none;
    stroke-width: 26;
    stroke-linecap: round;
    transition: stroke-opacity 0.15s ease;
}
.donut-segment:hover { stroke-opacity: 0.78; }
.donut-hole { fill: var(--surface); }
.donut-center {
    position: absolute;
    inset: 0;
    display: grid;
    place-content: center;
    place-items: center;
    pointer-events: none;
    text-align: center;
}
.donut-center-value {
    font-size: 1.4rem;
    font-weight: 800;
    line-height: 1.1;
    color: var(--text);
    font-variant-numeric: tabular-nums;
}
.donut-center-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.donut-empty-ring {
    width: 100%;
    aspect-ratio: 1;
    border: 14px solid var(--border);
    border-radius: 50%;
}
.donut-legend {
    display: grid;
    gap: 0.35rem;
    width: 100%;
}
.donut-legend-row {
    display: grid;
    grid-template-columns: 0.6rem minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.82rem;
}
.donut-legend-dot {
    width: 0.6rem;
    height: 0.6rem;
    border-radius: 50%;
    flex-shrink: 0;
}
.donut-legend-label {
    color: var(--text);
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.donut-legend-value { color: var(--text-muted); font-variant-numeric: tabular-nums; }
.donut-legend-pct {
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
    text-align: right;
    min-width: 3.2rem;
}

@media (max-width: 900px) {
    .pie-grid { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
    .donut-center-value { font-size: 1.15rem; }
    .donut-legend-row { grid-template-columns: 0.6rem minmax(0, 1fr) auto; }
    .donut-legend-pct { grid-column: 3; min-width: 0; }
}

@media (max-width: 480px) {
    .trend-kpi { flex: 1 1 100%; min-width: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .live-dot, .live-pulse { animation: none; }
}

/* ---- admin theme settings (V3) ---------------------------------- */
.theme-layout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 1.5rem; align-items: start; }

.theme-color-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 0.85rem; }
.theme-color-row {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.55rem 0.6rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface-alt);
}
.theme-swatch {
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
    border: 1px solid rgba(15, 23, 42, 0.15);
    border-radius: var(--radius-sm);
    background: transparent;
    cursor: pointer;
    flex: 0 0 auto;
}
.theme-swatch::-webkit-color-swatch-wrapper { padding: 2px; }
.theme-swatch::-webkit-color-swatch { border: none; border-radius: 4px; }
.theme-hex { width: 7.5rem; font-family: 'Consolas', ui-monospace, monospace; font-size: 0.78rem; }
.theme-current {
    display: inline-block;
    margin-top: 0.3rem;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    background: var(--primary-light);
    color: var(--primary-dark);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.03em;
}
.theme-current code { font-family: 'Consolas', ui-monospace, monospace; }
.theme-current span { font-weight: 800; }
.form-error { font-size: 0.72rem; color: var(--danger); margin-top: 0.25rem; }

.theme-preview-card .card-body { padding-bottom: 1.5rem; }
.theme-preview { position: sticky; top: 4.75rem; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); border: 1px solid var(--border); font-size: 0.8rem; }
.tp-topbar {
    display: flex; align-items: center; gap: 0.5rem;
    background: var(--header-bg); color: var(--header-text);
    padding: 0.7rem 0.9rem; border-bottom: 1px solid var(--border);
}
.tp-avatar {
    width: 1.7rem; height: 1.7rem; border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    color: var(--button-text);
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 0.72rem; font-weight: 800; flex: 0 0 auto;
}
.tp-title { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tp-spacer { flex: 1 1 auto; min-width: 0.5rem; }
.tp-body { display: grid; grid-template-columns: 150px 1fr; min-height: 380px; }
.tp-sidebar {
    background: linear-gradient(180deg, var(--sidebar-bg) 0%, var(--sidebar-bg) 55%, var(--sidebar-bg-end) 100%);
    padding: 0.85rem 0.6rem; display: flex; flex-direction: column; gap: 0.3rem;
}
.tp-brand {
    width: 1.5rem; height: 1.5rem; border-radius: var(--radius-sm);
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    color: var(--button-text);
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 0.75rem; font-weight: 900;
    margin: 0 0.15rem 0.5rem;
}
.tp-link {
    padding: 0.4rem 0.5rem; border-radius: 6px; font-size: 0.72rem;
    color: var(--sidebar-text);
}
.tp-link.active { background: var(--sidebar-active-bg); color: var(--sidebar-active-text); font-weight: 700; }
.tp-main { background: var(--bg); padding: 1rem; display: flex; flex-direction: column; gap: 0.8rem; }
.tp-actions { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.tp-actions .btn { padding: 0.4rem 0.7rem; font-size: 0.72rem; }
.tp-inputs { display: grid; gap: 0.45rem; }
.tp-inputs .form-control { font-size: 0.74rem; padding: 0.45rem 0.6rem; }
.tp-badges { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.tp-badges .badge { font-size: 0.66rem; }
.tp-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
    padding: 0.75rem;
}
.theme-preview .alert { margin-bottom: 0.55rem; }
.theme-preview .table th { padding: 0.45rem 0.5rem; }
.theme-preview .table td { padding: 0.45rem 0.5rem; }
.tp-link-sample { margin: 0; font-size: 0.75rem; color: var(--text-muted); }
.tp-link-sample a { color: var(--link); text-decoration: underline; }
.tp-link-sample a:hover { color: var(--link-hover); }
.preview-focused {
    box-shadow: 0 0 0 3px var(--input-focus-ring), var(--shadow-sm);
    border-color: var(--input-focus);
}
.theme-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; }

/* predefined theme presets */
.theme-presets {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}
.theme-preset {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    padding: 0.9rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface-alt);
}
.theme-preset-swatches { display: flex; gap: 4px; flex-wrap: wrap; }
.theme-preset-swatch {
    width: 1.65rem;
    height: 1.65rem;
    border-radius: 6px;
    border: 1px solid rgba(15, 23, 42, 0.12);
    display: block;
}
.theme-preset-info { display: flex; flex-direction: column; gap: 2px; }
.theme-preset-info strong { font-size: 0.9rem; color: var(--text); }
.theme-preset-info small { font-size: 0.74rem; color: var(--text-muted); }
.theme-preset-apply { margin-top: auto; }
.theme-preset-apply .btn { width: 100%; }

/* responsive */
@media (max-width: 1100px) {
    .theme-layout { grid-template-columns: 1fr; }
    .theme-preview { position: static; }
}
@media (max-width: 640px) {
    .theme-layout { gap: 1rem; }
    .theme-presets { grid-template-columns: 1fr; }
    .theme-color-grid { grid-template-columns: 1fr; }
    .theme-color-row { flex-wrap: wrap; }
    .theme-hex { width: 100%; flex: 1 1 100%; }
    .theme-swatch { width: 2.5rem; height: 2.5rem; }
    .tp-body { grid-template-columns: 1fr; min-height: auto; }
    .tp-sidebar { display: none; }
    .tp-topbar { padding: 0.6rem 0.75rem; }
    .tp-main { padding: 0.75rem; }
    .theme-actions .btn { flex: 1 1 auto; }
}
@media (max-width: 420px) {
    .theme-color-grid { grid-template-columns: 1fr; }
    .tp-sidebar { display: none; }
    .theme-preset-swatches { flex-wrap: wrap; }
}

/* ==========================================================================
   Licensing pages (guest status + admin licensing)
   ========================================================================== */
.license-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .6rem;
    margin: 0 0 1.2rem;
}
.license-actions .inline-form { margin: 0; }
.inline-form { display: inline; }
.license-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem 1.5rem;
    margin-bottom: 1.25rem;
}
.license-detail {
    display: flex;
    flex-direction: column;
    gap: .2rem;
    min-width: 0;
}
.license-detail-label {
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--text-muted);
}
.license-detail-value {
    font-size: .95rem;
    color: var(--text);
    overflow-wrap: anywhere;
}
.license-detail-value code {
    font-size: .85rem;
    word-break: break-all;
}
.license-detail-hint {
    display: block;
    font-size: .78rem;
    color: var(--text-muted);
}
@media (max-width: 640px) {
    .license-details { grid-template-columns: 1fr; }
}
@media (max-width: 420px) {
    .license-actions { flex-direction: column; align-items: stretch; }
    .license-actions .btn,
    .license-actions .inline-form .btn { width: 100%; }
}

/* ==========================================================================
   HushHive Portal — v20 UI redesign layer
   Built entirely on the admin-editable theme variables so all presets keep
   working. Adds self-hosted Inter, a full design-token scale and a polished,
   consistent treatment for every component across the app.
   ========================================================================== */

@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url('../fonts/Inter.woff2') format('woff2');
}

:root {
    /* spacing / proportion tokens */
    --radius: 1rem;
    --radius-sm: 0.65rem;
    --radius-md: 0.8rem;
    --radius-lg: 1.1rem;
    --radius-xl: 1.5rem;
    --radius-2xl: 1.75rem;
    --topbar-h: 4rem;
    --content-max: 1520px;
    --overlay: rgba(15, 23, 42, 0.45);
    /* softer, layered elevation */
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
    --shadow: 0 2px 8px rgba(15, 23, 42, 0.06), 0 10px 26px -14px rgba(15, 23, 42, 0.12);
    --shadow-lg: 0 12px 28px rgba(15, 23, 42, 0.12), 0 28px 56px -24px rgba(15, 23, 42, 0.2);
    /* derived, theme-aware helpers */
    --ring: color-mix(in srgb, var(--primary) 18%, transparent);
    --primary-soft: color-mix(in srgb, var(--primary) 10%, var(--surface));
    --success-soft: color-mix(in srgb, var(--success) 9%, var(--surface));
    --danger-soft: color-mix(in srgb, var(--danger) 8%, var(--surface));
    --warning-soft: color-mix(in srgb, var(--warning) 10%, var(--surface));
    --info-soft: color-mix(in srgb, var(--info-text) 9%, var(--surface));
    --primary-deep: color-mix(in srgb, var(--primary-dark) 14%, #000);
    --border-strong: color-mix(in srgb, var(--border) 82%, var(--text-muted));
    --ease: cubic-bezier(0.32, 0.72, 0, 1);
}

/* ---- base polish -------------------------------------------------------- */
body { letter-spacing: 0.002em; }
h1, h2, h3, h4, h5 { letter-spacing: -0.01em; }
::selection { background: var(--input-focus-ring); color: var(--text); }
:focus-visible {
    outline: 2px solid var(--input-focus);
    outline-offset: 2px;
    border-radius: 4px;
}
* { scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-strong); }

/* ---- icon glyphs (SVG sprite) ------------------------------------------ */
.icon {
    width: 1em;
    height: 1em;
    display: inline-block;
    flex: none;
    vertical-align: -0.135em;
    /* rounded joins keep small icons crisp on any stroke thief */
    stroke-linecap: round;
    stroke-linejoin: round;
}
.sidebar-nav .icon,
.sidebar-nav .nav-toggle .icon { width: 1.15em; height: 1.15em; }
.stat-card .icon.stat-glyph { width: 1.35rem; height: 1.35rem; }
.page-header .btn .icon, .card-header .btn .icon { width: 1.1em; height: 1.1em; }
.notif-btn .icon { width: 1.15rem; height: 1.15rem; }

/* ---- buttons ------------------------------------------------------------ */
.btn {
    border-radius: 0.65rem;
    padding: 0.6rem 1.1rem;
    font-size: 0.875rem;
    font-weight: 600;
    transition: background 0.16s var(--ease), border-color 0.16s var(--ease),
        color 0.16s var(--ease), box-shadow 0.16s var(--ease), transform 0.12s var(--ease);
}
.btn:hover:not(:disabled) { transform: translateY(-1px); }
.btn:active:not(:disabled) { transform: translateY(0); box-shadow: none; }

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, color-mix(in srgb, var(--primary) 78%, var(--primary-dark)) 100%);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.12), 0 8px 18px -10px color-mix(in srgb, var(--primary) 65%, transparent);
}
.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
    box-shadow: 0 2px 4px rgba(15, 23, 42, 0.14), 0 12px 24px -12px color-mix(in srgb, var(--primary) 75%, transparent);
}

.btn-secondary {
    background: var(--surface);
    border-color: var(--button-border);
    color: var(--text);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.btn-secondary:hover:not(:disabled) { border-color: var(--border-strong); background: var(--surface-alt); }

.btn-success { background: var(--success); color: var(--button-text); box-shadow: 0 8px 18px -10px color-mix(in srgb, var(--success) 65%, transparent); }
.btn-success:hover:not(:disabled) { background: color-mix(in srgb, var(--success) 88%, #000); }

.btn-danger { background: var(--danger); color: var(--button-text); box-shadow: 0 8px 18px -10px color-mix(in srgb, var(--danger) 65%, transparent); }
.btn-danger:hover:not(:disabled) { background: color-mix(in srgb, var(--danger) 88%, #000); }

.btn-warning { background: var(--warning); color: #fff; }
.btn-warning:hover:not(:disabled) { background: color-mix(in srgb, var(--warning) 88%, #000); }

.btn-danger-outline:hover:not(:disabled) { color: var(--button-text); }
.btn-outline {
    background: transparent;
    border-color: color-mix(in srgb, var(--primary) 55%, transparent);
    color: var(--primary);
}
.btn-outline:hover:not(:disabled) { background: var(--primary-soft); border-color: var(--primary); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-muted); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-alt); color: var(--text); }

.btn-sm { padding: 0.4rem 0.8rem; font-size: 0.8rem; border-radius: 0.55rem; }
.btn-lg { padding: 0.75rem 1.4rem; font-size: 0.95rem; border-radius: 0.75rem; }

/* ---- forms -------------------------------------------------------------- */
.form-control {
    border-radius: 0.65rem;
    padding: 0.62rem 0.9rem;
    font-size: 0.9rem;
    transition: border-color 0.16s var(--ease), box-shadow 0.16s var(--ease), background 0.16s var(--ease);
}
.form-control:hover:not(:focus):not(:disabled) { border-color: var(--border-strong); }
.form-control:focus {
    border-color: var(--input-focus);
    box-shadow: 0 0 0 4px var(--input-focus-ring);
}
.form-control.is-invalid { box-shadow: 0 0 0 4px color-mix(in srgb, var(--danger) 12%, transparent); }
select.form-control {
    appearance: none;
    -webkit-appearance: none;
    padding-right: 2.4rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 8 10 12 14 8'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.85rem center;
    background-size: 1rem;
    cursor: pointer;
}
.form-label { font-size: 0.82rem; font-weight: 600; color: var(--text); }
.form-hint { font-size: 0.76rem; }
.form-error { font-size: 0.78rem; font-weight: 600; }
.form-check input:focus-visible { outline: 2px solid var(--input-focus); outline-offset: 2px; }
.password-toggle { opacity: 0.65; border-radius: 0.5rem; transition: opacity 0.15s var(--ease), color 0.15s var(--ease); }
.password-toggle:hover { opacity: 1; color: var(--text); }

/* file upload boxes */
.file-box { border-radius: 0.75rem; transition: border-color 0.16s var(--ease), background 0.16s var(--ease), transform 0.12s var(--ease); }
.file-box:hover { transform: translateY(-1px); }
.file-box-icon { border-radius: 0.65rem; }
.file-box.has-file { border-color: var(--success); background: var(--success-soft); }

/* ---- cards -------------------------------------------------------------- */
.card {
    border-radius: var(--radius);
    border-color: var(--border);
    box-shadow: var(--shadow-sm), 0 10px 30px -18px rgba(15, 23, 42, 0.12);
    transition: box-shadow 0.16s var(--ease), transform 0.16s var(--ease), border-color 0.16s var(--ease);
}
.card-header { padding: 1rem 1.35rem; }
.card-header h3 { font-size: 1rem; }
.card-body { padding: 1.35rem; }
.card-footer { padding: 1rem 1.35rem; }
.card.is-clickable:hover { box-shadow: var(--shadow); transform: translateY(-1px); border-color: var(--input-border); }

.segmented { border-radius: var(--radius-md); background: var(--bg); }
.segmented a { border-radius: calc(var(--radius-md) - 4px); }
.segmented a.active { color: var(--button-text); background: var(--primary); box-shadow: 0 2px 6px -2px color-mix(in srgb, var(--primary) 60%, transparent); }

/* ---- stats -------------------------------------------------------------- */
.stat-card { border-radius: var(--radius); box-shadow: var(--shadow-sm), 0 10px 30px -20px rgba(15, 23, 42, 0.14); }
.stat-icon { border-radius: 0.9rem; transition: transform 0.16s var(--ease); }
a.stat-link:hover .stat-icon { transform: scale(1.05); }
.stat-label { font-size: 0.72rem; font-weight: 700; }
.stat-value { font-size: 1.45rem; font-variant-numeric: tabular-nums; }

/* ---- badges & chips ----------------------------------------------------- */
.badge {
    padding: 0.24rem 0.65rem;
    font-weight: 600;
    box-shadow: inset 0 0 0 1px color-mix(in srgb, currentColor 14%, transparent);
}
.badge-dot::before { box-shadow: 0 0 0 2px color-mix(in srgb, currentColor 18%, transparent); }

.chip {
    border-radius: 999px;
    font-weight: 600;
}

/* ---- alerts ------------------------------------------------------------- */
.alert {
    border-radius: 0.75rem;
    border-left: 3px solid transparent;
    box-shadow: var(--shadow-sm);
    font-size: 0.88rem;
}
.alert-success { border-left-color: var(--success); background: var(--success-bg); color: var(--success-text); }
.alert-danger { border-left-color: var(--danger); background: var(--danger-bg); color: var(--danger); }
.alert-warning { border-left-color: var(--warning); background: var(--warning-bg); color: var(--warning-text); }
.alert-info { border-left-color: var(--info-text); background: var(--info-bg); color: var(--info-text); }

/* ---- tables ------------------------------------------------------------- */
.table { font-size: 0.875rem; }
.table th {
    padding: 0.8rem 1.1rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.05em;
}
.table td { padding: 0.8rem 1.1rem; }
.table tbody tr { transition: background 0.12s var(--ease); }
.table tbody tr:hover { background: color-mix(in srgb, var(--primary) 4%, var(--surface)); }
.table-wrap { border-radius: var(--radius-md); }
.pagination { align-items: center; }
.pagination a, .pagination span { border-radius: 999px; font-weight: 600; transition: all 0.14s var(--ease); }
.pagination .current { color: var(--button-text); }
.bulk-bar { padding: 0.85rem 1.35rem; }

/* ---- layout shell ------------------------------------------------------- */
.sidebar {
    background:
        radial-gradient(140% 55% at 100% 0%, color-mix(in srgb, var(--sidebar-bg-end) 55%, transparent) 0%, transparent 55%),
        linear-gradient(180deg, var(--sidebar-bg) 0%, var(--sidebar-bg) 60%, var(--sidebar-bg-end) 100%);
    box-shadow: 1px 0 0 color-mix(in srgb, var(--sidebar-bg-end) 90%, transparent);
}
.sidebar-brand {
    padding: 1.15rem 1.25rem;
    border-bottom: 1px solid var(--sidebar-divider, rgba(255, 255, 255, 0.08));
}
.sidebar-brand .brand-mark {
    width: 2.5rem; height: 2.5rem;
    border-radius: 0.7rem;
    background: var(--sidebar-active-bg);
    color: var(--primary-dark);
    font-size: 1.2rem;
    box-shadow: 0 4px 12px -4px rgba(0, 0, 0, 0.3);
}
.sidebar-nav { padding: 0.9rem 0.75rem; }
.sidebar-nav a,
.sidebar-nav .nav-toggle {
    border-radius: 0.65rem;
    padding: 0.62rem 0.85rem;
    font-weight: 500;
}
.sidebar-nav a:hover, .sidebar-nav .nav-toggle:hover { background: color-mix(in srgb, var(--sidebar-text) 12%, transparent); color: var(--sidebar-text-strong); }
.sidebar-nav a.active {
    background: var(--sidebar-active-bg);
    color: var(--sidebar-active-text);
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.18), 0 8px 20px -12px color-mix(in srgb, var(--sidebar-active-bg) 60%, transparent);
}
.sidebar-nav .nav-toggle-caret { color: var(--sidebar-text-muted); }
.sidebar-nav .nav-group-label { letter-spacing: 0.1em; }
.sidebar-nav .nav-badge-hot { background: var(--danger); }
.sidebar-nav .nav-badge-balance {
    background: color-mix(in srgb, var(--success) 20%, transparent);
    color: color-mix(in srgb, var(--success) 62%, #fff);
}
.sidebar-nav .nav-badge-zero {
    background: color-mix(in srgb, var(--sidebar-text) 16%, transparent);
    color: var(--sidebar-text-muted);
}
.sidebar-foot { color: var(--sidebar-text-muted); border-top-color: var(--sidebar-divider, rgba(255, 255, 255, 0.12)); }

.topbar {
    height: var(--topbar-h);
    padding: 0 1.6rem;
    box-shadow: 0 1px 0 var(--header-border, var(--border)), 0 8px 20px -16px rgba(15, 23, 42, 0.14);
}
.topbar-title { font-size: 1.02rem; font-weight: 700; letter-spacing: -0.01em; }
.notif-btn {
    border-radius: 999px;
    border-color: var(--border);
    transition: all 0.15s var(--ease);
}
.notif-btn:hover { background: var(--surface-alt); border-color: var(--border-strong); }
.notif-count { background: var(--danger); color: var(--button-text); box-shadow: 0 0 0 2px var(--surface); }
.avatar { border-radius: 50%; box-shadow: 0 0 0 2px var(--primary-light), 0 4px 10px -4px color-mix(in srgb, var(--primary) 55%, transparent); }
.user-menu-btn { border-radius: 999px; padding: 0.35rem 0.6rem 0.35rem 0.35rem; transition: background 0.15s var(--ease); }
.user-menu-btn:hover { background: var(--surface-alt); }
.notif-dropdown, .user-menu { box-shadow: var(--shadow-lg); border-color: var(--border); }
.notif-item.unread { background: color-mix(in srgb, var(--primary) 6%, var(--surface)); }

.content {
    max-width: var(--content-max);
    margin: 0 auto;
    width: 100%;
    padding: 1.75rem 1.6rem;
}

/* ---- page header / filters / empty ------------------------------------- */
.page-header { margin-bottom: 1.35rem; }
.page-header h1 { font-size: 1.55rem; font-weight: 800; letter-spacing: -0.02em; }
.page-header .sub { font-size: 0.9rem; }
.back-link { border-radius: 0.65rem; font-weight: 600; transition: all 0.15s var(--ease); }
.back-link:hover { background: var(--surface-alt); border-color: var(--border-strong); transform: translateX(-1px); }
.filters { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.15rem; box-shadow: var(--shadow-sm); flex-wrap: wrap; }
.empty { border-radius: var(--radius); background: var(--surface); border: 1px dashed var(--border); }
.empty .empty-icon { border-radius: 999px; color: var(--text-muted); }

/* ---- service intro & related -------------------------------------------- */
.service-intro { border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.service-intro-icon { border-radius: 0.8rem; transition: transform 0.16s var(--ease); }
.service-intro:hover .service-intro-icon { transform: scale(1.06); }
.breadcrumb { color: var(--text-muted); }
.breadcrumb li + li::before { color: var(--text-muted); }

/* ---- modals ------------------------------------------------------------- */
.modal-backdrop { backdrop-filter: blur(3px); background: var(--overlay); }
.modal {
    border-radius: var(--radius-2xl);
    border-color: var(--border);
    box-shadow: var(--shadow-lg);
    animation: v20ModalPop 0.22s var(--ease);
}
.modal-head { padding: 1.1rem 1.4rem; }
.modal-body { padding: 1.4rem; }
.modal-foot { padding: 1rem 1.4rem; }
.modal-close { border-radius: 999px; width: 2rem; height: 2rem; display: grid; place-items: center; transition: background 0.15s var(--ease); }
.modal-close:hover { background: var(--surface-alt); }
@keyframes v20ModalPop { from { opacity: 0; transform: translateY(12px) scale(0.98); } to { opacity: 1; transform: none; } }

/* ---- auth (split panel + single card) ----------------------------------- */
.auth-wrap--free { padding-top: 3rem; padding-bottom: 3rem; }
.authx {
    border-radius: var(--radius-2xl);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 30px 70px -24px rgba(15, 23, 42, 0.32);
    min-height: 660px;
}
.authx-pane--form { padding: 3rem 3.25rem; }
.authx-head { margin-bottom: 1.6rem; }
.authx-head .brand-mark { border-radius: 0.75rem; }
.authx-title { font-size: 1.55rem; letter-spacing: -0.02em; }
.authx-brand-badge { background: color-mix(in srgb, var(--accent) 88%, #fff); border-color: rgba(255, 255, 255, 0.4); }

.authx-pane--brand {
    background:
        radial-gradient(120% 90% at 100% 0%, var(--brand-glow) 0%, transparent 55%),
        linear-gradient(160deg, var(--primary-dark) 0%, var(--primary) 60%, var(--gradient-end) 100%);
}
.authx-pane--brand::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle, rgba(255, 255, 255, 0.16) 1px, transparent 1.6px);
    background-size: 22px 22px;
    -webkit-mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.9), transparent 72%);
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.9), transparent 72%);
    pointer-events: none;
}
.authx-pane--brand::after {
    content: "";
    position: absolute;
    right: -90px;
    bottom: -90px;
    width: 260px;
    height: 260px;
    border-radius: 50%;
    background: radial-gradient(circle, color-mix(in srgb, var(--accent) 55%, transparent) 0%, transparent 60%);
    pointer-events: none;
}
.authx-pane--brand > * { position: relative; }
.authx-brand-title { font-size: 1.85rem; letter-spacing: -0.02em; }
.authx-brand-list .tick { background: color-mix(in srgb, var(--accent) 80%, #fff); color: #fff; }
.btn-ghost-light { background: rgba(255, 255, 255, 0.1); border-color: rgba(255, 255, 255, 0.75); backdrop-filter: blur(4px); }
.authx-card-single { border-radius: var(--radius-2xl); box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 30px 70px -24px rgba(15, 23, 42, 0.3); }
.authx-step-dot.is-active .authx-step-num { box-shadow: 0 0 0 4px var(--primary-light); }
.authx-resume-note { border-color: var(--primary); }
.device-icon { border-radius: 0.65rem; }
.authx-flash { box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 16%, transparent); }

/* guest auth card (non-split screens) */
.auth-card {
    border-radius: var(--radius-2xl);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 30px 70px -24px rgba(15, 23, 42, 0.3);
    padding: 2.5rem;
}

/* ---- payment ------------------------------------------------------------ */
.pay-card { border-radius: var(--radius-2xl); box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 30px 70px -24px rgba(15, 23, 42, 0.3); }
.pay-amount { color: var(--primary-dark); }
.pay-app { border-radius: 0.8rem; transition: all 0.15s var(--ease); box-shadow: var(--shadow-sm); }
.pay-app:hover { border-color: var(--primary); box-shadow: var(--shadow); transform: translateY(-1px); }

/* ---- errors ------------------------------------------------------------- */
.error-code { background: linear-gradient(135deg, var(--primary) 0%, var(--gradient-end) 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---- wallet ------------------------------------------------------------- */
.wallet-hero-actions .btn-primary { background: var(--surface); color: var(--primary); }
.wallet-hero-actions .btn-primary:hover { background: var(--secondary-bg); }
.amount-preset { border-radius: 0.75rem; font-weight: 700; transition: all 0.14s var(--ease); }
.amount-preset.active { color: var(--button-text); }

/* ---- admin theme editor ------------------------------------------------- */
.theme-preset { border-radius: var(--radius); transition: box-shadow 0.16s var(--ease), transform 0.16s var(--ease); }
.theme-preset:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.theme-group { border-radius: var(--radius); }

/* ---- component polish bits ---------------------------------------------- */
.detail-value, .detail-label { font-size: 0.9rem; }
.detail-label { font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); font-weight: 700; }
.trend-kpi-delta.is-up { color: var(--success); }
.trend-kpi-value { font-variant-numeric: tabular-nums; }
.ticker-bar, .announcement-ticker { border-radius: var(--radius-md); }

/* theme-aware cleanups: remove remaining hardcoded colors that ignored
   the admin palette so a theme change really changes every surface */
.breadcrumb li + li::before { color: var(--text-muted); }
.notif-count, .avatar { color: var(--button-text); }
.sidebar-nav a:hover { color: var(--sidebar-text-strong); }
.pagination .current { color: var(--button-text); }
.segmented a.active { color: var(--button-text); }
.btn-danger-outline:hover:not(:disabled) { color: var(--button-text); }
.pay-app { box-shadow: var(--shadow-sm); }
.pay-app:hover { border-color: var(--primary); }
.amount-preset.active { color: var(--button-text); }
.btn-primary, .btn-success, .btn-danger { color: var(--button-text); }
.ticket-panel-sub .sep, .ticket-subline .sep { color: var(--border); }
.ticket-avatar--amber, .ticket-avatar--green, .ticket-avatar--slate { border-color: var(--border); }
.ticket-item--waiting_operator::before { background: var(--info-text); }
.ticket-item--closed::before { background: var(--text-muted); }
.ticket-chevron { color: var(--text-muted); }
.bubble--in { background: color-mix(in srgb, var(--primary-dark) 92%, #000); }
.nav-badge-balance { color: color-mix(in srgb, var(--success) 55%, #fff); }
.wallet-hero-actions .btn-primary { background: var(--surface); color: var(--primary); }
.ll-eligibility-valid { color: var(--success); }
.ll-eligibility-invalid { color: var(--danger); }
.authx-flash { box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 16%, transparent); }

/* ---- responsive + motion refinements ------------------------------------ */
:root { --motion-reduce: no-preference; }
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

@media (max-width: 1100px) {
    .content { padding: 1.4rem 1.2rem; }
    .authx-pane--form { padding: 2.5rem 2rem; }
}

@media (max-width: 768px) {
    .content { padding: 1.25rem 1rem; }
    .authx-pane--form { padding: 1.9rem 1.3rem; }
    .authx-brand-title { font-size: 1.6rem; }
    .page-header h1 { font-size: 1.35rem; }
    .stat-value { font-size: 1.3rem; }
}

@media (max-width: 480px) {
    .btn { font-size: 0.84rem; }
    .content > * + * { margin-top: 1rem; }
    .module-row { display: block; }
}

/* ---- v20 refinements (part 2) ------------------------------------------- */
.catmenu-btn { border-radius: 0; }
.catmenu-btn:hover { box-shadow: none; }
.catmenu-btn:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
.catmenu-item.open .catmenu-btn,
.catmenu-item.open .catmenu-caret { color: #fff; }
.amount-preset { border: 1px solid var(--border); color: var(--text); }
.amount-preset:hover { border-color: var(--primary); color: var(--primary); }
.amount-preset.active { border-color: var(--primary); }
.tickers .announcement-ticker-label,
.announcement-ticker { font-weight: 600; }
.stat-icon { transition: transform 0.16s var(--ease), background 0.16s var(--ease); }
.table tbody tr.active-row { background: var(--primary-soft); }

/* =====================================================================
   v21 — professional icon chips (per-category accent gradients)
   ===================================================================== */
.tile-icon {
    width: 46px;
    height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    font-size: 1.3rem;
    line-height: 1;
    transition: transform 0.16s ease, box-shadow 0.16s ease;
}
a.tile:hover .tile-icon { transform: translateY(-2px); }

.catmenu-btn-icon {
    width: 26px;
    height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 0.95rem;
    line-height: 1;
}

.accent-violet,
.accent-blue,
.accent-sky,
.accent-amber,
.accent-rose,
.accent-green,
.accent-orange,
.accent-lime,
.accent-slate {
    color: #fff !important;
    background-image: none;
}

.accent-violet { background: linear-gradient(135deg, #7c3aed 0%, #a78bfa 100%); box-shadow: 0 8px 16px -8px rgba(124, 58, 237, 0.55); }
.accent-blue   { background: linear-gradient(135deg, #2563eb 0%, #60a5fa 100%); box-shadow: 0 8px 16px -8px rgba(37, 99, 235, 0.55); }
.accent-sky    { background: linear-gradient(135deg, #0891b2 0%, #22d3ee 100%); box-shadow: 0 8px 16px -8px rgba(8, 145, 178, 0.5); }
.accent-amber  { background: linear-gradient(135deg, #d97706 0%, #fbbf24 100%); box-shadow: 0 8px 16px -8px rgba(217, 119, 6, 0.5); }
.accent-rose   { background: linear-gradient(135deg, #e11d48 0%, #fb7185 100%); box-shadow: 0 8px 16px -8px rgba(225, 29, 72, 0.5); }
.accent-green  { background: linear-gradient(135deg, #16a34a 0%, #4ade80 100%); box-shadow: 0 8px 16px -8px rgba(22, 163, 74, 0.5); }
.accent-orange { background: linear-gradient(135deg, #ea580c 0%, #fb923c 100%); box-shadow: 0 8px 16px -8px rgba(234, 88, 12, 0.5); }
.accent-lime   { background: linear-gradient(135deg, #65a30d 0%, #a3e635 100%); box-shadow: 0 8px 16px -8px rgba(101, 163, 13, 0.5); }
.accent-slate  { background: linear-gradient(135deg, #475569 0%, #94a3b8 100%); box-shadow: 0 8px 16px -8px rgba(71, 85, 105, 0.5); }

/* Icons inside accent chips inherit the chip accent colour and size up with 1em. */
.tile-icon .icon,
.service-card-icon .icon,
.service-intro-icon .icon,
.authx-hero-service-icon .icon,
.catmenu-link-icon .icon,
.catmenu-drop-icon .icon,
.catmenu-btn-icon .icon,
.service-related-icon .icon { width: 1em; height: 1em; flex: none; color: inherit; }

.service-card-icon { font-size: 1.55rem; display: grid; place-items: center; }
.service-intro-icon { width: 3.25rem; height: 3.25rem; display: grid; place-items: center; }
.tile-icon { font-size: 1.5rem; }
.catmenu-btn-icon { font-size: 1.05rem; }
.catmenu-drop-icon { font-size: 1.1rem; }
.authx-hero-service-icon { font-size: 1.2rem; }
.catmenu-link-icon { font-size: 1.1rem; }
.service-related-icon { font-size: 1.2rem; }

.catmenu-link:hover .catmenu-link-icon[class*="accent-"] {
    background: rgba(11, 42, 91, 0.08);
    color: #0b2a5b;
}

/* =====================================================================
   v21 — operator services page (toolbar, filters, polished cards)
   ===================================================================== */
.services-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 0.75rem;
}

.service-search { flex: 1 1 320px; max-width: 460px; height: 46px; }

.service-filters {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.3rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 999px;
    box-shadow: var(--shadow-sm);
}
.service-filter {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    border: 0;
    background: none;
    padding: 0.5rem 1.05rem;
    border-radius: 999px;
    font-family: inherit;
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.service-filter .icon { width: 13px; height: 13px; }
.service-filter:hover:not(.is-active) { color: var(--primary-dark); background: var(--surface-alt); }
.service-filter.is-active {
    background: var(--primary-dark);
    color: #fff;
    box-shadow: 0 8px 18px -8px rgba(11, 42, 91, 0.6);
}
.service-filter:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

.service-grid-empty { grid-column: 1 / -1; }

.service-card {
    position: relative;
    padding: 1.35rem 1.4rem;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.service-card[hidden] { display: none; }
.service-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 3px;
    background: linear-gradient(90deg, var(--primary) 0%, var(--accent) 100%);
    opacity: 0;
    transition: opacity 0.18s ease;
}
.service-card:hover {
    transform: translateY(-4px);
    border-color: color-mix(in srgb, var(--primary) 30%, var(--border));
    box-shadow: 0 20px 44px -22px rgba(11, 42, 91, 0.3);
}
.service-card:hover::before { opacity: 1; }
.service-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.75rem; }
.service-card-top { margin-bottom: 0.85rem; }
.service-card-icon { width: 50px; height: 50px; border-radius: 15px; }
.service-card-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 700;
    color: #b45309;
    background: color-mix(in srgb, var(--accent) 14%, #fff);
    border: 1px solid color-mix(in srgb, var(--accent) 26%, #fff);
}
.service-card-tag .icon { width: 12px; height: 12px; }
.service-card h3 { margin: 0 0 0.3rem; font-size: 1.02rem; color: var(--text); }
.service-card-desc {
    margin: 0 0 0.65rem;
    font-size: 0.82rem;
    line-height: 1.55;
    color: var(--text-muted);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.service-card-meta { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; flex-wrap: wrap; }
.service-card-cat {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.26rem 0.62rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--surface-alt);
}
.service-card-cat .icon { width: 12px; height: 12px; }
.service-card-price { font-size: 0.92rem; font-weight: 700; color: var(--primary-dark); }
.service-card-actions {
    margin-top: 1rem;
    padding-top: 0.9rem;
    border-top: 1px dashed var(--border);
}
.service-card-actions .btn { width: 100%; justify-content: center; }
.service-card-actions .icon { width: 14px; height: 14px; }

.services-back-top {
    position: fixed;
    right: 1.25rem;
    bottom: 1.25rem;
    z-index: 60;
    width: 46px;
    height: 46px;
    border: 0;
    border-radius: 50%;
    background: var(--primary-dark);
    color: #fff;
    cursor: pointer;
    display: grid;
    place-items: center;
    box-shadow: 0 14px 30px -10px rgba(11, 42, 91, 0.55);
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.services-back-top:hover { transform: translateY(-3px); }
.services-back-top:active { transform: translateY(0) scale(0.96); }
.services-back-top:focus-visible { outline: 3px solid var(--primary-light); outline-offset: 2px; }
.services-back-top[hidden] { display: none; }
.services-back-top .icon { width: 18px; height: 18px; }

/* =====================================================================
   v21 — auth split-screen redesign (hero + white card)
   ===================================================================== */
.auth-wrap--v2 {
    padding: 0;
    background: #f5f8fc;
    overflow-x: hidden;
}

.authx.authx--v2 {
    position: relative;
    display: grid;
    grid-template-columns: 47fr 53fr;
    width: 100%;
    min-height: 100vh;
    min-height: 100svh;
    margin: 0;
    background: #f5f8fc;
    border-radius: 0;
    box-shadow: none;
    overflow: hidden;
}

/* ---- one-canvas composition ----
   A light full-screen background carries one large organic navy SVG shape
   with a flowing (S-curve) right edge, plus an orange SVG curve flowing
   between the navy and the light area. There are NO two boxes — just shapes
   flowing into each other. The white login card is the only real card. */
.authx-hero {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    color: #fff;
    padding: clamp(1.6rem, 4vw, 3.5rem) clamp(1.2rem, 3vw, 2.6rem);
    background: transparent;
}

.authx-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}
.authx-bg-svg { display: block; width: 100%; height: 100%; }

/* Colours for the organic background shapes come from the theme config
   (Admin → System → Theme Control) — never hardcoded here. */
.authx-bg-svg .ax-st1 { stop-color: var(--primary, #0066cc); }
.authx-bg-svg .ax-st2 { stop-color: var(--primary-dark, #0b2a5b); }
.authx-bg-svg .ax-st3 { stop-color: color-mix(in srgb, var(--primary-dark, #0b2a5b) 80%, #000); }
.authx-bg-svg .ax-or1 { stop-color: var(--accent, #f36c00); }
.authx-bg-svg .ax-or2 { stop-color: color-mix(in srgb, var(--accent, #f36c00) 68%, #fff); }
.authx-band .ax-band-blue { fill: var(--primary-dark, #0b2a5b); }
.authx-band .ax-band-orange { fill: var(--accent, #f36c00); }

/* Mobile / tablet transition strip between the navy hero and the light form. */
.authx-band { display: none; }
.authx-band svg { display: block; width: 100%; height: 100%; }

.authx-hero-content {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 560px;
    margin: 0 auto;
}
.authx-hero-brand {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    flex-wrap: wrap;
    margin-bottom: 1.7rem;
}
.authx-hero-brand-box {
    display: grid;
    place-items: center;
    width: clamp(104px, 20vw, 132px);
    height: clamp(50px, 9.5vw, 58px);
    padding: 0 0.75rem;
    background: #fff;
    border: 1px solid rgba(255, 255, 255, 0.85);
    border-radius: clamp(12px, 2.2vw, 16px);
    box-shadow: 0 16px 40px -14px rgba(0, 0, 0, 0.42);
    overflow: hidden;
}
.authx-hero-brand-box img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    padding: clamp(4px, 0.8vw, 8px) clamp(5px, 1.2vw, 10px);
    display: block;
}
.authx-brand-initial { font-size: clamp(1.4rem, 3.2vw, 1.9rem); font-weight: 800; color: var(--primary-dark, #0b2a5b); line-height: 1; }
.authx-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.42rem 0.85rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.26);
    font-size: 0.78rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(4px);
}
.authx-hero-badge .icon { width: 13px; height: 13px; }
.authx-hero-title {
    margin: 0 0 0.35rem;
    font-size: clamp(1.45rem, 2.4vw, 1.95rem);
    letter-spacing: 0.14em;
    line-height: 1.2;
}
.authx-hero-sub {
    max-width: 46ch;
    margin: 0 0 1.6rem;
    font-size: 0.97rem;
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.74);
}

.authx-hero-services {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.6rem;
}
.authx-hero-service {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.55rem;
    background: color-mix(in srgb, var(--primary, #0066cc) 20%, transparent);
    border: 1px solid rgba(255, 255, 255, 0.26);
    border-radius: 10px;
}
.authx-hero-service-icon {
    width: 2rem;
    height: 2rem;
    display: grid;
    place-items: center;
    border-radius: 9px;
    font-size: 1.05rem;
    line-height: 1;
    flex-shrink: 0;
}
.authx-hero-service-name {
    font-size: 0.74rem;
    font-weight: 600;
    line-height: 1.25;
    color: rgba(255, 255, 255, 0.92);
    overflow-wrap: anywhere;
}
.authx-hero-features {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.1rem;
    margin-top: 1.5rem;
}
.authx-hero-feature {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.85);
}
.authx-hero-feature-icon { display: inline-flex; color: color-mix(in srgb, var(--accent, #f36c00) 78%, #fff); }
.authx-hero-feature-icon .icon { width: 15px; height: 15px; }
.authx-hero-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 2rem;
}
.authx-hero-support {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.5rem 1.15rem;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 999px;
    color: #fff;
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}
.authx-hero-support .icon { width: 14px; height: 14px; }
.authx-hero-support:hover { background: rgba(255, 255, 255, 0.12); border-color: rgba(255, 255, 255, 0.65); }
.authx-hero-support:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* ---- right panel ---- */
.authx-panel {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1.5rem;
    padding: 3rem clamp(1.5rem, 5vw, 4.5rem);
    background: transparent;
}
.authx-panel-top { display: flex; justify-content: flex-end; }
.authx-switch { margin: 0; font-size: 0.9rem; color: #5b6b84; }
.authx-switch-link { color: var(--accent, #f36c00); font-weight: 700; text-decoration: none; }
.authx-switch-link:hover { text-decoration: underline; }

.authx-card {
    width: 100%;
    max-width: 620px;
    margin: 0 auto;
    padding: 2.4rem 2.7rem;
    background: #fff;
    border: 1px solid #e6ecf4;
    border-radius: 20px;
    box-shadow: 0 14px 46px color-mix(in srgb, var(--primary-dark, #0b2a5b) 10%, transparent);
}

.authx-welcome {
    margin: 0 0 1.5rem;
    font-size: clamp(1.7rem, 3vw, 2.1rem);
    font-weight: 700;
    color: var(--primary-dark, #0b2a5b);
    letter-spacing: -0.02em;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}
.authx-welcome.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: no-preference) {
    .authx-card .auth-panel {
        animation: authx-panel-in 0.18s ease;
    }
}

@keyframes authx-panel-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.authx--v2 .authx-title { color: var(--primary-dark, #0b2a5b); }
.authx--v2 .authx-sub { color: var(--text-muted, #64748b); }

.authx-form .form-label { color: #33415c; }
.authx-label-row { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.authx-label-row .form-label { margin-bottom: 0.35rem; }
.authx-forgot {
    margin-bottom: 0.35rem;
    color: var(--accent, #f36c00);
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
}
.authx-forgot:hover { text-decoration: underline; }

.authx-field { position: relative; }
.authx-field-icon {
    position: absolute;
    left: 0.95rem;
    top: 50%;
    transform: translateY(-50%);
    display: inline-flex;
    color: #9aa7bd;
    pointer-events: none;
}
.authx-field-icon .icon { width: 17px; height: 17px; }
.authx-field .form-control,
.authx-field .password-wrap .form-control { padding-left: 2.75rem; }

.btn-login {
    height: 48px;
    margin-top: 0.35rem;
    border-radius: 12px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}
.btn-login .icon { width: 16px; height: 16px; }

/* Brand-orange primary actions across all auth steps (sign in, send OTP,
   verify, reset). Blue is the global portal primary; the reference auth
   design uses the orange accent instead. Both come from the theme config. */
.authx-card .btn-primary {
    background: linear-gradient(135deg, var(--accent, #f36c00) 0%, color-mix(in srgb, var(--accent, #f36c00) 78%, #000) 100%);
    border: 1px solid color-mix(in srgb, var(--accent, #f36c00) 60%, #000);
    color: #fff;
    box-shadow: 0 12px 26px -12px color-mix(in srgb, var(--accent, #f36c00) 65%, transparent);
}
.authx-card .btn-primary:hover:not(:disabled),
.authx-card .btn-primary:focus {
    background: linear-gradient(135deg, color-mix(in srgb, var(--accent, #f36c00) 78%, #000) 0%, color-mix(in srgb, var(--accent, #f36c00) 55%, #000) 100%);
    border-color: color-mix(in srgb, var(--accent, #f36c00) 50%, #000);
    color: #fff;
}
.authx-card .btn-primary:active:not(:disabled) {
    background: color-mix(in srgb, var(--accent, #f36c00) 55%, #000);
    border-color: color-mix(in srgb, var(--accent, #f36c00) 50%, #000);
    transform: translateY(1px);
}
.authx-card .btn-primary:disabled {
    background: color-mix(in srgb, var(--accent, #f36c00) 55%, #fff);
    border-color: color-mix(in srgb, var(--accent, #f36c00) 70%, #fff);
}

.authx-or {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.2rem 0;
    color: #b3bcc9;
    font-size: 0.76rem;
    font-weight: 600;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}
.authx-or::before,
.authx-or::after { content: ""; flex: 1; height: 1px; background: #e9edf3; }

.btn-whatsapp {
    height: 48px;
    border-radius: 12px;
    border: 1.5px solid #25d366;
    background: #fff;
    color: #1faa51;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}
.btn-whatsapp:hover { background: #ecfdf3; border-color: #1faa51; color: #17823f; transform: translateY(-1px); }
.btn-whatsapp:focus-visible { outline: 2px solid #25d366; outline-offset: 2px; }
.btn-whatsapp .icon { width: 22px; height: 22px; }

.authx-trust {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem 1.6rem;
    padding: 0;
    margin: 0;
}
.authx-trust li {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.8rem;
    color: #8a97ab;
}
.authx-trust-icon { display: inline-flex; color: var(--accent, #f36c00); }
.authx-trust-icon .icon { width: 15px; height: 15px; }

/* ---- welcome landing card (guest /) ---- */
.authx-welcome-sub {
    margin: 0 0 1.75rem;
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-muted, #64748b);
}
.authx-cta-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.authx-cta-row .icon { width: 16px; height: 16px; }
.authx-join-bullets {
    list-style: none;
    margin: 1.75rem 0 0;
    padding: 1.6rem 0 0;
    border-top: 1px dashed var(--border, #e2e8f0);
    display: grid;
    gap: 0.72rem;
}
.authx-join-bullets li {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.88rem;
    color: var(--text-muted, #64748b);
}
.authx-join-check {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--primary, #0066cc) 12%, transparent);
    color: var(--primary, #0066cc);
}
.authx-join-check .icon { width: 13px; height: 13px; }
.authx-card--welcome .authx-trust { margin-top: 1.8rem; }

@media (max-width: 420px) {
    .authx-cta-row { grid-template-columns: 1fr; }
}

/* ---- devices (single centered card) ---- */
.authx.authx--v2-single {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: radial-gradient(120% 100% at 0% 0%, var(--primary, #0066cc) 0%, var(--primary-dark, #0b2a5b) 48%, color-mix(in srgb, var(--primary-dark, #0b2a5b) 72%, #000) 100%);
}
.authx-device-wrap { width: 100%; max-width: 580px; margin: auto; }
.authx-card--device {
    max-width: 580px;
    padding: 2.5rem 2.75rem;
    border-radius: 22px;
    background: #fff;
    border: 1px solid #edf0f5;
    box-shadow: 0 10px 40px color-mix(in srgb, var(--primary-dark, #0b2a5b) 20%, transparent);
}
.authx-device-brand { display: flex; align-items: center; gap: 0.8rem; margin-bottom: 1.4rem; }
.authx-hero-brand-box--sm {
    display: grid;
    place-items: center;
    min-width: 0;
    width: 48px;
    height: 48px;
    padding: 0;
    border-radius: 13px;
    box-shadow: 0 10px 24px -12px color-mix(in srgb, var(--primary-dark, #0b2a5b) 45%, transparent);
}
.authx-hero-brand-box--sm img { padding: 8px; }
.authx-hero-brand-box--sm .authx-brand-initial { font-size: 1.35rem; }
.authx-device-brand-name { font-size: 1.1rem; font-weight: 800; color: var(--primary-dark, #0b2a5b); }
.authx-resume-alt { margin-top: 1.15rem; text-align: center; }

/* ---- guest default auth card (reset password / verify email) ---- */
.auth-card--v2 {
    max-width: 560px;
    padding: 2.6rem 2.75rem;
    background: #fff;
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 22px;
    overflow: visible;
    box-shadow: 0 10px 40px color-mix(in srgb, var(--primary-dark, #0b2a5b) 16%, transparent);
}
.auth-card--v2 .auth-head,
.auth-card--v2 .auth-head-v2 {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.85rem;
    padding: 0 0 1.6rem;
}
.auth-card--v2 .authx-hero-brand-box {
    display: grid;
    place-items: center;
    width: clamp(68px, 16vw, 76px);
    min-width: 68px;
    height: clamp(68px, 16vw, 76px);
    padding: 0;
    border-radius: 19px;
    box-shadow: 0 16px 34px -12px color-mix(in srgb, var(--primary-dark, #0b2a5b) 40%, transparent);
}
.auth-card--v2 .authx-hero-brand-box img { padding: 12px; }
.auth-card--v2 .auth-card-title {
    margin: 0;
    color: var(--primary-dark, #0b2a5b);
    font-size: 1.5rem;
    letter-spacing: -0.02em;
}
.auth-card--v2 .auth-card-sub { margin: 0; color: var(--text-muted, #64748b); font-size: 0.9rem; }
.auth-card--v2 .auth-body { padding: 0; }
.auth-card--v2 .authx-trust--inline { margin-top: 1.8rem; }

/* ---- v21 auth responsive ---- */
@media (max-width: 1100px) {
    .authx-panel { padding: 2.5rem 1.6rem; }
    .authx-hero { padding: 2rem 1.5rem; }
    .authx-hero-services { gap: 0.45rem; }
    .authx-hero-service { padding: 0.45rem 0.5rem; }
}

@media (max-width: 980px) {
    .authx.authx--v2 { grid-template-columns: 1fr; }
    .authx-bg { display: none; }
    .authx-band {
        display: grid;
        grid-column: 1 / -1;
        height: clamp(48px, 9vw, 82px);
        line-height: 0;
    }
    .authx-hero {
        z-index: 0;
        display: block;
        background: linear-gradient(140deg, var(--primary, #0066cc) 0%, var(--primary-dark, #0b2a5b) 55%, color-mix(in srgb, var(--primary-dark, #0b2a5b) 72%, #000) 100%);
        padding: calc(2.4rem + env(safe-area-inset-top)) 1.5rem 1.6rem;
    }
    .authx-hero-content { max-width: 640px; }
    .authx-hero-brand { margin-bottom: 1.2rem; }
    .authx-hero-sub { margin-bottom: 1.2rem; }
    .authx-panel { padding: 1.6rem 1.2rem calc(2.4rem + env(safe-area-inset-bottom)); }
    .authx-trust { justify-content: center; }
}

@media (max-width: 860px) {
    .authx-hero-services { grid-template-columns: repeat(2, 1fr); }
    .authx-hero { padding: 2rem 1.25rem 1.4rem; }
}

@media (max-width: 640px) {
    .authx-hero { padding: calc(1.5rem + env(safe-area-inset-top)) 1rem 1.1rem; }
    .authx-hero-brand {
        gap: 0.7rem;
        margin-bottom: 1rem;
        align-items: flex-start;
    }
    .authx-hero-badge {
        font-size: 0.72rem;
        padding: 0.4rem 0.75rem;
        letter-spacing: 0.02em;
        max-width: 100%;
    }
    .authx-hero-title {
        font-size: 1.3rem;
        letter-spacing: 0.08em;
        line-height: 1.25;
        margin-bottom: 0.45rem;
    }
    .authx-hero-sub {
        max-width: 100%;
        font-size: 0.95rem;
        line-height: 1.65;
        margin-bottom: 0.9rem;
    }
    .authx-hero-services,
    .authx-hero-features { display: none; }
    .authx-hero-footer { margin-top: 0; }
    .authx-panel-top { justify-content: center; }
    .authx-panel { padding: 1.3rem 0.9rem calc(2rem + env(safe-area-inset-bottom)); }
    .authx-card {
        padding: 1.9rem 1.4rem;
        border-radius: 18px;
    }
    .auth-card--v2 { padding: 2rem 1.4rem; }
    .service-card { padding: 1.15rem 1.2rem; }
    .service-grid { grid-template-columns: 1fr; }
    .services-toolbar { align-items: stretch; }
    .service-filters { align-self: flex-start; }
}

@media (max-width: 390px) {
    .authx-hero { padding: calc(1.3rem + env(safe-area-inset-top)) 0.9rem 1rem; }
    .authx-hero-badge { font-size: 0.68rem; padding: 0.38rem 0.65rem; }
    .authx-hero-title { font-size: 1.2rem; letter-spacing: 0.06em; line-height: 1.3; }
    .authx-hero-sub { font-size: 0.9rem; line-height: 1.6; }
    .authx-card { padding: 1.6rem 1.15rem; }
    .auth-card--v2 { padding: 1.7rem 1.15rem; }
}

/* ---- profile page responsdiveness ----
   Page-level columns stack before the global .grid-2 breakpoint so the
   forms keep their width on tablets; OTP input rows stack on small phones. */
.profile-grid { align-items: start; }

@media (max-width: 1000px) {
    .profile-grid { grid-template-columns: 1fr; }
}

.profile-sessions-table { min-width: 520px; }

@media (max-width: 520px) {
    .input-group {
        flex-direction: column;
        align-items: stretch;
    }
    .input-group .form-control {
        width: 100%;
        border-radius: var(--radius-sm) !important;
        margin-bottom: 0.35rem;
    }
    .input-group .btn {
        width: 100%;
        border-radius: var(--radius-sm) !important;
    }
}

/* ---- v22 — keep layout boxes from being pushed past the card/container
   edge: grid/flex children default to min-width:auto, so wide content
   (e.g. the sessions table) can overflow the container on mobile. */
.grid-2 > *,
.grid-3 > *,
.stats-grid > *,
.profile-grid > * { min-width: 0; }

/* Profile: inner two-column rows stack early so each box stays in bounds. */
@media (max-width: 1000px) {
    .profile-grid .grid-2 { grid-template-columns: 1fr; }
}

/* ---- v33 — wallet tables on small screens ----
   Badges inside tables stay on one line (a pill that wraps mid-word looks
   broken on narrow phones). Below 640px the wallet transaction/top-up tables
   opt into a stacked "card per row" layout via .table-stack: headers are
   hidden and every cell becomes a labelled row so nothing is clipped and
   nothing scrolls sideways. */
.table-wrap .badge { white-space: nowrap; }

@media (max-width: 640px) {
    .table-wrap.table-stack { overflow: visible; }

    .table-wrap.table-stack thead { display: none; }

    .table-wrap.table-stack,
    .table-wrap.table-stack tbody,
    .table-wrap.table-stack tr,
    .table-wrap.table-stack td {
        display: block;
        width: 100%;
    }

    .table-wrap.table-stack tr {
        border: 1px solid var(--border);
        border-radius: var(--radius);
        background: var(--surface);
        padding: 0.4rem 0.9rem;
        margin: 0 0 0.8rem;
    }

    .table-wrap.table-stack tr:hover { background: var(--surface); }
    .table-wrap.table-stack tr:last-child { margin-bottom: 0; }

    .table-wrap.table-stack td {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 1rem;
        padding: 0.5rem 0;
        border-bottom: 1px solid var(--border);
        text-align: right;
        min-width: 0;
    }

    .table-wrap.table-stack td:last-child { border-bottom: 0; }

    .table-wrap.table-stack td::before {
        content: attr(data-label);
        flex-shrink: 0;
        font-size: 0.7rem;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.04em;
        color: var(--text-muted);
    }

    .table-wrap.table-stack td[data-label=""]::before { content: none; }

    .table-wrap.table-stack tr.table-stack-empty {
        border: 0;
        background: transparent;
        padding: 0;
    }

    .table-wrap.table-stack tr.table-stack-empty td {
        display: block;
        justify-content: center;
        border: 0;
        padding: 1rem 0;
    }

    .table-wrap.table-stack tr.table-stack-empty td::before { content: none; }
}
