/* style.css - Общие стили для TAP (SPA версия) */

/* Сброс и базовые стили */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
}

body {
    font-family: Arial, sans-serif;
    background-color: #f5f5f5;
    height: 100vh;
    overflow: hidden;
    line-height: 1.5;
}

h1, h2, h3, h4, h5, h6 {
    font-size: inherit;
    font-weight: inherit;
    margin: 0;
    padding: 0;
}

/* Хедер и навигация */
header {
    background-color: #2c3e50;
    color: white;
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 0;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
}

/* Логотип/название */
.app-title {
    font-size: 1.5em;
    font-weight: bold;
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

.app-title:hover {
    opacity: 0.9;
}

/* Десктопные кнопки (REBOOT/EXIT) */
.desktop-buttons {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* Мобильная кнопка меню */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 5px 10px;
}

/* Навигационные вкладки - объединяем с хедером */
.nav-tabs-wrapper {
    background-color: #34495e;
    border-bottom: 3px solid #2c3e50;
    position: sticky;
    top: 58px;
    z-index: 99;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.nav-tabs-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.nav-tabs {
    display: flex;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0;
    scrollbar-width: thin;
    scrollbar-color: #3498db #34495e;
}

.nav-tabs::-webkit-scrollbar {
    height: 4px;
}

.nav-tabs::-webkit-scrollbar-track {
    background: #34495e;
}

.nav-tabs::-webkit-scrollbar-thumb {
    background-color: #3498db;
    border-radius: 2px;
}

.tab {
    padding: 12px 20px;
    background-color: transparent;
    color: #bdc3c7;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
    flex-shrink: 0;
    min-width: 120px;
    text-align: center;
    position: relative;
       border-radius: 0;
}

.tab:hover {
    background-color: #3d566e;
    color: #ecf0f1;
}

.tab.active {
    background-color: #2c3e50;
    color: white;
    border-bottom-color: #3498db;
}

.tab-badge {
    background-color: #e74c3c;
    color: white;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: 6px;
    display: inline-block;
    min-width: 18px;
    text-align: center;
    position: absolute;
    top: 8px;
    right: 8px;
}

.tab-icon {
    margin-right: 6px;
    font-size: 16px;
}

/* Мобильное меню - расширенное */
.mobile-menu {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.95);
    z-index: 1000;
    flex-direction: column;
    padding-top: 20px;
    overflow-y: auto;
}

.mobile-menu.active {
    display: flex;
}

.mobile-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.mobile-app-title {
    font-size: 1.3em;
    font-weight: bold;
    color: white;
}

.mobile-menu-close {
    background: none;
    border: none;
    color: white;
    font-size: 30px;
    cursor: pointer;
    padding: 5px;
    line-height: 1;
}

.mobile-tab {
    padding: 18px 20px;
    color: white;
    font-size: 18px;
    text-decoration: none;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: background-color 0.3s;
}

.mobile-tab:hover {
    background-color: rgba(255,255,255,0.1);
}

.mobile-tab.active {
    background-color: #3498db;
}

.mobile-tab-icon {
    font-size: 20px;
    margin-right: 15px;
    width: 30px;
    text-align: center;
}

.mobile-tab-text {
    flex: 1;
}

/* Кнопки действий в мобильном меню */
.mobile-action-buttons {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: auto;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.mobile-action-buttons button {
    width: 100%;
    padding: 15px;
    font-size: 16px;
    border-radius: 8px;
    font-weight: bold;
}

/* Общие контейнеры */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    height: calc(100vh - 110px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.content-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

/* Контент вкладок */
.tab-content {
    display: none;
    flex: 1;
    overflow: hidden;
}

.tab-content.active {
    display: flex;
    flex-direction: column;
}

/* Кнопки */
button {
    padding: 10px 16px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s, transform 0.1s;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

button:hover {
    background-color: #2980b9;
    transform: translateY(-1px);
}

button:active {
    transform: translateY(0);
}

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* Цвета кнопок */
.btn-primary { background-color: #3498db; }
.btn-primary:hover { background-color: #2980b9; }

.btn-success { background-color: #27ae60; }
.btn-success:hover { background-color: #219653; }

.btn-warning { background-color: #f39c12; }
.btn-warning:hover { background-color: #e67e22; }

.btn-danger { background-color: #e74c3c; }
.btn-danger:hover { background-color: #c0392b; }

.btn-secondary { background-color: #95a5a6; }
.btn-secondary:hover { background-color: #7f8c8d; }

.btn-purple { background-color: #9b59b6; }
.btn-purple:hover { background-color: #8e44ad; }

.info-item {
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 4px;
    min-width: 180px;
    flex: 1;
    box-sizing: border-box;
}

/* На больших экранах - все в одну строку */
@media (min-width: 1024px) {
    .info-item {
        flex: 0 1 auto;
        min-width: 200px;
    }
}

/* На очень больших экранах можно сделать еще больше */
@media (min-width: 1400px) {
    .info-item {
        min-width: 220px;
    }
}

.info-label {
    font-weight: bold;
    color: #2c3e50;
    display: block;
    margin-bottom: 5px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-value {
    color: #34495e;
    font-family: 'Courier New', monospace;
    word-break: break-all;
    font-size: 13px;
    line-height: 1.4;
}

.status-changed {
    color: #f39c12 !important;
    font-weight: bold;
}

/* Элементы управления */
.controls {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    flex-shrink: 0;
    flex-wrap: wrap;
    align-items: center;
}

/* Фильтры */
.filters {
    display: flex;
    align-items: center;
    margin-left: 0;
    flex-wrap: wrap;
    background-color: #f8f9fa;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 5px;

    padding: 6px 10px;

    white-space: nowrap;
}

.filter-group label {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 0;
}

.filter-group input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0;
    margin-right: 6px;
    cursor: pointer;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    border: 2px solid #3498db;
    border-radius: 3px;
    position: relative;
    vertical-align: middle;
}

.filter-group input[type="checkbox"]:checked {
    background-color: #3498db;
}

.filter-group input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
}

.filter-group input[type="checkbox"]:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.3);
}

/* Альтернативный вариант с псевдоэлементом */
.checkbox-custom {
    display: none; /* Скрываем кастомный чекбокс, используем нативный */
}


.filter-group input[type="date"] {
    padding: 4px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
    min-width: 120px;
}

/* Редактор JSON */
.editor-container {
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    position: relative;
}

.editor-header {
    background-color: #34495e;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    flex-wrap: wrap;
    gap: 10px;
}

.editor-title {
    font-weight: bold;
    font-size: 15px;
    color: white;
    white-space: nowrap;
}

.editor-tools {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.editor-btn {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    white-space: nowrap;
    min-height: 32px;
}

.editor-btn:hover {
    background-color: #2980b9;
}

.editor {
    padding: 0;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

.acs-content-readonly {
    width: 100%;
    min-height: 200px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.5;
    padding: 15px;
    border: none;
    resize: vertical;
    background-color: #2c3e50;
    color: #ecf0f1;
    outline: none;
    white-space: pre;
    overflow-wrap: normal;
    overflow-x: auto;
    overflow-y: auto;
    flex: 1;
    tab-size: 2;
}

.json-editor-textarea {
    width: 100%;
    min-height: 200px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.5;
    padding: 15px;
    border: none;
    resize: vertical;
    background-color: #2c3e50;
    color: #ecf0f1;
    outline: none;
    white-space: pre;
    overflow-wrap: normal;
    overflow-x: auto;
    overflow-y: auto;
    flex: 1;
    tab-size: 2;
    border-radius: 0px;
}

/* Сообщения */
.editor-messages {
    position: relative;
    z-index: 10;
    min-height: 0;
}

.editor-message {
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    z-index: 100;
    padding: 15px 20px;
    border-radius: 4px;
    margin-bottom: 10px;
    animation: slideDown 0.3s ease-out;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    font-size: 14px;
    line-height: 1.4;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.editor-message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.editor-message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.editor-message.warning {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.message-close {
    position: absolute;
    right: 10px;
    top: 10px;
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: inherit;
    opacity: 0.7;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.message-close:hover {
    opacity: 1;
}

/* ====== Стили для индикатора загрузки ====== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    z-index: 9999;
    backdrop-filter: blur(3px);
}

.loading-overlay .spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

.loading-text {
    font-size: 18px;
    color: #333;
    font-weight: 500;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ====== Стили для уведомлений ====== */
.notification-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.notification {
    min-width: 300px;
    max-width: 400px;
    padding: 15px 20px;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    animation: slideIn 0.3s ease-out;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.notification.success {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    border-left: 4px solid #219653;
}

.notification.error {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    border-left: 4px solid #d63031;
    color: #fff; 
}

.notification.warning {
    background: linear-gradient(135deg, #f39c12, #e67e22);
    border-left: 4px solid #d35400;
}

.notification.info {
    background: linear-gradient(135deg, #3498db, #2980b9);
    border-left: 4px solid #2c80b9;
}

.notification-close {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    margin-left: 15px;
    opacity: 0.8;
    transition: opacity 0.2s;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.notification-close:hover {
    opacity: 1;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Таблица пользователей */
.table-container {
    flex: 1;
    overflow: hidden;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    background-color: white;
    min-height: 0;
    position: relative;
    display: flex;
    flex-direction: column;
}

.table-wrapper {
    overflow: auto;
    width: 100%;
    flex: 1;
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

th, td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
    font-size: 14px;
}

td:nth-child(4) {
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

thead {
    position: sticky;
    top: 0;
    z-index: 10;
    background-color: white;
}

th {
    background-color: #f8f9fa;
    position: sticky;
    top: 0;
    cursor: pointer;
    user-select: none;
    box-shadow: 0 2px 2px -1px rgba(0,0,0,0.1);
    font-weight: 600;
    font-size: 14px;
}

th:hover {
    background-color: #e9ecef;
}

th.sort-asc::after {
    content: " ↑";
    font-weight: bold;
    color: #3498db;
}

th.sort-desc::after {
    content: " ↓";
    font-weight: bold;
    color: #3498db;
}

tr:hover {
    background-color: #f8f9fa;
}

.actions {
    display: flex;
    gap: 4px;
    flex-wrap: nowrap;
}

.actions button {
    padding: 6px 10px;
    font-size: 12px;
    min-height: 30px;
    flex: 1;
    min-width: 60px;
}

.expiring-soon {
    background-color: #fff3cd;
}

.expired {
    background-color: #f8d7da;
}

/* JSON viewer */
.json-container {
    background-color: #2c3e50;
    color: #ecf0f1;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    position: relative;
}

.json-header {
    background-color: #34495e;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    flex-wrap: wrap;
    gap: 10px;
}

.json-title {
    font-weight: bold;
    font-size: 15px;
    color: white;
}

.json-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.json-btn {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    white-space: nowrap;
    min-height: 32px;
}

.json-btn:hover {
    background-color: #2980b9;
}

.json-btn.copied {
    background-color: #27ae60;
}

.json-content {
    padding: 15px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-all;
    tab-size: 2;
    overflow-x: auto;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
    color: #ecf0f1;
    background-color: #2c3e50;
    -webkit-overflow-scrolling: touch;
}

/* Формы */
.form-group {
    margin-bottom: 15px;
}

label {
    display: block;
    margin-bottom: 6px;
    font-weight: bold;
    font-size: 14px;
    color: #333;
}

input, textarea, select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

textarea {
    resize: vertical;
    min-height: 100px;
    line-height: 1.5;
}

.error {
    color: #e74c3c;
    font-size: 12px;
    margin-top: 4px;
    line-height: 1.3;
}

/* Модальные окна */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    z-index: 1000;
    overflow-y: auto;
    padding: 20px;
    box-sizing: border-box;
    -webkit-overflow-scrolling: touch;
}

.modal-content {
    background-color: white;
    margin: 0 auto;
    padding: 25px;
    border-radius: 8px;
    width: 100%;
    max-width: 500px;
    position: relative;
    box-sizing: border-box;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.close {
    position: absolute;
    right: 15px;
    top: 10px;
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
    padding: 5px;
    z-index: 10;
    color: #7f8c8d;
}

.close:hover {
    color: #333;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: #7f8c8d;
    font-size: 12px;
}

/* Сообщения об ошибках и успехе */
.error-message {
    background-color: #f8d7da;
    color: #721c24;
    padding: 12px 15px;
    border-radius: 4px;
    margin-bottom: 15px;
    border: 1px solid #f5c6cb;
    font-size: 14px;
    line-height: 1.4;
}

.success-message {
    background-color: #d4edda;
    color: #155724;
    padding: 12px 15px;
    border-radius: 4px;
    margin-bottom: 15px;
    border: 1px solid #c3e6cb;
    font-size: 14px;
    line-height: 1.4;
}

.empty-message {
    background-color: #fff3cd;
    color: #856404;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 15px;
    border: 1px solid #ffeaa7;
    text-align: center;
    font-size: 14px;
    line-height: 1.4;
}

/* Редирект на логин - ЦЕНТРИРУЕМ */
.login-redirect {
    text-align: center;
    padding: 30px 20px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin: 20px auto;
    max-width: 500px;
    width: 90%;
    box-sizing: border-box;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.login-redirect h2 {
    margin-bottom: 15px;
    color: #2c3e50;
    font-size: 20px;
}

.login-redirect p {
    margin-bottom: 20px;
    color: #666;
    font-size: 15px;
    line-height: 1.5;
}

.login-redirect button {
    min-width: 200px;
    padding: 12px 24px;
    font-size: 16px;
}

/* Спиннер */
.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
    vertical-align: middle;
    margin-right: 5px;
    flex-shrink: 0;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Стили для полей ввода заметки */
.note-textarea {
    resize: vertical;
    min-width: 100%;
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
    font-family: inherit;
}

/* Простая жирная оранжевая точка */
.sync-dot {
    width: 10px;
    height: 10px;
    background-color: #f39c12;
    border-radius: 50%;
    display: inline-block;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(243, 156, 18, 0.7); }
    70% { box-shadow: 0 0 0 5px rgba(243, 156, 18, 0); }
    100% { box-shadow: 0 0 0 0 rgba(243, 156, 18, 0); }
}

/* Панель информации - КОМПАКТНЫЙ ВАРИАНТ */
.info-panel {
    background-color: white;
    padding: 12px 15px;
    margin-top: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
    flex-shrink: 0;
    border: 1px solid #eaeaea;
    transition: all 0.2s ease;
}

.info-panel:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.info-item {
    padding: 8px 10px;
    background-color: #f8f9fa;
    border-radius: 6px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 60px;
    border-left: 3px solid #3498db;
    transition: all 0.2s ease;
}

.info-item:hover {
    background-color: #f1f8ff;
    transform: translateY(-1px);
}

.info-label {
    font-weight: 600;
    color: #5a6c7d;
    display: block;
    margin-bottom: 3px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    opacity: 0.8;
}

.info-value {
    color: #2c3e50;
    font-family: 'SF Mono', 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.4;
    font-weight: 500;
    word-break: break-word;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* Компактный вариант для больших экранов */
@media (min-width: 1024px) {
    .info-panel {
        grid-template-columns: repeat(4, 1fr);
        gap: 8px;
        padding: 10px 12px;
    }
    
    .info-item {
        padding: 8px;
        min-height: 55px;
    }
    
    .info-label {
        font-size: 10px;
        letter-spacing: 0.3px;
    }
    
    .info-value {
        font-size: 12px;
        -webkit-line-clamp: 1;
    }
}

/* На очень больших экранах */
@media (min-width: 1400px) {
    .info-panel {
        gap: 10px;
        padding: 12px 15px;
    }
    
    .info-item {
        padding: 10px;
        min-height: 60px;
    }
    
    .info-value {
        font-size: 13px;
    }
}

/* МОБИЛЬНАЯ АДАПТАЦИЯ */
@media (max-width: 768px) {
    .header-container {
        padding: 8px 15px;
    }
    
    .desktop-buttons {
        display: none;
    }
    
    .mobile-menu-btn {
        display: block;
    }
    
    .nav-tabs-wrapper {
        display: none;
    }
    
    .container {
        padding: 15px;
        height: calc(100vh - 78px);
    }
    
    .app-title {
        font-size: 1.3em;
    }
    
    .table-container {
        margin-bottom: 70px;
        border-radius: 6px;
        padding-bottom: env(safe-area-inset-bottom, 10px);
    }
    
    table tbody tr:last-child td {
        padding-bottom: 40px;
    }
    
    .info-item {
        flex: 1 1 100%;
        min-width: 100%;
    }
    
    .controls {
        align-items: stretch;
        margin-bottom: 10px;
        flex-direction: column;
        gap: 10px;
    }
    
    .controls button {
        width: 100%;
        margin-bottom: 8px;
    }
    
    .filters {
        width: 100%;
        margin-left: 0;
        justify-content: space-between;
        gap: 8px;
    }
    
    .filter-group {
        flex: 1;
        justify-content: center;
        padding: 6px 8px;
    }
    
    .filter-group label {
        font-size: 12px;
        margin-bottom: 0;
    }
    
    .filter-group input[type="date"] {
        min-width: 100px;
        font-size: 12px;
    }
    
    .editor-header,
    .json-header {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    
    .editor-tools,
    .json-actions {
        width: 100%;
        justify-content: center;
    }
    
    .editor-btn,
    .json-btn {
        flex: 1;
        min-width: 0;
        font-size: 12px;
        padding: 8px;
    }
    
    .modal-content {
        padding: 20px;
        margin: 20px auto;
        width: 95%;
        max-height: calc(100vh - 100px);
    }
    
    .login-redirect {
        width: 95%;
        max-width: 95%;
        margin: 0 auto;
        padding: 20px;
        position: relative;
        top: auto;
        left: auto;
        transform: none;
    }
    
    .notification-container {
        top: 10px;
        right: 10px;
        left: 10px;
    }
    
    .notification {
        min-width: auto;
        width: 100%;
        max-width: 100%;
    }
    
    .info-panel {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        padding: 10px;
    }
    
    .info-item {
        padding: 8px;
        min-height: 55px;
    }
    
    .info-label {
        font-size: 10px;
    }
    
    .info-value {
        font-size: 12px;
        -webkit-line-clamp: 1;
    }
    
    th, td {
        padding: 8px 10px;
        font-size: 13px;
    }

    .actions button {
        width: 100%;
        margin-bottom: 2px;
        padding: 5px;
        font-size: 11px;
        min-height: 28px;
    }
    
    .editor-header,
    .json-header {
        padding: 10px 12px;
    }
    
    .editor-btn,
    .json-btn {
        padding: 6px 10px;
        font-size: 12px;
    }
    
    .mobile-tab {
        padding: 16px 15px;
        font-size: 16px;
    }
    
    .mobile-action-buttons {
        padding: 15px;
    }
    
    .mobile-action-buttons button {
        padding: 12px;
        font-size: 15px;
    }
}

@media (max-width: 480px) {
    .header-container {
        padding: 6px 10px;
    }
    
    .app-title {
        font-size: 1.2em;
    }
    
    .container {
        padding: 10px;
        height: calc(100vh - 70px);
    }
    
    .nav-tabs-wrapper {
        display: none;
    }
    
    .info-panel {
        padding: 10px;
        gap: 8px;
    }
    
    .info-item {
        padding: 8px;
    }
    
    .json-editor-textarea {
        padding: 12px;
        font-size: 13px;
    }
    
    .json-content {
        padding: 12px;
        font-size: 12px;
    }
    
    .close {
        right: 10px;
        top: 5px;
        font-size: 20px;
    }
    
    .actions button {
        width: 100%;
        margin-bottom: 4px;
        font-size: 11px;
        padding: 6px;
    }
    
    .mobile-tab {
        padding: 18px 15px;
        font-size: 16px;
    }
    
    .info-panel {
        grid-template-columns: 1fr;
        gap: 6px;
        padding: 8px;
    }
    
    .info-item {
        padding: 8px;
        min-height: 50px;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
    
    .info-label {
        margin-bottom: 0;
        margin-right: 10px;
        font-size: 10px;
        white-space: nowrap;
    }
    
    .info-value {
        font-size: 12px;
        text-align: right;
        -webkit-line-clamp: 1;
        max-width: 60%;
    }
    
    .filters {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-group {
        width: 100%;
        justify-content: space-between;
    }
    
    .filter-group label {
        font-size: 12px;
        margin-bottom: 0;
    }
    
    .filter-group input[type="date"] {
        min-width: 120px;
        font-size: 12px;
    }
}

/* Планшеты и большие телефоны */
@media (max-width: 1024px) and (min-width: 769px) {
    .container {
        max-width: 95%;
    }
    
    .info-item {
        flex: 1 1 calc(33.333% - 12px);
    }
    
    .header-buttons button {
        padding: 9px 14px;
    }
    
    .tab {
        min-width: 140px;
    }
    
    .info-panel {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Улучшения для высоких экранов */
@media (min-height: 800px) {
    .container {
        height: calc(100vh - 140px);
    }
    
    .editor-container,
    .json-container,
    .table-container {
        max-height: none;
    }
}

/* Улучшения для очень низких экранов */
@media (max-height: 600px) {
    .container {
        height: calc(100vh - 100px);
    }
    
    .info-panel {
        padding: 8px;
        margin-bottom: 10px;
    }
    
    .controls {
        margin-bottom: 8px;
    }
    
    button {
        padding: 8px 12px;
        min-height: 36px;
    }
    
    .header-container {
        padding: 10px 15px;
    }
    
    .header-buttons button {
        padding: 6px 8px;
        font-size: 12px;
    }
}

/* Для ландшафтной ориентации на мобильных */
@media (max-height: 500px) and (orientation: landscape) {
    .container {
        height: calc(100vh - 80px);
    }
    
    .header-container {
        padding: 8px 15px;
    }
    
    .header-buttons {
        margin-bottom: 5px;
    }
    
    .header-buttons button {
        padding: 5px 6px;
        font-size: 11px;
        min-height: 30px;
    }
    
    .info-panel {
        display: none;
    }
    
    .controls {
        margin-bottom: 5px;
    }
    
    .controls button {
        padding: 5px 8px;
        font-size: 12px;
        min-height: 32px;
    }
    
    .nav-tabs-wrapper {
        display: none;
    }
    
    .mobile-menu-btn {
        display: block;
    }
    
    .mobile-menu {
        padding-top: 10px;
    }
    
    .mobile-tab {
        padding: 12px 15px;
        font-size: 16px;
    }
    
    .mobile-action-buttons {
        padding: 10px 15px;
    }
}

/* Улучшения для touch устройств */
@media (hover: none) and (pointer: coarse) {
    button {
        min-height: 44px;
    }
    
    .header-buttons button {
        padding: 10px 8px;
    }

    
    th, td {
        padding: 12px 10px;
    }
    
    input, textarea, select {
        font-size: 16px;
    }
    
    .message-close {
        width: 44px;
        height: 44px;
    }
    
    .close {
        padding: 10px;
        right: 5px;
        top: 5px;
    }
    
    .tab {
        min-height: 48px;
    }
}

/* Улучшение для безопасной зоны на iOS */
@supports (padding: max(0px)) {
    .container {
        padding-left: max(15px, env(safe-area-inset-left));
        padding-right: max(15px, env(safe-area-inset-right));
    }
    
    .table-container {
        padding-bottom: max(10px, env(safe-area-inset-bottom));
    }
}

/* Хедер и навигация - объединенный вариант */
header {
    background-color: #2c3e50;
    color: white;
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 0;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0;
    min-height: 50px;
}

/* Контейнер для вкладок и кнопок (десктоп) */
.nav-container {
    display: flex;
    align-items: center;
    width: 100%;
    padding-left: 1em;
}

/* Вкладки навигации в хедере */
.nav-tabs {
    display: flex;
    flex: 1;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #3498db #2c3e50;
    height: 50px;
}

.nav-tabs::-webkit-scrollbar {
    height: 4px;
}

.nav-tabs::-webkit-scrollbar-track {
    background: #2c3e50;
}

.nav-tabs::-webkit-scrollbar-thumb {
    background-color: #3498db;
    border-radius: 2px;
}

.tab {
    padding: 0 20px;
    background-color: transparent;
    color: #bdc3c7;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
    flex-shrink: 0;
    min-width: 120px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 50px;
}

.tab:hover {
    background-color: #34495e;
    color: #ecf0f1;
}

.tab.active {
    background-color: #34495e;
    color: white;
    border-bottom-color: #3498db;
}

.tab-icon {
    margin-right: 6px;
    font-size: 16px;
}

/* Кнопки в хедере (только десктоп) */
.header-buttons {
    display: flex;
    gap: 8px;
    padding: 0 20px;
    background-color: #2c3e50;    
    height: 50px;
    align-items: center;
}

/* Мобильный хедер */
.mobile-header {
    display: none;
    width: 100%;
    padding: 0 15px;
    background-color: #2c3e50;
    height: 50px;
    align-items: center;
    justify-content: space-between;
}

.mobile-title {
    font-size: 1.2em;
    font-weight: bold;
    color: white;
    margin-left: 10px;
}

.mobile-menu-btn {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 5px 10px;
    display: flex;
    align-items: center;
}

/* Мобильное меню */
.mobile-menu {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.95);
    z-index: 1000;
    flex-direction: column;
    padding-top: 0;
    overflow-y: auto;
}

.mobile-menu.active {
    display: flex;
}

.mobile-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background-color: #2c3e50;
    height: 50px;
}

.mobile-menu-close {
    background: none;
    border: none;
    color: white;
    font-size: 30px;
    cursor: pointer;
    padding: 5px;
    line-height: 1;
}

.mobile-tab {
    padding: 18px 20px;
    color: white;
    font-size: 18px;
    text-decoration: none;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    transition: background-color 0.3s;
}

.mobile-tab:hover {
    background-color: rgba(255,255,255,0.1);
}

.mobile-tab.active {
    background-color: #3498db;
}

.mobile-tab-icon {
    font-size: 20px;
    margin-right: 15px;
    width: 30px;
    text-align: center;
}

.mobile-tab-text {
    flex: 1;
}

/* Кнопки действий в мобильном меню */
.mobile-action-buttons {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: auto;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.mobile-action-buttons button {
    width: 100%;
    padding: 15px;
    font-size: 16px;
    border-radius: 8px;
    font-weight: bold;
}

/* Общие контейнеры */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    height: calc(100vh - 50px); /* Минус высота хедера */
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sync-indicator {
    display: inline-flex;
    align-items: center;
    margin-left: 10px;
    
    /* Делаем прозрачным, но детей видно */
    background-color: transparent !important;
    padding: 0 !important;
    border-radius: 0 !important;
    color: transparent !important;
    font-size: 0 !important;
}

/* МОБИЛЬНАЯ АДАПТАЦИЯ */
@media (max-width: 768px) {
    .nav-container {
        display: none;
    }
    
    .mobile-header {
        display: flex;
    }
    
    .container {
        padding: 15px;
        height: calc(100vh - 50px);
    }
    
    .table-container {
        margin-bottom: 70px;
        border-radius: 6px;
        padding-bottom: env(safe-area-inset-bottom, 10px);
    }
}

@media (max-width: 480px) {
    .mobile-header {
        padding: 0 10px;
    }
    
    .mobile-title {
        font-size: 1.1em;
        margin-left: 5px;
    }
    
    .container {
        padding: 10px;
        height: calc(100vh - 50px);
    }
    
    .mobile-tab {
        padding: 16px 15px;
        font-size: 16px;
    }
    
    .mobile-action-buttons {
        padding: 15px;
    }
    
    .mobile-action-buttons button {
        padding: 12px;
        font-size: 15px;
    }
}

/* Для ландшафтной ориентации на мобильных */
@media (max-height: 500px) and (orientation: landscape) {
    .mobile-tab {
        padding: 12px 15px;
        font-size: 16px;
    }
    
    .mobile-action-buttons {
        padding: 10px 15px;
    }
}

/* Стили для копируемых ячеек */
.copyable {
    cursor: pointer;
    position: relative;
    transition: background-color 0.2s ease;
    padding-right: 30px !important;
    /* Убрали hover эффект фона */
}

.copyable:hover .copy-hint {
    opacity: 1;
}

.copyable-content {
    display: inline-block;
    max-width: calc(100% - 25px);
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: middle;
}

.copy-hint {
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.3;
    font-size: 14px;
    transition: opacity 0.2s ease, color 0.2s ease;
    color: #3498db;
}

.copyable:hover .copy-hint {
    color: #2980b9;
    opacity: 1;
}

/* Эффект при успешном копировании */
.copyable.copied {
    background-color: #e8f5e8 !important;
    transition: background-color 0.3s ease;
}

/* Адаптация для мобильных */
@media (max-width: 768px) {
    .copy-hint {
        opacity: 0.5;
        font-size: 12px;
        right: 5px;
    }
    
    .copyable {
        padding-right: 25px !important;
    }
}

/* Улучшение для touch устройств */
@media (hover: none) and (pointer: coarse) {
    .copy-hint {
        opacity: 0.5;
    }
}

/* Стили для блока статистики */
.users-stats {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    margin: 0 0px;
    background: #f8f9fa;
    padding: 6px 8px;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    font-size: 14px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.stat-label {
    color: #6c757d;
    font-weight: 500;
}

.stat-value {
    font-weight: 700;
    color: #212529;
    padding: 2px 8px;
    background: white;
    border-radius: 4px;
    border: 1px solid #dee2e6;
    min-width: 30px;
    text-align: center;
}

/* Адаптивность для мобильных устройств */
@media (max-width: 1024px) {
    .controls {
        flex-direction: column;
        gap: 15px;
    }
    
    .controls-left {
        display: flex;
        gap: 10px;
        justify-content: center;
        width: 100%;
    }
    
    .users-stats {
        width: 100%;
        justify-content: center;
        margin: 0;
        order: 3;
    }
    
    .filters {
        width: 100%;
        justify-content: center;
        order: 2;
    }
}

@media (max-width: 768px) {
    .users-stats {
        flex-wrap: wrap;
        gap: 15px;
        padding: 10px;
    }
    
    .stat-item {
        flex: 1;
        min-width: 120px;
        justify-content: space-between;
    }
}

@media (max-width: 480px) {
    .users-stats {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    
    .stat-item {
        flex-direction: row;
        justify-content: space-between;
        min-width: unset;
    }
}