/* Email management styles, migrated from fcs-blazor-email-management's app.css.
 *
 * The original file's five GLOBAL rules are deliberately omitted: `html, body`, `*`, `a` and `h1`.
 * They set the standalone app's dark theme (background #111418, colour #e6edf3) and a box-sizing
 * reset, and FCSSite is themed light/dark by the user's own toggle — applying them here would
 * repaint the entire site. Everything kept below is class-scoped.
 *
 * Verified before adopting: none of the 127 class names here collide with any selector in
 * FCSSite's existing stylesheets, so this can be loaded site-wide without affecting other pages.
 */


.fcs-email-layout {
    min-height: 100vh;
    background: #111418;
}

.fcs-email-header {
    border-bottom: 1px solid #26313d;
    background: #0d1117;
    color: #e6edf3;
}

.fcs-email-nav {
    min-height: 60px;
    padding: 0 18px;
}

.brand-cluster {
    min-width: 0;
}

.brand-copy {
    min-width: 0;
}

.brand {
    overflow: hidden;
    color: #f5f7fa;
    font-size: 1rem;
    font-weight: 800;
    line-height: 1.15;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.subtle,
.muted {
    color: #8b98a5;
    font-size: 0.875rem;
}

.brand-copy .subtle {
    overflow: hidden;
    color: #aab6c3;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.topbar-actions {
    padding-right: 4px;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 30px;
    padding: 5px 10px;
    border: 1px solid #2f3c49;
    border-radius: 8px;
    background: #161d24;
    color: #c9d6e3;
    font-size: 0.83rem;
    font-weight: 600;
    white-space: nowrap;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: #96c93d;
    box-shadow: 0 0 0 3px rgba(150, 201, 61, 0.14);
}

.fcs-email-sidebar {
    --rz-sidebar-width: 274px;
    border-right: 1px solid #26313d;
    background: #0d1117;
    color: #dbe6ec;
}

.fcs-email-menu.rz-panel-menu {
    padding: 10px 8px;
    background: transparent;
}

.fcs-email-menu .rz-navigation-item-wrapper,
.fcs-email-menu .rz-navigation-item-link {
    min-height: 38px;
    border-radius: 7px;
    color: #9db2c8;
}

.fcs-email-menu .rz-navigation-item-link:hover,
.fcs-email-menu .rz-navigation-item-active > .rz-navigation-item-wrapper,
.fcs-email-menu .rz-navigation-item-active > .rz-navigation-item-link {
    background: #151b23;
    color: #58a6ff;
}

.fcs-email-body {
    background:
        linear-gradient(180deg, rgba(37, 170, 225, 0.05), rgba(37, 170, 225, 0) 220px),
        #111418;
}

.page-shell {
    width: 100%;
    max-width: 1540px;
    min-height: calc(100vh - 60px);
    margin: 0 auto;
    padding: 26px;
}

.search-panel,
.detail-header {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 18px;
}

.search-row {
    flex: 1 1 560px;
    justify-content: flex-end;
}

.query-input {
    width: min(680px, 100%);
}

.mailbox-select {
    width: min(380px, 100%);
}

.direction-select {
    width: 155px;
}

.query-example-select {
    width: 190px;
}

.limit-input {
    width: 112px;
}

.active-filters {
    flex-wrap: wrap !important;
}

.results-grid,
.embedded-grid {
    overflow: hidden;
    border: 1px solid #2b3742;
    border-radius: 8px;
    background: #171c22;
}

.rz-data-grid {
    --rz-grid-cell-padding: 0.65rem 0.75rem;
}

.rz-grid-table td,
.rz-grid-table th {
    border-color: #26313d !important;
}

.link-button {
    appearance: none;
    border: 0;
    padding: 0;
    background: transparent;
    color: #58a6ff;
    cursor: pointer;
    font: inherit;
    font-weight: 700;
    text-align: left;
}

.link-button:hover {
    color: #86c5da;
    text-decoration: underline;
}

.snippet {
    display: -webkit-box;
    overflow: hidden;
    margin-top: 4px;
    color: #8b98a5;
    font-size: 0.84rem;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.stat-box,
.activity-shell,
.labels-panel,
.rule-editor,
.email-body,
.raw-facts {
    border: 1px solid #2b3742;
    border-radius: 8px;
    background: #171c22;
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.16);
}

.stat-box {
    padding: 14px;
}

.stat-box span {
    display: block;
    margin-bottom: 6px;
    color: #9db2c8;
    font-size: 0.82rem;
}

.stat-box strong {
    color: #f5f7fa;
    font-size: 1.22rem;
}

.stat-button {
    appearance: none;
    color: inherit;
    cursor: pointer;
    text-align: left;
}

.stat-button:hover {
    border-color: #58a6ff;
    background: #10243a;
}

.activity-shell,
.labels-panel {
    margin-top: 18px;
    padding: 16px;
}

.activity-header {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.activity-header h2,
.labels-panel h2 {
    margin: 0;
    color: #f5f7fa;
    font-size: 1.02rem;
    font-weight: 700;
}

.activity-controls {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    flex-wrap: wrap;
}

.rule-editor {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) 180px minmax(260px, 1.5fr) auto;
    gap: 10px;
    align-items: center;
    margin-bottom: 16px;
    padding: 14px;
}

.rule-email-input,
.rule-select,
.rule-reason-input {
    width: 100%;
}

.rule-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.attributes {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 24px;
    padding: 16px 0;
    border-top: 1px solid #2b3742;
    border-bottom: 1px solid #2b3742;
}

.attributes div,
.raw-facts div {
    display: grid;
    grid-template-columns: 104px minmax(0, 1fr);
    gap: 12px;
}

.attributes span,
.raw-facts span {
    overflow-wrap: anywhere;
}

.detail-tabs {
    margin-top: 20px;
}

.email-body {
    padding: 20px;
}

.email-body pre {
    margin: 0;
    overflow-wrap: anywhere;
    color: #dbe6ec;
    font-family: inherit;
    line-height: 1.45;
    white-space: pre-wrap;
}

.html-preview {
    overflow: auto;
}

.html-preview * {
    max-width: 100%;
}

.raw-facts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 24px;
    padding: 16px;
}

@media (max-width: 980px) {
    .fcs-email-nav {
        padding: 10px 14px;
    }

    .fcs-email-sidebar {
        --rz-sidebar-width: 72px;
    }

    .fcs-email-menu.rz-panel-menu {
        padding: 8px 6px;
    }

    .fcs-email-menu .rz-navigation-item-text,
    .fcs-email-menu .rz-navigation-item-chevron,
    .fcs-email-menu .rz-navigation-menu {
        display: none;
    }

    .fcs-email-menu .rz-navigation-item-wrapper,
    .fcs-email-menu .rz-navigation-item-link {
        justify-content: center;
        padding-right: 0;
        padding-left: 0;
    }

    .fcs-email-menu .rz-navigation-item-icon {
        margin: 0;
    }

    .brand-copy .subtle,
    .status-pill {
        display: none;
    }

    .page-shell {
        padding: 16px;
    }

    .search-panel,
    .detail-header,
    .activity-header {
        align-items: stretch;
        flex-direction: column;
    }

    .search-row {
        flex-basis: auto;
        justify-content: flex-start;
    }

    .attributes,
    .raw-facts,
    .stat-grid,
    .rule-editor {
        grid-template-columns: 1fr;
    }
}

/* EmailDetail runs as a themed island now: the fixed dark palette above left the Text tab
   white-on-white in the light theme (the site gives pre a light background while the rule above
   pins near-white ink). Follow the Radzen theme variables instead — they invert with the theme
   (unlike --rz-base-100..400, see DesignLanguage notes). */
.email-body {
    border: var(--rz-border-normal);
    background: var(--rz-base-background-color);
}

.email-body pre {
    background: transparent;
    color: var(--rz-text-color);
}

/* HTML mail assumes a white canvas; keep one in both themes so the message's own colors hold. */
.email-body.html-preview {
    background: #fff;
    color: #111418;
}
