﻿:root {
    --app-toolbar-height: 48px;
    --app-toolbar-paddings: 7px;
}

html {
    height: 100%;
}

body {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;

    height: 100%;
}


h5, h6 {
    white-space: nowrap;
    text-overflow: ellipsis;
}

blockquote {
    font-style: italic;
    background: #f5f5f5;
    border-left: 3px solid #ccc;
    margin-left: 1.5em;
    padding: .5em 20px;
}

/******************************************************************************
 * Темная тема, (!) переменные CSS MudBlazor не работают!
 **/
@media (prefers-color-scheme: dark) {
    body {
        background-color: #32333d !important;
        color: #ffffffb2 !important;
    }

    blockquote {
        border-left: 3px solid #ffffffb2;
        background: rgba(255, 168, 0, 0.06);
    }
}


/******************************************************************************
 * Стили виджета ЭЦР
 **/
.eusign-container { height: 100%; overflow: hidden; }
.eusign-widget { height: 100%; }
.eusign-qr-code { display: none; }


/******************************************************************************
 * Корректировки стилей MudBlazor
 **/
.mud-appbar {
    position: initial !important;
    height: var(--app-toolbar-height);
    padding-left: var(--app-toolbar-paddings);
    padding-right: var(--app-toolbar-paddings);
}


.mud-button-label {
    white-space: nowrap;
    text-overflow: ellipsis;
}

.mud-toolbar {
    height: var(--app-toolbar-height);
    padding: 0;
}

.mud-divider-vertical {
    margin: 0 8px !important;
}

.mud-tab {
    text-transform: none !important
}

.mud-tabs {
    height: 100%;
    overflow: hidden;
}

.mud-tabs-panels {
    height: 100%;
    overflow: hidden;
}

.mud-button {
    text-transform: none !important
}

.mud-alert-position {
    align-items: center
}

.mud-alert-message {
    overflow: auto !important
}

.mud-drawer-header {
    padding: 8px 24px!important;
}

.mud-layout {
    display: flex;
    flex-direction: column;
}

.mud-main-content {
    padding: 5px!important;
    height: 100%;
    overflow: hidden;
}


/* Таблица занимает высоту контейнера (грид с виртуализацией) */
.mud-table {
    height: 100%;
}


/* Поле отбора в панели инструментов: ширина задаётся в разметке, не растягивается и не сжимается */
.app-toolbar-field {
    flex: none;
}

.column-header {
    font-weight: bold;
}

/******************************************************************************
 * Стили приложения
 **/

.app-main-layout {
    height: 100%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}


.app-content {
    height: 100%;
    width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 10px;
}

.appbar-item { }

/**
 * Страница-список: панель инструментов сверху, содержимое (грид) на всю оставшуюся высоту
 */
.app-page {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.app-page-toolbar {
    flex: none;
    gap: 8px;
}

.app-page-title {
    font-weight: bold;
    white-space: nowrap;
}

.app-page-content {
    flex: 1;
    min-height: 0;
    padding-top: 8px;
}

/* Содержимое формы прокручивается под неподвижной панелью инструментов — только по вертикали
   (отрицательные поля MudGrid и длинные строки не дают горизонтальной прокрутки) */
.app-page-scroll {
    overflow-x: hidden;
    overflow-y: auto;
}

/**
 * Логотип: высота по панели, пропорции сохраняются
 */
.app-logo {
    height: 32px;
    width: auto;
    object-fit: contain;
    align-self: center;
}

/**
 * Заголовок
 */
.appbar-title {
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow: hidden;
}

.appbar-name {
    line-height: 1.2 !important;
}

.appbar-legal-entity {
    font-size: 0.85rem !important;
    line-height: 1.1 !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

@media screen and (max-width: 840px) {
    .appbar-title { display: none; }
}

.app-copyright {
    font-style: italic;
    font-size: .8em;
}


/**
 * Файлы: плитка и список
 */
.app-file-tiles {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.app-file-tile {
    width: 160px;
    cursor: pointer;
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 6px;
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.app-file-tile:hover {
    border-color: var(--mud-palette-primary);
}

.app-file-tile-preview {
    height: 110px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 4px;
    background: var(--mud-palette-background-gray);
}

.app-file-tile-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.app-file-tile-name {
    font-size: .85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.app-file-tile-size {
    font-size: .75rem;
    color: var(--mud-palette-text-secondary);
}

.app-file-row-preview {
    width: 32px;
    height: 32px;
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 4px;
}

.app-file-row-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}


/**
 * Заголовок блока (панели аккордеона): в одну строку, длинный — с многоточием
 */
.app-panel-title {
    min-width: 0;
    overflow: hidden;
}

.app-panel-title-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}


/**
 * «Хлебные крошки» — строкой под панелью приложения; на странице без крошек строки нет
 */
.app-breadcrumbs-bar {
    flex: none;
    padding: 0 10px;
}

.app-breadcrumbs-bar:empty {
    display: none;
}

.app-breadcrumbs {
    padding: 4px 0 !important;
    font-size: .875rem;
}
