/* ============================================
   БАЗОВЫЕ СТИЛИ - используются на всех страницах
   ============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background-color: #f5f7fa;
    color: #1e293b;
    line-height: 1.5;
}

/* Основной контейнер с боковым меню */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Основной контент */
.main-content {
    flex: 1;
    padding: 32px;
    max-width: calc(100% - 260px);
}

/* Хлебные крошки */
.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 24px;
    font-size: 14px;
    color: #64748b;
}

.breadcrumbs a {
    color: #64748b;
    text-decoration: none;
    transition: color 0.2s;
}

.breadcrumbs a:hover {
    color: #0A84FF;
}

.breadcrumbs .separator {
    color: #94a3b8;
}

.breadcrumbs .current {
    color: #0f172a;
    font-weight: 500;
}

/* Заголовок страницы */
.page-title {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 32px;
    color: #0f172a;
}

/* Общие стили для карточек */
.card {
    background-color: #ffffff;
    border-radius: 16px;
    padding: 24px;
    border: 1px solid #e9eef2;
}

.card-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    color: #0f172a;
    letter-spacing: -0.3px;
}

/* Информационный блок */
.info-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #f1f5f9;
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    color: #64748b;
    font-size: 14px;
}

.info-value {
    font-weight: 500;
    color: #0f172a;
}

/* Адаптивность для базовых стилей */
@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
    }
    
    .main-content {
        max-width: 100%;
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .breadcrumbs {
        flex-wrap: wrap;
    }
}

/* ============================================
   СТИЛИ БОКОВОГО МЕНЮ - префикс: sidebar_
   ============================================ */

.sidebar-container {
    width: 260px;
    background-color: #ffffff;
    border-right: 1px solid #e9eef2;
    padding: 32px 20px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.sidebar-logo {
    font-size: 24px;
    font-weight: 600;
    color: #0A84FF;
    margin-bottom: 40px;
    letter-spacing: -0.5px;
}

.sidebar-logo span {
    color: #1e293b;
}

.sidebar-nav {
    flex: 1;
}

.sidebar-menu-item {
    padding: 12px 16px;
    margin: 4px 0;
    border-radius: 8px;
    color: #64748b;
    font-weight: 500;
    transition: all 0.2s;
    cursor: pointer;
    text-decoration: none;
    display: block;
}

.sidebar-menu-item:hover {
    background-color: #f8fafc;
    color: #0f172a;
}

.sidebar-menu-item.active {
    background-color: #f0f9ff;
    color: #0A84FF;
}

.sidebar-user-info {
    padding: 20px 16px;
    border-top: 1px solid #e9eef2;
    margin-top: auto;
}

.sidebar-user-name {
    font-weight: 600;
    color: #0f172a;
    margin-bottom: 4px;
}

.sidebar-user-role {
    font-size: 13px;
    color: #64748b;
}

.sidebar-logout {
    margin-top: 12px;
    padding: 8px 16px;
    background-color: #fee;
    color: #c33;
    border-radius: 8px;
    font-size: 13px;
    text-decoration: none;
    display: block;
    text-align: center;
    transition: background-color 0.2s;
}

.sidebar-logout:hover {
    background-color: #fdd;
}

/* Адаптивность для мобильных */
@media (max-width: 768px) {
    .sidebar-container {
        width: 100%;
        min-height: auto;
        border-right: none;
        border-bottom: 1px solid #e9eef2;
        padding: 20px;
    }
    
    .sidebar-logo {
        margin-bottom: 20px;
    }
    
    .sidebar-nav {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .sidebar-menu-item {
        flex: 1 1 auto;
        text-align: center;
        padding: 10px;
    }
    
    .sidebar-user-info {
        margin-top: 20px;
    }
}

/* ============================================
   СТИЛИ ДАШБОРДА - префикс: dashboard_
   ============================================ */

.dashboard-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

.dashboard-stat-card {
    background-color: #ffffff;
    border-radius: 16px;
    padding: 20px;
    border: 1px solid #e9eef2;
    transition: transform 0.2s;
}

.dashboard-stat-card:hover {
    transform: translateY(-2px);
    border-color: #d0d9e2;
}

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

.dashboard-stat-title {
    color: #64748b;
    font-size: 14px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.dashboard-stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background-color: #f0f9ff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dashboard-stat-icon svg {
    width: 24px;
    height: 24px;
    fill: #0A84FF;
}

.dashboard-stat-value {
    font-size: 32px;
    font-weight: 600;
    color: #0f172a;
    margin-bottom: 4px;
}

.dashboard-stat-trend {
    font-size: 13px;
    color: #10b981;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Сетка для дашборда */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-top: 24px;
}

.dashboard-full-width {
    grid-column: 1 / -1;
}

/* Карточка статуса сервера */
.dashboard-server-status {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e9eef2;
}

.dashboard-server-status:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.dashboard-status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: #10b981;
    position: relative;
}

.dashboard-status-indicator.online {
    background-color: #10b981;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}

.dashboard-status-indicator.offline {
    background-color: #ef4444;
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2);
}

.dashboard-status-indicator.warning {
    background-color: #f59e0b;
    box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.2);
}

.dashboard-server-info {
    flex: 1;
}

.dashboard-server-name {
    font-weight: 600;
    color: #0f172a;
    margin-bottom: 4px;
}

.dashboard-server-meta {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #64748b;
}

/* Прогресс бары для сервера */
.dashboard-progress-item {
    margin-bottom: 16px;
}

.dashboard-progress-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
    font-size: 13px;
}

.dashboard-progress-label {
    color: #64748b;
}

.dashboard-progress-value {
    font-weight: 500;
    color: #0f172a;
}

.dashboard-progress-bar {
    height: 8px;
    background-color: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
}

.dashboard-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #0A84FF 0%, #3b82f6 100%);
    border-radius: 4px;
    transition: width 0.3s ease;
}

/* Сетка для метрик сервера */
.dashboard-metrics-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-top: 16px;
}

.dashboard-metric-item {
    background-color: #f8fafc;
    border-radius: 12px;
    padding: 16px;
}

.dashboard-metric-label {
    font-size: 12px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 8px;
}

.dashboard-metric-value {
    font-size: 20px;
    font-weight: 600;
    color: #0f172a;
}

.dashboard-metric-unit {
    font-size: 12px;
    color: #94a3b8;
    margin-left: 4px;
}

/* Список инбаундов */
.dashboard-inbound-list {
    max-height: 400px;
    overflow-y: auto;
}

.dashboard-inbound-item {
    padding: 16px;
    border-bottom: 1px solid #f1f5f9;
    transition: background-color 0.2s;
}

.dashboard-inbound-item:last-child {
    border-bottom: none;
}

.dashboard-inbound-item:hover {
    background-color: #f8fafc;
}

.dashboard-inbound-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.dashboard-inbound-name {
    font-weight: 600;
    color: #0f172a;
}

.dashboard-inbound-port {
    font-size: 13px;
    color: #64748b;
    background-color: #f1f5f9;
    padding: 4px 8px;
    border-radius: 6px;
}

.dashboard-inbound-protocol {
    font-size: 12px;
    color: #0A84FF;
    background-color: #f0f9ff;
    padding: 2px 8px;
    border-radius: 12px;
    display: inline-block;
}

.dashboard-inbound-stats {
    display: flex;
    gap: 20px;
    margin-top: 8px;
    font-size: 13px;
}

.dashboard-inbound-stat {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #64748b;
}

.dashboard-inbound-stat-value {
    font-weight: 600;
    color: #0f172a;
}

/* Стили для клиентов онлайн */
.dashboard-online-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.dashboard-online-item {
    background-color: #f0f9ff;
    color: #0A84FF;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    border: 1px solid #d0e6ff;
}

/* Загрузка и ошибки */
.dashboard-loading {
    text-align: center;
    padding: 40px;
    color: #64748b;
}

.dashboard-error {
    background-color: #fee;
    color: #c33;
    padding: 12px;
    border-radius: 8px;
    margin: 20px 0;
    border: 1px solid #fcc;
    text-align: center;
}

/* Улучшенные стили для списка инбаундов */
.dashboard-inbound-item {
    padding: 20px;
    border-bottom: 1px solid #f1f5f9;
    transition: background-color 0.2s;
}

.dashboard-inbound-item:last-child {
    border-bottom: none;
}

.dashboard-inbound-item:hover {
    background-color: #f8fafc;
}

.dashboard-inbound-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 10px;
}

.dashboard-inbound-header > div {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.dashboard-inbound-name {
    font-weight: 600;
    color: #0f172a;
    font-size: 16px;
}

.dashboard-inbound-port {
    font-size: 13px;
    color: #64748b;
    background-color: #f1f5f9;
    padding: 4px 8px;
    border-radius: 6px;
    white-space: nowrap;
}

.dashboard-inbound-protocol {
    font-size: 12px;
    color: #0A84FF;
    background-color: #f0f9ff;
    padding: 4px 8px;
    border-radius: 12px;
    display: inline-block;
}

.dashboard-inbound-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.dashboard-inbound-stat {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #64748b;
    font-size: 13px;
    background-color: #f8fafc;
    padding: 8px 12px;
    border-radius: 8px;
}

.dashboard-inbound-stat-value {
    font-weight: 600;
    color: #0f172a;
    margin-left: auto;
}

/* Адаптивность для мобильных */
@media (max-width: 768px) {
    .dashboard-inbound-stats {
        grid-template-columns: 1fr;
    }
    
    .dashboard-inbound-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .dashboard-inbound-header > div {
        width: 100%;
        justify-content: space-between;
    }
}

/* Адаптивность для дашборда */
@media (max-width: 1200px) {
    .dashboard-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .dashboard-stats-grid {
        grid-template-columns: 1fr;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .dashboard-metrics-grid {
        grid-template-columns: 1fr;
    }
    
    .dashboard-server-meta {
        flex-direction: column;
        gap: 4px;
    }
}

/* ============================================
   СТИЛИ СТРАНИЦЫ ВХОДА - префикс: login_
   ============================================ */

/* Центрирование контейнера для страницы входа */
body:has(.login_container) {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background-color: #f5f7fa;
}

.login_container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login_card {
    background: #ffffff;
    border-radius: 16px;
    padding: 40px;
    border: 1px solid #e9eef2;
}

.login_logo {
    text-align: center;
    margin-bottom: 30px;
}

.login_logo h1 {
    font-size: 32px;
    font-weight: 600;
    color: #0f172a;
    letter-spacing: -0.5px;
}

.login_logo span {
    color: #0A84FF;
}

.login_logo p {
    color: #64748b;
    font-size: 14px;
    margin-top: 5px;
}

.login_title {
    font-size: 24px;
    font-weight: 600;
    color: #0f172a;
    margin-bottom: 30px;
    text-align: center;
    letter-spacing: -0.3px;
}

.login_error {
    background-color: #fee;
    color: #c33;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    text-align: center;
    border: 1px solid #fcc;
}

.login_form_group {
    margin-bottom: 20px;
}

.login_form_group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #1e293b;
    margin-bottom: 5px;
}

.login_form_group input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #e9eef2;
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.2s;
    background-color: #ffffff;
}

.login_form_group input:focus {
    outline: none;
    border-color: #0A84FF;
    background-color: #f8fafc;
}

.login_form_group input[type="password"] {
    font-family: monospace;
}

.login_submit {
    width: 100%;
    padding: 14px;
    background-color: #0A84FF;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
    margin-bottom: 20px;
}

.login_submit:hover {
    background-color: #0066CC;
}

.login_submit:active {
    background-color: #0052A3;
}

.login_security_info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #64748b;
    font-size: 12px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e9eef2;
}

.login_security_info svg {
    width: 16px;
    height: 16px;
    fill: #94a3b8;
}

.login_copyright {
    text-align: center;
    color: #64748b;
    font-size: 12px;
    margin-top: 20px;
}

/* Адаптивность для страницы входа */
@media (max-width: 480px) {
    .login_card {
        padding: 30px 20px;
    }
    
    .login_logo h1 {
        font-size: 28px;
    }
    
    .login_title {
        font-size: 22px;
    }
}