/* ============================= */
/* MOBILE HEADER (ТОЛЬКО МОБИЛА) */
/* ============================= */

/* Десктоп */
.desktop-only {
    display: block;
}
.mobile-move {
    display: none;
}

/* Мобильные ≤400px */
@media (max-width: 500px) {
    .desktop-only {
        display: none;
    }

    .mobile-move {
        display: block;
        width: 80px;   /* можно подправить размер */
        height: 80px;
        margin-right: 10px;
        flex-shrink: 0;
    }

    .card-header {
        flex-direction: row;  /* картинка слева, текст справа */
        align-items: center;
    }

    .info-section {
        flex: 1;
    }
}

.mobile-header {
    display: none; /* по умолчанию полностью выключен */
}


a, button, .btn, .doc-list a {
    user-select: none;
    cursor: pointer;
}

@media (max-width: 992px) {
    #sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

    #sidebar.show {
        transform: translateX(0);
    }



    .container,
    .container-fluid {
        --bs-gutter-x: 0;
    }

    .mobile-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 10px 15px;
        background-color: transparent;
        position: relative;
        z-index: 1100;
    }

    .mobile-logo-img {
        width: 200px;
        height: auto;
        display: block;
    }

    #mobile-menu-toggle {
        background: none;
        border: none;
        padding: 6px;
        font-size: 1.6rem;
        cursor: pointer;
        line-height: 1;
    }


        .mobile-burger {
        background: none;
        border: none;
        padding: 6px;
        cursor: pointer;
    }

    .mobile-burger i {
        font-size: 1.6rem;
        color: #f8f9fa; /* светлый бургер */
    }

    /* Для светлой темы — тёмный бургер */
    [data-bs-theme="light"] .mobile-burger i {
        color: #212529;
    }

    /* скрываем логотип в мобильной версии */
    #sidebar .sidebar-logo {
        display: none;
        height: 0;  
        padding: 0;
        border: none;
    }



    #sidebar .sidebar-nav {
        padding-bottom: 20px; 
        overflow-y: auto; 
        max-height: 100vh; 
    }
}

/* ============================= */
/* БУРГЕР МЕНЮ                   */
/* ============================= */

#sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 999;
}

#sidebar-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

body.sidebar-open {
    overflow: hidden;
}




/* ============================= */
/* ОБЩИЕ ПЕРЕМЕННЫЕ              */
/* ============================= */

:root {
    --sidebar-width: 250px;
    --header-height: 60px;
    --transition-speed: 0.3s;
}

/* ============================= */
/* ОСНОВА                        */
/* ============================= */

body {
    overflow-x: hidden;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* ============================= */
/* SIDEBAR                       */
/* ============================= */

#sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    padding-top: var(--header-height);
    transition: transform var(--transition-speed);
    overflow-y: auto;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
}

/* ============================= */
/* CONTENT                       */
/* ============================= */

#content {
    margin-left: var(--sidebar-width);
    padding-top: calc(var(--header-height) + 20px);
    transition: margin-left var(--transition-speed);
}

/* ============================= */
/* HEADER (DESKTOP)              */
/* ============================= */

#header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    z-index: 1001;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 0 15px;
}

/* ============================= */
/* SIDEBAR LOGO                  */
/* ============================= */

.sidebar-logo {
    padding: 15px;
    text-align: center;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    font-weight: bold;
    font-size: 1.2rem;
}

/* ============================= */
/* SIDEBAR NAV                   */
/* ============================= */

.sidebar-nav {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-nav li a {
    display: block;
    padding: 12px 20px;
    color: inherit;
    text-decoration: none;
    transition: background-color 0.2s;
    border-left: 3px solid transparent;
}

.sidebar-nav li a:hover {
    background-color: rgba(0, 0, 0, 0.05);
    border-left: 3px solid #0d6efd;
}

.sidebar-nav li.active a {
    background-color: rgba(13, 110, 253, 0.1);
    border-left: 3px solid #0d6efd;
    font-weight: bold;
}

/* ============================= */
/* TABLES                        */
/* ============================= */

.table-zebra {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
}

.table-zebra thead {
    background-color: rgba(0, 0, 0, 0.05);
}

.table-zebra tbody tr:nth-child(even) {
    background-color: rgba(0, 0, 0, 0.03);
}

.table-zebra tbody tr:hover {
    background-color: rgba(13, 110, 253, 0.1);
    cursor: pointer;
}

/* ============================= */
/* DEVICE CARD                   */
/* ============================= */

.device-card {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.device-tabs .nav-link {
    border-radius: 0;
}

/* ============================= */
/* ADAPTIVE                      */
/* ============================= */

@media (max-width: 992px) {
    #sidebar {
        transform: translateX(-100%);
    }

    #sidebar.show {
        transform: translateX(0);
    }

    #content {
        margin-left: 0;
        padding-top: 10px;
    }
    
    
}

/* ============================= */
/* AVATAR                        */
/* ============================= */

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #6c757d;
}

/* ============================= */
/* LOGIN PAGE                    */
/* ============================= */

.login-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ============================= */
/* SENSOR STYLES                 */
/* ============================= */

.sensor-status-badge {
    font-size: 0.8rem;
    padding: 0.25rem 0.5rem;
}

.sensor-type-icon {
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    margin-right: 8px;
}

.sensor-type-lt31 { background-color: #0d6efd; color: #fff; }
.sensor-type-cl31 { background-color: #198754; color: #fff; }
.sensor-type-hmp155 { background-color: #6f42c1; color: #fff; }
.sensor-type-aws310 { background-color: #fd7e14; color: #fff; }

/* ============================= */
/* FORMS                         */
/* ============================= */

.form-card {
    max-width: 800px;
    margin: 0 auto;
}

.field-group {
    background-color: rgba(0, 0, 0, 0.02);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

/* ============================= */
/* DARK THEME                    */
/* ============================= */

[data-bs-theme="dark"] body {
    background-color: #212529;
    color: #f8f9fa;
}

[data-bs-theme="dark"] .card {
    background-color: #2d3338;
    border-color: #495057;
}

[data-bs-theme="dark"] .sidebar-logo {
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

[data-bs-theme="dark"] .sidebar-nav li a:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

[data-bs-theme="dark"] .sidebar-nav li.active a {
    background-color: rgba(13, 110, 253, 0.25);
}
