/* === Глобальные стили === */
:root {
    --min-screen-size-width: 320px;
    --max-screen-size-width: 1280px;
}

* {
    margin: 0;
    padding: 0;
}

html {
    height: 100vh;
    width: 100vw;
    font-size: 10px;
}

@media (min-width: 768px) {
    html {
        font-size: 12px;
    }
}

@media (min-width: 1024px) {
    html {
        font-size: 14px;
    }
}

body {
    font-family: Verdana, Helvetica, Sans-Serif;
    min-width: var(--min-screen-size-width);
    max-width: var(--max-screen-size-width);
    margin: 0 auto;
    background: radial-gradient(ellipse farthest-corner at 100px 50px, #ffffff, #a2b4b4);
    padding-top: 70px;
}

    body::after {
        content: "";
        opacity: 0.3;
        position: absolute;
        top: 0;
        bottom: 0;
        right: 0;
        left: 0;
        z-index: -1;
    }

/* === Навигационная панель === */
.navbar {
    min-height: 50px;
    max-height: 60px;
    padding-top: 0;
    padding-bottom: 0;
}

.navbar-brand {
    line-height: 1;
}

.navbar.bg-dark {
    background-color: #9d9e9e !important;
}

/* === Логотип в бренде === */
.brand-logo {
    display: inline-block;
    width: 36px;
    height: 36px;
    vertical-align: middle;
    margin-right: 8px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 3000 3000' fill='none'%3E%3Cpath fill='%23F39314' d='M1500 226.11c703.7,0 1277.64,573.94 1277.64,1277.64 0,525.65 -320.26,978.86 -775.62,1174.55 -204.88,-189.35 -172.02,-553.9 -15.99,-1070.36 231.58,-766.51 0.89,-1039.43 -365.21,-1013.15 181.5,96.88 345.35,252.08 123.17,1060.82 -152.4,554.71 -170.73,817.97 -65.03,1011.86 22.76,33.61 45.31,63.53 67.72,89.86 -4.91,0.96 -9.83,1.92 -14.76,2.83 -339.7,-150.52 -326.03,-547.08 -143.2,-1152.22 231.58,-766.51 0.89,-1039.43 -365.21,-1013.15 181.5,96.88 345.35,252.08 123.16,1060.82 -152.39,554.71 -170.72,817.97 -65.02,1011.86 23.77,35.11 55.06,76.78 80.26,106.41 -7.69,-0.83 -15.36,-1.68 -23.01,-2.65 -334.6,-153.15 -329.33,-561.45 -147.5,-1163.29 231.58,-766.51 0.9,-1039.43 -365.21,-1013.15 181.5,96.88 345.35,252.08 123.17,1060.82 -137.05,498.87 -165.63,761.99 -93.12,950.94 -378.67,-222.14 -633.89,-633.58 -633.89,-1102.8 0,-703.7 573.94,-1277.64 1277.65,-1277.64z'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

@media (min-width: 768px) {
    .brand-logo {
        width: 36px;
        height: 36px;
    }
}

@media (min-width: 1024px) {
    .brand-logo {
        width: 48px;
        height: 48px;
    }
}

/* === Карусель объектов === */
.object-carousel-container {
    display: flex;
    overflow: hidden;
    max-width: 500px;
}

.object-item {
    cursor: pointer;
    padding: 2px 8px;
    border-radius: 4px;
    transition: background-color 0.2s;
    white-space: nowrap;
    user-select: none;
}

    .object-item:hover {
        background-color: rgba(255, 255, 255, 0.1);
    }

    .object-item.active {
        background-color: rgba(255, 255, 255, 0.25);
        font-weight: bold;
    }

/* Кастомный поповер (tooltip) */
.custom-popover {
    position: absolute;
    z-index: 10001;
    background: #fff;
    border: 1px solid #ccc;
    padding: 10px;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    font-size: 0.9rem;
    max-width: 300px;
    white-space: normal;
}

    .custom-popover a {
        color: #0d6efd;
        text-decoration: underline;
    }

/* === Срочные уведомления === */
#urgentNotifications {
    margin: 5px 10px 0 10px;
}

/* === Панель быстрых действий === */
#quickActions {
    margin: 15px 0 20px;
}

    #quickActions .btn {
        font-size: 1rem;
        padding: 0.75rem 1.5rem;
        white-space: nowrap;
        min-width: 200px;
    }

/* === Основной контент === */
.main-content {
    padding-top: 10px;
}

/* === Виджеты === */
.widget {
    max-width: 100%;
    height: 200px;
    margin-bottom: 1.5rem;
    cursor: default;
    position: relative;
    overflow: hidden;
}

    .widget .card-body {
        flex: 1;
        display: flex;
        flex-direction: column;
        padding-bottom: 2px;
    }

.widget-summary {
    flex: 1;
    overflow-y: auto;
}

.widget-actions {
    margin-top: auto;
    padding: 4px 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    border-top: none;
}

/* Три виджета в ряд на больших экранах */
#widgetsRow .col-auto {
    width: calc(100% / 3);
    padding: 0 10px;
}

@media (max-width: 992px) {
    #widgetsRow .col-auto {
        width: 50%;
    }
}

@media (max-width: 768px) {
    #widgetsRow .col-auto {
        width: 100%;
    }
}

/* Фоновый рисунок в правом нижнем углу */
.widget::after {
    content: "";
    position: absolute;
    right: 5px;
    bottom: 5px;
    width: 60px;
    height: 60px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    opacity: 0.15;
    pointer-events: none;
}

.widget[data-widget-type="balance"]::after {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%230d6efd'%3E%3Cpath d='M4 4h16v2H4V4zm0 4h16v2H4V8zm0 4h16v2H4v-2zm0 4h16v2H4v-2z'/%3E%3C/svg%3E");
}

.widget[data-widget-type="readings"]::after {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23198754'%3E%3Cpath d='M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-1 15l-4-4 1.41-1.41L11 14.17l6.59-6.59L19 9l-8 8z'/%3E%3C/svg%3E");
}

.widget[data-widget-type="history"]::after {
    content: "₽";
    font-size: 48px;
    font-weight: bold;
    color: #F39314;
    opacity: 0.2;
    line-height: 60px;
    text-align: center;
}

.widget[data-widget-type="contracts"]::after {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%230dcaf0'%3E%3Cpath d='M6 2c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V8l-6-6H6zm0 2h7v5h5v11H6V4z'/%3E%3C/svg%3E");
}

.widget[data-widget-type="feedback"]::after {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23dc3545'%3E%3Cpath d='M20 2H4c-1.1 0-2 .9-2 2v18l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2z'/%3E%3C/svg%3E");
}

.widget[data-widget-type="info"]::after {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%236c757d'%3E%3Cpath d='M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z'/%3E%3C/svg%3E");
}

/* === Модальное окно профиля === */
.profile-section h5 {
    margin-bottom: 1rem;
    color: #495057;
}

.profile-section p {
    margin-bottom: 0.5rem;
}

.profile-section .list-group {
    margin-bottom: 1rem;
}

/* === Модальное окно с деталями ЛС === */
.account-details h5 {
    margin-bottom: 1rem;
    color: #495057;
}

.meter-list {
    list-style: none;
    padding: 0;
}

    .meter-list li {
        padding: 5px 0;
        border-bottom: 1px solid #dee2e6;
    }

/* Toast-контейнер поверх всех модальных окон */
#globalToastContainer {
    z-index: 10560 !important;
}

/* === Вложенная модалка (субмодалка) === */
#subModal .modal-dialog {
    margin-top: 10vh;
    box-shadow: 0 1rem 3rem rgba(0,0,0,0.5);
    border: 1px solid rgba(0,0,0,0.2);
    border-radius: 0.5rem;
}

#subModal {
    z-index: 1060 !important;
}

    #subModal + .modal-backdrop {
        z-index: 1059 !important;
        opacity: 0.6;
    }


/* === Поле с паролем и "глазом" === */
.password-field {
    position: relative;
}

    .password-field .form-control {
        padding-right: 2.5rem; /* место для иконки */
    }

.password-toggle {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #6c757d;
    cursor: pointer;
    padding: 0;
    font-size: 1.2rem;
    line-height: 1;
    z-index: 3;
}

    .password-toggle:focus {
        outline: none;
        box-shadow: none;
    }



/* ===== Страницы входа и регистрации ===== */
.auth-page {
    padding-top: 0 !important;
}

    .auth-page .card {
        border: none;
        border-radius: 1rem;
        box-shadow: 0 1rem 2.5rem rgba(0, 0, 0, 0.08);
        overflow: hidden;
        background-color: #f4dac0;
        background: radial-gradient(ellipse farthest-corner at 100px 50px, #d8d8d8, #98aeae, #ffe0bb, #f8c26c);
    }

    .auth-page .card-body {
        padding: 2.5rem 2rem 2rem;
    }

    .auth-page .brand-logo {
        filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
    }

    .auth-page h4 {
        font-weight: 600;
        color: #212529;
        letter-spacing: -0.3px;
    }

    .auth-page .form-label {
        font-weight: 500;
        font-size: 0.9rem;
        color: #495057;
        margin-bottom: 0.3rem;
    }

    .auth-page .form-control {
        border: 1px solid #dee2e6;
        border-radius: 0.5rem;
        padding: 0.6rem 1rem;
        font-size: 0.95rem;
        transition: border-color 0.2s, box-shadow 0.2s;
    }

        .auth-page .form-control:focus {
            border-color: #86b7fe;
            box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15);
        }

    .auth-page .btn-primary {
        border-radius: 0.5rem;
        padding: 0.65rem;
        font-weight: 500;
        font-size: 1rem;
        letter-spacing: 0.2px;
        transition: all 0.2s;
    }

        .auth-page .btn-primary:hover {
            background-color: #0b5ed7;
            box-shadow: 0 4px 10px rgba(13, 110, 253, 0.3);
        }

    /* Card footer – более мягкий */
    .auth-page .card-footer {
        /*background-color: #f8f9fa;*/
        border-top: 1px solid rgba(0,0,0,0.05);
        padding: 1rem 1.5rem;
    }

        .auth-page .card-footer a {
            font-size: 0.85rem;
        }

        .auth-page .card-footer i {
            opacity: 0.8;
            transition: opacity 0.2s;
        }

        .auth-page .card-footer a:hover i {
            opacity: 1;
        }

    /* Парольное поле с иконкой */
    .auth-page .password-toggle {
        color: #adb5bd;
    }

        .auth-page .password-toggle:hover {
            color: #6c757d;
        }

    /* Мелкий текст */
    .auth-page .small {
        font-size: 0.8rem;
        color: #6c757d;
    }

        .auth-page .small a {
            color: #0d6efd;
            font-weight: 500;
        }


/* Лёгкие ссылки действий */
.auth-links {
    font-size: 0.85rem;
    line-height: 1.6;
}

    .auth-links a {
        font-weight: 500;
        color: #0d6efd;
        text-decoration: none;
        margin-left: 0.25rem;
    }

        .auth-links a:hover {
            text-decoration: underline;
            color: #0a58ca;
        }

/* Логотип Госуслуг внутри ссылки */
.esia-logo {
    height: 1.2em;
    vertical-align: middle;
    margin-left: 0.15em;
    position: relative;
    top: -1px;
}



@media (min-width: 768px) {
    .identity-card {
        max-width: 360px;
    }
}

@media (min-width: 1024px) {
    .identity-card {
        max-width: 400px;
    }
}

/* Единый стиль для всех детализаций */
.detail-table {
    max-height: 50vh;
    overflow-y: auto;
    border: 1px solid #dee2e6;
    border-radius: 0.25rem;
}

    .detail-table table {
        margin-bottom: 0;
    }

    .detail-table thead th {
        position: sticky;
        top: 0;
        background: #f8f9fa;
        z-index: 1;
    }

.accordion-body .detail-table {
    max-height: 400px;
}