/* Основные стили для проекта "Учет FTTH" */

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

body {
    background: #000;
    color: #00FF00;
    font-family: 'Courier New', monospace;
    overflow-x: hidden;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        linear-gradient(90deg, transparent 98%, #00FF00 100%),
        linear-gradient(180deg, transparent 98%, #00FF00 100%);
    background-size: 20px 20px;
    opacity: 0.1;
    z-index: -1;
    animation: scan 10s linear infinite;
}

@keyframes scan {
    0% { transform: translateY(-100%); }
    100% { transform: translateY(100%); }
}

/* Статус-бар */
.status-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.9);
    border-bottom: 1px solid #00FF00;
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    z-index: 1000;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: #00FF00;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Матричный фон */
.matrix-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -2;
    opacity: 0.1;
}

/* Убираем старое определение matrix-char */

@keyframes fall {
    0% { transform: translateY(-100vh); opacity: 1; }
    100% { transform: translateY(100vh); opacity: 0; }
}

/* Контейнеры */
.container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.main-content {
    padding: 40px 20px;
    max-width: 1200px;
    margin: 0 auto;
    margin-top: 60px;
}

/* Формы */
.login-form {
    background: rgba(0, 0, 0, 0.9);
    border: 2px solid #00FF00;
    border-radius: 10px;
    padding: 40px;
    box-shadow: 0 0 30px rgba(0, 255, 0, 0.3);
    backdrop-filter: blur(10px);
    max-width: 400px;
    width: 100%;
    position: relative;
    overflow: hidden;
}

.login-form::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(from 0deg, transparent, #00FF00, transparent);
    animation: rotate 3s linear infinite;
    z-index: -1;
}

@keyframes rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.login-form::after {
    content: '';
    position: absolute;
    inset: 3px;
    background: rgba(0, 0, 0, 0.95);
    border-radius: 8px;
    z-index: -1;
}

/* Логотип */
.logo {
    text-align: center;
    margin-bottom: 30px;
    font-size: 2.5em;
    font-weight: bold;
    text-shadow: 0 0 20px #00FF00;
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from { text-shadow: 0 0 20px #00FF00; }
    to { text-shadow: 0 0 30px #00FF00, 0 0 40px #00FF00; }
}

/* Группы форм */
.form-group {
    margin-bottom: 20px;
    position: relative;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    color: #00FF00;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.form-group input {
    width: 100%;
    padding: 15px;
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid #00FF00;
    border-radius: 5px;
    color: #00FF00;
    font-family: 'Courier New', monospace;
    font-size: 16px;
    transition: all 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #00FF00;
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.5);
    background: rgba(0, 255, 0, 0.1);
}

.form-group input::placeholder {
    color: rgba(0, 255, 0, 0.5);
}

/* Кнопки */
.submit-btn, .btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(45deg, #00FF00, #00CC00);
    border: none;
    border-radius: 5px;
    color: #000;
    font-family: 'Courier New', monospace;
    font-size: 16px;
    font-weight: bold;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.submit-btn::before, .btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.submit-btn:hover::before, .btn:hover::before {
    left: 100%;
}

.submit-btn:hover, .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 255, 0, 0.4);
}

/* Ошибки */
.error {
    color: #FF0000;
    text-align: center;
    margin-bottom: 20px;
    padding: 10px;
    background: rgba(255, 0, 0, 0.1);
    border: 1px solid #FF0000;
    border-radius: 5px;
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Заголовок */
.header {
    background: rgba(0, 0, 0, 0.95);
    border-bottom: 2px solid #00FF00;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header .logo {
    font-size: 2em;
    margin-bottom: 0;
}

/* Информация о пользователе */
.user-info {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-avatar {
    width: 50px;
    height: 50px;
    background: linear-gradient(45deg, #00FF00, #00CC00);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5em;
    font-weight: bold;
    color: #000;
    animation: pulse 2s infinite;
}

.user-details {
    text-align: right;
}

.username {
    font-size: 1.2em;
    font-weight: bold;
    margin-bottom: 5px;
}

.user-status {
    font-size: 0.9em;
    opacity: 0.8;
}

.logout-btn {
    background: linear-gradient(45deg, #FF0000, #CC0000);
    color: #000;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    width: auto;
}

.logout-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(255, 0, 0, 0.4);
}

/* Приветственная секция */
.welcome-section {
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid #00FF00;
    border-radius: 15px;
    padding: 40px;
    margin-bottom: 40px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.welcome-section::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(from 0deg, transparent, #00FF00, transparent);
    animation: rotate 4s linear infinite;
    z-index: -1;
}

.welcome-section::after {
    content: '';
    position: absolute;
    inset: 3px;
    background: rgba(0, 0, 0, 0.9);
    border-radius: 12px;
    z-index: -1;
}

.welcome-title {
    font-size: 3em;
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
}

.welcome-subtitle {
    font-size: 1.5em;
    opacity: 0.8;
    margin-bottom: 30px;
    position: relative;
    z-index: 1;
}

.login-time {
    font-size: 1.1em;
    opacity: 0.7;
    position: relative;
    z-index: 1;
}

/* Сетка dashboard */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.dashboard-card {
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid #00FF00;
    border-radius: 10px;
    padding: 30px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.dashboard-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 255, 0, 0.1), transparent);
    transition: left 0.5s;
}

.dashboard-card:hover::before {
    left: 100%;
}

.dashboard-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 255, 0, 0.3);
}

.card-title {
    font-size: 1.5em;
    margin-bottom: 20px;
    color: #00FF00;
    border-bottom: 1px solid #00FF00;
    padding-bottom: 10px;
}

.card-content {
    font-size: 1.1em;
    line-height: 1.6;
}

/* Индикаторы статуса */
.status-indicator {
    display: inline-block;
    width: 12px;
    height: 12px;
    background: #00FF00;
    border-radius: 50%;
    margin-right: 10px;
    animation: blink 1.5s infinite;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0.3; }
}

/* Кнопки уведомлений */
.notification-btn {
    background: linear-gradient(45deg, #00FF00, #00CC00);
    color: #000;
    border: none;
    padding: 15px 30px;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    font-size: 1.1em;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 20px 10px;
    width: auto;
}

.notification-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(0, 255, 0, 0.4);
}

/* Подвал */
.footer {
    background: rgba(0, 0, 0, 0.9);
    border-top: 1px solid #00FF00;
    padding: 20px;
    text-align: center;
    margin-top: 60px;
}

.footer-text {
    opacity: 0.7;
    font-size: 0.9em;
}

/* Мобильная адаптация - приоритет на сенсорные экраны */
@media (max-width: 1365px) {
    /* Основные отступы */
    .main-content {
        padding: 20px 15px;
        margin-top: 50px;
    }
    
    .section-title {
        font-size: 1.5em;
        margin-bottom: 20px;
    }
    
    /* FTTH карточки */
    .ftth-overview-grid {
        grid-template-columns: 1fr;
        gap: 15px;
        margin-bottom: 25px;
    }
    
    .ftth-overview-card {
        padding: 15px;
        margin-bottom: 15px;
    }
    
    .ftth-overview-header h3 {
        font-size: 1.1em;
    }
    
    .ftth-data-row {
        padding: 10px 0;
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .editable-field {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        width: 100%;
    }
    
    .unit-label {
        text-align: center;
        margin-left: 0;
        margin-top: 5px;
    }
    
    .ftth-input {
        width: 100%;
        padding: 12px;
        font-size: 16px; /* Предотвращает зум на iOS */
        min-height: 44px; /* Минимальная высота для сенсора */
        text-align: center;
    }
    
    .save-btn {
        width: 100%;
        padding: 12px;
        min-height: 44px;
        font-size: 16px;
    }
    
    /* Чат */
    .chat-section {
        margin: 25px 0;
    }
    
    .chat-header {
        flex-direction: column;
        gap: 15px;
        margin-bottom: 15px;
    }
    
    .chat-admin-controls {
        margin-left: 0;
        width: 100%;
    }
    
    .clear-chat-btn {
        width: 100%;
        padding: 12px;
        min-height: 44px;
        font-size: 16px;
    }
    
    .telegram-management-btn {
        width: 100%;
        padding: 12px;
        min-height: 44px;
        font-size: 16px;
        margin-left: 0;
        margin-top: 10px;
        text-align: center;
    }
    
    .chat-container {
        padding: 15px;
        margin-bottom: 25px;
    }
    
    .chat-messages {
        height: 350px;
        padding: 15px;
        gap: 12px;
    }
    
    .chat-message {
        max-width: 95%;
        padding: 12px;
    }
    
    .chat-input-container {
        padding: 15px;
    }
    
    .chat-input-wrapper {
        flex-direction: column;
        gap: 12px;
    }
    
    .chat-input-wrapper input {
        width: 100%;
        padding: 12px;
        min-height: 44px;
        font-size: 16px;
    }
    
    .chat-send-btn {
        width: 100%;
        padding: 12px;
        min-height: 44px;
        font-size: 16px;
    }
    
    .chat-info {
        flex-direction: column;
        gap: 10px;
        text-align: center;
        margin-top: 10px;
    }
    
    /* Последние изменения */
    /* Мобильные стили для последних изменений */
    .recent-changes-section {
        margin: 30px 0;
        padding: 20px;
        border-radius: 12px;
    }

    .change-item {
        padding: 16px;
        gap: 12px;
    }

    .change-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .change-time {
        align-self: flex-end;
        font-size: 0.8em;
    }

    .change-values {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .change-arrow {
        align-self: center;
        transform: rotate(90deg);
    }
    
    /* Заголовок */
    .header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
        padding: 15px;
    }
    
    .logo {
        font-size: 1.5em;
    }
    
    .logout-btn {
        padding: 12px 20px;
        min-height: 44px;
        font-size: 16px;
    }
    
    /* Уведомления */
    .notification {
        right: 10px;
        left: 10px;
        max-width: none;
        padding: 12px 15px;
        font-size: 14px;
    }
    
    /* Статус-бар */
    .status-bar {
        flex-direction: column;
        gap: 8px;
        padding: 10px 15px;
        font-size: 11px;
    }
}

/* Очень маленькие экраны */
@media (max-width: 480px) {
    .main-content {
        padding: 15px 10px;
        margin-top: 40px;
    }
    
    .section-title {
        font-size: 1.3em;
        margin-bottom: 15px;
    }
    
    .ftth-overview-card {
        padding: 12px;
    }
    
    .ftth-input, .save-btn, .chat-input-wrapper input, .chat-send-btn, .clear-chat-btn {
        min-height: 48px; /* Еще больше для удобства */
        font-size: 16px;
    }
    
    .chat-messages {
        height: 300px;
    }
    
    .logo {
        font-size: 1.3em;
    }
}

/* Пейзажная ориентация на телефонах */
@media (max-width: 1365px) and (orientation: landscape) {
    .chat-messages {
        height: 250px;
    }
    
    .ftth-overview-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
}

/* Улучшения для сенсорных экранов */
@media (hover: none) and (pointer: coarse) {
    /* Увеличиваем области нажатия */
    .ftth-input, .save-btn, .chat-input-wrapper input, .chat-send-btn, .clear-chat-btn {
        min-height: 48px;
    }
    
    /* Убираем hover эффекты */
    .ftth-overview-card:hover,
    .dashboard-card:hover {
        transform: none;
        box-shadow: 0 0 20px rgba(0, 255, 0, 0.3);
    }
    
    /* Увеличиваем отступы между интерактивными элементами */
    .ftth-data-row {
        margin-bottom: 8px;
    }
    
    .chat-message {
        margin-bottom: 10px;
    }
}

/* Дополнительные стили для мобильных устройств */
.mobile-device .ftth-overview-card,
.mobile-device .chat-container {
    border-radius: 8px;
}

.mobile-device .ftth-input:focus,
.mobile-device .chat-input-wrapper input:focus {
    transform: scale(1.02);
    transition: transform 0.2s ease;
}

/* Улучшения для iOS */
@supports (-webkit-touch-callout: none) {
    .ftth-input, .chat-input-wrapper input {
        -webkit-appearance: none;
        border-radius: 8px;
    }
    
    .save-btn, .chat-send-btn, .clear-chat-btn {
        -webkit-appearance: none;
        border-radius: 8px;
    }
}

/* Улучшения для Android */
@supports (-webkit-tap-highlight-color: transparent) {
    .ftth-input, .save-btn, .chat-input-wrapper input, .chat-send-btn, .clear-chat-btn {
        -webkit-tap-highlight-color: transparent;
    }
}

/* Оптимизация для планшетов */
@media (min-width: 1025px) and (max-width: 1365px) {
    .main-content {
        padding: 30px 25px;
    }
    
    .ftth-overview-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 20px;
    }
    
    .chat-messages {
        height: 400px;
    }
    
    .ftth-input, .save-btn, .chat-input-wrapper input, .chat-send-btn, .clear-chat-btn {
        min-height: 44px;
        font-size: 16px;
    }
}

/* Специальные стили для страницы входа */
.login-page .container {
    margin-top: 60px;
}

/* Специальные стили для dashboard */
.dashboard-page .main-content {
    margin-top: 60px;
}

/* Login page styles */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.login-box {
    background: rgba(0, 0, 0, 0.9);
    border: 2px solid #00ff00;
    border-radius: 15px;
    padding: 40px;
    box-shadow: 0 0 30px rgba(0, 255, 0, 0.5);
    width: 100%;
    max-width: 400px;
    backdrop-filter: blur(10px);
}

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

.login-header h1 {
    color: #00ff00;
    font-size: 2.5em;
    margin: 0 0 10px 0;
    text-shadow: 0 0 20px rgba(0, 255, 0, 0.7);
    font-family: 'Courier New', monospace;
    font-weight: bold;
}

.login-header p {
    color: #00aa00;
    font-size: 1.1em;
    margin: 0;
    opacity: 0.8;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    color: #00ff00;
    font-weight: bold;
    margin-bottom: 8px;
    font-size: 1.1em;
}

.form-group input {
    padding: 15px;
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid #00ff00;
    border-radius: 8px;
    color: #00ff00;
    font-size: 16px;
    transition: all 0.3s ease;
}

.form-group input:focus {
    outline: none;
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.5);
    border-color: #00cc00;
}

.form-group input::placeholder {
    color: #00aa00;
    opacity: 0.6;
}

.submit-btn {
    background: linear-gradient(45deg, #00ff00, #00cc00);
    color: #000;
    border: none;
    padding: 15px;
    border-radius: 8px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
}

/* Стили для элементов кнопки */
.submit-btn .btn-text,
.submit-btn .btn-loading {
    display: inline-block;
    transition: opacity 0.3s ease;
}

.submit-btn:disabled .btn-text {
    display: none;
}

.submit-btn:disabled .btn-loading {
    display: inline-block;
}

.submit-btn:disabled {
    background: linear-gradient(45deg, #666, #444);
    color: #999;
    cursor: not-allowed;
    transform: none;
}

.submit-btn:hover {
    background: linear-gradient(45deg, #00cc00, #00ff00);
    box-shadow: 0 0 25px rgba(0, 255, 0, 0.7);
    transform: translateY(-2px);
}

.submit-btn:active {
    transform: translateY(0);
}

/* Alert styles */
.alert {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 8px;
    border: 2px solid;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: bold;
}

.alert.error {
    background: rgba(255, 0, 0, 0.1);
    border-color: #ff0000;
    color: #ff6666;
}

.alert.expired {
    background: rgba(255, 165, 0, 0.1);
    border-color: #ffa500;
    color: #ffb366;
}

.alert.success {
    background: rgba(0, 255, 0, 0.1);
    border-color: #00ff00;
    color: #66ff66;
}

/* FTTH Overview Section */
.ftth-overview-section {
    margin: 40px 0;
}

.section-title {
    color: #00ff00;
    text-align: center;
    margin-bottom: 30px;
    font-size: 2em;
    text-shadow: 0 0 20px rgba(0, 255, 0, 0.7);
}

.ftth-overview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.ftth-overview-card {
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid #00ff00;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.3);
    transition: all 0.3s ease;
}

.ftth-overview-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 25px rgba(0, 255, 0, 0.5);
}

.ftth-overview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    border-bottom: 1px solid #00ff00;
    padding-bottom: 10px;
}

.ftth-overview-header h3 {
    color: #00ff00;
    margin: 0;
    font-size: 1.3em;
}

.ftth-status-indicator {
    width: 12px;
    height: 12px;
    background: #00ff00;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.ftth-overview-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ftth-data-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(0, 255, 0, 0.2);
}

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

.data-label {
    color: #00aa00;
    font-weight: bold;
    font-size: 0.9em;
}

.data-value {
    color: #00ff00;
    font-weight: bold;
    font-size: 1em;
}

/* Recent Changes Section */
/* Блок последних изменений */
.recent-changes-section {
    margin: 40px 0;
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid #00ff00;
    border-radius: 15px;
    padding: 25px;
    position: relative;
    overflow: hidden;
}

.recent-changes-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #00ff00, #00ffff, #00ff00);
    animation: gradientShift 3s infinite;
}

.recent-changes-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 20px;
}

.change-item {
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid rgba(0, 255, 0, 0.3);
    border-radius: 12px;
    padding: 20px;
    position: relative;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 255, 0, 0.1);
}

.change-item:hover {
    border-color: rgba(0, 255, 0, 0.6);
    box-shadow: 0 6px 20px rgba(0, 255, 0, 0.2);
    transform: translateY(-2px);
}

.change-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(0, 255, 0, 0.2);
}

.change-location {
    font-size: 1.1em;
    color: #00ffff;
    font-weight: bold;
}

.change-time {
    font-size: 0.85em;
    color: #00aa00;
    background: rgba(0, 170, 0, 0.1);
    padding: 4px 8px;
    border-radius: 6px;
    border: 1px solid rgba(0, 170, 0, 0.3);
}

.change-details {
    margin-bottom: 12px;
}

.change-field {
    color: #ffffff;
    font-size: 0.95em;
    margin-bottom: 8px;
    font-weight: 500;
}

.change-values {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.1em;
}

.change-arrow {
    color: #ffff00;
    font-size: 1.2em;
    font-weight: bold;
}

.old-value {
    color: #ff6666;
    text-decoration: line-through;
    background: rgba(255, 102, 102, 0.1);
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid rgba(255, 102, 102, 0.3);
}

.new-value {
    color: #66ff66;
    font-weight: bold;
    background: rgba(102, 255, 102, 0.1);
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid rgba(102, 255, 102, 0.3);
}

.change-user {
    color: #00ccff;
    font-size: 0.9em;
    font-weight: 500;
    text-align: left;
}

/* Chat Styles */
.chat-section {
    margin: 40px 0;
}

.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
}

.chat-title {
    flex: 1;
}

.chat-admin-controls {
    margin-left: 20px;
}

.clear-chat-btn {
    background: linear-gradient(45deg, #ff4444, #cc0000);
    color: white;
    border: 2px solid #ff6666;
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 0 10px rgba(255, 68, 68, 0.3);
}

.clear-chat-btn:hover {
    background: linear-gradient(45deg, #cc0000, #990000);
    border-color: #ff4444;
    box-shadow: 0 0 15px rgba(255, 68, 68, 0.5);
    transform: translateY(-2px);
}

.clear-chat-btn:active {
    transform: translateY(0);
}

.telegram-management-btn {
    background: linear-gradient(45deg, #0088ff, #0066cc);
    color: white;
    border: 2px solid #0099ff;
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 0 10px rgba(0, 136, 255, 0.3);
    text-decoration: none;
    display: inline-block;
    margin-left: 10px;
}

.telegram-management-btn:hover {
    background: linear-gradient(45deg, #0066cc, #004499);
    border-color: #0088ff;
    box-shadow: 0 0 15px rgba(0, 136, 255, 0.5);
    transform: translateY(-2px);
    color: white;
    text-decoration: none;
}

.telegram-management-btn:active {
    transform: translateY(0);
}

.chat-description {
    text-align: center;
    color: #00aa00;
    margin-bottom: 30px;
    font-size: 1.1em;
}

.chat-container {
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid #00ff00;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 40px;
}

.chat-messages {
    height: 500px;
    overflow-y: auto;
    padding: 20px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 10px;
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.chat-message {
    padding: 15px;
    border-radius: 10px;
    max-width: 80%;
    word-wrap: break-word;
}

.user-message {
    background: rgba(0, 255, 0, 0.1);
    border: 1px solid #00ff00;
    align-self: flex-end;
    margin-left: auto;
}

.system-message {
    background: rgba(255, 165, 0, 0.1);
    border: 1px solid #ffa500;
    align-self: flex-start;
    margin-right: auto;
}

.message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 0.9em;
}

.message-author {
    color: #00cc00;
    font-weight: bold;
}

.system-message .message-author {
    color: #ffa500;
}

.message-time {
    color: #00aa00;
    font-size: 0.8em;
}

.message-content {
    color: #00ff00;
    line-height: 1.4;
}

.chat-input-container {
    background: rgba(0, 0, 0, 0.5);
    border-radius: 10px;
    padding: 20px;
}

.chat-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.chat-input-wrapper {
    display: flex;
    gap: 10px;
    align-items: center;
}

.chat-input-wrapper input {
    flex: 1;
    padding: 15px;
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid #00ff00;
    border-radius: 8px;
    color: #00ff00;
    font-size: 16px;
    transition: all 0.3s ease;
}

.chat-input-wrapper input:focus {
    outline: none;
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.5);
    border-color: #00cc00;
}

.chat-input-wrapper input::placeholder {
    color: #00aa00;
    opacity: 0.6;
}

.chat-send-btn {
    background: linear-gradient(45deg, #00ff00, #00cc00);
    color: #000;
    border: none;
    padding: 15px 20px;
    border-radius: 8px;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 60px;
}

.chat-send-btn:hover {
    background: linear-gradient(45deg, #00cc00, #00ff00);
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.5);
    transform: translateY(-2px);
}

.chat-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9em;
}

.char-count {
    color: #00aa00;
    font-weight: bold;
}

.chat-tip {
    color: #00cc00;
    font-style: italic;
}

/* Chat Help Section */
.chat-help-section {
    margin: 40px 0;
}

.help-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.help-card {
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid #00ff00;
    border-radius: 10px;
    padding: 20px;
    transition: all 0.3s ease;
}

.help-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 25px rgba(0, 255, 0, 0.3);
}

.help-card h3 {
    color: #00ff00;
    margin-bottom: 15px;
    font-size: 1.2em;
    border-bottom: 1px solid #00ff00;
    padding-bottom: 10px;
}

.help-card p {
    color: #00cc00;
    margin-bottom: 10px;
    line-height: 1.5;
}

.help-card strong {
    color: #00ff00;
}

/* Scrollbar для чата */
.chat-messages::-webkit-scrollbar {
    width: 8px;
}

.chat-messages::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #00ff00;
    border-radius: 4px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #00cc00;
}

/* Адаптивность для чата */
@media (max-width: 768px) {
    .chat-messages {
        height: 400px;
    }
    
    .chat-message {
        max-width: 95%;
    }
    
    .chat-input-wrapper {
        flex-direction: column;
        align-items: stretch;
    }
    
    .chat-send-btn {
        width: 100%;
    }
    
    .chat-info {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .help-grid {
        grid-template-columns: 1fr;
    }
}

/* Editable FTTH Fields */
.editable-field {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ftth-input {
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid #00ff00;
    border-radius: 5px;
    color: #00ff00;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    padding: 8px 12px;
    width: 120px;
    text-align: center;
    transition: all 0.3s ease;
}

.ftth-input:focus {
    outline: none;
    box-shadow: 0 0 15px rgba(0, 255, 0, 0.5);
    border-color: #00cc00;
    background: rgba(0, 255, 0, 0.1);
}

.ftth-input:hover {
    border-color: #00cc00;
}

.save-btn {
    background: linear-gradient(45deg, #00ff00, #00cc00);
    color: #000;
    border: none;
    border-radius: 5px;
    padding: 8px 12px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 40px;
    display: none;
}

.save-btn:hover {
    background: linear-gradient(45deg, #00cc00, #00ff00);
    box-shadow: 0 0 15px rgba(0, 255, 0, 0.5);
    transform: translateY(-1px);
}

.save-btn:active {
    transform: translateY(0);
}

/* Метка единиц измерения */
.unit-label {
    color: #00aa00;
    font-size: 14px;
    font-weight: bold;
    margin-left: 5px;
    user-select: none;
}

/* Обновляем стили для editable-field */
.editable-field {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* Notifications */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.9);
    border: 2px solid #00ff00;
    border-radius: 10px;
    padding: 15px 20px;
    color: #00ff00;
    font-weight: bold;
    z-index: 10000;
    animation: slideIn 0.3s ease-out;
    max-width: 300px;
    word-wrap: break-word;
}

.notification.success {
    border-color: #00ff00;
    color: #00ff00;
}

.notification.error {
    border-color: #ff0000;
    color: #ff6666;
}

.notification.warning {
    border-color: #ffa500;
    color: #ffb366;
}

.notification.info {
    border-color: #007cba;
    color: #66b3ff;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Chat on Dashboard - Compact Version */
.dashboard-page .chat-section {
    margin: 30px 0;
}

.dashboard-page .chat-container {
    max-height: 400px;
}

.dashboard-page .chat-messages {
    height: 300px;
}

.dashboard-page .chat-description {
    font-size: 1em;
    margin-bottom: 20px;
}

/* Responsive Editable Fields */
@media (max-width: 768px) {
    .editable-field {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    
    .ftth-input {
        width: 100%;
        text-align: center;
    }
    
    .save-btn {
        width: 100%;
        padding: 10px;
    }
    
    .notification {
        right: 10px;
        left: 10px;
        max-width: none;
    }
}

/* Compact Header Styles */
.compact-header {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.95), rgba(0, 20, 0, 0.95));
    border-bottom: 2px solid #00ff00;
    box-shadow: 0 4px 20px rgba(0, 255, 0, 0.3);
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60px;
}

.logo {
    font-size: 1.8rem;
    font-weight: bold;
    color: #00ff00;
    text-shadow: 0 0 10px rgba(0, 255, 0, 0.5);
    font-family: 'Courier New', monospace;
    letter-spacing: 2px;
    text-align: center;
}

.logo.centered {
    text-align: center;
}

/* Page Content Wrapper */
.page-content {
    min-height: calc(100vh - 100px);
    padding: 20px;
    max-width: 1400px;
    margin: 0 auto;
}

/* Main Footer */
.main-footer {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.95), rgba(0, 20, 0, 0.95));
    border-top: 2px solid #00ff00;
    padding: 15px 0;
    margin-top: 40px;
}

.footer-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.footer-info {
    display: flex;
    align-items: center;
    justify-content: center;
}

.footer-text {
    color: #00ff00;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    opacity: 0.8;
}

/* Responsive Design */
/* Телефоны (до 1366px) */
@media (max-width: 1365px) {
    .header-container {
        padding: 0 15px;
        min-height: 50px;
    }
    
    .logo {
        font-size: 1.5rem;
    }
    
    .logout-btn {
        padding: 8px 16px;
        font-size: 0.8rem;
    }
    
    /* Адаптация экрана авторизации для телефонов */
    .login-container {
        padding: 5px;
        min-height: 100vh;
        align-items: flex-start;
        padding-top: 10px;
    }
    
    .login-box {
        padding: 20px 15px;
        max-width: 100%;
        border-radius: 12px;
        margin: 0 5px;
        width: calc(100% - 10px);
    }
    
    .login-header {
        margin-bottom: 25px;
    }
    
    .login-header h1 {
        font-size: 1.8em;
        margin-bottom: 8px;
    }
    
    .login-header p {
        font-size: 1em;
    }
    
    .login-form {
        gap: 15px;
    }
    
    .form-group {
        margin-bottom: 3px;
        width: 100%;
    }
    
    .form-group label {
        font-size: 1em;
        margin-bottom: 4px;
        width: 100%;
    }
    
    .form-group input {
        padding: 14px 12px;
        font-size: 16px; /* Предотвращает зум на iOS */
        border-radius: 6px;
        min-height: 48px; /* Минимальная высота для сенсорных экранов */
        -webkit-appearance: none; /* Убирает стандартные стили iOS */
        -moz-appearance: none;
        appearance: none;
        width: 100%;
        box-sizing: border-box;
    }
    
    .form-group input:focus {
        box-shadow: 0 0 15px rgba(0, 255, 0, 0.4);
    }
    
    .submit-btn {
        padding: 16px;
        font-size: 16px;
        min-height: 48px; /* Минимальная высота для сенсорных экранов */
        border-radius: 6px;
        -webkit-tap-highlight-color: transparent; /* Убирает подсветку при тапе */
        touch-action: manipulation; /* Оптимизация для сенсорных экранов */
        width: 100%;
        box-sizing: border-box;
    }
    
    .submit-btn:active {
        transform: scale(0.98);
        transition: transform 0.1s ease;
    }
    
    .form-group label {
        width: 100%;
    }
    
    /* Адаптация футера для телефонов */
    .main-footer {
        padding: 10px 0;
        margin-top: 30px;
    }
    
    .footer-text {
        font-size: 0.8rem;
    }
}

/* Стили для устройств без hover (сенсорные экраны) */
@media (hover: none) and (pointer: coarse) {
    .submit-btn:hover {
        transform: none;
    }
    
    .form-group input:hover {
        border-color: #00ff00;
    }
    
    /* Увеличиваем размер активной области для сенсорных экранов */
    .form-group input:focus {
        border-width: 2px;
    }
    
    .submit-btn:active {
        background: linear-gradient(45deg, #00cc00, #009900);
        transform: scale(0.95);
    }
    
    /* Стили для элементов кнопки */
    .submit-btn .btn-text,
    .submit-btn .btn-loading {
        display: inline-block;
        transition: opacity 0.3s ease;
    }
    
    .submit-btn:disabled .btn-text {
        display: none;
    }
    
    .submit-btn:disabled .btn-loading {
        display: inline-block;
    }
}

/* Стили для алертов на телефонах */
@media (max-width: 1365px) {
    .alert {
        margin: 15px 0;
        padding: 12px 15px;
        border-radius: 8px;
        font-size: 14px;
        min-height: 44px; /* Минимальная высота для сенсорных экранов */
        display: flex;
        align-items: center;
        gap: 10px;
    }
    
    .alert.error {
        border: 2px solid #ff4444;
        background: rgba(255, 68, 68, 0.1);
        color: #ff6666;
    }
    
    .alert span {
        font-size: 16px;
        flex-shrink: 0;
    }
    
    /* Увеличиваем размер кликабельных областей */
    .form-group label {
        cursor: pointer;
        user-select: none;
        -webkit-tap-highlight-color: transparent;
    }
    
    /* Улучшаем фокус для клавиатурной навигации */
    .form-group input:focus-visible {
        outline: 2px solid #00ff00;
        outline-offset: 2px;
    }
    
    /* Анимации для лучшего UX */
    .login-box {
        animation: slideInUp 0.3s ease-out;
    }
    
    @keyframes slideInUp {
        from {
            opacity: 0;
            transform: translateY(30px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
}
    
    /* Улучшенная обратная связь при вводе */
    .form-group input:valid {
        border-color: #00aa00;
    }
    
    .form-group input:invalid:not(:placeholder-shown) {
        border-color: #ff4444;
        animation: shake 0.5s ease-in-out;
    }
    
    @keyframes shake {
        0%, 100% { transform: translateX(0); }
        25% { transform: translateX(-5px); }
        75% { transform: translateX(5px); }
    }


/* Специальные стили для iOS Safari */
@supports (-webkit-touch-callout: none) {
    .form-group input {
        -webkit-user-select: text;
        -webkit-touch-callout: default;
    }
    
    .submit-btn {
        -webkit-user-select: none;
        -webkit-touch-callout: none;
    }
}

/* Стили для Android Chrome */
@supports (-webkit-tap-highlight-color: transparent) {
    .form-group input,
    .submit-btn {
        -webkit-tap-highlight-color: transparent;
    }
}

/* Дополнительные стили для телефонов */
@media (max-width: 1365px) {
    /* Улучшенные анимации для телефонов */
    .login-box {
        will-change: transform;
        backface-visibility: hidden;
    }
    
    /* Стили для полей с контентом */
    .form-group input.has-content {
        border-color: #00aa00;
        box-shadow: 0 0 10px rgba(0, 170, 0, 0.3);
    }
    
    /* Стили для ошибок полей */
    .field-error {
        color: #ff4444;
        font-size: 12px;
        margin-top: 5px;
        animation: slideInDown 0.3s ease-out;
        font-family: 'Courier New', monospace;
    }
    
    /* Улучшенные стили для алертов */
    .alert {
        position: relative;
        overflow: hidden;
    }
    
    .alert::before {
        content: '';
        position: absolute;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100%;
        background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
        animation: shimmer 2s infinite;
    }
    
    @keyframes shimmer {
        0% { left: -100%; }
        100% { left: 100%; }
    }
    
    /* Стили для состояния загрузки кнопки */
    .submit-btn:disabled {
        background: linear-gradient(45deg, #666, #444);
        color: #999;
        cursor: not-allowed;
        transform: none;
    }
    
    /* Улучшенные стили для фокуса */
    .form-group input:focus-visible {
        outline: 2px solid #00ff00;
        outline-offset: 2px;
        border-color: #00cc00;
    }
    
    /* Стили для виртуальной клавиатуры */
    .keyboard-open .login-container {
        padding-top: 10px;
        align-items: flex-start;
    }
    
    .keyboard-open .login-box {
        transform: scale(0.95);
        transition: transform 0.3s ease;
    }
    
    /* Улучшенные стили для touch событий */
    .form-group input:active,
    .submit-btn:active {
        transform: scale(0.98);
        transition: transform 0.1s ease;
    }
    
    /* Стили для placeholder */
    .form-group input::placeholder {
        color: #00aa00;
        opacity: 0.6;
        transition: opacity 0.3s ease;
    }
    
    .form-group input:focus::placeholder {
        opacity: 0.3;
    }
    
    /* Улучшенные стили для лейблов */
    .form-group label {
        position: relative;
        cursor: pointer;
        user-select: none;
        -webkit-tap-highlight-color: transparent;
        transition: color 0.3s ease;
    }
    
    .form-group label:hover {
        color: #00cc00;
    }
    
    /* Стили для анимации появления */
    .login-container {
        animation: fadeIn 0.5s ease-out;
    }
    
    @keyframes fadeIn {
        from {
            opacity: 0;
        }
        to {
            opacity: 1;
        }
    }
    
    /* Стили для улучшенной доступности */
    .form-group input[aria-invalid="true"] {
        border-color: #ff4444;
        animation: shake 0.5s ease-in-out;
    }
    
    /* Стили для успешной валидации */
    .form-group input[aria-invalid="false"] {
        border-color: #00aa00;
        box-shadow: 0 0 10px rgba(0, 170, 0, 0.3);
    }
}

/* Matrix Background */
.matrix-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    background: #000;
}

/* Оптимизированные стили для матричных символов */
.matrix-char {
    position: absolute;
    color: #00FF00;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    opacity: 0.7;
    animation: matrixFall 6s linear infinite;
    user-select: none;
    pointer-events: none;
    will-change: transform, opacity;
    transform: translateZ(0); /* Включаем аппаратное ускорение */
}

@keyframes matrixFall {
    0% {
        transform: translateY(-100px);
        opacity: 0;
    }
    20% {
        opacity: 0.7;
    }
    80% {
        opacity: 0.7;
    }
    100% {
        transform: translateY(100vh);
        opacity: 0;
    }
}

/* Упрощенные вариации цветов для лучшей производительности */
.matrix-char:nth-child(2n) {
    color: #00ff88;
}

.matrix-char:nth-child(3n) {
    color: #00ff44;
}

/* Стили для кнопки тестирования уведомлений */
.notification-test-btn {
    background: rgba(0, 255, 255, 0.1);
    border: 1px solid #00ffff;
    color: #00ffff;
    padding: 8px 12px;
    font-size: 16px;
    cursor: pointer;
    border-radius: 3px;
    margin-right: 10px;
    transition: all 0.3s ease;
}

.notification-test-btn:hover {
    background: rgba(0, 255, 255, 0.2);
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
    transform: scale(1.1);
}

/* Анимации для уведомлений */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.notification-content {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.notification-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.notification-text {
    line-height: 1.4;
    word-wrap: break-word;
}

/* Стили для навигационной секции */
.navigation-section {
    margin: 40px 0;
    padding: 20px;
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid #00ff00;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.3);
}

.navigation-section .section-title {
    color: #00ff00;
    margin-bottom: 20px;
    text-align: center;
    font-size: 24px;
}

.navigation-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.nav-card {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid #00ff00;
    border-radius: 8px;
    text-decoration: none;
    color: #00ff00;
    transition: all 0.3s ease;
}

.nav-card:hover {
    background: rgba(0, 255, 0, 0.1);
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0, 255, 0, 0.4);
}

.nav-card-icon {
    font-size: 32px;
    flex-shrink: 0;
}

.nav-card-content h3 {
    margin-bottom: 8px;
    font-size: 18px;
    color: #00ff00;
}

.nav-card-content p {
    font-size: 14px;
    color: #00aa00;
    line-height: 1.4;
    margin: 0;
}

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
    .navigation-grid {
        grid-template-columns: 1fr;
    }
    
    .nav-card {
        flex-direction: column;
        text-align: center;
        padding: 25px 20px;
    }
    
    .nav-card-icon {
        font-size: 40px;
        margin-bottom: 10px;
    }
}
/* Стили для основного контейнера */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    color: #00ff00;
    font-family: 'Courier New', monospace;
    background: #000;
    min-height: 100vh;
}

/* Стили для заголовков секций */
.section-title {
    color: #00ff00;
    margin-bottom: 20px;
    text-align: center;
    font-size: 24px;
    text-shadow: 0 0 10px rgba(0, 255, 0, 0.5);
}

/* Стили для блока баланса */
.balance-section {
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid #00ff00;
    border-radius: 10px;
    padding: 20px;
    margin: 20px 0;
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.3);
}

.balance-section h2 {
    color: #00ff00;
    margin-bottom: 15px;
    text-align: center;
}

.balance-info {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.balance-formula {
    color: #00ff00;
    font-size: 16px;
    text-align: center;
    padding: 10px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 5px;
}

.balance-result {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-radius: 5px;
    border: 2px solid;
}

.balance-result.positive {
    background: rgba(0, 255, 0, 0.1);
    border-color: #00ff00;
}

.balance-result.negative {
    background: rgba(255, 0, 0, 0.1);
    border-color: #ff4444;
}

.balance-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
}

.balance-arrow {
    font-size: 20px;
    font-weight: bold;
}

.balance-arrow.up {
    color: #ff4444;
    animation: bounce 1s infinite;
}

.balance-arrow.down {
    color: #ff4444;
    animation: bounce 1s infinite;
}

.balance-arrow.neutral {
    color: #00ff00;
}

.balance-status {
    font-size: 16px;
    font-weight: bold;
}

.balance-result.positive .balance-status {
    color: #ff4444;
}

.balance-result.negative .balance-status {
    color: #ff4444;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-5px);
    }
    60% {
        transform: translateY(-3px);
    }
}

.balance-value {
    color: #00ff00;
    font-size: 18px;
    font-weight: bold;
    background: rgba(0, 255, 0, 0.1);
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid rgba(0, 255, 0, 0.3);
    display: flex;
    align-items: center;
    gap: 8px;
}

.balance-status {
    font-size: 16px;
}

.status-good {
    color: #00ff00;
}

.status-bad {
    color: #ff4444;
}

.status-neutral {
    color: #cccccc;
}

.warehouse-explanation {
    color: #00ff00;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 5px;
    padding: 15px;
    border-left: 4px solid #00ff00;
}

.warehouse-explanation strong {
    color: #00ff00;
    display: block;
    margin-bottom: 8px;
}

.warehouse-explanation p {
    color: #00ff00;
    margin: 0;
    line-height: 1.5;
    font-size: 14px;
}



/* Стили для детального управления FTTH */
.ftth-management-section {
    margin: 20px 0;
}

.ftth-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.ftth-card {
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid #00ff00;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.3);
    transition: all 0.3s ease;
}

.ftth-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 25px rgba(0, 255, 0, 0.5);
}

.card-title {
    color: #00ff00;
    margin-bottom: 15px;
    font-size: 18px;
    text-align: center;
}

.card-content {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.ftth-form {
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #00ff00;
    font-weight: bold;
}

.form-group input {
    width: 100%;
    padding: 10px;
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid #00ff00;
    border-radius: 5px;
    color: #00ff00;
    font-size: 16px;
}

.form-group input:focus {
    outline: none;
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.5);
}

.update-btn {
    background: #00ff00;
    color: #000;
    border: none;
    padding: 8px 16px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
    width: 100%;
    font-size: 14px;
}

.update-btn:hover {
    background: #00cc00;
    box-shadow: 0 0 15px rgba(0, 255, 0, 0.7);
}

.ftth-info {
    border-top: 1px solid #00ff00;
    padding-top: 15px;
    margin-top: 15px;
}

.ftth-info p {
    margin: 5px 0;
    color: #00ff00;
    font-size: 14px;
}

/* Стили для истории изменений */
.changes-log-section {
    margin: 40px 0;
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid #00ff00;
    border-radius: 10px;
    padding: 20px;
}

.changes-log-section h2 {
    color: #00ff00;
    margin-bottom: 20px;
    text-align: center;
}

.changes-log {
    max-height: 400px;
    overflow-y: auto;
}

.change-item {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid #00ff00;
    border-radius: 5px;
    padding: 15px;
    margin-bottom: 10px;
}

.change-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 12px;
    color: #00aa00;
}

.change-details {
    color: #00ff00;
    font-size: 14px;
}

.old-value {
    color: #ff6666;
    text-decoration: line-through;
}

.new-value {
    color: #66ff66;
    font-weight: bold;
}

.no-changes {
    text-align: center;
    color: #666;
    font-style: italic;
}

/* Стили для алертов */
.alert {
    padding: 15px;
    margin: 20px 0;
    border-radius: 5px;
    border: 2px solid;
}

.alert.success {
    background: rgba(0, 255, 0, 0.1);
    border-color: #00ff00;
    color: #00ff00;
}

.alert.error {
    background: rgba(255, 0, 0, 0.1);
    border-color: #ff0000;
    color: #ff0000;
}

/* Стили для чата */
.chat-section {
    margin: 40px 0;
}

.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.chat-title {
    flex-grow: 1;
}

.chat-title h2 {
    color: #00ff00;
    margin: 0;
}

.chat-description {
    color: #00aa00;
    font-size: 14px;
    margin: 5px 0 0 0;
}

.chat-container {
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid #00ff00;
    border-radius: 10px;
    overflow: hidden;
}

.chat-messages {
    max-height: 400px;
    overflow-y: auto;
    padding: 15px;
}

.chat-message {
    margin-bottom: 15px;
    padding: 10px;
    border-radius: 5px;
    background: rgba(0, 0, 0, 0.5);
}

.chat-message.system-message {
    border-left: 4px solid #00ff00;
}

.chat-message.user-message {
    border-left: 4px solid #00aa00;
}

.message-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 12px;
}

.message-author {
    color: #00ff00;
    font-weight: bold;
}

.message-time {
    color: #00aa00;
}

.message-content {
    color: #00ff00;
    line-height: 1.4;
}

.chat-input-container {
    border-top: 1px solid #00ff00;
    padding: 15px;
    background: rgba(0, 0, 0, 0.9);
}

.chat-form {
    display: flex;
    gap: 10px;
}

.chat-input-wrapper {
    flex-grow: 1;
    display: flex;
    gap: 10px;
}

#messageInput {
    flex-grow: 1;
    padding: 10px;
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid #00ff00;
    border-radius: 5px;
    color: #00ff00;
    font-family: 'Courier New', monospace;
}

#messageInput:focus {
    outline: none;
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.5);
}

.chat-send-btn {
    background: #00ff00;
    color: #000;
    border: none;
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
}

.chat-send-btn:hover {
    background: #00cc00;
}

.chat-info {
    margin-top: 10px;
    font-size: 12px;
    color: #00aa00;
}

.char-count {
    color: #00ff00;
}

/* Стили для навигации */
.navigation-section {
    margin: 40px 0;
}

.navigation-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.nav-card {
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid #00ff00;
    border-radius: 10px;
    padding: 20px;
    text-decoration: none;
    color: #00ff00;
    transition: all 0.3s ease;
    display: block;
}

.nav-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 25px rgba(0, 255, 0, 0.5);
    border-color: #00cc00;
}

.nav-card-icon {
    font-size: 48px;
    text-align: center;
    margin-bottom: 15px;
    display: block;
}

.nav-card-content h3 {
    margin: 0 0 10px 0;
    color: #00ff00;
    text-align: center;
}

.nav-card-content p {
    margin: 0;
    color: #00aa00;
    font-size: 14px;
    text-align: center;
}

/* Стили для уведомлений */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.9);
    color: #0f0;
    border: 1px solid #0f0;
    border-radius: 5px;
    padding: 15px;
    max-width: 300px;
    z-index: 10000;
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.3);
    animation: slideInRight 0.5s ease-out;
    font-family: monospace;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Стили для системных уведомлений */
.notification-system {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.9);
    color: #0f0;
    border: 1px solid #0f0;
    border-radius: 5px;
    padding: 15px;
    max-width: 300px;
    z-index: 10000;
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.3);
    animation: slideInRight 0.5s ease-out;
    font-family: monospace;
}

/* Мобильная адаптация */
@media (max-width: 768px) {
    .main-content {
        padding: 10px;
    }

    .ftth-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .balance-result {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }

    .chat-header {
        flex-direction: column;
        gap: 10px;
    }

    .navigation-grid {
        grid-template-columns: 1fr;
    }

    .change-header {
        flex-direction: column;
        gap: 5px;
    }
}

/* Новые адаптивные стили для мобильных устройств */
@media (max-width: 1200px) {
    .main-content {
        padding: 15px;
    }
    
    .ftth-grid {
        grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
        gap: 15px;
    }
}

@media (max-width: 768px) {
    .main-content {
        padding: 10px;
    }

    .section-title {
        font-size: 20px;
        margin-bottom: 15px;
    }

    .ftth-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .ftth-card {
        padding: 15px;
        margin-bottom: 15px;
    }

    .card-title {
        font-size: 16px;
        margin-bottom: 12px;
    }

    .form-group {
        margin-bottom: 12px;
    }

    .form-group input {
        padding: 12px;
        font-size: 16px; /* Предотвращает зум на iOS */
    }

    .update-btn {
        padding: 12px 16px;
        font-size: 16px;
        min-height: 48px; /* Минимальная высота для сенсорных экранов */
    }

    .balance-result {
        flex-direction: column;
        text-align: center;
        gap: 10px;
        padding: 12px;
    }

    .balance-value {
        font-size: 16px;
    }

    .chat-header {
        flex-direction: column;
        gap: 10px;
    }

    .chat-container {
        margin: 15px 0;
    }

    .chat-messages {
        max-height: 300px;
    }

    .chat-input-container {
        padding: 12px;
    }

    #messageInput {
        padding: 12px;
        font-size: 16px;
        min-height: 48px;
    }

    .chat-send-btn {
        padding: 12px 16px;
        min-height: 48px;
        min-width: 48px;
    }

    .change-header {
        flex-direction: column;
        gap: 5px;
    }

    .change-item {
        padding: 12px;
        margin-bottom: 8px;
    }








}

@media (max-width: 480px) {
    .main-content {
        padding: 8px;
    }

    .ftth-card {
        padding: 12px;
    }

    .section-title {
        font-size: 18px;
    }

    .balance-section {
        padding: 15px;
        margin: 15px 0;
    }

    .chat-section {
        margin: 20px 0;
    }

    .changes-log-section {
        margin: 20px 0;
        padding: 15px;
    }
}









/* Новые стили для блока склада */
.warehouse-info {
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid #00ff00;
    border-radius: 8px;
    padding: 15px;
    margin: 15px 0;
}

/* Стили для группы ввода склада */
.warehouse-input-group {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.warehouse-input-group input[type="number"] {
    flex: 1;
}

.info-btn-small {
    background: linear-gradient(45deg, #00ff00, #00cc00);
    color: #000;
    border: none;
    border-radius: 4px;
    padding: 8px 10px;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Courier New', monospace;
    flex-shrink: 0;
    min-width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.info-btn-small:hover {
    background: linear-gradient(45deg, #00cc00, #00ff00);
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(0, 255, 0, 0.4);
}

.warehouse-balance {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.balance-label {
    color: #00aa00;
    font-size: 14px;
    font-weight: bold;
}

.warehouse-balance .balance-value {
    color: #00ff00;
    font-size: 18px;
    font-weight: bold;
}

.info-btn {
    background: linear-gradient(45deg, #00ff00, #00cc00);
    color: #000;
    border: none;
    border-radius: 6px;
    padding: 10px 15px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Courier New', monospace;
}

.info-btn:hover {
    background: linear-gradient(45deg, #00cc00, #00ff00);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 255, 0, 0.4);
}

/* Модальное окно подсказки о балансе */
.balance-help-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1003;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.balance-help-modal.active {
    opacity: 1;
}

.balance-help-content {
    background: rgba(0, 0, 0, 0.95);
    border: 2px solid #00ff00;
    border-radius: 15px;
    padding: 25px;
    max-width: 90%;
    max-height: 80%;
    overflow-y: auto;
    backdrop-filter: blur(10px);
    animation: slideInUp 0.3s ease-out;
}

.balance-help-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #00ff00;
}

.balance-help-header h3 {
    color: #00ff00;
    margin: 0;
    font-size: 22px;
}

.balance-help-close {
    background: #00ff00;
    color: #000;
    border: none;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.balance-help-close:hover {
    background: #00cc00;
    transform: scale(1.1);
}

.balance-help-body {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.help-step {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(0, 255, 0, 0.3);
    border-radius: 10px;
}

.step-number {
    background: #00ff00;
    color: #000;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 16px;
    flex-shrink: 0;
}

.step-content strong {
    color: #00ff00;
    font-size: 16px;
    display: block;
    margin-bottom: 8px;
}

.step-content p {
    color: #00cc00;
    margin: 0;
    line-height: 1.5;
    font-size: 14px;
}

.help-formula {
    background: rgba(0, 255, 0, 0.1);
    border: 2px solid #00ff00;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
}

.help-formula strong {
    color: #00ff00;
    font-size: 18px;
    display: block;
    margin-bottom: 10px;
}

.help-formula p {
    color: #00cc00;
    margin: 0;
    font-size: 16px;
    font-weight: bold;
}

/* Обновленные стили для истории изменений */
.change-item {
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid rgba(0, 255, 0, 0.4);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 255, 0, 0.1);
    position: relative;
}

.change-item:hover {
    border-color: rgba(0, 255, 0, 0.7);
    box-shadow: 0 6px 20px rgba(0, 255, 0, 0.3);
    transform: translateY(-2px);
}

/* Добавляем разделитель между карточками */
.change-item:not(:last-child)::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(0, 255, 0, 0.3), transparent);
    border-radius: 1px;
}

.change-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 2px solid rgba(0, 255, 0, 0.3);
    background: rgba(0, 255, 0, 0.05);
    padding: 10px;
    border-radius: 6px;
    margin: -10px -10px 10px -10px;
}

.change-user {
    color: #00ccff;
    font-size: 14px;
    font-weight: bold;
    background: rgba(0, 204, 255, 0.1);
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid rgba(0, 204, 255, 0.3);
}

.change-time {
    color: #00aa00;
    font-size: 12px;
    background: rgba(0, 170, 0, 0.15);
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid rgba(0, 170, 0, 0.4);
    font-weight: bold;
}

.change-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    border: 1px solid rgba(0, 255, 0, 0.2);
}

.change-location {
    color: #00ffff;
    font-size: 15px;
    font-weight: bold;
    text-align: center;
    padding: 8px;
    background: rgba(0, 255, 255, 0.1);
    border-radius: 6px;
    border: 1px solid rgba(0, 255, 255, 0.3);
}



/* Адаптивность для новых элементов */
@media (max-width: 768px) {
    .warehouse-info {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .balance-help-content {
        padding: 20px;
        max-width: 95%;
    }
    
    .balance-help-header h3 {
        font-size: 18px;
    }
    
    .help-step {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    
    .change-header {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
    
    .change-values {
        justify-content: center;
    }
    
    /* Мобильные стили для карточек изменений */
    .change-item {
        padding: 12px;
        margin-bottom: 12px;
    }
    
    .change-header {
        padding: 8px;
        margin: -8px -8px 8px -8px;
    }
    
    .change-details {
        padding: 8px;
    }
    
    .change-user,
    .change-time {
        padding: 4px 8px;
        font-size: 12px;
    }
    
    .change-location {
        font-size: 13px;
        padding: 6px;
    }
    
    /* Мобильные стили для баланса */
    .balance-indicator {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
    
    .balance-arrow {
        font-size: 24px;
    }
    
    .balance-status {
        font-size: 14px;
    }
    
    .balance-value {
        font-size: 16px;
        padding: 6px 10px;
        flex-direction: column;
        gap: 4px;
        text-align: center;
    }
    
    /* Мобильные стили для группы ввода склада */
    .warehouse-input-group {
        flex-direction: column;
        gap: 8px;
    }
    
    .info-btn-small {
        width: 100%;
        height: 40px;
        font-size: 14px;
    }
}