/* Общие стили новых разделов: кабинет, профиль, отпуска. Цвета — через переменные Bootstrap, работают в обеих темах. */

:root {
    --vday-free: transparent;
    --vday-mine: rgba(25, 135, 84, .28);
    --vday-pending: rgba(255, 193, 7, .30);
    --vday-busy: rgba(220, 53, 69, .20);
    --vday-blocked: repeating-linear-gradient(135deg, rgba(108, 117, 125, .30) 0 6px, transparent 6px 12px);
}

/* ---------- аватары ---------- */
.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex: 0 0 auto;
}
.avatar-lg { width: 96px; height: 96px; }
.avatar-xl { width: 128px; height: 128px; }
.avatar-initials {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--bs-secondary-bg);
    color: var(--bs-secondary-color);
    font-weight: 600;
}
.avatar-lg.avatar-initials { font-size: 2rem; }
.avatar-xl.avatar-initials { font-size: 2.6rem; }

/* ---------- кабинет ---------- */
.cabinet-tile {
    height: 100%;
}
.cabinet-tile .tile-label {
    color: var(--bs-secondary-color);
    font-size: .85rem;
}
.cabinet-tile .tile-value {
    font-size: 2.4rem;
    line-height: 1.1;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}
.countdown-number {
    font-size: 3rem;
    line-height: 1;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}
.quick-link {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .75rem 1rem;
    border: 1px solid var(--bs-border-color);
    border-radius: var(--bs-border-radius-lg);
    color: var(--bs-body-color);
    text-decoration: none;
    height: 100%;
    transition: background-color .15s, border-color .15s;
}
.quick-link:hover {
    background: var(--bs-tertiary-bg);
    border-color: var(--bs-primary-border-subtle);
}
.quick-link i {
    font-size: 1.4rem;
    color: var(--bs-primary);
}
.mini-chart {
    height: 140px !important;
}

/* ---------- календарь отпусков ---------- */
.vcal {
    width: 100%;
    table-layout: fixed;
    border-collapse: separate;
    border-spacing: 3px;
}
.vcal th {
    font-weight: 500;
    font-size: .75rem;
    color: var(--bs-secondary-color);
    text-align: center;
}
.vcal td {
    height: 2.2rem;
    text-align: center;
    vertical-align: middle;
    border-radius: 6px;
    font-size: .85rem;
    font-variant-numeric: tabular-nums;
    position: relative;
    border: 1px solid var(--bs-border-color-translucent);
}
.vcal td.weekend { color: var(--bs-danger-text-emphasis); }
.vcal td.today { outline: 2px solid var(--bs-primary); outline-offset: -2px; font-weight: 700; }
.vcal .vday-outside { border-color: transparent; color: transparent; }
.vcal .vday-past { color: var(--bs-tertiary-color); opacity: .55; }
.vcal .vday-free { background: var(--vday-free); }
.vcal .vday-mine-approved { background: var(--vday-mine); font-weight: 600; }
.vcal .vday-mine-pending { background: var(--vday-pending); }
.vcal .vday-busy { background: var(--vday-busy); }
.vcal .vday-blocked { background: var(--vday-blocked); }
.vcal .busy-count {
    position: absolute;
    top: 1px;
    right: 3px;
    font-size: .6rem;
    color: var(--bs-secondary-color);
}
.vcal-legend span {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    margin-right: 1rem;
    font-size: .8rem;
}
.vcal-legend i {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 3px;
    border: 1px solid var(--bs-border-color);
}
.vcal-legend .lg-mine { background: var(--vday-mine); }
.vcal-legend .lg-pending { background: var(--vday-pending); }
.vcal-legend .lg-busy { background: var(--vday-busy); }
.vcal-legend .lg-blocked { background: var(--vday-blocked); }

/* Календарь коллег: в ячейке — имена */
.vcal-team td {
    height: auto;
    min-height: 5rem;
    vertical-align: top;
    text-align: left;
    padding: .25rem .35rem;
}
.vcal-team .day-number { font-size: .8rem; color: var(--bs-secondary-color); }
.vcal-team .person {
    display: block;
    font-size: .72rem;
    line-height: 1.25;
    margin-top: 2px;
    padding: 1px 4px;
    border-radius: 4px;
    background: var(--vday-mine);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.vcal-team .person.pending { background: var(--vday-pending); }

@media (max-width: 575.98px) {
    .vcal-team .person { font-size: .62rem; }
}
.min-w-0 { min-width: 0; }

/* ---------- пустые состояния (fragments/ui :: empty) ---------- */
.empty-state {
    padding: 2rem 1rem;
    text-align: center;
    color: var(--bs-secondary-color);
}
.empty-state-icon {
    display: block;
    font-size: 2rem;
    margin-bottom: .5rem;
    opacity: .6;
}
.empty-state-title {
    color: var(--bs-body-color);
    font-weight: 500;
}
.empty-state-hint {
    font-size: .875rem;
    margin-top: .25rem;
}
td > .empty-state {
    padding: 1.25rem .5rem;
}

/* ---------- ширина страниц ----------
   page-wide: списки, таблицы, статистика (на всю ширину, края совпадают с меню);
   page-medium: кабинет, карточки, страницы из нескольких блоков;
   page-narrow: формы и отдельные записи. */
.page {
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    padding-left: 1rem;
    padding-right: 1rem;
    padding-bottom: 3rem;
}
@media (min-width: 1400px) {
    .page { padding-left: 1.5rem; padding-right: 1.5rem; }
}
.page-wide { max-width: 1920px; }
.page-medium { max-width: 1240px; }
.page-narrow { max-width: 860px; }

/* ---------- таблицы: шапка остаётся видна при прокрутке ----------
   .table-sticky на .table-responsive (или любой обёртке) с ограниченной высотой */
.table-sticky {
    max-height: 75vh;
    overflow: auto;
}
.table-sticky > .table > thead > tr > th,
.table-sticky > table > thead > tr > th {
    position: sticky;
    top: 0;
    z-index: 2;
    background-color: var(--bs-table-bg, var(--bs-body-bg));
    box-shadow: inset 0 -1px 0 var(--bs-border-color);
}

/* Числа на плитках кабинета, которые ведут в отфильтрованный список */
a.tile-link {
    color: inherit;
    text-decoration: none;
}
a.tile-link:hover .tile-value,
a.tile-link:hover .countdown-number {
    color: var(--bs-link-hover-color);
    text-decoration: underline;
    text-decoration-thickness: 2px;
}

/* ---------- выбор сотрудников флажками (fragments/ui :: people) ---------- */
.people-picker-list {
    max-height: 18rem;
    overflow-y: auto;
}
.people-picker-list .form-check {
    margin-bottom: .15rem;
}

/* ---------- живые уведомления (static/js/live-notifications.js) ---------- */
.live-toast {
    width: 22rem;
    max-width: calc(100vw - 2rem);
}
.live-toast-text {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    white-space: pre-line;
}

/* ---------- объявления, заявки, опросы ---------- */
.announcement-body,
.request-text {
    white-space: pre-line;
    overflow-wrap: anywhere;
}
.announcement-stats {
    min-width: 14rem;
}
.request-message {
    padding: .5rem .75rem;
    border: 1px solid var(--bs-border-color);
    border-radius: var(--bs-border-radius-lg);
    max-width: 48rem;
}
.request-message-mine {
    margin-left: auto;
    background: var(--bs-primary-bg-subtle);
    border-color: var(--bs-primary-border-subtle);
}
.request-message-status {
    border-style: dashed;
    background: transparent;
    font-size: .875rem;
}
.poll-result .progress {
    margin-top: .2rem;
}

/* Запрещёнка в формах загрузки (forbidden-topics.js): текст поля с подсвеченными запрещёнными словами */
.forbidden-preview {
    margin-top: 4px;
    padding: 4px 8px;
    font-size: 0.875rem;
    border-radius: var(--bs-border-radius-sm);
    border: 1px solid var(--bs-danger-border-subtle);
    background: var(--bs-danger-bg-subtle);
    color: var(--bs-body-color);
    overflow-wrap: anywhere;
}

.forbidden-preview > .bi {
    color: var(--bs-danger);
}

.forbidden-hit {
    padding: 0 2px;
    border-radius: 3px;
    background: var(--bs-danger);
    color: #fff;
    font-weight: 600;
}
