/*
 * Modern and Responsive CSS for Mentora AI
 * Leveraging CSS Variables, Flexbox, and Grid for improved UI/UX.
 */

/* === 1. Root Variables & Global Reset === */
:root {
    /* === Refined premium palette: indigo/violet + slate === */
    --bg: #F6F7FB;                 /* slightly warmer near-white */
    --bg-soft: #EEF0F7;
    --card-bg: #FFFFFF;
    --text-primary: #0F172A;       /* slate-900 */
    --text-secondary: #475569;     /* slate-600 */
    --text-tertiary: #94A3B8;      /* slate-400 */

    --accent: #4F46E5;             /* indigo-600 — primary brand */
    --accent-dark: #4338CA;        /* indigo-700 */
    --accent-light: #818CF8;       /* indigo-400 */
    --accent-soft: #EEF2FF;        /* indigo-50 — subtle wash */
    --accent-gradient: linear-gradient(135deg, #4F46E5 0%, #7C3AED 100%);
    --accent-gradient-soft: linear-gradient(135deg, #EEF2FF 0%, #F3E8FF 100%);

    --border-color: #E2E8F0;       /* slate-200 */
    --border-strong: #CBD5E1;      /* slate-300 */
    --shadow: rgba(15, 23, 42, 0.06);
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
    --shadow-md: 0 4px 14px rgba(15, 23, 42, 0.06);
    --shadow-lg: 0 18px 40px rgba(15, 23, 42, 0.10);
    --shadow-glass: 0 24px 60px rgba(79, 70, 229, 0.18);

    --color-success: #10B981;
    --color-warning: #F59E0B;
    --color-danger: #EF4444;

    /* Legacy/Utility Variables (kept for backwards-compat with older selectors) */
    --color-primary: var(--accent);
    --color-primary-dark: var(--accent-dark);
    --color-secondary: var(--accent-light);
    --color-text-dark: var(--text-primary);
    --color-text-light: var(--text-secondary);
    --color-background-light: var(--bg-soft);
    --color-background-med: var(--border-color);
    --color-card-background: var(--card-bg);
    --shadow-light: var(--shadow-md);
    --shadow-medium: var(--shadow-lg);

    /* Layout */
    --border-radius-large: 22px;
    --border-radius-medium: 14px;
    --border-radius-small: 8px;
    --sidebar-width: 280px;
    --header-height: 65px;

    --transition-speed: 0.28s;
}

/* Dark Mode Overrides — clean slate + sky-blue (no more purple wash) */
body.dark-mode {
    --bg: #0B1117;                /* near-black with cool tint */
    --bg-soft: #131A23;
    --card-bg: #181F2A;
    --text-primary: #E6EDF3;
    --text-secondary: #9CA8B5;
    --text-tertiary: #6B7785;
    --accent: #60A5FA;            /* blue-400 — fresh, clean */
    --accent-dark: #3B82F6;       /* blue-500 */
    --accent-light: #93C5FD;      /* blue-300 */
    --accent-soft: #15233A;
    --accent-gradient: linear-gradient(135deg, #3B82F6 0%, #06B6D4 100%); /* blue → cyan */
    --accent-gradient-soft: linear-gradient(135deg, #15233A 0%, #0F2C3A 100%);
    --border-color: #232C3A;
    --border-strong: #364153;
    --shadow: rgba(0, 0, 0, 0.5);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 18px 40px rgba(0, 0, 0, 0.5);
    --shadow-glass: 0 24px 60px rgba(59, 130, 246, 0.18);

    --color-background-light: var(--bg-soft);
    --color-background-med: var(--border-color);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Manrope', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
    background: var(--bg);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    transition: background var(--transition-speed), color var(--transition-speed);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    /* Prevent horizontal scroll */
    overflow-y: auto;
}

a {
    text-decoration: none;
    color: var(--accent);
    transition: color var(--transition-speed);
}

.hidden {
    display: none !important;
}

.version-info {
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 0.85em;
    color: var(--color-text-light);
    z-index: 100;
}

/* === 2. Buttons & Inputs === */
.input-group {
    width: 100%;
    margin-bottom: 20px;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
textarea {
    width: 100%;
    padding: 14px 16px;
    border: 1.5px solid var(--border-color);
    border-radius: 12px;
    font-size: 0.98em;
    background-color: var(--bg-soft);
    box-shadow: none;
    transition: border-color var(--transition-speed), box-shadow var(--transition-speed), background-color var(--transition-speed), color var(--transition-speed);
    color: var(--text-primary);
    font-family: inherit;
}

input::placeholder,
textarea::placeholder {
    color: var(--text-tertiary);
}

input:hover,
textarea:hover {
    border-color: var(--border-strong);
}

input:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent);
    background-color: var(--card-bg);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.14);
}

.btn-primary,
.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
    border-radius: var(--border-radius-medium);
    font-weight: 600;
    cursor: pointer;
    transition: background-color var(--transition-speed), transform 0.2s ease, box-shadow var(--transition-speed), color var(--transition-speed);
    text-align: center;
}

.btn-primary {
    background: var(--accent-gradient);
    color: #FFFFFF;
    padding: 13px 26px;
    font-size: 1em;
    font-weight: 600;
    letter-spacing: 0.01em;
    box-shadow: 0 8px 20px rgba(79, 70, 229, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.15);
    margin-top: 12px;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 28px rgba(79, 70, 229, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    filter: brightness(1.04);
}

.btn-primary:active {
    transform: translateY(0);
    filter: brightness(0.97);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background-color: var(--card-bg);
    color: var(--text-primary);
    padding: 11px 22px;
    font-size: 0.95em;
    border: 1.5px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    font-weight: 600;
}

.btn-secondary:hover {
    background-color: var(--bg-soft);
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-secondary:active {
    transform: translateY(0);
}

.w-full {
    width: 100%;
}

.mt-4 {
    margin-top: 1rem;
}

.text-sm {
    font-size: 0.9em;
}

/* === 3. Login Page === */
.full-screen-center {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    width: 100%;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1000;
    background:
        radial-gradient(at 20% 20%, rgba(79, 70, 229, 0.10) 0%, transparent 50%),
        radial-gradient(at 80% 80%, rgba(124, 58, 237, 0.10) 0%, transparent 50%),
        radial-gradient(at 50% 0%, rgba(99, 102, 241, 0.06) 0%, transparent 40%),
        var(--bg);
    padding: 24px;
    overflow: auto;
}

body.dark-mode .full-screen-center {
    background:
        radial-gradient(at 20% 20%, rgba(99, 102, 241, 0.18) 0%, transparent 50%),
        radial-gradient(at 80% 80%, rgba(168, 85, 247, 0.14) 0%, transparent 50%),
        var(--bg);
}

.login-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    padding: 44px 40px 36px;
    border-radius: 24px;
    box-shadow: var(--shadow-lg), 0 0 0 1px rgba(79, 70, 229, 0.04);
    text-align: center;
    width: 100%;
    max-width: 440px;
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: loginFadeUp 0.55s cubic-bezier(0.22, 1, 0.36, 1);
    position: relative;
    overflow: hidden;
}

.login-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--accent-gradient);
}

@keyframes loginFadeUp {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}

.login-card h1 {
    font-size: 2em;
    font-weight: 800;
    margin: 0 0 10px;
    letter-spacing: -0.02em;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: var(--accent);
}

.login-card p {
    color: var(--text-secondary);
    font-size: 0.98em;
    margin: 0 0 26px;
    line-height: 1.5;
}

/* CAPTCHA Styles */
.captcha-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--color-background-light);
    padding: 10px 15px;
    border-radius: var(--border-radius-medium);
    border: 1px solid var(--border-color);
    margin-bottom: 10px;
}

#captchaCode {
    font-family: 'Courier New', Courier, monospace;
    font-size: 1.4em;
    font-weight: 800;
    letter-spacing: 5px;
    color: var(--accent);
    user-select: none;
    background: linear-gradient(45deg, var(--accent), var(--accent-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

.captcha-container input {
    text-align: center;
    letter-spacing: 2px;
    font-weight: 600;
}

/* === 4. Main Application Layout (Full Width) === */
.app-container {
    background-color: var(--bg);
    border-radius: 0; /* Remove border radius for full width feel */
    box-shadow: none;
    width: 100%;
    max-width: 100vw;
    height: 100vh;
    overflow: hidden;
    position: relative;

    /* Grid Layout for Desktop */
    display: grid;
    grid-template-rows: var(--header-height) 1fr;
    grid-template-columns: 1fr;
}

.full-width-dashboard {
    padding: 20px 40px !important;
}

/* Header */
.app-header {
    grid-row: 1;
    grid-column: 1 / -1;
    background-color: var(--card-bg);
    padding: 0 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    z-index: 50;
    height: var(--header-height);
    transition: background-color var(--transition-speed), box-shadow var(--transition-speed), border-color var(--transition-speed);
}

.hamburger-menu {
    font-size: 1.5em;
    cursor: pointer;
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    transition: background-color 0.25s ease, color 0.25s ease;
}

.hamburger-menu:hover {
    background-color: var(--bg-soft);
    color: var(--accent);
}

.app-title {
    font-size: 1.4em;
    font-weight: 800;
    letter-spacing: -0.01em;
    flex-grow: 1;
    text-align: center;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: var(--accent);
}

/* Sidebar */
.sidebar {
    position: fixed;
    /* Use fixed for overlay effect */
    top: 0;
    left: 0;
    height: 100%;
    width: var(--sidebar-width);
    background-color: var(--card-bg);
    backdrop-filter: blur(10px);
    box-shadow: 5px 0 20px var(--shadow);
    transform: translateX(-100%);
    transition: transform 0.3s ease-in-out, background-color var(--transition-speed), box-shadow var(--transition-speed);
    z-index: 100;
    border-right: 1px solid var(--border-color);
    /* Flex column so the header pins to the top and the menu can scroll */
    display: flex;
    flex-direction: column;
}

.sidebar.active {
    transform: translateX(0);
}

/* Minimal Sidebar Transitions */
.sidebar {
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), background-color var(--transition-speed);
}

.sidebar-header {
    padding: 16px 22px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 6px;
    margin-bottom: 0;
    width: 100%;
    min-height: var(--header-height);
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0; /* never compress when the menu scrolls */
    background: var(--card-bg);
}

.sidebar-header h3 {
    margin: 0;
    font-size: 1.2em;
    font-weight: 700;
    white-space: nowrap;
    line-height: 1.1;
}


.sidebar-menu {
    list-style: none;
    padding: 12px 0 24px;
    margin: 0;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    /* Slim themed scrollbar */
    scrollbar-width: thin;
    scrollbar-color: rgba(168, 85, 247, 0.35) transparent;
    /* Add a soft fade at top + bottom edges so items look like they melt into the chrome */
    -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 14px, #000 calc(100% - 14px), transparent 100%);
            mask-image: linear-gradient(to bottom, transparent 0, #000 14px, #000 calc(100% - 14px), transparent 100%);
}
.sidebar-menu::-webkit-scrollbar { width: 5px; }
.sidebar-menu::-webkit-scrollbar-track { background: transparent; }
.sidebar-menu::-webkit-scrollbar-thumb {
    background: rgba(168, 85, 247, 0.35);
    border-radius: 999px;
}
.sidebar-menu::-webkit-scrollbar-thumb:hover {
    background: rgba(168, 85, 247, 0.55);
}

.sidebar-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    color: var(--text-secondary);
    font-size: 0.95em;
    font-weight: 500;
    transition: background-color var(--transition-speed), color var(--transition-speed);
    border-radius: 10px;
    margin: 0 12px 4px 12px;
}

.sidebar-item:hover {
    background-color: var(--bg-soft);
    color: var(--text-primary);
}

.sidebar-item.active {
    background: var(--accent-gradient);
    color: #FFFFFF;
    font-weight: 600;
    box-shadow: 0 8px 18px rgba(79, 70, 229, 0.28);
}

.sidebar-item.active .sidebar-icon {
    color: #FFFFFF;
}

.sidebar-icon {
    margin-right: 12px;
    font-size: 1em;
    width: 20px;
    height: 20px;
    text-align: center;
    color: var(--text-tertiary);
    transition: color var(--transition-speed);
}

.sidebar-item:hover .sidebar-icon {
    color: var(--accent);
}

/* Sidebar Overlay for Mobile */
#sidebarOverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4);
    z-index: 90;
    opacity: 0;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    visibility: hidden;
}

#sidebarOverlay.active {
    opacity: 1;
    visibility: visible;
}

/* Main Content Area */
.main-content {
    grid-row: 2;
    grid-column: 1;
    padding: 25px;
    overflow-y: auto;
    transition: margin-left 0.3s ease-in-out;
}

/* === 5. Card Base Style === */
.card {
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Glassmorphism for Light Mode */
[data-theme="light"] .card {
    background-color: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

/* Premium Scrollbars */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

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

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* Toast System (single source of truth — 5–7s, close button, smooth fade) */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 10001;
    pointer-events: none;
    /* let clicks fall through to anything underneath when no toast is shown */
}

.toast {
    pointer-events: auto;
    background: var(--accent-gradient);
    color: #fff;
    padding: 14px 18px 14px 22px;
    border-radius: 14px;
    box-shadow: 0 16px 36px rgba(79, 70, 229, 0.30), inset 0 1px 0 rgba(255, 255, 255, 0.15);
    font-size: 0.95em;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 240px;
    max-width: 360px;
    opacity: 0;
    transform: translateY(12px) scale(0.96);
    transition: opacity 0.45s ease, transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.toast.show {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.toast.fade-out {
    opacity: 0;
    transform: translateY(-6px) scale(0.96);
}

.toast-text {
    flex: 1;
    line-height: 1.35;
}

.toast-close {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: #fff;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2em;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, transform 0.2s ease;
}

.toast-close:hover {
    background: rgba(255, 255, 255, 0.28);
    transform: scale(1.08);
}

.card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-large);
    box-shadow: var(--shadow-md);
    padding: 32px;
    margin-bottom: 24px;
    width: 100%;
    transition: background var(--transition-speed), border-color var(--transition-speed), box-shadow var(--transition-speed);
}

.card h2 {
    font-family: 'Manrope', sans-serif;
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    margin-bottom: 18px;
    text-align: center;
    transition: color var(--transition-speed);
}

/* === 6. Dashboard Page Styles === */
.dashboard-card {
    max-width: 900px;
    margin: 20px auto;
}

.dashboard-card h2 {
    font-size: 2em;
    color: var(--accent);
    margin-bottom: 15px;
}

.dashboard-intro {
    font-size: 1em;
    color: var(--text-secondary);
    text-align: center;
    max-width: 600px;
    margin: 0 auto 35px auto;
}

.dashboard-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 25px;
    margin-bottom: 35px;
}

.summary-item {
    background-color: var(--color-background-light);
    border-radius: var(--border-radius-medium);
    padding: 20px;
    text-align: center;
    box-shadow: 0 2px 8px var(--shadow);
    border: 1px solid var(--border-color);
    transition: transform 0.2s ease, background-color var(--transition-speed), border-color var(--transition-speed), box-shadow var(--transition-speed);
}

.summary-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.summary-icon {
    font-size: 2.5em;
    color: var(--accent);
    margin-bottom: 10px;
    transition: color var(--transition-speed);
}

.summary-item h3 {
    font-family: 'Manrope', sans-serif;
    font-size: 1.2em;
    color: var(--text-primary);
    margin-bottom: 5px;
    font-weight: 600;
}

.summary-item p {
    font-size: 26px;
    color: var(--accent);
    font-weight: 700;
    margin: 0;
}

/* Dashboard User Profile Info */
.dashboard-user-profile {
    background: rgba(255, 255, 255, 0.05);
    padding: 20px;
    border-radius: var(--border-radius-medium);
    border: 1px solid var(--border-color);
}

.profile-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.profile-info-item {
    font-size: 0.95em;
    color: var(--text-secondary);
}

.profile-info-item strong {
    color: var(--text-primary);
    margin-right: 5px;
}

.dashboard-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
}

.dashboard-actions .btn-primary,
.dashboard-actions .btn-secondary {
    min-width: 180px;
}

/* === 7. Chatbot Section Styles === */
.chat-card,
.help-me-card {
    display: flex;
    flex-direction: column;
    height: calc(90vh - var(--header-height) - 50px);
    /* Adjusted for full height */
    max-width: 900px;
    margin: 0 auto;
}

.chat-display,
.help-me-chat-display,
.advice-box {
    flex: 1;
    background-color: var(--bg-soft);
    border-radius: 16px;
    padding: 18px;
    margin-bottom: 14px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    display: flex;
    transition: background-color var(--transition-speed), border-color var(--transition-speed);
    flex-direction: column;
    gap: 10px;
}

.message-container {
    display: flex;
}

.message {
    max-width: 80%;
    padding: 12px 18px;
    border-radius: 18px;
    line-height: 1.6;
    word-wrap: break-word;
    font-size: 0.95em;
    box-shadow: var(--shadow-sm);
    position: relative;
}

.message.user {
    background: var(--accent-gradient);
    color: #FFFFFF;
    margin-left: auto;
    border-bottom-right-radius: 6px;
    box-shadow: 0 8px 20px rgba(79, 70, 229, 0.20);
}

.message.bot {
    background-color: var(--card-bg);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    margin-right: auto;
    border-bottom-left-radius: 6px;
}

/* Copy Button Styling */
.copy-chat-btn {
    position: absolute;
    top: 5px;
    /* Small offset from the top edge */
    right: 5px;
    /* Small offset from the right edge */
    background: var(--card-bg);
    /* Use card background for glass effect */
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    width: 24px;
    height: 24px;
    border-radius: 4px;
    /* Minimal square style */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7em;
    cursor: pointer;
    opacity: 0;
    /* Hidden by default */
    transition: opacity 0.2s ease, background-color var(--transition-speed), transform 0.2s ease;
    z-index: 10;
    padding: 0;
}

.copy-chat-btn:hover {
    opacity: 1;
    background-color: var(--color-background-med);
    color: var(--accent);
    transform: scale(1.05);
}

/* Position the button specifically for bot messages (top right of the bubble) */
.message.bot .copy-chat-btn {
    /* Default position is top: 5px, right: 5px */
    left: auto;
}

/* Hide the copy button for user messages (Task 3: No other changes, only Chat Advisor AI response) */
.message.user .copy-chat-btn {
    display: none !important;
}

/* Fade-in on hover of the parent message container */
.message-container:hover .message.bot .copy-chat-btn {
    opacity: 0.8;
}

.typing-indicator {
    /* Existing typing indicator styles */
    display: flex;
    align-items: center;
    background-color: var(--accent-light);
    color: var(--text-primary);
    padding: 12px 18px;
    border-radius: 20px;
    border-bottom-left-radius: 8px;
    max-width: fit-content;
    margin-right: auto;
    animation: fadeIn 0.3s ease-in-out;
    transition: background-color var(--transition-speed), color var(--transition-speed);
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background-color: var(--text-secondary);
    border-radius: 50%;
    margin: 0 3px;
    animation: bounce 1.4s infinite ease-in-out;
    transition: background-color var(--transition-speed);
}

@keyframes bounce {

    0%,
    80%,
    100% {
        transform: translateY(0);
    }

    40% {
        transform: translateY(-5px);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.chat-input-area,
.help-me-input-area {
    display: flex;
    align-items: flex-end;
    /* Align items to the bottom for multi-line textarea */
    width: 100%;
}

.chat-input-area textarea,
.help-me-input-area textarea {
    flex: 1;
    min-height: 50px;
    height: 50px;
    max-height: 120px;
    padding: 12px;
}

.send-btn {
    background-color: var(--accent);
    color: var(--text-primary);
    border: none;
    border-radius: var(--border-radius-medium);
    /* Square button for modern look */
    width: 50px;
    height: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-left: 10px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 122, 255, 0.2);
    font-size: 1.2em;
    transition: background-color var(--transition-speed), transform 0.2s ease;
}

.send-btn:hover {
    background-color: var(--accent-dark);
    transform: translateY(-1px);
}

.send-btn:disabled {
    background-color: #a7d9ff;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.initial-chat-message {
    text-align: center;
    color: var(--text-secondary);
    font-style: italic;
    padding: 20px;
    font-size: 0.9em;
    transition: color var(--transition-speed);
}

.quick-access-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-top: 15px;
}

.btn-quick-access {
    background-color: var(--color-background-light);
    color: var(--text-primary);
    padding: 10px 15px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-medium);
    font-size: 0.85em;
    font-weight: 500;
    cursor: pointer;
    transition: background-color var(--transition-speed), transform 0.2s ease, border-color var(--transition-speed), color var(--transition-speed);
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-quick-access:hover {
    background-color: var(--color-background-med);
    transform: translateY(-1px);
}

.btn-quick-access i {
    color: var(--accent);
    transition: color var(--transition-speed);
}


/* Help Me? Grade Selection Buttons */
.grade-selection-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    /* Space between options */
    padding: 15px 0;
}

.grade-option-btn {
    border-radius: 20px;
    /* More curved edges */
    padding: 12px 24px;
    font-weight: 500;
}

/* === 8. Profile Page Styles === */
.profile-layout {
    display: grid;
    grid-template-columns: minmax(280px, 340px) 1fr;
    gap: 20px;
    align-items: start;
    margin: 20px auto;
    max-width: 1200px;
}

@media (max-width: 980px) {
    .profile-layout { grid-template-columns: 1fr; }
}

.profile-card {
    margin: 0;
    text-align: center;
}

.profile-card h2 {
    margin-bottom: 20px;
}

.profile-avatar-container {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 20px;
    cursor: pointer;
}

.profile-avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 4px solid var(--border-color);
    box-shadow: var(--shadow-light);
    transition: border-color var(--transition-speed);
}

.profile-avatar-container:hover::after {
    content: 'Edit';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 0.8em;
}

#profileUsername[contenteditable="true"] {
    outline: 2px dashed var(--accent);
    padding: 5px;
    cursor: text;
}

.profile-card h3 {
    font-size: 1.5em;
    margin-bottom: 8px;
    font-weight: 600;
}


.tier-level {
    font-size: 1.1em;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

/* Profile Meta List (User ID / Role / Tier) — premium */
.profile-meta-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 22px auto 28px;
    max-width: 380px;
}

.profile-meta-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    background: var(--bg-soft);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    transition: border-color 0.25s ease, background 0.25s ease;
}

.profile-meta-row:hover {
    border-color: var(--accent-light);
}

.profile-meta-label {
    font-size: 0.78em;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-tertiary);
    font-weight: 700;
}

.profile-meta-value {
    font-weight: 600;
    color: var(--text-primary);
}

/* Tier badges — Platinum is highlighted as the premium tier. */
.tier-badge {
    padding: 6px 14px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.85em;
    letter-spacing: 0.04em;
    border: 1px solid transparent;
}

.tier-platinum {
    color: #FFFFFF;
    background: var(--accent-gradient);
    border-color: transparent;
    box-shadow: 0 6px 18px rgba(79, 70, 229, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.20);
}

.tier-silver {
    color: #475569;
    background: #E2E8F0;
    border-color: #CBD5E1;
}

.tier-bronze,
.tier-standard {
    color: var(--text-secondary);
    background: var(--bg-soft);
    border-color: var(--border-color);
}

body.dark-mode .tier-silver {
    color: #CBD5E1;
    background: #2A3251;
    border-color: #3A4470;
}

.profile-description {
    font-size: 0.95em;
    color: var(--text-secondary);
    margin-bottom: 30px;
}

.profile-stats {
    display: flex;
    justify-content: space-around;
    gap: 15px;
}

/* Management Panel Tabs — premium */
.management-tabs {
    display: inline-flex;
    gap: 4px;
    margin-bottom: 28px;
    padding: 4px;
    background: var(--bg-soft);
    border: 1px solid var(--border-color);
    border-radius: 12px;
}

.m-tab-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 10px 18px;
    font-family: inherit;
    font-weight: 600;
    font-size: 0.92em;
    cursor: pointer;
    transition: background 0.25s ease, color 0.25s ease;
    border-radius: 9px;
}

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

.m-tab-btn.active {
    background: var(--card-bg);
    color: var(--accent);
    box-shadow: var(--shadow-sm), 0 0 0 1px var(--border-color);
}

.m-tab-content {
    animation: fadeIn 0.3s ease;
}

.create-user-form .input-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.create-user-form label {
    display: block;
    font-size: 0.85em;
    margin-bottom: 8px;
    color: var(--text-secondary);
}

.activity-log-container {
    background: #0d0d0d;
    color: #00ff41;
    font-family: 'Courier New', Courier, monospace;
    padding: 15px;
    border-radius: var(--border-radius-medium);
    max-height: 460px;
    overflow-y: auto;
    font-size: 0.9em;
    border: 1px solid #333;
}

.activity-log-container > div {
    margin-bottom: 5px;
    border-left: 2px solid transparent;
    padding-left: 8px;
}

.activity-log-container > div:hover {
    background: rgba(0, 255, 65, 0.1);
    border-left-color: #00ff41;
}

.activity-log-container .logs-empty {
    color: rgba(0, 255, 65, 0.55);
    font-style: italic;
    padding: 6px 8px;
}

/* Rich log rows — emitted by the new Firestore-backed logger */
.activity-log-container .log-row {
    background: rgba(0, 255, 65, 0.04);
    border-left: 2px solid rgba(0, 255, 65, 0.35);
    border-radius: 4px;
    padding: 8px 10px;
    margin-bottom: 8px;
    transition: background 0.18s ease, border-color 0.18s ease;
}

.activity-log-container .log-row:hover {
    background: rgba(0, 255, 65, 0.1);
    border-left-color: #00ff41;
}

.activity-log-container .log-row-main {
    display: flex;
    align-items: baseline;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 6px;
}

.activity-log-container .log-when {
    color: rgba(0, 255, 65, 0.55);
    font-size: 0.78em;
    white-space: nowrap;
}

.activity-log-container .log-msg {
    color: #d4ffd6;
    font-weight: 600;
    flex: 1;
}

.activity-log-container .log-row-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.activity-log-container .log-meta-chip {
    background: rgba(0, 255, 65, 0.08);
    border: 1px solid rgba(0, 255, 65, 0.22);
    color: rgba(220, 255, 220, 0.85);
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.72em;
    line-height: 1.5;
    white-space: nowrap;
    font-family: 'Courier New', Courier, monospace;
}

.activity-log-container .log-meta-chip.log-who {
    color: #b9f1ff;
    border-color: rgba(120, 200, 255, 0.35);
    background: rgba(120, 200, 255, 0.08);
}

.activity-log-container .log-meta-chip.log-ip {
    color: #ffe7a0;
    border-color: rgba(255, 200, 0, 0.3);
    background: rgba(255, 200, 0, 0.06);
}

.activity-log-container .log-loc {
    opacity: 0.75;
    font-weight: 400;
}

.activity-log-container .log-meta-chip.log-platform {
    color: #f3c2ff;
    border-color: rgba(220, 120, 255, 0.3);
    background: rgba(220, 120, 255, 0.06);
}

/* Achievements Styles */
.achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
}

.achievement-card {
    background: var(--color-background-light);
    padding: 25px;
    border-radius: var(--border-radius-large);
    text-align: center;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    cursor: default;
}

.achievement-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-glass);
    border-color: var(--accent);
}

.achievement-icon {
    font-size: 2em;
    color: var(--accent);
    margin-bottom: 15px;
    background: rgba(45, 136, 255, 0.1);
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    margin: 0 auto 15px;
}

.achievement-card h3 {
    font-size: 1.1em;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.achievement-card p {
    font-size: 0.9em;
    color: var(--text-secondary);
}

/* Table Styles Cleanup */
table {
    width: 100%;
    border-collapse: collapse;
}

th {
    text-align: left;
    padding: 12px;
    font-size: 0.85em;
    color: var(--text-secondary);
    border-bottom: 2px solid var(--border-color);
}

td {
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.95em;
}

.btn-icon {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
    border-radius: 10px;
    transition: background 0.2s ease, color 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover {
    background: var(--bg-soft);
    color: var(--accent);
}

/* (Stray declarations removed — these were dangling outside any selector.) */


.stat-item {
    flex: 1;
    padding: 0 10px;
}

.stat-item h4 {
    font-size: 0.9em;
    color: var(--text-secondary);
    margin-bottom: 5px;
    font-weight: 500;
}

.stat-item p {
    font-size: 1.6em;
    font-weight: 700;
    color: var(--accent);
    margin: 0;
}

.edit-profile-btn {
    margin-top: 25px;
}

/* === Header Toggle Switch === */
.settings-toggle-header {
    position: relative;
    display: flex;
    align-items: center;
}

.toggle-checkbox {
    display: none;
    /* Hide the actual checkbox */
}

.toggle-label {
    cursor: pointer;
    width: 44px;
    height: 24px;
    background-color: var(--color-background-med);
    border-radius: 24px;
    position: relative;
    transition: background-color var(--transition-speed);
}

.toggle-label::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background-color: white;
    top: 3px;
    left: 4px;
    transition: transform 0.3s ease;
}

.toggle-checkbox:checked+.toggle-label {
    background-color: var(--accent);
}

.toggle-checkbox:checked+.toggle-label::after {
    transform: translateX(19px);
}

/* === 9. Explore Page Styles === */
.explore-card {
    max-width: 1100px;
    margin: 20px auto;
}

.explore-intro {
    font-size: 1em;
    color: var(--text-secondary);
    text-align: center;
    max-width: 700px;
    margin: 0 auto 35px auto;
}

.opscore-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    /* Space below the header */
}

.opscore-header h2 {
    margin-bottom: 0;
    /* Remove default margin from h2 inside the flex container */
    text-align: left;
    /* Ensure title is left-aligned */
}

.server-status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    /* Small padding (6-8px) */
    border-radius: 12px;
    background-color: transparent;
    border: none;
    font-size: 0.9em;
    font-weight: 500;
    color: var(--text-primary);
    transition: background-color var(--transition-speed), border-color var(--transition-speed);
}

.server-icon {
    font-size: 1.1em;
    transition: color 0.3s ease;
}

/* Status Colors & Animations */
@keyframes pulse-green {
    0% {
        box-shadow: 0 0 0 0 rgba(66, 183, 42, 0.7);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(66, 183, 42, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(66, 183, 42, 0);
    }
}

@keyframes pulse-yellow {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 193, 7, 0.7);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(255, 193, 7, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(255, 193, 7, 0);
    }
}

@keyframes pulse-red {
    0% {
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.7);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(220, 53, 69, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0);
    }
}

.server-icon {
    font-size: 1.1em;
    transition: color 0.3s ease, stroke 0.3s ease;
    border-radius: 50%;
    /* Needed for the pulse effect */
    padding: 2px;
    /* Add some padding so the shadow is visible */
}

/* More specific selectors to ensure colors are applied */
.server-status-indicator .status-green {
    color: var(--color-success);
    stroke: var(--color-success);
    animation: pulse-green 2s infinite;
}

.server-status-indicator .status-yellow {
    color: #FFC107;
    stroke: #FFC107;
    animation: pulse-yellow 2s infinite;
}

.server-status-indicator .status-red {
    color: #DC3545;
    stroke: #DC3545;
    animation: pulse-red 2s infinite;
}

.server-status-indicator .status-grey {
    color: var(--text-secondary);
    stroke: var(--text-secondary);
    animation: none;
    /* No animation for grey status */
}

.trend-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
}

.trend-item {
    background-color: var(--color-background-light);
    border-radius: var(--border-radius-medium);
    box-shadow: 0 4px 10px var(--shadow);
    padding: 30px;
    text-align: center;
    transition: transform 0.3s ease, box-shadow var(--transition-speed), background-color var(--transition-speed), border-color var(--transition-speed);
    border: 1px solid var(--border-color);
    cursor: pointer;
}

.trend-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.trend-icon {
    font-size: 3.5em;
    color: var(--accent);
    margin-bottom: 15px;
    transition: color var(--transition-speed);
}

.trend-item h3 {
    font-size: 1.5em;
    margin-bottom: 10px;
    font-weight: 600;
}

.trend-item p {
    font-size: 0.95em;
    color: var(--text-secondary);
    min-height: 50px;
    /* Ensure consistent height for descriptions */
}

.trend-filters {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 20px;
}

.trend-filter-select {
    padding: 8px 12px;
    border-radius: var(--border-radius-medium);
    border: 1px solid var(--border-color);
    background-color: var(--color-background-light);
    color: var(--text-primary);
    font-size: 0.9em;
    transition: background-color var(--transition-speed), color var(--transition-speed), border-color var(--transition-speed);
}

.trend-detail-modal {
    max-width: 600px;
}

.trend-detail-modal .custom-alert-body {
    max-height: 60vh;
    overflow-y: auto;
}

.agent-insights {
    margin-top: 20px;
    border-top: 1px solid var(--border-color);
    padding-top: 15px;
}

.insight-item {
    background-color: var(--color-background-light);
    padding: 10px;
    border-radius: var(--border-radius-medium);
    margin-bottom: 10px;
    font-size: 0.9em;
}

/* === 10. Management Page — refined table === */
.management-card {
    max-width: 1200px;
    margin: 20px auto;
    min-width: 0;
}

/* Horizontal-scroll wrapper used by the User List table. */
.management-card .overflow-x-auto,
.overflow-x-auto {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
    margin-top: 20px;
    border-radius: 14px;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
}

.management-card table {
    width: 100%;
    min-width: 760px;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 0;
    background: var(--card-bg);
    font-size: 0.92em;
    table-layout: auto;
}

.management-card th,
.management-card td {
    padding: 8px 10px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    transition: border-color var(--transition-speed), background-color var(--transition-speed);
    vertical-align: middle;
}

/* Email column — keep narrow with ellipsis on overflow; full text in tooltip */
.management-card td:nth-child(3) {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.management-card td:nth-child(3):hover { white-space: normal; word-break: break-all; }

.management-card th {
    background-color: var(--bg-soft);
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.72em;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    white-space: nowrap;
}

.management-card td {
    font-size: 0.88em;
    background-color: var(--card-bg);
    color: var(--text-primary);
}

.management-card tbody tr:last-child td {
    border-bottom: none;
}

.management-card tbody tr:hover td {
    background-color: var(--bg-soft);
}

.text-center {
    text-align: center;
}

.text-textLight {
    color: var(--text-secondary);
}

.mb-6 {
    margin-bottom: 1.5rem;
}

.mt-6 {
    margin-top: 1.5rem;
}

/* === 11. Custom Alert/Modal Styles === */
.custom-alert-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
}

.custom-alert-overlay.active {
    opacity: 1;
    visibility: visible;
}

.custom-alert-box {
    background-color: var(--card-bg);
    border-radius: var(--border-radius-large);
    box-shadow: var(--shadow-medium);
    width: 90%;
    transition: background-color var(--transition-speed);
    max-width: 380px;
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s ease;
    opacity: 0;
}

.custom-alert-overlay.active .custom-alert-box {
    transform: scale(1);
    opacity: 1;
}

.custom-alert-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
}

.custom-alert-header h3 {
    margin: 0;
    font-size: 1.1em;
    font-weight: 600;
    color: var(--text-primary);
}

.close-alert {
    font-size: 1.5em;
    cursor: pointer;
    color: var(--text-secondary);
}

.custom-alert-body {
    padding: 20px;
    font-size: 0.95em;
    color: var(--text-primary);
    line-height: 1.6;
}

.custom-alert-footer {
    padding: 15px 20px;
    border-top: 1px solid var(--border-color);
    text-align: right;
}

.custom-alert-footer .btn-primary {
    padding: 8px 18px;
    font-size: 0.9em;
    margin-top: 0;
}

/* === 12. Responsive Media Queries === */

/* Tablet and smaller desktop screens */
@media (min-width: 769px) {

    /* Desktop Sidebar Behavior */
    .app-container {
        grid-template-columns: var(--sidebar-width) 1fr;
    }

    .app-header {
        grid-column: 1 / -1;
    }

    .sidebar {
        position: relative;
        /* Docked on desktop */
        transform: translateX(0);
        grid-row: 1 / -1;
        grid-column: 1;
        height: 100%;
        padding-top: 0;
        box-shadow: none;
        z-index: 10;
    }

    .sidebar-header {
        position: relative;
        border-bottom: none;
    }

    .main-content {
        grid-column: 2;
        grid-row: 2;
        padding: 30px;
    }

    .app-header {
        grid-column: 2;
        grid-row: 1;
        border-bottom: 1px solid var(--border-color);
    }

    .app-header .hamburger-menu {
        display: none;
        /* Hide hamburger on desktop */
    }

    .app-header .app-title {
        text-align: left;
        position: static;
        transform: none;
        margin-left: 0;
    }

    .app-header .logout-button {
        margin-left: auto;
    }
}

/* New styles for theme toggle and header actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.btn-icon {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.4em;
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color var(--transition-speed), color var(--transition-speed), transform 0.2s ease;
}

.btn-icon:hover {
    background-color: var(--color-background-med);
    transform: scale(1.1);
}

.btn-icon i {
    transition: color var(--transition-speed), transform 0.3s ease;
}

/* Mobile screens (max 768px) */
@media (max-width: 768px) {
    body {
        font-size: 15px;
        align-items: flex-start;
        padding: 0;
        overflow-y: auto;
    }

    .app-container {
        width: 100%;
        height: 100vh;
        max-width: none;
        border-radius: 0;
        box-shadow: none;
    }

    .app-header {
        padding: 0 15px;
    }

    .app-title {
        font-size: 1.3em;
    }

    .sidebar {
        width: 260px;
        box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
    }

    .main-content {
        padding: 15px;
    }

    .card {
        padding: 20px;
    }

    .chat-card,
    .help-me-card {
        height: calc(100vh - var(--header-height) - 30px);
        min-height: 400px;
        max-width: 100%;
    }

    .dashboard-summary-grid {
        grid-template-columns: 1fr;
    }

    .trend-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-actions {
        flex-direction: column;
    }

    .dashboard-actions .btn-primary,
    .dashboard-actions .btn-secondary {
        width: 100%;
    }

    .quick-access-buttons {
        flex-direction: column;
    }

    .btn-quick-access {
        width: 100%;
    }

    .login-card {
        padding: 30px 20px;
        width: 100%;
        height: 100vh;
        border-radius: 0;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .card h2 {
        font-size: 1.5em;
    }

    .btn-primary {
        padding: 12px 24px;
        font-size: 1em;
    }

    .btn-secondary {
        padding: 8px 18px;
        font-size: 0.9em;
    }

    .message {
        max-width: 90%;
        padding: 10px 15px;
    }
}

/* === 13. Advice Actions and Toast Styles (New) === */

/* === 13. Advice Actions and Toast Styles (New) === */

/* Report Output Container (Rule 1: Comfortable height, expands, fade-in) */
.report-output-container {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-large);
    box-shadow: var(--shadow-glass);
    padding: 0;
    margin: 0;
    transition: opacity 0.5s ease-in-out;

    /* Fill the help-me-card vertically so the report feels like a real document */
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

/* Report meta strip (inserted by JS) shown above the content */
.report-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    padding: 18px 32px;
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(135deg, rgba(45, 136, 255, 0.08), rgba(99, 102, 241, 0.05));
    flex-shrink: 0;
}

.report-meta .report-meta-title {
    font-size: 0.85em;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent);
    font-weight: 700;
    margin: 0;
}

.report-meta .report-meta-info {
    font-size: 0.85em;
    color: var(--text-secondary);
    text-align: right;
}

.report-meta .report-meta-info strong {
    color: var(--text-primary);
    font-weight: 600;
}

.report-disclaimer {
    font-size: 0.78em;
    color: var(--text-secondary);
    text-align: center;
    margin: 0;
    padding: 10px 24px 0;
    line-height: 1.4;
}

.report-disclaimer a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
}

.report-disclaimer a:hover {
    text-decoration: underline;
}

/* Report Content Styling */
.final-report-content {
    padding: 0;
    line-height: 1.75;
    color: var(--text-primary);
    font-size: 1em;
    max-width: 760px;
    margin: 0 auto;
}

/* New scrolling container for the report text */
.report-scroll-content {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 36px 40px 28px;
    scroll-behavior: smooth;
}

@media (max-width: 640px) {
    .report-meta { padding: 14px 18px; }
    .report-scroll-content { padding: 22px 18px; }
}

/* Fade-in animation class (Rule 1) */
.report-fade-in {
    opacity: 0;
    animation: reportFadeIn 0.6s ease-out forwards;
}

@keyframes reportFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Additional styles for Career Guidance Report formatting (Rule 2) */
.career-guidance-report .report-header {
    font-family: 'Inter', sans-serif;
    font-size: 1.8em;
    font-weight: 700;
    margin: 0 0 8px;
    padding: 0;
    border: none;
    display: block;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.career-guidance-report .report-header strong {
    font-weight: 700;
}

.career-guidance-report .report-subtitle {
    color: var(--text-secondary);
    font-size: 0.95em;
    margin: 0 0 28px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--border-color);
}

.career-guidance-report h3.report-section-title {
    font-size: 1.25em;
    font-weight: 700;
    color: var(--accent);
    margin: 32px 0 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.career-guidance-report h4.roadmap-subsection-title {
    font-size: 1.02em;
    font-weight: 600;
    color: var(--text-primary);
    margin: 20px 0 8px;
    padding-left: 12px;
    border-left: 3px solid var(--accent);
}

.career-guidance-report p,
.career-guidance-report ul,
.career-guidance-report li {
    font-size: 0.98em;
}

.career-guidance-report ul {
    padding-left: 22px;
    margin: 8px 0;
}

.career-guidance-report li {
    margin-bottom: 6px;
}

.career-guidance-report .career-block {
    margin: 18px 0;
    padding: 18px 20px;
    background: var(--color-background-light);
    border-radius: 12px;
    border-left: 4px solid var(--accent);
}

.career-guidance-report .career-block strong:first-child {
    display: block;
    font-size: 1.08em;
    color: var(--accent);
    margin-bottom: 8px;
}

.career-guidance-report hr.section-divider {
    border: none;
    border-top: 1px dashed var(--border-color);
    margin: 28px 0;
}

.career-guidance-report .final-note-text {
    margin-top: 14px;
    padding: 18px 22px;
    background: linear-gradient(135deg, rgba(45, 136, 255, 0.08), rgba(99, 102, 241, 0.08));
    border-radius: 12px;
    font-style: italic;
    font-size: 1.05em;
    color: var(--text-primary);
    text-align: center;
}

/* Advice Actions Container — pinned bottom bar */
.advice-actions {
    display: flex;
    gap: 14px;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
    padding: 14px 20px;
    background-color: var(--card-bg);
    border-top: 1px solid var(--border-color);
    transition: border-color var(--transition-speed);
}

/* Icon-only Button Base Style (Rule 2: Icon-only, rounded, centered) */
.btn-icon-action {
    background-color: var(--color-background-light);
    color: var(--accent);
    border: 1px solid var(--border-color);
    width: 45px;
    height: 45px;
    border-radius: 50%;
    /* Circular button */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1em;
    cursor: pointer;
    transition: background-color var(--transition-speed), transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 2px 5px var(--shadow);
}

.btn-icon-action:hover {
    background-color: var(--color-background-med);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

/* Micro-animation: Copy Button — single-pulse on hover, no infinite loop */
.copy-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(65, 105, 225, 0.25);
}

.copy-btn:active {
    transform: scale(0.95);
}

/* Micro-animation: Download Button (Rule 3: Slide Down) */
.download-btn i {
    transition: transform 0.2s ease;
}

.download-btn:hover i,
.download-btn:active i {
    transform: translateY(4px);
    /* Slide downward slightly (4px) */
}

/* (Legacy toast block intentionally removed — see single toast block earlier in this file.) */

/* === 14. About Page Styles === */
.about-card {
    max-width: 900px;
    margin: 20px auto;
    text-align: left;
}

.about-card h2 {
    text-align: center;
    color: var(--accent);
    margin-bottom: 25px;
}

.about-card h3 {
    font-size: 1.4em;
    color: var(--text-primary);
    margin-top: 20px;
    margin-bottom: 10px;
    border-bottom: 2px solid var(--accent-light);
    padding-bottom: 5px;
}

.about-card p {
    font-size: 1em;
    line-height: 1.7;
    color: var(--text-secondary);
    margin-bottom: 15px;
}

.about-card ul {
    list-style-type: disc;
    margin-left: 20px;
    margin-bottom: 15px;
}

.about-card ul li {
    margin-bottom: 10px;
    color: var(--text-secondary);
}

/* === 15. Zomato-Style Loading Screen === */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    z-index: 20000;
    pointer-events: none;
    /* Allow clicks through when hidden */
}

.loading-overlay.hidden {
    visibility: hidden;
}

.door {
    position: absolute;
    width: 50%;
    height: 100%;
    background-color: var(--card-bg);
    transition: transform 0.5s cubic-bezier(0.77, 0, 0.175, 1);
}

#leftDoor {
    left: 0;
    transform: translateX(-100%);
}

#rightDoor {
    right: 0;
    transform: translateX(100%);
}

.loading-overlay:not(.hidden) #leftDoor {
    transform: translateX(0);
}

.loading-overlay:not(.hidden) #rightDoor {
    transform: translateX(0);
}

.loading-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    opacity: 0;
    transition: opacity 0.3s ease 0.5s;
    /* Fade in after doors close */
}

.loading-overlay:not(.hidden) .loading-content {
    opacity: 1;
}

.loading-quote {
    font-size: 1.2em;
    color: var(--text-secondary);
    margin-top: 20px;
}

.loader-icon {
    width: 48px;
    height: 48px;
    border: 3px solid var(--accent);
    border-radius: 50%;
    display: inline-block;
    position: relative;
    box-sizing: border-box;
    animation: pulse 1s linear infinite;
}

.loader-icon:after {
    content: '';
    position: absolute;
    width: 48px;
    height: 48px;
    border: 3px solid var(--accent);
    border-radius: 50%;
    display: inline-block;
    box-sizing: border-box;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    animation: pulse 1s linear infinite;
    animation-delay: 0.5s;
}

@keyframes pulse {
    0% {
        transform: translate(-50%, -50%) scale(0.5);
        opacity: 1;
    }

    100% {
        transform: translate(-50%, -50%) scale(1.5);
        opacity: 0;
    }
}

/* === 15. Dashboard — premium grid styles === */
.dashboard-card-new {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
}

.dashboard-header-new {
    margin-bottom: 32px;
    text-align: left;
    padding: 28px 32px;
    border-radius: var(--border-radius-large);
    background: var(--accent-gradient);
    color: #FFFFFF;
    box-shadow: 0 18px 40px rgba(79, 70, 229, 0.20);
    position: relative;
    overflow: hidden;
}

.dashboard-header-new::before {
    content: '';
    position: absolute;
    right: -60px;
    top: -60px;
    width: 220px;
    height: 220px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.18) 0%, transparent 70%);
    pointer-events: none;
}

.dashboard-header-new::after {
    content: '';
    position: absolute;
    left: -40px;
    bottom: -80px;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(168, 85, 247, 0.35) 0%, transparent 70%);
    pointer-events: none;
}

.dashboard-header-new h2 {
    text-align: left;
    font-size: 2.2em;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin: 0 0 6px;
    color: #FFFFFF;
    position: relative;
    z-index: 1;
}

.dashboard-header-new .dashboard-intro {
    color: rgba(255, 255, 255, 0.85);
    font-size: 1.02em;
    margin: 0;
    position: relative;
    z-index: 1;
}

.dashboard-grid-new {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 22px;
    margin-bottom: 32px;
}

.grid-card {
    background: var(--card-bg);
    padding: 26px;
    border-radius: 18px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.28s ease, border-color 0.28s ease;
    position: relative;
    overflow: hidden;
}

.grid-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 3px;
    background: var(--accent-gradient);
    opacity: 0;
    transition: opacity 0.28s ease;
}

.grid-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--accent-light);
}

.grid-card:hover::before {
    opacity: 1;
}

.card-header-icon {
    width: 44px;
    height: 44px;
    background: var(--accent-gradient-soft);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 18px;
    color: var(--accent);
}

.card-header-icon i,
.card-header-icon svg {
    width: 20px;
    height: 20px;
}

.grid-card h3 {
    font-size: 0.85em;
    color: var(--text-secondary);
    margin-bottom: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.stat-value {
    font-size: 2em;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    margin: 0;
}

.profile-info-item-new {
    font-size: 0.98em;
    margin-bottom: 6px;
    color: var(--text-primary);
}

.profile-info-item-new strong {
    color: var(--text-secondary);
    font-weight: 500;
    margin-right: 6px;
}

/* === 16. Modern Create User Form === */
.create-user-form-modern {
    background: var(--card-bg);
    padding: 36px;
    border-radius: 18px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
}

.form-grid-modern {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 22px;
}

.input-group-modern {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.input-group-modern.full-width {
    grid-column: span 2;
}

.input-group-modern label {
    font-size: 0.9em;
    font-weight: 600;
    color: var(--text-secondary);
    margin-left: 5px;
}

.input-group-modern input, .modern-select {
    padding: 15px;
    border-radius: 12px;
    border: 1.5px solid var(--border-color);
    background: var(--bg);
    color: var(--text-primary);
    font-size: 1em;
    transition: all 0.3s ease;
}

.input-group-modern input:focus, .modern-select:focus {
    border-color: var(--accent);
    background: var(--card-bg);
    box-shadow: 0 0 0 4px rgba(24, 119, 242, 0.15);
    outline: none;
}

.create-btn {
    margin-top: 35px;
    width: 100%;
    padding: 18px !important;
    font-size: 1.1em !important;
}

/* Priority Selection Boxes */
.priority-selection {
    display: flex;
    gap: 12px;
    margin-top: 5px;
}

.priority-box {
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    border: 1.5px solid var(--border-color);
    border-radius: 10px;
    font-weight: 700;
    font-size: 1.1em;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--text-secondary);
}

.priority-box:hover {
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(24, 119, 242, 0.1);
}

.priority-box.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
    box-shadow: 0 8px 20px rgba(24, 119, 242, 0.3);
}

/* === 17. MihU Category Selection — premium === */
.mihu-header {
    text-align: center;
    margin-bottom: 36px;
}

.mihu-header h2 {
    font-size: 2em;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: var(--accent);
}

.mihu-header .help-me-intro {
    color: var(--text-secondary);
    font-size: 1.02em;
    max-width: 540px;
    margin: 8px auto 0;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 18px;
    margin-bottom: 32px;
}

.category-item {
    background: var(--card-bg);
    padding: 28px 20px;
    border-radius: 18px;
    border: 1.5px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    cursor: pointer;
    transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.28s ease, border-color 0.28s ease, background 0.28s ease;
    position: relative;
    overflow: hidden;
}

.category-item::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--accent-gradient-soft);
    opacity: 0;
    transition: opacity 0.28s ease;
    pointer-events: none;
}

.category-item > * {
    position: relative;
    z-index: 1;
}

.category-item i,
.category-item svg {
    width: 36px;
    height: 36px;
    color: var(--accent);
    transition: transform 0.3s ease;
}

.category-item span {
    font-weight: 600;
    font-size: 1.05em;
    color: var(--text-primary);
}

.category-item:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
    border-color: var(--accent-light);
}

.category-item:hover::before {
    opacity: 1;
}

.category-item:hover i,
.category-item:hover svg {
    transform: scale(1.1);
}

.category-item.selected {
    background: var(--accent-gradient);
    border-color: transparent;
    color: #FFFFFF;
    box-shadow: 0 16px 32px rgba(79, 70, 229, 0.30);
}

.category-item.selected::before {
    opacity: 0;
}

.category-item.selected i,
.category-item.selected svg,
.category-item.selected span {
    color: #FFFFFF;
}

/* Management Actions */
.panel-header-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-danger {
    background: #dc2626;
    color: #fff;
    border: 1px solid #b91c1c;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 0.9em;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background 0.18s ease, transform 0.12s ease, box-shadow 0.18s ease;
}

.btn-danger:hover {
    background: #b91c1c;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.25);
}

.btn-danger:active { transform: scale(0.97); }

.btn-danger:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-danger i {
    width: 16px;
    height: 16px;
}

@media (max-width: 768px) {
    .form-grid-modern {
        grid-template-columns: 1fr;
    }
    .input-group-modern.full-width {
        grid-column: span 1;
    }
    .full-width-dashboard {
        padding: 20px !important;
    }
}

/* === 18. NovaMind OS Floating Button (bottom-right) — premium === */
.nova-mind-floating {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    border: none;
    border-radius: 999px;
    background: var(--accent-gradient);
    color: #fff;
    font-family: inherit;
    font-size: 0.9em;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 16px 36px rgba(79, 70, 229, 0.40), inset 0 1px 0 rgba(255, 255, 255, 0.18);
    transition: transform 0.25s ease, box-shadow 0.25s ease, filter 0.25s ease;
}

.nova-mind-floating:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 22px 44px rgba(79, 70, 229, 0.50), inset 0 1px 0 rgba(255, 255, 255, 0.25);
    filter: brightness(1.05);
}

.nova-mind-floating:active {
    transform: translateY(-1px) scale(0.99);
}

.nova-mind-floating i,
.nova-mind-floating svg {
    width: 18px;
    height: 18px;
}

.nova-mind-label strong {
    margin-left: 4px;
    opacity: 0.9;
    font-weight: 700;
}

@media (max-width: 600px) {
    .nova-mind-floating {
        bottom: 16px;
        right: 16px;
        padding: 11px 14px;
        font-size: 0.85em;
    }
    .nova-mind-label {
        display: none;
    }
}

/* === 19. Star Rating (replaces priority boxes) === */
.star-rating {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
    user-select: none;
}

.star-rating .star-item {
    font-size: 2em;
    line-height: 1;
    color: var(--border-color);
    cursor: pointer;
    transition: color 0.18s ease, transform 0.18s ease;
}

.star-rating .star-item:hover {
    transform: translateY(-1px) scale(1.08);
}

.star-rating .star-item.hover,
.star-rating .star-item.filled {
    color: #f5b800;
    /* warm star yellow — distinct from any tier color */
    text-shadow: 0 2px 8px rgba(245, 184, 0, 0.35);
}

.star-rating-label {
    margin-left: 12px;
    font-size: 0.9em;
    color: var(--text-secondary);
    font-weight: 500;
}

/* === 20. Custom Select (Role dropdown) === */
.custom-select-wrapper {
    position: relative;
    display: block;
}

.modern-select {
    width: 100%;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding: 15px 44px 15px 15px;
    border-radius: 12px;
    border: 1.5px solid var(--border-color);
    background: var(--bg);
    color: var(--text-primary);
    font-size: 1em;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s ease;
}

.modern-select:focus {
    border-color: var(--accent);
    background: var(--card-bg);
    box-shadow: 0 0 0 4px rgba(24, 119, 242, 0.15);
    outline: none;
}

.modern-select option[disabled] {
    color: var(--text-secondary);
}

.custom-select-caret {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--text-secondary);
    pointer-events: none;
}

/* === 21. Dashboard — full width, cleaner spacing === */
.full-width-dashboard {
    max-width: 100%;
    width: 100%;
    padding: 32px 40px;
}

.dashboard-card-new {
    max-width: 1400px;
    margin: 0 auto;
}

.dashboard-grid-new {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 28px;
    margin-bottom: 36px;
}

.grid-card {
    padding: 28px 26px;
    gap: 4px;
}

.dashboard-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 8px;
}

@media (max-width: 900px) {
    .full-width-dashboard {
        padding: 24px 20px;
    }
}

/* === 22. MihU UI polish — centered card, progress, clean inputs === */
.help-me-card {
    max-width: 820px;
    margin: 20px auto;
}

.mihu-header h2 {
    font-size: 1.9em;
    color: var(--accent);
}

.help-me-input-area {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 10px;
    margin-top: 14px;
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.help-me-input-area textarea {
    border: none;
    background: transparent;
    box-shadow: none;
    padding: 10px;
    resize: none;
    min-height: 44px;
}

.help-me-input-area textarea:focus {
    box-shadow: none;
}

.mihu-progress {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: var(--color-background-light);
    border: 1px solid var(--border-color);
    border-radius: 999px;
    font-size: 0.85em;
    color: var(--text-secondary);
    margin: 0 auto 14px;
    width: fit-content;
}

.mihu-progress-bar {
    width: 140px;
    height: 6px;
    background: var(--border-color);
    border-radius: 999px;
    overflow: hidden;
}

.mihu-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--accent-light));
    width: 0%;
    transition: width 0.35s ease;
}

/* === 23. Dark mode tweaks for new components === */
body.dark-mode .star-rating .star-item {
    color: #3a3b3c;
}

body.dark-mode .star-rating .star-item.filled,
body.dark-mode .star-rating .star-item.hover {
    color: #ffd24a;
}

body.dark-mode .modern-select {
    background: #2a2b2d;
}

body.dark-mode .profile-meta-row {
    background: #2a2b2d;
    border-color: #3a3b3c;
}

/* === 24. Login Tabs — premium === */
.login-tabs {
    display: flex;
    gap: 4px;
    padding: 4px;
    margin: 8px 0 24px;
    background: var(--bg-soft);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    width: 100%;
    max-width: 360px;
}

.login-tab {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 9px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-family: inherit;
    font-weight: 600;
    font-size: 0.92em;
    cursor: pointer;
    transition: background 0.25s ease, color 0.25s ease;
}

.login-tab i,
.login-tab svg {
    width: 15px;
    height: 15px;
}

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

.login-tab.active {
    background: var(--card-bg);
    color: var(--accent);
    box-shadow: var(--shadow-sm), 0 0 0 1px var(--border-color);
}

.login-pane {
    animation: loginPaneFade 0.25s ease;
}

@keyframes loginPaneFade {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* OTP step UI (shared by Email OTP) */
.otp-step {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.otp-hint {
    font-size: 0.9em;
    color: var(--text-secondary);
    margin: 0 0 4px;
    text-align: center;
}

.otp-hint strong {
    color: var(--text-primary);
}

.otp-hint a {
    color: var(--accent);
    cursor: pointer;
}

#emailOtpCode {
    letter-spacing: 0.5em;
    text-align: center;
    font-size: 1.4em;
    font-weight: 600;
    padding-left: 0.5em;
}

#resendEmailOtpButton:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* === 25. System Admin Row in User Table === */
.system-admin-row td {
    background: linear-gradient(90deg, rgba(79, 70, 229, 0.06), transparent);
    font-weight: 500;
}

.admin-tag {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 10px;
    font-size: 0.7em;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    border-radius: 999px;
    background: var(--accent-gradient);
    color: #fff;
    vertical-align: middle;
    box-shadow: 0 4px 10px rgba(79, 70, 229, 0.25);
}

.system-admin-badge {
    display: inline-block;
    padding: 4px 12px;
    font-size: 0.78em;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    border-radius: 999px;
    background: var(--bg-soft);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    cursor: help;
}

body.dark-mode .system-admin-row td {
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.14), transparent);
}

/* === Mindmap card (inside MihU report) === */
.mindmap-card {
    margin: 0 auto 32px;
    max-width: 760px;
    background: linear-gradient(135deg, rgba(45, 136, 255, 0.06), rgba(99, 102, 241, 0.04));
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 18px 20px;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.04);
}

.mindmap-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 12px;
}

.mindmap-header h3 {
    font-size: 1.05em;
    font-weight: 700;
    color: var(--accent);
    margin: 0;
    letter-spacing: -0.01em;
}

.mindmap-status {
    font-size: 0.78em;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.mindmap-body {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    min-height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 14px;
}

body.dark-mode .mindmap-body { background: #f8fafc; }

.mindmap-svg-wrap {
    width: 100%;
    display: flex;
    justify-content: center;
}

.mindmap-svg-wrap svg {
    max-width: 100%;
    height: auto;
    display: block;
}

.mindmap-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    color: var(--text-secondary);
    font-size: 0.92em;
    padding: 28px 12px;
}

.mindmap-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(45, 136, 255, 0.18);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: mindmap-spin 0.9s linear infinite;
}

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

.mindmap-error {
    text-align: center;
    color: #b45309;
    padding: 18px 12px;
    font-size: 0.95em;
}

.mindmap-error-detail {
    margin-top: 6px;
    font-size: 0.85em;
    color: var(--text-secondary);
}

/* === OpsCore redesign =========================================== */
.opscore-card {
    max-width: 1200px;
    margin: 20px auto;
    padding: 28px 28px 24px;
}

.opscore-hero {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 18px;
    padding: 20px 24px;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(45, 136, 255, 0.12), rgba(99, 102, 241, 0.08));
    border: 1px solid var(--border-color);
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
}

.opscore-hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 90% -20%, rgba(45, 136, 255, 0.25), transparent 50%);
    pointer-events: none;
}

.opscore-hero-left { position: relative; z-index: 1; }
.opscore-hero-right { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 10px; align-items: flex-end; }

.opscore-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.72em;
    font-weight: 700;
    letter-spacing: 0.12em;
    color: var(--accent);
    background: rgba(45, 136, 255, 0.12);
    padding: 4px 10px;
    border-radius: 999px;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.opscore-live-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #16a34a;
    border-radius: 50%;
    box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.6);
    animation: opscoreLivePulse 1.6s ease-out infinite;
}

.opscore-live-dot.small {
    width: 6px;
    height: 6px;
}

@keyframes opscoreLivePulse {
    0%   { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.6); }
    70%  { box-shadow: 0 0 0 8px rgba(22, 163, 74, 0); }
    100% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0); }
}

.opscore-hero h2 {
    margin: 0 0 6px;
    font-size: 1.9em;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.opscore-hero p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.95em;
    max-width: 540px;
}

.opscore-uptime {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 8px 14px;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.04);
}

.opscore-uptime-label {
    font-size: 0.65em;
    color: var(--text-secondary);
    letter-spacing: 0.16em;
    font-weight: 700;
}

.opscore-uptime-value {
    font-family: 'Courier New', Courier, monospace;
    font-size: 1.05em;
    font-weight: 700;
    color: var(--text-primary);
}

/* Metric tiles */
.opscore-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}

.opscore-metric {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 16px 16px 8px;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
    position: relative;
    overflow: hidden;
}

.opscore-metric:hover {
    transform: translateY(-2px);
    border-color: var(--accent);
    box-shadow: 0 8px 22px rgba(45, 136, 255, 0.12);
}

.opscore-metric-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.opscore-metric-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82em;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.opscore-metric-label i {
    width: 14px;
    height: 14px;
}

.opscore-trend {
    font-size: 0.72em;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(110, 117, 130, 0.12);
    color: var(--text-secondary);
}

.opscore-trend.up    { background: rgba(22, 163, 74, 0.12);  color: #16a34a; }
.opscore-trend.down  { background: rgba(45, 136, 255, 0.12); color: var(--accent); }

.opscore-metric-value {
    font-size: 1.7em;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    margin-bottom: 4px;
}

.opscore-sparkline {
    display: block;
    width: 100%;
    height: 44px;
}

/* Lower grid: gauges + nodes + activity */
.opscore-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
    gap: 18px;
}

.opscore-panel {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 18px;
}

.opscore-gauges  { grid-column: 1 / 2; }
.opscore-nodes   { grid-column: 2 / 3; }
.opscore-activity { grid-column: 1 / -1; }

.opscore-panel-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.opscore-panel-head h3 {
    margin: 0;
    font-size: 1.02em;
    font-weight: 700;
    color: var(--text-primary);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.opscore-panel-head h3 i { width: 16px; height: 16px; color: var(--accent); }

.opscore-panel-sub {
    font-size: 0.78em;
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* Gauges */
.opscore-gauge-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.opscore-gauge { display: flex; flex-direction: column; gap: 6px; }

.opscore-gauge-bar {
    height: 8px;
    border-radius: 999px;
    background: rgba(110, 117, 130, 0.14);
    overflow: hidden;
}

.opscore-gauge-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #2d88ff, #6366f1);
    border-radius: 999px;
    transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.opscore-gauge-fill.warn { background: linear-gradient(90deg, #f59e0b, #ef4444); }
.opscore-gauge-fill.crit { background: linear-gradient(90deg, #ef4444, #b91c1c); }

.opscore-gauge-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.78em;
    color: var(--text-secondary);
    font-weight: 600;
}

.opscore-gauge-meta span:last-child { color: var(--text-primary); font-variant-numeric: tabular-nums; }

/* Node list */
.opscore-node-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    max-height: 260px;
    overflow-y: auto;
    padding-right: 4px;
}

.opscore-node {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 10px;
    background: rgba(110, 117, 130, 0.05);
    border: 1px solid var(--border-color);
    font-size: 0.85em;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.opscore-node:hover { background: rgba(45, 136, 255, 0.06); border-color: rgba(45, 136, 255, 0.3); }

.opscore-node-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    background: #16a34a;
    box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.6);
    animation: opscoreLivePulse 2.2s ease-out infinite;
}
.opscore-node-dot.warn { background: #f59e0b; animation-name: opscoreLivePulseY; }
.opscore-node-dot.down { background: #ef4444; animation-name: opscoreLivePulseR; }

@keyframes opscoreLivePulseY {
    0% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.6); }
    70% { box-shadow: 0 0 0 6px rgba(245, 158, 11, 0); }
    100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
}
@keyframes opscoreLivePulseR {
    0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.6); }
    70% { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
    100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.opscore-node-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

.opscore-node-name {
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.opscore-node-meta {
    font-size: 0.78em;
    color: var(--text-secondary);
}

.opscore-node-load {
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.78em;
    color: var(--text-primary);
    font-weight: 700;
    margin-left: auto;
}

/* Activity panel — uses existing .activity-log-container for the list */
.opscore-activity .activity-log-container {
    background: #0a0e14;
    border-color: #1e293b;
    max-height: 320px;
}

@media (max-width: 900px) {
    .opscore-grid { grid-template-columns: 1fr; }
    .opscore-gauges, .opscore-nodes, .opscore-activity { grid-column: 1 / -1; }
    .opscore-gauge-row { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 560px) {
    .opscore-hero { flex-direction: column; align-items: flex-start; }
    .opscore-hero-right { align-items: flex-start; }
    .opscore-gauge-row { grid-template-columns: 1fr; }
    .opscore-node-list { grid-template-columns: 1fr; }
}

/* === Achievements: Coming Soon Placeholder === */
.achievements-coming-soon {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 60px 24px;
    border: 1px dashed var(--border-color);
    border-radius: var(--border-radius-large);
    background: var(--color-background-light);
    margin-top: 16px;
}

.achievements-coming-soon .coming-soon-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: rgba(45, 136, 255, 0.1);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 18px;
}

.achievements-coming-soon .coming-soon-icon i {
    width: 36px;
    height: 36px;
}

.achievements-coming-soon h3 {
    font-size: 1.4em;
    color: var(--text-primary);
    margin: 0 0 10px;
}

.achievements-coming-soon p {
    max-width: 480px;
    font-size: 0.95em;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0 0 8px;
}

.achievements-coming-soon .coming-soon-sorry {
    font-style: italic;
    color: var(--text-secondary);
    margin-top: 12px;
}

/* === Consent Modal (Privacy Policy + Terms & Conditions) === */
.consent-overlay {
    z-index: 11000;
    background-color: rgba(0, 0, 0, 0.72);
}

.consent-box {
    max-width: 720px;
    width: 92%;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.consent-header {
    padding: 18px 24px;
}

.consent-header h3 {
    font-size: 1.2em;
}

.consent-tabs {
    display: flex;
    gap: 8px;
    padding: 12px 24px 0;
    border-bottom: 1px solid var(--border-color);
}

.consent-tab {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.92em;
    font-weight: 600;
    padding: 10px 12px;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.consent-tab i {
    width: 16px;
    height: 16px;
}

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

.consent-tab.active {
    color: var(--accent-color, #4f46e5);
    border-bottom-color: var(--accent-color, #4f46e5);
}

.consent-body {
    padding: 18px 24px;
    overflow-y: auto;
    flex: 1 1 auto;
    font-size: 0.92em;
    line-height: 1.6;
}

.consent-doc.hidden {
    display: none;
}

.consent-doc h4 {
    margin: 18px 0 6px;
    font-size: 1em;
    color: var(--text-primary);
    font-weight: 700;
}

.consent-doc p,
.consent-doc ul {
    margin: 0 0 10px;
    color: var(--text-primary);
}

.consent-doc ul {
    padding-left: 20px;
}

.consent-doc li {
    margin-bottom: 4px;
}

.consent-doc a {
    color: var(--accent-color, #4f46e5);
    text-decoration: underline;
}

.consent-meta {
    color: var(--text-secondary);
    font-size: 0.85em;
    margin-bottom: 12px;
}

.consent-checks {
    padding: 14px 24px 0;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.consent-check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 0.9em;
    color: var(--text-primary);
    cursor: pointer;
    line-height: 1.4;
}

.consent-check input[type="checkbox"] {
    margin-top: 2px;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    cursor: pointer;
    accent-color: var(--accent-color, #4f46e5);
}

.consent-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 24px;
}

.consent-footer .btn-primary[disabled] {
    opacity: 0.55;
    cursor: not-allowed;
}

.consent-view-close {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 24px;
}

.consent-view-close.hidden {
    display: none;
}

.legal-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 8px;
}

.legal-link-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.legal-link-btn i {
    width: 16px;
    height: 16px;
}

/* Acceptance badges in the User List */
.consent-badge {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1px;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 0.74em;
    font-weight: 600;
    line-height: 1.15;
    white-space: nowrap;
}

.consent-badge small {
    font-size: 0.72em;
    font-weight: 500;
    opacity: 0.85;
}

.consent-badge.consent-yes {
    background: rgba(34, 197, 94, 0.14);
    color: #15803d;
    border: 1px solid rgba(34, 197, 94, 0.35);
}

.consent-badge.consent-no {
    background: rgba(239, 68, 68, 0.12);
    color: #b91c1c;
    border: 1px solid rgba(239, 68, 68, 0.32);
}

[data-theme="dark"] .consent-badge.consent-yes {
    color: #4ade80;
    background: rgba(34, 197, 94, 0.18);
}

[data-theme="dark"] .consent-badge.consent-no {
    color: #fca5a5;
    background: rgba(239, 68, 68, 0.18);
}

/* Compact icon-only consent badge for the User List */
.consent-badge-mini {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    font-size: 0.78em;
    font-weight: 700;
    cursor: help;
}
.consent-badge-mini.consent-yes {
    background: rgba(34, 197, 94, 0.16);
    color: #15803d;
}
.consent-badge-mini.consent-no {
    background: rgba(239, 68, 68, 0.15);
    color: #b91c1c;
}
[data-theme="dark"] .consent-badge-mini.consent-yes { color: #4ade80; }
[data-theme="dark"] .consent-badge-mini.consent-no { color: #fca5a5; }

/* Last Login column */
.last-login {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1px;
    font-size: 0.82em;
    color: var(--text-primary);
    line-height: 1.2;
    white-space: nowrap;
    position: relative;
    padding-left: 0;
}

.last-login.last-login-online {
    padding-left: 14px;
}

.last-login .last-login-dot {
    position: absolute;
    left: 0;
    top: 6px;
}

.last-login .last-login-method {
    color: var(--text-secondary);
    font-size: 0.78em;
    font-weight: 500;
    opacity: 0.85;
}

.last-login.last-login-online .last-login-relative {
    color: #15803d;
    font-weight: 600;
}

[data-theme="dark"] .last-login.last-login-online .last-login-relative {
    color: #4ade80;
}

.last-login-never {
    color: var(--text-secondary);
    font-style: italic;
    opacity: 0.75;
}

/* Generic live pulse dot — used in the table header and on online users. */
.live-pulse {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: 6px;
    font-size: 0.65em;
    font-weight: 700;
    color: #15803d;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    vertical-align: middle;
}

[data-theme="dark"] .live-pulse {
    color: #4ade80;
}

.live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.6);
    animation: live-dot-pulse 1.8s ease-out infinite;
    flex-shrink: 0;
    display: inline-block;
}

@keyframes live-dot-pulse {
    0%   { box-shadow: 0 0 0 0   rgba(34, 197, 94, 0.55); }
    70%  { box-shadow: 0 0 0 8px rgba(34, 197, 94, 0);    }
    100% { box-shadow: 0 0 0 0   rgba(34, 197, 94, 0);    }
}

@media (max-width: 600px) {
    .consent-box {
        max-height: 94vh;
        width: 96%;
    }
    .consent-tabs {
        padding: 10px 14px 0;
    }
    .consent-body,
    .consent-checks,
    .consent-footer,
    .consent-header {
        padding-left: 16px;
        padding-right: 16px;
    }
    .consent-footer {
        flex-direction: column-reverse;
    }
    .consent-footer .btn-primary,
    .consent-footer .btn-secondary {
        width: 100%;
    }
}

/* =========================================================================
   Rate Us modal (cute end-of-chat rating prompt)
   ========================================================================= */
.rate-us-overlay {
    z-index: 10010;
}

.rate-us-box {
    max-width: 460px;
    width: calc(100% - 32px);
    padding: 0;
    border-radius: 22px;
    overflow: hidden;
    position: relative;
    background: linear-gradient(160deg, #fff7ed 0%, #fdf2f8 60%, #eef2ff 100%);
    box-shadow: 0 30px 70px rgba(99, 102, 241, 0.25);
}

[data-theme="dark"] .rate-us-box {
    background: linear-gradient(160deg, #2a1a44 0%, #2b1135 60%, #1a1d3a 100%);
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.5);
}

.rate-us-confetti {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 0;
}
.rate-us-confetti span {
    position: absolute;
    font-size: 18px;
    opacity: 0.7;
    animation: rateUsFloat 6s ease-in-out infinite;
}
.rate-us-confetti span:nth-child(1) { top: 12%;  left: 8%;  animation-delay: 0s;   }
.rate-us-confetti span:nth-child(2) { top: 22%;  right: 10%; animation-delay: 1.2s; }
.rate-us-confetti span:nth-child(3) { top: 68%;  left: 12%; animation-delay: 2.4s; }
.rate-us-confetti span:nth-child(4) { top: 78%;  right: 14%; animation-delay: 0.8s; }
.rate-us-confetti span:nth-child(5) { top: 45%;  left: 50%; animation-delay: 1.8s; }

@keyframes rateUsFloat {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50%      { transform: translateY(-10px) rotate(8deg); }
}

.rate-us-header {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 28px 24px 12px;
}

.rate-us-emoji {
    font-size: 44px;
    line-height: 1;
    margin-bottom: 8px;
    animation: rateUsBounce 2.2s ease-in-out infinite;
}

@keyframes rateUsBounce {
    0%, 100% { transform: translateY(0) scale(1); }
    50%      { transform: translateY(-6px) scale(1.06); }
}

.rate-us-header h3 {
    margin: 0;
    font-size: 1.25rem;
    color: #1f2937;
}

[data-theme="dark"] .rate-us-header h3 {
    color: #f8fafc;
}

.rate-us-sub {
    margin: 6px 0 0;
    font-size: 0.92rem;
    color: #6b7280;
}

[data-theme="dark"] .rate-us-sub {
    color: #cbd5e1;
}

.rate-us-body {
    position: relative;
    z-index: 1;
    padding: 4px 24px 16px;
    text-align: center;
}

.rate-us-stars {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 8px 0 6px;
}

.rate-us-star {
    font-size: 38px;
    line-height: 1;
    color: #d1d5db;
    cursor: pointer;
    transition: transform 0.15s ease, color 0.15s ease;
    user-select: none;
}

[data-theme="dark"] .rate-us-star {
    color: #4b5563;
}

.rate-us-star:hover {
    transform: scale(1.18);
}

.rate-us-star.active {
    color: #f59e0b;
    text-shadow: 0 2px 8px rgba(245, 158, 11, 0.45);
}

.rate-us-label {
    min-height: 1.3em;
    font-size: 0.95rem;
    color: #6b7280;
    margin-bottom: 10px;
}

[data-theme="dark"] .rate-us-label {
    color: #cbd5e1;
}

.rate-us-comment {
    width: 100%;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.4);
    background: rgba(255, 255, 255, 0.7);
    font-family: inherit;
    font-size: 0.92rem;
    resize: vertical;
    color: inherit;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.rate-us-comment:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

[data-theme="dark"] .rate-us-comment {
    background: rgba(15, 23, 42, 0.55);
    border-color: rgba(99, 102, 241, 0.45);
}

.rate-us-footer {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 4px 24px 22px;
}

.rate-us-footer .btn-primary[disabled] {
    opacity: 0.55;
    cursor: not-allowed;
}

@media (max-width: 480px) {
    .rate-us-star { font-size: 32px; }
    .rate-us-footer { flex-direction: column-reverse; }
    .rate-us-footer .btn-primary,
    .rate-us-footer .btn-secondary { width: 100%; }
}

/* =========================================================================
   Data Collection (admin) page
   ========================================================================= */
.dc-source-tabs {
    display: flex;
    gap: 6px;
    padding: 4px;
    margin: 18px 0 8px;
    background: rgba(99, 102, 241, 0.08);
    border-radius: 14px;
    width: fit-content;
}

[data-theme="dark"] .dc-source-tabs {
    background: rgba(99, 102, 241, 0.18);
}

.dc-source-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 10px;
    border: none;
    background: transparent;
    color: #4b5563;
    font-weight: 600;
    font-size: 0.92rem;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

[data-theme="dark"] .dc-source-tab {
    color: #cbd5e1;
}

.dc-source-tab i {
    width: 16px;
    height: 16px;
}

.dc-source-tab:hover {
    background: rgba(255, 255, 255, 0.45);
}

[data-theme="dark"] .dc-source-tab:hover {
    background: rgba(255, 255, 255, 0.08);
}

.dc-source-tab.active {
    background: var(--card-bg, #ffffff);
    color: #4338ca;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.15);
}

[data-theme="dark"] .dc-source-tab.active {
    background: rgba(15, 23, 42, 0.85);
    color: #c7d2fe;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
}

.dc-source-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 20px;
    padding: 0 7px;
    border-radius: 999px;
    background: rgba(99, 102, 241, 0.2);
    color: #4338ca;
    font-size: 0.78rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

[data-theme="dark"] .dc-source-count {
    background: rgba(99, 102, 241, 0.35);
    color: #e0e7ff;
}

.dc-source-tab.active .dc-source-count {
    background: rgba(99, 102, 241, 0.95);
    color: #ffffff;
}

@media (max-width: 600px) {
    .dc-source-tabs { width: 100%; }
    .dc-source-tab { flex: 1; justify-content: center; padding: 8px 10px; }
}

/* Small per-row source label inside session list */
.dc-source-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.dc-source-badge.chat {
    background: rgba(99, 102, 241, 0.15);
    color: #4338ca;
}

.dc-source-badge.mihu {
    background: rgba(236, 72, 153, 0.18);
    color: #be185d;
}

[data-theme="dark"] .dc-source-badge.chat {
    background: rgba(99, 102, 241, 0.32);
    color: #c7d2fe;
}

[data-theme="dark"] .dc-source-badge.mihu {
    background: rgba(236, 72, 153, 0.32);
    color: #fbcfe8;
}

.dc-grid {
    grid-template-columns: 1fr 1fr;
}

.dc-sessions-panel,
.dc-feedback-panel {
    grid-column: 1 / -1;
}

.dc-session-filters {
    display: flex;
    gap: 8px;
    align-items: center;
}

.dc-session-filters input[type="search"],
.dc-session-filters select {
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: rgba(255, 255, 255, 0.6);
    font-size: 0.85rem;
    color: inherit;
}

[data-theme="dark"] .dc-session-filters input[type="search"],
[data-theme="dark"] .dc-session-filters select {
    background: rgba(15, 23, 42, 0.4);
    border-color: rgba(99, 102, 241, 0.4);
}

.dc-rating-dist {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px 4px;
}

.dc-rating-row {
    display: grid;
    grid-template-columns: 90px 1fr 40px;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
}

.dc-rating-stars {
    color: #f59e0b;
    letter-spacing: 1px;
}

.dc-rating-stars-dim {
    color: rgba(148, 163, 184, 0.45);
}

.dc-rating-bar {
    height: 10px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.18);
    overflow: hidden;
}

.dc-rating-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #fbbf24, #f59e0b);
    border-radius: 999px;
    transition: width 0.4s ease;
}

.dc-rating-count {
    text-align: right;
    font-variant-numeric: tabular-nums;
    color: #6b7280;
}

[data-theme="dark"] .dc-rating-count { color: #cbd5e1; }

.dc-topics {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 14px 4px;
    align-items: center;
}

.dc-topic-chip {
    padding: 5px 12px;
    border-radius: 999px;
    background: rgba(99, 102, 241, 0.12);
    color: #4338ca;
    font-weight: 500;
    line-height: 1.4;
}

.dc-topic-chip em {
    font-style: normal;
    opacity: 0.6;
    font-size: 0.8em;
    margin-left: 4px;
}

[data-theme="dark"] .dc-topic-chip {
    background: rgba(99, 102, 241, 0.25);
    color: #c7d2fe;
}

.dc-sessions-list,
.dc-feedback-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 480px;
    overflow-y: auto;
    padding: 6px 4px;
}

.dc-empty {
    text-align: center;
    color: #94a3b8;
    padding: 24px 8px;
    font-size: 0.9rem;
}

.dc-session {
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.55);
    overflow: hidden;
}

[data-theme="dark"] .dc-session {
    background: rgba(15, 23, 42, 0.4);
    border-color: rgba(99, 102, 241, 0.3);
}

.dc-session summary {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 10px 14px;
    cursor: pointer;
    list-style: none;
    font-size: 0.9rem;
}

.dc-session summary::-webkit-details-marker { display: none; }
.dc-session summary::marker { display: none; }

.dc-session-user {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    flex: 0 0 auto;
}

.dc-session-user i {
    width: 14px;
    height: 14px;
}

.dc-session-meta {
    flex: 1;
    color: #6b7280;
    font-size: 0.82rem;
}

[data-theme="dark"] .dc-session-meta { color: #94a3b8; }

.dc-session-rating {
    color: #f59e0b;
    letter-spacing: 1px;
    font-size: 0.95rem;
}

.dc-session-rating.dim {
    color: #94a3b8;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.dc-transcript {
    border-top: 1px solid rgba(148, 163, 184, 0.2);
    padding: 12px 14px;
    background: rgba(248, 250, 252, 0.7);
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 0.88rem;
}

[data-theme="dark"] .dc-transcript {
    background: rgba(2, 6, 23, 0.35);
}

.dc-msg {
    padding: 8px 10px;
    border-radius: 10px;
    line-height: 1.45;
    word-break: break-word;
}

.dc-msg-user {
    background: rgba(99, 102, 241, 0.1);
    align-self: flex-start;
}

.dc-msg-bot {
    background: rgba(16, 185, 129, 0.1);
    align-self: flex-start;
}

[data-theme="dark"] .dc-msg-user { background: rgba(99, 102, 241, 0.22); }
[data-theme="dark"] .dc-msg-bot  { background: rgba(16, 185, 129, 0.22); }

.dc-session-comment {
    padding: 8px 14px 12px;
    font-style: italic;
    color: #6b7280;
    font-size: 0.88rem;
}

[data-theme="dark"] .dc-session-comment { color: #cbd5e1; }

.dc-feedback-item {
    padding: 10px 14px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.55);
    border: 1px solid rgba(148, 163, 184, 0.25);
}

[data-theme="dark"] .dc-feedback-item {
    background: rgba(15, 23, 42, 0.4);
    border-color: rgba(99, 102, 241, 0.3);
}

.dc-feedback-head {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 4px;
    font-size: 0.88rem;
}

.dc-feedback-user {
    font-weight: 600;
}

.dc-feedback-when {
    margin-left: auto;
    color: #94a3b8;
    font-size: 0.78rem;
}

.dc-feedback-comment {
    font-size: 0.9rem;
    color: #374151;
}

.dc-feedback-comment.dim {
    color: #94a3b8;
    font-style: italic;
}

[data-theme="dark"] .dc-feedback-comment { color: #e2e8f0; }

@media (max-width: 900px) {
    .dc-grid { grid-template-columns: 1fr; }
    .dc-session-filters { flex-direction: column; align-items: stretch; }
    .dc-rating-row { grid-template-columns: 70px 1fr 32px; }
}

/* =========================================================================
   Issues / Support page
   ========================================================================= */

.nav-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 18px;
    padding: 0 6px;
    margin-left: 6px;
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.issues-card {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.issues-hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.issues-hero h2 {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 4px;
}

.issues-hero h2 i {
    width: 22px;
    height: 22px;
}

.issues-sub {
    margin: 0;
    color: #6b7280;
    font-size: 0.92rem;
}

[data-theme="dark"] .issues-sub { color: #cbd5e1; }

.issues-tabs {
    display: flex;
    gap: 6px;
    padding: 4px;
    background: rgba(99, 102, 241, 0.08);
    border-radius: 14px;
    width: fit-content;
    flex-wrap: wrap;
}

[data-theme="dark"] .issues-tabs { background: rgba(99, 102, 241, 0.18); }

.issues-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 10px;
    border: none;
    background: transparent;
    color: #4b5563;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

[data-theme="dark"] .issues-tab { color: #cbd5e1; }

.issues-tab i { width: 16px; height: 16px; }

.issues-tab:hover { background: rgba(255, 255, 255, 0.45); }

[data-theme="dark"] .issues-tab:hover { background: rgba(255, 255, 255, 0.08); }

.issues-tab.active {
    background: var(--card-bg, #ffffff);
    color: #4338ca;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.15);
}

[data-theme="dark"] .issues-tab.active {
    background: rgba(15, 23, 42, 0.85);
    color: #c7d2fe;
}

.issues-tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 20px;
    padding: 0 7px;
    border-radius: 999px;
    background: rgba(99, 102, 241, 0.2);
    color: #4338ca;
    font-size: 0.75rem;
    font-weight: 700;
}

[data-theme="dark"] .issues-tab-count {
    background: rgba(99, 102, 241, 0.35);
    color: #e0e7ff;
}

.issues-tab.active .issues-tab-count {
    background: rgba(99, 102, 241, 0.95);
    color: #fff;
}

.issues-tab-pane {
    margin-top: 6px;
}

/* Form */

.issue-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 720px;
}

.issue-form-row.two-cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.issue-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.9rem;
}

.issue-field.grow { flex: 1; }

.issue-field > span {
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #374151;
}

.issue-field > span em {
    color: #ef4444;
    font-style: normal;
    margin-left: 2px;
}

[data-theme="dark"] .issue-field > span { color: #e2e8f0; }

.issue-field input,
.issue-field select,
.issue-field textarea {
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid rgba(148, 163, 184, 0.4);
    background: rgba(255, 255, 255, 0.7);
    color: inherit;
    font-family: inherit;
    font-size: 0.95rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

[data-theme="dark"] .issue-field input,
[data-theme="dark"] .issue-field select,
[data-theme="dark"] .issue-field textarea {
    background: rgba(15, 23, 42, 0.55);
    border-color: rgba(99, 102, 241, 0.4);
}

.issue-field input:focus,
.issue-field select:focus,
.issue-field textarea:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.issue-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.issue-priority-note {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 6px 0 0;
    padding: 6px 10px;
    border-radius: 8px;
    background: rgba(99, 102, 241, 0.1);
    color: #4338ca;
    font-size: 0.82rem;
}

.issue-priority-note i { width: 14px; height: 14px; }

[data-theme="dark"] .issue-priority-note {
    background: rgba(99, 102, 241, 0.2);
    color: #c7d2fe;
}

/* Issue list + cards */

.issues-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-right: 4px;
}

.issues-triage-filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.issues-triage-filters input,
.issues-triage-filters select {
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid rgba(148, 163, 184, 0.4);
    background: rgba(255, 255, 255, 0.7);
    font-size: 0.88rem;
    color: inherit;
}

[data-theme="dark"] .issues-triage-filters input,
[data-theme="dark"] .issues-triage-filters select {
    background: rgba(15, 23, 42, 0.55);
    border-color: rgba(99, 102, 241, 0.4);
}

.issues-triage-filters input { flex: 1; min-width: 220px; }

.issue-card {
    border: 1px solid rgba(148, 163, 184, 0.3);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.65);
    overflow: hidden;
}

[data-theme="dark"] .issue-card {
    background: rgba(15, 23, 42, 0.45);
    border-color: rgba(99, 102, 241, 0.3);
}

.issue-card summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    font-size: 0.92rem;
    position: sticky;
    top: 0;
    z-index: 2;
    background: inherit;
    backdrop-filter: saturate(180%) blur(4px);
}

.issue-card[open] summary {
    border-bottom: 1px solid rgba(148, 163, 184, 0.25);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.issue-card summary::after {
    content: "▾";
    margin-left: 6px;
    color: #94a3b8;
    font-size: 0.85rem;
    transition: transform 0.2s ease;
}

.issue-card[open] summary::after {
    transform: rotate(180deg);
}

.issue-collapse-row {
    display: flex;
    justify-content: flex-end;
    margin-top: 8px;
}

.issue-card summary::-webkit-details-marker { display: none; }
.issue-card summary::marker { display: none; }

.issue-card-title {
    font-weight: 700;
    flex: 1;
    min-width: 180px;
}

.issue-card-when {
    color: #94a3b8;
    font-size: 0.78rem;
    margin-left: auto;
}

.issue-status {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: rgba(99, 102, 241, 0.15);
    color: #4338ca;
}

.issue-status.status-open          { background: rgba(59, 130, 246, 0.15);  color: #1d4ed8; }
.issue-status.status-assigned      { background: rgba(245, 158, 11, 0.18);  color: #b45309; }
.issue-status.status-in-progress   { background: rgba(139, 92, 246, 0.18);  color: #6d28d9; }
.issue-status.status-awaiting-review { background: rgba(236, 72, 153, 0.18); color: #be185d; }
.issue-status.status-resolved      { background: rgba(16, 185, 129, 0.18);  color: #047857; }
.issue-status.status-closed        { background: rgba(148, 163, 184, 0.25); color: #475569; }

[data-theme="dark"] .issue-status.status-open          { background: rgba(59, 130, 246, 0.32);  color: #bfdbfe; }
[data-theme="dark"] .issue-status.status-assigned      { background: rgba(245, 158, 11, 0.32);  color: #fde68a; }
[data-theme="dark"] .issue-status.status-in-progress   { background: rgba(139, 92, 246, 0.35);  color: #ddd6fe; }
[data-theme="dark"] .issue-status.status-awaiting-review { background: rgba(236, 72, 153, 0.35); color: #fbcfe8; }
[data-theme="dark"] .issue-status.status-resolved      { background: rgba(16, 185, 129, 0.32);  color: #a7f3d0; }
[data-theme="dark"] .issue-status.status-closed        { background: rgba(148, 163, 184, 0.4);  color: #e2e8f0; }

.issue-chip {
    padding: 3px 9px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.2);
    font-size: 0.75rem;
    font-weight: 600;
}

.issue-chip.priority-high   { background: rgba(239, 68, 68, 0.18);  color: #b91c1c; }
.issue-chip.priority-normal { background: rgba(245, 158, 11, 0.18); color: #b45309; }
.issue-chip.priority-low    { background: rgba(16, 185, 129, 0.18); color: #047857; }

[data-theme="dark"] .issue-chip.priority-high   { background: rgba(239, 68, 68, 0.35);  color: #fecaca; }
[data-theme="dark"] .issue-chip.priority-normal { background: rgba(245, 158, 11, 0.32); color: #fde68a; }
[data-theme="dark"] .issue-chip.priority-low    { background: rgba(16, 185, 129, 0.32); color: #a7f3d0; }

.issue-body {
    padding: 0 16px 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    border-top: 1px solid rgba(148, 163, 184, 0.2);
}

.issue-meta-row {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: #6b7280;
    padding-top: 8px;
}

[data-theme="dark"] .issue-meta-row { color: #cbd5e1; }

.issue-meta-row i { width: 14px; height: 14px; }

.issue-description {
    margin: 4px 0 0;
    padding: 10px 12px;
    background: rgba(248, 250, 252, 0.7);
    border-radius: 10px;
    font-size: 0.92rem;
    white-space: pre-wrap;
    line-height: 1.5;
}

[data-theme="dark"] .issue-description { background: rgba(2, 6, 23, 0.45); }

.issue-resolution {
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(16, 185, 129, 0.12);
    color: #065f46;
    font-size: 0.92rem;
}

[data-theme="dark"] .issue-resolution { background: rgba(16, 185, 129, 0.25); color: #d1fae5; }

.issue-note {
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 0.85rem;
    line-height: 1.4;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.issue-note.info { background: rgba(59, 130, 246, 0.12); color: #1e40af; }
.issue-note.warn { background: rgba(245, 158, 11, 0.18); color: #92400e; }
.issue-note.ok   { background: rgba(16, 185, 129, 0.18); color: #065f46; }
.issue-note.muted {
    background: rgba(148, 163, 184, 0.16);
    color: var(--text-secondary);
    font-size: 0.82rem;
}
.issue-note.muted i { width: 14px; height: 14px; }

[data-theme="dark"] .issue-note.info { background: rgba(59, 130, 246, 0.25); color: #dbeafe; }
[data-theme="dark"] .issue-note.warn { background: rgba(245, 158, 11, 0.3); color: #fde68a; }
[data-theme="dark"] .issue-note.ok   { background: rgba(16, 185, 129, 0.3); color: #d1fae5; }
[data-theme="dark"] .issue-note.muted { background: rgba(148, 163, 184, 0.28); color: #e2e8f0; }

.issue-action-block {
    margin-top: 6px;
    padding: 12px;
    background: rgba(99, 102, 241, 0.06);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

[data-theme="dark"] .issue-action-block { background: rgba(99, 102, 241, 0.14); }

.issue-action-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.issue-admin-row {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.issue-review-block {
    padding: 12px;
    background: rgba(236, 72, 153, 0.08);
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

[data-theme="dark"] .issue-review-block { background: rgba(236, 72, 153, 0.18); }

.issue-review-block h4 {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    font-size: 0.95rem;
}

.issue-proposed {
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.65);
    border-radius: 8px;
    font-size: 0.9rem;
    white-space: pre-wrap;
    line-height: 1.45;
}

[data-theme="dark"] .issue-proposed { background: rgba(15, 23, 42, 0.6); }

.issue-log {
    margin-top: 4px;
    font-size: 0.82rem;
    color: #6b7280;
}

.issue-log summary { cursor: pointer; }

.issue-log ul {
    list-style: none;
    margin: 6px 0 0;
    padding: 0 0 0 6px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.issue-log-when {
    color: #94a3b8;
    margin-right: 6px;
    font-variant-numeric: tabular-nums;
}

[data-theme="dark"] .issue-log { color: #cbd5e1; }

@media (max-width: 700px) {
    .issue-form-row.two-cols { grid-template-columns: 1fr; }
    .issues-tabs { width: 100%; }
    .issues-tab { flex: 1; justify-content: center; padding: 8px 10px; }
    .issue-card-when { width: 100%; text-align: left; margin-left: 0; }
}

/* Ticket + verdict tags on issue cards */
.issue-ticket {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 9px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.07);
    color: #1f2937;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.issue-ticket i { width: 12px; height: 12px; }

[data-theme="dark"] .issue-ticket {
    background: rgba(255, 255, 255, 0.1);
    color: #e2e8f0;
}

.issue-fairness {
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.issue-fairness.fair { background: rgba(16, 185, 129, 0.2); color: #047857; }
.issue-fairness.fake { background: rgba(239, 68, 68, 0.2); color: #b91c1c; }

[data-theme="dark"] .issue-fairness.fair { background: rgba(16, 185, 129, 0.35); color: #a7f3d0; }
[data-theme="dark"] .issue-fairness.fake { background: rgba(239, 68, 68, 0.35); color: #fecaca; }

.issue-verdict-row {
    align-items: center;
}

.issue-verdict-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    margin-right: 6px;
}

.verdict-btn.active.fair { background: rgba(16, 185, 129, 0.18); color: #047857; border-color: rgba(16, 185, 129, 0.4); }
.verdict-btn.active.fake { background: rgba(239, 68, 68, 0.18); color: #b91c1c; border-color: rgba(239, 68, 68, 0.4); }

.issue-verdict-note { font-size: 0.85rem; color: #6b7280; }
.issue-verdict-note.dim { font-style: italic; }
[data-theme="dark"] .issue-verdict-note { color: #cbd5e1; }

/* =========================================================================
   MentoraMiles rewards
   ========================================================================= */

.miles-card {
    margin: 0;
}

/* Single-column (mobile) — keep card spacing nice when stacked. */
@media (max-width: 980px) {
    .miles-card { margin-top: 0; }
    .miles-panels { grid-template-columns: 1fr 1fr; }
}

.miles-hero {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    flex-wrap: wrap;
}

.miles-hero h2 {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 4px;
}

.miles-tagline {
    margin: 0;
    color: #6b7280;
    max-width: 540px;
    font-size: 0.92rem;
}

[data-theme="dark"] .miles-tagline { color: #cbd5e1; }

.miles-pill {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    border-radius: 14px;
    background: linear-gradient(135deg, #6366f1, #ec4899);
    color: #fff;
    box-shadow: 0 12px 30px rgba(99, 102, 241, 0.3);
}

.miles-pill-pts {
    font-size: 1.6rem;
    font-weight: 800;
    line-height: 1;
}

.miles-pill-label {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    opacity: 0.85;
}

.miles-pill-muted {
    background: rgba(148, 163, 184, 0.25);
    color: #475569;
    box-shadow: none;
    padding: 8px 12px;
    font-size: 0.85rem;
    font-weight: 600;
    gap: 6px;
}

.miles-pill-muted i { width: 14px; height: 14px; }

.miles-not-enrolled {
    padding: 20px;
    border-radius: 14px;
    background: linear-gradient(160deg, rgba(99, 102, 241, 0.08), rgba(236, 72, 153, 0.08));
    margin-top: 14px;
}

.miles-not-enrolled h3 { margin: 0 0 6px; }

.miles-benefits {
    list-style: none;
    margin: 12px 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 0.92rem;
}

.miles-benefits li {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.miles-benefits i { width: 16px; height: 16px; color: #6366f1; }

[data-theme="dark"] .miles-not-enrolled {
    background: linear-gradient(160deg, rgba(99, 102, 241, 0.2), rgba(236, 72, 153, 0.2));
}

.miles-enrolled { margin-top: 14px; }

.miles-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.miles-stat {
    padding: 14px 16px;
    border-radius: 12px;
    background: rgba(99, 102, 241, 0.06);
    border: 1px solid rgba(99, 102, 241, 0.18);
}

[data-theme="dark"] .miles-stat {
    background: rgba(99, 102, 241, 0.15);
    border-color: rgba(99, 102, 241, 0.35);
}

.miles-stat-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 6px;
}

.miles-stat-label i { width: 14px; height: 14px; }

.miles-stat-value {
    font-size: 1.6rem;
    font-weight: 800;
    line-height: 1.1;
}

.miles-stat-value.tier-badge {
    display: inline-block;
    padding: 4px 14px;
    font-size: 1.05rem;
}

.miles-stat-sub {
    font-size: 0.78rem;
    color: #6b7280;
    margin-top: 4px;
}

[data-theme="dark"] .miles-stat-sub { color: #cbd5e1; }

.miles-progress-wrap {
    margin: 16px 0 6px;
}

.miles-progress-track {
    height: 10px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.2);
    overflow: hidden;
}

.miles-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #6366f1, #ec4899);
    border-radius: 999px;
    transition: width 0.6s ease;
}

.miles-progress-meta {
    margin-top: 6px;
    font-size: 0.85rem;
    color: #6b7280;
}

[data-theme="dark"] .miles-progress-meta { color: #cbd5e1; }

.miles-panels {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-top: 18px;
}

.miles-panel {
    padding: 14px 16px;
    background: var(--card-bg, #fff);
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.25);
}

[data-theme="dark"] .miles-panel {
    background: rgba(15, 23, 42, 0.4);
    border-color: rgba(99, 102, 241, 0.3);
}

.miles-panel h3 {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 10px;
    font-size: 1rem;
}

.miles-activity-panel { grid-column: 1 / -1; }

.miles-earn-list,
.miles-redeem-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.miles-earn-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    border-radius: 8px;
    background: rgba(99, 102, 241, 0.06);
    font-size: 0.9rem;
}

.miles-earn-list strong { color: #4338ca; }

[data-theme="dark"] .miles-earn-list li { background: rgba(99, 102, 241, 0.18); }
[data-theme="dark"] .miles-earn-list strong { color: #c7d2fe; }

.miles-redeem-list li {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(245, 158, 11, 0.08);
}

.miles-redeem-list li > div { flex: 1; }
.miles-redeem-list strong { display: block; font-size: 0.95rem; }
.miles-redeem-list small { display: block; color: #6b7280; font-size: 0.8rem; margin-top: 2px; }

[data-theme="dark"] .miles-redeem-list li { background: rgba(245, 158, 11, 0.18); }
[data-theme="dark"] .miles-redeem-list small { color: #cbd5e1; }

.miles-expiry-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 220px;
    overflow-y: auto;
}

.miles-expiry-row,
.miles-activity-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    background: rgba(99, 102, 241, 0.05);
    font-size: 0.88rem;
}

[data-theme="dark"] .miles-expiry-row,
[data-theme="dark"] .miles-activity-row { background: rgba(99, 102, 241, 0.15); }

.miles-expiry-row.urgent { background: rgba(239, 68, 68, 0.12); }
[data-theme="dark"] .miles-expiry-row.urgent { background: rgba(239, 68, 68, 0.25); }

.miles-expiry-row.never-expires { background: rgba(168, 85, 247, 0.12); }
[data-theme="dark"] .miles-expiry-row.never-expires { background: rgba(168, 85, 247, 0.25); }

.btn-small {
    padding: 6px 12px;
    font-size: 0.82rem;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-small i { width: 14px; height: 14px; }

.miles-leave-row {
    margin-top: 16px;
    padding: 12px 14px;
    border-radius: 10px;
    background: rgba(148, 163, 184, 0.08);
    border: 1px solid rgba(148, 163, 184, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

[data-theme="dark"] .miles-leave-row {
    background: rgba(148, 163, 184, 0.15);
    border-color: rgba(148, 163, 184, 0.35);
}

.miles-leave-text {
    flex: 1;
    min-width: 220px;
    font-size: 0.85rem;
    color: #6b7280;
}

[data-theme="dark"] .miles-leave-text { color: #cbd5e1; }

.btn-link-danger {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #b91c1c;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease;
}

.btn-link-danger:hover {
    background: rgba(239, 68, 68, 0.1);
}

.btn-link-danger i { width: 14px; height: 14px; }

[data-theme="dark"] .btn-link-danger {
    color: #fecaca;
    border-color: rgba(239, 68, 68, 0.6);
}

[data-theme="dark"] .btn-link-danger:hover {
    background: rgba(239, 68, 68, 0.2);
}

.miles-testing-row,
.issues-testing-row {
    margin-top: 16px;
    padding: 10px 14px;
    border-radius: 10px;
    background: rgba(239, 68, 68, 0.07);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.issues-testing-row { margin: 0 0 12px; }

.miles-testing-label {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #b91c1c;
    font-weight: 700;
}

[data-theme="dark"] .miles-testing-row,
[data-theme="dark"] .issues-testing-row { background: rgba(239, 68, 68, 0.18); }
[data-theme="dark"] .miles-testing-label { color: #fecaca; }

.miles-expiry-pts,
.miles-activity-pts {
    flex: 0 0 70px;
    font-weight: 800;
    color: #4338ca;
}

.miles-activity-row.spend .miles-activity-pts { color: #b91c1c; }

[data-theme="dark"] .miles-expiry-pts { color: #c7d2fe; }
[data-theme="dark"] .miles-activity-row.earn .miles-activity-pts { color: #c7d2fe; }

.miles-expiry-meta,
.miles-activity-meta { flex: 1; }
.miles-expiry-meta small,
.miles-activity-meta small { display: block; color: #6b7280; font-size: 0.78rem; margin-top: 2px; }

[data-theme="dark"] .miles-expiry-meta small,
[data-theme="dark"] .miles-activity-meta small { color: #cbd5e1; }

.miles-meta { margin: 8px 0 0; font-size: 0.78rem; color: #6b7280; }
[data-theme="dark"] .miles-meta { color: #cbd5e1; }

.miles-activity-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 280px;
    overflow-y: auto;
}

/* Tier badge colours (existing tier-platinum class plus new tiers) */
.tier-badge.tier-standard { background: rgba(148, 163, 184, 0.3); color: #475569; }
.tier-badge.tier-silver   { background: linear-gradient(135deg, #cbd5e1, #94a3b8); color: #1e293b; }
.tier-badge.tier-gold     { background: linear-gradient(135deg, #fde68a, #f59e0b); color: #78350f; }
.tier-badge.tier-platinum { background: linear-gradient(135deg, #e9d5ff, #a78bfa); color: #4c1d95; }

[data-theme="dark"] .tier-badge.tier-standard { color: #e2e8f0; }
[data-theme="dark"] .tier-badge.tier-silver   { color: #f1f5f9; }

/* Golden profile frame redemption */
.profile-avatar-container.miles-framed .profile-avatar {
    box-shadow: 0 0 0 4px #fff, 0 0 0 8px #f59e0b, 0 0 24px rgba(245, 158, 11, 0.6);
    transition: box-shadow 0.4s ease;
}

@media (max-width: 900px) {
    .miles-stats-grid { grid-template-columns: 1fr 1fr; }
    .miles-panels { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
    .miles-stats-grid { grid-template-columns: 1fr; }
}

/* =========================================================================
   Profile page — redesigned hero + sectioned MentoraMiles
   ========================================================================= */

.profile-shell {
    max-width: 1180px;
    margin: 20px auto;
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.profile-hero {
    position: relative;
    overflow: hidden;
    padding: 0;
    border-radius: 22px;
    border: 1px solid var(--border-color);
}

.profile-hero-bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(1200px 200px at 0% 0%, rgba(99, 102, 241, 0.22), transparent 60%),
        radial-gradient(900px 200px at 100% 0%, rgba(236, 72, 153, 0.20), transparent 60%),
        linear-gradient(180deg, rgba(99, 102, 241, 0.08), rgba(236, 72, 153, 0.04));
    pointer-events: none;
}

[data-theme="dark"] .profile-hero-bg {
    background:
        radial-gradient(1200px 200px at 0% 0%, rgba(99, 102, 241, 0.35), transparent 60%),
        radial-gradient(900px 200px at 100% 0%, rgba(236, 72, 153, 0.30), transparent 60%),
        linear-gradient(180deg, rgba(15, 23, 42, 0.6), rgba(15, 23, 42, 0.2));
}

.profile-hero-inner {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 22px;
    align-items: center;
    padding: 28px 32px;
}

.profile-hero .profile-avatar-container {
    width: 96px;
    height: 96px;
    margin: 0;
}

.profile-hero-meta {
    min-width: 0;
}

.profile-hero-meta h2 {
    margin: 0 0 10px;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.1;
}

.profile-hero-meta h2[contenteditable="true"] {
    outline: 2px dashed var(--accent);
    padding: 4px 8px;
    border-radius: 8px;
}

.profile-hero-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 10px;
}

.profile-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid var(--border-color);
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    backdrop-filter: blur(6px);
}

.profile-chip i { width: 14px; height: 14px; }

[data-theme="dark"] .profile-chip {
    background: rgba(30, 41, 59, 0.6);
    color: var(--text-primary);
}

.profile-hero-sub {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
    max-width: 580px;
}

.profile-hero-actions {
    display: flex;
    gap: 10px;
}

.profile-hero-actions .btn-secondary i { width: 16px; height: 16px; }

@media (max-width: 760px) {
    .profile-hero-inner {
        grid-template-columns: 1fr;
        text-align: center;
        padding: 24px 20px;
    }
    .profile-hero .profile-avatar-container { margin: 0 auto; }
    .profile-hero-chips { justify-content: center; }
    .profile-hero-sub { margin: 0 auto; }
    .profile-hero-actions { justify-content: center; }
}

.miles-card {
    border-radius: 22px;
    padding: 26px 28px;
}

@media (max-width: 720px) {
    .miles-card { padding: 20px 18px; }
}

/* Tabs inside the Miles card */
.miles-tabs {
    display: flex;
    gap: 6px;
    padding: 5px;
    margin: 22px 0 16px;
    background: var(--bg-soft);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    overflow-x: auto;
}

.miles-tab {
    flex: 1 1 0;
    min-width: 100px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 14px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.88rem;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.18s ease;
}

.miles-tab i { width: 15px; height: 15px; }

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

.miles-tab.active {
    background: var(--accent-gradient, linear-gradient(135deg, #6366f1, #ec4899));
    color: #fff;
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.25);
}

[data-theme="dark"] .miles-tab.active { color: #fff; }

.miles-tab-pane.hidden { display: none; }

.miles-activity-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.miles-activity-col h4 {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 10px;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.miles-activity-col h4 i { width: 16px; height: 16px; }

@media (max-width: 760px) {
    .miles-activity-split { grid-template-columns: 1fr; }
}

/* Collapsed testing tools */
.miles-testing-details {
    margin-top: 18px;
    border-top: 1px dashed var(--border-color);
    padding-top: 14px;
}

.miles-testing-details summary {
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-tertiary);
    list-style: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    user-select: none;
}

.miles-testing-details summary::-webkit-details-marker { display: none; }
.miles-testing-details summary i { width: 14px; height: 14px; }
.miles-testing-details[open] summary { color: var(--text-secondary); margin-bottom: 8px; }

/* =========================================================================
   Custom Confirm modal (replaces native window.confirm)
   ========================================================================= */

.custom-confirm-box {
    max-width: 440px;
    padding: 26px 26px 22px;
    text-align: left;
    border-radius: 18px;
}

.custom-confirm-icon {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(236, 72, 153, 0.15));
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
    color: #6366f1;
}

.custom-confirm-icon i { width: 26px; height: 26px; }

.custom-confirm-box.danger .custom-confirm-icon {
    background: rgba(239, 68, 68, 0.14);
    color: #dc2626;
}

[data-theme="dark"] .custom-confirm-box.danger .custom-confirm-icon {
    background: rgba(239, 68, 68, 0.28);
    color: #fca5a5;
}

.custom-confirm-content h3 {
    margin: 0 0 8px;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
}

.custom-confirm-body {
    color: var(--text-secondary);
    font-size: 0.92rem;
    line-height: 1.55;
    white-space: pre-wrap;
}

.custom-confirm-footer {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 22px;
}

.custom-confirm-footer .btn-primary,
.custom-confirm-footer .btn-secondary {
    padding: 9px 18px;
    font-size: 0.9rem;
}

.custom-confirm-box.danger .btn-primary {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    border-color: transparent;
    color: #fff;
}

.custom-confirm-box.danger .btn-primary:hover {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
}

/* =========================================================================
   Processing modal — soft "request raised, please wait" UX
   ========================================================================= */

.processing-box {
    max-width: 440px;
    padding: 28px 28px 24px;
    text-align: center;
    border-radius: 18px;
}

.processing-spinner {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.spinner-ring {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 4px solid rgba(99, 102, 241, 0.18);
    border-top-color: #6366f1;
    border-right-color: #ec4899;
    animation: processing-spin 0.9s linear infinite;
}

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

.processing-box h3 {
    margin: 0 0 8px;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
}

.processing-body {
    margin: 0 0 18px;
    color: var(--text-secondary);
    font-size: 0.92rem;
    line-height: 1.5;
}

.processing-steps {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 14px auto 18px;
    max-width: 320px;
    text-align: left;
}

.processing-step {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 0.86rem;
    font-weight: 600;
    transition: background 0.25s ease, color 0.25s ease;
}

.processing-step i { width: 16px; height: 16px; flex-shrink: 0; }

.processing-step.done {
    background: rgba(34, 197, 94, 0.14);
    color: #15803d;
}

.processing-step.active {
    background: rgba(99, 102, 241, 0.14);
    color: #4338ca;
}

.processing-step.active i {
    animation: processing-spin 1.4s linear infinite;
}

.processing-step.pending {
    background: var(--bg-soft);
    color: var(--text-tertiary);
}

[data-theme="dark"] .processing-step.done    { color: #bbf7d0; }
[data-theme="dark"] .processing-step.active  { color: #c7d2fe; }
[data-theme="dark"] .processing-step.pending { color: #94a3b8; }

.processing-progress {
    height: 6px;
    border-radius: 999px;
    background: var(--bg-soft);
    overflow: hidden;
    margin-top: 8px;
}

.processing-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #6366f1, #ec4899);
    border-radius: 999px;
    transition: width 0.25s linear;
}

/* =========================================================================
   Issue Tracker (admin-only) page
   ========================================================================= */

.tracker-card {
    margin: 20px auto;
    max-width: 1280px;
    padding: 28px;
}

.tracker-hero {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.tracker-hero h2 {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 6px;
    font-size: 1.35rem;
}

.tracker-sub {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
    max-width: 660px;
}

.tracker-stats-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
    margin-bottom: 18px;
}

@media (max-width: 1100px) { .tracker-stats-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 640px)  { .tracker-stats-grid { grid-template-columns: repeat(2, 1fr); } }

.tracker-stat {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 14px;
    background: var(--bg-soft);
    border: 1px solid var(--border-color);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.tracker-stat:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.tracker-stat-icon {
    width: 38px; height: 38px;
    border-radius: 10px;
    background: rgba(99, 102, 241, 0.14);
    color: #4338ca;
    display: inline-flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.tracker-stat-icon i { width: 18px; height: 18px; }
.tracker-stat-icon.open      { background: rgba(245, 158, 11, 0.18); color: #b45309; }
.tracker-stat-icon.progress  { background: rgba(59, 130, 246, 0.18); color: #1d4ed8; }
.tracker-stat-icon.review    { background: rgba(168, 85, 247, 0.18); color: #7e22ce; }
.tracker-stat-icon.resolved  { background: rgba(34, 197, 94, 0.18);  color: #15803d; }
.tracker-stat-icon.high      { background: rgba(239, 68, 68, 0.18);  color: #b91c1c; }

[data-theme="dark"] .tracker-stat-icon            { background: rgba(99, 102, 241, 0.28); color: #c7d2fe; }
[data-theme="dark"] .tracker-stat-icon.open       { background: rgba(245, 158, 11, 0.28); color: #fde68a; }
[data-theme="dark"] .tracker-stat-icon.progress   { background: rgba(59, 130, 246, 0.28); color: #bfdbfe; }
[data-theme="dark"] .tracker-stat-icon.review     { background: rgba(168, 85, 247, 0.28); color: #e9d5ff; }
[data-theme="dark"] .tracker-stat-icon.resolved   { background: rgba(34, 197, 94, 0.28);  color: #bbf7d0; }
[data-theme="dark"] .tracker-stat-icon.high       { background: rgba(239, 68, 68, 0.28);  color: #fecaca; }

.tracker-stat-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-tertiary);
    font-weight: 700;
    margin-bottom: 2px;
}

.tracker-stat-value {
    font-size: 1.45rem;
    font-weight: 800;
    line-height: 1;
    color: var(--text-primary);
}

.tracker-insights {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

@media (max-width: 640px) { .tracker-insights { grid-template-columns: 1fr; } }

.tracker-insight {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 12px;
    background: rgba(99, 102, 241, 0.07);
    border: 1px solid rgba(99, 102, 241, 0.18);
}

.tracker-insight i { width: 20px; height: 20px; color: #6366f1; }

.tracker-insight-label {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-tertiary);
    font-weight: 700;
}

.tracker-insight-value {
    font-size: 0.98rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-top: 2px;
}

[data-theme="dark"] .tracker-insight {
    background: rgba(99, 102, 241, 0.18);
    border-color: rgba(99, 102, 241, 0.35);
}

.tracker-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 16px;
}

.tracker-filters input[type="search"],
.tracker-filters select {
    padding: 9px 12px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    color: var(--text-primary);
    font-size: 0.88rem;
}

.tracker-filters input[type="search"] { flex: 1 1 280px; min-width: 220px; }

.tracker-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border-color);
    border-radius: 14px;
}

.tracker-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.tracker-table th,
.tracker-table td {
    padding: 12px 14px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.tracker-table thead th {
    background: var(--bg-soft);
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 700;
    color: var(--text-tertiary);
}

.tracker-table tbody tr:hover {
    background: rgba(99, 102, 241, 0.05);
}

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

.tracker-table .tracker-ticket {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-weight: 700;
    color: #4338ca;
}

[data-theme="dark"] .tracker-table .tracker-ticket { color: #c7d2fe; }

.tracker-pill {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: capitalize;
}

.tracker-pill.status-open            { background: rgba(245, 158, 11, 0.2); color: #92400e; }
.tracker-pill.status-assigned        { background: rgba(99, 102, 241, 0.18); color: #4338ca; }
.tracker-pill.status-in-progress     { background: rgba(59, 130, 246, 0.20); color: #1e40af; }
.tracker-pill.status-awaiting-review { background: rgba(168, 85, 247, 0.20); color: #6b21a8; }
.tracker-pill.status-resolved        { background: rgba(34, 197, 94, 0.20); color: #166534; }
.tracker-pill.status-closed          { background: rgba(148, 163, 184, 0.25); color: #475569; }

.tracker-pill.priority-high    { background: rgba(239, 68, 68, 0.18); color: #b91c1c; }
.tracker-pill.priority-normal  { background: rgba(245, 158, 11, 0.18); color: #b45309; }
.tracker-pill.priority-low     { background: rgba(34, 197, 94, 0.18); color: #15803d; }

.tracker-pill.verdict-fair       { background: rgba(34, 197, 94, 0.18); color: #15803d; }
.tracker-pill.verdict-fake       { background: rgba(239, 68, 68, 0.18); color: #b91c1c; }
.tracker-pill.verdict-unreviewed { background: rgba(148, 163, 184, 0.20); color: #475569; }

[data-theme="dark"] .tracker-pill.status-open            { color: #fde68a; }
[data-theme="dark"] .tracker-pill.status-assigned        { color: #c7d2fe; }
[data-theme="dark"] .tracker-pill.status-in-progress     { color: #bfdbfe; }
[data-theme="dark"] .tracker-pill.status-awaiting-review { color: #e9d5ff; }
[data-theme="dark"] .tracker-pill.status-resolved        { color: #bbf7d0; }
[data-theme="dark"] .tracker-pill.status-closed          { color: #e2e8f0; }
[data-theme="dark"] .tracker-pill.priority-high          { color: #fecaca; }
[data-theme="dark"] .tracker-pill.priority-normal        { color: #fde68a; }
[data-theme="dark"] .tracker-pill.priority-low           { color: #bbf7d0; }
[data-theme="dark"] .tracker-pill.verdict-fair           { color: #bbf7d0; }
[data-theme="dark"] .tracker-pill.verdict-fake           { color: #fecaca; }
[data-theme="dark"] .tracker-pill.verdict-unreviewed     { color: #e2e8f0; }

.tracker-table .tracker-empty td {
    text-align: center;
    padding: 32px 16px;
    color: var(--text-secondary);
    font-style: italic;
}

/* === QA Tester ============================================================ */

/* QA pane on login screen */
.qa-info-banner {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    background: linear-gradient(135deg, #FFF7ED 0%, #FFEDD5 100%);
    border: 1px solid #FDBA74;
    color: #7C2D12;
    padding: 12px 14px;
    border-radius: var(--border-radius-medium);
    margin: 4px 0 14px;
    line-height: 1.45;
    font-size: 0.9em;
}
.qa-info-banner i,
.qa-info-banner svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    margin-top: 2px;
    color: #C2410C;
}
.qa-info-banner strong { display: block; margin-bottom: 4px; font-weight: 700; }
.qa-info-banner span { font-size: 0.88em; }
body.dark-mode .qa-info-banner {
    background: linear-gradient(135deg, #3F1D0F 0%, #4A2308 100%);
    border-color: #B45309;
    color: #FED7AA;
}
body.dark-mode .qa-info-banner i,
body.dark-mode .qa-info-banner svg { color: #FB923C; }

/* Green-tinted variant for the "Already approved" sign-in banner */
.qa-info-banner.qa-info-banner-success {
    background: linear-gradient(135deg, #ECFDF5 0%, #D1FAE5 100%);
    border-color: #6EE7B7;
    color: #065F46;
}
.qa-info-banner.qa-info-banner-success i,
.qa-info-banner.qa-info-banner-success svg { color: #059669; }
body.dark-mode .qa-info-banner.qa-info-banner-success {
    background: linear-gradient(135deg, #0F2922 0%, #133F33 100%);
    border-color: #059669;
    color: #6EE7B7;
}
body.dark-mode .qa-info-banner.qa-info-banner-success i,
body.dark-mode .qa-info-banner.qa-info-banner-success svg { color: #34D399; }

/* QA tab toggle (Request vs Sign-In) */
.qa-mode-toggle {
    display: flex;
    gap: 4px;
    padding: 4px;
    background: var(--bg-soft);
    border-radius: 999px;
    margin-bottom: 14px;
}
.qa-mode-tab {
    flex: 1;
    background: transparent;
    border: none;
    padding: 8px 14px;
    border-radius: 999px;
    font-family: inherit;
    font-size: 0.88em;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}
.qa-mode-tab i { width: 14px; height: 14px; }
.qa-mode-tab:hover:not(.active) {
    color: var(--text-primary);
}
.qa-mode-tab.active {
    background: var(--card-bg);
    color: var(--accent);
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
body.dark-mode .qa-mode-tab.active {
    background: var(--bg);
    box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

.qa-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 20px;
}
.qa-form-grid .input-group { margin: 0; }

.qa-consent-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 4px 0 14px;
    text-align: left;
}
.qa-consent-check {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 0.85em;
    color: var(--text-secondary);
    cursor: pointer;
    line-height: 1.4;
}
.qa-consent-check input { margin-top: 3px; accent-color: var(--accent); }
.qa-consent-check a { color: var(--accent); text-decoration: underline; }

.qa-foot-note {
    font-size: 0.78em;
    color: var(--text-tertiary);
    text-align: center;
    margin-top: 10px;
}
.qa-foot-note code {
    background: var(--bg-soft);
    padding: 1px 5px;
    border-radius: 4px;
    font-size: 0.95em;
}

/* QA Mode marquee notice — slim fixed strip at the top of the viewport */
.qa-mode-marquee {
    position: fixed;
    left: 0;
    right: 0;
    top: 0;
    height: 32px;
    display: flex;
    align-items: stretch;
    background: linear-gradient(90deg, #C2410C 0%, #9A3412 100%);
    color: #FFEDD5;
    font-size: 0.82em;
    z-index: 120;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.18);
    overflow: hidden;
    border-bottom: 1px solid rgba(255, 255, 255, 0.18);
}
.qa-mode-marquee.hidden { display: none; }

.qa-mode-marquee-icon {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0 14px;
    background: rgba(0, 0, 0, 0.22);
    color: #FED7AA;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-size: 0.85em;
    flex-shrink: 0;
}
.qa-mode-marquee-icon i,
.qa-mode-marquee-icon svg {
    width: 14px;
    height: 14px;
}
.qa-mode-marquee-label { font-size: 0.92em; }

.qa-mode-marquee-track {
    flex: 1;
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: center;
}
.qa-mode-marquee-track::before,
.qa-mode-marquee-track::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 36px;
    pointer-events: none;
    z-index: 2;
}
.qa-mode-marquee-track::before {
    left: 0;
    background: linear-gradient(90deg, #C2410C, transparent);
}
.qa-mode-marquee-track::after {
    right: 0;
    background: linear-gradient(270deg, #9A3412, transparent);
}

.qa-mode-marquee-inner {
    display: inline-flex;
    align-items: center;
    gap: 18px;
    white-space: nowrap;
    padding-left: 100%;
    animation: qaMarqueeScroll 38s linear infinite;
}
.qa-mode-marquee:hover .qa-mode-marquee-inner {
    animation-play-state: paused;
}
.qa-mode-marquee-item strong { font-weight: 700; color: #fff; }
.qa-mode-marquee-sep {
    color: rgba(255, 237, 213, 0.6);
    font-size: 1.2em;
    line-height: 1;
}

@keyframes qaMarqueeScroll {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
}

/* Push the app down so the top marquee doesn't overlap the header.
   The sidebar is position:fixed/full-height, so nudge its top + height too. */
body.qa-mode-active .app-container {
    margin-top: 32px;
    height: calc(100vh - 32px);
}
body.qa-mode-active .sidebar {
    top: 32px;
    height: calc(100% - 32px);
}

@media (prefers-reduced-motion: reduce) {
    .qa-mode-marquee-inner {
        animation: none;
        padding-left: 16px;
    }
}

body.dark-mode .qa-mode-marquee {
    background: linear-gradient(90deg, #7C2D12 0%, #4A2308 100%);
}
body.dark-mode .qa-mode-marquee-track::before {
    background: linear-gradient(90deg, #7C2D12, transparent);
}
body.dark-mode .qa-mode-marquee-track::after {
    background: linear-gradient(270deg, #4A2308, transparent);
}

/* "Finish QA Testing" header button */
.btn-qa-finish {
    background: linear-gradient(135deg, #F97316 0%, #DB2777 100%);
    color: #fff;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.btn-qa-finish:hover { filter: brightness(1.05); }
.btn-qa-finish i, .btn-qa-finish svg { width: 16px; height: 16px; }

/* Finish QA modal */
.qa-finish-overlay { z-index: 2200; }
.qa-finish-box {
    max-width: 720px;
    width: min(720px, 96vw);
    padding: 24px;
    border-radius: var(--border-radius-large);
    background: var(--card-bg);
    box-shadow: var(--shadow-lg);
}
.qa-finish-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}
.qa-finish-title { display: flex; align-items: center; gap: 10px; }
.qa-finish-title i, .qa-finish-title svg { color: #F97316; width: 22px; height: 22px; }
.qa-finish-title h3 { margin: 0; font-size: 1.15em; }
.qa-finish-step-indicator {
    font-size: 0.78em;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-tertiary);
    padding: 4px 10px;
    background: var(--bg-soft);
    border-radius: 999px;
}
.qa-finish-step { display: flex; flex-direction: column; gap: 14px; }
.qa-finish-step.hidden { display: none; }
.qa-finish-lead { color: var(--text-secondary); margin: 0; line-height: 1.5; }
.qa-finish-label {
    font-weight: 600;
    font-size: 0.92em;
    color: var(--text-primary);
    display: block;
    margin-bottom: 6px;
}
.qa-finish-slider-row { display: flex; align-items: center; gap: 14px; }
.qa-finish-slider-row input[type="range"] { flex: 1; accent-color: var(--accent); }
.qa-finish-slider-out {
    background: var(--accent-soft);
    color: var(--accent-dark);
    font-weight: 700;
    font-size: 1.2em;
    min-width: 48px;
    text-align: center;
    padding: 6px 10px;
    border-radius: 10px;
}
body.dark-mode .qa-finish-slider-out { color: var(--accent-light); }
.qa-finish-helper { font-size: 0.85em; color: var(--text-tertiary); margin: 0; }
.qa-finish-footer {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 8px;
    border-top: 1px solid var(--border-color);
    padding-top: 14px;
}

/* Question cards */
.qa-finish-questions {
    display: flex;
    flex-direction: column;
    gap: 14px;
    max-height: 60vh;
    overflow-y: auto;
    padding-right: 4px;
}
.qa-question {
    background: var(--bg-soft);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 14px 16px;
}
.qa-question-head { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 10px; }
.qa-question-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--accent-soft);
    color: var(--accent-dark);
    font-weight: 700;
    font-size: 0.85em;
    flex-shrink: 0;
}
body.dark-mode .qa-question-num { color: var(--accent-light); }
.qa-question-text { margin: 2px 0 0; font-weight: 500; color: var(--text-primary); line-height: 1.4; }
.qa-question-rating {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    margin: 8px 0 10px;
}
.qa-rating-pill {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    color: var(--text-secondary);
    font-weight: 700;
    font-size: 0.95em;
    cursor: pointer;
    transition: all 0.15s ease;
}
.qa-rating-pill:hover { border-color: var(--accent); color: var(--accent); }
.qa-rating-pill.selected {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
    box-shadow: 0 4px 10px rgba(79, 70, 229, 0.25);
}
.qa-rating-hint {
    font-size: 0.78em;
    color: var(--text-tertiary);
    margin-left: 6px;
}
.qa-question-comment {
    width: 100%;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 8px 10px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9em;
    resize: vertical;
}
.qa-question-comment:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }

/* Overall step */
.qa-finish-overall { display: flex; flex-direction: column; gap: 6px; }
.qa-finish-overall textarea {
    width: 100%;
    background: var(--bg-soft);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 10px 12px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95em;
}
.qa-finish-overall textarea:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
.qa-star-rating {
    display: flex;
    gap: 6px;
    align-items: center;
}
.qa-star {
    font-size: 1.9em;
    line-height: 1;
    color: var(--border-strong);
    cursor: pointer;
    transition: color 0.15s ease, transform 0.15s ease;
}
.qa-star:hover { transform: scale(1.06); }
.qa-star.filled { color: #F59E0B; }
.qa-star-label {
    margin-left: 10px;
    font-size: 0.9em;
    color: var(--text-secondary);
    font-weight: 600;
}

/* Thank-you step */
.qa-finish-done {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 24px 0 12px;
    text-align: center;
}
.qa-finish-done-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--accent-gradient-soft);
    display: grid;
    place-items: center;
}
.qa-finish-done-icon i,
.qa-finish-done-icon svg {
    width: 32px;
    height: 32px;
    color: var(--accent);
}
.qa-finish-done h3 { margin: 0; }
.qa-finish-done p { margin: 0; color: var(--text-secondary); max-width: 420px; }

/* Admin: QA Testers tab */
.qa-admin-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}
.qa-admin-title { display: flex; align-items: center; gap: 8px; margin: 0; }
.qa-admin-title i, .qa-admin-title svg { color: #F97316; }
.qa-admin-sub { margin: 4px 0 0; color: var(--text-secondary); font-size: 0.92em; }
.qa-admin-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.qa-admin-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin: 14px 0 18px;
}
.qa-admin-stat {
    background: var(--bg-soft);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.qa-admin-stat-label {
    font-size: 0.78em;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-tertiary);
}
.qa-admin-stat-value {
    font-size: 1.35em;
    font-weight: 700;
    color: var(--text-primary);
}

.qa-testers-table th,
.qa-testers-table td {
    padding: 10px 12px;
    font-size: 0.9em;
}
.qa-testers-table code {
    background: var(--bg-soft);
    padding: 2px 6px;
    border-radius: 6px;
    font-size: 0.88em;
}
.qa-tester-status {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.75em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.qa-tester-status.finished {
    background: rgba(16, 185, 129, 0.12);
    color: #047857;
}
.qa-tester-status.active {
    background: rgba(249, 115, 22, 0.12);
    color: #C2410C;
}
body.dark-mode .qa-tester-status.finished { background: rgba(16, 185, 129, 0.2); color: #6EE7B7; }
body.dark-mode .qa-tester-status.active { background: rgba(249, 115, 22, 0.2); color: #FDBA74; }

.btn-small {
    padding: 6px 10px !important;
    font-size: 0.82em;
    border-radius: 8px;
}
.btn-small i, .btn-small svg { width: 14px; height: 14px; }

/* Tab badge in management tabs */
.m-tab-badge {
    display: inline-block;
    min-width: 20px;
    padding: 1px 6px;
    margin-left: 6px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent-dark);
    font-size: 0.72em;
    font-weight: 700;
    text-align: center;
}
body.dark-mode .m-tab-badge { color: var(--accent-light); }

/* Feedback detail modal */
.qa-feedback-detail-box { max-width: 720px; width: min(720px, 96vw); }
.qa-feedback-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
    margin-bottom: 14px;
    background: var(--bg-soft);
    border-radius: 12px;
    padding: 12px 14px;
    border: 1px solid var(--border-color);
}
.qa-feedback-overview div { font-size: 0.9em; }
.qa-feedback-quote {
    margin: 0 0 16px;
    padding: 12px 14px;
    border-left: 4px solid var(--accent);
    background: var(--accent-soft);
    color: var(--text-primary);
    font-style: italic;
    border-radius: 0 12px 12px 0;
}
body.dark-mode .qa-feedback-quote { color: var(--text-primary); }
.qa-feedback-section-title { margin: 12px 0 8px; font-size: 1em; }
.qa-feedback-answers { display: flex; flex-direction: column; gap: 10px; }
.qa-feedback-answer {
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 10px 12px;
    background: var(--card-bg);
}
.qa-feedback-answer-head { display: flex; align-items: flex-start; gap: 10px; }
.qa-feedback-answer-num {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--accent-soft);
    color: var(--accent-dark);
    font-weight: 700;
    font-size: 0.78em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
body.dark-mode .qa-feedback-answer-num { color: var(--accent-light); }
.qa-feedback-answer-head p { margin: 0; flex: 1; font-size: 0.9em; }
.qa-feedback-answer-rating {
    font-weight: 700;
    color: var(--accent);
    font-size: 0.9em;
}
.qa-feedback-answer-comment {
    margin: 6px 0 0;
    font-size: 0.85em;
    color: var(--text-secondary);
    font-style: italic;
}
.qa-feedback-note {
    font-size: 0.82em;
    color: var(--text-tertiary);
    text-align: center;
    margin-top: 12px;
}

@media (max-width: 600px) {
    .qa-form-grid { grid-template-columns: 1fr; }
    .qa-finish-footer { flex-direction: column-reverse; }
    .qa-finish-footer button { width: 100%; }
}

/* ===========================================================================
 * Account Reviews / Moderation system
 * ========================================================================= */

.ar-sub {
    color: var(--text-secondary);
    margin: 6px 0 18px;
    font-size: 0.95em;
}
.ar-sub-small {
    color: var(--text-tertiary);
    margin: 4px 0 14px;
    font-size: 0.85em;
}
.ar-tabs { margin-bottom: 18px; }

.ar-cases-list,
.ar-requests-list,
.ar-hidden-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ar-case-card,
.ar-request-card {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 14px 16px;
    background: var(--card-bg);
    box-shadow: var(--shadow-md);
}

.ar-case-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}
.ar-case-user {
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.ar-case-id {
    color: var(--text-tertiary);
    font-weight: 400;
    font-size: 0.78em;
}
.ar-case-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 6px;
    color: var(--text-secondary);
    font-size: 0.82em;
}
.ar-case-meta span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.ar-case-meta i { width: 14px; height: 14px; }

.ar-case-snippet {
    margin: 10px 0 12px;
    padding: 10px 12px;
    background: var(--accent-soft);
    border-radius: 8px;
    font-style: italic;
    font-size: 0.88em;
    color: var(--text-primary);
    line-height: 1.5;
}
body.dark-mode .ar-case-snippet { background: rgba(129, 140, 248, 0.12); }

.ar-request-note { font-style: normal; }

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

.ar-pill {
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.74em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
    flex-shrink: 0;
}
.ar-pill-amber { background: #FEF3C7; color: #92400E; }
.ar-pill-red   { background: #FEE2E2; color: #991B1B; }
.ar-pill-green { background: #DCFCE7; color: #166534; }
body.dark-mode .ar-pill-amber { background: rgba(251, 191, 36, 0.15); color: #FCD34D; }
body.dark-mode .ar-pill-red   { background: rgba(248, 113, 113, 0.15); color: #FCA5A5; }
body.dark-mode .ar-pill-green { background: rgba(74, 222, 128, 0.15); color: #86EFAC; }

/* Case Review modal */
.case-review-box {
    max-width: 760px;
    width: 92vw;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
}
.case-review-body {
    overflow-y: auto;
    padding: 18px 20px;
}
.ar-review-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 14px;
}
.ar-review-header h4 { margin: 0 0 2px; font-size: 1.15em; }
.ar-review-header small { color: var(--text-tertiary); font-size: 0.8em; }

.ar-review-section {
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid var(--border-color);
}
.ar-review-section h5 {
    margin: 0 0 10px;
    font-size: 0.95em;
    color: var(--text-primary);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.ar-review-section h5 i { width: 16px; height: 16px; }

.ar-trigger-snippet {
    background: #FEF3C7;
    color: #78350F;
    padding: 10px 12px;
    border-radius: 8px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.85em;
    margin-top: 8px;
    word-break: break-word;
}
body.dark-mode .ar-trigger-snippet {
    background: rgba(251, 191, 36, 0.12);
    color: #FCD34D;
}

.ar-session {
    margin: 6px 0;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 8px 12px;
    background: var(--card-bg);
}
.ar-session summary {
    cursor: pointer;
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 0.85em;
}
.ar-session-body {
    margin-top: 8px;
    max-height: 200px;
    overflow-y: auto;
    border-top: 1px dashed var(--border-color);
    padding-top: 8px;
    font-size: 0.83em;
    color: var(--text-secondary);
}
.ar-msg {
    margin: 4px 0;
    padding: 4px 6px;
    border-radius: 6px;
}
.ar-msg-user { background: var(--accent-soft); }
body.dark-mode .ar-msg-user { background: rgba(129, 140, 248, 0.08); }

.ar-ai-summary {
    background: var(--accent-soft);
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 0.9em;
    line-height: 1.55;
    margin-bottom: 10px;
    white-space: pre-wrap;
}
body.dark-mode .ar-ai-summary { background: rgba(129, 140, 248, 0.12); }

#arAdminNotes {
    width: 100%;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 8px 10px;
    font-family: inherit;
    font-size: 0.9em;
    background: var(--card-bg);
    color: var(--text-primary);
    resize: vertical;
}

.ar-review-decision {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
    flex-wrap: wrap;
}

.ar-decided-meta {
    margin-top: 16px;
    color: var(--text-tertiary);
    font-size: 0.82em;
    text-align: center;
}

/* User-list status tags (suspended / held) */
.user-status-tag {
    display: inline-block;
    margin-left: 6px;
    padding: 2px 7px;
    border-radius: 999px;
    font-size: 0.7em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.user-status-hold { background: #FEF3C7; color: #92400E; }
.user-status-perm { background: #FEE2E2; color: #991B1B; }
body.dark-mode .user-status-hold { background: rgba(251, 191, 36, 0.15); color: #FCD34D; }
body.dark-mode .user-status-perm { background: rgba(248, 113, 113, 0.15); color: #FCA5A5; }

/* ===========================================================================
 * Suspended Login Gate
 * ========================================================================= */

.suspended-gate-box {
    max-width: 480px;
    width: 92vw;
}
.suspended-gate-body { padding: 18px 20px; }
.suspended-gate-reason {
    background: #FEE2E2;
    color: #991B1B;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.85em;
    margin: 10px 0;
}
body.dark-mode .suspended-gate-reason {
    background: rgba(248, 113, 113, 0.12);
    color: #FCA5A5;
}
.suspended-gate-form {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.suspended-gate-form label { font-size: 0.9em; color: var(--text-secondary); }
.suspended-gate-form textarea {
    width: 100%;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px;
    font-family: inherit;
    font-size: 0.95em;
    background: var(--card-bg);
    color: var(--text-primary);
    resize: vertical;
}
.suspended-gate-success {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    background: #DCFCE7;
    color: #166534;
    border-radius: 10px;
    padding: 14px 16px;
    margin-top: 12px;
}
body.dark-mode .suspended-gate-success {
    background: rgba(74, 222, 128, 0.12);
    color: #86EFAC;
}
.suspended-gate-success p { margin: 0; font-size: 0.9em; line-height: 1.5; }

/* ===========================================================================
 * Download Options modal (with-or-without mindmap + password preview)
 * ========================================================================= */

.download-options-box {
    max-width: 460px;
    width: 92vw;
}
.download-options-body { padding: 16px 20px; }
.download-option-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    margin: 12px 0;
    cursor: pointer;
}
.download-option-row input { margin-top: 3px; flex-shrink: 0; }
.download-option-row span { font-size: 0.9em; line-height: 1.45; color: var(--text-secondary); }
.download-option-row span strong { color: var(--text-primary); }

.download-password-box {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    background: var(--accent-soft);
    border-radius: 10px;
    padding: 12px 14px;
    margin-top: 10px;
}
.download-password-box > i {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    color: var(--accent);
}
.download-password-box strong { color: var(--text-primary); display: block; margin-bottom: 4px; }
.download-password-box p {
    margin: 0;
    font-size: 0.84em;
    color: var(--text-secondary);
    line-height: 1.45;
}
.download-password-preview { margin-top: 6px !important; }
.download-password-preview code {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 2px 8px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-weight: 600;
    color: var(--accent-dark);
}
body.dark-mode .download-password-preview code { color: var(--accent); }
body.dark-mode .download-password-box { background: rgba(129, 140, 248, 0.12); }

/* ===========================================================================
 * MihU Fullscreen mode for the report
 * ========================================================================= */

.report-output-container.mihu-fullscreen {
    /* `inset: 5vh 0 auto 0` + `margin: 0 auto` centers a fixed element by
     * giving it equal left/right anchors and letting auto-margins balance.
     * This avoids the transform conflict with `.report-fade-in`, whose
     * keyframes end with `transform: translateY(0)` and would otherwise
     * replace any `translateX(-50%)` we set here. */
    position: fixed !important;
    top: 5vh;
    left: 0 !important;
    right: 0 !important;
    margin: 0 auto !important;
    width: min(1100px, 92vw);
    max-height: 90vh;
    z-index: 2000;
    border-radius: 18px;
    padding: 28px 32px 88px;
    box-sizing: border-box;
    overflow-y: auto;
    background: var(--card-bg);
    box-shadow: 0 24px 80px rgba(15, 23, 42, 0.35);
}
body.mihu-fullscreen-active {
    overflow: hidden;
}
body.mihu-fullscreen-active::before {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1999;
}
.report-output-container.mihu-fullscreen #reportScrollContent {
    max-width: 920px;
    margin: 0 auto;
}
.report-output-container.mihu-fullscreen .advice-actions {
    position: sticky;
    bottom: 0;
    margin-top: 24px;
    padding: 12px;
    background: var(--card-bg);
    border-top: 1px solid var(--border-color);
    border-radius: 0 0 18px 18px;
    z-index: 2010;
}
.btn-icon-action.fullscreen-btn {
    /* inherit visual treatment from other icon-only actions */
}

/* (.nav-badge is already defined in the Issues section above) */

/* Keep the global confirm modal on top of any other open overlay so it never
 * gets trapped behind, e.g., the Case Review modal. */
#customConfirm.custom-alert-overlay { z-index: 11000; }

/* ===========================================================================
 * MihU "cooking" loading overlay
 * Shown while Gemini drafts the career report. Sits inside the MihU card.
 * ========================================================================= */

.mihu-cooking-overlay {
    position: fixed;
    inset: 0;
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
    padding: 20px;
    box-sizing: border-box;
}
.mihu-cooking-overlay.active {
    opacity: 1;
    visibility: visible;
}
.mihu-cooking-overlay.hidden { display: none; }

body.dark-mode .mihu-cooking-overlay {
    background: rgba(2, 6, 23, 0.7);
}

.mihu-cooking-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    box-shadow: 0 12px 40px rgba(15, 23, 42, 0.12);
    padding: 28px 32px 22px;
    max-width: 380px;
    width: 100%;
    text-align: center;
    animation: mihuCookingPop 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
@keyframes mihuCookingPop {
    0%   { transform: scale(0.85); opacity: 0; }
    100% { transform: scale(1);    opacity: 1; }
}

.mihu-cooking-icon {
    position: relative;
    width: 96px;
    height: 96px;
    margin: 0 auto 18px;
}
.mihu-cooking-pot {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    animation: mihuPotBounce 1.4s ease-in-out infinite;
}
.mihu-cooking-pot i {
    width: 56px;
    height: 56px;
    stroke-width: 2;
}
@keyframes mihuPotBounce {
    0%, 100% { transform: translateY(0) scale(1); }
    50%      { transform: translateY(-4px) scale(1.06); }
}

.mihu-cooking-steam {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
}
.mihu-cooking-steam span {
    display: inline-block;
    width: 6px;
    height: 18px;
    background: var(--accent);
    border-radius: 999px;
    opacity: 0;
    animation: mihuSteam 1.8s ease-in-out infinite;
}
.mihu-cooking-steam span:nth-child(1) { animation-delay: 0s; }
.mihu-cooking-steam span:nth-child(2) { animation-delay: 0.3s; }
.mihu-cooking-steam span:nth-child(3) { animation-delay: 0.6s; }
@keyframes mihuSteam {
    0%   { transform: translateY(0)   scaleY(0.6); opacity: 0;   }
    30%  { opacity: 0.55; }
    100% { transform: translateY(-24px) scaleY(1.2); opacity: 0; }
}

.mihu-cooking-spark {
    position: absolute;
    font-size: 1.1em;
    pointer-events: none;
    animation: mihuSparkle 2.2s ease-in-out infinite;
}
.mihu-cooking-spark-1 { top: 4px;  left: -8px; animation-delay: 0s; }
.mihu-cooking-spark-2 { top: 20px; right: -10px; animation-delay: 0.7s; }
.mihu-cooking-spark-3 { bottom: 0;  right: 10px;  animation-delay: 1.3s; }
@keyframes mihuSparkle {
    0%, 100% { transform: scale(0.6) rotate(0deg);   opacity: 0; }
    40%      { transform: scale(1.1) rotate(15deg);  opacity: 1; }
    60%      { transform: scale(1.1) rotate(-15deg); opacity: 1; }
}

.mihu-cooking-title {
    margin: 0 0 8px;
    font-size: 1.15em;
    color: var(--text-primary);
    font-weight: 700;
}
.mihu-cooking-message {
    margin: 0 0 16px;
    font-size: 0.95em;
    color: var(--text-secondary);
    min-height: 1.4em;
    transition: opacity 0.2s ease;
}

.mihu-cooking-bar {
    width: 100%;
    height: 6px;
    background: var(--accent-soft);
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 14px;
}
body.dark-mode .mihu-cooking-bar { background: rgba(129, 140, 248, 0.18); }
.mihu-cooking-fill {
    width: 30%;
    height: 100%;
    background: linear-gradient(90deg, var(--accent), #A78BFA, var(--accent));
    background-size: 200% 100%;
    border-radius: 999px;
    animation: mihuBarSlide 1.8s linear infinite, mihuBarShimmer 2.5s linear infinite;
}
@keyframes mihuBarSlide {
    0%   { transform: translateX(-100%); }
    100% { transform: translateX(330%);  }
}
@keyframes mihuBarShimmer {
    0%   { background-position: 0 0; }
    100% { background-position: 200% 0; }
}

.mihu-cooking-foot {
    margin: 0;
    font-size: 0.8em;
    color: var(--text-tertiary);
}

/* ===========================================================================
   SIGN-UP PANE
   =========================================================================== */
.signup-intro {
    margin-bottom: 14px;
    text-align: center;
}
.signup-intro h3 {
    margin: 0 0 4px;
    font-size: 1.05em;
    font-weight: 700;
    color: var(--text-primary);
}
.signup-intro p {
    margin: 0;
    font-size: 0.85em;
    color: var(--text-tertiary);
}
.signup-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}
@media (max-width: 480px) {
    .signup-grid { grid-template-columns: 1fr; }
}
.signup-foot {
    margin: 14px 0 0;
    text-align: center;
    font-size: 0.85em;
    color: var(--text-tertiary);
}
.signup-foot a {
    color: var(--accent, #2d88ff);
    font-weight: 600;
    text-decoration: none;
}
.signup-foot a:hover { text-decoration: underline; }

.login-signup-prompt {
    margin: 14px 0 0;
    text-align: center;
    font-size: 0.88em;
    color: var(--text-tertiary);
}
.login-signup-prompt a {
    color: var(--accent, #6c4fed);
    font-weight: 600;
    text-decoration: none;
    margin-left: 4px;
}
.login-signup-prompt a:hover { text-decoration: underline; }

#signupButton i {
    width: 16px; height: 16px;
    margin-right: 6px;
    vertical-align: -3px;
}

/* ===========================================================================
   PENDING APPROVAL GATE
   =========================================================================== */
.pending-approval-screen {
    background: linear-gradient(180deg, #f7f7fb 0%, #eef0f6 100%);
}
[data-theme="dark"] .pending-approval-screen {
    background: linear-gradient(180deg, #0f1117 0%, #1a1d27 100%);
}
.pending-approval-shell {
    width: min(560px, calc(100% - 32px));
    text-align: center;
    padding: 32px 16px;
}
.pending-approval-icon {
    display: flex;
    justify-content: center;
    margin-bottom: 18px;
}
.pending-approval-icon-circle {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #fde2e4;
    color: #c92b3f;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 20px rgba(201, 43, 63, 0.18);
}
.pending-approval-icon-circle i {
    width: 28px; height: 28px;
}
.pending-approval-app-name {
    margin: 0 0 4px;
    font-size: 1.4em;
    font-weight: 700;
    color: var(--text-primary);
}
.pending-approval-tagline {
    margin: 0 0 28px;
    font-size: 0.9em;
    color: var(--text-tertiary);
}
.pending-approval-card {
    background: var(--card-bg, #ffffff);
    border: 1px solid var(--card-border, #e4e6ed);
    border-radius: 16px;
    padding: 28px 24px;
    box-shadow: 0 12px 36px rgba(15, 23, 42, 0.08);
    text-align: center;
}
[data-theme="dark"] .pending-approval-card {
    background: #1c1f29;
    border-color: #2a2f3a;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.4);
}
.pending-approval-badge {
    display: inline-block;
    padding: 4px 12px;
    background: #fff4d3;
    color: #b3771b;
    border-radius: 999px;
    font-size: 0.72em;
    font-weight: 700;
    letter-spacing: 0.08em;
    margin-bottom: 14px;
}
[data-theme="dark"] .pending-approval-badge {
    background: #3a2c10;
    color: #e9b65a;
}
.pending-approval-card h2 {
    margin: 0 0 12px;
    font-size: 1.4em;
    font-weight: 700;
    color: var(--text-primary);
}
.pending-approval-card p {
    margin: 0 0 12px;
    font-size: 0.95em;
    line-height: 1.55;
    color: var(--text-secondary, var(--text-primary));
}
.pending-approval-sub {
    color: var(--text-tertiary) !important;
    font-size: 0.85em !important;
}
/* Pending-approval User ID highlight block */
.pending-approval-id-block {
    margin: 18px auto 16px;
    padding: 16px 18px;
    background: linear-gradient(135deg, rgba(108, 79, 237, 0.10), rgba(45, 136, 255, 0.08));
    border: 1px dashed rgba(108, 79, 237, 0.4);
    border-radius: 14px;
    max-width: 380px;
    text-align: center;
    box-shadow: 0 6px 20px rgba(108, 79, 237, 0.12);
}
[data-theme="dark"] .pending-approval-id-block {
    background: linear-gradient(135deg, rgba(108, 79, 237, 0.18), rgba(45, 136, 255, 0.10));
    border-color: rgba(140, 110, 255, 0.5);
}
.pending-approval-id-block.hidden { display: none; }

.pending-approval-id-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #6c4fed;
    font-size: 0.72em;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-bottom: 6px;
}
[data-theme="dark"] .pending-approval-id-label { color: #a692ff; }
.pending-approval-id-label i { width: 14px; height: 14px; }

.pending-approval-id-value {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}
.pending-approval-id-value code {
    background: rgba(255,255,255,0.6);
    color: var(--text-primary);
    padding: 6px 16px;
    border-radius: 10px;
    font-size: 1.6em;
    font-weight: 800;
    letter-spacing: 0.14em;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}
[data-theme="dark"] .pending-approval-id-value code {
    background: rgba(255,255,255,0.08);
}
.pending-approval-id-copy {
    background: transparent;
    border: 1px solid rgba(108, 79, 237, 0.35);
    color: #6c4fed;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}
.pending-approval-id-copy:hover {
    background: rgba(108, 79, 237, 0.12);
    transform: translateY(-1px);
}
.pending-approval-id-copy i { width: 16px; height: 16px; }
.pending-approval-id-copy.is-copied {
    background: rgba(34, 197, 94, 0.15);
    color: #16a34a;
    border-color: rgba(34, 197, 94, 0.4);
}

.pending-approval-id-note {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 0;
    padding: 8px 12px;
    background: rgba(255, 213, 79, 0.12);
    border-left: 3px solid #f5b400;
    border-radius: 6px;
    text-align: left;
    font-size: 0.82em !important;
    color: var(--text-secondary, var(--text-primary)) !important;
    line-height: 1.45;
}
.pending-approval-id-note i {
    width: 16px;
    height: 16px;
    color: #b3771b;
    flex-shrink: 0;
    margin-top: 2px;
}
.pending-approval-id-note strong { color: #b3771b; }
[data-theme="dark"] .pending-approval-id-note {
    background: rgba(245, 180, 0, 0.12);
}
[data-theme="dark"] .pending-approval-id-note i,
[data-theme="dark"] .pending-approval-id-note strong { color: #e9b65a; }
.pending-approval-card .btn-secondary {
    margin-top: 8px;
    padding: 10px 24px;
}
.pending-approval-footer {
    margin: 26px 0 0;
    font-size: 0.78em;
    color: var(--text-tertiary);
}

/* ===========================================================================
   MY REPORTS PAGE
   =========================================================================== */
.my-reports-card {
    padding: 24px;
}
.my-reports-hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.my-reports-hero h2 {
    margin: 0 0 6px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.my-reports-hero h2 i { width: 22px; height: 22px; }
.my-reports-sub {
    margin: 0;
    color: var(--text-tertiary);
    font-size: 0.92em;
    max-width: 640px;
}

.my-reports-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}
.my-reports-stat {
    background: var(--card-bg-soft, rgba(0,0,0,0.03));
    border: 1px solid var(--card-border, rgba(0,0,0,0.07));
    border-radius: 12px;
    padding: 14px 16px;
}
[data-theme="dark"] .my-reports-stat {
    background: rgba(255,255,255,0.04);
    border-color: rgba(255,255,255,0.07);
}
.my-reports-stat-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78em;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.my-reports-stat-label i { width: 14px; height: 14px; }
.my-reports-stat-value {
    margin-top: 4px;
    font-size: 1.4em;
    font-weight: 700;
    color: var(--text-primary);
}

.my-reports-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.my-reports-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 36px;
    color: var(--text-tertiary);
}
.my-reports-loading i { animation: spin 1s linear infinite; width: 18px; height: 18px; }
@keyframes spin { to { transform: rotate(360deg); } }

.my-reports-empty {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-tertiary);
}
.my-reports-empty i {
    width: 48px;
    height: 48px;
    opacity: 0.45;
    margin-bottom: 12px;
}
.my-reports-empty h3 {
    margin: 0 0 6px;
    font-size: 1.1em;
    color: var(--text-primary);
}
.my-reports-empty p {
    margin: 0 0 18px;
    font-size: 0.92em;
}

.my-report-card {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: var(--card-bg, #ffffff);
    border: 1px solid var(--card-border, #e4e6ed);
    border-radius: 12px;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
[data-theme="dark"] .my-report-card {
    background: #1c1f29;
    border-color: #2a2f3a;
}
.my-report-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.07);
}
.my-report-card-icon {
    width: 40px;
    height: 40px;
    background: rgba(45, 136, 255, 0.1);
    color: #2d88ff;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.my-report-card-icon i { width: 18px; height: 18px; }
.my-report-card-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}
.my-report-card-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    font-size: 0.82em;
    color: var(--text-tertiary);
}
.my-report-card-meta i { width: 12px; height: 12px; }
.my-report-tag, .my-report-date {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.my-report-card-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.my-report-card-actions .btn-small {
    padding: 6px 10px;
    font-size: 0.8em;
}
.my-report-card-actions .btn-small i {
    width: 14px; height: 14px;
}
@media (max-width: 560px) {
    .my-report-card {
        grid-template-columns: auto 1fr;
    }
    .my-report-card-actions {
        grid-column: 1 / -1;
        justify-content: flex-end;
    }
}

/* Saved-report modal viewer */
.saved-report-box {
    max-width: 760px;
    width: min(760px, calc(100% - 32px));
    max-height: 86vh;
    display: flex;
    flex-direction: column;
}
.saved-report-body {
    flex: 1;
    overflow-y: auto;
    padding: 18px 22px;
}
.saved-report-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    padding: 10px 14px;
    background: rgba(0,0,0,0.03);
    border-radius: 10px;
    margin-bottom: 14px;
    font-size: 0.88em;
}
[data-theme="dark"] .saved-report-meta {
    background: rgba(255,255,255,0.04);
}
.saved-report-content {
    /* Re-use existing report styles since we re-inject the same HTML */
}
.saved-report-footer {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    padding: 12px 18px;
    border-top: 1px solid var(--card-border, rgba(0,0,0,0.07));
}
.saved-report-footer .btn-secondary i,
.saved-report-footer .btn-primary i {
    width: 14px; height: 14px;
    margin-right: 4px;
    vertical-align: -2px;
}

/* Save button state — when a report has been saved, swap to a green check. */
.btn-icon-action.save-btn.is-saved {
    background: rgba(34, 197, 94, 0.12);
    color: #16a34a;
}
.btn-icon-action.save-btn.is-saved:hover {
    background: rgba(34, 197, 94, 0.18);
}

/* "Save it!" attention bubble + pulse on the save button (MihU report actions) */
.save-btn-spot {
    position: relative;
    display: inline-flex;
}
.save-btn-spot.hidden { display: none; }

.save-btn-pulse {
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    pointer-events: none;
    border: 2px solid rgba(34, 197, 94, 0.55);
    opacity: 0;
}
.btn-icon-action.save-btn-attention {
    position: relative;
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.18), rgba(34, 197, 94, 0.08)) !important;
    color: #16a34a !important;
    box-shadow: 0 4px 14px rgba(34, 197, 94, 0.25);
    transform: scale(1);
    animation: saveBtnBob 1.8s ease-in-out infinite;
}
.btn-icon-action.save-btn-attention .save-btn-pulse {
    animation: saveBtnPulse 1.6s ease-out infinite;
}
.btn-icon-action.save-btn-attention:hover {
    background: rgba(34, 197, 94, 0.25) !important;
}
.btn-icon-action.save-btn.is-saved .save-btn-pulse { display: none; }

@keyframes saveBtnPulse {
    0%   { transform: scale(0.85); opacity: 0.7; }
    70%  { transform: scale(1.45); opacity: 0; }
    100% { transform: scale(1.45); opacity: 0; }
}
@keyframes saveBtnBob {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-3px); }
}

.save-btn-callout {
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: #fff;
    padding: 6px 12px 6px 14px;
    border-radius: 999px;
    font-size: 0.78em;
    font-weight: 700;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 8px 18px rgba(34, 197, 94, 0.35);
    animation: saveCalloutFloat 2.2s ease-in-out infinite;
    pointer-events: none;
    z-index: 5;
}
.save-btn-callout::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 7px solid #16a34a;
}
.save-btn-callout .save-btn-callout-arrow {
    width: 14px;
    height: 14px;
    animation: saveCalloutArrow 0.9s ease-in-out infinite;
}
.save-btn-callout.hidden { display: none; }

@keyframes saveCalloutFloat {
    0%, 100% { transform: translate(-50%, 0); }
    50%      { transform: translate(-50%, -4px); }
}
@keyframes saveCalloutArrow {
    0%, 100% { transform: translateY(0); opacity: 1; }
    50%      { transform: translateY(2px); opacity: 0.7; }
}

/* ===========================================================================
   PLAN & DAILY QUOTA — profile panel
   =========================================================================== */
.quota-card {
    padding: 24px;
}
.quota-hero {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}
.quota-hero-left h2 {
    margin: 0 0 6px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.quota-hero-left h2 i { width: 22px; height: 22px; color: #6c4fed; }
.quota-tagline {
    margin: 0;
    color: var(--text-tertiary);
    font-size: 0.92em;
    max-width: 560px;
}
.quota-plan-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: linear-gradient(135deg, rgba(108, 79, 237, 0.15), rgba(108, 79, 237, 0.06));
    border: 1px solid rgba(108, 79, 237, 0.3);
    border-radius: 999px;
    color: #6c4fed;
    font-weight: 700;
    font-size: 0.95em;
}
[data-theme="dark"] .quota-plan-pill { color: #a692ff; }
.quota-plan-pill i { width: 16px; height: 16px; }

.quota-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}
.quota-stat-tokens {
    margin-bottom: 14px;
    background: var(--card-bg-soft, rgba(0,0,0,0.03));
    border: 1px solid var(--card-border, rgba(0,0,0,0.07));
    border-radius: 14px;
    padding: 18px 20px;
}
[data-theme="dark"] .quota-stat-tokens {
    background: rgba(255,255,255,0.04);
    border-color: rgba(255,255,255,0.07);
}
.quota-bar-tall { height: 12px !important; }

.quota-breakdown {
    display: flex;
    gap: 18px;
    margin-top: 12px;
    flex-wrap: wrap;
}
.quota-breakdown-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85em;
    color: var(--text-tertiary);
}
.quota-breakdown-item i { width: 14px; height: 14px; }
.quota-breakdown-item strong {
    color: var(--text-primary);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.quota-expiry-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(108, 79, 237, 0.08);
    border-left: 3px solid #6c4fed;
    border-radius: 8px;
    margin-bottom: 14px;
    font-size: 0.92em;
}
.quota-expiry-row i {
    width: 20px; height: 20px;
    color: #6c4fed;
    flex-shrink: 0;
}
.quota-expiry-row strong {
    display: block;
    color: var(--text-primary);
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 2px;
}
.quota-expiry-row span {
    color: var(--text-tertiary);
    font-size: 0.88em;
}
.quota-expiry-row.quota-expiry-warning {
    background: rgba(245, 158, 11, 0.10);
    border-left-color: #f59e0b;
}
.quota-expiry-row.quota-expiry-warning i { color: #f59e0b; }
.quota-expiry-row.quota-expiry-expired {
    background: rgba(239, 68, 68, 0.10);
    border-left-color: #ef4444;
}
.quota-expiry-row.quota-expiry-expired i { color: #ef4444; }
.quota-expiry-row.hidden { display: none; }

/* Admin "Reset all plans" testing row */
.plan-reset-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 16px;
    margin-bottom: 16px;
    background: rgba(239, 68, 68, 0.06);
    border: 1px dashed rgba(239, 68, 68, 0.3);
    border-radius: 10px;
    flex-wrap: wrap;
}
.plan-reset-meta {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}
.plan-reset-meta i {
    width: 18px; height: 18px;
    color: #ef4444;
    margin-top: 2px;
}
.plan-reset-meta strong {
    display: block;
    color: var(--text-primary);
    font-weight: 700;
    margin-bottom: 2px;
}
.plan-reset-meta span {
    color: var(--text-tertiary);
    font-size: 0.85em;
}
.plan-reset-row .btn-danger i { width: 14px; height: 14px; margin-right: 4px; vertical-align: -2px; }
.quota-stat {
    background: var(--card-bg-soft, rgba(0,0,0,0.03));
    border: 1px solid var(--card-border, rgba(0,0,0,0.07));
    border-radius: 14px;
    padding: 16px 18px;
}
[data-theme="dark"] .quota-stat {
    background: rgba(255,255,255,0.04);
    border-color: rgba(255,255,255,0.07);
}
.quota-stat-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}
.quota-stat-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85em;
    color: var(--text-secondary, var(--text-primary));
    font-weight: 600;
}
.quota-stat-label i { width: 14px; height: 14px; }
.quota-stat-numbers {
    font-size: 1.05em;
    font-weight: 700;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}
.quota-bar {
    width: 100%;
    height: 8px;
    background: rgba(0,0,0,0.07);
    border-radius: 999px;
    overflow: hidden;
}
[data-theme="dark"] .quota-bar { background: rgba(255,255,255,0.08); }
.quota-bar-fill {
    height: 100%;
    background: #6c4fed;
    border-radius: 999px;
    transition: width 0.4s ease, background 0.3s ease;
}
.quota-stat-sub {
    margin: 8px 0 0;
    font-size: 0.82em;
    color: var(--text-tertiary);
}

.quota-upgrade-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 20px;
    background: linear-gradient(135deg, rgba(108, 79, 237, 0.08), rgba(45, 136, 255, 0.04));
    border: 1px dashed rgba(108, 79, 237, 0.3);
    border-radius: 12px;
    flex-wrap: wrap;
}
.quota-upgrade-row h4 {
    margin: 0 0 4px;
    font-size: 1em;
    color: var(--text-primary);
}
.quota-upgrade-sub {
    margin: 0;
    font-size: 0.88em;
    color: var(--text-tertiary);
}
.quota-upgrade-row .btn-primary i {
    width: 14px; height: 14px;
    vertical-align: -2px;
    margin-right: 4px;
}
.quota-pending-note {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: rgba(245, 180, 0, 0.12);
    border-left: 3px solid #f5b400;
    border-radius: 6px;
    font-size: 0.88em;
    margin-top: 12px;
}
.quota-pending-note i { width: 16px; height: 16px; color: #b3771b; }
.quota-pending-note.hidden { display: none; }
[data-theme="dark"] .quota-pending-note { background: rgba(245, 180, 0, 0.10); }

/* Dashboard quota tile */
.dashboard-quota-card .stat-value { font-size: 1.6em; }
.dashboard-quota-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 10px;
}

/* Per-plan theming for the Today's Tokens card */
.dashboard-quota-card { position: relative; overflow: hidden; transition: box-shadow 0.25s ease, transform 0.25s ease; }
/* Suppress the hover accent stripe that .grid-card::before normally shows —
   it's not wanted on the quota card. */
.dashboard-quota-card::before,
.dashboard-quota-card:hover::before { display: none !important; content: none !important; }
.dashboard-quota-card.plan-free {
    background: linear-gradient(135deg, rgba(114, 128, 165, 0.10), rgba(114, 128, 165, 0.03));
    border: 1px solid rgba(114, 128, 165, 0.18);
}
.dashboard-quota-card.plan-free .card-header-icon { color: #7280a5; }
.dashboard-quota-card.plan-plus {
    background: linear-gradient(135deg, rgba(108, 79, 237, 0.15), rgba(108, 79, 237, 0.05));
    border: 1px solid rgba(108, 79, 237, 0.35);
    box-shadow: 0 6px 18px rgba(108, 79, 237, 0.15);
}
.dashboard-quota-card.plan-plus .card-header-icon { color: #6c4fed; }
.dashboard-quota-card.plan-plus .stat-value { color: #6c4fed; }
.dashboard-quota-card.plan-pro {
    background: linear-gradient(150deg, #fff8e1 0%, #ffe9a6 60%, #f6cc52 100%);
    border: 1px solid rgba(199, 154, 42, 0.35);
    box-shadow: 0 8px 22px rgba(199, 154, 42, 0.18);
    color: #5a3f06;
}
.dashboard-quota-card.plan-pro h3,
.dashboard-quota-card.plan-pro .stat-value,
.dashboard-quota-card.plan-pro .dashboard-quota-line-label,
.dashboard-quota-card.plan-pro .dashboard-quota-line-value {
    color: #5a3f06 !important;
}
.dashboard-quota-card.plan-pro .card-header-icon {
    background: linear-gradient(135deg, #ffd964, #c79a2a);
    color: #ffffff;
    box-shadow: 0 4px 10px rgba(199, 154, 42, 0.35);
}
.dashboard-quota-card.plan-pro::after {
    content: '';
    position: absolute;
    top: -60%;
    left: -40%;
    width: 50%;
    height: 220%;
    background: linear-gradient(110deg, transparent 0%, rgba(255,255,255,0.35) 50%, transparent 100%);
    transform: rotate(20deg);
    animation: proCardShine 7s ease-in-out infinite;
    pointer-events: none;
}
@keyframes proCardShine {
    0%   { transform: translateX(0) rotate(20deg); opacity: 0; }
    15%  { opacity: 0.7; }
    50%  { transform: translateX(380%) rotate(20deg); opacity: 0; }
    100% { transform: translateX(380%) rotate(20deg); opacity: 0; }
}
.dashboard-quota-card.plan-admin {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border: 1px solid #334155;
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.35), inset 0 1px 0 rgba(255,255,255,0.06);
    color: #e2e8f0;
}
.dashboard-quota-card.plan-admin h3,
.dashboard-quota-card.plan-admin .stat-value,
.dashboard-quota-card.plan-admin .dashboard-quota-line-label,
.dashboard-quota-card.plan-admin .dashboard-quota-line-value {
    color: #f1f5f9 !important;
}
.dashboard-quota-card.plan-admin .card-header-icon {
    background: linear-gradient(135deg, #cbd5e1, #64748b);
    color: #0f172a;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.4);
}
.dashboard-quota-card.plan-qa {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.10), rgba(245, 158, 11, 0.03));
    border: 1px solid rgba(245, 158, 11, 0.35);
}
.dashboard-quota-card.plan-qa .card-header-icon { color: #f59e0b; }

/* User Profile card — plan badge */
.dash-plan-row {
    display: flex;
    align-items: center;
    gap: 6px;
}
.dash-plan-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.82em;
    font-weight: 700;
    letter-spacing: 0.02em;
}
.dash-plan-badge i { width: 12px; height: 12px; }
.dash-plan-badge.plan-free {
    background: rgba(114, 128, 165, 0.12);
    color: #5c6886;
}
[data-theme="dark"] .dash-plan-badge.plan-free { color: #9fa9c3; }
.dash-plan-badge.plan-plus {
    background: linear-gradient(135deg, rgba(108, 79, 237, 0.18), rgba(108, 79, 237, 0.08));
    color: #6c4fed;
}
[data-theme="dark"] .dash-plan-badge.plan-plus { color: #a692ff; }
.dash-plan-badge.plan-pro {
    background: linear-gradient(135deg, #f0b429, #c79a2a);
    color: #fff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.15);
    box-shadow: 0 4px 10px rgba(199, 154, 42, 0.35);
    position: relative;
}
.dash-plan-badge.plan-pro::after {
    content: '★';
    margin-left: 2px;
    color: #fff;
    text-shadow: 0 0 6px rgba(255,255,255,0.7);
}
.dash-plan-badge.plan-admin {
    background: linear-gradient(135deg, #334155, #0f172a);
    color: #f1f5f9;
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.35);
    border: 1px solid rgba(203, 213, 225, 0.25);
}
.dash-plan-badge.plan-admin::after {
    content: '◆';
    margin-left: 4px;
    color: #cbd5e1;
}
.dash-plan-badge.plan-qa {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #fff;
    box-shadow: 0 4px 10px rgba(245, 158, 11, 0.3);
}
.dashboard-quota-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 0.85em;
    color: var(--text-tertiary);
}
.dashboard-quota-line-label {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.dashboard-quota-line-label i { width: 13px; height: 13px; }
.dashboard-quota-line-value {
    font-weight: 700;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

/* Plan chip in profile hero */
.profile-chip.profile-chip-plan {
    background: linear-gradient(135deg, rgba(108, 79, 237, 0.18), rgba(108, 79, 237, 0.08));
    color: #6c4fed;
    border: 1px solid rgba(108, 79, 237, 0.25);
    font-weight: 700;
}
[data-theme="dark"] .profile-chip.profile-chip-plan { color: #a692ff; }

/* ===========================================================================
   PLANS COMPARISON MODAL
   =========================================================================== */
.plans-modal-box {
    max-width: 900px;
    width: min(900px, calc(100% - 32px));
    max-height: 90vh;
    overflow-y: auto;
}
.plans-modal-body { padding: 18px 22px; }
.plans-modal-intro {
    margin: 0 0 18px;
    color: var(--text-tertiary);
    font-size: 0.92em;
}
.plans-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
    margin-bottom: 14px;
}
.plan-card {
    position: relative;
    padding: 18px 16px;
    background: var(--card-bg, #fff);
    border: 1.5px solid var(--card-border, #e4e6ed);
    border-radius: 14px;
    display: flex;
    flex-direction: column;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}
[data-theme="dark"] .plan-card { background: #1c1f29; border-color: #2a2f3a; }
.plan-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
}
.plan-card-recommended {
    border-color: var(--plan-accent, #6c4fed);
    box-shadow: 0 10px 28px rgba(108, 79, 237, 0.15);
}
.plan-card-current {
    border-style: dashed;
    opacity: 0.95;
}
.plan-recommend-tag {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    padding: 3px 12px;
    background: var(--plan-accent, #6c4fed);
    color: #fff;
    font-size: 0.7em;
    font-weight: 700;
    letter-spacing: 0.08em;
    border-radius: 999px;
    box-shadow: 0 4px 12px rgba(108, 79, 237, 0.3);
}
.plan-card-head { text-align: center; margin-bottom: 14px; }
.plan-card-head h4 {
    margin: 0 0 4px;
    font-size: 1.3em;
    color: var(--plan-accent, var(--text-primary));
    font-weight: 800;
    letter-spacing: 0.01em;
}
.plan-tagline {
    margin: 0 0 10px;
    font-size: 0.78em;
    color: var(--text-tertiary);
    font-style: italic;
    text-transform: lowercase;
    letter-spacing: 0.02em;
}
.plan-price {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}
.plan-price strong {
    font-size: 1.8em;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
}
.plan-price span {
    font-size: 0.78em;
    color: var(--text-tertiary);
    text-transform: lowercase;
}
.plan-feature-list {
    list-style: none;
    padding: 0;
    margin: 0 0 18px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.plan-feature-list li {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 0.88em;
    color: var(--text-secondary, var(--text-primary));
}
.plan-feature-list li i {
    width: 14px;
    height: 14px;
    color: var(--plan-accent, #6c4fed);
    flex-shrink: 0;
    margin-top: 3px;
}
.plan-choose-btn {
    width: 100%;
    padding: 10px;
    font-weight: 700;
    background: var(--plan-accent, #6c4fed) !important;
    background-image: none !important;
}
.plan-choose-btn:disabled {
    background: rgba(0,0,0,0.1) !important;
    cursor: not-allowed;
}
.plan-choose-btn i { width: 14px; height: 14px; margin-right: 4px; vertical-align: -2px; }

.plans-modal-foot {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 14px;
    background: rgba(0,0,0,0.04);
    border-radius: 8px;
    font-size: 0.84em;
    color: var(--text-tertiary);
}
[data-theme="dark"] .plans-modal-foot { background: rgba(255,255,255,0.04); }
.plans-modal-foot i { width: 14px; height: 14px; margin-top: 2px; flex-shrink: 0; }

/* ===========================================================================
   UPGRADE REQUEST MODAL
   =========================================================================== */
.upgrade-request-box {
    max-width: 480px;
    width: min(480px, calc(100% - 32px));
}
.upgrade-request-body {
    padding: 18px 22px;
}
.upgrade-request-body > p {
    margin: 0 0 14px;
    color: var(--text-secondary, var(--text-primary));
}
.upgrade-request-summary {
    margin: 12px 0 16px;
    padding: 12px 14px;
    background: rgba(108, 79, 237, 0.08);
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.upgrade-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9em;
}
.upgrade-summary-row strong {
    color: var(--text-tertiary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 0.82em;
}
.upgrade-summary-row span { color: var(--text-primary); font-weight: 700; }
.upgrade-summary-row small { color: var(--text-tertiary); font-weight: 400; }
.upgrade-request-label {
    display: block;
    font-size: 0.82em;
    color: var(--text-tertiary);
    margin: 14px 0 6px;
    font-weight: 600;
}
#upgradeRequestNote {
    width: 100%;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid var(--card-border, #e4e6ed);
    background: var(--card-bg, #fff);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.92em;
    resize: vertical;
}
[data-theme="dark"] #upgradeRequestNote {
    background: #1c1f29;
    border-color: #2a2f3a;
}
.upgrade-request-foot {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 12px 0 0;
    padding: 10px 12px;
    background: rgba(0,0,0,0.03);
    border-radius: 8px;
    font-size: 0.84em;
    color: var(--text-tertiary);
}
[data-theme="dark"] .upgrade-request-foot { background: rgba(255,255,255,0.04); }
.upgrade-request-foot i { width: 14px; height: 14px; margin-top: 2px; flex-shrink: 0; }
.upgrade-request-foot a {
    color: #6c4fed;
    text-decoration: none;
    font-weight: 600;
}
.upgrade-request-foot a:hover { text-decoration: underline; }
.upgrade-request-footer {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    padding: 12px 18px;
    border-top: 1px solid var(--card-border, rgba(0,0,0,0.07));
}
.upgrade-request-footer .btn-primary i,
.upgrade-request-footer .btn-secondary i {
    width: 14px; height: 14px;
    margin-right: 4px;
    vertical-align: -2px;
}

/* ===========================================================================
   QUOTA EXCEEDED MODAL
   =========================================================================== */
.quota-exceeded-box {
    max-width: 460px;
    width: min(460px, calc(100% - 32px));
}
.quota-exceeded-body {
    text-align: center;
    padding: 20px 24px;
}
.quota-exceeded-icon {
    display: flex;
    justify-content: center;
    margin-bottom: 14px;
}
.quota-exceeded-icon i {
    width: 48px;
    height: 48px;
    color: #f59e0b;
    background: rgba(245, 158, 11, 0.12);
    padding: 14px;
    border-radius: 50%;
}
.quota-exceeded-body p {
    margin: 0 0 10px;
    color: var(--text-secondary, var(--text-primary));
    font-size: 1em;
}
.quota-exceeded-sub {
    color: var(--text-tertiary) !important;
    font-size: 0.88em !important;
}
.quota-exceeded-footer {
    display: flex;
    gap: 8px;
    justify-content: center;
    padding: 12px 18px 18px;
}
.quota-exceeded-footer .btn-primary i,
.quota-exceeded-footer .btn-secondary i {
    width: 14px; height: 14px;
    margin-right: 4px;
    vertical-align: -2px;
}

/* ===========================================================================
   UPGRADE REQUESTS TAB (admin) — status badges
   =========================================================================== */
.upgrade-status {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.78em;
    font-weight: 600;
    text-transform: capitalize;
}
.upgrade-status.status-pending {
    background: rgba(245, 158, 11, 0.18);
    color: #b3771b;
}
.upgrade-status.status-approved {
    background: rgba(34, 197, 94, 0.18);
    color: #16a34a;
}
.upgrade-status.status-rejected {
    background: rgba(239, 68, 68, 0.18);
    color: #dc2626;
}
[data-theme="dark"] .upgrade-status.status-pending { color: #f5b400; }
[data-theme="dark"] .upgrade-status.status-approved { color: #4ade80; }
[data-theme="dark"] .upgrade-status.status-rejected { color: #f87171; }

/* Force-hide the MentoraMiles section (replaced by Plan & Quota) */
#milesCard { display: none !important; }

/* ===========================================================================
   BYTEBLOOM BRANDING — header subtitle, sidebar byline, legal publisher line
   =========================================================================== */
.app-title {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.1;
    gap: 1px;
}
.app-title-main {
    font-size: 1.1em;
    font-weight: 800;
    letter-spacing: -0.01em;
    color: var(--text-primary);
}
.app-title-byline {
    font-family: 'Dancing Script', 'Apple Chancery', cursive;
    font-size: 0.78em;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
    background: linear-gradient(120deg,
        #EC4899 0%,
        #A855F7 25%,
        #6366F1 50%,
        #A855F7 75%,
        #EC4899 100%);
    background-size: 220% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: bylineShimmer 5s ease-in-out infinite;
    text-shadow: 0 0 24px rgba(168, 85, 247, 0.2);
    line-height: 1.1;
    margin-top: 2px;
}
.app-title-byline strong {
    font-family: inherit;
    font-weight: 700;
    color: transparent;
    background: inherit;
    -webkit-background-clip: text;
    background-clip: text;
    letter-spacing: -0.005em;
    text-transform: none;
}

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

.sidebar-byline {
    margin: 0;
    padding: 4px 11px;
    background:
        linear-gradient(135deg, rgba(236, 72, 153, 0.10), rgba(99, 102, 241, 0.10));
    border-radius: 999px;
    font-size: 0.88em;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    width: fit-content;
    max-width: 100%;
    white-space: nowrap;
    border: 1px solid rgba(168, 85, 247, 0.22);
    line-height: 1.3;
    font-family: 'Dancing Script', 'Apple Chancery', cursive;
    box-shadow: 0 4px 14px rgba(168, 85, 247, 0.10);
}
.sidebar-byline i { width: 13px; height: 13px; color: #16a34a; flex-shrink: 0; }
.sidebar-byline-logo {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    object-fit: contain;
    display: inline-block;
    vertical-align: middle;
}
.sidebar-byline strong {
    font-family: inherit;
    font-weight: 700;
    background: linear-gradient(120deg,
        #EC4899 0%,
        #A855F7 35%,
        #6366F1 70%,
        #A855F7 100%);
    background-size: 220% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: bylineShimmer 5s ease-in-out infinite;
}

/* Privacy / T&C publisher disclaimer line */
.consent-publisher {
    padding: 12px 14px;
    background: linear-gradient(135deg, rgba(236, 72, 153, 0.06), rgba(99, 102, 241, 0.06));
    border-left: 3px solid #A855F7;
    border-radius: 8px;
    font-size: 0.92em;
    line-height: 1.5;
    margin: 0 0 14px;
}

/* ===========================================================================
   ABOUT PAGE — hero, facts grid, ByteBloom card
   =========================================================================== */
.about-hero {
    text-align: center;
    margin-bottom: 22px;
    padding-bottom: 22px;
    border-bottom: 1px solid var(--border-color);
}
.about-hero-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    border-radius: 18px;
    background: linear-gradient(135deg, #EC4899 0%, #A855F7 50%, #6366F1 100%);
    color: #fff;
    margin-bottom: 12px;
    box-shadow: 0 10px 30px rgba(168, 85, 247, 0.28);
}
.about-hero-icon i { width: 28px; height: 28px; }

/* When the hero icon is the ByteBloom leaf logo (green), swap the colourful
   gradient for a clean white tile with a subtle green glow so the logo reads. */
.about-hero-icon.about-hero-icon-logo {
    background: #ffffff;
    padding: 8px;
    box-shadow:
        0 12px 32px rgba(22, 163, 74, 0.22),
        0 0 0 1px rgba(22, 163, 74, 0.08) inset;
}
.about-hero-icon.about-hero-icon-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}
body.dark-mode .about-hero-icon.about-hero-icon-logo {
    background: #ffffff;
}
.about-hero h2 { margin: 0 0 6px; font-size: 2em; }
.about-byline {
    margin: 0;
    color: var(--text-tertiary);
    font-size: 1.05em;
    font-family: 'Dancing Script', 'Apple Chancery', cursive;
    font-weight: 500;
    line-height: 1.3;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
}
.about-byline-logo {
    width: 22px;
    height: 22px;
    object-fit: contain;
    vertical-align: middle;
    flex-shrink: 0;
}
.about-byline strong {
    font-family: inherit;
    background: linear-gradient(120deg,
        #EC4899 0%,
        #A855F7 35%,
        #6366F1 70%,
        #A855F7 100%);
    background-size: 220% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-weight: 700;
    animation: bylineShimmer 5s ease-in-out infinite;
}
.about-lead {
    font-size: 1em;
    line-height: 1.65;
    color: var(--text-secondary);
    margin-bottom: 22px;
}

/* Facts grid */
.about-facts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
    margin: 0 0 28px;
}
.about-fact {
    display: flex;
    gap: 12px;
    padding: 14px 16px;
    background: var(--bg-soft);
    border: 1px solid var(--border-color);
    border-radius: 12px;
}
.about-fact i {
    width: 22px;
    height: 22px;
    color: #A855F7;
    flex-shrink: 0;
    margin-top: 2px;
}
.about-fact strong { display: block; color: var(--text-primary); margin-bottom: 2px; }
.about-fact span { color: var(--text-tertiary); font-size: 0.88em; line-height: 1.45; }

/* Section titles with leading icon */
.about-section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 28px 0 12px;
    font-size: 1.15em;
    font-weight: 700;
}
.about-section-title i {
    width: 20px;
    height: 20px;
    color: #A855F7;
    background: rgba(168, 85, 247, 0.12);
    padding: 6px;
    border-radius: 8px;
    box-sizing: content-box;
}

.about-list {
    list-style: none;
    padding: 0;
    margin: 0 0 16px;
}
.about-list li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 0;
    color: var(--text-secondary);
}
.about-list li i {
    width: 16px;
    height: 16px;
    color: #6366F1;
    margin-top: 3px;
    flex-shrink: 0;
}

/* ByteBloom card */
.about-bytebloom {
    margin-top: 28px;
}
.about-bytebloom-card {
    display: flex;
    gap: 18px;
    padding: 22px;
    background:
        radial-gradient(circle at 0% 0%, rgba(236, 72, 153, 0.12) 0%, transparent 50%),
        radial-gradient(circle at 100% 100%, rgba(99, 102, 241, 0.12) 0%, transparent 50%),
        var(--card-bg);
    border: 1px solid rgba(168, 85, 247, 0.25);
    border-radius: 16px;
    box-shadow: 0 12px 32px rgba(168, 85, 247, 0.10);
}
.about-bytebloom-mark {
    flex-shrink: 0;
    width: 64px;
    height: 64px;
    border-radius: 18px;
    background: linear-gradient(135deg, #EC4899 0%, #A855F7 50%, #6366F1 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 26px rgba(168, 85, 247, 0.4);
}
.about-bytebloom-letter {
    font-size: 2em;
    font-weight: 800;
    letter-spacing: -0.04em;
}
.about-bytebloom-mark-logo {
    background: #ffffff;
    padding: 6px;
    box-shadow:
        0 10px 28px rgba(22, 163, 74, 0.18),
        0 0 0 1px rgba(22, 163, 74, 0.08) inset;
}
body.dark-mode .about-bytebloom-mark-logo {
    background: #ffffff;
}
.about-bytebloom-mark-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}
.about-bytebloom-body { flex: 1; }
.about-bytebloom-body h4 {
    margin: 0 0 8px;
    font-size: 1.1em;
    font-weight: 800;
    color: var(--text-primary);
}
.about-bytebloom-body p {
    margin: 0 0 10px;
    color: var(--text-secondary);
    line-height: 1.55;
    font-size: 0.93em;
}
.about-bytebloom-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px dashed var(--border-color);
    font-size: 0.86em;
    color: var(--text-tertiary);
}
.about-bytebloom-meta span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.about-bytebloom-meta i { width: 14px; height: 14px; color: #A855F7; }
.about-bytebloom-meta strong { color: var(--text-primary); font-weight: 700; }

@media (max-width: 560px) {
    .about-bytebloom-card { flex-direction: column; gap: 14px; padding: 18px; }
}

.about-footer {
    margin: 8px 0 0;
    padding-top: 18px;
    border-top: 1px solid var(--border-color);
    text-align: center;
    font-size: 0.82em;
    color: var(--text-tertiary);
}

/* Asterisk inline marker next to "free" mentions */
.about-asterisk {
    color: #A855F7;
    font-weight: 800;
    font-size: 0.85em;
    margin-left: 1px;
}

/* Small T&C-apply note placed above the copyright footer */
.about-tnc-note {
    margin: 24px 0 0;
    padding: 12px 16px;
    background: rgba(168, 85, 247, 0.06);
    border-left: 3px solid #A855F7;
    border-radius: 8px;
    font-size: 0.85em;
    line-height: 1.5;
    color: var(--text-tertiary);
}
.about-tnc-note .about-asterisk { margin-right: 4px; }
.about-tnc-note a {
    color: #A855F7;
    font-weight: 600;
    text-decoration: none;
    border-bottom: 1px dashed rgba(168, 85, 247, 0.4);
}
.about-tnc-note a:hover { border-bottom-style: solid; }

/* ByteBloom tagline (the quoted line) */
.about-bytebloom-tagline {
    margin: 0 0 12px !important;
    padding: 8px 14px;
    background: linear-gradient(135deg, rgba(22, 163, 74, 0.08), rgba(34, 197, 94, 0.04));
    border-left: 3px solid #16a34a;
    border-radius: 6px;
    font-size: 0.95em !important;
    color: var(--text-primary) !important;
}
.about-bytebloom-tagline em {
    font-family: 'Dancing Script', 'Apple Chancery', cursive;
    font-size: 1.15em;
    font-style: normal;
    font-weight: 500;
}

/* Make the ByteBloom website link in the meta row a bit more obvious */
.about-bytebloom-meta a {
    color: #A855F7;
    font-weight: 600;
    text-decoration: none;
    border-bottom: 1px dashed rgba(168, 85, 247, 0.3);
}
.about-bytebloom-meta a:hover { border-bottom-style: solid; }

/* ===========================================================================
   PWA — install banner + iOS tip
   =========================================================================== */
.pwa-install-banner {
    position: fixed;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    width: min(440px, calc(100% - 24px));
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: 0 12px 32px rgba(0,0,0,0.18);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 10500;
    animation: pwaSlideUp 0.32s cubic-bezier(0.22, 1, 0.36, 1);
    font-family: 'Manrope', -apple-system, sans-serif;
}
.pwa-install-banner.hidden { display: none; }
@keyframes pwaSlideUp {
    from { transform: translate(-50%, 30px); opacity: 0; }
    to   { transform: translate(-50%, 0);     opacity: 1; }
}
.pwa-install-banner-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    overflow: hidden;
    background: linear-gradient(135deg, #EC4899, #6366F1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.pwa-install-banner-icon img { width: 40px; height: 40px; display: block; }
.pwa-install-banner-icon i {
    width: 20px; height: 20px;
    color: #fff;
}
.pwa-install-banner-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 0.88em;
    line-height: 1.35;
}
.pwa-install-banner-text strong {
    color: var(--text-primary);
    font-weight: 700;
}
.pwa-install-banner-text span {
    color: var(--text-tertiary);
    font-size: 0.92em;
}
.pwa-install-banner-text .inline-i {
    width: 14px;
    height: 14px;
    vertical-align: -3px;
    margin: 0 2px;
}
.pwa-install-banner-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}
.pwa-install-banner-actions .btn-small { padding: 6px 12px; font-size: 0.82em; }
.pwa-install-banner-actions .btn-small i { width: 13px; height: 13px; margin-right: 3px; vertical-align: -2px; }

.pwa-ios-tip .pwa-install-banner-icon {
    background: linear-gradient(135deg, #0EA5E9, #6366F1);
}

@media (max-width: 520px) {
    .pwa-install-banner {
        flex-wrap: wrap;
        bottom: 10px;
    }
    .pwa-install-banner-actions { width: 100%; justify-content: flex-end; }
}

/* Safe-area padding when running as installed PWA on iOS (notch / home indicator) */
@supports (padding: env(safe-area-inset-top)) {
    body { padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom); }
}

/* ===========================================================================
   SMOOTH ANIMATIONS — page fades, button spinner, GPU-accelerated transforms
   =========================================================================== */
.page-fade-in {
    animation: pageFadeIn 0.36s cubic-bezier(0.22, 1, 0.36, 1) both;
    will-change: opacity, transform;
}
@keyframes pageFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Spinner inside the login button while signing in */
.btn-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    margin-right: 6px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #ffffff;
    border-radius: 50%;
    vertical-align: -2px;
    animation: btnSpin 0.7s linear infinite;
}
@keyframes btnSpin { to { transform: rotate(360deg); } }
.btn-primary.is-loading { opacity: 0.85; cursor: progress; }

/* Make hover transitions on cards/buttons use the same easing for consistency */
.grid-card,
.btn-primary,
.btn-secondary,
.btn-danger,
.btn-icon,
.btn-icon-action,
.sidebar-item,
.miles-tab,
.login-tab,
.m-tab-btn,
.consent-tab,
.dc-source-tab,
.qa-mode-tab {
    transition:
        transform 0.22s cubic-bezier(0.22, 1, 0.36, 1),
        background-color 0.22s ease,
        color 0.22s ease,
        border-color 0.22s ease,
        box-shadow 0.22s ease,
        opacity 0.18s ease;
    will-change: transform;
}

/* Sidebar — silkier slide-in/out */
.sidebar {
    transition:
        transform 0.32s cubic-bezier(0.22, 1, 0.36, 1),
        box-shadow 0.32s ease,
        background-color 0.22s ease;
    will-change: transform;
}
#sidebarOverlay {
    transition: opacity 0.28s ease, backdrop-filter 0.28s ease;
}

/* Toast slide-in smoother */
.toast {
    transition:
        transform 0.32s cubic-bezier(0.22, 1, 0.36, 1),
        opacity 0.22s ease;
}

/* Modals — already animate; make the easing consistent */
.custom-alert-overlay {
    transition: opacity 0.28s ease, visibility 0s linear 0.28s;
}
.custom-alert-overlay.active {
    transition: opacity 0.28s ease, visibility 0s linear 0s;
}
.custom-alert-box {
    transition:
        transform 0.32s cubic-bezier(0.22, 1, 0.36, 1),
        opacity 0.22s ease;
}

/* ===========================================================================
   BOOT SPLASH — first paint, before any script.js runs
   =========================================================================== */
.boot-splash {
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse at 20% 0%, rgba(236, 72, 153, 0.55) 0%, transparent 55%),
        radial-gradient(ellipse at 80% 100%, rgba(99, 102, 241, 0.5) 0%, transparent 55%),
        linear-gradient(180deg, #1a0f2e 0%, #0B1117 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    overflow: hidden;
    opacity: 1;
    transition: opacity 0.55s ease, visibility 0s linear 0.55s;
    pointer-events: all;
    color: #fff;
    font-family: 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif;
    padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
}
.boot-splash.hiding {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.boot-bg-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.6;
    pointer-events: none;
    animation: bootOrbDrift 10s ease-in-out infinite alternate;
}
.boot-bg-orb-1 {
    top: -10%; left: -10%;
    width: 320px; height: 320px;
    background: radial-gradient(circle, #EC4899, transparent 70%);
}
.boot-bg-orb-2 {
    bottom: -15%; right: -15%;
    width: 380px; height: 380px;
    background: radial-gradient(circle, #6366F1, transparent 70%);
    animation-delay: -3s;
}
.boot-bg-orb-3 {
    top: 30%; right: -20%;
    width: 280px; height: 280px;
    background: radial-gradient(circle, #A855F7, transparent 70%);
    animation-delay: -6s;
}
@keyframes bootOrbDrift {
    from { transform: translate(0, 0) scale(1); }
    to   { transform: translate(40px, -30px) scale(1.1); }
}

.boot-stage {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 1;
    animation: bootStageIn 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes bootStageIn {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

.boot-logo {
    position: relative;
    width: 120px;
    height: 120px;
    margin-bottom: 28px;
}
.boot-logo img {
    width: 120px;
    height: 120px;
    display: block;
    border-radius: 28px;
    box-shadow:
        0 0 0 1px rgba(255,255,255,0.10),
        0 20px 50px rgba(168, 85, 247, 0.45),
        0 8px 24px rgba(0, 0, 0, 0.35);
    animation: bootLogoFloat 3.5s ease-in-out infinite;
    will-change: transform;
}
@keyframes bootLogoFloat {
    0%, 100% { transform: translateY(0) scale(1); }
    50%      { transform: translateY(-8px) scale(1.03); }
}

.boot-ring {
    position: absolute;
    inset: 0;
    border: 2px solid rgba(255, 255, 255, 0.45);
    border-radius: 28px;
    opacity: 0;
    animation: bootRingPulse 2.2s ease-out infinite;
    pointer-events: none;
}
.boot-ring-2 { animation-delay: 0.7s; }
.boot-ring-3 { animation-delay: 1.4s; }
@keyframes bootRingPulse {
    0%   { transform: scale(1);   opacity: 0.55; }
    100% { transform: scale(1.55); opacity: 0; }
}

.boot-name {
    font-size: 2em;
    font-weight: 800;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, #fff 0%, #f1f5f9 50%, #cbd5e1 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 8px;
    text-align: center;
}

.boot-tagline {
    color: rgba(255, 255, 255, 0.65);
    font-size: 0.95em;
    font-weight: 500;
    margin-bottom: 22px;
    text-align: center;
}

.boot-dots {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.boot-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.65);
    animation: bootDotPulse 1.2s ease-in-out infinite;
}
.boot-dots span:nth-child(2) { animation-delay: 0.15s; }
.boot-dots span:nth-child(3) { animation-delay: 0.30s; }
@keyframes bootDotPulse {
    0%, 100% { transform: scale(0.7); opacity: 0.4; }
    50%      { transform: scale(1.0); opacity: 1; }
}

.boot-version {
    position: absolute;
    bottom: calc(20px + env(safe-area-inset-bottom));
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.75em;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-weight: 600;
}

/* ===========================================================================
   MOBILE / iOS PWA POLISH
   =========================================================================== */

/* Prevent iOS Safari from zooming when an input is focused */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="tel"],
input[type="search"],
input[type="url"],
input[type="date"],
textarea,
select {
    font-size: 16px;
}

/* Larger touch targets on mobile */
@media (max-width: 768px) {
    .btn-primary,
    .btn-secondary,
    .btn-danger,
    .btn-icon,
    .btn-icon-action,
    .sidebar-item,
    .m-tab-btn,
    .login-tab {
        min-height: 44px;
    }

    /* Status bar safe area for PWA standalone */
    .app-header {
        padding-top: 12px;
        padding-left: max(16px, env(safe-area-inset-left));
        padding-right: max(16px, env(safe-area-inset-right));
        position: sticky;
        top: 0;
        z-index: 100;
        backdrop-filter: saturate(180%) blur(14px);
        -webkit-backdrop-filter: saturate(180%) blur(14px);
        background: rgba(255, 255, 255, 0.85);
        border-bottom: 1px solid var(--border-color);
    }
    body.dark-mode .app-header {
        background: rgba(11, 17, 23, 0.85);
    }

    /* Sidebar slides in cleanly on mobile */
    .sidebar {
        padding-top: calc(20px + env(safe-area-inset-top));
        padding-bottom: env(safe-area-inset-bottom);
        box-shadow: 0 0 50px rgba(0,0,0,0.18);
    }
    #sidebarOverlay.active {
        backdrop-filter: blur(2px);
        -webkit-backdrop-filter: blur(2px);
        background: rgba(0,0,0,0.45);
    }

    /* Main content padding */
    .main-content {
        padding-left: max(16px, env(safe-area-inset-left));
        padding-right: max(16px, env(safe-area-inset-right));
        padding-bottom: max(24px, env(safe-area-inset-bottom));
    }

    /* Cards: tighter padding on small screens */
    .card { padding: 18px; }
    .dashboard-card-new { padding: 18px; }
    .dashboard-grid-new {
        gap: 12px;
    }

    /* Modal scaling */
    .custom-alert-box {
        width: calc(100% - 24px);
        max-height: 90vh;
        overflow-y: auto;
    }

    /* Install banner — slimmer on mobile */
    .pwa-install-banner {
        bottom: calc(12px + env(safe-area-inset-bottom));
    }

    /* Profile hero stacks vertically on phone */
    .profile-hero-inner {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 14px;
    }
    .profile-hero-chips { justify-content: center; }
    .profile-hero-actions { width: 100%; justify-content: center; }

    /* Headings scale down */
    .card h2 { font-size: 22px; }
    .dashboard-header-new h2 { font-size: 26px; }
    h3 { font-size: 1.05em; }

    /* MihU report viewer goes full-width */
    .report-output-container { padding: 14px; }
}

/* Active state feedback on touch (replaces hover that doesn't exist on touch) */
@media (hover: none) {
    .btn-primary:active,
    .btn-secondary:active,
    .sidebar-item:active,
    .grid-card:active {
        transform: scale(0.98);
        opacity: 0.92;
    }
}

/* iOS PWA standalone: the floating elements need safe-area bottom */
@media (display-mode: standalone) {
    .nova-mind-floating {
        bottom: calc(20px + env(safe-area-inset-bottom));
    }
    .toast-container {
        padding-bottom: env(safe-area-inset-bottom);
    }
}

/* ===========================================================================
   MANAGEMENT PAGE MOBILE — dropdown selector + responsive tables
   =========================================================================== */
.management-tabs-mobile { display: none; }
.management-tabs-mobile-label {
    display: block;
    font-size: 0.74em;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-tertiary);
    margin-bottom: 6px;
}
.management-tabs-mobile-select {
    width: 100%;
    padding: 12px 14px;
    font-size: 0.95em;
    font-weight: 600;
    background: var(--card-bg);
    border: 1.5px solid var(--accent);
    color: var(--text-primary);
    border-radius: 12px;
    box-shadow: 0 4px 14px rgba(0,0,0,0.06);
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%236c4fed' d='M6 8 0 0h12z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 40px;
}

@media (max-width: 768px) {
    /* Hide the desktop pill tabs, show the dropdown */
    #managementPage .management-tabs { display: none; }
    #managementPage .management-tabs-mobile { display: block; margin-bottom: 16px; }

    /* Sub-headers inside tabs (qa-admin-header etc.) stack cleanly */
    .qa-admin-header {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    .qa-admin-actions {
        flex-wrap: wrap;
        gap: 6px;
    }
    .qa-admin-actions .btn-secondary { flex: 1 1 auto; min-width: 0; }

    /* Make the wide tables readable: convert the row layout into stacked cards */
    .management-card table {
        min-width: 0;
        font-size: 0.92em;
    }
    .management-card thead {
        /* hide column headers on mobile — labels move into each row */
        position: absolute;
        width: 1px; height: 1px;
        overflow: hidden;
        clip: rect(0,0,0,0);
        white-space: nowrap;
        border: 0;
    }
    .management-card tbody tr {
        display: block;
        margin-bottom: 10px;
        padding: 4px 14px;
        background: var(--card-bg);
        border: 1px solid var(--border-color);
        border-radius: 12px;
        box-shadow: 0 2px 6px rgba(0,0,0,0.03);
        transition: box-shadow 0.18s ease, border-color 0.18s ease;
        overflow: hidden;
    }
    .management-card tbody tr.expanded {
        box-shadow: 0 6px 20px rgba(0,0,0,0.06);
        border-color: var(--accent);
    }
    .management-card tbody tr td {
        /* Smooth-collapse — tds stay in the layout but their height/opacity tween. */
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 12px;
        max-height: 0;
        opacity: 0;
        padding-top: 0;
        padding-bottom: 0;
        margin: 0;
        border-bottom: 0 dashed transparent;
        overflow: hidden;
        text-align: right;
        max-width: none !important;
        white-space: normal !important;
        transition:
            max-height 0.28s cubic-bezier(0.22, 1, 0.36, 1),
            opacity 0.22s ease,
            padding 0.22s ease,
            border-color 0.22s ease;
    }
    /* The FIRST td (the user's name) is always visible — tap it to expand */
    .management-card tbody tr td:first-child {
        max-height: 56px;
        opacity: 1;
        padding: 12px 36px 12px 4px;
        font-weight: 700;
        font-size: 1em;
        border-bottom: 0;
        cursor: pointer;
        position: relative;
        user-select: none;
        -webkit-tap-highlight-color: transparent;
        justify-content: flex-start;
        text-align: left;
    }
    /* Chevron indicator pinned to the right edge */
    .management-card tbody tr td:first-child::after {
        content: "";
        position: absolute;
        right: 6px;
        top: 50%;
        width: 9px;
        height: 9px;
        border-right: 2px solid var(--text-tertiary);
        border-bottom: 2px solid var(--text-tertiary);
        transform: translateY(-70%) rotate(-45deg);
        transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.22s ease;
    }
    .management-card tbody tr.expanded td:first-child::after {
        transform: translateY(-30%) rotate(45deg);
        border-color: var(--accent);
    }
    /* Expanded state — every cell becomes visible and animates open */
    .management-card tbody tr.expanded td {
        max-height: 200px;
        opacity: 1;
        padding-top: 8px;
        padding-bottom: 8px;
        border-bottom: 1px dashed var(--border-color);
    }
    .management-card tbody tr.expanded td:last-child {
        border-bottom: 0;
        padding-bottom: 12px;
        justify-content: flex-end;
    }
    .management-card tbody tr.expanded td:first-child {
        border-bottom: 1px dashed var(--border-color);
    }
    /* Subtle gradient sheen across the expanded card */
    .management-card tbody tr.expanded {
        background: linear-gradient(180deg, var(--card-bg) 0%, var(--bg-soft) 100%);
    }

    /* User List specific labels */
    #userTableBody tr td:nth-child(1)::before { content: ""; }
    #userTableBody tr td:nth-child(2)::before { content: "User ID"; }
    #userTableBody tr td:nth-child(3)::before { content: "Email"; }
    #userTableBody tr td:nth-child(4)::before { content: "Role"; }
    #userTableBody tr td:nth-child(5)::before { content: "Plan"; }
    #userTableBody tr td:nth-child(6)::before { content: "Priority"; }
    #userTableBody tr td:nth-child(7)::before { content: "Privacy"; }
    #userTableBody tr td:nth-child(8)::before { content: "Terms"; }
    #userTableBody tr td:nth-child(9)::before { content: "Last Login"; }
    #userTableBody tr td:nth-child(10)::before { content: ""; }

    /* Registered Users labels */
    #registeredUsersTableBody tr td:nth-child(1)::before { content: ""; }
    #registeredUsersTableBody tr td:nth-child(2)::before { content: "Email"; }
    #registeredUsersTableBody tr td:nth-child(3)::before { content: "User ID"; }
    #registeredUsersTableBody tr td:nth-child(4)::before { content: "Plan"; }
    #registeredUsersTableBody tr td:nth-child(5)::before { content: "DOB"; }
    #registeredUsersTableBody tr td:nth-child(6)::before { content: "Signed up"; }
    #registeredUsersTableBody tr td:nth-child(7)::before { content: "Approved"; }
    #registeredUsersTableBody tr td:nth-child(8)::before { content: "Last login"; }
    #registeredUsersTableBody tr td:nth-child(9)::before { content: ""; }

    /* Approvals labels */
    #approvalsTableBody tr td:nth-child(1)::before { content: ""; }
    #approvalsTableBody tr td:nth-child(2)::before { content: "Email"; }
    #approvalsTableBody tr td:nth-child(3)::before { content: "User ID"; }
    #approvalsTableBody tr td:nth-child(4)::before { content: "DOB"; }
    #approvalsTableBody tr td:nth-child(5)::before { content: "Requested"; }
    #approvalsTableBody tr td:nth-child(6)::before { content: ""; }

    /* Upgrade requests labels */
    #upgradeRequestsTableBody tr td:nth-child(1)::before { content: ""; }
    #upgradeRequestsTableBody tr td:nth-child(2)::before { content: "Email"; }
    #upgradeRequestsTableBody tr td:nth-child(3)::before { content: "Current"; }
    #upgradeRequestsTableBody tr td:nth-child(4)::before { content: "Requested"; }
    #upgradeRequestsTableBody tr td:nth-child(5)::before { content: "Note"; }
    #upgradeRequestsTableBody tr td:nth-child(6)::before { content: "Filed at"; }
    #upgradeRequestsTableBody tr td:nth-child(7)::before { content: "Status"; }
    #upgradeRequestsTableBody tr td:nth-child(8)::before { content: ""; }

    /* QA Testers labels */
    #qaTestersTableBody tr td:nth-child(1)::before { content: "UID"; }
    #qaTestersTableBody tr td:nth-child(2)::before { content: ""; }
    #qaTestersTableBody tr td:nth-child(3)::before { content: "Email"; }
    #qaTestersTableBody tr td:nth-child(4)::before { content: "Org"; }
    #qaTestersTableBody tr td:nth-child(5)::before { content: "Started"; }
    #qaTestersTableBody tr td:nth-child(6)::before { content: "Status"; }
    #qaTestersTableBody tr td:nth-child(7)::before { content: "Overall"; }
    #qaTestersTableBody tr td:nth-child(8)::before { content: "Recommend"; }
    #qaTestersTableBody tr td:nth-child(9)::before { content: ""; }

    /* All ::before labels share a style */
    .management-card tbody tr td::before {
        content: attr(data-label);
        color: var(--text-tertiary);
        font-size: 0.78em;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.04em;
        text-align: left;
        flex-shrink: 0;
    }
    /* Hide pseudo-label entirely if it's empty — keeps the row clean for name/actions */
    .management-card tbody tr td::before:empty { display: none; }

    /* Loading / empty rows shouldn't render as cards */
    .management-card tbody tr td[colspan] {
        display: block;
        text-align: center;
        border: none;
    }
    .management-card tbody tr td[colspan]::before { content: none; display: none; }
    .management-card tbody tr:has(td[colspan]) {
        background: transparent;
        border: 1px dashed var(--border-color);
        box-shadow: none;
    }

    /* Cut the .overflow-x-auto border so cards float, not boxed */
    .management-card .overflow-x-auto {
        background: transparent;
        border: none;
        padding: 0;
    }

    /* Plan reset row: stack on mobile */
    .plan-reset-row {
        flex-direction: column;
        align-items: stretch;
    }
    .plan-reset-row .btn-danger { width: 100%; }

    /* Filter rows in tabs: wrap to multiple lines */
    .issues-triage-filters,
    .tracker-filters {
        flex-wrap: wrap;
    }
    .issues-triage-filters > *,
    .tracker-filters > * {
        flex: 1 1 calc(50% - 4px);
        min-width: 0;
    }
}

/* Sidebar nav badge (used for My Reports count + Approvals count) */
.nav-badge {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 7px;
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    font-size: 0.7em;
    font-weight: 700;
    line-height: 1.4;
    vertical-align: middle;
}
.nav-badge.hidden { display: none; }

