/* Reset and Base Styles */
* {
    margin: 0;
    padding: 2px;
    box-sizing: border-box;
}

/* Modern Design System Variables */
:root {
    /* Color Palette */
    --primary: #4F46E5;
    --primary-hover: #4338CA;
    --accent: #10B981;
    --accent-hover: #059669;
    --background: #F9FAFB;
    --surface: #FFFFFF;
    --text-primary: #111827;
    --text-secondary: #595959;
    --text-muted: #9CA3AF;
    --border: #E5E7EB;
    --border-hover: #D1D5DB;
    
    /* Typography */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 1.875rem;
    --font-size-4xl: 2.25rem;
    
    /* Spacing */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    --space-16: 4rem;
    
    /* Border Radius — modest corners (not pills) */
    --radius-sm: 4px;
    --radius-tbl: 6px;
    --radius: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 300ms ease;
    --transition-slow: 500ms ease;
}

html, body {
    height: 100%;
}

body {
    font-family: var(--font-family);
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--background);
    font-size: var(--font-size-base);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-5);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    margin-bottom: var(--space-4);
    color: var(--text-primary);
    line-height: 1.2;
}

h1 { font-size: var(--font-size-4xl); }
h2 { font-size: var(--font-size-3xl); }
h3 { font-size: var(--font-size-2xl); }
h4 { font-size: var(--font-size-xl); }

p {
    margin-bottom: var(--space-4);
    color: #595959;
    line-height: 1.6;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--primary-hover);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-6);
    font-size: var(--font-size-sm);
    font-weight: 500;
    text-decoration: none;
    color: #ffffff;
    border: 2px solid #ffffff;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition-normal);
    white-space: nowrap;
    font-family: inherit;
    line-height: 1;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

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

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

.btn-outline {
    background: transparent;
    color: var(--text-primary);
    border: 2px solid #ffffff;
}

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

.btn-large {
    padding: var(--space-4) var(--space-8);
    font-size: var(--font-size-base);
}

.btn-full {
    width: 100%;
    justify-content: center;
}

.btn:disabled {
    opacity: 0.8;
    cursor: not-allowed;
    transform: none;
    background-color: #0849c9;
    color: #fbfdff;
    border-color: #a9aeb6;
}

/* Header */
.header {
    background: var(--surface);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--border);
}

.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-4) 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: var(--text-primary);
}

.logo a {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    color: inherit;
    text-decoration: none;
}

.logo i {
    font-size: var(--font-size-2xl);
    color: var(--primary);
}

.nav-links {
    display: flex;
    gap: var(--space-8);
}

.nav-links a {
    font-weight: 500;
    color: var(--text-secondary);
    transition: color var(--transition-fast);
}

.nav-links a:hover {
    color: var(--primary);
}

.auth-buttons {
    display: flex;
    gap: var(--space-4);
    align-items: center;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, #e54646, #6e5cff);
    color: white;
    padding: var(--space-16) 0;
    min-height: 90vh;
    display: flex;
    align-items: center;
}

.hero .container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-16);
    align-items: center;
}

.hero-content h1 {
    font-size: var(--font-size-4xl);
    margin-bottom: var(--space-10);
    color: white;
    font-weight: 700;
}

.hero-content p {
    font-size: var(--font-size-lg);
    margin-bottom: var(--space-8);
    color: rgba(255, 255, 255, 0.9);
}

.hero-buttons {
    display: flex;
    gap: var(--space-4);
}

.hero-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border-radius: var(--radius-xl);
    padding: var(--space-8);
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.hero-card i {
    font-size: var(--font-size-3xl);
    margin-bottom: var(--space-4);
    color: var(--accent);
}

/* Features Section */
.features {
    padding: var(--space-16) 0;
    background: var(--surface);
}

.features h2 {
    text-align: center;
    margin-bottom: var(--space-12);
    font-size: var(--font-size-3xl);
    color: var(--text-primary);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--space-8);
}

.feature-card {
    background: var(--surface);
    padding: var(--space-8);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    text-align: center;
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
    border: 1px solid var(--border);
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

.feature-icon {
    width: 4rem;
    height: 4rem;
    margin: 0 auto var(--space-6);
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: var(--font-size-xl);
}

.feature-card h3 {
    margin-bottom: var(--space-4);
    color: var(--text-primary);
}

.feature-card p {
    color: var(--text-secondary);
    margin-bottom: 0;
}

/* About Section */
.about {
    padding: var(--space-16) 0;
    background: var(--background);
}

.about-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: var(--space-12);
    align-items: center;
}

.about-text ul {
    list-style: none;
    margin-top: var(--space-6);
}

.about-text li {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-bottom: var(--space-3);
    color: var(--text-secondary);
}

.about-text li i {
    color: var(--accent);
    font-size: var(--font-size-sm);
}

.about-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-6);
}

.stat {
    text-align: center;
    padding: var(--space-6);
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.stat-number {
    font-size: var(--font-size-3xl);
    font-weight: 700;
    color: var(--primary);
    margin-bottom: var(--space-2);
}

.stat-label {
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
}

/* Footer */
.footer {
    background: var(--text-primary);
    color: white;
    padding: var(--space-16) 0 var(--space-8);
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: var(--space-8);
    margin-bottom: var(--space-8);
}

.footer-section h3 {
    margin-bottom: var(--space-4);
    color: white;
}

.footer-section ul {
    list-style: none;
}

.footer-section li {
    margin-bottom: var(--space-2);
}

.footer-section a {
    color: rgba(255, 255, 255, 0.8);
    transition: color var(--transition-fast);
}

.footer-section a:hover {
    color: white;
}

.social-links {
    display: flex;
    gap: var(--space-4);
}

.social-links a {
    width: 40px;
    height: 40px;
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.social-links a:hover {
    background: var(--primary);
    transform: translateY(-2px);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: var(--space-6);
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
}

/* Auth Section */
.auth-section {
    height: calc(100vh - 80px); /* Subtract header height */
    background: linear-gradient(135deg, var(--background) 0%, var(--surface) 100%);
    display: flex;
    align-items: center;
    padding: var(--space-8);
    overflow: hidden;
}

/* Prevent scrolling on login/signup pages */
body.auth-page {
    overflow: hidden;
}

.auth-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-12);
    align-items: center;
}

.auth-card {
    background: var(--surface);
    padding: var(--space-8);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border);
}

.auth-header {
    text-align: center;
    margin-bottom: var(--space-8);
}

.auth-header h2 {
    margin-bottom: var(--space-2);
    color: var(--text-primary);
}

.auth-header p {
    color: var(--text-secondary);
    margin-bottom: 0;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-6);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.form-group label {
    font-weight: 500;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.form-group input {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-size: var(--font-size-base);
    transition: border-color var(--transition-fast);
    background: var(--surface);
    box-sizing: border-box;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.password-input {
    position: relative;
    width: 100%;
}

.password-toggle {
    position: absolute;
    right: var(--space-3);
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: var(--space-1);
    z-index: 10;
}

.password-toggle:hover {
    color: var(--text-primary);
}

.auth-footer {
    text-align: center;
    margin-top: var(--space-6);
    padding-top: var(--space-6);
    border-top: 1px solid var(--border);
}

.auth-decoration {
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    padding: var(--space-8);
    border-radius: var(--radius-xl);
    color: white;
    text-align: center;
}

.decoration-content i {
    font-size: var(--font-size-4xl);
    margin-bottom: var(--space-4);
    color: var(--accent);
}

.decoration-content h3 {
    margin-bottom: var(--space-4);
    color: white;
}

.decoration-content p {
    margin-bottom: var(--space-8);
    color: rgba(255, 255, 255, 0.9);
}

.decoration-features {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.decoration-features .feature {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    color: rgba(255, 255, 255, 0.9);
}

.decoration-features .feature i {
    color: var(--accent);
    font-size: var(--font-size-sm);
}

/* Dashboard Styles */
.dashboard-container {
    display: flex;
    min-height: 100vh;
    background: var(--background);
}

.sidebar {
    width: 280px;
    background: var(--surface);
    border-right: 1px solid var(--border);
    padding: var(--space-6);
}

.sidebar-header {
    margin-bottom: var(--space-8);
}

.sidebar-nav {
    list-style: none;
}

.sidebar-nav li {
    margin-bottom: var(--space-2);
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius);
    color: var(--text-secondary);
    transition: all var(--transition-fast);
    text-decoration: none;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
    background: var(--primary);
    color: white;
}

.sidebar-nav a i {
    width: 20px;
    text-align: center;
}

.main-content {
    flex: 1;
    padding: var(--space-8);
    overflow-y: auto;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-8);
    padding-bottom: var(--space-6);
    border-bottom: 1px solid var(--border);
}

.dashboard-title {
    margin-bottom: 0;
    color: var(--text-primary);
}

.user-menu {
    display: flex;
    align-items: center;
    gap: var(--space-4);
}

.user-info {
    text-align: right;
}

.user-name {
    font-weight: 600;
    color: var(--text-primary);
}

.user-role {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

.card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    margin-bottom: var(--space-6);
}

.card-header {
    padding: var(--space-6);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-title {
    margin-bottom: 0;
    color: var(--text-primary);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-6);
    margin-bottom: var(--space-8);
}

.stat-card {
    background: var(--surface);
    padding: var(--space-6);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    text-align: center;
    border: 1px solid var(--border);
}

.stat-card i {
    font-size: var(--font-size-2xl);
    color: var(--primary);
    margin-bottom: var(--space-4);
}

.stat-value {
    font-size: var(--font-size-3xl);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-2);
}

.stat-label {
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
}

/* Table Styles */
.table-container {
    overflow-x: auto;
    border-radius: var(--radius-tbl);
    border: 1px solid var(--border);
}

.table-header-controls {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-bottom: var(--space-4);
    padding: var(--space-3) var(--space-4);
    background: var(--surface);
    border-radius: var(--radius-tbl) var(--radius-tbl) 0 0;
    border-bottom: 1px solid var(--border);
}

.filter-controls {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.filter-controls label {
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--text-secondary);
    margin: 0;
}

.filter-controls select {
    padding: var(--space-2) var(--space-3);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: var(--font-size-sm);
    background: var(--surface);
    color: var(--text-primary);
    cursor: pointer;
    transition: border-color var(--transition-fast);
}

.filter-controls select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.1);
}

.text-red-500 {
    color: #EF4444;
}

.table {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface);
    font-size: var(--font-size-sm);
}

.table th,
.table td {
    padding: var(--space-4);
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.table th {
    background: var(--background);
    font-weight: 600;
    color: var(--text-primary);
    position: sticky;
    top: 0;
    z-index: 10;
}

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

.table .btn {
    padding: var(--space-2) var(--space-3);
    font-size: var(--font-size-xs);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--surface);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid var(--border);
    /* Custom scrollbar styles */
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

.modal-content::-webkit-scrollbar {
    width: 8px;
}

.modal-content::-webkit-scrollbar-track {
    background: transparent;
    border-radius: var(--radius);
}

.modal-content::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: var(--radius);
    border: 2px solid var(--surface);
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

.modal.active .modal-content {
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    padding: var(--space-6);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    margin-bottom: 0;
    color: var(--text-primary);
}

.modal-close {
    background: none;
    border: none;
    font-size: var(--font-size-xl);
    color: var(--text-secondary);
    cursor: pointer;
    padding: var(--space-2);
    border-radius: var(--radius);
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: var(--background);
    color: var(--text-primary);
}

.modal-actions {
    padding: var(--space-6);
    border-top: 1px solid var(--border);
    display: flex;
    gap: var(--space-4);
    justify-content: flex-end;
}

/* Alert Styles */
#alertContainer {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 12000;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    pointer-events: none;
}

#alertContainer .alert {
    pointer-events: auto;
}

.alert {
    position: relative;
    padding: 0.45rem 0.75rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    z-index: 12001;
    transform: translateX(100%);
    transition: transform var(--transition-normal);
    max-width: 360px;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    line-height: 1.3;
}

.alert.show {
    transform: translateX(0);
}

.alert-body {
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.alert-body > i {
    font-size: 0.9rem;
    flex-shrink: 0;
}

.alert-message {
    flex: 1;
    min-width: 0;
}

.alert-success {
    background: var(--accent);
    color: white;
}

.alert-error {
    background: #EF4444;
    color: white;
}

.alert-warning {
    background: #F59E0B;
    color: white;
}

.alert-info {
    background: var(--primary);
    color: white;
}

/* Utility Classes */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.btn-sm {
    padding: var(--space-2) var(--space-4);
    font-size: var(--font-size-xs);
}

.btn-lg {
    padding: var(--space-4) var(--space-8);
    font-size: var(--font-size-lg);
}

.hidden { display: none; }

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 var(--space-4);
    }
    
    .hero .container {
        grid-template-columns: 1fr;
        gap: var(--space-8);
    }
    
    .hero-content h1 {
        font-size: var(--font-size-3xl);
    }
    
    .hero-buttons {
        flex-direction: column;
    }
    
    .about-content {
        grid-template-columns: 1fr;
        gap: var(--space-8);
    }
    
    .auth-section {
        height: calc(100vh - 70px); /* Subtract header height on mobile */
        padding: var(--space-4) 0;
        overflow: hidden;
        margin-top: 70px; /* Account for header height on mobile */
    }
    
    .auth-container {
        grid-template-columns: 1fr;
        gap: var(--space-6);
        max-height: 100vh;
        overflow-y: auto;
    }
    
    .auth-decoration {
        display: none;
    }
    
    .dashboard-container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }
    
    .nav-links {
        display: none;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        width: 95%;
        margin: var(--space-4);
    }
    
    .alert {
        right: var(--space-4);
        left: var(--space-4);
        max-width: none;
    }
    
    /* Mobile table adjustments */
    .table-container {
        border-radius: 0;
        border-left: none;
        border-right: none;
        overflow-x: scroll;
    }
    
    .table {
        font-size: var(--font-size-xs);
        min-width: 600px;
    }
    
    .table th,
    .table td {
        padding: var(--space-2) var(--space-3);
        white-space: nowrap;
    }
}

@media (max-width: 480px) {
    .hero-content h1 {
        font-size: var(--font-size-2xl);
    }
    
    .features h2 {
        font-size: var(--font-size-2xl);
    }
    
    .feature-card {
        padding: var(--space-6);
    }
    
    .auth-section {
        height: calc(100vh - 60px); /* Subtract header height on small screens */
        padding: var(--space-2) 0;
        margin-top: 60px; /* Account for header height on small screens */
    }
    
    .auth-container {
        gap: var(--space-4);
    }
    
    .auth-card {
        padding: var(--space-4);
    }
    
    .main-content {
        padding: var(--space-4);
    }
    
    .card {
        margin-bottom: var(--space-4);
    }
}

/* Response Modal Styles */
.response-modal {
    display: none;
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 10, 30, 0.48);
    z-index: 1000;
    backdrop-filter: blur(6px);
    padding: 1.25rem;
    box-sizing: border-box;
}

.response-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.response-modal-content {
    background: #fff;
    border-radius: 1rem;
    box-shadow: 0 24px 64px rgba(15, 10, 30, 0.22);
    max-width: 44rem;
    width: min(100%, 44rem);
    max-height: min(90vh, 52rem);
    display: flex;
    flex-direction: column;
    border: 1px solid var(--auth-border, rgba(20, 16, 31, 0.12));
    animation: modalSlideIn 0.22s ease;
    overflow: hidden;
}

.response-modal-header {
    padding: 1rem 1.15rem 0.95rem;
    border-bottom: 1px solid var(--auth-border, rgba(20, 16, 31, 0.12));
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
    flex-shrink: 0;
    background:
      linear-gradient(135deg, color-mix(in srgb, var(--auth-grad-from, #e54646) 8%, #fff), color-mix(in srgb, var(--auth-grad-to, #6e5cff) 10%, #fff));
}

.response-modal-heading {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.55rem 0.75rem;
    min-width: 0;
}

.response-modal-title {
    margin: 0;
    color: var(--auth-ink, #14101f);
    font-family: var(--auth-display, Georgia, serif);
    font-size: 1.2rem;
    font-weight: 650;
    letter-spacing: -0.01em;
}

.response-status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.response-status-badge.is-answered {
    background: color-mix(in srgb, #10b981 16%, #fff);
    color: #047857;
}

.response-status-badge.is-unanswered {
    background: color-mix(in srgb, #ef4444 14%, #fff);
    color: #b91c1c;
}

.response-modal-close {
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid var(--auth-border, rgba(20, 16, 31, 0.12));
    width: 2rem;
    height: 2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--auth-muted, rgba(20, 16, 31, 0.62));
    cursor: pointer;
    border-radius: 0.5rem;
    flex-shrink: 0;
    transition: background 0.15s ease, color 0.15s ease;
}

.response-modal-close:hover {
    color: var(--auth-ink, #14101f);
    background: #fff;
}

.response-modal-body {
    padding: 1rem 1.15rem;
    overflow-y: auto;
    display: grid;
    gap: 1rem;
    flex: 1 1 auto;
    min-height: 0;
    scrollbar-width: thin;
    scrollbar-color: color-mix(in srgb, var(--auth-grad-to, #6e5cff) 45%, #cbd5e1) transparent;
}

.response-meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr));
    gap: 0.55rem;
}

.response-meta-chip {
    display: grid;
    gap: 0.2rem;
    padding: 0.55rem 0.7rem;
    border-radius: 0.65rem;
    background: var(--auth-ground, #f4f2f8);
    border: 1px solid var(--auth-border, rgba(20, 16, 31, 0.08));
    min-width: 0;
}

.response-meta-label {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--auth-muted, rgba(20, 16, 31, 0.62));
}

.response-meta-value {
    font-size: 0.88rem;
    font-weight: 550;
    color: var(--auth-ink, #14101f);
    word-break: break-word;
}

.response-block {
    display: grid;
    gap: 0.45rem;
    min-width: 0;
}

.response-block-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.response-block-title {
    margin: 0;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--auth-muted, rgba(20, 16, 31, 0.62));
}

.response-block-query {
    padding: 0.85rem 0.95rem;
    border-radius: 0.75rem;
    background: color-mix(in srgb, var(--auth-grad-to, #6e5cff) 7%, #fff);
    border: 1px solid color-mix(in srgb, var(--auth-grad-to, #6e5cff) 18%, transparent);
    color: var(--auth-ink, #14101f);
    font-size: 0.98rem;
    font-weight: 550;
    line-height: 1.45;
    word-break: break-word;
}

.response-block-sources {
    padding: 0.75rem 0.95rem;
    border-radius: 0.75rem;
    background: color-mix(in srgb, var(--auth-muted, rgba(20, 16, 31, 0.62)) 6%, #fff);
    border: 1px solid color-mix(in srgb, var(--auth-muted, rgba(20, 16, 31, 0.62)) 14%, transparent);
    color: var(--auth-ink, #14101f);
    font-size: 0.92rem;
    line-height: 1.45;
    word-break: break-word;
}

.response-block-answer .response-block-body {
    padding: 0.9rem 1rem;
    border-radius: 0.75rem;
    background: #fafafa;
    border: 1px solid var(--auth-border, rgba(20, 16, 31, 0.1));
    color: var(--auth-ink, #14101f);
    font-size: 0.92rem;
    line-height: 1.65;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: min(42vh, 22rem);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: color-mix(in srgb, var(--auth-grad-to, #6e5cff) 45%, #cbd5e1) transparent;
}

.response-modal-actions {
    padding: 0.85rem 1.15rem;
    border-top: 1px solid var(--auth-border, rgba(20, 16, 31, 0.12));
    display: flex;
    gap: 0.65rem;
    justify-content: flex-end;
    flex-shrink: 0;
    background: #fff;
}

@media (max-width: 640px) {
    .response-modal {
        padding: 0.65rem;
        align-items: flex-end;
    }

    .response-modal-content {
        max-height: 92vh;
        border-radius: 1rem 1rem 0.75rem 0.75rem;
    }
}

/* Print Styles */
@media print {
    .header,
    .sidebar,
    .modal,
    .alert {
        display: none;
    }
    
    .main-content {
        padding: 0;
        margin: 0;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .btn-outline {
        border-width: 3px;
    }
    
    .form-group input:focus {
        box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.2);
    }
}

/* Badge Styles */
.badge {
    display: inline-flex;
    align-items: center;
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius);
    font-size: var(--font-size-xs);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-primary {
    background: var(--primary);
    color: white;
}

.badge-secondary {
    background: var(--text-secondary);
    color: white;
}

.badge-success {
    background: var(--accent);
    color: white;
}

.badge-danger {
    background: #EF4444;
    color: white;
}

.badge-warning {
    background: #F59E0B;
    color: white;
}

.badge-info {
    background: var(--primary);
    color: white;
}

/* Progress Bar */
.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    margin: var(--space-2) 0;
}

.progress-fill {
    height: 100%;
    background: var(--primary);
    transition: width var(--transition-normal);
}

.progress-text {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    margin-top: var(--space-1);
}

/* Content Sections */
.content-section {
    display: none;
}

.content-section.active {
    display: block;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: var(--space-12);
    color: var(--text-secondary);
}

.empty-state i {
    font-size: var(--font-size-4xl);
    margin-bottom: var(--space-4);
    color: var(--text-muted);
}

.empty-state h3 {
    margin-bottom: var(--space-2);
    color: var(--text-secondary);
}

/* No Project Warning */
.no-project-warning {
    background: #FEF3C7;
    border: 1px solid #F59E0B;
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    text-align: center;
    margin-bottom: var(--space-6);
}

.no-project-warning i {
    font-size: var(--font-size-2xl);
    color: #F59E0B;
    margin-bottom: var(--space-4);
}

/* Loading State */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-8);
    color: var(--text-secondary);
}

.loading i {
    animation: spin 1s linear infinite;
    margin-right: var(--space-3);
}

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

/* Search Container */
.search-container {
    position: relative;
    margin-bottom: var(--space-6);
}

.search-container input {
    width: 100%;
    padding: var(--space-3) var(--space-4) var(--space-3) var(--space-10);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-size: var(--font-size-base);
}

.search-container i {
    position: absolute;
    left: var(--space-4);
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

/* Text Colors */
.text-success { color: var(--accent); }
.text-danger { color: #EF4444; }
.text-warning { color: #F59E0B; }
.text-muted { color: var(--text-muted); }

/* API Keys Header */
.api-keys-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-6);
    padding-bottom: var(--space-4);
    border-bottom: 1px solid var(--border);
}

.api-keys-header h4 {
    margin-bottom: 0;
    color: var(--text-primary);
}

.api-keys-header .btn {
    margin-left: auto;
}

/* Button Groups */
.btn-group {
    display: flex;
    gap: 0;
}

.btn-group .btn {
    border-radius: 0;
}

.btn-group .btn:first-child {
    border-top-left-radius: var(--radius);
    border-bottom-left-radius: var(--radius);
}

.btn-group .btn:last-child {
    border-top-right-radius: var(--radius);
    border-bottom-right-radius: var(--radius);
}

.btn-group .btn:not(:first-child):not(:last-child) {
    border-left: 1px solid rgba(255, 255, 255, 0.2);
}

.table td .btn-group {
    display: flex;
    gap: var(--space-1);
}

/* Secondary Button */
.btn-secondary {
    background: var(--text-secondary);
    color: white;
}

.btn-secondary:hover {
    background: var(--text-primary);
    color: white;
}

.btn-success {
    background: var(--accent);
    color: white;
}

.btn-success:hover {
    background: var(--accent-hover);
    color: white;
}

.btn-danger {
    background: #EF4444;
    color: white;
}

.btn-danger:hover {
    background: #DC2626;
    color: white;
}

.btn-warning {
    background: #F59E0B;
    color: white;
}

.btn-warning:hover {
    background: #D97706;
    color: white;
}

/* Upload Section */
.upload-section {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    margin-bottom: var(--space-6);
}

.upload-section .btn {
    align-self: flex-start;
}

@media (max-width: 768px) {
    .upload-section {
        flex-direction: column;
        gap: var(--space-3);
    }
    
    .upload-section .btn {
        align-self: stretch;
    }
}

/* ---------------------------------------------------------------------------
   Admin UI — login (body.auth-page) + dashboards (body.dashboard-page)
   Single global stylesheet (styles.css).
   --------------------------------------------------------------------------- */

body.auth-page,
body.dashboard-page {
  --auth-grad-from: #e54646;
  --auth-grad-to: #6e5cff;
  --auth-accent: #10b981;
  --auth-ink: #14101f;
  --auth-muted: rgba(20, 16, 31, 0.62);
  --auth-font: "Outfit", system-ui, sans-serif;
  --auth-display: "Fraunces", Georgia, serif;
  --auth-surface: #ffffff;
  --auth-ground: #f4f2f8;
  --auth-border: rgba(20, 16, 31, 0.12);
  --auth-radius: 12px;
  --auth-radius-sm: 8px;
  --auth-radius-lg: 16px;
  --cursor-default: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='18' viewBox='0 0 14 18'%3E%3Cpath fill='%2314101f' stroke='%23fff' stroke-width='1' d='M1.5 1.2 L1.5 15.5 L5.2 12.4 L11.2 12.1 Z'/%3E%3C/svg%3E") 1 1, auto;
  --cursor-pointer: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='18' viewBox='0 0 14 18'%3E%3Cpath fill='%236e5cff' stroke='%23fff' stroke-width='1' d='M1.5 1.2 L1.5 15.5 L5.2 12.4 L11.2 12.1 Z'/%3E%3C/svg%3E") 1 1, pointer;
}

body.auth-page,
body.dashboard-page {
  cursor: var(--cursor-default);
}

body.auth-page a,
body.auth-page button,
body.auth-page [role="button"],
body.auth-page input[type="submit"],
body.auth-page label,
body.auth-page select,
body.dashboard-page a,
body.dashboard-page button,
body.dashboard-page [role="button"],
body.dashboard-page .nav-link,
body.dashboard-page .row-menu-toggle,
body.dashboard-page label,
body.dashboard-page select,
body.dashboard-page summary {
  cursor: var(--cursor-pointer);
}

body.auth-page input:disabled,
body.auth-page button:disabled,
body.dashboard-page input:disabled,
body.dashboard-page button:disabled,
body.dashboard-page .btn:disabled {
  cursor: not-allowed;
}

/* Skeleton loaders */
@keyframes dash-skeleton-shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

body.dashboard-page .skeleton {
  display: inline-block;
  border-radius: 4px;
  background: linear-gradient(
    90deg,
    rgba(20, 16, 31, 0.06) 0%,
    rgba(20, 16, 31, 0.12) 45%,
    rgba(20, 16, 31, 0.06) 90%
  );
  background-size: 200% 100%;
  animation: dash-skeleton-shimmer 1.1s ease-in-out infinite;
  vertical-align: middle;
}

body.dashboard-page .skeleton-text {
  width: 100%;
  height: 0.85rem;
  max-width: 12rem;
}

body.dashboard-page .skeleton-stat {
  width: 3.25rem;
  height: 1.5rem;
}

body.dashboard-page .skeleton-block {
  display: block;
  width: 100%;
  height: 2.75rem;
  margin-bottom: 0.65rem;
}

body.dashboard-page .skeleton-stack {
  padding: 0.75rem 0;
}

body.dashboard-page .skeleton-row td {
  vertical-align: middle;
}

body.auth-page {
  margin: 0;
  min-height: 100vh;
  height: 100vh;
  font-family: var(--auth-font);
  color: var(--auth-ink);
  overflow: hidden;
  background: var(--auth-ground);
}

body.auth-page *,
body.auth-page *::before,
body.auth-page *::after {
  box-sizing: border-box;
}

/* Full-viewport 60 / 40 split — no max-width, no centered island */
.auth-shell {
  display: grid;
  grid-template-columns: 60% 40%;
  width: 100%;
  min-height: 100vh;
  height: 100%;
  margin: 0;
  padding: 0;
  gap: 0;
  max-width: none;
}

.auth-brand,
.auth-panel {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.auth-brand {
  color: #fff;
  padding: clamp(2rem, 6vw, 4.5rem) clamp(2rem, 5vw, 4rem);
  /* Same palette, richer multi-layer geometry */
  background:
    radial-gradient(ellipse 70% 55% at 8% 12%, color-mix(in srgb, var(--auth-grad-from) 85%, #fff) 0%, transparent 58%),
    radial-gradient(ellipse 65% 60% at 92% 88%, color-mix(in srgb, var(--auth-grad-to) 90%, #1a0a40) 0%, transparent 55%),
    radial-gradient(ellipse 50% 40% at 55% 45%, color-mix(in srgb, var(--auth-grad-from) 35%, var(--auth-grad-to)) 0%, transparent 70%),
    linear-gradient(
      148deg,
      var(--auth-grad-from) 0%,
      color-mix(in srgb, var(--auth-grad-from) 55%, var(--auth-grad-to)) 42%,
      var(--auth-grad-to) 100%
    );
  background-size: 160% 160%, 150% 150%, 180% 180%, 140% 140%;
  background-position: 0% 20%, 100% 80%, 50% 50%, 0% 40%;
  animation: auth-gradient-drift 22s ease-in-out infinite alternate, auth-fade-up 0.7s ease both;
}

@keyframes auth-gradient-drift {
  from {
    background-position: 0% 20%, 100% 80%, 40% 55%, 0% 40%;
  }
  to {
    background-position: 30% 50%, 70% 40%, 60% 40%, 100% 60%;
  }
}

/* Soft light accents (toned down) */
.auth-brand::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 50% 40% at 18% 22%, rgba(255, 255, 255, 0.12), transparent 55%),
    radial-gradient(ellipse 35% 30% at 72% 70%, rgba(16, 185, 129, 0.1), transparent 50%);
  z-index: 0;
}

/* Dark vignette + film grain + subtle scan */
.auth-brand::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse 75% 70% at 40% 40%, transparent 20%, rgba(10, 6, 20, 0.45) 100%),
    repeating-linear-gradient(
      -28deg,
      transparent 0,
      transparent 3px,
      rgba(0, 0, 0, 0.04) 3px,
      rgba(0, 0, 0, 0.04) 4px
    ),
    url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E");
  background-size: auto, auto, 180px 180px;
  background-repeat: no-repeat, repeat, repeat;
  mix-blend-mode: multiply;
  opacity: 0.72;
}

.auth-brand > * {
  position: relative;
  z-index: 1;
}

.auth-brand__mark {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: inherit;
  margin-bottom: 1.75rem;
}

.auth-brand__logo {
  width: 2.75rem;
  height: 2.75rem;
  display: block;
  border-radius: var(--auth-radius-sm);
}

.auth-brand__icon {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: var(--auth-radius-sm);
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.28);
  font-size: 1.15rem;
  color: var(--auth-accent);
}

.auth-brand__name {
  font-family: var(--auth-display);
  font-size: clamp(1.65rem, 3vw, 2.15rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.auth-brand__headline {
  font-family: var(--auth-display);
  font-size: clamp(2.1rem, 4.5vw, 3.25rem);
  font-weight: 650;
  line-height: 1.12;
  letter-spacing: -0.03em;
  margin: 0 0 1rem;
  max-width: 14ch;
  color: #fff;
}

.auth-brand__lede {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.88);
  max-width: 36ch;
}

.auth-brand__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.75rem;
}

.auth-brand__chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.75rem;
  border-radius: var(--auth-radius);
  font-size: 0.8125rem;
  font-weight: 500;
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.22);
}

.auth-brand__chip i {
  color: var(--auth-accent);
  font-size: 0.75rem;
}

.auth-panel {
  background: #f4f2f8;
  padding: clamp(1.75rem, 4vw, 3rem) clamp(1.5rem, 4vw, 3.25rem);
  animation: auth-fade-up 0.75s ease 0.08s both;
  border-radius: var(--auth-radius);
}

.auth-form-wrap {
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  padding: 0;
  background: none;
  border: none;
  border-radius: var(--auth-radius);
  box-shadow: none;
}

@keyframes auth-fade-up {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.auth-form-wrap__title {
  font-family: var(--auth-display);
  font-size: 1.75rem;
  font-weight: 650;
  letter-spacing: -0.02em;
  margin: 0 0 0.35rem;
  color: var(--auth-ink);
}

.auth-form-wrap__subtitle {
  margin: 0 0 1.5rem;
  color: var(--auth-muted);
  font-size: 0.95rem;
  line-height: 1.45;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.auth-field label {
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--auth-ink);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.auth-field label i {
  color: var(--auth-grad-to);
  font-size: 0.75rem;
}

.auth-field input[type="text"],
.auth-field input[type="password"],
.auth-field input[type="email"] {
  width: 100%;
  padding: 0.8rem 1rem;
  border: 1.5px solid rgba(20, 16, 31, 0.12);
  border-radius: var(--auth-radius);
  font-family: inherit;
  font-size: 1rem;
  color: var(--auth-ink);
  background: #fff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.auth-field input:focus {
  outline: none;
  border-color: var(--auth-grad-to);
  box-shadow: 0 0 0 3px rgba(110, 92, 255, 0.2);
}

.auth-field input::placeholder {
  color: rgba(20, 16, 31, 0.38);
}

.auth-password {
  position: relative;
}

.auth-password input {
  padding-right: 2.75rem;
}

.auth-password__toggle {
  position: absolute;
  right: 0.65rem;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  color: var(--auth-muted);
  cursor: pointer;
  padding: 0.35rem;
  border-radius: var(--auth-radius);
  transition: color 0.15s ease, background 0.15s ease;
}

.auth-password__toggle:hover {
  color: var(--auth-ink);
  background: rgba(20, 16, 31, 0.06);
}

.auth-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  margin-top: 0.25rem;
  padding: 0.9rem 1.25rem;
  border: none;
  border-radius: var(--auth-radius);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  background: linear-gradient(135deg, var(--auth-grad-from), var(--auth-grad-to));
  background-size: 160% 160%;
  box-shadow: none;
  transition: background-position 0.35s ease;
}

.auth-submit:hover:not(:disabled) {
  background-position: 100% 50%;
}

.auth-submit:active:not(:disabled) {
  transform: translateY(0);
}

.auth-submit:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
}

.auth-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.auth-remember {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.875rem;
  color: var(--auth-muted);
  cursor: pointer;
  user-select: none;
}

.auth-remember input {
  width: 1rem;
  height: 1rem;
  accent-color: var(--auth-grad-to);
}

.auth-forgot {
  border: none;
  background: none;
  padding: 0;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--auth-grad-to);
  cursor: pointer;
  text-decoration: none;
}

.auth-forgot:hover {
  text-decoration: underline;
}

.auth-forgot-hint {
  margin: 0;
  padding: 0.75rem 0.9rem;
  border-radius: var(--auth-radius);
  font-size: 0.85rem;
  line-height: 1.45;
  color: var(--auth-ink);
  background: rgba(110, 92, 255, 0.08);
  border: 1px solid rgba(110, 92, 255, 0.18);
}


/* Signup info panel (admin gate) */
.auth-info {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.auth-info__icon {
  width: 3rem;
  height: 3rem;
  border-radius: var(--auth-radius);
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(229, 70, 70, 0.12), rgba(110, 92, 255, 0.16));
  color: var(--auth-grad-to);
  font-size: 1.25rem;
}

.auth-info h3 {
  margin: 0;
  font-family: var(--auth-display);
  font-size: 1.25rem;
  font-weight: 650;
}

.auth-info p {
  margin: 0;
  color: var(--auth-muted);
  line-height: 1.5;
  font-size: 0.95rem;
}

.auth-info__steps-title {
  margin: 0 0 0.35rem;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--auth-muted);
}

.auth-info__steps {
  margin: 0;
  padding-left: 1.15rem;
  color: var(--auth-ink);
  font-size: 0.9rem;
  line-height: 1.65;
}

/* Alerts on auth pages */
body.auth-page #alertContainer {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: min(360px, calc(100vw - 2rem));
}

@media (max-width: 860px) {
  body.auth-page {
    height: auto;
    overflow-y: auto;
  }

  .auth-shell {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 100vh;
  }

  .auth-brand,
  .auth-panel {
    min-height: auto;
  }

  .auth-brand {
    order: 1;
    text-align: center;
    padding: 2rem 1.5rem 2.5rem;
  }

  .auth-brand__mark {
    justify-content: center;
  }

  .auth-brand__headline {
    max-width: none;
    margin-left: auto;
    margin-right: auto;
    font-size: clamp(1.75rem, 6vw, 2.25rem);
  }

  .auth-brand__lede {
    max-width: 36ch;
    margin-left: auto;
    margin-right: auto;
  }

  .auth-brand__chips {
    justify-content: center;
  }

  .auth-panel {
    order: 0;
    padding: 1.75rem 1.25rem 2rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.auth-page,
  .auth-panel,
  .auth-submit {
    animation: none;
    transition: none;
  }

  /* Keep static texture; only stop gradient drift / fade-up */
  .auth-brand {
    animation: none;
    background-position: 0% 20%, 100% 80%, 50% 50%, 0% 40%;
  }
}

/* =============================================================================
   Dashboard shell — body.dashboard-page (shared tokens with login)
   ============================================================================= */

body.dashboard-page {
  margin: 0;
  height: 100vh;
  max-height: 100vh;
  font-family: var(--auth-font);
  color: var(--auth-ink);
  background: var(--auth-ground);
  overflow: hidden;
}

body.dashboard-page *,
body.dashboard-page *::before,
body.dashboard-page *::after {
  box-sizing: border-box;
}

body.dashboard-page h1,
body.dashboard-page h2,
body.dashboard-page h3,
body.dashboard-page h4,
body.dashboard-page .dashboard-title,
body.dashboard-page .card-title,
body.dashboard-page .modal-title {
  font-family: var(--auth-display);
  color: var(--auth-ink);
  font-weight: 650;
  letter-spacing: -0.02em;
}

body.dashboard-page .dashboard-container {
  display: flex;
  height: 100vh;
  max-height: 100vh;
  overflow: hidden;
  background: var(--auth-ground);
}

/* Sidebar — fixed to viewport; only main content scrolls */
body.dashboard-page .sidebar {
  width: 240px;
  flex-shrink: 0;
  padding: 1.25rem 0.85rem;
  color: #fff;
  background:
    radial-gradient(ellipse 80% 50% at 10% 0%, color-mix(in srgb, var(--auth-grad-from) 80%, #fff) 0%, transparent 55%),
    radial-gradient(ellipse 70% 55% at 100% 100%, color-mix(in srgb, var(--auth-grad-to) 85%, #1a0a40) 0%, transparent 50%),
    linear-gradient(160deg, var(--auth-grad-from) 0%, var(--auth-grad-to) 100%);
  border-right: none;
  position: sticky;
  top: 0;
  align-self: flex-start;
  height: 100vh;
  max-height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: width 0.2s ease;
  z-index: 20;
}

body.dashboard-page .sidebar.is-collapsed,
body.dashboard-page.sidebar-collapsed .sidebar,
body.dashboard-page .dashboard-container.sidebar-collapsed .sidebar {
  width: 72px !important;
  padding-left: 0.55rem !important;
  padding-right: 0.55rem !important;
}

body.dashboard-page .sidebar::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 80% 70% at 40% 40%, transparent 25%, rgba(10, 6, 20, 0.4) 100%),
    url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
  background-size: auto, 160px 160px;
  mix-blend-mode: multiply;
  opacity: 0.65;
  z-index: 0;
}

body.dashboard-page .sidebar > * {
  position: relative;
  z-index: 1;
}

body.dashboard-page .sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  padding: 0 0.35rem;
}

body.dashboard-page .sidebar-brand-swap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
  min-width: 0;
}

body.dashboard-page .logo {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
  color: #fff;
  font-family: var(--auth-display);
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

body.dashboard-page .logo img {
  display: block;
  width: 1.75rem;
  height: 1.75rem;
  flex-shrink: 0;
}

body.dashboard-page .logo-text,
body.dashboard-page .nav-label {
  white-space: nowrap;
  overflow: hidden;
}

body.dashboard-page .sidebar-toggle {
  flex-shrink: 0;
  position: relative;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: var(--auth-radius-sm);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  cursor: pointer;
  pointer-events: auto;
  transition: background 0.15s ease, opacity 0.15s ease;
}

body.dashboard-page .sidebar-toggle:hover {
  background: rgba(255, 255, 255, 0.22);
}

body.dashboard-page .sidebar-nav-wrap {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

body.dashboard-page .sidebar-nav {
  list-style: none;
  margin: 0;
  padding: 0;
}

body.dashboard-page .sidebar-nav li {
  margin-bottom: 0.25rem;
}

body.dashboard-page .sidebar-nav a,
body.dashboard-page .sidebar-nav a.nav-link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.42rem 0.75rem;
  color: rgba(255, 255, 255, 0.82);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  border: 1px solid transparent;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

body.dashboard-page .sidebar-nav a:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.18);
}

body.dashboard-page .sidebar-nav a.active {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.28);
}

body.dashboard-page .sidebar-nav a i {
  width: 1.15rem;
  text-align: center;
  color: #fff;
  flex-shrink: 0;
}

/* Nested Settings group (collapsible) */
body.dashboard-page .sidebar-nav .nav-group {
  margin-bottom: 0.35rem;
}

body.dashboard-page .sidebar-nav .nav-group-toggle {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  padding: 0.42rem 0.75rem;
  margin: 0;
  border: 1px solid transparent;
  background: transparent;
  color: rgba(255, 255, 255, 0.82);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

body.dashboard-page .sidebar-nav .nav-group-toggle:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.18);
}

body.dashboard-page .sidebar-nav .nav-group.is-open > .nav-group-toggle,
body.dashboard-page .sidebar-nav .nav-group:has(.nav-sub-link.active) > .nav-group-toggle {
  color: #fff;
}

body.dashboard-page .sidebar-nav .nav-group-toggle > i:first-child {
  width: 1.15rem;
  text-align: center;
  color: #fff;
  flex-shrink: 0;
}

body.dashboard-page .sidebar-nav .nav-group-chevron {
  margin-left: auto;
  font-size: 0.7rem;
  opacity: 0.75;
  transition: transform 0.2s ease;
}

body.dashboard-page .sidebar-nav .nav-group.is-open .nav-group-chevron {
  transform: rotate(180deg);
}

body.dashboard-page .sidebar-nav .nav-sub {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.22s ease, opacity 0.18s ease;
}

body.dashboard-page .sidebar-nav .nav-group.is-open > .nav-sub {
  max-height: 12rem;
  opacity: 1;
  padding: 0.1rem 0 0.25rem 0.85rem;
  margin: 0 0.35rem 0 1.35rem;
  border-left: 2px solid rgba(255, 255, 255, 0.28);
}

body.dashboard-page .sidebar-nav .nav-sub li {
  margin-bottom: 0.1rem;
}

body.dashboard-page .sidebar-nav a.nav-link.nav-sub-link {
  padding: 0.32rem 0.6rem 0.32rem 0.65rem;
  font-size: 0.86rem;
  margin-left: 0;
  min-height: 0;
  line-height: 1.25;
  gap: 0.5rem;
}

/* Collapsed: hide Settings parent + hierarchy line; keep sub-section icons */
body.dashboard-page .sidebar.is-collapsed .nav-group-toggle,
body.dashboard-page.sidebar-collapsed .nav-group-toggle {
  display: none;
}

body.dashboard-page .sidebar.is-collapsed .nav-group > .nav-sub,
body.dashboard-page.sidebar-collapsed .nav-group > .nav-sub {
  display: block;
  max-height: none;
  opacity: 1;
  overflow: visible;
  margin: 0;
  padding: 0;
  border-left: none;
}

body.dashboard-page .sidebar.is-collapsed .nav-sub .nav-label,
body.dashboard-page.sidebar-collapsed .nav-sub .nav-label {
  display: none;
}

body.dashboard-page .sidebar.is-collapsed .nav-sub li,
body.dashboard-page.sidebar-collapsed .nav-sub li {
  margin-bottom: 0.2rem;
}

body.dashboard-page .sidebar.is-collapsed a.nav-link.nav-sub-link,
body.dashboard-page.sidebar-collapsed a.nav-link.nav-sub-link {
  justify-content: center;
  padding: 0.4rem;
  gap: 0;
}

/* Sidebar footer — name + logout */
body.dashboard-page .sidebar-theme-wrap {
  margin-top: auto;
  padding: 0.35rem 0.2rem 0.55rem;
}

body.dashboard-page .sidebar-footer {
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
}

body.dashboard-page .sidebar-user-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.35rem 0.35rem 0.15rem;
  min-width: 0;
}

body.dashboard-page .sidebar-user-swap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
  min-width: 0;
}

body.dashboard-page .sidebar-user-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  flex: 1;
}

body.dashboard-page .sidebar-user-meta > .fa-user {
  flex-shrink: 0;
  color: #fff;
  font-size: 0.9rem;
}

body.dashboard-page .sidebar-footer .user-name {
  font-weight: 600;
  color: #fff;
  font-size: 0.85rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  display: block;
}

body.dashboard-page .sidebar-user-text {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
  flex: 1;
}

body.dashboard-page .user-role-badge {
  display: inline-flex;
  align-self: flex-start;
  max-width: 100%;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.3;
  color: #fff;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.28);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Theme as one segmented strip */
body.dashboard-page .sidebar-theme {
  display: flex;
  width: 100%;
  padding: 0.2rem;
  gap: 0;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.18);
}

body.dashboard-page .theme-btn {
  flex: 1 1 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  margin: 0;
  padding: 0.4rem 0.35rem;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: rgba(255, 255, 255, 0.78);
  font: inherit;
  font-size: 0.68rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

body.dashboard-page .theme-btn i {
  font-size: 0.75rem;
}

body.dashboard-page .theme-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

body.dashboard-page .theme-btn.is-active {
  background: rgba(255, 255, 255, 0.92);
  color: #1a1428;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
}

body.dashboard-page.sidebar-collapsed .sidebar-theme span,
body.dashboard-page.sidebar-collapsed .user-role-badge {
  display: none;
}

body.dashboard-page.sidebar-collapsed .sidebar-theme {
  flex-direction: column;
  border-radius: var(--auth-radius-sm, 8px);
  padding: 0.15rem;
}

body.dashboard-page.sidebar-collapsed .theme-btn {
  padding: 0.45rem 0.2rem;
  border-radius: 6px;
}

body.dashboard-page .btn-icon-logout {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: var(--auth-radius-sm);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  cursor: pointer;
  transition: background 0.15s ease, opacity 0.15s ease;
}

body.dashboard-page .btn-icon-logout:hover {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
}

body.dashboard-page .btn-icon-logout:disabled,
body.dashboard-page .btn-icon-logout.is-loading {
  cursor: wait;
  opacity: 1;
}

body.dashboard-page .btn-icon-logout i {
  color: #fff;
}

/* Collapsed sidebar labels */
body.dashboard-page .sidebar.is-collapsed .logo-text,
body.dashboard-page .sidebar.is-collapsed .nav-label,
body.dashboard-page .sidebar.is-collapsed .user-name,
body.dashboard-page.sidebar-collapsed .logo-text,
body.dashboard-page.sidebar-collapsed .nav-label,
body.dashboard-page.sidebar-collapsed .sidebar-footer .user-name,
body.dashboard-page .dashboard-container.sidebar-collapsed .logo-text,
body.dashboard-page .dashboard-container.sidebar-collapsed .nav-label,
body.dashboard-page .dashboard-container.sidebar-collapsed .user-name {
  display: none !important;
}

body.dashboard-page .sidebar.is-collapsed .sidebar-header,
body.dashboard-page.sidebar-collapsed .sidebar-header {
  justify-content: center;
  padding: 0;
  margin-bottom: 1.25rem;
}

body.dashboard-page .sidebar.is-collapsed .sidebar-nav a,
body.dashboard-page.sidebar-collapsed .sidebar-nav a {
  justify-content: center;
  padding: 0.4rem;
}

body.dashboard-page .sidebar.is-collapsed .sidebar-user-row,
body.dashboard-page.sidebar-collapsed .sidebar-user-row {
  justify-content: center;
  width: 100%;
  padding: 0.15rem 0;
}

/* Collapsed: brand icon ↔ expand/collapse toggle on hover */
body.dashboard-page .sidebar.is-collapsed .sidebar-brand-swap,
body.dashboard-page.sidebar-collapsed .sidebar-brand-swap {
  position: relative;
  width: 2.5rem;
  height: 2.5rem;
  margin: 0 auto;
  justify-content: center;
}

body.dashboard-page .sidebar.is-collapsed .sidebar-brand-swap .logo,
body.dashboard-page.sidebar-collapsed .sidebar-brand-swap .logo {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  opacity: 1;
  transition: opacity 0.15s ease;
}

body.dashboard-page .sidebar.is-collapsed .sidebar-brand-swap .sidebar-toggle,
body.dashboard-page.sidebar-collapsed .sidebar-brand-swap .sidebar-toggle {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  pointer-events: auto;
  transition: opacity 0.15s ease, background 0.15s ease;
}

body.dashboard-page .sidebar.is-collapsed .sidebar-brand-swap:hover .logo,
body.dashboard-page.sidebar-collapsed .sidebar-brand-swap:hover .logo,
body.dashboard-page .sidebar.is-collapsed .sidebar-brand-swap:has(.sidebar-toggle:focus-visible) .logo,
body.dashboard-page.sidebar-collapsed .sidebar-brand-swap:has(.sidebar-toggle:focus-visible) .logo {
  opacity: 0;
  pointer-events: none;
}

body.dashboard-page .sidebar.is-collapsed .sidebar-brand-swap:hover .sidebar-toggle,
body.dashboard-page.sidebar-collapsed .sidebar-brand-swap:hover .sidebar-toggle,
body.dashboard-page .sidebar.is-collapsed .sidebar-brand-swap:has(.sidebar-toggle:focus-visible) .sidebar-toggle,
body.dashboard-page.sidebar-collapsed .sidebar-brand-swap:has(.sidebar-toggle:focus-visible) .sidebar-toggle {
  opacity: 1;
  pointer-events: auto;
}

/* Collapsed: user icon ↔ logout on hover */
body.dashboard-page .sidebar.is-collapsed .sidebar-user-swap,
body.dashboard-page.sidebar-collapsed .sidebar-user-swap {
  position: relative;
  width: 2.5rem;
  height: 2.5rem;
  margin: 0 auto;
  justify-content: center;
}

body.dashboard-page .sidebar.is-collapsed .sidebar-user-swap .sidebar-user-meta,
body.dashboard-page.sidebar-collapsed .sidebar-user-swap .sidebar-user-meta {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  flex: none;
  width: 100%;
  min-width: 0;
  opacity: 1;
  transition: opacity 0.15s ease;
}

body.dashboard-page .sidebar.is-collapsed .sidebar-user-swap .sidebar-user-text,
body.dashboard-page.sidebar-collapsed .sidebar-user-swap .sidebar-user-text {
  display: none !important;
}

body.dashboard-page .sidebar.is-collapsed .sidebar-user-meta > .fa-user,
body.dashboard-page.sidebar-collapsed .sidebar-user-meta > .fa-user {
  margin: 0;
  width: auto;
  text-align: center;
}

body.dashboard-page .sidebar.is-collapsed .sidebar-footer,
body.dashboard-page.sidebar-collapsed .sidebar-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-left: 0;
  padding-right: 0;
}

body.dashboard-page .sidebar.is-collapsed .sidebar-user-swap .btn-icon-logout,
body.dashboard-page.sidebar-collapsed .sidebar-user-swap .btn-icon-logout {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  pointer-events: auto;
  transition: opacity 0.15s ease, background 0.15s ease;
}

body.dashboard-page .sidebar.is-collapsed .sidebar-user-swap:hover .sidebar-user-meta,
body.dashboard-page .sidebar.is-collapsed .sidebar-user-swap:focus-within .sidebar-user-meta,
body.dashboard-page.sidebar-collapsed .sidebar-user-swap:hover .sidebar-user-meta,
body.dashboard-page.sidebar-collapsed .sidebar-user-swap:focus-within .sidebar-user-meta {
  opacity: 0;
  pointer-events: none;
}

body.dashboard-page .sidebar.is-collapsed .sidebar-user-swap:hover .btn-icon-logout,
body.dashboard-page .sidebar.is-collapsed .sidebar-user-swap:focus-within .btn-icon-logout,
body.dashboard-page.sidebar-collapsed .sidebar-user-swap:hover .btn-icon-logout,
body.dashboard-page.sidebar-collapsed .sidebar-user-swap:focus-within .btn-icon-logout {
  opacity: 1;
  pointer-events: auto;
}

/* Keep logout control visible while signing out (collapsed or expanded) */
body.dashboard-page.is-logging-out .sidebar-user-swap .sidebar-user-meta {
  opacity: 0 !important;
  pointer-events: none !important;
}

body.dashboard-page.is-logging-out .sidebar-user-swap .btn-icon-logout {
  opacity: 1 !important;
  pointer-events: none !important;
}

body.dashboard-page.is-logging-out .sidebar.is-collapsed .sidebar-user-swap .btn-icon-logout,
body.dashboard-page.is-logging-out.sidebar-collapsed .sidebar-user-swap .btn-icon-logout {
  position: absolute;
  inset: 0;
}

/* Main content */
body.dashboard-page .main-content {
  flex: 1;
  min-width: 0;
  height: 100vh;
  max-height: 100vh;
  padding: 1.75rem 2rem 2.5rem;
  overflow-x: hidden;
  overflow-y: auto;
  background: var(--auth-ground);
}

body.dashboard-page .dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.75rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--auth-border);
}

body.dashboard-page .dashboard-title {
  margin: 0;
  font-size: clamp(1.5rem, 2.5vw, 1.85rem);
  color: var(--auth-ink);
}

/* Profile page */
body.dashboard-page .profile-page-header {
  margin-bottom: 1.5rem;
}

body.dashboard-page .section-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  margin: -0.5rem 0 1rem;
}

body.dashboard-page .profile-page-title {
  margin: 0 0 0.35rem;
  font-family: var(--auth-display);
  font-size: clamp(1.5rem, 2.5vw, 1.85rem);
  font-weight: 650;
  letter-spacing: -0.02em;
  color: var(--auth-ink);
}

body.dashboard-page .profile-page-subtitle {
  margin: 0;
  color: var(--auth-muted);
  font-size: 0.95rem;
}

body.dashboard-page .profile-layout {
  max-width: 640px;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

body.dashboard-page .profile-identity {
  display: flex;
  align-items: center;
  gap: 1rem;
}

body.dashboard-page .profile-avatar {
  flex-shrink: 0;
  width: 3.25rem;
  height: 3.25rem;
  display: grid;
  place-items: center;
  border-radius: var(--auth-radius);
  font-family: var(--auth-display);
  font-size: 1.05rem;
  font-weight: 650;
  color: #fff;
  background: linear-gradient(135deg, var(--auth-grad-from), var(--auth-grad-to));
  letter-spacing: 0.02em;
}

body.dashboard-page .profile-identity-text {
  min-width: 0;
}

body.dashboard-page .profile-name {
  margin: 0 0 0.2rem;
  font-family: var(--auth-display);
  font-size: 1.35rem;
  font-weight: 650;
  letter-spacing: -0.02em;
  color: var(--auth-ink);
}

body.dashboard-page .profile-email {
  margin: 0 0 0.45rem;
  color: var(--auth-muted);
  font-size: 0.9rem;
  word-break: break-word;
}

body.dashboard-page .profile-role {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #4c3db8;
  background: rgba(110, 92, 255, 0.12);
  border: 1px solid rgba(110, 92, 255, 0.28);
  border-radius: var(--auth-radius-sm);
}

body.dashboard-page .profile-section-title {
  margin: 0 0 0.35rem;
  font-family: var(--auth-display);
  font-size: 1.05rem;
  font-weight: 650;
  color: var(--auth-ink);
}

body.dashboard-page .profile-form {
  display: grid;
  gap: 0.85rem;
  padding: 0;
  border: none;
  background: transparent;
}

body.dashboard-page .profile-password-form {
  padding-top: 1.25rem;
  border-top: 1px solid var(--auth-border);
}

body.dashboard-page .profile-name-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
}

body.dashboard-page .profile-form .form-group {
  margin: 0;
  min-width: 0;
}

body.dashboard-page .profile-form label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--auth-ink);
}

body.dashboard-page .profile-form input:disabled {
  background: var(--auth-ground);
  color: var(--auth-muted);
  cursor: not-allowed;
}

body.dashboard-page .profile-form .password-input {
  position: relative;
  display: flex;
  align-items: center;
}

body.dashboard-page .profile-form .password-input input {
  width: 100%;
  padding-right: 2.5rem;
}

body.dashboard-page .profile-form .password-toggle {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  color: var(--auth-muted);
  cursor: pointer;
  padding: 0.25rem;
  border-radius: var(--auth-radius-sm);
}

body.dashboard-page .profile-form .password-toggle:hover {
  color: var(--auth-ink);
}

body.dashboard-page .profile-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.65rem;
  padding-top: 0.25rem;
}

body.dashboard-page .profile-action {
  border-radius: var(--auth-radius);
}

@media (max-width: 640px) {
  body.dashboard-page .profile-name-row {
    grid-template-columns: 1fr;
  }
}

/* System: identity + generation model stacked, no cards */
body.dashboard-page .system-panels {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

body.dashboard-page .system-panel {
  min-width: 0;
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
}

body.dashboard-page .system-panel .settings-note {
  margin-top: 0;
}

body.dashboard-page .instructions-panel-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.35rem;
}

body.dashboard-page .instructions-panel-header .profile-section-title {
  margin-bottom: 0;
}

body.dashboard-page .instructions-textarea {
  min-height: 16rem;
  resize: vertical;
  font-family: inherit;
  line-height: 1.5;
}

/* Settings (platform console) */
body.dashboard-page .settings-block {
  margin: 0 0 2rem;
  padding: 0 0 1.75rem;
  border-bottom: 1px solid var(--auth-border);
}

body.dashboard-page .settings-block:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

body.dashboard-page .settings-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

body.dashboard-page .settings-note {
  margin: 0.35rem 0 1rem;
  font-size: 0.85rem;
  color: var(--auth-muted);
  line-height: 1.45;
}

body.dashboard-page .settings-empty {
  margin: 0.5rem 0;
  font-size: 0.875rem;
  color: var(--auth-muted);
}

body.dashboard-page .llm-entity-list {
  margin-top: 0.25rem;
}

body.dashboard-page .llm-table td .settings-note {
  margin: 0.15rem 0 0;
  display: inline-block;
}

body.dashboard-page .llm-row-actions {
  width: 2.5rem;
  text-align: right;
}

body.dashboard-page .row-menu {
  position: relative;
  display: inline-flex;
  justify-content: flex-end;
}

body.dashboard-page .row-menu-toggle {
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  color: var(--auth-muted);
  width: 2rem;
  height: 2rem;
  border-radius: var(--auth-radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

body.dashboard-page .row-menu-toggle:hover,
body.dashboard-page .row-menu.open .row-menu-toggle {
  color: var(--auth-ink);
  background: var(--auth-ground);
  border-color: var(--auth-border);
}

body.dashboard-page .llm-entity-list .table-container {
  overflow: visible;
}

body.dashboard-page .llm-table {
  overflow: visible;
}

body.dashboard-page .llm-table tbody tr {
  position: relative;
}

body.dashboard-page .row-menu-panel {
  display: none;
  position: fixed;
  min-width: 8.5rem;
  background: var(--auth-surface);
  border: 1px solid var(--auth-border);
  border-radius: var(--auth-radius);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
  z-index: 1200;
  padding: 0.25rem 0;
}

body.dashboard-page .row-menu.open .row-menu-panel {
  display: grid;
}

body.dashboard-page .row-menu-panel button {
  appearance: none;
  border: none;
  background: transparent;
  text-align: left;
  padding: 0.5rem 0.85rem;
  font-family: var(--auth-font);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--auth-ink);
  cursor: pointer;
  width: 100%;
}

body.dashboard-page .row-menu-panel button:hover {
  background: var(--auth-ground);
}

body.dashboard-page .row-menu-panel button.row-menu-danger {
  color: #b42318;
}

/* Buttons */
body.dashboard-page .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.55rem 1rem;
  font-family: var(--auth-font);
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.2;
  border: 1.5px solid transparent;
  border-radius: var(--auth-radius);
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  box-shadow: none;
  transform: none;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

body.dashboard-page .btn:hover {
  transform: none;
  box-shadow: none;
}

body.dashboard-page .btn-primary {
  background: linear-gradient(135deg, var(--auth-grad-from), var(--auth-grad-to));
  color: #fff;
  border-color: transparent;
}

body.dashboard-page .btn-primary:hover {
  background: linear-gradient(135deg, var(--auth-grad-to), var(--auth-grad-from));
  color: #fff;
}

body.dashboard-page .btn-outline {
  background: var(--auth-surface);
  color: var(--auth-ink);
  border-color: var(--auth-border);
}

body.dashboard-page .btn-outline:hover {
  background: rgba(110, 92, 255, 0.08);
  color: var(--auth-ink);
  border-color: var(--auth-grad-to);
}

body.dashboard-page .btn-secondary {
  background: rgba(20, 16, 31, 0.08);
  color: var(--auth-ink);
  border-color: var(--auth-border);
}

body.dashboard-page .btn-secondary:hover {
  background: rgba(20, 16, 31, 0.14);
  color: var(--auth-ink);
}

body.dashboard-page .btn-success {
  background: var(--auth-accent);
  color: #fff;
  border-color: transparent;
}

body.dashboard-page .btn-success:hover {
  filter: brightness(0.95);
  color: #fff;
}

body.dashboard-page .btn-warning {
  background: #d97706;
  color: #fff;
  border-color: transparent;
}

body.dashboard-page .btn-warning:hover {
  filter: brightness(0.95);
  color: #fff;
}

body.dashboard-page .btn-sm {
  padding: 0.35rem 0.65rem;
  font-size: 0.75rem;
}

body.dashboard-page .btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  background: rgba(20, 16, 31, 0.2);
  border-color: transparent;
  color: #fff;
}

/* Flat panels (keep .card markup) */
body.dashboard-page .card {
  background: var(--auth-surface);
  border: 1px solid var(--auth-border);
  box-shadow: none;
  margin-bottom: 1.25rem;
}

body.dashboard-page .card-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--auth-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

body.dashboard-page .card-title {
  margin: 0;
  font-size: 1.1rem;
}

body.dashboard-page .card .table-container {
  margin: 0;
  border-left: none;
  border-right: none;
  border-bottom: none;
}

body.dashboard-page .stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

body.dashboard-page .stat-card {
  background: var(--auth-surface);
  padding: 1.25rem 1rem;
  text-align: center;
  border: 1px solid var(--auth-border);
  box-shadow: none;
}

body.dashboard-page .stat-card i {
  font-size: 1.35rem;
  color: var(--auth-grad-to);
  margin-bottom: 0.65rem;
}

body.dashboard-page .stat-value {
  font-family: var(--auth-display);
  font-size: 1.75rem;
  font-weight: 650;
  color: var(--auth-ink);
  margin-bottom: 0.25rem;
}

body.dashboard-page .stat-label {
  color: var(--auth-muted);
  font-size: 0.8rem;
  font-weight: 500;
}

/* Tables */
body.dashboard-page .table-container {
  overflow-x: auto;
  border: 1px solid var(--auth-border);
  background: var(--auth-surface);
}

body.dashboard-page .table-header-controls {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin-bottom: 0;
  padding: 0.75rem 1rem;
  background: var(--auth-ground);
  border-bottom: 1px solid var(--auth-border);
}

body.dashboard-page .filter-controls select,
body.dashboard-page .form-group input,
body.dashboard-page .form-group textarea,
body.dashboard-page .form-group select,
body.dashboard-page input[type="text"],
body.dashboard-page input[type="password"],
body.dashboard-page input[type="email"],
body.dashboard-page input[type="number"],
body.dashboard-page textarea,
body.dashboard-page select {
  border: 1.5px solid var(--auth-border);
  border-radius: var(--auth-radius);
  background: #fff;
  color: var(--auth-ink);
  font-family: var(--auth-font);
  font-size: 0.9rem;
  padding: 0.55rem 0.75rem;
}

body.dashboard-page .filter-controls select:focus,
body.dashboard-page .form-group input:focus,
body.dashboard-page input:focus,
body.dashboard-page textarea:focus,
body.dashboard-page select:focus {
  outline: none;
  border-color: var(--auth-grad-to);
  box-shadow: 0 0 0 3px rgba(110, 92, 255, 0.18);
}

body.dashboard-page .table {
  width: 100%;
  border-collapse: collapse;
  background: var(--auth-surface);
  font-size: 0.875rem;
}

body.dashboard-page .table th,
body.dashboard-page .table td {
  padding: 0.85rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--auth-border);
  color: var(--auth-ink);
}

body.dashboard-page .table th {
  background: var(--auth-ground);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--auth-muted);
}

body.dashboard-page .table tr:hover {
  background: rgba(110, 92, 255, 0.04);
}

body.dashboard-page .table .btn {
  padding: 0.3rem 0.55rem;
  font-size: 0.75rem;
}

/* Badges */
body.dashboard-page .badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.5rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  border: 1px solid transparent;
  border-radius: var(--auth-radius-sm);
}

body.dashboard-page .badge-success {
  background: rgba(16, 185, 129, 0.12);
  color: #047857;
  border-color: rgba(16, 185, 129, 0.3);
}

body.dashboard-page .badge-danger {
  background: rgba(229, 70, 70, 0.12);
  color: #b91c1c;
  border-color: rgba(229, 70, 70, 0.3);
}

body.dashboard-page .badge-warning {
  background: rgba(217, 119, 6, 0.12);
  color: #b45309;
  border-color: rgba(217, 119, 6, 0.3);
}

body.dashboard-page .badge-primary,
body.dashboard-page .badge-info {
  background: rgba(110, 92, 255, 0.12);
  color: #4c3db8;
  border-color: rgba(110, 92, 255, 0.3);
}

body.dashboard-page .badge-secondary {
  background: rgba(20, 16, 31, 0.08);
  color: var(--auth-muted);
  border-color: var(--auth-border);
}

/* Sections / empty / warnings */
body.dashboard-page .content-section {
  display: none;
}

body.dashboard-page .content-section.active {
  display: block;
}

/* Pre-paint hash restore: show hash section before JS marks .active */
html[data-dash-section]:not(.dash-ready) body.dashboard-page .content-section {
  display: none !important;
}
html[data-dash-section="overview"]:not(.dash-ready) body.dashboard-page #overview.content-section,
html[data-dash-section="projects"]:not(.dash-ready) body.dashboard-page #projects.content-section,
html[data-dash-section="settings"]:not(.dash-ready) body.dashboard-page #settings-admins.content-section,
html[data-dash-section="settings-admins"]:not(.dash-ready) body.dashboard-page #settings-admins.content-section,
html[data-dash-section="settings-providers"]:not(.dash-ready) body.dashboard-page #settings-providers.content-section,
html[data-dash-section="settings-models"]:not(.dash-ready) body.dashboard-page #settings-models.content-section,
html[data-dash-section="profile"]:not(.dash-ready) body.dashboard-page #profile.content-section,
html[data-dash-section="sources"]:not(.dash-ready) body.dashboard-page #sources.content-section,
html[data-dash-section="deploy"]:not(.dash-ready) body.dashboard-page #deploy.content-section,
html[data-dash-section="credentials"]:not(.dash-ready) body.dashboard-page #credentials.content-section,
html[data-dash-section="bot-instructions"]:not(.dash-ready) body.dashboard-page #bot-instructions.content-section,
html[data-dash-section="live-test"]:not(.dash-ready) body.dashboard-page #live-test.content-section,
html[data-dash-section="documents"]:not(.dash-ready) body.dashboard-page #documents.content-section,
html[data-dash-section="logs"]:not(.dash-ready) body.dashboard-page #logs.content-section,
html[data-dash-section="analytics"]:not(.dash-ready) body.dashboard-page #analytics.content-section {
  display: block !important;
}

html[data-dash-section]:not(.dash-ready) body.dashboard-page .sidebar-nav a.nav-link.active {
  background: transparent;
  border-color: transparent;
  color: rgba(255, 255, 255, 0.82);
}
html[data-dash-section="overview"]:not(.dash-ready) body.dashboard-page .sidebar-nav a.nav-link[href="#overview"],
html[data-dash-section="projects"]:not(.dash-ready) body.dashboard-page .sidebar-nav a.nav-link[href="#projects"],
html[data-dash-section="settings"]:not(.dash-ready) body.dashboard-page .sidebar-nav a.nav-link[href="#settings-admins"],
html[data-dash-section="settings-admins"]:not(.dash-ready) body.dashboard-page .sidebar-nav a.nav-link[href="#settings-admins"],
html[data-dash-section="settings-providers"]:not(.dash-ready) body.dashboard-page .sidebar-nav a.nav-link[href="#settings-providers"],
html[data-dash-section="settings-models"]:not(.dash-ready) body.dashboard-page .sidebar-nav a.nav-link[href="#settings-models"],
html[data-dash-section="profile"]:not(.dash-ready) body.dashboard-page .sidebar-nav a.nav-link[href="#profile"],
html[data-dash-section="sources"]:not(.dash-ready) body.dashboard-page .sidebar-nav a.nav-link[href="#sources"],
html[data-dash-section="deploy"]:not(.dash-ready) body.dashboard-page .sidebar-nav a.nav-link[href="#deploy"],
html[data-dash-section="credentials"]:not(.dash-ready) body.dashboard-page .sidebar-nav a.nav-link[href="#credentials"],
html[data-dash-section="bot-instructions"]:not(.dash-ready) body.dashboard-page .sidebar-nav a.nav-link[href="#bot-instructions"],
html[data-dash-section="live-test"]:not(.dash-ready) body.dashboard-page .sidebar-nav a.nav-link[href="#live-test"],
html[data-dash-section="documents"]:not(.dash-ready) body.dashboard-page .sidebar-nav a.nav-link[href="#documents"],
html[data-dash-section="logs"]:not(.dash-ready) body.dashboard-page .sidebar-nav a.nav-link[href="#logs"],
html[data-dash-section="analytics"]:not(.dash-ready) body.dashboard-page .sidebar-nav a.nav-link[href="#analytics"] {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.28);
}

body.dashboard-page .empty-state {
  text-align: center;
  padding: 2.5rem 1.5rem;
  color: var(--auth-muted);
}

body.dashboard-page .empty-state i {
  font-size: 2rem;
  color: var(--auth-grad-to);
  margin-bottom: 0.75rem;
  opacity: 0.7;
}

body.dashboard-page .empty-state h3 {
  margin: 0 0 0.35rem;
  font-size: 1.1rem;
}

body.dashboard-page .no-project-warning {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
  background: rgba(217, 119, 6, 0.1);
  border: 1px solid rgba(217, 119, 6, 0.35);
  color: #92400e;
}

body.dashboard-page .no-project-warning i {
  color: #d97706;
}

/* Forms in modals / cards */
body.dashboard-page .form-group {
  margin-bottom: 1rem;
}

body.dashboard-page .form-group label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--auth-ink);
  margin-bottom: 0.35rem;
}

body.dashboard-page .form-group label i {
  color: var(--auth-grad-to);
  font-size: 0.75rem;
}

body.dashboard-page .form-group input {
  width: 100%;
}

body.dashboard-page .form-group input[type="checkbox"] {
  width: auto;
  margin: 0;
  flex: none;
}

body.dashboard-page .form-group label.checkbox-inline {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0;
  font-weight: 600;
  cursor: pointer;
  width: auto;
}

body.dashboard-page .form-group label.checkbox-inline span {
  line-height: 1.2;
}

body.dashboard-page .btn.is-loading {
  opacity: 0.85;
  pointer-events: none;
}

/* Modals */
body.dashboard-page .modal {
  background: rgba(20, 16, 31, 0.55);
  backdrop-filter: blur(4px);
}

body.dashboard-page .modal-content {
  background: var(--auth-surface);
  border: 1px solid var(--auth-border);
  border-radius: var(--auth-radius-lg);
  box-shadow: none;
  max-width: 520px;
  width: 92%;
  max-height: 90vh;
  overflow-y: auto;
}

body.dashboard-page .modal-header {
  padding: 1.15rem 1.25rem;
  border-bottom: 1px solid var(--auth-border);
}

body.dashboard-page .modal-title {
  margin: 0;
  font-size: 1.2rem;
}

body.dashboard-page .modal-close {
  background: none;
  border: none;
  color: var(--auth-muted);
  cursor: pointer;
  padding: 0.25rem 0.4rem;
  font-size: 1.25rem;
}

body.dashboard-page .modal-close:hover {
  background: var(--auth-ground);
  color: var(--auth-ink);
}

body.dashboard-page .modal-body {
  padding: 1.15rem 1.25rem;
}

body.dashboard-page .modal-actions {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--auth-border);
  display: flex;
  gap: 0.65rem;
  justify-content: flex-end;
}

/* LLM provider/model modals — hug content, no oversized empty body */
body.dashboard-page .llm-settings-modal.modal.active {
  align-items: center;
  justify-content: center;
}

body.dashboard-page #llmProviderModal .modal-content,
body.dashboard-page #llmModelModal .modal-content,
body.dashboard-page .llm-settings-modal .modal-content,
body.dashboard-page .llm-settings-modal-content {
  display: flex;
  flex-direction: column;
  height: auto;
  max-height: none;
  overflow: visible;
  align-self: center;
  width: min(420px, 92%);
  max-width: 420px;
}

body.dashboard-page .llm-settings-modal .modal-header {
  padding: 0.85rem 1.1rem;
  flex: 0 0 auto;
}

body.dashboard-page .llm-settings-modal .modal-body {
  padding: 0.85rem 1.1rem;
  flex: 0 0 auto;
  overflow: visible;
}

body.dashboard-page .llm-settings-modal .modal-actions {
  padding: 0.75rem 1.1rem;
  flex: 0 0 auto;
}

body.dashboard-page .llm-modal-form {
  gap: 0.55rem;
  align-content: start;
}

body.dashboard-page .llm-modal-form .form-group {
  margin: 0;
}

body.dashboard-page .llm-modal-form .settings-note {
  margin: 0.2rem 0 0;
}

body.dashboard-page .llm-test-status {
  margin: 0;
  min-height: 0;
}

body.dashboard-page .llm-test-status[hidden] {
  display: none !important;
}

body.dashboard-page .llm-test-status:not([hidden]) {
  margin-top: 0.35rem;
}

body.dashboard-page .llm-test-status.is-ok {
  color: #067647;
}

body.dashboard-page .llm-test-status.is-error {
  color: #b42318;
}

body.dashboard-page .llm-test-status.is-pending {
  color: var(--auth-muted);
}

/* Confirm dialog — compact, hugs content */
body.dashboard-page .confirm-modal.modal.active {
  align-items: center;
  justify-content: center;
}

body.dashboard-page #confirmModal .modal-content,
body.dashboard-page .confirm-modal .modal-content,
body.dashboard-page .confirm-modal-content {
  display: flex;
  flex-direction: column;
  height: auto;
  max-height: none;
  overflow: visible;
  align-self: center;
  width: min(360px, 92%);
  max-width: 360px;
}

body.dashboard-page .confirm-modal .modal-header {
  padding: 0.65rem 0.9rem;
  flex: 0 0 auto;
}

body.dashboard-page .confirm-modal .modal-title {
  font-family: var(--auth-font);
  font-size: 1.05rem;
  font-weight: 650;
  letter-spacing: -0.01em;
}

body.dashboard-page .confirm-modal .modal-close {
  padding: 0.15rem 0.3rem;
  font-size: 1rem;
  line-height: 1;
}

body.dashboard-page .confirm-modal .modal-body {
  padding: 0.5rem 0.9rem 0.55rem;
  flex: 0 0 auto;
}

body.dashboard-page .confirm-modal .modal-actions {
  padding: 0.55rem 0.9rem 0.7rem;
  flex: 0 0 auto;
  gap: 0.5rem;
}

body.dashboard-page .confirm-modal .modal-actions .btn {
  padding: 0.4rem 0.85rem;
  font-size: 0.875rem;
  min-width: auto;
}

body.dashboard-page .confirm-modal-message {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--auth-ink);
}

body.dashboard-page .confirm-modal.is-danger .btn-danger {
  background: #dc2626;
  color: #fff;
  border-color: #dc2626;
}

body.dashboard-page .confirm-modal.is-danger .btn-danger:hover {
  background: #b91c1c;
  border-color: #b91c1c;
}

body.dashboard-page .btn-danger {
  background: #dc2626;
  color: #fff;
  border: 1px solid #dc2626;
}

body.dashboard-page .btn-danger:hover {
  background: #b91c1c;
  border-color: #b91c1c;
  color: #fff;
}

/* Alerts on dashboard */
body.dashboard-page .alert {
  border: 1px solid transparent;
  box-shadow: none;
  font-family: var(--auth-font);
  padding: 0.4rem 0.7rem;
  font-size: 0.85rem;
}

body.dashboard-page .activity-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

body.dashboard-page .activity-item {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--auth-border);
  font-size: 0.875rem;
}

body.dashboard-page .activity-time {
  color: var(--auth-muted);
  min-width: 8rem;
}

body.dashboard-page .activity-project {
  font-weight: 600;
  color: var(--auth-grad-to);
}

@media (max-width: 900px) {
  body.dashboard-page {
    height: auto;
    max-height: none;
    overflow-x: hidden;
    overflow-y: auto;
  }

  body.dashboard-page .dashboard-container {
    flex-direction: column;
    height: auto;
    max-height: none;
    overflow: visible;
  }

  body.dashboard-page .sidebar {
    position: relative;
    top: auto;
    align-self: stretch;
    width: 100%;
    height: auto;
    max-height: none;
    min-height: auto;
    padding: 1rem;
  }

  /* Keep intentional collapse as icon rail even on narrow viewports */
  body.dashboard-page .sidebar.is-collapsed,
  body.dashboard-page.sidebar-collapsed .sidebar,
  body.dashboard-page .dashboard-container.sidebar-collapsed .sidebar {
    width: 72px !important;
    padding-left: 0.55rem !important;
    padding-right: 0.55rem !important;
  }

  body.dashboard-page .sidebar-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
  }

  body.dashboard-page .sidebar-nav li {
    margin: 0;
  }

  body.dashboard-page .sidebar-user-row {
    width: 100%;
  }

  body.dashboard-page .main-content {
    height: auto;
    max-height: none;
    overflow: visible;
    padding: 1.25rem 1rem 2rem;
  }
}

/* Custom cursor — last so it wins over earlier cursor: pointer rules */
body.auth-page,
body.dashboard-page {
  cursor: var(--cursor-default);
}

body.auth-page :is(a, button, [role="button"], label, select, summary, input[type="submit"], input[type="button"]),
body.dashboard-page :is(a, button, [role="button"], label, select, summary, .nav-link, .row-menu-toggle, .btn) {
  cursor: var(--cursor-pointer);
}

body.auth-page :is(a, button, input, select):disabled,
body.dashboard-page :is(a, button, input, select, .btn):disabled {
  cursor: not-allowed;
}

@media (pointer: coarse) {
  body.auth-page,
  body.dashboard-page,
  body.auth-page :is(a, button, [role="button"], label, select, summary),
  body.dashboard-page :is(a, button, [role="button"], label, select, summary, .nav-link, .btn) {
    cursor: auto;
  }
}

/* Custom scrollbars — dashboard + auth */
body.dashboard-page,
body.auth-page {
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--auth-grad-to) 55%, #a8a0c0) transparent;
}

body.dashboard-page *,
body.auth-page * {
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--auth-grad-to) 55%, #a8a0c0) transparent;
}

body.dashboard-page ::-webkit-scrollbar,
body.auth-page ::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}

body.dashboard-page ::-webkit-scrollbar-track,
body.auth-page ::-webkit-scrollbar-track {
  background: transparent;
}

body.dashboard-page ::-webkit-scrollbar-thumb,
body.auth-page ::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--auth-grad-to) 45%, #b0a8c8);
  border: 1px solid transparent;
  background-clip: padding-box;
  border-radius: 999px;
  min-height: 2.5rem;
}

body.dashboard-page ::-webkit-scrollbar-thumb:hover,
body.auth-page ::-webkit-scrollbar-thumb:hover {
  background: var(--auth-grad-to);
  border: 2px solid transparent;
  background-clip: padding-box;
}

body.dashboard-page ::-webkit-scrollbar-corner,
body.auth-page ::-webkit-scrollbar-corner {
  background: transparent;
}

body.dashboard-page .main-content,
body.dashboard-page .sidebar,
body.dashboard-page .table-container,
body.dashboard-page .modal-content {
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--auth-grad-to) 55%, #a8a0c0) transparent;
}

/* Phase C/D — Sources, Deploy, Credentials, Live test */
.sources-stack {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.sources-page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
}

.sources-page-heading {
  flex: 1 1 14rem;
  min-width: 0;
}

.sources-page-heading .profile-page-title {
  margin-bottom: 0.35rem;
}

.sources-page-heading .profile-page-subtitle {
  max-width: 36rem;
}

.sources-page-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.65rem;
  flex: 0 1 auto;
}

.sources-page-actions .btn-outline {
  border-color: color-mix(in srgb, var(--auth-ink, #1e3a5f) 28%, transparent);
  color: var(--auth-ink, #1e3a5f);
  background: transparent;
}

.sources-page-actions .btn-outline:hover {
  border-color: var(--auth-ink, #1e3a5f);
  background: color-mix(in srgb, var(--auth-ink, #1e3a5f) 6%, #fff);
  color: var(--auth-ink, #1e3a5f);
}

#sources .card-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.sources-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
}

#sources .supported-file-types {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex: 0 0 auto;
}

.sources-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  padding: 0;
  align-items: center;
  flex: 1 1 16rem;
  min-width: 0;
}

.sources-filter-input,
.sources-filter-select {
  font: inherit;
  font-size: 0.875rem;
  padding: 0.45rem 0.65rem;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: var(--radius, 0.5rem);
  background: color-mix(in srgb, #fff 82%, transparent);
  color: var(--auth-ink, #1e3a5f);
  backdrop-filter: blur(6px);
}

.sources-filter-input {
  flex: 1 1 12rem;
  min-width: 10rem;
}

.sources-filter-select {
  flex: 0 0 auto;
}

#sources .table-container {
  overflow: visible;
}

#sources .sources-row-actions {
  width: 2.5rem;
  text-align: right;
}

body.dashboard-page .row-menu-panel button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.upload-chooser-tabs {
  display: flex;
  gap: 0.35rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border, #e2e8f0);
}

.upload-chooser-tab {
  border: none;
  background: transparent;
  padding: 0.55rem 0.85rem;
  font: inherit;
  font-weight: 550;
  color: var(--text-secondary, #64748b);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.upload-chooser-tab.is-active {
  color: var(--auth-ink, #1e3a5f);
  border-bottom-color: var(--auth-ink, #1e3a5f);
}

.upload-chooser-pane .form-group {
  margin-bottom: 0.85rem;
}

.upload-progress-dock {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 12000;
  width: min(22rem, calc(100vw - 2rem));
  pointer-events: none;
}

.upload-progress-dock[hidden] {
  display: none !important;
}

.upload-progress-dock-inner {
  pointer-events: auto;
  padding: 0.9rem 1rem;
  border-radius: 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.45);
  background: color-mix(in srgb, rgba(255, 255, 255, 0.72) 70%, rgba(30, 58, 95, 0.08));
  backdrop-filter: blur(16px) saturate(1.35);
  -webkit-backdrop-filter: blur(16px) saturate(1.35);
  box-shadow:
    0 12px 40px rgba(15, 23, 42, 0.16),
    0 2px 8px rgba(15, 23, 42, 0.06);
}

.upload-progress-dock-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
}

.upload-progress-dock-header strong {
  font-size: 0.92rem;
  color: var(--auth-ink, #1e3a5f);
}

.upload-progress-dismiss {
  border: none;
  background: transparent;
  color: var(--auth-muted, #64748b);
  cursor: pointer;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 0.4rem;
}

.upload-progress-dismiss:hover {
  background: rgba(30, 58, 95, 0.08);
  color: var(--auth-ink, #1e3a5f);
}

.upload-progress-meta {
  margin: 0 0 0.65rem;
  font-size: 0.8rem;
  color: var(--auth-muted, #64748b);
}

.upload-progress-track {
  height: 0.4rem;
  border-radius: 999px;
  background: rgba(30, 58, 95, 0.12);
  overflow: hidden;
}

.upload-progress-fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, #e54646, #7c3aed);
  transition: width 0.25s ease;
}

.supported-formats-hint {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0;
  padding: 0.2rem 0.45rem 0.2rem 0.2rem;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--auth-muted, #64748b);
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: help;
  transition:
    color 0.18s ease,
    background-color 0.18s ease,
    transform 0.18s ease;
}

.supported-formats-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 50%;
  border: 1.5px solid color-mix(in srgb, var(--auth-ink, #1e3a5f) 22%, transparent);
  background: #fff;
  color: var(--auth-ink, #1e3a5f);
  font-size: 0.65rem;
  transition:
    background-color 0.18s ease,
    border-color 0.18s ease,
    color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.18s ease;
}

.supported-formats-hint:hover,
.supported-formats-hint:focus-visible {
  color: var(--auth-ink, #1e3a5f);
  background: color-mix(in srgb, var(--auth-ink, #1e3a5f) 6%, #fff);
  outline: none;
}

.supported-formats-hint:hover .supported-formats-icon,
.supported-formats-hint:focus-visible .supported-formats-icon {
  background: var(--auth-ink, #1e3a5f);
  border-color: var(--auth-ink, #1e3a5f);
  color: #fff;
  box-shadow: 0 4px 12px color-mix(in srgb, var(--auth-ink, #1e3a5f) 28%, transparent);
  transform: translateY(-1px) scale(1.06);
}

.supported-formats-tooltip {
  position: absolute;
  top: calc(100% + 0.55rem);
  right: 0;
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  max-width: min(22rem, 80vw);
  padding: 0.65rem 0.75rem;
  border-radius: 0.65rem;
  border: 1px solid color-mix(in srgb, var(--auth-ink, #1e3a5f) 12%, transparent);
  background: #fff;
  box-shadow:
    0 10px 28px color-mix(in srgb, var(--auth-ink, #1e3a5f) 12%, transparent),
    0 2px 6px rgba(15, 23, 42, 0.06);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  pointer-events: none;
  transition:
    opacity 0.16s ease,
    transform 0.16s ease,
    visibility 0.16s ease;
}

.supported-formats-tooltip::before {
  content: "";
  position: absolute;
  top: -5px;
  right: 1.1rem;
  width: 9px;
  height: 9px;
  background: #fff;
  border-left: 1px solid color-mix(in srgb, var(--auth-ink, #1e3a5f) 12%, transparent);
  border-top: 1px solid color-mix(in srgb, var(--auth-ink, #1e3a5f) 12%, transparent);
  transform: rotate(45deg);
}

.supported-file-types:hover .supported-formats-tooltip,
.supported-formats-hint:focus-visible + .supported-formats-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.format-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.45rem;
  border-radius: 0.35rem;
  background: color-mix(in srgb, var(--auth-ink, #1e3a5f) 7%, #f8fafc);
  color: var(--auth-ink, #1e3a5f);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.credentials-header {
  flex-wrap: wrap;
  gap: var(--space-4);
}

.credentials-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.snippet-box {
  display: block;
  margin: var(--space-2) 0;
  padding: var(--space-4);
  background: var(--surface-muted, #f4f4f5);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: ui-monospace, monospace;
  font-size: 0.8125rem;
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 220px;
  overflow: auto;
}

.credential-secret-box {
  user-select: all;
}

.live-test-card {
  max-width: none;
  width: 100%;
  min-height: min(70vh, 720px);
  display: flex;
  flex-direction: column;
  padding: 1rem 1.15rem 1.15rem;
  background: transparent;
  border: none;
  box-shadow: none;
}

.live-test-panel {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  flex: 1;
  min-height: 0;
}

.chat-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.live-test-reset-btn {
  width: 2.25rem;
  height: 2.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface, #fff);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.live-test-reset-btn:hover {
  background: var(--auth-ground, #f3f4f6);
  color: var(--text-primary);
  border-color: var(--border-hover, #d1d5db);
}

.live-test-messages {
  flex: 1;
  min-height: 360px;
  max-height: none;
  height: min(52vh, 560px);
  overflow-y: auto;
  padding: 0.25rem 0.15rem;
  border: none;
  border-radius: 0;
  background: transparent;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.live-test-msg {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 0;
  border-radius: 0;
  max-width: 92%;
  line-height: 1.5;
  background: transparent;
  border: none;
}

.live-test-msg-meta {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--auth-muted, #64748b);
  padding: 0 0.15rem;
}

.live-test-msg-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 50%;
  font-size: 0.58rem;
  flex-shrink: 0;
  background: color-mix(in srgb, var(--auth-ink, #1e3a5f) 10%, #fff);
  color: var(--auth-ink, #1e3a5f);
}

.live-test-msg-user {
  align-self: flex-end;
  background: transparent;
  border: none;
}

.live-test-msg-user .live-test-msg-meta {
  justify-content: flex-end;
}

.live-test-msg-user .live-test-msg-avatar {
  background: color-mix(in srgb, var(--accent, #7c3aed) 18%, #fff);
}

.live-test-msg-assistant {
  align-self: flex-start;
  background: transparent;
  border: none;
}

.live-test-msg-bubble {
  padding: var(--space-3);
  border-radius: var(--radius);
  line-height: 1.5;
}

.live-test-msg-user .live-test-msg-bubble {
  background: color-mix(in srgb, var(--accent) 15%, white);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
}

.live-test-msg-assistant .live-test-msg-bubble {
  background: white;
  border: 1px solid var(--border);
}

.live-test-msg-typing .live-test-msg-bubble {
  background: white;
  border: 1px solid var(--border);
  min-width: 3.5rem;
}

.live-test-msg-rich .chat-msg-body {
  font-size: 0.9375rem;
}

.live-test-msg-rich .chat-para {
  margin: 0 0 0.65rem;
}

.live-test-msg-rich .chat-para:last-child {
  margin-bottom: 0;
}

.live-test-msg-rich .chat-list {
  margin: 0.45rem 0 0.85rem 0;
  padding-left: 1.35rem;
}

.live-test-msg-rich .chat-list-ol {
  list-style: decimal;
}

.live-test-msg-rich .chat-list-ul {
  list-style: disc;
  margin-top: 0.35rem;
  padding-left: 1.25rem;
}

.live-test-msg-rich .chat-list > li {
  margin-bottom: 0.55rem;
  padding-left: 0.15rem;
}

.live-test-msg-rich .chat-list .chat-list-ul {
  margin-bottom: 0.25rem;
}

.live-test-msg-rich .chat-inline-code,
.live-test-msg-rich .chat-code-block {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85em;
}

.live-test-msg-rich .chat-inline-code {
  padding: 0.1em 0.35em;
  border-radius: 0.25rem;
  background: color-mix(in srgb, var(--auth-ink, #1e3a5f) 8%, #fff);
}

.live-test-msg-rich .chat-code-block {
  margin: 0.5rem 0 0.75rem;
  padding: 0.65rem 0.75rem;
  overflow-x: auto;
  border-radius: 0.4rem;
  background: color-mix(in srgb, var(--auth-ink, #1e3a5f) 6%, #f8fafc);
  border: 1px solid var(--border, #e2e8f0);
}

.chat-sources {
  margin-top: 0.75rem;
  padding-top: 0.55rem;
  border-top: 1px solid var(--border, #e2e8f0);
  font-size: 0.75rem;
  color: var(--auth-muted, #64748b);
  line-height: 1.4;
}

.chat-sources-label {
  font-weight: 600;
  color: var(--auth-ink, #1e3a5f);
}

.chat-source-item {
  color: var(--auth-muted, #64748b);
}

.chat-source-link {
  appearance: none;
  border: none;
  background: none;
  padding: 0;
  margin: 0;
  font: inherit;
  font-size: inherit;
  color: var(--auth-ink, #1e3a5f);
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.chat-source-link:hover {
  color: color-mix(in srgb, var(--auth-grad-to, #7c3aed) 80%, #1e3a5f);
}

.live-test-msg-typing .chat-typing-dots {
  display: inline-flex;
  gap: 0.35rem;
  padding: 0.35rem 0.15rem;
  align-items: center;
}

.live-test-msg-typing .chat-typing-dots span {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: var(--auth-muted, #64748b);
  animation: liveTestTyping 1.2s infinite ease-in-out;
}

.live-test-msg-typing .chat-typing-dots span:nth-child(2) {
  animation-delay: 0.15s;
}

.live-test-msg-typing .chat-typing-dots span:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes liveTestTyping {
  0%,
  80%,
  100% {
    opacity: 0.35;
    transform: translateY(0);
  }
  40% {
    opacity: 1;
    transform: translateY(-3px);
  }
}

.live-test-msg-system,
.live-test-msg-error {
  align-self: center;
  font-size: 0.875rem;
  color: var(--text-muted);
  padding: var(--space-3);
  border-radius: var(--radius);
  max-width: 92%;
}

.live-test-msg-error {
  color: #ef4444;
  border: 1px solid #fecaca;
  background: #fef2f2;
}

.live-test-composer {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
  margin-top: 0.45rem;
  padding: 0.28rem 0.32rem 0.28rem 0.4rem;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 999px;
  background: var(--surface, #fff);
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

.live-test-composer:focus-within {
  border-color: color-mix(in srgb, var(--auth-grad-to, #7c3aed) 55%, #cbd5e1);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--auth-grad-to, #7c3aed) 18%, transparent);
}

.live-test-model {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  flex: 0 0 auto;
  max-width: 7.25rem;
  min-width: 0;
  padding: 0.2rem 0.15rem 0.2rem 0.35rem;
  border: none;
  border-radius: 0.35rem;
  background: transparent;
}

.live-test-model-icon {
  flex: 0 0 auto;
  font-size: 0.68rem;
  color: var(--auth-muted, #64748b);
  opacity: 0.9;
}

.live-test-model-select {
  appearance: none;
  flex: 1 1 auto;
  min-width: 0;
  max-width: 100%;
  margin: 0;
  padding: 0.15rem 0.95rem 0.15rem 0;
  border: none;
  border-radius: 0;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='5' viewBox='0 0 8 5'%3E%3Cpath fill='%2394a3b8' d='M1 1l3 3 3-3'/%3E%3C/svg%3E")
      no-repeat right 0.1rem center / 0.45rem,
    transparent;
  color: var(--auth-muted, #64748b);
  font: inherit;
  font-size: 0.68rem;
  font-weight: 500;
  line-height: 1.2;
  cursor: pointer;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.live-test-model:hover .live-test-model-icon,
.live-test-model:hover .live-test-model-select,
.live-test-model:focus-within .live-test-model-icon,
.live-test-model:focus-within .live-test-model-select {
  color: var(--auth-ink, #1e3a5f);
}

.live-test-model-select:focus {
  outline: none;
}

.live-test-composer input[type="text"] {
  flex: 1 1 auto;
  min-width: 0;
  width: auto;
  margin: 0;
  padding: 0.5rem 0.35rem;
  border: none;
  border-radius: 0;
  background: transparent;
  font-size: 0.9375rem;
  color: var(--auth-ink, #1e3a5f);
  box-shadow: none;
}

.live-test-composer input[type="text"]:focus {
  outline: none;
  border: none;
  box-shadow: none;
}

.live-test-send-btn {
  position: static;
  transform: none;
  flex: 0 0 auto;
  width: 1.55rem;
  height: 1.55rem;
  margin: 0;
  border: none;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #fff;
  font-size: 0.7rem;
  background: linear-gradient(135deg, var(--auth-grad-from, #e54646), var(--auth-grad-to, #7c3aed));
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.live-test-send-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  background: #94a3b8;
}

.live-test-send-btn.is-stop {
  background: #fff;
  color: var(--auth-ink, #1e3a5f);
  border: 1.5px solid color-mix(in srgb, var(--auth-ink, #1e3a5f) 28%, transparent);
}

.live-test-send-btn.is-stop .fa-stop {
  font-size: 0.55rem;
}

.live-test-input-row,
.live-test-composer-row,
.live-test-model-wrap,
.live-test-model-label {
  display: none;
}

#chat.content-section.active {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 7rem);
}

#chat .live-test-card {
  flex: 1;
}

/* Super Admin Overview cockpit + Audit logs */
body.dashboard-page .overview-page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

body.dashboard-page .overview-toolbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

body.dashboard-page .live-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--auth-muted, #6b7280);
}

body.dashboard-page .live-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: #2f6f4e;
  box-shadow: 0 0 0 0 rgba(47, 111, 78, 0.45);
  animation: live-pulse 1.6s ease-out infinite;
}

body.dashboard-page .live-indicator.is-paused .live-dot {
  background: #9ca3af;
  animation: none;
  box-shadow: none;
}

@keyframes live-pulse {
  0% { box-shadow: 0 0 0 0 rgba(47, 111, 78, 0.45); }
  70% { box-shadow: 0 0 0 8px rgba(47, 111, 78, 0); }
  100% { box-shadow: 0 0 0 0 rgba(47, 111, 78, 0); }
}

body.dashboard-page .overview-kpi-grid {
  margin-bottom: 1.25rem;
}

body.dashboard-page .overview-charts-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}

body.dashboard-page .overview-chart-card .card-header {
  margin-bottom: 0.5rem;
}

body.dashboard-page .chart-wrap {
  position: relative;
  height: 220px;
  padding: 0 0.75rem 0.75rem;
}

body.dashboard-page .chart-wrap--doughnut {
  height: 240px;
  max-width: 280px;
  margin: 0 auto;
}

body.dashboard-page .overview-actions-alone {
  margin-bottom: 1.25rem;
}

body.dashboard-page .overview-actions-alone .overview-actions-card {
  margin-bottom: 0;
}

body.dashboard-page .overview-actions-card .quick-actions {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

body.dashboard-page .overview-telemetry-card {
  margin-top: 0.25rem;
}

body.dashboard-page .overview-telemetry-card .telemetry-strip {
  display: grid;
}

body.dashboard-page .overview-telemetry-card .telemetry-list {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.75rem 1.25rem;
}

body.dashboard-page .overview-telemetry-card .telemetry-list li {
  grid-template-columns: 7rem minmax(0, 1fr);
}

body.dashboard-page .overview-lower-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
  align-items: stretch;
}

body.dashboard-page .overview-actions-card .card-header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.2rem;
  margin-bottom: 0.35rem;
}

body.dashboard-page .overview-actions-card .card-subtitle {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--auth-muted, #6b7280);
}

body.dashboard-page .quick-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
  padding: 0 1rem 1.1rem;
}

body.dashboard-page .quick-action {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  width: 100%;
  margin: 0;
  padding: 0.85rem 0.9rem;
  text-align: left;
  cursor: pointer;
  color: var(--auth-ink, #1a1a1a);
  background: linear-gradient(180deg, rgba(255,255,255,0.9), rgba(248,249,250,0.95));
  border: 1px solid var(--auth-border, #e5e7eb);
  border-radius: var(--auth-radius-sm, 8px);
  font: inherit;
  transition: border-color 0.15s ease, background-color 0.15s ease, transform 0.15s ease;
}

body.dashboard-page .quick-action:hover,
body.dashboard-page .quick-action:focus-visible {
  border-color: color-mix(in srgb, var(--auth-grad-to, #6e5cff) 45%, var(--auth-border, #e5e7eb));
  background: #fff;
  outline: none;
  transform: translateY(-1px);
}

body.dashboard-page .quick-action:active {
  transform: none;
}

body.dashboard-page .quick-action--wide {
  grid-column: 1 / -1;
}

body.dashboard-page .quick-action-icon {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: var(--auth-radius-sm, 8px);
  color: var(--auth-grad-to, #6e5cff);
  background: color-mix(in srgb, var(--auth-grad-to, #6e5cff) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--auth-grad-to, #6e5cff) 22%, var(--auth-border, #e5e7eb));
}

body.dashboard-page .quick-action-copy {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

body.dashboard-page .quick-action-title {
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.25;
}

body.dashboard-page .quick-action-hint {
  font-size: 0.78rem;
  line-height: 1.35;
  color: var(--auth-muted, #6b7280);
}

body.dashboard-page .telemetry-strip {
  padding: 0 1rem 1rem;
}

body.dashboard-page .telemetry-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
}

body.dashboard-page .telemetry-list li {
  display: grid;
  grid-template-columns: 7.5rem minmax(0, 1fr);
  gap: 0.75rem;
  font-size: 0.9rem;
}

body.dashboard-page .tel-label {
  color: var(--auth-muted, #6b7280);
  font-weight: 500;
}

body.dashboard-page .tel-value.ok { color: #2f6f4e; font-weight: 600; }
body.dashboard-page .tel-value.bad { color: #b42318; font-weight: 600; }

body.dashboard-page .overview-meta-row,
body.dashboard-page .muted-meta {
  color: var(--auth-muted, #6b7280);
  font-size: 0.85rem;
}

body.dashboard-page .audit-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

body.dashboard-page .filter-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.8rem;
  color: var(--auth-muted, #6b7280);
}

body.dashboard-page .filter-field input,
body.dashboard-page .filter-field select {
  min-width: 9rem;
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--auth-border, #e5e7eb);
  background: var(--auth-surface, #fff);
  font: inherit;
  color: var(--auth-ink, #1a1a1a);
}

body.dashboard-page .table-pager {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--auth-border, #e5e7eb);
}

body.dashboard-page .table-pager .pager-btn.btn-outline:disabled,
body.dashboard-page .table-pager .pager-btn.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  background: transparent;
  border-color: var(--auth-border, #e5e7eb);
  color: var(--auth-muted, #6b7280);
}

body.dashboard-page .outcome-pill {
  display: inline-block;
  padding: 0.15rem 0.45rem;
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid var(--auth-border, #e5e7eb);
}

body.dashboard-page .outcome-success { color: #2f6f4e; }
body.dashboard-page .outcome-failure,
body.dashboard-page .outcome-denied,
body.dashboard-page .outcome-error { color: #b42318; }

body.dashboard-page .corr-id {
  font-size: 0.75rem;
  word-break: break-all;
}

@media (max-width: 1100px) {
  body.dashboard-page .overview-actions-card .quick-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 960px) {
  body.dashboard-page .overview-charts-grid,
  body.dashboard-page .overview-lower-grid {
    grid-template-columns: 1fr;
  }
  body.dashboard-page .overview-actions-card .quick-actions,
  body.dashboard-page .quick-actions {
    grid-template-columns: 1fr;
  }
  body.dashboard-page .quick-action--wide {
    grid-column: auto;
  }
  body.dashboard-page .telemetry-list li,
  body.dashboard-page .overview-telemetry-card .telemetry-list li {
    grid-template-columns: 1fr;
    gap: 0.15rem;
  }
}

/*
Theme / dark mode deferred — re-enable with switcher later

html[data-theme='dark'] body.dashboard-page {
  --auth-grad-from: #3a2a4a;
  --auth-grad-to: #4a5d8a;
  --auth-ink: #e8eaef;
  --auth-muted: rgba(232, 234, 239, 0.58);
  --auth-surface: #1a1d24;
  --auth-ground: #0e1014;
  --auth-border: rgba(232, 234, 239, 0.1);
  --background: #0e1014;
  --surface: #1a1d24;
  --text-primary: #e8eaef;
  --text-secondary: rgba(232, 234, 239, 0.7);
  --border: rgba(232, 234, 239, 0.1);
  background: var(--auth-ground);
  color: var(--auth-ink);
}

html[data-theme='dark'] body.dashboard-page .sidebar {
  background:
    radial-gradient(ellipse 70% 45% at 8% 0%, rgba(90, 70, 120, 0.35) 0%, transparent 55%),
    radial-gradient(ellipse 60% 50% at 100% 100%, rgba(55, 75, 120, 0.4) 0%, transparent 55%),
    linear-gradient(165deg, #1a1524 0%, #151a28 55%, #12151f 100%);
}

html[data-theme='dark'] body.dashboard-page .sidebar::after {
  opacity: 0.45;
  mix-blend-mode: soft-light;
}

html[data-theme='dark'] body.dashboard-page .main-content {
  background: var(--auth-ground);
  color: var(--auth-ink);
}

html[data-theme='dark'] body.dashboard-page .card,
html[data-theme='dark'] body.dashboard-page .stat-card,
html[data-theme='dark'] body.dashboard-page .modal-content,
html[data-theme='dark'] body.dashboard-page .table-container {
  background: var(--auth-surface);
  border-color: var(--auth-border);
  color: var(--auth-ink);
  box-shadow: none;
}

html[data-theme='dark'] body.dashboard-page .stat-card i,
html[data-theme='dark'] body.dashboard-page .quick-action-icon {
  color: #9aa8d4;
  background: rgba(154, 168, 212, 0.12);
  border-color: rgba(154, 168, 212, 0.22);
}

html[data-theme='dark'] body.dashboard-page .profile-page-title,
html[data-theme='dark'] body.dashboard-page .card-title,
html[data-theme='dark'] body.dashboard-page .stat-value,
html[data-theme='dark'] body.dashboard-page .table th,
html[data-theme='dark'] body.dashboard-page .table td,
html[data-theme='dark'] body.dashboard-page .quick-action-title,
html[data-theme='dark'] body.dashboard-page .tel-value {
  color: var(--auth-ink);
}

html[data-theme='dark'] body.dashboard-page .profile-page-subtitle,
html[data-theme='dark'] body.dashboard-page .stat-label,
html[data-theme='dark'] body.dashboard-page .muted-meta,
html[data-theme='dark'] body.dashboard-page .card-subtitle,
html[data-theme='dark'] body.dashboard-page .quick-action-hint,
html[data-theme='dark'] body.dashboard-page .tel-label {
  color: var(--auth-muted);
}

html[data-theme='dark'] body.dashboard-page .quick-action {
  background: #151820;
  border-color: var(--auth-border);
  color: var(--auth-ink);
}

html[data-theme='dark'] body.dashboard-page .quick-action:hover,
html[data-theme='dark'] body.dashboard-page .quick-action:focus-visible {
  background: #1e222c;
  border-color: rgba(154, 168, 212, 0.35);
}

html[data-theme='dark'] body.dashboard-page .btn-primary {
  background: linear-gradient(135deg, #5a6fa8, #6b5b95);
  border-color: transparent;
  color: #fff;
}

html[data-theme='dark'] body.dashboard-page .btn-outline {
  background: transparent;
  color: var(--auth-ink);
  border-color: rgba(232, 234, 239, 0.18);
}

html[data-theme='dark'] body.dashboard-page .btn-outline:hover {
  border-color: rgba(154, 168, 212, 0.55);
  background: rgba(154, 168, 212, 0.08);
  color: var(--auth-ink);
}

html[data-theme='dark'] body.dashboard-page input,
html[data-theme='dark'] body.dashboard-page select,
html[data-theme='dark'] body.dashboard-page textarea,
html[data-theme='dark'] body.dashboard-page .filter-field input,
html[data-theme='dark'] body.dashboard-page .filter-field select {
  background: #12151b;
  color: var(--auth-ink);
  border-color: rgba(232, 234, 239, 0.14);
}

html[data-theme='dark'] body.dashboard-page .table thead th {
  background: rgba(255, 255, 255, 0.03);
  border-color: var(--auth-border);
}

html[data-theme='dark'] body.dashboard-page .table tbody tr:hover td {
  background: rgba(255, 255, 255, 0.03);
}

html[data-theme='dark'] body.dashboard-page .card-header,
html[data-theme='dark'] body.dashboard-page .table-pager {
  border-color: var(--auth-border);
}

html[data-theme='dark'] body.dashboard-page .skeleton {
  background: linear-gradient(90deg, rgba(255,255,255,0.04), rgba(255,255,255,0.09), rgba(255,255,255,0.04));
}

html[data-theme='dark'] body.dashboard-page .outcome-pill {
  border-color: var(--auth-border);
}

html[data-theme='dark'] body.dashboard-page .outcome-success { color: #5ecf8e; }
html[data-theme='dark'] body.dashboard-page .outcome-failure,
html[data-theme='dark'] body.dashboard-page .outcome-denied,
html[data-theme='dark'] body.dashboard-page .outcome-error { color: #f07178; }

html[data-theme='dark'] body.dashboard-page .live-dot {
  background: #5ecf8e;
}

html[data-theme='dark'] body.dashboard-page .sidebar-theme {
  background: rgba(0, 0, 0, 0.28);
  border-color: rgba(255, 255, 255, 0.16);
}

html[data-theme='dark'] body.dashboard-page .theme-btn.is-active {
  background: #e8eaef;
  color: #12151b;
}

html[data-theme='dark'] body.dashboard-page .nav-link.active {
  background: rgba(255, 255, 255, 0.12);
}

html[data-theme='dark'] body.dashboard-page code,
html[data-theme='dark'] body.dashboard-page .corr-id {
  color: #c5cce0;
}
*/

/* Client cockpit topbar (Dashboard | workspace + bell) */
body.dashboard-page .client-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: -1.75rem -2rem 1.25rem;
  padding: 0.95rem 2rem;
  position: sticky;
  top: -1.75rem;
  z-index: 30;
  background: var(--auth-surface, #fff);
  border-bottom: 1px solid var(--auth-border);
}

body.dashboard-page .client-topbar-title {
  margin: 0;
  font-family: var(--auth-sans, 'Outfit', sans-serif);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--auth-ink);
  line-height: 1.2;
}

body.dashboard-page .client-topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
}

body.dashboard-page .ws-switcher-wrap {
  position: relative;
  min-width: 0;
}

body.dashboard-page .ws-switcher-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  max-width: min(18rem, 46vw);
  margin: 0;
  padding: 0.2rem 0.15rem;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--auth-ink);
  cursor: pointer;
  box-shadow: none;
}

body.dashboard-page .ws-switcher-btn:hover,
body.dashboard-page .ws-switcher-btn[aria-expanded='true'] {
  background: color-mix(in srgb, var(--auth-ink) 4%, transparent);
}

body.dashboard-page .ws-switcher-icon {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 5px;
  border: 1px solid var(--auth-border);
  background: #fff;
  font-family: var(--auth-sans, 'Outfit', sans-serif);
  font-size: 0.78rem;
  font-weight: 700;
  color: #1e3a5f;
  line-height: 1;
  overflow: hidden;
}

body.dashboard-page .ws-switcher-icon.has-logo {
  padding: 0;
  border-color: transparent;
  background: transparent;
}

body.dashboard-page .ws-switcher-icon.has-logo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

body.dashboard-page .ws-switcher-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--auth-sans, 'Outfit', sans-serif);
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--auth-ink);
}

body.dashboard-page .ws-switcher-chevron {
  flex: 0 0 auto;
  font-size: 0.7rem;
  color: var(--auth-muted);
  opacity: 0.85;
}

body.dashboard-page .ws-switcher-panel {
  position: absolute;
  top: calc(100% + 0.45rem);
  right: 0;
  width: min(20rem, calc(100vw - 5rem));
  background: var(--auth-surface);
  border: 1px solid var(--auth-border);
  border-radius: var(--auth-radius-sm, 8px);
  box-shadow: 0 12px 32px rgba(20, 16, 31, 0.14);
  overflow: hidden;
  z-index: 40;
}

body.dashboard-page .ws-switcher-panel[hidden] {
  display: none !important;
}

body.dashboard-page .ws-switcher-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.7rem 0.85rem 0.45rem;
}

body.dashboard-page .ws-switcher-panel-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--auth-muted);
}

body.dashboard-page .ws-switcher-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  margin: 0;
  padding: 0.65rem 0.85rem;
  border: 0;
  background: transparent;
  color: var(--auth-ink);
  text-align: left;
  cursor: pointer;
  box-shadow: none;
}

body.dashboard-page .ws-switcher-item:hover:not(:disabled) {
  background: color-mix(in srgb, var(--auth-ink) 4%, transparent);
}

body.dashboard-page .ws-switcher-item.is-current {
  cursor: default;
}

body.dashboard-page .ws-switcher-item.is-current .fa-check {
  color: #2f6b3a;
  font-size: 0.75rem;
}

body.dashboard-page .ws-switcher-item-icon {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 5px;
  border: 1px solid var(--auth-border);
  background: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  color: #1e3a5f;
}

body.dashboard-page .ws-switcher-item-icon--add {
  color: var(--auth-muted);
  font-weight: 500;
}

body.dashboard-page .ws-switcher-item-copy {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

body.dashboard-page .ws-switcher-item-name {
  font-size: 0.9rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.dashboard-page .ws-switcher-item-hint {
  font-size: 0.72rem;
  color: var(--auth-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.dashboard-page .ws-switcher-panel-foot {
  border-top: 1px solid var(--auth-border);
}

body.dashboard-page .notif-bell-wrap {
  position: relative;
}

body.dashboard-page .notif-bell-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.15rem;
  height: 2.15rem;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #5b6472;
  font-size: 1.1rem;
  cursor: pointer;
  box-shadow: none;
}

body.dashboard-page .notif-bell-btn:hover,
body.dashboard-page .notif-bell-btn[aria-expanded='true'] {
  color: var(--auth-ink);
  background: color-mix(in srgb, var(--auth-ink) 4%, transparent);
}

body.dashboard-page .notif-badge {
  position: absolute;
  top: -0.3rem;
  right: -0.3rem;
  min-width: 1.1rem;
  height: 1.1rem;
  padding: 0 0.25rem;
  border-radius: 999px;
  background: #c0392b;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  line-height: 1.1rem;
  text-align: center;
}

body.dashboard-page .notif-panel {
  position: absolute;
  top: calc(100% + 0.45rem);
  right: 0;
  width: min(26rem, calc(100vw - 5rem));
  max-height: min(28rem, 70vh);
  display: flex;
  flex-direction: column;
  background: var(--auth-surface);
  border: 1px solid var(--auth-border);
  border-radius: var(--auth-radius-sm, 8px);
  box-shadow: 0 12px 32px rgba(20, 16, 31, 0.14);
  overflow: hidden;
}

body.dashboard-page .notif-panel[hidden] {
  display: none !important;
}

body.dashboard-page .notif-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--auth-border);
}

body.dashboard-page .notif-panel-title {
  margin: 0;
  font-family: var(--auth-display);
  font-size: 1.05rem;
  color: var(--auth-ink);
}

body.dashboard-page .notif-panel-sub {
  margin: 0.15rem 0 0;
  font-size: 0.78rem;
  color: var(--auth-muted);
}

body.dashboard-page .notif-panel-body {
  overflow-y: auto;
  padding: 0.5rem 0;
  max-height: 18rem;
}

body.dashboard-page .notif-panel-footer {
  display: flex;
  justify-content: flex-end;
  padding: 0.65rem 1rem;
  border-top: 1px solid var(--auth-border);
}

body.dashboard-page .notif-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

body.dashboard-page .notif-item {
  padding: 0.7rem 1rem;
  border-left: 3px solid transparent;
}

body.dashboard-page .notif-item.is-new {
  border-left-color: var(--auth-grad-to);
  background: color-mix(in srgb, var(--auth-grad-to) 6%, transparent);
}

body.dashboard-page .notif-item-row {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
}

body.dashboard-page .notif-item-icon {
  flex: 0 0 auto;
  width: 1.5rem;
  height: 1.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--auth-muted);
  margin-top: 0.15rem;
}

body.dashboard-page .notif-item-copy {
  flex: 1;
  min-width: 0;
}

body.dashboard-page .notif-item-workspace {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--auth-grad-to, #6b4a9e);
  margin-bottom: 0.15rem;
}

body.dashboard-page .notif-item-time {
  font-size: 0.72rem;
  color: var(--auth-muted);
  margin-bottom: 0.2rem;
}

body.dashboard-page .notif-item-query {
  font-size: 0.9rem;
  color: var(--auth-ink);
  line-height: 1.35;
}

body.dashboard-page .notif-item-meta {
  margin-top: 0.25rem;
  font-size: 0.75rem;
  color: var(--auth-muted);
}

body.dashboard-page .notif-empty {
  padding: 1.25rem 1rem;
}

body.dashboard-page .client-quick-actions {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

body.dashboard-page .client-charts-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 1100px) {
  body.dashboard-page .client-quick-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 960px) {
  body.dashboard-page .client-topbar {
    margin: -1.25rem -1rem 1rem;
    padding: 0.85rem 1rem;
    top: -1.25rem;
  }

  body.dashboard-page .client-quick-actions,
  body.dashboard-page .client-charts-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  body.dashboard-page .client-topbar-title {
    font-size: 1.05rem;
  }

  body.dashboard-page .ws-switcher-name {
    max-width: 7.5rem;
  }
}

/* —— Bots dual-sidebar IA —— */
body.dashboard-page .bot-sidebar {
  display: none;
  width: 13.5rem;
  flex-shrink: 0;
  background: #f3f4f6;
  border-right: 1px solid var(--border);
  padding: 0.75rem 0.65rem 1rem;
  overflow-y: auto;
}

body.dashboard-page.bot-scope-active .bot-sidebar,
html.bot-scope-pending body.dashboard-page .bot-sidebar {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

body.dashboard-page .bot-sidebar[hidden] {
  display: none !important;
}

body.dashboard-page .bot-sidebar-header {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  padding: 0 0.35rem;
}

body.dashboard-page .bot-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  padding: 0.25rem 0;
}

body.dashboard-page .bot-back-btn:hover {
  color: var(--text-primary);
}

body.dashboard-page .bot-sidebar-title {
  font-size: 1rem;
  font-weight: 650;
  color: var(--text-primary);
  line-height: 1.25;
  word-break: break-word;
}

body.dashboard-page .bot-sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

body.dashboard-page .bot-nav-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.6rem;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  cursor: pointer;
  font: inherit;
}

body.dashboard-page .bot-nav-link:hover {
  background: rgba(0, 0, 0, 0.05);
  color: var(--text-primary);
}

body.dashboard-page .bot-nav-link.active {
  background: rgba(30, 58, 95, 0.1);
  color: #1e3a5f;
}

body.dashboard-page .bot-nav-group-toggle {
  justify-content: flex-start;
}

body.dashboard-page .bot-nav-group-toggle .nav-group-chevron {
  margin-left: auto;
  font-size: 0.7rem;
  opacity: 0.75;
  transition: transform 0.2s ease;
}

body.dashboard-page .bot-nav-group.is-open > .bot-nav-group-toggle .nav-group-chevron {
  transform: rotate(180deg);
}

body.dashboard-page .bot-nav-sub {
  display: none;
  flex-direction: column;
  gap: 0.15rem;
  margin: 0.15rem 0 0.35rem 1.15rem;
  padding: 0.15rem 0 0.15rem 0.75rem;
  border-left: 1px solid rgba(0, 0, 0, 0.14);
}

body.dashboard-page .bot-nav-group.is-open > .bot-nav-sub {
  display: flex;
}

body.dashboard-page .bot-nav-sub .bot-nav-link {
  font-size: 0.85rem;
  padding: 0.38rem 0.55rem;
  gap: 0.55rem;
}

body.dashboard-page .bot-nav-sub .bot-nav-link i {
  width: 0.95rem;
  text-align: center;
  font-size: 0.8rem;
  opacity: 0.75;
  flex-shrink: 0;
}

body.dashboard-page .bots-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

body.dashboard-page .bots-page-title {
  font-size: 1.5rem;
  font-weight: 650;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

body.dashboard-page .bots-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.5rem;
  height: 1.5rem;
  padding: 0 0.4rem;
  border-radius: 999px;
  background: #e5e7eb;
  font-size: 0.8rem;
  font-weight: 600;
}

body.dashboard-page .bots-page-subtitle {
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

body.dashboard-page .bots-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 1rem;
}

body.dashboard-page .logs-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  margin: 0 0 1rem;
}

body.dashboard-page .logs-search {
  flex: 1 1 16rem;
  min-width: 12rem;
  max-width: 28rem;
  padding: 0.55rem 0.85rem;
  border: 1px solid var(--auth-border, #e2e8f0);
  border-radius: 0.5rem;
  background: #fff;
  font: inherit;
  font-size: 0.9rem;
  color: var(--auth-ink, #14101f);
}

body.dashboard-page .logs-search:focus {
  outline: none;
  border-color: var(--auth-grad-to, #6e5cff);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--auth-grad-to, #6e5cff) 22%, transparent);
}

body.dashboard-page .logs-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem 0.75rem;
}

body.dashboard-page .logs-filter-label {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary, #64748b);
}

body.dashboard-page .logs-filter-label select {
  min-width: 8.5rem;
  padding: 0.45rem 0.65rem;
  border: 1px solid var(--auth-border, #e2e8f0);
  border-radius: 0.5rem;
  background: #fff;
  font: inherit;
  font-size: 0.875rem;
  color: var(--auth-ink, #14101f);
}

body.dashboard-page .logs-card .table-container {
  padding-top: 0;
}

body.dashboard-page .logs-actions-col,
body.dashboard-page .logs-row-actions {
  width: 2.75rem;
  text-align: right;
}

body.dashboard-page .logs-row-actions .row-menu {
  display: inline-flex;
  justify-content: flex-end;
}

body.dashboard-page .bots-search {
  flex: 1 1 14rem;
  min-width: 10rem;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font: inherit;
}

body.dashboard-page .bots-sort-label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

body.dashboard-page .bots-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
  gap: 1rem;
}

body.dashboard-page .bot-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 1rem 1.1rem;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

body.dashboard-page .bot-card:hover,
body.dashboard-page .bot-card:focus-visible {
  border-color: #1e3a5f;
  box-shadow: 0 2px 8px rgba(30, 58, 95, 0.08);
  outline: none;
}

body.dashboard-page .bot-card-top {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}

body.dashboard-page .bot-card-icon {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: var(--radius-sm);
  background: #1e3a5f;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 650;
  flex-shrink: 0;
}

body.dashboard-page .bot-card-body {
  flex: 1;
  min-width: 0;
}

body.dashboard-page .bot-card-name {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 0.25rem;
}

body.dashboard-page .bot-card-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.35;
}

body.dashboard-page .bot-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.85rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

body.dashboard-page .bot-card-title-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.25rem;
}

body.dashboard-page .bot-card-title-row .bot-card-name {
  margin: 0;
}

body.dashboard-page .bot-card-menu {
  flex-shrink: 0;
  margin-left: auto;
}

body.dashboard-page .bot-card-menu .row-menu-toggle {
  width: 2rem;
  height: 2rem;
}

body.dashboard-page .bot-card {
  position: relative;
}

body.dashboard-page .bot-card-opening {
  display: none;
  position: absolute;
  inset: 0;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.72);
  border-radius: inherit;
  color: #1e3a5f;
  font-size: 1.25rem;
  z-index: 2;
}

body.dashboard-page .bot-card.is-opening .bot-card-opening {
  display: flex;
}

body.dashboard-page .bot-card.is-opening {
  pointer-events: none;
}

body.dashboard-page.bot-opening .main-content::before {
  content: '';
  position: sticky;
  top: 0;
  left: 0;
  display: block;
  height: 3px;
  width: 100%;
  z-index: 50;
  background: linear-gradient(90deg, transparent, #1e3a5f, transparent);
  background-size: 40% 100%;
  background-repeat: no-repeat;
  animation: bot-open-progress 0.9s ease-in-out infinite;
}

@keyframes bot-open-progress {
  0% { background-position: -40% 0; }
  100% { background-position: 140% 0; }
}

body.dashboard-page .content-section.section-booting .live-test-card,
body.dashboard-page .content-section.section-booting .card,
body.dashboard-page .content-section.section-booting .config-main {
  animation: section-boot-pulse 1.1s ease-in-out infinite;
}

@keyframes section-boot-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.72; }
}




body.dashboard-page .widget-tabs {
  display: flex;
  gap: 0.35rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

body.dashboard-page .widget-tab {
  border: none;
  background: transparent;
  padding: 0.55rem 0.9rem;
  font: inherit;
  font-weight: 550;
  color: var(--text-secondary);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

body.dashboard-page .widget-tab.is-active {
  color: #1e3a5f;
  border-bottom-color: #1e3a5f;
}

/* Widget → Deploy (DocsBot-style) */
body.dashboard-page .deploy-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

body.dashboard-page .deploy-save-btn {
  flex-shrink: 0;
  width: 2.5rem;
  height: 2.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--auth-border);
  border-radius: var(--auth-radius-sm);
  background: var(--auth-surface, #fff);
  color: var(--auth-ink);
  cursor: pointer;
}

body.dashboard-page .deploy-save-btn:hover {
  border-color: var(--auth-ink);
}

body.dashboard-page .deploy-save-btn:disabled {
  opacity: 0.65;
  cursor: wait;
}

body.dashboard-page .deploy-panel {
  display: flex;
  flex-direction: column;
  gap: 0;
  max-width: 52rem;
}

body.dashboard-page .deploy-block {
  padding: 0 0 1.75rem;
  margin: 0 0 1.75rem;
  border-bottom: 1px solid var(--auth-border);
}

body.dashboard-page .deploy-block:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

body.dashboard-page .deploy-embed-method {
  margin-top: 1.25rem;
}

body.dashboard-page .deploy-embed-title {
  margin: 0 0 0.35rem;
  font-size: 0.95rem;
  font-weight: 650;
  color: var(--auth-ink);
}

body.dashboard-page .deploy-snippet {
  position: relative;
  margin-top: 0.75rem;
  border-radius: var(--auth-radius);
  background: #1a2332;
  overflow: hidden;
}

body.dashboard-page .deploy-snippet-copy {
  position: absolute;
  top: 0.65rem;
  right: 0.65rem;
  z-index: 1;
  background: transparent;
  color: #e8eef7;
  border-color: rgba(255, 255, 255, 0.35);
}

body.dashboard-page .deploy-snippet-copy:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.55);
}

body.dashboard-page .deploy-snippet-code {
  margin: 0;
  padding: 1rem 1.1rem;
  padding-top: 2.75rem;
  overflow-x: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.78rem;
  line-height: 1.55;
  color: #e8eef7;
  white-space: pre;
}

body.dashboard-page .deploy-signing-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  max-width: 40rem;
}

body.dashboard-page .deploy-signing-input {
  flex: 1;
  min-width: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85rem;
}

body.dashboard-page .deploy-signing-row .btn-icon {
  flex-shrink: 0;
  width: 2.35rem;
  height: 2.35rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--auth-border);
  border-radius: var(--auth-radius-sm);
  background: transparent;
  color: var(--auth-muted);
  cursor: pointer;
}

body.dashboard-page .deploy-signing-row .btn-icon:hover {
  color: var(--auth-ink);
  border-color: var(--auth-ink);
}

body.dashboard-page .deploy-signing-reveal {
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  border: 1px solid rgba(180, 83, 9, 0.35);
  border-radius: var(--auth-radius);
  background: rgba(251, 191, 36, 0.12);
}

body.dashboard-page .deploy-domains-input {
  width: 100%;
  max-width: 40rem;
  resize: vertical;
}

body.dashboard-page .deploy-docs-list {
  margin: 0 0 1rem;
  padding-left: 1.25rem;
  display: grid;
  gap: 0.55rem;
  color: var(--auth-ink);
}

body.dashboard-page .deploy-docs-list li {
  line-height: 1.45;
}

/* —— Widget Design split pane —— */
body.dashboard-page .design-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

body.dashboard-page .design-save-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 2.5rem;
  padding: 0.55rem 1.05rem;
  border: none;
  border-radius: 0.5rem;
  background: linear-gradient(135deg, var(--auth-grad-from), var(--auth-grad-to));
  color: #fff;
  font-size: 0.9rem;
  font-weight: 650;
  letter-spacing: 0.01em;
  cursor: pointer;
  box-shadow: 0 2px 8px color-mix(in srgb, var(--auth-grad-to) 28%, transparent);
  transition: filter 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

body.dashboard-page .design-save-btn i {
  font-size: 0.9rem;
}

body.dashboard-page .design-save-btn:hover {
  filter: brightness(1.06);
  box-shadow: 0 4px 14px color-mix(in srgb, var(--auth-grad-to) 36%, transparent);
}

body.dashboard-page .design-save-btn:disabled,
body.dashboard-page .design-save-btn.is-loading {
  opacity: 0.7;
  cursor: wait;
  box-shadow: none;
  filter: none;
}

body.dashboard-page .design-split {
  display: grid;
  grid-template-columns: minmax(22rem, 36rem) minmax(0, 1fr);
  gap: 1.5rem;
  align-items: stretch;
  min-height: min(70vh, 52rem);
}

body.dashboard-page .design-controls {
  overflow-y: auto;
  max-height: min(75vh, 56rem);
  padding: 0.15rem 0.65rem 0.15rem 0.1rem;
  display: grid;
  gap: 1rem;
  align-content: start;
}

body.dashboard-page .design-colors-grid,
body.dashboard-page .design-inline-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

body.dashboard-page .design-block {
  display: grid;
  gap: 0.7rem;
  padding: 1rem 1.05rem;
  border: 1px solid var(--auth-border, #e2e8f0);
  border-radius: 0.75rem;
  background: rgba(255, 255, 255, 0.72);
}

body.dashboard-page .design-block .profile-section-title {
  margin: 0;
}

body.dashboard-page .design-block .settings-note {
  margin: 0;
}

body.dashboard-page .design-block .form-group {
  margin: 0;
}

body.dashboard-page .design-compact-group {
  display: grid;
  gap: 0.45rem;
}

body.dashboard-page .design-badge {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.1rem 0.4rem;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #0369a1;
  background: #e0f2fe;
  border-radius: 0.25rem;
  vertical-align: middle;
}

body.dashboard-page .design-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

body.dashboard-page .design-swatch {
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 50%;
  border: 2px solid transparent;
  background: var(--swatch);
  cursor: pointer;
  padding: 0;
}

body.dashboard-page .design-swatch.is-selected {
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--auth-accent, #0ea5e9);
}

body.dashboard-page .design-custom-color {
  display: grid;
  gap: 0.35rem;
}

body.dashboard-page .design-custom-color > label {
  font-size: 0.8rem;
  font-weight: 600;
  color: #64748b;
}

body.dashboard-page .design-custom-color .design-color-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
}

body.dashboard-page .design-custom-color input[type="color"] {
  width: 2.35rem;
  height: 2.1rem;
  padding: 0;
  border: 1px solid var(--auth-border, #e2e8f0);
  border-radius: 0.4rem;
  background: #fff;
  cursor: pointer;
  flex-shrink: 0;
}

body.dashboard-page .design-hex-input {
  flex: 1;
  min-width: 0;
  width: auto;
  max-width: 8.5rem;
  font-family: ui-monospace, monospace;
}

body.dashboard-page .design-radio-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
}

body.dashboard-page .design-radio {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.9rem;
  cursor: pointer;
}

body.dashboard-page .design-icon-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

body.dashboard-page .design-icon-btn {
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  border: 1.5px solid var(--auth-border, #e2e8f0);
  background: #fff;
  color: #334155;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  padding: 0;
}

body.dashboard-page .design-icon-btn.is-selected {
  border-color: #0ea5e9;
  box-shadow: 0 0 0 2px rgba(14, 165, 233, 0.35);
  color: #0369a1;
}

body.dashboard-page .design-logo-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

body.dashboard-page .design-logo-preview {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--auth-border, #e2e8f0);
  border-radius: 0.5rem;
  background: #fff;
}

body.dashboard-page .design-logo-preview img {
  max-height: 2rem;
  max-width: 8rem;
  object-fit: contain;
}

body.dashboard-page .design-logo-remove {
  position: absolute;
  top: -0.4rem;
  right: -0.4rem;
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 50%;
  border: none;
  background: #ef4444;
  color: #fff;
  font-size: 0.85rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

body.dashboard-page .design-upload-btn {
  cursor: pointer;
  margin: 0;
}

body.dashboard-page .design-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.9rem;
}

body.dashboard-page .design-toggle {
  width: 2.5rem;
  height: 1.35rem;
  accent-color: #14b8a6;
}

body.dashboard-page .design-check {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
}

body.dashboard-page .design-preview-pane {
  display: flex;
  flex-direction: column;
  min-height: min(70vh, 52rem);
  background: transparent;
  overflow: visible;
}

body.dashboard-page .design-preview-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 0 0 0.65rem;
  background: transparent;
  border: none;
}

body.dashboard-page .design-mode-toggle {
  display: inline-flex;
  padding: 0.2rem;
  gap: 0.15rem;
  border: 1px solid var(--auth-border, #e2e8f0);
  border-radius: 0.5rem;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

body.dashboard-page .design-mode-btn {
  border: none;
  background: transparent;
  padding: 0.45rem 0.95rem;
  font-size: 0.85rem;
  font-weight: 650;
  color: #64748b;
  cursor: pointer;
  border-radius: 0.35rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

body.dashboard-page .design-mode-btn i {
  font-size: 0.75rem;
  opacity: 0.85;
}

body.dashboard-page .design-mode-btn.is-active {
  background: linear-gradient(135deg, var(--auth-grad-from), var(--auth-grad-to));
  color: #fff;
  box-shadow: 0 1px 4px color-mix(in srgb, var(--auth-grad-to) 24%, transparent);
}

body.dashboard-page .design-preview-stage {
  position: relative;
  flex: 1;
  min-height: min(82vh, 48rem);
  background: transparent;
  border: none;
  box-shadow: none;
  border-radius: 0;
  overflow: hidden;
}

body.dashboard-page .design-preview-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: transparent;
  color-scheme: normal;
}

body.dashboard-page .design-preview-skeleton {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: stretch;
  padding: 0.5rem 0.85rem 1rem;
  pointer-events: none;
  z-index: 2;
}

body.dashboard-page .design-preview-skeleton[hidden] {
  display: none !important;
}

body.dashboard-page .design-skel-panel {
  flex: 1;
  width: min(360px, 100%);
  display: flex;
  flex-direction: column;
  border-radius: 18px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.12);
  overflow: hidden;
  margin-bottom: 4.25rem;
}

body.dashboard-page .design-skel-header {
  height: 3.25rem;
  background: linear-gradient(90deg, #cbd5e1 0%, #e2e8f0 50%, #cbd5e1 100%);
  background-size: 200% 100%;
  animation: designSkelShine 1.1s ease-in-out infinite;
}

body.dashboard-page .design-skel-body {
  flex: 1;
  padding: 1.1rem;
  display: grid;
  gap: 0.75rem;
  align-content: start;
}

body.dashboard-page .design-skel-bubble {
  height: 3.4rem;
  width: 72%;
  border-radius: 14px;
  background: linear-gradient(90deg, #e2e8f0 0%, #f1f5f9 50%, #e2e8f0 100%);
  background-size: 200% 100%;
  animation: designSkelShine 1.1s ease-in-out infinite;
}

body.dashboard-page .design-skel-bubble-short {
  width: 48%;
  height: 2.4rem;
  animation-delay: 0.12s;
}

body.dashboard-page .design-skel-bubble-user {
  width: 56%;
  margin-left: auto;
  height: 2.6rem;
  animation-delay: 0.2s;
}

body.dashboard-page .design-skel-input {
  height: 2.75rem;
  margin: 0 1rem 1rem;
  border-radius: 999px;
  background: linear-gradient(90deg, #e2e8f0 0%, #f8fafc 50%, #e2e8f0 100%);
  background-size: 200% 100%;
  animation: designSkelShine 1.1s ease-in-out infinite;
  animation-delay: 0.08s;
}

body.dashboard-page .design-skel-fab {
  position: absolute;
  right: 1.5rem;
  bottom: 1.15rem;
  width: 3.35rem;
  height: 3.35rem;
  border-radius: 50%;
  background: linear-gradient(90deg, #94a3b8 0%, #cbd5e1 50%, #94a3b8 100%);
  background-size: 200% 100%;
  animation: designSkelShine 1.1s ease-in-out infinite;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.15);
}

body.dashboard-page .design-preview-stage[data-preview-mode="embed"] .design-skel-fab {
  display: none;
}

body.dashboard-page .design-preview-stage[data-preview-mode="embed"] .design-skel-panel {
  width: 100%;
  margin-bottom: 0;
}

body.dashboard-page .design-preview-empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 1.5rem;
  text-align: center;
  color: #64748b;
  font-size: 0.95rem;
  pointer-events: none;
}

@media (max-width: 1280px) {
  body.dashboard-page .design-split {
    grid-template-columns: minmax(20rem, 30rem) minmax(0, 1fr);
  }
}

@media (max-width: 1100px) {
  body.dashboard-page .design-split {
    grid-template-columns: 1fr;
  }

  body.dashboard-page .design-controls {
    max-height: none;
  }

  body.dashboard-page .design-preview-pane {
    min-height: 28rem;
  }
}

@media (max-width: 720px) {
  body.dashboard-page .design-colors-grid,
  body.dashboard-page .design-inline-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 960px) {


  body.dashboard-page.bot-scope-active .bot-sidebar {
    width: 11.5rem;
  }
}
