:root {
    --tprc-orange: #FF4C00;
    --tprc-orange-light: #FF6B33;
    --tprc-orange-hover: #E64400;
    --tprc-orange-subtle: rgba(255, 76, 0, 0.08);
    --tprc-orange-border: rgba(255, 76, 0, 0.2);

    --bg-body: #F5F6FA;
    --bg-surface: #FFFFFF;
    --bg-surface-hover: #FAFBFC;
    --bg-muted: #F0F2F5;
    --surface-primary: #FFFFFF;
    --surface-secondary: #F7FAFC;

    --text-primary: #1A202C;
    --text-secondary: #4A5568;
    --text-muted: #8896A6;
    --text-inverse: #FFFFFF;

    --border-color: #E2E8F0;
    --border-light: #EDF2F7;

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.08);

    --glass-bg: rgba(255, 255, 255, 0.72);
    --glass-border: rgba(255, 255, 255, 0.5);
    --glass-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
    --glass-blur: 12px;

    --sidebar-width: 250px;
    --sidebar-collapsed-width: 68px;
    --sidebar-bg: #1A202C;
    --sidebar-text: #CBD5E0;
    --sidebar-text-active: #FFFFFF;
    --sidebar-hover-bg: rgba(255, 255, 255, 0.08);
    --sidebar-active-bg: rgba(255, 76, 0, 0.15);
    --sidebar-transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;

    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

body {
    font-family: var(--font-sans);
    background-color: var(--bg-body);
    color: var(--text-primary);
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
}

.sidebar {
    position: fixed;
    top: var(--total-header-height);
    left: 0;
    width: var(--sidebar-width);
    height: calc(100vh - var(--total-header-height));
    background: var(--sidebar-bg);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transition: width var(--sidebar-transition), transform var(--sidebar-transition);
    overflow: hidden;
}

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

.sidebar-brand {
    display: flex;
    align-items: center;
    padding: 18px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    min-height: 64px;
    gap: 12px;
}

.sidebar-brand img {
    width: 36px;
    height: 36px;
    object-fit: contain;
    flex-shrink: 0;
}

.sidebar-brand .brand-text {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-inverse);
    white-space: nowrap;
    opacity: 1;
    transition: opacity 0.2s ease;
}

.sidebar.collapsed .brand-text {
    opacity: 0;
    width: 0;
    overflow: hidden;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 12px 8px;
}

.sidebar-nav::-webkit-scrollbar {
    width: 4px;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}

.nav-item-sidebar {
    margin-bottom: 2px;
}

.nav-link-sidebar {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    color: var(--sidebar-text);
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition: all 0.15s ease;
    gap: 12px;
    white-space: nowrap;
    font-size: 0.9rem;
    font-weight: 450;
}

.nav-link-sidebar i {
    width: 20px;
    text-align: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.nav-link-sidebar .nav-label {
    opacity: 1;
    transition: opacity 0.2s ease;
}

.sidebar.collapsed .nav-label {
    opacity: 0;
    width: 0;
    overflow: hidden;
}

/* Collapsed sidebar: center the icons and show a hover tooltip with the
   label so each menu item stays distinguishable. The sidebar and nav clip
   overflow normally; allow it to escape only while collapsed (the collapsed
   nav is icon-only and short, so vertical scrolling isn't needed). */
.sidebar.collapsed,
.sidebar.collapsed .sidebar-nav {
    overflow: visible;
}

.sidebar.collapsed .nav-link-sidebar {
    justify-content: center;
    gap: 0;
    padding: 10px 0;
    position: relative;
}

.sidebar.collapsed .nav-link-sidebar[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    left: calc(100% + 14px);
    top: 50%;
    transform: translateY(-50%);
    background: #1f2937;
    color: #fff;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    line-height: 1;
    white-space: nowrap;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.12s ease;
    z-index: 1100;
}

.sidebar.collapsed .nav-link-sidebar[data-tooltip]::before {
    content: "";
    position: absolute;
    left: calc(100% + 8px);
    top: 50%;
    transform: translateY(-50%);
    border: 6px solid transparent;
    border-right-color: #1f2937;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.12s ease;
    z-index: 1100;
}

.sidebar.collapsed .nav-link-sidebar[data-tooltip]:hover::after,
.sidebar.collapsed .nav-link-sidebar[data-tooltip]:hover::before {
    opacity: 1;
    visibility: visible;
}

.nav-link-sidebar:hover {
    background: var(--sidebar-hover-bg);
    color: var(--text-inverse);
    text-decoration: none;
}

.nav-link-sidebar.active {
    background: var(--sidebar-active-bg);
    color: var(--tprc-orange-light);
    font-weight: 600;
}

.nav-link-sidebar.active i {
    color: var(--tprc-orange-light);
}

.sidebar-section-label {
    padding: 16px 12px 6px;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    font-weight: 600;
    white-space: nowrap;
}

.sidebar.collapsed .sidebar-section-label {
    opacity: 0;
    height: 0;
    padding: 0;
    margin: 0;
    overflow: hidden;
}

.sidebar-tour {
    margin: 12px 12px 0;
    padding: 14px;
    background: linear-gradient(135deg, rgba(255,76,0,0.18), rgba(255,76,0,0.06));
    border: 1px solid rgba(255,76,0,0.35);
    border-radius: 10px;
}
.sidebar-tour-icon { color: var(--tprc-orange); font-size: 1.1rem; margin-bottom: 6px; }
.sidebar-tour-title { font-size: 0.88rem; font-weight: 700; color: #fff; margin-bottom: 2px; }
.sidebar-tour-desc {
    font-size: 0.75rem; color: rgba(255,255,255,0.7);
    line-height: 1.4; margin-bottom: 10px;
}
.sidebar-tour-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 14px; border-radius: 6px;
    background: var(--tprc-orange); color: #fff;
    font-size: 0.8rem; font-weight: 600;
    text-decoration: none; border: none; cursor: pointer;
    transition: background 0.2s;
}
.sidebar-tour-btn:hover { background: #e04400; }
.sidebar-tour-btn i { font-size: 0.7rem; }
.sidebar.collapsed .sidebar-tour { display: none; }

/* Guided tour overlay, spotlight and popover */
#tprc-tour-root { display: none; }
#tprc-tour-root.show { display: block; }
.tprc-tour-overlay {
    position: fixed; inset: 0;
    background: rgba(15, 23, 42, 0.55);
    z-index: 9998;
}
.tprc-tour-spotlight {
    position: fixed; z-index: 9999; pointer-events: none;
    border-radius: 10px;
    box-shadow: 0 0 0 4px rgba(255,76,0,0.85), 0 0 0 9999px rgba(15,23,42,0.55);
    transition: all 0.25s ease;
    opacity: 0;
}
.tprc-tour-spotlight.show { opacity: 1; }
.tprc-tour-target { position: relative; z-index: 10000 !important; }
.tprc-tour-popover {
    position: fixed; z-index: 10001;
    width: 360px; max-width: calc(100vw - 32px);
    background: #fff; color: var(--text-primary, #111827);
    border-radius: 12px;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.25);
    padding: 18px 18px 14px;
    font-family: inherit;
}
.tprc-tour-popover-head {
    display: flex; align-items: center; gap: 8px; margin-bottom: 8px;
}
.tprc-tour-step-count {
    flex: 1; font-size: 0.72rem; font-weight: 600;
    color: var(--text-muted, #6b7280); text-transform: uppercase;
    letter-spacing: 0.04em;
}
.tprc-tour-voice, .tprc-tour-end {
    background: none; border: 1px solid #e5e7eb; border-radius: 6px;
    width: 30px; height: 30px; cursor: pointer;
    color: var(--text-muted, #6b7280);
    display: inline-flex; align-items: center; justify-content: center;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.tprc-tour-voice:hover, .tprc-tour-end:hover {
    background: #f3f4f6; color: var(--text-primary, #111827); border-color: #d1d5db;
}
.tprc-tour-voice[aria-pressed="true"] {
    background: rgba(255,76,0,0.08); border-color: rgba(255,76,0,0.4);
    color: var(--tprc-orange);
}
.tprc-tour-title {
    font-size: 1.05rem; font-weight: 700; margin: 0 0 6px;
    color: var(--text-primary, #111827);
}
.tprc-tour-text {
    font-size: 0.9rem; line-height: 1.5; margin: 0 0 12px;
    color: var(--text-primary, #111827);
}
.tprc-tour-progress {
    height: 4px; background: #f3f4f6; border-radius: 999px;
    overflow: hidden; margin-bottom: 12px;
}
.tprc-tour-progress-bar {
    height: 100%; width: 0%;
    background: var(--tprc-orange);
    transition: width 0.3s ease;
}
.tprc-tour-actions {
    display: flex; gap: 8px; align-items: center;
}
.tprc-tour-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 14px; border-radius: 8px;
    font-size: 0.85rem; font-weight: 600;
    border: 1px solid transparent; cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s, opacity 0.15s;
}
.tprc-tour-btn.primary {
    background: var(--tprc-orange); color: #fff;
    margin-left: auto;
}
.tprc-tour-btn.primary:hover { background: #e04400; }
.tprc-tour-btn.ghost {
    background: #fff; color: var(--text-muted, #6b7280); border-color: #e5e7eb;
}
.tprc-tour-btn.ghost:hover:not(:disabled) {
    background: #f9fafb; color: var(--text-primary, #111827); border-color: #d1d5db;
}
.tprc-tour-btn:disabled { opacity: 0.45; cursor: not-allowed; }

.sidebar-chatbot {
    margin: 12px 12px 0;
    padding: 14px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}
.sidebar-chatbot-icon {
    color: var(--tprc-orange);
    font-size: 1.1rem;
    margin-bottom: 6px;
}
.sidebar-chatbot-title {
    font-size: 0.88rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 2px;
}
.sidebar-chatbot-desc {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.55);
    line-height: 1.4;
    margin-bottom: 10px;
}
.sidebar-chatbot-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 6px;
    background: var(--tprc-orange);
    color: #fff;
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s;
    border: none;
    cursor: pointer;
}
.sidebar-chatbot-btn:hover { background: #e04400; color: #fff; }
.sidebar-chatbot-btn i { font-size: 0.7rem; }
.sidebar.collapsed .sidebar-chatbot { display: none; }

.sidebar-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding: 12px 8px;
}

.sidebar-user {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    gap: 10px;
    color: var(--sidebar-text);
    border-radius: var(--radius-sm);
    cursor: pointer;
    position: relative;
}

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

.sidebar-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--tprc-orange);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-inverse);
    font-size: 0.8rem;
    font-weight: 600;
    flex-shrink: 0;
}

.sidebar-user-info {
    overflow: hidden;
    white-space: nowrap;
    opacity: 1;
    transition: opacity 0.2s ease;
}

.sidebar.collapsed .sidebar-user-info {
    opacity: 0;
    width: 0;
    overflow: hidden;
}

.sidebar-user-name {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-inverse);
    line-height: 1.2;
}

.sidebar-user-role {
    font-size: 0.72rem;
    color: var(--text-muted);
    line-height: 1.2;
}

.sidebar-user-menu {
    position: absolute;
    bottom: 100%;
    left: 8px;
    right: 8px;
    background: #2D3748;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 6px;
    display: none;
    z-index: 1050;
    margin-bottom: 6px;
}

.sidebar-user-menu.show {
    display: block;
}

.sidebar-user-menu a {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    color: var(--sidebar-text);
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    gap: 8px;
}

.sidebar-user-menu a:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-inverse);
}

.sidebar-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 12px;
    color: var(--sidebar-text);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all 0.15s ease;
    border: none;
    background: none;
    width: 100%;
    gap: 12px;
}

.sidebar-toggle:hover {
    background: var(--sidebar-hover-bg);
    color: var(--text-inverse);
}

.sidebar-toggle i {
    width: 20px;
    text-align: center;
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.sidebar.collapsed .sidebar-toggle i {
    transform: rotate(180deg);
}

.sidebar-toggle .nav-label {
    opacity: 1;
    transition: opacity 0.2s ease;
    font-size: 0.85rem;
}

.sidebar.collapsed .sidebar-toggle .nav-label {
    opacity: 0;
    width: 0;
    overflow: hidden;
}

:root {
    --top-bar-height: 56px;
    --total-header-height: 56px;
}

.top-user-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--top-bar-height);
    background: #fff;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    gap: 16px;
    z-index: 1050;
    gap: 12px;
}

/* Single-bar: company identity on the left for client pages */
.top-bar-company-identity {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
    min-width: 0;
}

.top-bar-company-identity .company-bar-name {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 260px;
}

/* Bell button inside the top bar */
.top-bar-bell {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 36px;
    padding: 0 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: #fff;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.18s;
    font-size: 0.85rem;
    font-weight: 500;
    flex-shrink: 0;
}

.top-bar-bell i {
    font-size: 0.88rem;
    color: var(--tprc-orange);
}

.top-bar-bell:hover {
    background: var(--tprc-orange-subtle, #fff5f0);
    border-color: var(--tprc-orange);
    color: var(--tprc-orange);
}

.top-bar-bell:hover i {
    color: var(--tprc-orange);
}

.top-bar-bell .notif-dot {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 999px;
    background: var(--tprc-orange);
    color: #fff;
    font-size: 0.62rem;
    font-weight: 700;
    line-height: 16px;
    display: none;
    border: 2px solid #fff;
    box-sizing: content-box;
}

.top-bar-bell.has-updates .notif-dot { display: inline-block; }

.top-bar-bell-label {
    font-size: 0.82rem;
}

/* Per-page "Refresh" button, injected into each page's banner header
   (data-refresh-anchor). margin-left:auto right-aligns it inside flex
   banners; float:right handles plain block banners. */
.page-refresh-btn {
    margin-left: auto;
    float: right;
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 34px;
    padding: 0 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: #fff;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.18s;
    font-size: 0.82rem;
    font-weight: 500;
    flex-shrink: 0;
}

.page-refresh-btn i {
    font-size: 0.85rem;
    color: var(--tprc-orange);
}

.page-refresh-btn:hover {
    background: var(--tprc-orange-subtle, #fff5f0);
    border-color: var(--tprc-orange);
    color: var(--tprc-orange);
}

.page-refresh-btn:hover i {
    color: var(--tprc-orange);
}

.page-refresh-btn:disabled {
    opacity: 0.6;
    cursor: default;
}

.page-refresh-label {
    font-size: 0.82rem;
}

/* "My Profile" label next to avatar */
.top-bar-user-label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.top-bar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex: 1 1 auto;
}

.top-bar-logo-link {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
}

.top-bar-logo {
    height: 30px;
    width: auto;
    display: block;
}

.top-bar-admin-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid rgba(255, 76, 0, 0.4);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    white-space: nowrap;
}

.top-bar-admin-badge i {
    color: var(--tprc-orange);
    font-size: 0.78rem;
}

@media (max-width: 576px) {
    .top-bar-admin-badge {
        font-size: 0.65rem;
        padding: 3px 8px;
    }
    .top-bar-admin-badge i { font-size: 0.7rem; }
}


.mobile-menu-trigger {
    display: none;
    align-items: center;
    justify-content: center;
    background: none;
    border: 1.5px solid var(--text-secondary);
    color: var(--text-secondary);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    padding: 5px 14px;
    border-radius: var(--radius-sm);
    transition: all 0.15s;
    letter-spacing: 0.02em;
    z-index: 1050;
    position: relative;
}

.mobile-menu-trigger:hover {
    background: var(--bg-muted);
    border-color: var(--tprc-orange);
    color: var(--tprc-orange);
}

.top-bar-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
    flex-shrink: 0;
}

.top-bar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: background 0.15s;
}

.top-bar-user:hover {
    background: var(--bg-muted);
}

.top-bar-user-name {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.top-bar-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--tprc-orange);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.top-bar-user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 6px;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 6px;
    display: none;
    z-index: 1050;
    min-width: 180px;
}

.top-bar-user-dropdown.show {
    display: block;
}

.top-bar-user-dropdown a {
    display: flex;
    align-items: center;
    padding: 8px 14px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    gap: 8px;
    transition: background 0.12s;
}

.top-bar-user-dropdown a:hover {
    background: var(--bg-muted);
    color: var(--text-primary);
}

.top-bar-dropdown-divider {
    height: 1px;
    background: var(--border-light, #e2e8f0);
    margin: 6px 8px;
}

.top-bar-dropdown-label {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted, #64748b);
    padding: 4px 14px 2px;
}

/* The header is a single bar; the company identity, details and bell are
 * folded into it (see js/sidebar.js). The classes below style those pieces
 * in their new home inside .top-user-bar. */

.company-bar-identity {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex: 1 1 auto;
}

.company-bar-logo {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--tprc-orange);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 0.8rem;
    flex-shrink: 0;
    overflow: hidden;
}

.company-bar-logo img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}

.company-bar-name-block {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
    min-width: 0;
}

.company-bar-name {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.company-bar-meta {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.company-bar-bell {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--tprc-orange-border);
    background: #fff;
    color: var(--tprc-orange);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.9rem;
    padding: 0;
    flex-shrink: 0;
    margin-left: 16px;
}
.company-bar-bell:hover {
    background: var(--tprc-orange);
    color: #fff;
    border-color: var(--tprc-orange);
}
.company-bar-bell .notif-dot {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 999px;
    background: var(--tprc-orange);
    color: #fff;
    font-size: 0.62rem;
    font-weight: 700;
    line-height: 16px;
    display: none;
    border: 2px solid #fff;
    box-sizing: content-box;
}
.company-bar-bell.has-updates .notif-dot { display: inline-block; }


.main-content {
    margin-left: var(--sidebar-width);
    padding: 24px 28px;
    padding-top: calc(var(--total-header-height) + 24px);
    min-height: 100vh;
    transition: margin-left var(--sidebar-transition);
}

.sidebar.collapsed ~ .main-content {
    margin-left: var(--sidebar-collapsed-width);
}

.mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: var(--sidebar-bg);
    z-index: 1030;
    align-items: center;
    padding: 0 16px;
    gap: 12px;
}

.mobile-header img {
    height: 28px;
}

.mobile-header .brand-text {
    color: var(--text-inverse);
    font-weight: 700;
    font-size: 1rem;
}

.mobile-menu-btn {
    background: none;
    border: none;
    color: var(--text-inverse);
    font-size: 1.3rem;
    cursor: pointer;
    padding: 4px;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1035;
}

/* ===== Mobile bottom navigation (client portal) ===== */
.mobile-bottom-nav { display: none; }

@media (max-width: 768px) {
    .mobile-bottom-nav {
        display: flex;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 1040;
        background: #ffffff;
        border-top: 1px solid var(--border-color, #E2E8F0);
        box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.06);
        padding-bottom: env(safe-area-inset-bottom, 0px);
    }

    .mobile-bottom-nav-item {
        flex: 1 1 0;
        min-width: 0;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        padding: 8px 2px;
        min-height: 56px;
        background: none;
        border: none;
        cursor: pointer;
        text-decoration: none;
        color: var(--text-muted, #64748B);
        font-size: 0.6rem;
        font-weight: 600;
        line-height: 1.1;
        text-align: center;
        transition: color 0.15s;
    }

    .mobile-bottom-nav-item i {
        font-size: 1.15rem;
    }

    .mobile-bottom-nav-item span {
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        width: 100%;
    }

    .mobile-bottom-nav-item.active {
        color: var(--tprc-orange, #FF4D00);
    }
}

@media (max-width: 768px) {
    .mobile-header {
        display: none;
    }

    .sidebar {
        transform: translateX(-100%);
        width: var(--sidebar-width) !important;
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.3);
        z-index: 1060;
        top: 0;
        height: 100vh;
    }

    .sidebar.mobile-open {
        transform: translateX(0);
    }

    .sidebar-overlay {
        z-index: 1055;
    }

    .sidebar.collapsed {
        width: var(--sidebar-width) !important;
    }

    /* On mobile the sidebar is shown full-width (slide-in), even if the
       persisted state has the 'collapsed' class. Undo the desktop collapsed
       tweaks so labels show and the nav scrolls normally. */
    .sidebar.collapsed {
        overflow: hidden;
    }

    .sidebar.collapsed .sidebar-nav {
        overflow-y: auto;
    }

    .sidebar.collapsed .nav-label {
        opacity: 1;
        width: auto;
    }

    .sidebar.collapsed .nav-link-sidebar {
        justify-content: flex-start;
        gap: 12px;
        padding: 12px 14px;
    }

    .sidebar.collapsed .nav-link-sidebar[data-tooltip]::after,
    .sidebar.collapsed .nav-link-sidebar[data-tooltip]::before {
        display: none;
    }

    .sidebar-nav {
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Ensure every nav link is at least 44px tall for touch accessibility */
    .nav-link-sidebar {
        min-height: 44px;
        padding: 12px 14px;
    }

    .sidebar-footer {
        border-top: 1px solid rgba(255, 255, 255, 0.08);
    }

    .sidebar-toggle {
        display: none;
    }

    .sidebar-overlay.show {
        display: block;
    }

    .top-user-bar {
        padding: 0 12px;
    }

    .top-bar-user-name {
        display: none;
    }

    .top-bar-bell-label {
        display: none;
    }

    .top-bar-user-label {
        display: none;
    }

    .top-bar-company-identity .company-bar-name {
        max-width: 140px;
    }

    .top-bar-actions {
        gap: 8px;
    }

    /* The bottom nav surfaces the four primary destinations only, so the
       top-bar Menu button is the way to open the full off-canvas sidebar
       (Agreements, Documentation, Resources, etc.) on mobile. */
    .mobile-menu-trigger {
        display: flex;
    }

    .top-bar-bell {
        padding: 0;
        width: 36px;
        border-radius: 50%;
    }

    .company-bar-meta {
        display: none;
    }

    .main-content {
        margin-left: 0 !important;
        padding-top: calc(var(--total-header-height) + 16px);
        padding-left: 16px;
        padding-right: 16px;
        padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px));
    }

    .container-fluid {
        padding-left: 8px;
        padding-right: 8px;
    }

    .table-responsive {
        -webkit-overflow-scrolling: touch;
    }
}

.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    box-shadow: var(--glass-shadow);
}

.ds-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.2s ease;
}

.ds-card:hover {
    box-shadow: var(--shadow-md);
}

.ds-card .card-header {
    background: transparent;
    border-bottom: 1px solid var(--border-light);
    padding: 14px 20px;
    font-weight: 600;
    font-size: 0.95rem;
}

.ds-card .card-body {
    padding: 20px;
}

.ds-stat-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
}

.ds-stat-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.ds-stat-card .stat-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.ds-stat-card .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}

.ds-stat-card .stat-label {
    font-size: 0.82rem;
    color: var(--text-muted);
    font-weight: 500;
}

.btn-tprc {
    background: var(--tprc-orange);
    color: var(--text-inverse);
    border: none;
    border-radius: var(--radius-sm);
    padding: 8px 18px;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.15s ease;
}

.btn-tprc:hover {
    background: var(--tprc-orange-hover);
    color: var(--text-inverse);
    box-shadow: 0 2px 8px rgba(255, 76, 0, 0.25);
}

.btn-tprc-outline {
    background: transparent;
    color: var(--tprc-orange);
    border: 1px solid var(--tprc-orange);
    border-radius: var(--radius-sm);
    padding: 8px 18px;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.15s ease;
}

.btn-tprc-outline:hover {
    background: var(--tprc-orange-subtle);
    color: var(--tprc-orange-hover);
}

.ds-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 500;
}

.ds-badge-orange {
    background: var(--tprc-orange-subtle);
    color: var(--tprc-orange);
}

.ds-breadcrumb {
    padding: 0;
    margin-bottom: 8px;
    background: transparent;
    font-size: 0.85rem;
}

.ds-breadcrumb .breadcrumb-item a {
    color: var(--text-muted);
    text-decoration: none;
}

.ds-breadcrumb .breadcrumb-item a:hover {
    color: var(--tprc-orange);
}

.ds-breadcrumb .breadcrumb-item.active {
    color: var(--text-secondary);
}

.ds-page-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.ds-page-subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 0;
}

.ds-table {
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.ds-table thead th {
    background: var(--bg-muted);
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-secondary);
    padding: 12px 16px;
}

.ds-table tbody td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
    font-size: 0.9rem;
}

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

.ds-table tbody tr:last-child td {
    border-bottom: none;
}

.ds-input {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 8px 14px;
    font-size: 0.9rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.ds-input:focus {
    border-color: var(--tprc-orange);
    box-shadow: 0 0 0 3px rgba(255, 76, 0, 0.1);
    outline: none;
}

.card {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.card .card-header {
    background: transparent;
    border-bottom: 1px solid var(--border-light);
}

.text-tprc {
    color: var(--tprc-orange) !important;
}

.bg-tprc {
    background-color: var(--tprc-orange) !important;
}

.breadcrumb-item a {
    color: var(--text-muted);
}

.breadcrumb-item a:hover {
    color: var(--tprc-orange);
}

h1, h2, h3, h4, h5, h6 {
    color: var(--text-primary);
    font-weight: 600;
}

.navbar.navbar-dark.bg-dark {
    display: none !important;
}

.bg-gradient-primary {
    background: linear-gradient(135deg, var(--tprc-orange) 0%, var(--tprc-orange-light) 100%) !important;
}

.container-fluid.mt-4,
.container-fluid.py-4,
.container-fluid.mt-3,
.container-fluid.px-3 {
    max-width: 100%;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--tprc-orange);
    box-shadow: 0 0 0 3px rgba(255, 76, 0, 0.1);
}

.nav-tabs .nav-link.active {
    color: var(--tprc-orange);
    border-color: var(--border-color) var(--border-color) var(--bg-surface);
}

.nav-tabs .nav-link:hover:not(.active) {
    border-color: var(--border-light) var(--border-light) var(--border-color);
    color: var(--tprc-orange-light);
}

.table {
    margin-bottom: 0;
}

.table thead th {
    font-weight: 600;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-secondary);
    border-bottom: 2px solid var(--border-color);
}

.table tbody td {
    vertical-align: middle;
    border-bottom: 1px solid var(--border-light);
}

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

.badge {
    font-weight: 500;
    font-size: 0.78rem;
}

.progress {
    border-radius: 20px;
    background-color: var(--bg-muted);
}

.progress-bar {
    border-radius: 20px;
}

a {
    color: var(--tprc-orange);
}

a:hover {
    color: var(--tprc-orange-hover);
}

.text-primary {
    color: var(--tprc-orange) !important;
}

.breadcrumb {
    background: transparent;
    padding: 0;
    margin-bottom: 8px;
}

.page-header {
    margin-bottom: 24px;
}

.page-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
}

.page-header p {
    color: var(--text-muted);
}

.auth-card {
    border-radius: var(--radius-lg);
    border: 1px solid var(--glass-border);
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
}

.auth-title {
    color: var(--text-primary);
    font-weight: 600;
}

.auth-brand-heading {
    color: var(--text-secondary);
}

.auth-brand-text {
    color: var(--text-muted);
}

.btn-auth {
    background-color: var(--tprc-orange);
    border-color: var(--tprc-orange);
    color: var(--text-inverse);
    font-weight: 500;
}

.btn-auth:hover {
    background-color: var(--tprc-orange-hover);
    border-color: var(--tprc-orange-hover);
    color: var(--text-inverse);
    box-shadow: 0 2px 8px rgba(255, 76, 0, 0.25);
}

.auth-form-container {
    position: relative;
    z-index: 10;
}

/* ============================================================
   MAYA SUPPORT PANEL
   Built on the tprc-tokens palette so the assistant reads as part
   of the portal rather than a bolted-on widget: charcoal header and
   user bubbles matching the page heroes, and brand orange kept for
   the single primary action (Send) instead of used decoratively.
   Fallbacks are inline so the panel still renders on any page that
   loads design-system.css without the token sheet.
   ============================================================ */

.chatbot-panel {
    position: fixed;
    top: 50%;
    right: 24px;
    transform: translateY(-50%) translateX(440px);
    width: 400px;
    height: min(720px, calc(100vh - 48px));
    background: var(--t-surface, #fff);
    border: 1px solid var(--t-border-color, rgba(27,34,40,0.08));
    border-radius: var(--t-radius-lg, 18px);
    box-shadow: 0 24px 60px rgba(27, 34, 40, 0.18), 0 2px 10px rgba(27, 34, 40, 0.06);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    font-family: var(--t-font, 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
    transition: transform 0.32s cubic-bezier(.2,.9,.3,1), opacity 0.25s ease;
}
.chatbot-panel.open {
    transform: translateY(-50%) translateX(0);
    opacity: 1;
    pointer-events: auto;
}

/* Charcoal, like every other panel header in the portal. */
.chatbot-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--t-space-3, 12px);
    padding: var(--t-space-4, 16px) var(--t-space-5, 20px);
    background: var(--t-charcoal, #2B3640);
    color: var(--t-on-charcoal, #fff);
    flex-shrink: 0;
}
.chatbot-header-left {
    display: flex;
    align-items: center;
    gap: var(--t-space-3, 12px);
    min-width: 0;
}
.chatbot-header-avatar {
    width: 36px; height: 36px;
    border-radius: var(--t-radius-sm, 8px);
    background: var(--t-brand, #FF4C00);
    color: #fff;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 0.95rem;
    flex-shrink: 0;
}
.chatbot-header-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.chatbot-header-title {
    font-size: var(--t-body-size, 15px);
    font-weight: var(--t-weight-bold, 700);
    line-height: 1.2;
}
.chatbot-header-status {
    font-size: 12px;
    font-weight: 500;
    color: var(--t-on-charcoal-mute, rgba(255,255,255,0.62));
    display: inline-flex; align-items: center; gap: 0.35rem;
}
.chatbot-header-status::before {
    content: ''; width: 7px; height: 7px; border-radius: 50%;
    background: #4ade80; flex-shrink: 0;
}
.chatbot-close {
    background: rgba(255,255,255,0.10);
    border: none;
    color: #fff;
    width: 32px; height: 32px;
    border-radius: var(--t-radius-sm, 8px);
    font-size: 0.85rem;
    cursor: pointer;
    flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center;
    transition: background var(--t-duration, 0.16s) var(--t-ease, ease);
}
.chatbot-close:hover { background: rgba(255,255,255,0.22); }

.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: var(--t-space-5, 20px) var(--t-space-4, 16px) var(--t-space-2, 8px);
    display: flex;
    flex-direction: column;
    gap: var(--t-space-3, 12px);
    background: var(--t-surface-sunken, #FAFBFC);
}
.chatbot-messages::-webkit-scrollbar { width: 6px; }
.chatbot-messages::-webkit-scrollbar-thumb {
    background: var(--t-border-strong, rgba(27,34,40,0.14));
    border-radius: 3px;
}

.chatbot-msg {
    display: flex;
    align-items: flex-end;
    gap: var(--t-space-2, 8px);
    animation: chatbotFade 0.18s ease;
}
@keyframes chatbotFade {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}
.chatbot-msg-bot { justify-content: flex-start; }
.chatbot-msg-user { justify-content: flex-end; }
.chatbot-msg-avatar {
    width: 28px; height: 28px;
    border-radius: var(--t-radius-pill, 999px);
    background: var(--t-charcoal, #2B3640);
    color: #fff;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 0.75rem;
    font-weight: var(--t-weight-bold, 700);
    flex-shrink: 0;
}
.chatbot-msg-avatar-spacer {
    width: 28px; height: 1px; flex-shrink: 0;
}
.chatbot-msg-stack { margin-top: -0.5rem; }

.chatbot-meta {
    font-size: 11px;
    color: var(--t-faint, #9ca3af);
    margin: 2px 0 6px 36px;
    line-height: 1;
}
.chatbot-meta-right {
    text-align: right;
    margin: 2px 4px 6px 0;
}

.chatbot-bubble {
    max-width: 78%;
    padding: 0.7rem 0.9rem;
    border-radius: var(--t-radius, 14px);
    font-size: var(--t-body-sm-size, 14px);
    line-height: 1.55;
    word-wrap: break-word;
}
.chatbot-msg-bot .chatbot-bubble {
    background: var(--t-surface, #fff);
    color: var(--t-ink, #333F49);
    border: 1px solid var(--t-border-color, rgba(27,34,40,0.08));
    border-bottom-left-radius: 4px;
}
.chatbot-msg-user .chatbot-bubble {
    background: var(--t-charcoal, #2B3640);
    color: var(--t-on-charcoal, #fff);
    border-bottom-right-radius: 4px;
}

/* Markdown formatting inside bot bubbles */
.chatbot-bubble p { margin: 0 0 0.5rem; }
.chatbot-bubble p:last-child { margin-bottom: 0; }
.chatbot-bubble strong { font-weight: var(--t-weight-row, 600); color: inherit; }
.chatbot-bubble em { font-style: italic; }
.chatbot-bubble h1, .chatbot-bubble h2, .chatbot-bubble h3, .chatbot-bubble h4 {
    margin: 0.5rem 0 0.3rem; font-weight: var(--t-weight-bold, 700); line-height: 1.3; color: inherit;
}
.chatbot-bubble h1 { font-size: 15px; }
.chatbot-bubble h2 { font-size: 14px; }
.chatbot-bubble h3, .chatbot-bubble h4 { font-size: 13px; }
.chatbot-bubble ul, .chatbot-bubble ol {
    margin: 0.25rem 0 0.5rem; padding-left: 1.15rem;
}
.chatbot-bubble li { margin-bottom: 0.25rem; }
.chatbot-bubble li:last-child { margin-bottom: 0; }
.chatbot-bubble code {
    background: rgba(27,34,40,0.06);
    padding: 1px 5px; border-radius: 4px;
    font-size: 0.85em; font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.chatbot-msg-user .chatbot-bubble code { background: rgba(255,255,255,0.16); }
.chatbot-bubble a { color: var(--t-action, #D13E00); text-decoration: underline; }
.chatbot-msg-user .chatbot-bubble a { color: #fff; }

.chatbot-typing-bubble {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 0.7rem 0.9rem;
}
.chatbot-typing-bubble span {
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--t-faint, #9ca3af);
    animation: chatbotTyping 1.2s infinite ease-in-out;
}
.chatbot-typing-bubble span:nth-child(2) { animation-delay: 0.15s; }
.chatbot-typing-bubble span:nth-child(3) { animation-delay: 0.3s; }
@keyframes chatbotTyping {
    0%, 60%, 100% { opacity: 0.3; transform: translateY(0); }
    30% { opacity: 1; transform: translateY(-3px); }
}

/* Quick replies, styled as the portal's secondary pill button. */
.chatbot-suggestions {
    display: flex; flex-wrap: wrap; gap: var(--t-space-2, 8px);
    padding: 0 0.25rem 0.25rem 36px;
}
.chatbot-suggestion {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    border: 1px solid var(--t-border-strong, rgba(27,34,40,0.14));
    background: var(--t-surface, #fff);
    color: var(--t-ink, #333F49);
    border-radius: var(--t-radius-pill, 999px);
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    padding: 0.4rem 0.8rem;
    cursor: pointer;
    transition: border-color var(--t-duration, 0.16s) var(--t-ease, ease),
                color var(--t-duration, 0.16s) var(--t-ease, ease),
                background var(--t-duration, 0.16s) var(--t-ease, ease);
}
.chatbot-suggestion:hover {
    border-color: var(--t-brand-border, rgba(255,76,0,0.22));
    color: var(--t-action, #D13E00);
    background: var(--t-brand-subtle, rgba(255,76,0,0.08));
}
.chatbot-suggestion i { font-size: 0.9em; }
/* The support escape hatch. Filled brand so it reads as the action it is
   instead of disappearing into a row of identical question chips. Support is
   a primary action, so this stays within the "one accent" rule. */
.chatbot-suggestion.is-primary {
    background: var(--t-brand, #FF4C00);
    border-color: var(--t-brand, #FF4C00);
    color: #fff;
    font-weight: var(--t-weight-row, 600);
}
.chatbot-suggestion.is-primary:hover {
    background: var(--t-brand-hover, #E64400);
    border-color: var(--t-brand-hover, #E64400);
    color: #fff;
}

.chatbot-input-area {
    display: flex;
    align-items: center;
    gap: var(--t-space-2, 8px);
    padding: var(--t-space-3, 12px) var(--t-space-4, 16px);
    background: var(--t-surface, #fff);
    border-top: 1px solid var(--t-border-color, rgba(27,34,40,0.08));
    flex-shrink: 0;
}
.chatbot-input {
    flex: 1;
    min-width: 0;
    border: 1px solid var(--t-border-color, rgba(27,34,40,0.08));
    background: var(--t-surface-sunken, #FAFBFC);
    color: var(--t-ink, #333F49);
    border-radius: var(--t-radius-pill, 999px);
    padding: 0.6rem 1rem;
    font-size: var(--t-body-sm-size, 14px);
    outline: none;
    font-family: inherit;
    transition: border-color var(--t-duration, 0.16s) var(--t-ease, ease),
                box-shadow var(--t-duration, 0.16s) var(--t-ease, ease),
                background var(--t-duration, 0.16s) var(--t-ease, ease);
}
.chatbot-input::placeholder { color: var(--t-faint, #9ca3af); }
.chatbot-input:focus {
    border-color: var(--t-brand, #FF4C00);
    background: var(--t-surface, #fff);
    box-shadow: 0 0 0 3px var(--t-brand-subtle, rgba(255,76,0,0.08));
}
/* The one primary action in the panel, so the one place orange appears. */
.chatbot-send {
    background: var(--t-brand, #FF4C00);
    color: #fff;
    border: none;
    border-radius: var(--t-radius-pill, 999px);
    width: 40px; height: 40px;
    font-size: 0.85rem;
    cursor: pointer;
    font-family: inherit;
    flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center;
    transition: background var(--t-duration, 0.16s) var(--t-ease, ease);
}
.chatbot-send:hover:not(:disabled) { background: var(--t-brand-hover, #E64400); }
.chatbot-send:disabled { opacity: 0.5; cursor: not-allowed; }

.chatbot-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(27, 34, 40, 0.45);
    z-index: 1999;
}
/* openChatbot() uses .show; resources.html's no-JS fallback adds .open.
   Honour both so the dim backdrop never goes missing. */
.chatbot-overlay.show,
.chatbot-overlay.open { display: block; }

@media (max-width: 480px) {
    .chatbot-panel {
        right: 0; left: 0;
        top: auto; bottom: 0;
        width: 100%;
        height: 85vh;
        border: none;
        border-radius: var(--t-radius-lg, 18px) var(--t-radius-lg, 18px) 0 0;
        transform: translateY(100%);
    }
    .chatbot-panel.open { transform: translateY(0); }
}

/* ============================================================
   MOBILE-FIRST UI MODERNIZATION — shared utility styles
   ============================================================ */

/* --- Dashboard welcome banner --- */
.dash-welcome {
    background: var(--surface-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 1.1rem 1.35rem;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    box-shadow: var(--shadow-sm);
}
.dash-welcome-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}
.dash-welcome-sub {
    font-size: 0.84rem;
    color: var(--text-muted);
    margin: 0.2rem 0 0;
}
.dash-welcome-icon {
    font-size: 1.9rem;
    color: var(--tprc-orange);
    opacity: 0.65;
    flex-shrink: 0;
}

/* --- Dashboard stat cards --- */
.dash-stat-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}
@media (min-width: 768px) {
    .dash-stat-grid { grid-template-columns: repeat(4, 1fr); }
}
.dash-stat-card {
    background: var(--surface-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 1rem 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.85rem;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.2s;
}
.dash-stat-card:hover { box-shadow: var(--shadow-md); }
.dash-stat-icon {
    width: 42px; height: 42px;
    border-radius: var(--radius-md);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.05rem;
    flex-shrink: 0;
}
.dash-stat-icon.orange { background: rgba(255,76,0,0.1); color: var(--tprc-orange); }
.dash-stat-icon.green  { background: rgba(72,187,120,0.12); color: #48bb78; }
.dash-stat-icon.blue   { background: rgba(66,153,225,0.12); color: #4299e1; }
.dash-stat-icon.purple { background: rgba(111,66,193,0.1); color: #6f42c1; }
.dash-stat-value {
    font-size: 1.55rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
}
.dash-stat-label {
    font-size: 0.76rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-top: 3px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

/* --- Scrollable nav tabs --- */
.nav-tabs-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap !important;
    scrollbar-width: none;
    padding-bottom: 1px;
}
.nav-tabs-scroll::-webkit-scrollbar { display: none; }
.nav-tabs-scroll .nav-item {
    white-space: nowrap;
    flex-shrink: 0;
}

/* --- Responsive card-header filter/search row --- */
.card-header-filters {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}
.card-header-filters .input-group { min-width: 0; flex: 1 1 160px; }
.card-header-filters .form-select { min-width: 100px; flex: 0 0 auto; }

/* --- Pipeline hero banner --- */
.pipeline-hero {
    background: linear-gradient(135deg, #1a202c 0%, #2d3748 100%);
    border-radius: var(--radius-lg);
    padding: 1.4rem 1.5rem 1.25rem;
    margin-bottom: 1.5rem;
    color: #fff;
}
.pipeline-hero h3 { color: #fff; font-size: 1.15rem; margin-bottom: 0.2rem; }
.pipeline-hero p  { color: rgba(255,255,255,0.75); font-size: 0.85rem; margin: 0; }
.pipeline-hero-body {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}
.pipeline-hero-title { flex: 1; min-width: 160px; }
.pipeline-hero-stats {
    display: flex;
    gap: 0;
    flex: 2;
    min-width: 220px;
}
.pipeline-overview-stat {
    flex: 1;
    text-align: center;
    padding: 0.4rem 0.2rem;
}
.pipeline-overview-stat h2 {
    font-size: 1.6rem;
    font-weight: 800;
    color: #fff;
    margin: 0 0 2px;
    line-height: 1;
}
.pipeline-overview-stat small {
    color: rgba(255,255,255,0.7);
    font-size: 0.72rem;
}

/* --- Pipeline progress tracker — scrollable on mobile --- */
.pipeline-progress-track {
    display: flex;
    position: relative;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 2px;
    margin-top: 0.75rem;
}
.pipeline-progress-track::-webkit-scrollbar { display: none; }
.pipeline-progress-track::before {
    content: '';
    position: absolute;
    top: 20px; left: 0; right: 0; height: 4px;
    background: rgba(255,255,255,0.25);
    z-index: 0;
}
.pipeline-pstep {
    flex: 1;
    min-width: 56px;
    text-align: center;
    z-index: 1;
    flex-shrink: 0;
}
.pipeline-pstep .step-icon {
    width: 40px; height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 0.4rem;
    font-weight: 700;
    color: #fff;
    font-size: 0.82rem;
    border: 2px solid transparent;
}
.pipeline-pstep.active .step-icon   { background: var(--tprc-orange); border-color: rgba(255,255,255,0.3); }
.pipeline-pstep.completed .step-icon { background: #48bb78; border-color: rgba(255,255,255,0.3); }
.pipeline-pstep .step-label {
    font-size: 0.67rem;
    color: rgba(255,255,255,0.82);
    line-height: 1.2;
}

/* --- Pipeline filter btn group — scrollable on mobile --- */
.filter-btn-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    white-space: nowrap;
    display: flex;
    gap: 0.35rem;
    padding-bottom: 2px;
}
.filter-btn-scroll::-webkit-scrollbar { display: none; }
.filter-btn-scroll .btn { white-space: nowrap; flex-shrink: 0; }

/* --- Pipeline candidates: table (desktop) / card list (mobile) --- */
.pipeline-cand-table { display: block; width: 100%; }
.pipeline-cand-cards { display: none; }

@media (max-width: 767.98px) {
    .pipeline-cand-table { display: none !important; }
    .pipeline-cand-cards { display: block; }
    .pipeline-cand-card {
        border: 1px solid var(--border-light);
        border-radius: var(--radius-md);
        padding: 0.85rem 1rem;
        margin-bottom: 0.6rem;
        background: var(--surface-primary);
        display: flex;
        align-items: center;
        gap: 0.75rem;
    }
    .pipeline-cand-card-info { flex: 1; min-width: 0; }
    .pipeline-cand-card-name { font-weight: 700; font-size: 0.92rem; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .pipeline-cand-card-pos  { font-size: 0.78rem; color: var(--text-muted); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .pipeline-cand-card-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 0.45rem; gap: 0.5rem; flex-wrap: wrap; }
}

/* --- Applicant header — modern flex layout --- */
.applicant-header-flex {
    display: flex;
    gap: 1.25rem;
    align-items: flex-start;
    flex-wrap: wrap;
}
.applicant-header-avatar { flex-shrink: 0; text-align: center; }
.applicant-header-info { flex: 1; min-width: 0; }
.applicant-header-meta { flex-shrink: 0; text-align: right; min-width: 160px; }

@media (max-width: 767.98px) {
    .applicant-header-flex {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 0.85rem;
    }
    .applicant-header-avatar { margin: 0 auto; }
    .applicant-header-info,
    .applicant-header-meta {
        text-align: center;
        min-width: 0;
        width: 100%;
    }
    .applicant-header-info .d-flex { justify-content: center; }
    #association-labels { align-items: center; }
}

/* --- Touch targets: 44px minimum on mobile --- */
@media (max-width: 991.98px) {
    .btn          { min-height: 44px; }
    .nav-link     { min-height: 44px; display: inline-flex; align-items: center; }
    .form-control,
    .form-select  { min-height: 44px; }
    .form-check-input { width: 20px; height: 20px; }
    .input-group-text { min-height: 44px; }
}

/* --- Reduce excessive white space on mobile --- */
@media (max-width: 767.98px) {
    .container-fluid.mt-4 { margin-top: 1rem !important; }
    .container-fluid.mt-3 { margin-top: 0.75rem !important; }
    .row.mb-4  { margin-bottom: 1rem !important; }
    .row.mb-3  { margin-bottom: 0.75rem !important; }
    .card-body { padding: 1rem; }
    .card-header { padding: 0.75rem 1rem; }
}

/* --- No horizontal overflow on mobile --- */
@media (max-width: 575.98px) {
    .container-fluid { padding-left: 0.75rem; padding-right: 0.75rem; }
    .card { border-radius: 10px; }
}

/* ============================================================
   Unified Page Header (matches home-hero "Welcome back" banner)
   ============================================================ */
.dash-welcome,
.jo-header,
.contracts-header,
.res-header,
.ru-header,
.bl-header,
.ah-header,
.au-header,
.cs-header,
.page-header {
    position: relative !important;
    background: linear-gradient(120deg, #0F1A2D 0%, #1A2740 60%, #1F2D44 100%) !important;
    border: 1px solid rgba(255, 255, 255, 0.06) !important;
    border-radius: 12px !important;
    padding: 1.5rem 1.85rem !important;
    margin-bottom: 1.5rem !important;
    overflow: hidden !important;
    box-shadow:
        0 1px 0 rgba(255,255,255,0.03) inset,
        0 4px 18px rgba(15,26,45,0.18) !important;
    color: #fff !important;
}

/* Subtle grid texture overlay */
.dash-welcome::before,
.jo-header::before,
.contracts-header::before,
.res-header::before,
.ru-header::before,
.bl-header::before,
.ah-header::before,
.au-header::before,
.cs-header::before,
.page-header::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
    background-size: 56px 56px;
    -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 30%, #000 100%);
    mask-image: linear-gradient(90deg, transparent 0%, #000 30%, #000 100%);
    pointer-events: none;
}

/* Orange accent bar on the left */
.dash-welcome::after,
.jo-header::after,
.contracts-header::after,
.res-header::after,
.ru-header::after,
.bl-header::after,
.ah-header::after,
.au-header::after,
.cs-header::after,
.page-header::after {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, var(--tprc-orange) 0%, rgba(255, 76, 0, 0.2) 100%);
    pointer-events: none;
}

/* Lift content above the texture/accent */
.dash-welcome > *,
.jo-header > *,
.contracts-header > *,
.res-header > *,
.ru-header > *,
.bl-header > *,
.ah-header > *,
.au-header > *,
.cs-header > *,
.page-header > * {
    position: relative;
    z-index: 1;
}

/* Title text — white */
.dash-welcome .dash-welcome-title,
.dash-welcome h1,
.jo-header h1,
.contracts-header h1,
.res-header h1,
.ru-header h1,
.bl-header h1,
.ah-header h1,
.au-header h1,
.cs-header h1,
.page-header h1,
.page-header h2 {
    color: #fff !important;
    font-weight: 700 !important;
}

/* Subtitle / description text — muted light */
.dash-welcome .dash-welcome-sub,
.jo-header .subtitle,
.contracts-header .subtitle,
.res-header .subtitle,
.ru-header .subtitle,
.bl-header .subtitle,
.ah-header p,
.au-header .subtitle,
.cs-header .subtitle,
.cs-header p,
.page-header p {
    color: rgba(226, 232, 240, 0.72) !important;
}

/* Dashboard welcome icon — light contrast on dark bg */
.dash-welcome .dash-welcome-icon {
    color: rgba(255, 255, 255, 0.7) !important;
    opacity: 0.9 !important;
}

/* Mobile sizing — match home-hero responsive rules */
@media (max-width: 600px) {
    .dash-welcome,
    .jo-header,
    .contracts-header,
    .res-header,
    .ru-header,
    .bl-header,
    .ah-header,
    .au-header,
    .cs-header,
    .page-header {
        padding: 1.1rem 1.15rem 1.1rem 1.25rem !important;
        border-radius: 10px !important;
    }
}
