/* ==========================================================================
   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;
}

* { 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(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }

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: #fff;
    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: #fff;
    box-shadow: 0 4px 10px rgba(0, 102, 204, 0.35);
}

.btn-secondary { background: var(--surface); border-color: var(--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: #fff;
    border: none;
}
.btn-success:hover:not(:disabled) { background: linear-gradient(135deg, #15803d 0%, #16a34a 100%); color: #fff; }

.btn-danger {
    background: linear-gradient(135deg, var(--danger) 0%, #f87171 100%);
    color: #fff;
    border: none;
}
.btn-danger:hover:not(:disabled) { background: linear-gradient(135deg, #b91c1c 0%, #dc2626 100%); color: #fff; }

.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(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: border-color 0.15s, box-shadow 0.15s;
}
.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.15);
}
.form-control.is-invalid { border-color: var(--danger); }
.form-control::placeholder { color: #94a3b8; }
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: #166534; }
.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: #0369a1; }
.stat-icon.info { background: var(--info-bg); color: #0369a1; }
.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: #166534; }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-warning { background: var(--warning-bg); color: #92400e; }
.badge-info { background: var(--info-bg); color: #0369a1; }
.badge-secondary { background: #e2e8f0; color: #475569; }
.badge-primary { background: var(--primary-light); color: var(--primary-dark); }

.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: #166534; }
.alert-danger { background: var(--danger-bg); color: var(--danger); }
.alert-warning { background: var(--warning-bg); color: #92400e; }
.alert-info { background: var(--info-bg); color: #0369a1; }

/* ---------- 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(--text-muted);
    font-weight: 600;
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 1px solid var(--border);
    background: var(--surface-alt);
    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, #0b2a5b 0%, #0b2a5b 55%, #084d9e 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: #bfdbfe; 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: #cbd5f5;
    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: #fff; color: var(--primary-dark); 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: #7a9be0;
    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: #cbd5f5;
    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: #bfdbfe; }

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

.topbar {
    background: var(--surface);
    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, #0b2a5b 0%, #0066cc 55%, #2f8fff 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, #0b2a5b 0%, #0066cc 60%, #2f8fff 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, #0b2a5b 0%, #0066cc 60%, #2f8fff 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; }
}

/* ---------- 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, #0b2a5b 0%, #0066cc 60%, #2f8fff 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: #e2e8f0; }
.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: #92400e;
}
.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(--primary);
    box-shadow: 0 0 0 3px var(--primary-light), var(--shadow);
}
.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) ---------- */
.catmenu {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem 0.6rem;
}

.catmenu-item { position: relative; }

.catmenu-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.6rem 0.95rem;
    border-radius: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    line-height: 1;
    color: var(--text);
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}
.catmenu-btn:hover {
    border-color: var(--primary);
    color: var(--primary-dark);
    box-shadow: 0 6px 16px -8px rgba(0, 102, 204, 0.4);
    transform: translateY(-1px);
}
.catmenu-btn:active { transform: translateY(1px); }
.catmenu-btn:focus-visible { outline: 3px solid rgba(0, 102, 204, 0.35); outline-offset: 2px; }
.catmenu-btn-icon { font-size: 1.1rem; line-height: 1; }
.catmenu-btn-label { overflow-wrap: anywhere; }
.catmenu-caret {
    display: inline-flex;
    color: var(--text-muted);
    transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}
.catmenu-item.open .catmenu-caret { transform: rotate(180deg); }
.catmenu-item.open .catmenu-btn {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    box-shadow: 0 8px 20px -8px rgba(0, 102, 204, 0.55);
}
.catmenu-item.open .catmenu-caret { color: #fff; }

.catmenu-drop {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    z-index: 50;
    width: 300px;
    max-width: calc(100vw - 2rem);
    padding: 0.55rem;
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 20px 45px -12px rgba(2, 6, 23, 0.28), 0 6px 16px -6px rgba(2, 6, 23, 0.12);
    visibility: hidden;
    opacity: 0;
    transform: translateY(8px) scale(0.97);
    transform-origin: top left;
    transition: visibility 0s linear 0.18s, opacity 0.18s ease, transform 0.18s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
}
.catmenu-item.open > .catmenu-drop {
    visibility: visible;
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
    transition-delay: 0s;
}
.catmenu-item .catmenu-drop.align-right { left: auto; right: 0; transform-origin: top right; }

.catmenu-drop-head {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.4rem 0.5rem 0.65rem;
    border-bottom: 1px solid var(--border);
}
.catmenu-drop-icon {
    width: 2.5rem; height: 2.5rem;
    display: grid; place-items: center;
    background: linear-gradient(135deg, var(--primary-light), #e0f2fe);
    color: var(--primary-dark);
    border-radius: var(--radius-sm);
    font-size: 1.25rem;
    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, 300px);
    overflow-y: auto;
    padding: 0.35rem 0.1rem;
}
.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.05rem;
    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-top: 0.35rem;
    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.4rem; }
    .catmenu-btn { padding: 0.55rem 0.85rem; font-size: 0.85rem; }
    .catmenu-item .catmenu-drop,
    .catmenu-item .catmenu-drop.align-right {
        position: fixed;
        inset: auto 0.75rem 0.75rem;
        top: auto;
        left: 0.75rem;
        right: 0.75rem;
        width: auto;
        max-width: none;
        min-width: 0;
        max-height: min(70vh, 480px);
        border-radius: 18px 18px 14px 14px;
        transform-origin: bottom center;
        transform: translateY(40px) scale(0.98);
    }
    .catmenu-item.open > .catmenu-drop { transform: translateY(0) scale(1); }
    .catmenu-drop-list { max-height: none; overflow-y: auto; }
    .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: #166534;
}
.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%, rgba(0, 102, 204, .55) 0%, transparent 55%),
        linear-gradient(160deg, #0b2a5b 0%, #0066cc 60%, #2f8fff 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-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: #92400e; border-color: #fcd34d; }
.ticket-avatar--green { background: var(--success-bg); color: #166534; border-color: #bbf7d0; }
.ticket-avatar--slate { background: #e2e8f0; color: #475569; 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: #e2e8f0;
    color: #475569;
}

.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; }
}

/* ---------- Dashboard trend chart ---------- */
.chart-legend {
    display: flex;
    gap: 1rem;
    align-items: center;
    font-size: 0.8rem;
    color: var(--text-muted);
    padding-top: 0.5rem;
}
.chart-legend-dot {
    display: inline-block;
    width: 0.6rem;
    height: 0.6rem;
    border-radius: 999px;
}
.chart-legend-dot--success { background: var(--success); }
.chart-legend-dot--primary { background: var(--primary); }
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%; height: auto; display: block; }
.trend-gridline { stroke: var(--border); stroke-dasharray: 4 5; }
.trend-app-line {
    stroke: var(--accent); stroke-width: 2.4;
    stroke-linejoin: round; stroke-linecap: round;
    filter: drop-shadow(0 2px 3px rgba(243, 108, 0, 0.25));
}
.trend-axis-label { fill: var(--text-muted); font-size: 9px; text-anchor: middle; }
.trend-rev-dot { background: linear-gradient(135deg, var(--primary), #22d3ee); }
.trend-app-dot { background: var(--accent); }

@media (max-width: 480px) {
    .trend-kpi { flex: 1 1 100%; min-width: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .live-dot, .live-pulse { animation: none; }
}
