﻿/*
	This CSS file matches the color scheme from MudBlazor to Bootstrap when utilized for authentication.
	The file remains available at all times for demonstration purposes,
	but it is exclusively employed in the 'App.razor' component when authentication is enabled.
*/

.btn-primary {
    text-transform: uppercase;
    --bs-btn-bg: var(--mud-palette-primary) !important;
    --bs-btn-hover-bg: var(--mud-palette-primary-darken) !important;
}

.nav-pills {
    --bs-nav-pills-link-active-bg: var(--mud-palette-primary) !important;
}

.nav {
    --bs-nav-link-color: var(--mud-palette-primary) !important;
    --bs-nav-link-hover-color: var(--mud-palette-primary-darken) !important;
}

/* GenericDataGrid: size columns to content instead of stretching to 100% */
.generic-data-grid-auto-cols .mud-table-container {
    overflow-x: auto;
}

.generic-data-grid-auto-cols .mud-table-root {
    width: max-content !important;
    table-layout: auto !important;
}

.generic-data-grid-auto-cols .mud-table-root .mud-table-cell {
    white-space: nowrap;
    width: 1%;
    vertical-align: middle;
}

/*
   Numeric/short columns end up wider than their content because the header
   reserves space for padding, the (invisible) sort icon and icon buttons.
   Tighten all of that inside this grid only.
*/

/* Dense cells default to "6px 24px 6px 16px"; the 24px end padding exists
   for the column resizer, which this grid disables (ResizeMode.None). */
.generic-data-grid-auto-cols .mud-table-dense * .mud-table-row .mud-table-cell {
    padding: 6px 8px;
    padding-inline-start: 8px;
    padding-inline-end: 8px;
}

/* Filter funnel button in the header: default padding makes it ~30px wide. */
.generic-data-grid-auto-cols .column-header .column-options .mud-icon-button {
    padding: 2px;
}

/* Sort arrow reserves ~22px even when invisible (opacity 0); trim its margin. */
.generic-data-grid-auto-cols .column-header .sort-direction-icon {
    margin-left: 2px;
    margin-inline-start: 2px;
}

/* Don't stretch the title area; let the header shrink to its text. */
.generic-data-grid-auto-cols .column-header .sortable-column-header {
    width: auto;
}

.email-verification-overlay {
    position: fixed;
    inset: 0;
    z-index: 1400;
    display: grid;
    place-items: center;
    padding: 1rem;
    background: rgb(0 0 0 / 55%);
}

.email-verification-popup {
    width: min(100%, 30rem);
    padding: 2rem;
    border-radius: 1rem;
    background: var(--mud-palette-surface);
    color: var(--mud-palette-text-primary);
    box-shadow: 0 1.5rem 4rem rgb(0 0 0 / 35%);
    text-align: center;
}

.email-verification-code {
    margin-top: .5rem;
    letter-spacing: .3rem;
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
}
/* Support ticket inbox */
.ticket-page { max-width: 1500px; margin-inline: auto; }
.ticket-page-heading { display: flex; align-items: center; justify-content: space-between; padding-inline: 4px; }
.ticket-page-title { font-weight: 700; letter-spacing: -.02em; }
.ticket-inbox { overflow: hidden; border: 1px solid var(--mud-palette-divider); border-radius: 8px; background: var(--mud-palette-surface); box-shadow: 0 4px 22px rgb(0 0 0 / 7%); }
.ticket-layout { height: 100%; }
.ticket-people { min-width: 0; border-inline-end: 1px solid var(--mud-palette-divider); display: flex; flex-direction: column; background: color-mix(in srgb, var(--mud-palette-background-grey) 35%, var(--mud-palette-surface)); }
.ticket-sidebar-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 14px; }
.telegram-sidebar-bar { min-height: 58px; }
.telegram-sidebar-bar .mud-typography { font-weight: 650; }
.ticket-search-wrap { padding: 0 12px 7px; }
.ticket-search { width: 100%; }
.telegram-search .mud-input-root { border-radius: 21px; background: var(--mud-palette-surface); }
.telegram-inbox-summary { display: flex; align-items: center; justify-content: space-between; padding: 4px 18px 8px; color: var(--mud-palette-text-secondary); }
.telegram-unread-total { color: var(--mud-palette-primary); font-size: .72rem; font-weight: 600; }
.ticket-user-list { flex: 1; min-height: 0; overflow-y: auto; padding: 0; }
.ticket-user { position: relative; width: 100%; border: 0; border-radius: 0; background: transparent; display: flex; align-items: center; gap: 12px; padding: 10px 16px; margin-bottom: 0; text-align: start; cursor: pointer; color: inherit; transition: background .15s ease; }
.ticket-user:hover { background: var(--mud-palette-action-default-hover); }
.ticket-user.selected { background: var(--mud-palette-primary); color: var(--mud-palette-primary-text); }
.ticket-user.selected .ticket-user-preview, .ticket-user.selected .ticket-user-time { color: color-mix(in srgb, var(--mud-palette-primary-text) 72%, transparent); }
.ticket-user.selected .ticket-user-name { color: inherit; }
.ticket-user.selected::before { display: none; }
.ticket-user.unread { background: color-mix(in srgb, var(--mud-palette-primary) 6%, transparent); }
.ticket-user.selected.unread { background: var(--mud-palette-primary); }
.ticket-user.unread .ticket-user-name { font-weight: 800; }
.ticket-user-copy { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 3px; }
.ticket-user-topline { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.ticket-user-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--mud-palette-text-primary); font-weight: 600; }
.ticket-user-name:hover, .ticket-title-link:hover { color: var(--mud-palette-primary); text-decoration: underline; }
.ticket-user-time { flex: 0 0 auto; margin-inline-start: auto; font-size: .7rem; color: var(--mud-palette-text-secondary); }
.ticket-user-preview { font-size: .78rem; color: var(--mud-palette-text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ticket-unread-dot { flex: 0 0 auto; min-width: 20px; height: 20px; padding-inline: 5px; border-radius: 10px; display: inline-grid; place-items: center; background: var(--mud-palette-error); color: var(--mud-palette-error-text); font-size: .68rem; font-weight: 700; }
.ticket-list-empty, .ticket-no-messages { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; padding: 48px 20px; color: var(--mud-palette-text-secondary); text-align: center; }
.ticket-list-empty .mud-icon-root { margin-bottom: 5px; font-size: 2rem; opacity: .55; }
.ticket-conversation { min-width: 0; display: flex; flex-direction: column; background: var(--mud-palette-surface); }
.ticket-header { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 8px 16px; border-bottom: 1px solid var(--mud-palette-divider); }
.ticket-header-copy { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ticket-title-link { width: fit-content; color: var(--mud-palette-text-primary); font-size: .98rem; font-weight: 700; cursor: pointer; }
.ticket-messages { flex: 1 1 0; min-height: 0; overflow-y: auto; overflow-anchor: none; padding: 22px clamp(18px, 7vw, 110px); background: radial-gradient(circle at 15% 15%, color-mix(in srgb, var(--mud-palette-primary) 5%, transparent), transparent 35%), color-mix(in srgb, var(--mud-palette-background-grey) 45%, transparent); }
.ticket-message-content { max-width: 880px; margin-inline: auto; }
.ticket-start-label { width: fit-content; margin: 0 auto 22px; padding: 4px 10px; border-radius: 20px; background: var(--mud-palette-action-default-hover); color: var(--mud-palette-text-secondary); font-size: .7rem; }
.ticket-message-row { display: flex; margin-bottom: 6px; }
.ticket-message-row.mine { justify-content: flex-end; }
.ticket-bubble { max-width: min(68%, 660px); padding: 10px 13px 6px; border: 1px solid var(--mud-palette-divider); border-radius: 9px; background: var(--mud-palette-surface); box-shadow: 0 1px 2px rgb(0 0 0 / 7%); }
.ticket-message-row.mine .ticket-bubble { border-color: transparent; background: var(--mud-palette-primary); color: var(--mud-palette-primary-text); border-bottom-right-radius: 5px; }
.ticket-message-row.theirs .ticket-bubble { border-bottom-left-radius: 5px; }
.ticket-message-content-text { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.55; }
.ticket-time { display: block; opacity: .7; margin-top: 5px; font-size: .68rem; }
.ticket-message-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 24px; }
.ticket-message-meta .mud-icon-button { opacity: 0; margin-inline-end: -8px; color: inherit; }
.ticket-bubble:hover .ticket-message-meta .mud-icon-button, .ticket-message-meta .mud-icon-button:focus-visible { opacity: .7; }
.ticket-message-actions { display: flex; justify-content: flex-end; gap: 6px; margin-top: 8px; }
.ticket-header, .ticket-composer { flex-shrink: 0; }
.ticket-message-row .ticket-bubble.ticket-editing { width: min(100%, 34rem); max-width: 100%; min-width: 0; color: var(--mud-palette-text-primary); background: var(--mud-palette-surface); border-color: var(--mud-palette-divider); }
.ticket-editing .ticket-message-actions { position: sticky; bottom: 0; z-index: 1; flex-wrap: wrap; padding-block: 8px; background: var(--mud-palette-surface); }
.ticket-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; max-width: 360px; margin: auto; color: var(--mud-palette-text-secondary); text-align: center; }
.ticket-empty-icon { display: grid; place-items: center; width: 72px; height: 72px; margin-bottom: 8px; border-radius: 24px; background: color-mix(in srgb, var(--mud-palette-primary) 12%, transparent); color: var(--mud-palette-primary); }
.ticket-empty-icon .mud-icon-root { font-size: 2.4rem; }
.ticket-compose-field { flex: 1; min-width: 0; }
.ticket-composer { display: flex; align-items: flex-end; gap: 8px; padding: 9px 14px 11px; border-top: 1px solid var(--mud-palette-divider); background: color-mix(in srgb, var(--mud-palette-background-grey) 45%, var(--mud-palette-surface)); }
.ticket-input { width: 100%; }
.ticket-compose-field > .mud-typography { display: block; margin: 4px 4px 0; font-size: .68rem; }
.ticket-send { min-height: 42px; min-width: 42px; border-radius: 50%; }
.ticket-composer .mud-input-control { margin-top: 0; }
.ticket-composer .mud-input-root { border-radius: 22px; background: var(--mud-palette-surface); }
.ticket-saved-replies { border: 1px solid var(--mud-palette-divider); border-radius: 14px; }
@media (max-width: 600px) {
    .ticket-inbox { height: auto !important; min-height: 0 !important; }
    .ticket-people { height: auto !important; max-height: 280px; border-inline-end: 0; border-bottom: 1px solid var(--mud-palette-divider); }
    .ticket-conversation { height: min(680px, calc(100dvh - 96px)) !important; min-height: 380px !important; }
    .ticket-bubble { max-width: 86%; }
}
@media (max-width: 520px) {
    .ticket-page-heading { padding-inline: 0; }
    .ticket-page-title { font-size: 1.45rem; }
    .ticket-header { padding-inline: 14px; }
    .ticket-header .mud-icon-button { padding: 7px; }
    .ticket-messages { padding: 20px 12px; }
    .ticket-composer { align-items: stretch; flex-wrap: wrap; padding: 10px 12px 12px; }
    .ticket-compose-field { order: 1; flex-basis: calc(100% - 48px); }
    .ticket-composer > .mud-menu { order: 0; }
    .ticket-send { order: 2; flex: 1; }
}

/* Admin workspace: shared MudBlazor shell and responsive data surfaces. */
.admin-shell { min-height: 100vh; background: var(--mud-palette-background); }
.admin-shell.theme-light { color-scheme: light; }
.admin-shell.theme-dark { color-scheme: dark; }
.admin-appbar { border-bottom: 1px solid var(--mud-palette-divider); }
.appbar-context { min-width: 0; margin-inline-start: 12px; display: flex; flex-direction: column; line-height: 1.25; }
.appbar-title { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-drawer { border-inline-end: 1px solid var(--mud-palette-divider); }
.drawer-brand { gap: 12px; align-items: center; padding: 24px 20px 16px; }
.drawer-brand .mud-typography-h6 { font-weight: 700; letter-spacing: -.025em; }
.admin-navigation { padding: 0 10px 20px; }
.nav-search { position: sticky; top: 0; z-index: 2; padding: 4px 4px 12px; background: var(--mud-palette-drawer-background); }
.nav-category { display: block; padding: 20px 16px 6px; font-weight: 650; color: var(--mud-palette-text-secondary); }
.admin-navigation .mud-nav-link { min-height: 42px; border-radius: 7px; padding: 9px 12px; margin-block: 2px; }
.admin-navigation .mud-nav-link.active { background: color-mix(in srgb, var(--mud-palette-primary) 11%, transparent); font-weight: 650; }
.admin-navigation .mud-nav-link .mud-nav-link-icon { font-size: 21px; }
.admin-main { padding: 88px 28px 32px; min-width: 0; }
.admin-content { max-width: 1680px; margin-inline: auto; min-width: 0; }
.admin-content:focus { outline: none; }
.admin-page-heading { margin-bottom: 24px; }
.admin-page-heading h1, .dashboard-overview h1 { font-size: clamp(1.6rem, 2.4vw, 2rem); font-weight: 700; letter-spacing: -.035em; margin-bottom: 6px; }
.admin-content h1, .admin-content h2, .admin-content h3 { scroll-margin-top: 88px; text-wrap: balance; }
.admin-content .mud-paper-outlined { border-color: var(--mud-palette-divider); }
.admin-content .mud-table-cell { font-variant-numeric: tabular-nums; }
.admin-content .mud-table-head .mud-table-cell { color: var(--mud-palette-text-secondary); font-weight: 650; background: color-mix(in srgb, var(--mud-palette-background) 70%, var(--mud-palette-surface)); }
.admin-content .generic-data-grid-auto-cols { border: 1px solid var(--mud-palette-divider); border-radius: 10px; background: var(--mud-palette-surface); overflow: hidden; }
.admin-grid-toolbar { width: 100%; padding-block: 14px; }
.generic-data-grid-auto-cols .mud-table-toolbar { height: auto; min-height: 72px; }
.dashboard-metric { box-shadow: none; }
.dashboard-metric .mud-card-content { padding: 20px; }
.dashboard-metric .metric-value { font-size: 2rem; font-weight: 700; letter-spacing: -.035em; font-variant-numeric: tabular-nums; }
.dashboard-metric .mud-typography-caption { display: block; line-height: 1.5; min-height: 2.7em; }
.dashboard-overview .mud-table-cell { overflow-wrap: anywhere; }
.skip-link { position: fixed; inset-block-start: 8px; inset-inline-start: 16px; z-index: 2000; transform: translateY(-150%); background: var(--mud-palette-primary); color: var(--mud-palette-primary-text); padding: 12px 18px; border-radius: 6px; font-weight: 600; }
.skip-link:focus { transform: translateY(0); }
.admin-shell a:focus-visible, .admin-shell button:focus-visible, .admin-shell input:focus-visible { outline: 3px solid var(--mud-palette-primary); outline-offset: 3px; }
.admin-shell button, .admin-shell a { touch-action: manipulation; }
.admin-drawer .mud-drawer-content { overscroll-behavior: contain; }
@media (max-width: 959px) {
    .admin-main { padding: 80px 20px 24px; }
}
@media (max-width: 599px) {
    .admin-main { padding: 76px 12px 20px; }
    .appbar-context { margin-inline-start: 4px; }
    .appbar-context .mud-typography-caption { display: none; }
    .admin-page-heading { margin-bottom: 18px; }
    .admin-grid-toolbar { gap: 8px !important; }
    .dashboard-overview .mud-chart { max-width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
    .admin-shell *, .admin-shell *::before, .admin-shell *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
