/* ============================================================================
   CONSOLIDATED SITE STYLES - Main CSS for TheUIThingApp
   This file consolidates all component-scoped CSS from Razor pages
   ============================================================================ */

/* ============================================================================
   GLOBAL VARIABLES AND BASE STYLES
   ============================================================================ */

    /* Variables */
    :root {
        --primary-color: #1976D2;
        --primary-color-dark: #1565C0;
        --secondary-color: #FDB927;
        --success-green: #3dcb6c;
        --error-red: #ff3f5f;
        --border-color: #ddd;
        --text-primary: #333;
        --text-secondary: #666;
        --input-bg: #fff;
        --shadow-light: 0 2px 4px rgba(0, 0, 0, 0.1);
        --shadow-medium: 0 4px 8px rgba(0, 0, 0, 0.15);
    }

    /* Global Body Styles */
    * {
        margin: 0;
        padding: 0;
        box-sizing: border-box;
    }

    body {
        font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
        line-height: 1.6;
        color: var(--text-primary);
        background: #f5f5f5;
    }

    /* Container */
    .register-container {
        display: flex;
        justify-content: center;
        align-items: flex-start;
        min-height: 100vh;
        padding: 2rem 1rem;
    }

    /* Card */
    .register-card {
        background: white;
        border-radius: 8px;
        box-shadow: var(--shadow-medium);
        padding: 2rem;
        width: 100%;
        max-width: 480px;
        margin-top: 1.5rem;
    }

    /* Title */
    .register-title {
        color: var(--text-primary);
        font-size: 1.75rem;
        font-weight: 500;
        margin: 0 0 0.5rem 0;
    }

    .register-subtitle {
        color: var(--text-secondary);
        font-size: 0.9rem;
        margin: 0 0 1.5rem 0;
        line-height: 1.5;
    }

    /* Alerts */
    .alert {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        padding: 0.75rem 1rem;
        border-radius: 4px;
        margin-bottom: 1rem;
        font-size: 0.9rem;
    }

    .alert-icon {
        flex-shrink: 0;
    }

    .alert-error {
        background-color: rgba(255, 63, 95, 0.1);
        color: var(--error-red);
        border-left: 3px solid var(--error-red);
    }

    .alert-success {
        background-color: rgba(61, 203, 108, 0.1);
        color: var(--success-green);
        border-left: 3px solid var(--success-green);
    }

    /* Form */
    .form-group {
        margin-bottom: 1.25rem;
    }

    .form-label {
        display: block;
        color: var(--text-primary);
        font-size: 0.875rem;
        font-weight: 500;
        margin-bottom: 0.5rem;
    }

    /* Input Wrapper */
    .input-wrapper {
        position: relative;
        display: flex;
        align-items: center;
    }

    .input-icon {
        position: absolute;
        left: 12px;
        color: var(--text-secondary);
        pointer-events: none;
    }

    /* Form Input */
    .form-input {
        width: 100%;
        padding: 0.75rem 1rem 0.75rem 2.75rem;
        border: 1px solid var(--border-color);
        border-radius: 4px;
        font-size: 1rem;
        color: var(--text-primary);
        background-color: var(--input-bg);
        transition: all 0.2s ease;
        outline: none;
    }

    .form-input:focus {
        border-color: var(--primary-color);
        box-shadow: 0 0 0 2px rgba(25, 118, 210, 0.1);
    }

    .form-input::placeholder {
        color: #aaa;
    }

    .form-input:invalid:not(:placeholder-shown) {
        border-color: var(--error-red);
    }

    /* Validation Message */
    .validation-message {
        display: block;
        color: var(--error-red);
        font-size: 0.8rem;
        margin-top: 0.375rem;
        min-height: 1.2rem;
    }

    /* Button Group */
    .button-group {
        display: flex;
        gap: 0.75rem;
        margin-top: 1.5rem;
    }

    /* Buttons */
    .btn {
        flex: 1;
        padding: 0.75rem 1.5rem;
        border: none;
        border-radius: 4px;
        font-size: 0.95rem;
        font-weight: 500;
        cursor: pointer;
        transition: all 0.2s ease;
        text-transform: uppercase;
        letter-spacing: 0.02857em;
    }

    .btn:disabled {
        opacity: 0.6;
        cursor: not-allowed;
    }

    .btn-primary {
        background-color: var(--primary-color);
        color: white;
        box-shadow: var(--shadow-light);
    }

    .btn-primary:hover:not(:disabled) {
        background-color: var(--primary-color-dark);
        box-shadow: var(--shadow-medium);
        transform: translateY(-1px);
    }

    .btn-primary:active:not(:disabled) {
        transform: translateY(0);
    }

    .btn-secondary {
        background-color: transparent;
        color: var(--text-secondary);
        border: 1px solid var(--border-color);
    }

    .btn-secondary:hover:not(:disabled) {
        background-color: rgba(0, 0, 0, 0.04);
        border-color: var(--text-secondary);
    }

    /* Responsive */
    @@media (max-width: 768px) {
        .register-container {
            padding: 1rem 0.75rem;
        }

        .register-card {
            padding: 1.5rem;
            margin-top: 1rem;
        }

        .register-title {
            font-size: 1.5rem;
        }

        .button-group {
            flex-direction: column;
        }

        .btn {
            width: 100%;
        }
    }

    @@media (max-width: 480px) {
        .register-card {
            padding: 1.25rem;
        }

        .register-title {
            font-size: 1.35rem;
        }

        .form-input {
            font-size: 0.95rem;
            padding: 0.625rem 0.875rem 0.625rem 2.5rem;
        }

        .input-icon {
            left: 10px;
            width: 18px;
            height: 18px;
        }
    }



/* Layout-specific styles - scoped to MainLayout */
.app-container {
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.app-bar {
    background-color: var(--primary-color); /* Primary color */
    color: #FFFFFF;
    display: flex;
    align-items: center;
    padding: 0 1rem;
    gap: 1rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    height: 64px;
    flex-shrink: 0;
    z-index: 1100;
}

.icon-btn {
    background: transparent;
    border: none;
    color: #FFFFFF;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

    .icon-btn:hover {
        background-color: rgba(255, 238, 0, 0.2); /* Secondary color transparent */
    }

    .icon-btn:active {
        background-color: rgba(255, 238, 0, 0.3);
    }

.app-logo {
    height: 40px;
    margin: 0 0.5rem;
}

.app-title {
    font-size: 1.25rem;
    font-weight: 500;
    margin-left: 0.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-name {
    font-size: 0.95rem;
    color: #e8e8e8;
    padding: 0.5rem 1rem;
    background: rgba(255, 238, 0, 0.15);
    border-radius: 20px;
}

.spacer {
    flex: 1;
}

.main-content-full {
    flex: 1;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-color-dark) 100%);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

@media (max-width: 600px) {
    .app-bar {
        padding: 0 0.5rem;
    }

    .app-title {
        font-size: 0.9rem;
    }

    .user-name {
        display: none;
    }
}

/* ============================================================================
   HOME PAGE STYLES
   ============================================================================ */

/* Home page styles */
.home-container {
    min-height: 100%;
    padding: 2rem 1rem;
    width: 100%;
}

.home-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    width: 100%;
}

/* Home Tabs */
.home-tabs {
    display: flex;
    gap: 0.5rem;
    margin: 2rem 0 1.5rem 0;
    background: white;
    border-radius: 12px;
    padding: 0.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.home-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: #666;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.home-tab:hover {
    background: rgba(25, 118, 210, 0.1);
    color: var(--primary-color);
}

.home-tab.active {
    background: var(--primary-color);
    color: white;
}

.home-tab .tab-icon {
    flex-shrink: 0;
}

/* Apps Grid */
.apps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.app-card {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1rem;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.app-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.app-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.app-card:hover::before {
    transform: scaleX(1);
}

.app-card-icon {
    width: 72px;
    height: 72px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-color-dark));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: all 0.3s ease;
}

.app-card:hover .app-card-icon {
    background: var(--secondary-color);
    color: var(--primary-color);
    transform: scale(1.1);
}

.app-card-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--primary-color);
    margin: 0;
}

.app-card-description {
    font-size: 0.95rem;
    color: #666;
    margin: 0;
    line-height: 1.5;
}

.app-card-arrow {
    margin-top: auto;
    color: var(--primary-color);
    transition: transform 0.3s ease;
}

.app-card:hover .app-card-arrow {
    transform: translateX(8px);
}

/* Home Actions */
.home-actions {
    display: flex;
    justify-content: center;
    margin-top: 2rem;
}

.btn-home-action {
    display: inline-flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 2rem;
    background: white;
    border: 2px solid var(--primary-color);
    border-radius: 12px;
    color: var(--primary-color);
    font-size: 1.1rem;
    font-weight: 600;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
}

.btn-home-action:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.btn-home-action .arrow-icon {
    transition: transform 0.3s ease;
}

.btn-home-action:hover .arrow-icon {
    transform: translateX(4px);
}

.btn-login {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.btn-login:hover {
    background: var(--secondary-color);
    color: var(--primary-color);
    border-color: var(--secondary-color);
}

/* Welcome Card */
.welcome-card {
    text-align: center;
    padding: 3rem 2rem;
}

.welcome-title {
    font-size: 1.75rem;
    font-weight: 500;
    color: var(--primary-color);
    margin: 0 0 1.5rem 0;
}

.welcome-card .intro-text {
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

.welcome-card .home-actions {
    margin-top: 2rem;
}

/* ============================================================================
   CONFIG PAGE STYLES
   ============================================================================ */

/* Config page with navigation sidebar */
.config-page-with-nav {
    display: flex;
    height: 100%;
    gap: 1rem;
    padding: 1rem;
}

.config-sidebar {
    width: 240px;
    flex-shrink: 0;
    background: var(--primary-color);
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    overflow-y: auto;
}

.config-main-content {
    flex: 1;
    overflow-y: auto;
}

.sidebar-content {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 1rem 0.5rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: #FFFFFF;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.2s ease;
    cursor: pointer;
    font-size: 0.95rem;
}

.nav-link:hover {
    background-color: rgba(255, 238, 0, 0.2);
}

.nav-link.active {
    background-color: var(--secondary-color) !important;
    color: var(--primary-color) !important;
    font-weight: 600;
}

.nav-link.active .nav-icon {
    color: var(--primary-color) !important;
}

.nav-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    color: currentColor;
}

.nav-divider {
    height: 1px;
    background-color: rgba(255, 255, 255, 0.12);
    margin: 0.5rem 0;
}

/* Config editor page styles */
.config-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

.config-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 2rem 1rem 2rem;
    background-color: #f5f5f5;
    border-bottom: 1px solid #ddd;
}

.config-title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary-color);
}

.config-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.editor-toolbar {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    background-color: #f5f5f5;
    border-bottom: 1px solid #ddd;
}

.monaco-host {
    flex: 1;
    position: relative;
    overflow: hidden;
}

.message {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-size: 0.9rem;
}

.message-icon {
    flex-shrink: 0;
}

.message-info {
    background-color: rgba(33, 150, 243, 0.1);
    color: #2196F3;
    border: 1px solid rgba(33, 150, 243, 0.3);
}

.message-success {
    background-color: rgba(61, 203, 108, 0.1);
    color: #3dcb6c;
    border-left: 3px solid #3dcb6c;
}

.message-error {
    background-color: rgba(255, 63, 95, 0.1);
    color: #ff3f5f;
    border: 1px solid rgba(255, 63, 95, 0.3);
}

/* Tabs */
.config-tabs {
    display: flex;
    gap: 0.25rem;
    padding: 0 2rem;
    background-color: #f5f5f5;
    border-bottom: 2px solid #ddd;
}

.config-tab {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: #666;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.2s;
}

.config-tab:hover {
    background-color: rgba(25, 118, 210, 0.05);
    color: var(--primary-color);
}

.config-tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    background-color: white;
}

.tab-icon {
    flex-shrink: 0;
}

/* Content area */
.config-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.apps-editor-container {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
}

.editor-section {
    max-width: 1200px;
    margin: 0 auto;
}

.section-title {
    margin: 0 0 1.5rem 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--primary-color);
}

.app-card {
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.app-card-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    background: #f5f9fa;
    border-bottom: 1px solid #ddd;
}

.app-name-input {
    flex: 1;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-color);
}

.app-card-body {
    padding: 1.5rem;
}

.form-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.form-row label {
    min-width: 140px;
    font-weight: 500;
    color: #555;
}

.form-input {
    flex: 1;
    padding: 0.5rem 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.95rem;
    transition: border-color 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(25, 118, 210, 0.1);
}

.reports-section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #eee;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.section-header h5 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #333;
}

.reports-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.report-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: #fafafa;
    border: 1px solid #eee;
    border-radius: 4px;
}

.report-name-input {
    flex: 2;
}

.report-id-input {
    flex: 3;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.85rem;
}

.btn-block {
    width: 100%;
    justify-content: center;
    margin-top: 1rem;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background-color: #5a6268;
}

.btn-danger {
    background-color: #dc3545;
    color: white;
}

.btn-danger:hover {
    background-color: #c82333;
}

.access-matrix-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 1.5rem;
}

.matrix-toolbar {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: #f5f9fa;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.new-user-form {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.new-user-form .form-input {
    min-width: 250px;
}

.yaml-editor-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.matrix-scroll {
    flex: 1;
    overflow: auto;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.access-matrix {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.access-matrix thead {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--primary-color);
    color: white;
}

.access-matrix th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid var(--primary-color-dark);
}

.access-matrix th.row-header {
    min-width: 200px;
    position: sticky;
    left: 0;
    background: var(--primary-color);
    z-index: 11;
}

.access-matrix th.app-column {
    min-width: 140px;
    text-align: center;
    border-left: 1px solid rgba(255, 255, 255, 0.2);
}

.access-matrix th.action-column {
    width: 100px;
    text-align: center;
    border-left: 1px solid rgba(255, 255, 255, 0.2);
}

.access-matrix tbody tr {
    transition: background-color 0.15s;
}

.access-matrix tbody tr:hover {
    background-color: #f9f9f9;
}

.access-matrix td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #eee;
}

.user-row {
    background-color: white;
}

.user-name {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    position: sticky;
    left: 0;
    background: white;
    z-index: 5;
    font-weight: 500;
    color: #333;
}

.user-row:hover .user-name {
    background-color: #f9f9f9;
}

.row-icon {
    flex-shrink: 0;
    opacity: 0.7;
}

.access-cell {
    text-align: center;
    border-left: 1px solid #eee;
}

.access-cell input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.action-cell {
    text-align: center;
    border-left: 1px solid #eee;
}

.loading, .no-data {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #999;
    font-size: 1.1rem;
}

/* Button styles */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    font-size: 0.95rem;
    font-weight: 500;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-icon {
    flex-shrink: 0;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-color-dark);
}

.btn-success {
    background-color: #3dcb6c;
    color: white;
}

.btn-success:hover {
    background-color: #2fb55d;
}

.btn:active {
    transform: translateY(1px);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ============================================================================
   REPORTS PAGE STYLES
   ============================================================================ */


/* ===== Generic Tabs System (for Reports page) ===== */
.tabs {
    position: relative;
    width: 100%;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

.tabs-header {
    display: flex;
    gap: 0;
    position: relative;
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) transparent;
}

.tabs-header::-webkit-scrollbar {
    height: 4px;
}

.tabs-header::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 2px;
}

.tab {
    flex: 1;
    min-width: 120px;
    padding: 1rem 1.5rem;
    border: none;
    background: white;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.3s ease;
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
    position: relative;
    text-align: center;
}

.tab:hover {
    color: var(--primary-color);
    background: rgba(25, 118, 210, 0.05);
}

.tab.active {
    background: var(--secondary-color);
    color: var(--primary-color);
    font-weight: 600;
}

.tab-slider {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 4px;
    background: var(--secondary-color);
    transition: transform 0.3s ease;
    width: calc(100% / var(--tab-count, 1));
}

/* Reports page styles - unified report + chat view with sidebar navigation */

.reports-page-with-nav {
    display: flex;
    height: 100%;
    gap: 1rem;
    padding: 1rem;
}

/* ---- Sidebar Navigation ---- */

.reports-sidebar {
    width: 240px;
    flex-shrink: 0;
    background: var(--primary-color);
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    overflow-y: auto;
}

.sidebar-content {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 1rem 0.5rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: #FFFFFF;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.2s ease;
    cursor: pointer;
    font-size: 0.95rem;
}

.nav-link:hover {
    background-color: rgba(255, 238, 0, 0.2);
}

.nav-link.active {
    background-color: var(--secondary-color) !important;
    color: var(--primary-color) !important;
    font-weight: 600;
}

.nav-link.active .nav-icon {
    color: var(--primary-color) !important;
}

.nav-link-child {
    padding-left: 3rem;
    font-size: 0.9rem;
}

.nav-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    color: currentColor;
}

.nav-divider {
    height: 1px;
    background-color: rgba(255, 255, 255, 0.12);
    margin: 0.5rem 0;
}

.nav-group {
    display: flex;
    flex-direction: column;
}

.nav-group-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: transparent;
    border: none;
    color: #FFFFFF;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    text-align: left;
}

.nav-group-header:hover {
    background-color: rgba(255, 238, 0, 0.2);
}

.nav-group-title {
    flex: 1;
}

.expand-icon {
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.nav-group.expanded .expand-icon {
    transform: rotate(180deg);
}

.nav-group-content {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.nav-group.expanded .nav-group-content {
    max-height: 1000px;
    margin-top: 0.25rem;
}

/* ---- Main Content Area ---- */

.reports-main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 0;
}

.reports-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    gap: 0.5rem;
}

/* ---- Tab toolbar (tabs + mode toggle) ---- */

.tab-toolbar {
    display: flex;
    align-items: stretch;
    gap: 0.5rem;
    flex-shrink: 0;
}

.tab-toolbar .tabs {
    flex: 1;
    min-width: 0;
}

.mode-toggle-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0 1.25rem;
    background: white;
    border: none;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    color: var(--primary-color);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.mode-toggle-btn:hover {
    background: var(--primary-color);
    color: white;
}

.mode-toggle-btn.active {
    background: var(--secondary-color);
    color: var(--primary-color);
    font-weight: 600;
}

.clear-chat-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0 1.25rem;
    background: white;
    border: none;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    color: var(--error-red);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.clear-chat-btn:hover:not(:disabled) {
    background: var(--error-red);
    color: white;
}

.clear-chat-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ---- Visibility helpers ---- */

.d-none {
    display: none !important;
}

/* ---- Report view ---- */

.report-view {
    flex: 1;
    overflow: hidden;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* ---- Chat view ---- */

.chat-view {
    flex: 1;
    overflow: hidden;
}

.chat-grid {
    display: grid;
    grid-template-columns: 3fr 1fr;
    gap: 1rem;
    height: 100%;
    overflow: hidden;
}

/* Chat Panel */
.chat-panel {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    gap: 1rem;
}

.messages-container {
    flex: 1;
    overflow-y: auto;
    background: #f5f5f5;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.messages-paper {
    background: white;
    padding: 1rem;
    min-height: 100%;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Chat Messages */
.chat-message {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-width: 70%;
}

    .chat-message.user {
        align-self: flex-start;
    }

    .chat-message.ai {
        align-self: flex-end;
    }

.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: #666;
    padding: 0 0.5rem;
}

.chat-author {
    font-weight: 600;
}

.chat-time {
    font-size: 0.75rem;
    opacity: 0.7;
}

.chat-bubble {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    word-wrap: break-word;
    line-height: 1.5;
}

.chat-message.user .chat-bubble {
    background-color: #e3f2fd;
    color: #1565c0;
    border-bottom-left-radius: 4px;
}

.chat-message.ai .chat-bubble {
    background-color: #f5f5f5;
    color: #333;
    border-bottom-right-radius: 4px;
}

/* Input */
.input-bubble {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background: white;
    border: 1px solid #ddd;
    border-radius: 24px;
    flex: 1;
}

.chat-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 1rem;
    padding: 0.5rem;
    background: transparent;
}

    .chat-input::placeholder {
        color: #aaa;
    }

.send-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

    .send-btn:hover:not(:disabled) {
        background: var(--primary-color-dark);
        transform: scale(1.05);
    }

    .send-btn:disabled {
        opacity: 0.6;
        cursor: not-allowed;
    }

/* Loading Spinner */
.loading-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Attachments Panel */
.attachments-panel {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 1rem;
    overflow-y: auto;
}

.attachment-item {
    padding: 0.75rem;
    background: #f8f9fa;
    border-radius: 6px;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: background 0.2s;
}

    .attachment-item:hover {
        background: #e9ecef;
    }

.attachment-icon {
    color: var(--primary-color);
    flex-shrink: 0;
}

.attachment-name {
    flex: 1;
    font-size: 0.9rem;
    color: #333;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Scrollbar */
.messages-container::-webkit-scrollbar,
.attachments-panel::-webkit-scrollbar {
    width: 8px;
}

.messages-container::-webkit-scrollbar-track,
.attachments-panel::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.messages-container::-webkit-scrollbar-thumb,
.attachments-panel::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}

    .messages-container::-webkit-scrollbar-thumb:hover,
    .attachments-panel::-webkit-scrollbar-thumb:hover {
        background: #555;
    }

/* Responsive */
@media (max-width: 768px) {
    .chat-grid {
        grid-template-columns: 1fr;
    }

    .attachments-panel {
        display: none;
    }

    .chat-message {
        max-width: 85%;
    }

    .messages-container {
        height: calc(100vh - 200px);
    }

    .mode-toggle-btn span {
        display: none;
    }
}

/* ============================================================================
   LOGOUT PAGE STYLES
   ============================================================================ */

/* Logout page styles */
.logout-container {
    min-height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.logout-card {
    background: white;
    border-radius: 16px;
    padding: 3rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    max-width: 400px;
    width: 100%;
    text-align: center;
}

.logout-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-color-dark));
    border-radius: 50%;
    color: white;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.8;
    }
}

.logout-title {
    font-size: 1.75rem;
    font-weight: 500;
    color: var(--primary-color);
    margin: 0 0 0.75rem 0;
}

.logout-message {
    font-size: 1rem;
    color: #666;
    margin: 0;
    line-height: 1.6;
}

/* ============================================================================
   LOGIN PAGE STYLES
   ============================================================================ */

/* Login page styles */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 64px);
    padding: 2rem 1rem;
}

.login-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    padding: 2.5rem;
    width: 100%;
    max-width: 480px;
}

.login-title {
    color: #333;
    font-size: 1.75rem;
    font-weight: 500;
    margin: 0 0 0.5rem 0;
    text-align: center;
}

.login-subtitle {
    color: #666;
    font-size: 0.9rem;
    margin: 0 0 2rem 0;
    line-height: 1.5;
    text-align: center;
}

.form-footer {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #ddd;
    font-size: 0.9rem;
    color: #666;
    text-align: center;
}

.form-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

    .form-link:hover {
        text-decoration: underline;
    }

.json-panel {
    background-color: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 1rem;
    max-height: 400px;
    overflow: auto;
    margin-top: 1rem;
}

    .json-panel pre {
        margin: 0;
        font-family: 'Courier New', monospace;
        font-size: 0.85rem;
        white-space: pre-wrap;
        word-break: break-all;
    }

/* ============================================================================
   REGISTER PAGE STYLES
   ============================================================================ */

/* Register page styles */
.register-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 64px);
    padding: 2rem 1rem;
}

.register-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    padding: 2.5rem;
    width: 100%;
    max-width: 480px;
}

.register-title {
    color: #333;
    font-size: 1.75rem;
    font-weight: 500;
    margin: 0 0 2rem 0;
    text-align: center;
}

/* ============================================================================
   SELECT REALM PAGE STYLES
   ============================================================================ */

/* Select realm page styles */
.select-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 64px);
    padding: 2rem 1rem;
}

.select-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    padding: 2.5rem;
    width: 100%;
    max-width: 600px;
}

.select-title {
    color: #333;
    font-size: 1.75rem;
    font-weight: 500;
    margin: 0 0 1rem 0;
    text-align: center;
}

.realm-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.realm-btn {
    width: 100%;
    padding: 1rem 1.5rem;
    background: white;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.realm-btn:hover {
    border-color: var(--primary-color);
    background-color: rgba(25, 118, 210, 0.05);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* ============================================================================
   CMS CONTENT BLOCKS STYLES
   ============================================================================ */

/* Hero Section */
.hero-section {
    text-align: center;
    padding: 3rem 2rem;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    margin: 0 auto 2rem auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 100%;
}

.hero-logo {
    max-width: 150px;
    height: auto;
    margin: 0 auto 1.5rem auto;
    display: block;
}

.hero-title {
    font-size: 2.5rem;
    font-weight: 600;
    color: white;
    margin: 0 0 1rem 0;
    line-height: 1.2;
    text-align: center;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: white;
    margin: 0 0 1.5rem 0;
    line-height: 1.5;
    text-align: center;
}

.hero-divider {
    width: 80px;
    height: 4px;
    background: var(--secondary-color);
    margin: 1rem auto;
    border-radius: 2px;
}


/* Content Card */
.content-card {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    margin-bottom: 2rem;
}

.card-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #f0f0f0;
}

.card-icon {
    flex-shrink: 0;
    color: var(--primary-color);
}

.card-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary-color);
    margin: 0;
    line-height: 1.3;
}

.card-text {
    font-size: 1rem;
    color: var(--text-primary);
    line-height: 1.7;
    margin: 0 0 1rem 0;
}

.card-text:last-child {
    margin-bottom: 0;
}
.intro-text {
    font-size: 1.1rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin: 0 0 1rem 0;
}

.intro-text:last-child {
    margin-bottom: 0;
}

.intro-text a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    transition: border-color 0.2s;
}

.intro-text a:hover {
    border-bottom-color: var(--primary-color);
}
/* Feature List */
.feature-list {
    list-style: none;
    padding: 0;
    margin: 1.5rem 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.feature-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 0.75rem;
    background: rgba(4, 99, 106, 0.03);
    border-radius: 8px;
    transition: all 0.2s ease;
}

.feature-item:hover {
    background: rgba(4, 99, 106, 0.08);
    transform: translateX(4px);
}

.check-icon {
    flex-shrink: 0;
    color: var(--success-green);
    margin-top: 0.125rem;
}

.feature-item div {
    flex: 1;
    font-size: 1rem;
    color: var(--text-primary);
    line-height: 1.6;
}

.feature-item strong {
    color: var(--primary-color);
    font-weight: 600;
}
/* Responsive adjustments for CMS blocks */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1.1rem;
    }

    .hero-section {
        padding: 2rem 1.5rem;
    }

    .content-card {
        padding: 1.5rem;
    }

    .card-title {
        font-size: 1.25rem;
    }

    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .feature-item {
        padding: 0.625rem;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 1.75rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .hero-logo {
        max-width: 120px;
    }

    .card-text,
    .intro-text,
    .feature-item div {
        font-size: 0.95rem;
    }
}









