


/* Defines the global THOTH brand palette. */
:root {
    --thoth-copper: #954e0e;
    --thoth-blue: #121f6b;
    --thoth-text: #25282d;
    --thoth-muted: #667085;
    --thoth-border: #d9dde3;
    --thoth-card: #ffffff;
    --thoth-background: #f5f7fa;
    --thoth-success: #198754;
    --thoth-danger: #dc3545;
}

/* Layout classes for MainLayout */
.page {
    position: relative;
    display: flex;
    flex-direction: row;
    min-height: 100vh;
}

.sidebar {
    width: 250px;
    background-color: #1b1a22; /* Or your preferred color */
    color: white;
}

main {
    flex: 1;
}

/* ==========================================================================
   Search Explorer — THOTH Theme
   ========================================================================== */

.search-explorer-page {
    color: var(--thoth-blue);
}

    /* Small page eyebrow such as RETRIEVAL LAB. */
    .search-explorer-page .eyebrow,
    .search-explorer-page .page-eyebrow,
    .search-explorer-page .section-eyebrow {
        color: var(--thoth-copper);
        font-weight: 700;
        letter-spacing: 0.14em;
        text-transform: uppercase;
    }

    /* Main Search Explorer heading. */
    .search-explorer-page h1 {
        color: var(--thoth-copper);
        font-weight: 700;
    }

    /* Major section headings. */
    .search-explorer-page h2 {
        color: var(--thoth-copper);
        font-weight: 700;
    }

    /* Result and card headings. */
    .search-explorer-page h3,
    .search-explorer-page h4 {
        color: var(--thoth-copper);
        font-weight: 700;
    }

    /* General page description and explanatory text. */
    .search-explorer-page p {
        color: var(--thoth-blue);
    }

    /* Form labels. */
    .search-explorer-page label,
    .search-explorer-page .form-label {
        color: var(--thoth-copper);
        font-weight: 600;
    }

    /* Text inputs and select controls. */
    .search-explorer-page .form-control,
    .search-explorer-page .form-select {
        color: var(--thoth-blue);
        border-color: var(--thoth-border);
    }

        .search-explorer-page .form-control:focus,
        .search-explorer-page .form-select:focus {
            border-color: var(--thoth-copper);
            box-shadow: 0 0 0 0.2rem rgba(149, 78, 14, 0.15);
        }

    /* Search button. */
    .search-explorer-page .btn-primary {
        color: #ffffff;
        border-color: var(--thoth-copper);
        background-color: var(--thoth-copper);
    }

        .search-explorer-page .btn-primary:hover,
        .search-explorer-page .btn-primary:focus {
            color: #ffffff;
            border-color: #783d0a;
            background-color: #783d0a;
        }

    /* Cards and search panels. */
    .search-explorer-page .card,
    .search-explorer-page .content-card,
    .search-explorer-page .search-panel,
    .search-explorer-page .search-result-card,
    .search-explorer-page .summary-card {
        color: var(--thoth-blue);
        border-color: var(--thoth-border);
        background: var(--thoth-card);
    }

    /* Summary-card labels such as RESULTS, MODE, DURATION, TOP K. */
    .search-explorer-page .summary-label,
    .search-explorer-page .stat-label,
    .search-explorer-page .metric-label {
        color: var(--thoth-copper);
        font-weight: 700;
        letter-spacing: 0.05em;
        text-transform: uppercase;
    }

    /* Summary values. */
    .search-explorer-page .summary-value,
    .search-explorer-page .stat-value,
    .search-explorer-page .metric-value {
        color: var(--thoth-blue);
        font-weight: 700;
    }

    /* Search result document titles. */
    .search-explorer-page .result-title,
    .search-explorer-page .search-result-title {
        color: var(--thoth-copper);
        font-weight: 700;
    }

    /* Retrieved chunk content. */
    .search-explorer-page .result-chunk-content,
    .search-explorer-page .chunk-content,
    .search-explorer-page .chunk-text {
        color: var(--thoth-blue);
        line-height: 1.7;
    }

    /* Metadata values and result badges. */
    .search-explorer-page .result-metadata,
    .search-explorer-page .result-meta,
    .search-explorer-page .metadata-value {
        color: var(--thoth-blue);
    }

    /* Score label. */
    .search-explorer-page .score-label,
    .search-explorer-page .result-score-label {
        color: var(--thoth-copper);
        font-weight: 600;
    }

    /* Score value. */
    .search-explorer-page .score-value,
    .search-explorer-page .result-score {
        color: var(--thoth-blue);
        font-weight: 700;
    }
/* ==========================================================================
   Document Chunks Card
   ========================================================================== */

.chunk-list-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

    .chunk-list-header h2 {
        margin: 0;
        color: var(--thoth-copper);
        font-size: 1.85rem;
        font-weight: 700;
    }

    .chunk-list-header p {
        margin-top: .35rem;
        color: var(--thoth-blue);
    }

.chunk-count-badge {
    padding: .35rem .75rem;
    border: 1px solid var(--thoth-copper);
    border-radius: .5rem;
    background: #fffaf6;
    color: var(--thoth-copper);
    font-weight: 600;
}


/* ==========================================================================
   THOTH Theme Overrides
   ========================================================================== */

/* Metadata labels */
.metadata-label,
.overview-label,
.statistics-label {
    color: var(--thoth-copper);
    font-weight: 600;
}

/* Metadata values */
.metadata-value,
.overview-value,
.statistics-value {
    color: var(--thoth-blue);
}

/* Chunk titles */
.chunk-card h3,
.chunk-title {
    color: var(--thoth-blue);
    font-weight: 700;
}

.brand {
    margin-bottom: 32px;
}

.brand-title {
    font-size: 22px;
    font-weight: 700;
}

.brand-subtitle {
    font-size: 13px;
    color: #9ca3af;
    margin-top: 4px;
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-link {
    color: #d1d5db;
    text-decoration: none;
    padding: 10px 12px;
    border-radius: 8px;
}

    .nav-link:hover {
        color: white;
        background: #1f2937;
    }

.sidebar-footer {
    margin-top: auto;
    font-size: 13px;
    color: #9ca3af;
}

.user-email {
    margin-bottom: 8px;
    word-break: break-word;
}

.logout-link {
    color: #f87171;
    text-decoration: none;
}

    .logout-link:hover {
        color: #fecaca;
    }


/* Ensure these exist to match your MainLayout.razor */
.top-row {
    height: 3.5rem;
    display: flex;
    align-items: center;
}

.content {
    padding-top: 1.1rem;
}
html, body {
    margin: 0;
    padding: 0;
    font-family: Arial, Helvetica, sans-serif;
}

.app-shell {
    min-height: 100vh;
    display: flex;
    background: #f5f6f8;
}

    .app-shell:has(.templates-workspace),
    .main-content:has(.templates-workspace) {
        background-color: #FFFFF7;
    }

.sidebar {
    width: 280px;
    min-height: 100vh;
    background: #111827;
    color: white;
    display: flex;
    flex-direction: column;
    padding: 24px;
}

.main-content {
    flex: 1;
    padding: 32px;
}

.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f6f8;
}

.login-card {
    width: 420px;
    background: white;
    padding: 32px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
}

.login-actions {
    text-align: center;
    margin-top: 24px;
}

.login-button {
    width: auto !important;
    min-width: 140px;
    padding: 10px 28px;
}

.user-name {
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 4px;
}

.user-role {
    font-size: 12px;
    color: #9ca3af;
    margin-bottom: 12px;
}

.page-header {
    margin-bottom: 24px;
}

    .page-header h1 {
        margin-bottom: 4px;
    }

    .page-header p {
        color: #6b7280;
    }

.ai-panel {
    background: white;
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.ai-question-box {
    min-height: 140px;
    resize: vertical;
}

.ai-actions {
    margin-top: 16px;
}

.ai-response {
    background: white;
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.answer-box {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px;
    white-space: pre-wrap;
}

.references-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.reference-card {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 14px;
    background: #f9fafb;
}

.reference-title {
    font-weight: 700;
}

.reference-meta {
    color: #4b5563;
    font-size: 14px;
    margin-top: 4px;
}

.reference-path {
    color: #6b7280;
    font-size: 13px;
    margin-top: 4px;
    margin-bottom: 6px;
}
.diagnostics-list {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.diagnostic-card {
    min-width: 220px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 14px;
}

.diagnostic-title {
    font-weight: 700;
    margin-bottom: 8px;
}

.diagnostic-message {
    font-size: 13px;
    color: #6b7280;
    margin-top: 6px;
}
.access-denied-container {
    min-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.access-denied-card {
    width: 420px;
    background: white;
    border-radius: 14px;
    padding: 32px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
}

.access-denied-icon {
    font-size: 42px;
    margin-bottom: 12px;
}

.access-denied-card h2 {
    margin-bottom: 10px;
}

.access-denied-card p {
    color: #6b7280;
    margin-bottom: 24px;
}

.access-denied-login {
    display: block;
    margin-top: 14px;
    font-size: 14px;
}

/* ==========================================================================
   THOTH Color Palette
   ========================================================================== */

:root {
    /* Brand */
    --thoth-copper: #954E0E;
    --thoth-blue: #121F6B;
    /* Neutral */
    --thoth-text: #2b2b2b;
    --thoth-muted: #6c757d;
    --thoth-border: #d9dde3;
    --thoth-card: #ffffff;
    --thoth-background: #f8f9fb;
    --thoth-success: #198754;
    --thoth-danger: #dc3545;
}


/* ==========================================
   SESHAT — Full Navy Page Background
   ========================================== */

body:has(.seshat-workspace) {
    background-color: #061427;
}

    body:has(.seshat-workspace) .main-content {
        background-color: #061427;
        padding: 0;
    }


/* ==========================================
   THOTH Administration — Full Navy Background
   ========================================== */

body:has(.thoth-admin-workspace) {
    background-color: #061427;
}

    body:has(.thoth-admin-workspace) .main-content {
        background-color: #061427;
        padding: 0;
    }


/* THOTH Processing Dashboard headings */

.processing-dashboard h1 {
    color: #17365D;
}

.processing-dashboard .section-heading {
    color: #B87333;
    font-family: inherit;
    font-size: 1.5rem;
    font-weight: 600;
}

/* Append to the existing GLOBAL stylesheet (not an isolated .razor.css). */
.thoth-admin-workspace:has(.knowledge-base-page) {
    display: flex;
    align-items: stretch;
    gap: 14px;
    width: 100%;
    min-width: 0;
    min-height: calc(100vh - 88px);
    padding: 16px;
    box-sizing: border-box;
    background: #fff !important;
    border-radius: 20px;
}

    .thoth-admin-workspace:has(.knowledge-base-page) > .thoth-admin-sidebar {
        flex: 0 0 270px;
        width: 270px;
        min-width: 0;
        box-sizing: border-box;
        padding: 18px 14px;
        background: #122945 !important;
        border: 1px solid #304D70 !important;
        border-radius: 16px;
        color: #E8C477;
    }

        .thoth-admin-workspace:has(.knowledge-base-page) > .thoth-admin-sidebar.collapsed {
            flex-basis: 58px;
            width: 58px;
            padding: 14px 8px;
        }

    .thoth-admin-workspace:has(.knowledge-base-page) .thoth-admin-sidebar-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        margin-bottom: 20px;
        color: #E8C477;
        font-weight: 700;
    }

    .thoth-admin-workspace:has(.knowledge-base-page) .thoth-admin-sidebar-toggle {
        background: #122945;
        border: 1px solid #304D70;
        border-radius: 8px;
        color: #E9EDF3;
        padding: 7px 10px;
        cursor: pointer;
    }

    .thoth-admin-workspace:has(.knowledge-base-page) .thoth-admin-sidebar-link {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 11px 10px;
        margin-bottom: 5px;
        border-radius: 9px;
        color: #E9EDF3;
        text-decoration: none;
        font-size: .9rem;
        font-weight: 500;
        white-space: normal;
    }

        .thoth-admin-workspace:has(.knowledge-base-page) .thoth-admin-sidebar-link:is(:hover,.active) {
            background: #304D70;
            color: #E8C477;
        }

        .thoth-admin-workspace:has(.knowledge-base-page) .thoth-admin-sidebar-link :is(i,svg) {
            color: #E8C477;
            flex-shrink: 0;
        }

    .thoth-admin-workspace:has(.knowledge-base-page) .collapsed .thoth-admin-sidebar-link {
        justify-content: center;
        padding: 12px 4px;
    }

    .thoth-admin-workspace:has(.knowledge-base-page) .thoth-admin-menu-heading {
        margin: 24px 6px 12px;
        padding-top: 18px;
        border-top: 1px solid #304D70;
        color: #E8C477;
        font-size: .7rem;
        font-weight: 700;
        letter-spacing: .08em;
    }

    .thoth-admin-workspace:has(.knowledge-base-page) > .thoth-admin-content {
        flex: 1;
        min-width: 0;
        padding: 0;
        overflow-x: auto;
        background: transparent;
    }

@media(max-width:768px) {
    .thoth-admin-workspace:has(.knowledge-base-page) {
        padding: 8px;
        gap: 10px;
    }

        .thoth-admin-workspace:has(.knowledge-base-page) > .thoth-admin-sidebar:not(.collapsed) {
            flex-basis: 190px;
            width: 190px;
            padding: 12px 8px;
        }
}

/* Append to the existing GLOBAL stylesheet (not an isolated .razor.css). */
.thoth-admin-workspace:has(.knowledge-base-page) {
    display: flex;
    align-items: stretch;
    gap: 14px;
    width: 100%;
    min-width: 0;
    min-height: calc(100vh - 88px);
    padding: 16px;
    box-sizing: border-box;
    background: #fff !important;
    border-radius: 20px;
}

    .thoth-admin-workspace:has(.knowledge-base-page) > .thoth-admin-sidebar {
        flex: 0 0 270px;
        width: 270px;
        min-width: 0;
        box-sizing: border-box;
        padding: 18px 14px;
        background: #122945 !important;
        border: 1px solid #304D70 !important;
        border-radius: 16px;
        color: #E8C477;
    }

        .thoth-admin-workspace:has(.knowledge-base-page) > .thoth-admin-sidebar.collapsed {
            flex-basis: 58px;
            width: 58px;
            padding: 14px 8px;
        }

    .thoth-admin-workspace:has(.knowledge-base-page) .thoth-admin-sidebar-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        margin-bottom: 20px;
        color: #E8C477;
        font-weight: 700;
    }

    .thoth-admin-workspace:has(.knowledge-base-page) .thoth-admin-sidebar-toggle {
        background: #122945;
        border: 1px solid #304D70;
        border-radius: 8px;
        color: #E9EDF3;
        padding: 7px 10px;
        cursor: pointer;
    }

    .thoth-admin-workspace:has(.knowledge-base-page) .thoth-admin-sidebar-link {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 11px 10px;
        margin-bottom: 5px;
        border-radius: 9px;
        color: #E9EDF3;
        text-decoration: none;
        font-size: .9rem;
        font-weight: 500;
        white-space: normal;
    }

        .thoth-admin-workspace:has(.knowledge-base-page) .thoth-admin-sidebar-link:is(:hover,.active) {
            background: #304D70;
            color: #E8C477;
        }

        .thoth-admin-workspace:has(.knowledge-base-page) .thoth-admin-sidebar-link :is(i,svg) {
            color: #E8C477;
            flex-shrink: 0;
        }

    .thoth-admin-workspace:has(.knowledge-base-page) .collapsed .thoth-admin-sidebar-link {
        justify-content: center;
        padding: 12px 4px;
    }

    .thoth-admin-workspace:has(.knowledge-base-page) .thoth-admin-menu-heading {
        margin: 24px 6px 12px;
        padding-top: 18px;
        border-top: 1px solid #304D70;
        color: #E8C477;
        font-size: .7rem;
        font-weight: 700;
        letter-spacing: .08em;
    }

    .thoth-admin-workspace:has(.knowledge-base-page) > .thoth-admin-content {
        flex: 1;
        min-width: 0;
        padding: 0;
        overflow-x: auto;
        background: transparent;
    }

@media(max-width:768px) {
    .thoth-admin-workspace:has(.knowledge-base-page) {
        padding: 8px;
        gap: 10px;
    }

        .thoth-admin-workspace:has(.knowledge-base-page) > .thoth-admin-sidebar:not(.collapsed) {
            flex-basis: 190px;
            width: 190px;
            padding: 12px 8px;
        }
}
