/* assets/style.css */

/* ============================================================
   Базовые сбросы и типографика
   ============================================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', 'Inter', system-ui, -apple-system, sans-serif;
}

body {
    background: linear-gradient(145deg, #f6f9fc 0%, #eef2f7 100%);
    min-height: 100vh;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 2rem 1.5rem;
    color: #1e3b5c;
}

h1 {
    font-size: 2.2rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: #0a2a44;
    margin-bottom: 0.5rem;
}

/* ============================================================
   Контейнеры
   ============================================================ */
.portal-container {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 2rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25),
                0 0 0 1px rgba(255, 255, 255, 0.7) inset;
    padding: 2.5rem;
}

.portal-container.narrow {
    max-width: 560px;
}

/* ============================================================
   Заголовки и подзаголовки
   ============================================================ */
.subhead {
    color: #4a5f73;
    font-size: 1rem;
    margin-bottom: 2rem;
    border-left: 5px solid #2b6c9e;
    padding: 0.25rem 0 0.25rem 1.25rem;
    background: linear-gradient(90deg, rgba(43, 108, 158, 0.06), transparent);
    border-radius: 0 100px 100px 0;
    line-height: 1.5;
}

.header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

/* ============================================================
   Сетки
   ============================================================ */
.grid-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

@media (max-width: 800px) {
    .grid-layout {
        grid-template-columns: 1fr;
    }
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.2rem;
    align-items: end;
}

@media (max-width: 640px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

/* ============================================================
   Карточки
   ============================================================ */
.card {
    background: #ffffff;
    border-radius: 1.5rem;
    padding: 1.8rem;
    box-shadow: 0 10px 25px -5px rgba(0, 30, 60, 0.08),
                0 0 0 1px rgba(0, 0, 0, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.8);
    transition: box-shadow 0.25s;
}

.card:hover {
    box-shadow: 0 18px 35px -10px rgba(16, 58, 94, 0.12),
                0 0 0 1px rgba(43, 108, 158, 0.15);
}

.card.narrow-card {
    max-width: 460px;
}

.card h2 {
    font-size: 1.3rem;
    font-weight: 600;
    color: #1e3b5c;
    margin-bottom: 1.3rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-bottom: 2px solid #e3ebf3;
    padding-bottom: 0.8rem;
    flex-wrap: wrap;
}

.card h2 span {
    font-weight: 400;
    font-size: 0.8rem;
    color: #62809b;
    background: #f0f5fa;
    padding: 0.15rem 0.7rem;
    border-radius: 40px;
}

.block-card {
    margin-bottom: 1.5rem;
}

/* ============================================================
   Формы
   ============================================================ */
.form-group {
    margin-bottom: 1.2rem;
}

label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: #2b4b6e;
    margin-bottom: 0.4rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

input {
    width: 100%;
    padding: 0.85rem 1.1rem;
    font-size: 1rem;
    border: 1.5px solid #d6e2ee;
    border-radius: 0.9rem;
    background: #f9fbfd;
    color: #0a2a44;
    transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus {
    outline: none;
    border-color: #2b6c9e;
    box-shadow: 0 0 0 4px rgba(43, 108, 158, 0.12);
    background: #ffffff;
}

input[type="date"] {
    max-width: 220px;
}

textarea {
    width: 100%;
    padding: 0.85rem 1.1rem;
    font-size: 1rem;
    font-family: inherit;
    border: 1.5px solid #d6e2ee;
    border-radius: 0.9rem;
    background: #f9fbfd;
    color: #0a2a44;
    resize: vertical;
    min-height: 100px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

textarea:focus {
    outline: none;
    border-color: #2b6c9e;
    box-shadow: 0 0 0 4px rgba(43, 108, 158, 0.12);
    background: #ffffff;
}

.req {
    color: #b23a3a;
    font-weight: 700;
}

.hint {
    font-size: 0.82rem;
    color: #7a8fa3;
    margin-top: 0.4rem;
}

/* --- Чекбоксы --- */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    cursor: pointer;
    font-size: 0.95rem;
    color: #1e3b5c;
    font-weight: 500;
    padding: 0.5rem 0;
    text-transform: none;
    letter-spacing: 0;
}

.checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: #2b6c9e;
    cursor: pointer;
    flex-shrink: 0;
}

/* --- Кнопки формы --- */
.form-actions {
    display: flex;
    gap: 0.9rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}

/* ============================================================
   Кнопки
   ============================================================ */
.btn {
    display: inline-block;
    padding: 0.85rem 1.6rem;
    font-size: 0.95rem;
    font-weight: 600;
    border: none;
    border-radius: 0.9rem;
    background: linear-gradient(135deg, #2b6c9e, #1d5180);
    color: #ffffff;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.2s, filter 0.2s;
    text-decoration: none;
    box-shadow: 0 6px 18px -6px rgba(43, 108, 158, 0.5);
    font-family: inherit;
}

.btn:hover {
    filter: brightness(1.07);
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}

.btn-ghost {
    background: transparent;
    color: #2b6c9e;
    border: 1.5px solid #c7d9ea;
    box-shadow: none;
}

.btn-ghost:hover {
    background: #f0f5fa;
}

.btn-small {
    padding: 0.55rem 1.1rem;
    font-size: 0.85rem;
    margin-top: 0;
}

.btn-full {
    width: 100%;
    padding: 0.95rem 1.6rem;
    margin-top: 0.4rem;
}

.btn-disabled {
    background: #e9eff5;
    color: #94a8ba;
    box-shadow: none;
    cursor: not-allowed;
    pointer-events: none;
}

.btn-danger {
    background: #fbeaea;
    color: #a12b2b;
    border: 1.5px solid #f0c8c8;
    box-shadow: none;
}

.btn-danger:hover {
    background: #f8dada;
    color: #8a1e1e;
    filter: none;
}

/* ============================================================
   Алерты
   ============================================================ */
.alert {
    padding: 1rem 1.2rem;
    border-radius: 1rem;
    background: #fdeaea;
    color: #a12b2b;
    border: 1px solid #f5c6c6;
    margin-bottom: 1.3rem;
    font-size: 0.95rem;
}

.alert.success {
    background: #eaf6ee;
    color: #1e6b3a;
    border-color: #c2e4cf;
}

/* ============================================================
   Код доступа
   ============================================================ */
.code-display {
    font-family: 'SFMono-Regular', Consolas, monospace;
    font-size: 1.4rem;
    font-weight: 600;
    letter-spacing: 0.15em;
    color: #0a2a44;
    background: #f0f5fa;
    padding: 0.9rem 1.2rem;
    border-radius: 1rem;
    border: 1px dashed #b9cfe2;
    text-align: center;
    margin-bottom: 1.5rem;
}

/* ============================================================
   Вспомогательные текстовые классы
   ============================================================ */
.muted {
    color: #7a8fa3;
}

.muted-link {
    margin-top: 1.2rem;
    font-size: 0.9rem;
}

.muted-link a {
    color: #2b6c9e;
    text-decoration: none;
}

.muted-link a:hover {
    text-decoration: underline;
}

/* ============================================================
   Таблицы
   ============================================================ */
.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
}

.table th {
    text-align: left;
    padding: 0.7rem 0.8rem;
    color: #5a748c;
    font-weight: 600;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 2px solid #e3ebf3;
}

.table td {
    padding: 0.8rem;
    border-bottom: 1px solid #eef2f7;
    color: #1e3b5c;
    vertical-align: middle;
}

.table tr:hover td {
    background: #f8fbfe;
}

.danger-link {
    color: #b23a3a;
    text-decoration: none;
    font-weight: 500;
}

.danger-link:hover {
    text-decoration: underline;
}

/* ============================================================
   Теги
   ============================================================ */
.tag-soft {
    display: inline-block;
    margin-left: 0.5rem;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #2b6c9e;
    background: #eaf1f8;
    padding: 0.15rem 0.55rem;
    border-radius: 40px;
    vertical-align: middle;
}

/* ============================================================
   Каталог материалов
   ============================================================ */
.materials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.material-card {
    background: #ffffff;
    border-radius: 1.5rem;
    padding: 1.6rem;
    box-shadow: 0 10px 25px -8px rgba(0, 30, 60, 0.1);
    border: 1px solid #e9f0f6;
    transition: transform 0.2s, box-shadow 0.25s, border-color 0.2s;
    display: flex;
    flex-direction: column;
}

.material-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 22px 40px -14px rgba(16, 58, 94, 0.18);
    border-color: #cfe0ef;
}

.material-link {
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.material-link:hover .material-title {
    color: #2b6c9e;
}

.material-cat {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #2b6c9e;
    background: #eaf1f8;
    padding: 0.25rem 0.8rem;
    border-radius: 40px;
    margin-bottom: 0.9rem;
    align-self: flex-start;
}

.material-title {
    font-size: 1.15rem;
    color: #0a2a44;
    margin-bottom: 0.6rem;
    line-height: 1.35;
    transition: color 0.15s;
}

.material-excerpt {
    font-size: 0.92rem;
    color: #526b82;
    line-height: 1.55;
    flex: 1;
}

.material-more {
    margin-top: 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: #2b6c9e;
    letter-spacing: 0.02em;
    display: inline-block;
    transition: color 0.15s;
}

.material-link:hover .material-more {
    color: #1d5180;
}

/* ============================================================
   Хлебные крошки
   ============================================================ */
.breadcrumbs {
    font-size: 0.88rem;
    color: #7a8fa3;
    margin-bottom: 1.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
}

.breadcrumbs a {
    color: #2b6c9e;
    text-decoration: none;
}

.breadcrumbs a:hover {
    text-decoration: underline;
}

.breadcrumbs-sep {
    color: #c0cfdc;
}

.breadcrumbs-current {
    color: #4a5f73;
    font-weight: 500;
}

/* ============================================================
   Страница подробной информации о материале
   ============================================================ */
.material-detail {
    background: #ffffff;
    border-radius: 1.8rem;
    padding: 2.4rem 2.6rem;
    box-shadow: 0 18px 40px -14px rgba(16, 58, 94, 0.15);
    border: 1px solid #eef2f7;
}

@media (max-width: 640px) {
    .material-detail {
        padding: 1.6rem 1.4rem;
    }
}

.material-detail-head {
    border-bottom: 2px solid #eef2f7;
    padding-bottom: 1.4rem;
    margin-bottom: 1.6rem;
}

.material-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.8rem;
}

.material-detail-title {
    font-size: 2rem;
    font-weight: 650;
    color: #0a2a44;
    line-height: 1.25;
    margin: 0.7rem 0 0.8rem;
    letter-spacing: -0.01em;
}

@media (max-width: 640px) {
    .material-detail-title {
        font-size: 1.55rem;
    }
}

.material-detail-meta {
    font-size: 0.88rem;
    color: #7a8fa3;
}

.material-section {
    margin-bottom: 2rem;
    padding-bottom: 1.6rem;
    border-bottom: 1px solid #eef2f7;
}

.material-section:last-of-type {
    border-bottom: none;
    padding-bottom: 0;
}

.section-title {
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #5a748c;
    margin-bottom: 0.9rem;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.section-count {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    color: #62809b;
    background: #f0f5fa;
    padding: 0.12rem 0.6rem;
    border-radius: 40px;
    vertical-align: middle;
    letter-spacing: 0;
    text-transform: none;
}

.material-description {
    font-size: 1rem;
    line-height: 1.7;
    color: #2b4258;
    background: #f8fbfe;
    border-left: 4px solid #2b6c9e;
    padding: 1.2rem 1.4rem;
    border-radius: 0 1rem 1rem 0;
}

.material-detail-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.9rem;
    padding-top: 1.4rem;
    border-top: 2px solid #eef2f7;
}

/* ============================================================
   Бейджи и метки
   ============================================================ */
.badge-soft {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #4a5f73;
    background: #eef2f7;
    padding: 0.25rem 0.7rem;
    border-radius: 40px;
}

.badge-lecture {
    color: #1e6b3a;
    background: #eaf6ee;
}

.badge-danger {
    color: #a12b2b;
    background: #fdeaea;
    margin-left: 0.4rem;
    text-transform: none;
    letter-spacing: 0;
    font-weight: 600;
}

.dot-sep {
    color: #b9cfe2;
    margin: 0 0.4rem;
}

/* ============================================================
   Сетка характеристик
   ============================================================ */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem 1.5rem;
    margin-top: 0.8rem;
}

.info-item {
    background: #f8fbfe;
    border-radius: 0.9rem;
    padding: 0.9rem 1.1rem;
    border: 1px solid #eef2f7;
}

.info-label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #7a8fa3;
    margin-bottom: 0.3rem;
}

.info-value {
    font-size: 0.98rem;
    color: #0a2a44;
    font-weight: 500;
    line-height: 1.4;
    word-break: break-word;
}

/* ============================================================
   Прикреплённые файлы
   ============================================================ */
.attachment-list {
    list-style: none;
    padding: 0;
    margin: 0.8rem 0 0;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.attachment-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: #ffffff;
    border: 1px solid #eef2f7;
    border-radius: 1rem;
    padding: 0.85rem 1rem;
    transition: border-color 0.15s, box-shadow 0.15s;
    flex-wrap: wrap;
}

.attachment-item:hover {
    border-color: #cfe0ef;
    box-shadow: 0 8px 20px -10px rgba(16, 58, 94, 0.12);
}

.attachment-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 0.75rem;
    background: #eaf1f8;
    color: #2b6c9e;
    flex-shrink: 0;
}

.attachment-info {
    flex: 1;
    min-width: 0;
}

.attachment-name {
    font-size: 0.95rem;
    font-weight: 500;
    color: #0a2a44;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.attachment-meta {
    font-size: 0.8rem;
    color: #7a8fa3;
    margin-top: 0.15rem;
}

.attachment-item form {
    margin: 0;
}

@media (max-width: 640px) {
    .attachment-info {
        flex-basis: calc(100% - 60px);
    }
    .attachment-item .btn-small {
        flex: 1;
        text-align: center;
    }
}

/* ============================================================
   Анонимные примечания (страница материала)
   ============================================================ */
.notes-hint {
    font-size: 0.85rem;
    color: #7a8fa3;
    margin-bottom: 1rem;
}

.note-form {
    background: #f8fbfe;
    border: 1px solid #eef2f7;
    border-radius: 1.2rem;
    padding: 1.2rem 1.4rem 1rem;
    margin-bottom: 1.6rem;
}

.note-form .form-group {
    margin-bottom: 0.8rem;
}

.note-form textarea {
    min-height: 90px;
}

.note-counter {
    font-size: 0.78rem;
    color: #9fb2c4;
    text-align: right;
    margin-top: 0.35rem;
    font-variant-numeric: tabular-nums;
    transition: color 0.15s;
}

.note-counter.over {
    color: #b23a3a;
    font-weight: 600;
}

.notes-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.note-item {
    background: #ffffff;
    border: 1px solid #eef2f7;
    border-radius: 1rem;
    padding: 1rem 1.2rem;
    border-left: 4px solid #2b6c9e;
}

.note-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.6rem;
    margin-bottom: 0.4rem;
}

.note-author {
    display: inline-block;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #62809b;
    background: #f0f5fa;
    padding: 0.15rem 0.6rem;
    border-radius: 40px;
}

.note-date {
    font-size: 0.78rem;
    color: #9fb2c4;
    font-variant-numeric: tabular-nums;
    margin-left: 0.5rem;
}

.note-body {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #2b4258;
    word-break: break-word;
}

@media (max-width: 480px) {
    .note-head {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.3rem;
    }
    .note-date {
        margin-left: 0;
    }
}

/* ============================================================
   Модерация примечаний (админка)
   ============================================================ */
.notes-admin-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.note-admin-item {
    background: #f8fbfe;
    border: 1px solid #eef2f7;
    border-radius: 1rem;
    padding: 1rem 1.2rem;
    border-left: 4px solid #2b6c9e;
}

.note-admin-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.note-admin-head .note-author {
    background: #eef2f7;
    margin-right: 0.5rem;
}

.note-admin-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.note-admin-actions .danger-link {
    font-size: 0.85rem;
}

/* ============================================================
   Автоподстановка (autocomplete)
   ============================================================ */
.autocomplete {
    position: relative;
}

.autocomplete-list {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: #ffffff;
    border-radius: 0.9rem;
    box-shadow: 0 18px 40px -12px rgba(16, 58, 94, 0.25),
                0 0 0 1px rgba(43, 108, 158, 0.12);
    max-height: 260px;
    overflow-y: auto;
    z-index: 50;
    display: none;
    padding: 0.35rem;
}

.autocomplete-list.open {
    display: block;
}

.autocomplete-item {
    padding: 0.7rem 1rem;
    border-radius: 0.65rem;
    cursor: pointer;
    font-size: 0.95rem;
    color: #1e3b5c;
    transition: background 0.12s;
}

.autocomplete-item:hover,
.autocomplete-item.active {
    background: #eaf1f8;
    color: #0a2a44;
}

.autocomplete-item.active {
    background: #dbe9f6;
    font-weight: 500;
}

/* ============================================================
   Загрузка файлов
   ============================================================ */
.file-zone {
    border: 2px dashed #c7d9ea;
    border-radius: 1rem;
    padding: 1.6rem 1.2rem;
    text-align: center;
    background: #f8fbfe;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

.file-zone:hover {
    border-color: #2b6c9e;
    background: #f0f5fa;
}

.file-zone-inner {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.file-zone-title {
    font-weight: 600;
    color: #2b6c9e;
    font-size: 0.95rem;
}

.file-zone-hint {
    font-size: 0.82rem;
    color: #7a8fa3;
}

.file-list {
    list-style: none;
    margin-top: 0.8rem;
    padding: 0;
}

.file-item {
    font-size: 0.88rem;
    color: #3a546c;
    background: #f0f5fa;
    padding: 0.45rem 0.9rem;
    border-radius: 0.6rem;
    margin-bottom: 0.4rem;
    word-break: break-all;
}

/* ============================================================
   Узкий центрированный блок авторизации администратора
   ============================================================ */
.auth-wrapper {
    min-height: 100vh;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.auth-card {
    width: 100%;
    max-width: 400px;
    background: #ffffff;
    border-radius: 1.5rem;
    padding: 2.2rem 2rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25),
                0 0 0 1px rgba(0, 0, 0, 0.02);
    border: 1px solid #eef2f7;
}

.auth-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #0a2a44;
    margin-bottom: 0.3rem;
}

.auth-sub {
    font-size: 0.9rem;
    color: #7a8fa3;
    margin-bottom: 1.6rem;
}

.auth-footer {
    margin-top: 1.4rem;
    font-size: 0.88rem;
    text-align: center;
}

.auth-footer a {
    color: #2b6c9e;
    text-decoration: none;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* ============================================================
   Кастомный календарь (datepicker)
   ============================================================ */
.datepicker {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 260px;
    background: #f9fbfd;
    border: 1.5px solid #d6e2ee;
    border-radius: 0.9rem;
    padding: 0 0.4rem 0 0;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.datepicker:focus-within,
.datepicker.open {
    border-color: #2b6c9e;
    box-shadow: 0 0 0 4px rgba(43, 108, 158, 0.12);
    background: #ffffff;
}

.datepicker-display {
    flex: 1;
    border: none;
    background: transparent;
    padding: 0.85rem 1.1rem;
    font-size: 1rem;
    color: #0a2a44;
    cursor: pointer;
    border-radius: 0.9rem 0 0 0.9rem;
    font-variant-numeric: tabular-nums;
}

.datepicker-display:focus {
    outline: none;
    box-shadow: none;
    background: transparent;
}

.datepicker-display::placeholder {
    color: #9fb2c4;
}

.datepicker-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: none;
    border-radius: 0.7rem;
    background: transparent;
    color: #2b6c9e;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.datepicker-toggle:hover {
    background: #eaf1f8;
    color: #1d5180;
}

.datepicker-popup {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    z-index: 80;
    background: #ffffff;
    border-radius: 1.2rem;
    padding: 1rem 1rem 0.8rem;
    width: 300px;
    box-shadow: 0 22px 45px -14px rgba(16, 58, 94, 0.28),
                0 0 0 1px rgba(43, 108, 158, 0.12);
    animation: dpFadeIn 0.15s ease-out;
}

@keyframes dpFadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

.dp-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.8rem;
}

.dp-title {
    font-weight: 600;
    font-size: 0.98rem;
    color: #0a2a44;
    letter-spacing: 0.01em;
}

.dp-nav {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 0.6rem;
    background: #f0f5fa;
    color: #2b6c9e;
    font-size: 1.3rem;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s;
    padding-bottom: 2px;
    font-family: inherit;
}

.dp-nav:hover {
    background: #dbe9f6;
    color: #1d5180;
}

.dp-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    margin-bottom: 0.35rem;
}

.dp-weekdays span {
    text-align: center;
    font-size: 0.72rem;
    font-weight: 600;
    color: #7a8fa3;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.3rem 0;
}

.dp-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

.dp-empty {
    height: 34px;
}

.dp-day {
    height: 34px;
    border: none;
    background: transparent;
    border-radius: 0.6rem;
    font-size: 0.9rem;
    color: #1e3b5c;
    cursor: pointer;
    transition: background 0.12s, color 0.12s;
    font-variant-numeric: tabular-nums;
    font-family: inherit;
}

.dp-day:hover {
    background: #eaf1f8;
    color: #0a2a44;
}

.dp-day.dp-today {
    color: #2b6c9e;
    font-weight: 700;
    box-shadow: inset 0 0 0 1.5px #b9cfe2;
}

.dp-day.dp-selected {
    background: linear-gradient(135deg, #2b6c9e, #1d5180);
    color: #ffffff;
    font-weight: 600;
    box-shadow: 0 6px 14px -6px rgba(43, 108, 158, 0.55);
}

.dp-day.dp-selected:hover {
    filter: brightness(1.07);
}

.dp-day.dp-disabled {
    color: #c3d0dc;
    cursor: not-allowed;
    background: transparent;
}

.dp-footer {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    margin-top: 0.7rem;
    padding-top: 0.7rem;
    border-top: 1px solid #eef2f7;
}

.dp-quick {
    border: none;
    background: transparent;
    color: #2b6c9e;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0.4rem 0.7rem;
    border-radius: 0.55rem;
    transition: background 0.15s;
    font-family: inherit;
}

.dp-quick:hover {
    background: #f0f5fa;
}

.dp-clear {
    color: #b23a3a;
}

.dp-clear:hover {
    background: #fdeaea;
}

@media (max-width: 420px) {
    .datepicker-popup {
        width: 280px;
        left: 50%;
        margin-left: -140px;
    }
}

@media (max-width: 320px) {
    .datepicker-popup {
        width: calc(100vw - 32px);
        margin-left: 0;
        left: 0;
    }
}

/* ============================================================
   Страница входа по коду (центрирование по обеим осям)
   ============================================================ */
.auth-page {
    min-height: 100vh;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.auth-page-card {
    width: 100%;
    max-width: 460px;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.auth-page-head {
    text-align: center;
    margin-bottom: 0.4rem;
}

.auth-page-head h1 {
    font-size: 1.8rem;
    line-height: 1.25;
    margin-bottom: 0.5rem;
}

@media (max-width: 480px) {
    .auth-page-head h1 {
        font-size: 1.5rem;
    }
}

.auth-page-sub {
    color: #4a5f73;
    font-size: 0.95rem;
    line-height: 1.5;
    max-width: 380px;
    margin: 0 auto;
}

.auth-page .card {
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25),
                0 0 0 1px rgba(0, 0, 0, 0.02);
}

.auth-page-footer {
    text-align: center;
    margin-top: 1.2rem;
}

.auth-page-footer a {
    color: #2b6c9e;
    text-decoration: none;
}

.auth-page-footer a:hover {
    text-decoration: underline;
}