html {
    font-size: 14px;
}

@media (min-width: 768px) {
    html {
        font-size: 15px;
    }
}

html,
body {
    height: 100%;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: #f4f6f9;
    color: #212529;
}

/* ============================================================ СТАТУС БАЗЫ ДАННЫХ ============================================================ */ .sidebar-footer {
    padding: 12px;
}

.connection-status {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}
/* ------------------------------------------------------------ Индикатор ------------------------------------------------------------ */

.status-dot {
    width: 9px;
    height: 9px;
    min-width: 9px;
    border-radius: 50%;
    display: block;
}
/* ------------------------------------------------------------ Текст ------------------------------------------------------------ */

.connection-status-text {
    min-width: 0;
}

.status-title {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
}

.status-subtitle {
    margin-top: 2px;
    font-size: 11px;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* ============================================================ БАЗА ДОСТУПНА ============================================================ */

.connection-online {
    background-color: rgba(25, 135, 84, 0.08);
}

    .connection-online .status-dot {
        background-color: #198754;
        box-shadow: 0 0 0 3px rgba(25, 135, 84, 0.12);
    }

    .connection-online .status-title {
        color: #198754;
    }

    .connection-online .status-subtitle {
        color: #6c757d;
    }
/* ============================================================ БАЗА НЕДОСТУПНА ============================================================ */

.connection-offline {
    background-color: rgba(220, 53, 69, 0.08);
}

    .connection-offline .status-dot {
        background-color: #dc3545;
        box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.12);
        animation: database-status-pulse 1.5s infinite;
    }

    .connection-offline .status-title {
        color: #dc3545;
    }

    .connection-offline .status-subtitle {
        color: #6c757d;
    }
/* ------------------------------------------------------------ Анимация при отсутствии БД ------------------------------------------------------------ */

@keyframes database-status-pulse {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.45;
    }

    100% {
        opacity: 1;
    }
}

/* ============================================================
APP
============================================================ */

.app {
    display: flex;
    min-height: 100vh;
}

/* ============================================================
SIDEBAR
============================================================ */

.sidebar {
    width: 260px;
    min-width: 260px;
    background: #1f2937;
    color: #ffffff;
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    overflow-y: auto;
    z-index: 1000;
}

/* ============================================================
SIDEBAR HEADER
============================================================ */

.sidebar-header {
    height: 75px;
    display: flex;
    align-items: center;
    padding: 0 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.logo {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: #2563eb;
    font-size: 17px;
    font-weight: bold;
    margin-right: 12px;
}

.brand-title {
    font-size: 17px;
    font-weight: 600;
}

.brand-subtitle {
    margin-top: 3px;
    font-size: 11px;
    color: #9ca3af;
}

/* ============================================================
MENU
============================================================ */

.sidebar-menu {
    flex: 1;
    padding: 15px 10px;
}

.menu-section {
    margin-bottom: 20px;
}

.menu-section-title {
    padding: 0 12px;
    margin-bottom: 6px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    color: #6b7280;
}

/* ============================================================
MENU ITEM
============================================================ */

.menu-item {
    display: flex;
    align-items: center;
    height: 42px;
    padding: 0 12px;
    margin-bottom: 3px;
    border-radius: 6px;
    color: #d1d5db;
    text-decoration: none;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.menu-item {
    background: #374151;
    color: #ffffff;
}

    .menu-item.active {
        background: #2563eb;
        color: #ffffff;
    }

.menu-icon {
    width: 30px;
    font-size: 18px;
    text-align: center;
    margin-right: 8px;
}

.menu-item span {
    font-size: 14px;
}

/* ============================================================
SIDEBAR FOOTER
============================================================ */

.sidebar-footer {
    padding: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.connection-status {
    display: flex;
    align-items: center;
    padding: 10px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
}

.status-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #22c55e;
    margin-right: 9px;
}

.status-title {
    font-size: 12px;
    font-weight: 600;
}

.status-subtitle {
    margin-top: 2px;
    font-size: 10px;
    color: #9ca3af;
}

/* ============================================================
MAIN
============================================================ */

.main {
    margin-left: 260px;
    width: calc(100% - 260px);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ============================================================
TOPBAR
============================================================ */

.topbar {
    height: 65px;
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 25px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.page-title {
    font-size: 20px;
    font-weight: 600;
}

.topbar-date {
    color: #6b7280;
    font-size: 13px;
}

/* ============================================================
CONTENT
============================================================ */

.content {
    padding: 25px;
}

/* ============================================================
SCROLLBAR
============================================================ */

.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background: #4b5563;
    border-radius: 3px;
}
