/*
 * @package    tmatic-app
 * @copyright  2024 TECHNOMATIC SIA
 * @author     Dmitrij Kormakov <d.kormakov@tmatic.de>
 *
 * style.css — главная таблица стилей мобильного приложения Tmatic.
 *
 * Структура файла:
 *   1.  База: раскладка страниц
 *   2.  Глобальные утилиты
 *   3.  Кнопки и touch-фиксы
 *   4.  Профиль и навигация
 *   5.  Формы и валидация
 *   6.  Модальные окна
 *   7.  Вкладка: Учет времени
 *   8.  Вкладка: Отчет
 *   9.  Вкладка: Архив
 *  10.  Вкладка: Уважаемые люди
 *  11.  Страница: Лист отметок
 *  12.  Карта (модальное окно)
 *  13.  Адаптивные стили (media queries)
 */


/* ========== 1. БАЗА: РАСКЛАДКА СТРАНИЦ ========== */

.demo-wrap {
    position: relative;
    height: 100vh;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.demo-wrap:before {
    content: ' ';
    display: block;
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100vh;
    opacity: 0.3;
    background-image: url('../images/bg.jpg');
    background-repeat: no-repeat;
    background-position: 50% 0;
    background-size: cover;
}

/* Страницы без фонового изображения */
.noBg.demo-wrap:before {
    content: ' ';
    display: block;
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100vh;
    opacity: 0.3;
    background-image: none;
    background-repeat: no-repeat;
    background-position: 50% 0;
    background-size: cover;
    pointer-events: none;
}

.demo-content {
    position: relative;
}

/* Все страницы скрыты по умолчанию, показываются через JS */
[id^="page-"] {
    display: none;
}


/* ========== 2. ГЛОБАЛЬНЫЕ УТИЛИТЫ ========== */

h1.title {
    font-weight: 700;
    font-size: 2.125rem;
    font-family: Poppins, BlinkMacSystemFont, Roboto, sans-serif;
    line-height: 41px;
}

.fs-7 {
    font-size: 0.7rem !important;
}

.h-85 {
    height: 85% !important;
}

.badge.block-badge {
    display: block !important;
}

/* Кастомные размеры Bootstrap-кнопок */
.btn-xl > .btn {
    --bs-btn-padding-y: 1.5rem !important;
    --bs-btn-padding-x: 2rem !important;
    --bs-btn-font-size: 2.25rem !important;
    --bs-btn-border-radius: 2rem !important;
}

.btn-ss {
    --bs-btn-padding-y: 0.15rem;
    --bs-btn-padding-x: 0.25rem;
    --bs-btn-font-size: 0.375rem;
    --bs-btn-border-radius: var(--bs-border-radius-sm);
}

/* Полноэкранный спиннер загрузки */
.spinner-border {
    display: block;
    position: fixed;
    width: 158px;
    height: 158px;
    top: calc(50% - (158px / 2));
    right: calc(50% - (158px / 2));
    color: #101010;
}

/* Белый оверлей-блокировщик на время запросов */
#backdrop {
    position: absolute;
    display: block;
    top: 0;
    width: 100vw;
    height: 100vh;
    z-index: 999999999;
    background-color: rgba(255, 255, 255, 1);
}

/* Версия приложения — технический оверлей (скрыт) */
.versionOverlay {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    height: 15px;
    background: unset;
    color: #336e12;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    pointer-events: none;
    z-index: 9999;
    display: none !important;
}

/* Мигание — используется для индикации активного таймера */
.blink {
    animation: blinkSequence 2.2s steps(1) infinite;
}

@keyframes blinkSequence {
    0%   { opacity: 1; }
    10%  { opacity: 0; }
    20%  { opacity: 1; }
    30%  { opacity: 0; }
    40%  { opacity: 1; }
    50%  { opacity: 0; }
    60%  { opacity: 1; }
    100% { opacity: 1; }
}

/* Превью изображения/PDF в форме */
img.pdf-preview,
.imagePreview img {
    width: 80px;
    height: 80px;
}

/* Fancybox поверх модальных окон */
.fancybox__container {
    z-index: 9999;
}

/* Размер иконок в нижнем меню */
#mainMenu button n {
    font-size: 2vh !important;
}


/* ========== 3. КНОПКИ И TOUCH-ФИКСЫ ========== */

/* Убрать залипание hover/active-состояния на сенсорных экранах */
.btn:hover,
.btn:focus,
.btn:focus-visible,
.btn:active,
.btn:first-child:active,
:not(.btn-check) + .btn:active {
    background-color: var(--bs-btn-bg) !important;
    border-color: var(--bs-btn-border-color) !important;
    color: var(--bs-btn-color) !important;
    box-shadow: none !important;
    outline: none !important;
}

/* Разрешить hover только на десктопе с мышью */
@media (hover: hover) and (pointer: fine) {
    .btn:hover {
        background-color: var(--bs-btn-hover-bg) !important;
        border-color: var(--bs-btn-hover-border-color) !important;
        color: var(--bs-btn-hover-color) !important;
    }
}


/* ========== 4. ПРОФИЛЬ И НАВИГАЦИЯ ========== */

/* Кнопка открытия профиля (offcanvas) — выше контента страницы */
.navbar-toggler {
    display: block !important;
    position: relative;
    z-index: 10;
}

/* Аватар пользователя в offcanvas */
.userAvatar {
    max-width: 180px;
    width: 100%;
    height: auto;
    border-radius: 12px !important;
    display: block;
    margin: 12px auto;
}


/* ========== 5. ФОРМЫ И ВАЛИДАЦИЯ ========== */

/* Тёмный фон лейбла floating-input */
.form-floating label::after {
    background-color: black !important;
    color: white !important;
}

/* Звёздочка обязательного поля */
.form-group.required .form-label:after {
    content: "*";
    color: red;
    float: right;
    position: absolute;
}


/* ========== 6. МОДАЛЬНЫЕ ОКНА ========== */

/* Светлое модальное окно — учёт времени и архив */
.modal-content-timetracking .modal-header {
    background: #1e2433;
    color: #fff;
    border-bottom: none;
}
.modal-content-timetracking .modal-header .modal-title { color: #fff; }
.modal-content-timetracking .modal-header .btn-close { filter: invert(1); }
.modal-content-timetracking .modal-body {
    background: #f9fafb;
}
.modal-content-timetracking .modal-footer {
    background: #f1f3f5;
    border-top: 1px solid #dee2e6;
}

/* Тёмное модальное окно (legacy, возможно не используется) */
.modal-content-dark {
    background: #1a1a1a;
    color: #fff;
}

/* Изображение в модальном окне контакта */
#contactModalImg {
    max-width: 300px;
    width: 100%;
    height: auto;
    border-radius: 16px !important;
    display: block;
    margin: 16px auto;
}

/* Иконки в списке modalList (чеки) */
#modalList img {
    display: block;
    width: 120px;
    height: auto;
    max-height: 100px;
}

/* Белый фон кнопок выбора файла в модальных окнах */
.buttonAlbum,
.buttonCamera {
    background-color: #fff !important;
}

/* Белый фон всех полей ввода внутри модальных окон (кроме ползунка) */
.modal-content-timetracking .modal-body select,
.modal-content-timetracking .modal-body .form-select,
.modal-content-timetracking .modal-body .form-control,
.modal-content-timetracking .modal-body .btn.dropdown-toggle,
.modal-content-timetracking .modal-body .bootstrap-select .dropdown-toggle,
.modal-content-timetracking .modal-body input:not(.toggle-switch-input),
.modal-content-timetracking .modal-body textarea {
    background-color: #fff !important;
}

/* Красная рамка кнопки Альбом если файл не прикреплён */
#formSend.was-validated .inputImage:has(input[type="text"][required]:invalid) .buttonAlbum {
    border-color: #dc3545 !important;
    color: #dc3545 !important;
}

/* Ползунок «Оплачено» — выключен серый, включен зелёный */
.toggle-switch-input {
    width: 3.0em !important;
    height: 1.5em !important;
    cursor: pointer;
    background-color: #adb5bd;
    border-color: #adb5bd;
}
.toggle-switch-input:checked {
    background-color: #198754 !important;
    border-color: #198754 !important;
}

.modal-content-dark .modal-header {
    background: #111 !important;
    border-bottom-color: rgba(255, 255, 255, 0.1);
}
.modal-content-dark .form-label { color: #ddd; }
.modal-content-dark .form-text { color: rgba(255, 255, 255, 0.45); }
.modal-content-dark select,
.modal-content-dark textarea,
.modal-content-dark input[type="text"],
.modal-content-dark input[type="number"] {
    background: rgba(255, 255, 255, 0.08) !important;
    border-color: rgba(255, 255, 255, 0.18) !important;
    color: #fff !important;
}
.modal-content-dark select option { background: #2a2a2a; color: #fff; }
.modal-content-dark .form-check-label { color: #ddd; }
.modal-content-dark .form-check-input { filter: brightness(0.85); }
.modal-content-dark .modal-footer {
    background: #111;
    border-top-color: rgba(255, 255, 255, 0.1);
}
.modal-content-dark .btn-outline-secondary { color: #bbb; border-color: #555; }
.modal-content-dark .btn-close { filter: invert(1); }


/* ========== 7. ВКЛАДКА: УЧЕТ ВРЕМЕНИ ========== */

#page-time {
    background: #f4f4f4;
    align-items: flex-start;
}

.time-scroll-wrap {
    position: relative;
    z-index: 1;
    height: 100vh;
    padding-top: 70px !important;
    padding-bottom: 80px !important;
    max-width: 1520px;
}

/* Карточка Старт/Стоп */
.time-main-card {
    background: #3a3a3a;
    border-radius: 20px;
    padding: 24px 20px 16px;
}

.time-card-body {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 20px;
    margin-bottom: 16px;
}

/* Кнопка Play/Stop */
.time-play-btn {
    width: 76px;
    height: 76px;
    flex-shrink: 0;
    background: #ffffff;
    border: none;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #3a3a3a;
    font-size: 2.6rem;
    cursor: pointer;
}

.time-card-text { flex: 1; text-align: center; }

.time-card-main {
    font-size: 2rem;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.1;
}

.time-card-sub {
    font-size: 0.88rem;
    color: #ffffff;
    margin-top: 3px;
}

.time-card-timer {
    font-size: 1.1rem;
    color: #ffffff;
    margin-top: 4px;
    font-variant-numeric: tabular-nums;
}

/* Геолокационная строка */
.time-geo-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #7e7e7e;
    border: none;
    border-radius: 20px;
    padding: 8px 14px;
    color: #ffffff;
    font-size: 0.82rem;
    cursor: pointer;
    width: 100%;
    text-align: left;
}

.time-geo-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* GPS не определён — внешний контур тёмный, точка красная */
.time-geo-icon .geo-outer { fill: #3a3a3a; transition: fill 0.25s; }
.time-geo-icon .geo-inner { fill: #dc3545; transition: fill 0.25s; }

/* GPS определён — внешний контур светлеет */
.time-geo-icon.geo-available .geo-outer { fill: #ffffff; }

/* В зоне проекта — точка зелёная */
.time-geo-icon.geo-inzone .geo-inner { fill: #198754; }

/* Вне зоны — точка красная */
.time-geo-icon.geo-outzone .geo-inner { fill: #dc3545; }

/* Кнопка «Недавние отметки» */
.time-recent-wrap {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.07);
}

.time-recent-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background: none;
    border: none;
    padding: 14px 16px;
    font-size: 0.95rem;
    font-weight: 600;
    color: #111;
    cursor: pointer;
}

/* Строки отметок в списке «Недавние» (legacy — список убран из HTML) */
.time-entry {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-top: 1px solid #f0f0f0;
}

.time-entry-icon {
    width: 36px;
    height: 36px;
    background: #111;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.82rem;
    flex-shrink: 0;
}

.time-entry-info { flex: 1; min-width: 0; }

.time-entry-title {
    font-size: 0.88rem;
    font-weight: 600;
    color: #111;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.time-entry-project {
    font-size: 0.75rem;
    color: #888;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.time-entry-meta { text-align: right; flex-shrink: 0; }

.time-entry-clock {
    font-size: 0.95rem;
    font-weight: 600;
    color: #111;
}

.time-entry-status { font-size: 0.72rem; color: #888; }


/* ========== 8. ВКЛАДКА: ОТЧЕТ ========== */

#page-send {
    background: #f4f4f4;
    align-items: flex-start;
}

.send-scroll-wrap {
    position: relative;
    z-index: 1;
    height: 100vh;
    padding-top: 65px !important;
    padding-bottom: 80px !important;
    max-width: 1520px;
}

/* Заголовок страницы */
.send-page-title {
    font-size: 2rem;
    font-weight: 700;
    color: #111;
    text-align: center;
    margin-bottom: 24px;
}

/* Карточка категории расхода */
.expense-card {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    background: #fff;
    border: none;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.07);
    padding: 14px 12px;
    text-align: left;
    cursor: pointer;
}

.expense-icon {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    background: #111;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1rem;
}

.expense-label {
    flex: 1;
    font-size: 0.82rem;
    font-weight: 500;
    color: #111;
    line-height: 1.2;
}

.expense-chevron {
    color: #bbb;
    font-size: 0.75rem;
    flex-shrink: 0;
}

/* --- Декоративный борд (legacy — убран из HTML) --- */

.send-hero-board {
    background: #e8e8e8;
    border-radius: 20px;
    padding: 20px;
    max-width: 1520px;
    display: flex;
    align-items: center;
    gap: 16px;
    overflow: hidden;
}

.send-hero-visual {
    position: relative;
    width: 110px;
    height: 90px;
    flex-shrink: 0;
}

.send-hero-plus {
    position: absolute;
    left: 0;
    bottom: 0;
    z-index: 2;
    width: 62px;
    height: 62px;
    background: #999;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 2rem;
}

.send-hero-papers {
    position: absolute;
    right: 0;
    top: 0;
    width: 70px;
    height: 86px;
}

.shp {
    position: absolute;
    display: block;
    width: 50px;
    height: 70px;
    border-radius: 5px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    background: linear-gradient(
        #bbb 0, #bbb 13px,
        #fff 13px, #fff 21px,
        #ddd 21px, #ddd 23px,
        #fff 23px, #fff 31px,
        #ddd 31px, #ddd 33px,
        #fff 33px, #fff 41px,
        #ddd 41px, #ddd 43px,
        #fff 43px
    );
}

.shp-1 { right: 0;   top: 10px; transform: rotate(14deg); }
.shp-2 { right: 4px; top: 5px;  transform: rotate(6deg);  }
.shp-3 { right: 8px; top: 0;    transform: rotate(-1deg); }

.send-hero-text {
    max-width: 200px;
    margin-left: auto;
}

.send-hero-sparkle {
    font-size: 1rem;
    color: #444;
    margin-bottom: 4px;
    line-height: 1;
}

.send-hero-sparkle span {
    font-size: 0.6rem;
    vertical-align: super;
}

.send-hero-title {
    font-size: 1.15rem;
    line-height: 1.2;
    margin-bottom: 6px;
}

.send-hero-sub {
    font-size: 0.78rem;
    color: #555;
    line-height: 1.4;
}


/* ========== 9. ВКЛАДКА: АРХИВ ========== */

#page-archive {
    background: #f5f5f5;
}

.archive-page-wrap {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100vh;
    max-width: 1520px;
    display: flex;
    flex-direction: column;
    background: #f5f5f5;
    padding-top: 65px;
    padding-bottom: 80px;
}

.archive-page-title {
    font-size: 2rem;
    font-weight: 700;
    color: #111;
    text-align: center;
    margin-bottom: 16px;
    margin-top: 8px;
}

/* Статичная шапка (заголовок + период + календарь) */
.archive-top {
    flex-shrink: 0;
}

/* Прокручиваемая область списка */
.archive-list-scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

/* Карточка записи в архиве */
.archive-entry-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: #fff;
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 8px;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}
.archive-entry-card:active { background: #f5f5f5; }

.archive-entry-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    color: #555;
    flex-shrink: 0;
    margin-top: 2px;
}

.archive-entry-body {
    flex: 1;
    min-width: 0;
}

.arc-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 4px;
}

.archive-entry-title {
    font-weight: 600;
    font-size: 0.9rem;
    color: #111;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.arc-submit-date {
    font-size: 0.75rem;
    color: #999;
    flex-shrink: 0;
    white-space: nowrap;
}

.arc-row { font-size: 0.82rem; color: #444; margin-top: 2px; }
.arc-lbl { color: #999; }
.arc-val  { color: #222; }

.arc-price {
    font-weight: 700;
    color: #111;
}

.arc-comment {
    font-size: 0.78rem;
    color: #888;
    margin-top: 4px;
    font-style: italic;
}

/* Иконка в борде архива (legacy — борд убран из HTML) */
.archive-hero-icon {
    position: absolute;
    left: 0;
    bottom: 0;
    z-index: 2;
    width: 62px;
    height: 62px;
    background: #999;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.6rem;
}


/* ========== 10. ВКЛАДКА: УВАЖАЕМЫЕ ЛЮДИ ========== */

#page-contacts {
    background: #f5f5f5;
}

.contacts-page-wrap {
    position: relative;
    z-index: 1;
    height: 100vh;
    width: 100%;
    max-width: 1520px;
    display: flex;
    flex-direction: column;
    background: #f5f5f5;
    padding-top: 65px;
    padding-bottom: 80px;
}

.contacts-page-title {
    font-size: 2rem;
    font-weight: 700;
    color: #111;
    text-align: center;
    margin-bottom: 16px;
    margin-top: 8px;
}

/* Статичная шапка (заголовок + поиск) */
.contacts-top {
    flex-shrink: 0;
}

/* Прокручиваемая область списка */
.contacts-list-scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

/* Поиск */
.contacts-search-inner {
    display: flex;
    align-items: center;
    background: #fff;
    border-radius: 12px;
    padding: 10px 14px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.07);
    gap: 8px;
}
.contacts-search-icon {
    color: #999;
    font-size: 0.9rem;
    flex-shrink: 0;
}
.contacts-search-inner .form-control {
    border: none;
    padding: 0;
    background: transparent;
    box-shadow: none;
    font-size: 0.88rem;
    font-weight: 500;
    color: #111;
}
.contacts-search-inner .form-control:focus {
    box-shadow: none;
    outline: none;
}

/* Список контактов — карточка как timelog-day-cards */
#contactsList {
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    padding: 0;
    margin: 0;
    list-style: none;
}

/* Строка контакта — как timelog-entry-card */
#contactsList .list-group-item {
    background: transparent;
    border: none;
    border-bottom: 1px solid #f5f5f5;
    border-radius: 0 !important;
    padding: 12px 14px;
    align-items: center !important;
}
#contactsList .list-group-item:last-child {
    border-bottom: none;
}
#contactsList .fw-bold {
    font-size: 0.88rem;
    font-weight: 600;
    color: #111;
}
#contactsList .fs-7 {
    font-size: 0.75rem;
    color: #888;
    display: block;
}


/* ========== 11. СТРАНИЦА: ЛИСТ ОТМЕТОК ========== */

#page-timelog {
    background: #f5f5f5;
}

.timelog-page-wrap {
    position: relative;
    z-index: 1;
    height: 100vh;
    width: 100%;
    max-width: 1520px;
    display: flex;
    flex-direction: column;
    background: #f5f5f5;
    padding-top: 65px;
    padding-bottom: 80px;
}

.timelog-page-title {
    font-size: 2rem;
    font-weight: 700;
    color: #111;
    text-align: center;
    margin-bottom: 16px;
    margin-top: 8px;
    padding: 0 16px;
}

/* Статичная шапка (заголовок + период + календарь) */
.timelog-top {
    flex-shrink: 0;
}

/* Прокручиваемая область списка */
.timelog-list-scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding-bottom: 90px;
}

/* Строка выбора периода */
.timelog-period-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding-top: 16px;
}

.timelog-period-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    border-radius: 12px;
    padding: 10px 14px;
    font-size: 0.88rem;
    font-weight: 500;
    color: #111;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.07);
    flex: 1;
    cursor: pointer;
    user-select: none;
}

.timelog-period-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.timelog-period-small {
    font-size: 0.7rem;
    color: #999;
    font-weight: 400;
}

/* Иконка стрелки раскрытия календаря */
.timelog-cal-toggle-icon { transition: transform 0.2s; }
.timelog-cal-toggle-icon.tl-icon-rotated { transform: rotate(180deg); }

/* Кнопка «Скачать PDF» */
.timelog-pdf-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #111;
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: 10px 16px;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
}

/* Блок подсказки выбранного диапазона */
.timelog-range-hint {
    font-size: 0.78rem;
    color: #555;
    text-align: center;
    padding: 6px 4px 0;
}

/* Календарь */
.timelog-calendar-wrap { }

.timelog-calendar {
    background: #fff;
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.08);
}

.timelog-cal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.timelog-cal-month {
    font-size: 1rem;
    font-weight: 600;
    color: #111;
}

.timelog-cal-nav {
    background: none;
    border: none;
    color: #333;
    font-size: 1rem;
    padding: 4px 10px;
    cursor: pointer;
}

.timelog-cal-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    margin-bottom: 4px;
}

.timelog-cal-weekdays span {
    font-size: 0.72rem;
    color: #aaa;
    font-weight: 500;
    padding: 4px 0;
}

.timelog-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
}

/* Ячейка дня */
.timelog-cal-day {
    text-align: center;
    padding: 7px 2px;
    font-size: 0.875rem;
    color: #111;
    cursor: pointer;
    position: relative;
    border-radius: 0;
}
.timelog-cal-day.tl-other-month { color: #ccc; cursor: default; }
.timelog-cal-day.tl-today       { font-weight: 700; }

/* Выделение диапазона */
.timelog-cal-day.tl-in-range    { background: #f0f0f0; color: #111; }
.timelog-cal-day.tl-range-start { background: #111; color: #fff; border-radius: 8px 0 0 8px; }
.timelog-cal-day.tl-range-end   { background: #111; color: #fff; border-radius: 0 8px 8px 0; }

/* Один выбранный день */
.timelog-cal-day.tl-range-start.tl-single { border-radius: 8px; }

/* Кнопки управления периодом */
.timelog-cal-modes {
    display: flex;
    gap: 8px;
    margin-top: 14px;
}

.timelog-mode-btn {
    flex: 1;
    padding: 8px 4px;
    border: 1px solid #ddd;
    border-radius: 20px;
    background: none;
    font-size: 0.82rem;
    color: #555;
    cursor: pointer;
}

.timelog-mode-btn.timelog-mode-active {
    background: #111;
    color: #fff;
    border-color: #111;
}

/* В режиме выбора диапазона — дни кликабельны */
#timelogCalendar.timelog-selecting .timelog-cal-day:not(.tl-other-month) {
    cursor: crosshair;
}

/* Группировка записей по дате */
.timelog-day-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 4px 0 8px;
}

.timelog-day-name {
    font-size: 0.82rem;
    color: #666;
    font-weight: 500;
}

.timelog-day-total {
    font-size: 0.82rem;
    color: #444;
    font-weight: 600;
}

.timelog-day-cards {
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

/* Строка записи (отметка) */
.timelog-entry-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-bottom: 1px solid #f5f5f5;
}
.timelog-entry-card:last-child { border-bottom: none; }

.timelog-entry-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    flex-shrink: 0;
    color: #fff;
}
.timelog-icon-play { background: #111; }
.timelog-icon-stop { background: #333; }

.timelog-entry-info { flex: 1; min-width: 0; }

.timelog-entry-title {
    font-size: 0.88rem;
    font-weight: 600;
    color: #111;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.timelog-entry-project {
    font-size: 0.75rem;
    color: #888;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.timelog-entry-meta { text-align: right; flex-shrink: 0; }

.timelog-entry-time {
    font-size: 0.95rem;
    font-weight: 600;
    color: #111;
}

.timelog-entry-status { font-size: 0.72rem; color: #888; }


/* ========== 12. КАРТА (МОДАЛЬНОЕ ОКНО) ========== */

/* Мобильный: bottom sheet снизу */
#mapModal .modal-dialog {
    margin: 0;
    max-width: 100%;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
}

#mapModal .modal-content {
    border-radius: 20px 20px 0 0;
    border: none;
    overflow: hidden;
}

#mapModal .modal-header {
    background: #f7f7f7;
    border-bottom: 1px solid #eee;
    padding: 22px 20px 12px;
    position: relative;
}

/* Drag-handle полоска */
#mapModal .modal-header::before {
    content: '';
    display: block;
    width: 36px;
    height: 4px;
    background: #ccc;
    border-radius: 2px;
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
}

#mapModal .modal-title {
    font-size: 0.95rem;
    font-weight: 700;
}

#mapModal .modal-body { padding: 0; }

#mapModal #map22 {
    height: 72vh;
    width: 100%;
}

/* Анимация slide-up снизу (мобильный) */
#mapModal.fade .modal-dialog {
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
}

#mapModal.show .modal-dialog {
    transform: translateY(0);
}


/* ========== 13. АДАПТИВНЫЕ СТИЛИ ========== */

/* Десктоп: карта в центрированном модальном окне */
@media (min-width: 768px) {
    #mapModal .modal-dialog {
        position: static;
        bottom: auto;
        margin: 1.75rem auto;
        max-width: 720px;
    }

    #mapModal .modal-content {
        border-radius: 16px;
    }

    #mapModal #map22 {
        height: 62vh;
    }

    #mapModal.fade .modal-dialog {
        transform: scale(0.95);
        transition: transform 0.25s ease-out;
    }

    #mapModal.show .modal-dialog {
        transform: none;
    }
}


/* ========== 14. ПРОФИЛЬ ========== */

/* Аватар */
.profile-hero {
    background: #fff;
    border-bottom: 1px solid #f0f0f0;
}

.profile-avatar-wrap {
    position: relative;
    width: 90px;
    height: 90px;
    margin: 0 auto;
}

.profile-avatar {
    width: 90px !important;
    height: 90px !important;
    border-radius: 50% !important;
    object-fit: cover;
    border: 3px solid #f0f0f0;
}

.profile-avatar-btn {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 28px;
    height: 28px;
    background: #111;
    border: 2px solid #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.7rem;
    cursor: pointer;
}

.profile-name {
    font-size: 1.15rem;
    font-weight: 700;
    color: #111;
}

.profile-status-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 4px;
}

.profile-status {
    font-size: 0.88rem;
    color: #666;
}

.profile-edit-btn {
    background: none;
    border: none;
    color: #bbb;
    padding: 0;
    font-size: 0.75rem;
    cursor: pointer;
}

/* Строки полей */
.profile-rows {
    padding: 0 16px;
    background: #fff;
}

.profile-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid #f5f5f5;
}
.profile-row:last-child { border-bottom: none; }

.profile-row-icon {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    background: #f5f5f5;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: #444;
}

.profile-row-body {
    flex: 1;
    min-width: 0;
}

.profile-row-label {
    font-size: 0.72rem;
    color: #999;
    margin-bottom: 2px;
}

.profile-row-value {
    font-size: 0.9rem;
    font-weight: 500;
    color: #111;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.profile-row-edit {
    flex-shrink: 0;
    background: none;
    border: none;
    color: #bbb;
    font-size: 0.85rem;
    padding: 4px;
    cursor: pointer;
}

/* Язык */
.profile-lang-wrap {
    padding: 12px 16px;
    border-top: 1px solid #f0f0f0;
}

.profile-lang-wrap .btn {
    border: none !important;
    box-shadow: none !important;
    background: transparent !important;
    color: #aaa !important;
    font-size: 0.9rem;
    padding: 8px 10px;
    border-radius: 8px !important;
}

.profile-lang-wrap .btn-check:checked + .btn {
    background: #111 !important;
    color: #fff !important;
}

@media (hover: hover) and (pointer: fine) {
    .profile-lang-wrap .btn:hover {
        background: #f0f0f0 !important;
        color: #111 !important;
    }
}

/* Выход */
.profile-logout-wrap {
    padding: 0 16px 0;
    margin-top: 8px;
}

.profile-logout {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 12px;
    color: #333;
    font-size: 0.9rem;
    cursor: pointer;
    text-decoration: none;
}

/* Версия */
.profile-version {
    text-align: center;
    font-size: 0.75rem;
    color: #bbb;
    padding: 16px 0 24px;
}
