body {
    background-color: #15100a;
    color: #f0d9b0;
    font-family: 'Philosopher', 'Segoe UI', Arial, sans-serif;
    margin: 0;
    padding: 0;
    -webkit-text-size-adjust: 100%;
}

.admin-main-container {
    padding: 0 15px;
    max-width: 1200px;
    margin: 0 auto;
    box-sizing: border-box;
}
.admin-main-container {
    padding-bottom: 80px !important;
}

.glass-panel {
    background: rgba(30, 20, 12, 0.65);
    border: 1px solid rgba(212, 163, 95, 0.25);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(8px);
}

/* СТИЛИ ВСЕХ КНОПОК ПОД ДИЗАЙН САЙТА */
.btn-mesh {
    background: linear-gradient(135deg, #3a2a1a 0%, #261a10 100%);
    border: 1px solid #d4a35f;
    color: #f0d9b0;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-family: 'Philosopher', serif;
    font-size: 1rem;
    transition: all 0.25s ease;
    box-shadow: 0 2px 10px rgba(212, 163, 95, 0.1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    min-height: 42px;
}

.btn-mesh:hover {
    background: #d4a35f;
    color: #1d1812;
    box-shadow: 0 0 15px rgba(212, 163, 95, 0.4);
    transform: translateY(-1px);
}

.btn-mesh.btn-danger {
    border-color: #c95a5a;
    color: #ff9e9e;
    background: linear-gradient(135deg, #3a1a1a 0%, #261010 100%);
}

.btn-mesh.btn-danger:hover {
    background: #c95a5a;
    color: #fff;
    box-shadow: 0 0 15px rgba(201, 90, 90, 0.4);
}

/* Кнопки действий внутри таблиц и схем */
.btn-mesh-small, .btn-action {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(212, 163, 95, 0.5);
    color: #f0d9b0;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    font-family: 'Philosopher', serif;
    transition: all 0.2s ease;
    min-height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-mesh-small:hover, .btn-action:hover {
    background: #d4a35f;
    color: #1d1812;
    border-color: #d4a35f;
    box-shadow: 0 0 10px rgba(212, 163, 95, 0.3);
}

.btn-mesh-small.btn-danger:hover, .btn-action.delete-btn:hover {
    background: #c95a5a;
    color: #fff;
    border-color: #c95a5a;
    box-shadow: 0 0 10px rgba(201, 90, 90, 0.3);
}

.btn-mesh-small[disabled] {
    opacity: 0.4;
    cursor: not-allowed;
    background: rgba(0, 0, 0, 0.1) !important;
    color: #777 !important;
    border-color: rgba(212, 163, 95, 0.2) !important;
}

/* ОШИБКА 1: ИСПРАВЛЕНИЕ И ЦЕНТРИРОВАНИЕ ФОРМЫ ЛОГИНА */
.auth-screen-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 140px);
    padding: 20px;
    box-sizing: border-box;
}

.auth-glass-panel {
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
    box-sizing: border-box;
    text-align: center;
}

.auth-logo-container {
    display: flex;
    justify-content: center;
    width: 100%;
    margin-bottom: 15px;
}

.auth-logo {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    box-shadow: 0 0 20px rgba(255, 180, 70, 0.3);
    object-fit: cover;
}

.auth-glass-panel h2 {
    font-family: 'Philosopher', serif;
    color: #e4b066;
    margin-bottom: 25px;
    font-size: 1.6rem;
}

.auth-form-group {
    display: flex;
    flex-direction: column;
    text-align: left;
    gap: 6px;
    margin-bottom: 16px;
}

.auth-form-group label {
    font-size: 0.9rem;
    color: #c9a26a;
}

.auth-error-msg {
    color: #ff9e9e;
    background: rgba(201, 90, 90, 0.15);
    border: 1px solid rgba(201, 90, 90, 0.3);
    padding: 10px;
    border-radius: 6px;
    font-size: 0.9rem;
    margin-bottom: 15px;
}

/* ВКЛАДКИ */
.tabs-nav {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(212, 163, 95, 0.3);
    padding-bottom: 0px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.tab-btn {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(212, 163, 95, 0.3);
    color: #c9a26a;
    padding: 12px 18px;
    border-radius: 6px 6px 0 0;
    cursor: pointer;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    white-space: nowrap;
    flex: 1;
    text-align: center;
}

.tab-btn:hover {
    background: rgba(212, 163, 95, 0.1);
    color: #f0d9b0;
}

.tab-btn.active {
    background: #d4a35f;
    color: #1d1812;
    border-color: #d4a35f;
    font-weight: bold;
}

.tab-content { display: none !important; }
.tab-content.active { display: block !important; }

/* ШАПКА САЙТА (HERO BLOCK) */
.hero {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    background: rgba(20, 12, 6, 0.4);
    border-bottom: 1px solid rgba(212, 163, 95, 0.15);
    margin-bottom: 25px;
    gap: 20px;
}

.hero-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.hero .logo-block img {
    width: 75px;
    height: 75px;
    border-radius: 50%;
    box-shadow: 0 0 15px rgba(255, 180, 70, 0.3);
    object-fit: cover;
}

.hero .title-block h1 {
    margin: 0;
    font-family: 'Philosopher', serif;
    font-size: 2.2rem;
    color: #e4b066;
    line-height: 1.2;
}

.hero .title-block h2 {
    margin: 5px 0 0 0;
    font-size: 1.1rem;
    color: #c9a26a;
    font-weight: normal;
}

.hero-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}

.operator-info {
    font-size: 0.95rem;
    color: #f0d9b0;
}

.logout-link {
    color: #ff9e9e;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.logout-link:hover {
    color: #ffc4c4;
    text-decoration: underline;
}

@media (max-width: 768px) {
    .hero {
        flex-direction: column;
        text-align: center;
        padding: 20px 15px;
    }
    .hero-left {
        flex-direction: column;
        gap: 12px;
    }
    .hero-right {
        align-items: center;
        width: 100%;
        border-top: 1px solid rgba(212, 163, 95, 0.1);
        padding-top: 12px;
    }
}

/* МОДАЛЬНЫЕ ОКНА */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 7, 5, 0.85);
    backdrop-filter: blur(6px);
    z-index: 2000;
    display: none; 
    align-items: center;
    justify-content: center;
}

.modal-overlay.active { display: flex !important; }

.modal-window {
    background: #1e140c;
    border: 2px solid #d4a35f;
    border-radius: 14px;
    padding: 25px;
    width: 100%;
    max-width: 500px;
    box-shadow: 0 0 30px rgba(212, 163, 95, 0.25);
    position: relative;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    animation: modalFadeIn 0.25s cubic-bezier(0.165, 0.84, 0.44, 1);
    box-sizing: border-box;
}

/* ОШИБКА 2: СКРОЛЛ ДЛЯ МОДАЛЬНОГО ОКНА ПРЕФИКСОВ */
.modal-window.modal-window-prefix {
    max-width: 650px;
}

.modal-scrollable-form-body {
    overflow-y: auto;
    flex: 1;
    padding-right: 5px;
    margin: 15px 0;
    -webkit-overflow-scrolling: touch; /* Плавный скролл на iOS */
}

.modal-prefix-table-container {
    width: 100%;
    margin-top: 10px;
}

.modal-footer {
    display: flex;
    gap: 12px;
    margin-top: 15px;
    justify-content: flex-end;
}

.modal-window h3 {
    font-family: 'Philosopher', serif;
    color: #e4b066;
    border-bottom: 2px solid #d4a35f;
    padding-bottom: 10px;
    margin-top: 0;
    margin-bottom: 15px;
}

#dynamic-form-fields .form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    text-align: left;
    margin-bottom: 12px;
}

#dynamic-form-fields label {
    font-size: 0.95rem;
    color: #c9a26a;
    font-family: 'Philosopher', serif;
}

/* ИНПУТЫ ДЛЯ DATALIST И ОБЩИЕ ПОЛЯ */
#dynamic-form-fields input[type="text"],
#dynamic-form-fields input[type="number"],
#dynamic-form-fields input[list],
#dynamic-form-fields textarea,
.modal-text-input,
input[type="text"],
input[type="password"],
input[type="number"],
select,
textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 11px 12px;
    background: rgba(0, 0, 0, 0.4) !important;
    border: 1px solid rgba(212, 163, 95, 0.5) !important;
    border-radius: 6px;
    color: #f0d9b0 !important;
    font-size: 16px !important; 
    font-family: Arial, sans-serif;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.modal-window.modal-compact { max-width: 750px; }
.modal-window.modal-compact .modal-scrollable-form-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 16px;
}

@media (min-width: 601px) {
    .modal-window.modal-compact .form-group:nth-last-child(1):nth-child(odd) {
        grid-column: span 2;
    }
}

@media (max-width: 600px) {
    .modal-overlay { padding: 0; }
    .modal-window {
        max-width: 100% !important;
        width: 100% !important;
        height: 100% !important;
        max-height: 100vh !important;
        border-radius: 0;
        border: none;
        padding: 16px;
    }
    .modal-window.modal-compact .modal-scrollable-form-body {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    .layout-fixed-footer {
        position: sticky;
        bottom: 0;
        background: #1e140c;
        margin-top: auto;
        padding-top: 12px;
        border-top: 1px solid rgba(212, 163, 95, 0.2);
        display: grid;
        grid-template-columns: 1fr 1fr;
    }
    .layout-fixed-footer .btn-mesh { width: 100%; }
}

/* АДАПТИВНЫЕ ТАБЛИЦЫ */
.table-glass-section { padding: 0; overflow: hidden; }
.table-responsive-adaptive { width: 100%; }
.responsive-card-table { width: 100%; border-collapse: collapse; }
.responsive-card-table th, .responsive-card-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid rgba(212, 163, 95, 0.15);
}
.responsive-card-table th {
    background: rgba(0, 0, 0, 0.3);
    color: #e4b066;
    font-family: 'Philosopher', serif;
}
.responsive-card-table tbody tr { transition: background 0.2s; }
.responsive-card-table tbody tr:hover { background: rgba(212, 163, 95, 0.04); }

.action-buttons {
    display: flex;
    gap: 6px;
    justify-content: flex-start;
}

@media (max-width: 768px) {
    .responsive-card-table thead { display: none; }
    .responsive-card-table, .responsive-card-table tbody, .responsive-card-table tr, .responsive-card-table td {
        display: block; width: 100%; box-sizing: border-box;
    }
    .responsive-card-table tbody tr {
        margin-bottom: 15px; background: rgba(0, 0, 0, 0.25);
        border: 1px solid rgba(212, 163, 95, 0.2); border-radius: 8px; padding: 8px 0;
    }
    .responsive-card-table td {
        text-align: right; padding: 8px 15px;
        border-bottom: 1px solid rgba(212, 163, 95, 0.08);
        display: flex; justify-content: space-between; align-items: center;
    }
    .responsive-card-table td:last-child {
        border-bottom: none; justify-content: center;
        background: rgba(212, 163, 95, 0.03); margin-top: 5px; padding-top: 12px;
    }
    .responsive-card-table td::before {
        content: attr(data-label); float: left; font-weight: bold;
        color: #c9a26a; font-family: 'Philosopher', serif; padding-right: 10px;
    }
    .action-buttons { width: 100%; justify-content: space-around !important; }
    .btn-action { flex: 1; max-width: 70px; }
}

.records-filter-wrapper {
    display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 15px;
}
.filters-inline-group { display: flex; gap: 12px; flex: 1; min-width: 280px; }
.filter-select-box { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.filter-select-box label { font-size: 0.85rem; color: #c9a26a; }
.add-node-trigger-btn { height: 44px; }

@media (max-width: 768px) {
    .records-filter-wrapper { flex-direction: column; align-items: stretch; }
    .filters-inline-group { width: 100%; }
    .add-node-trigger-btn { width: 100%; }
}

.prefix-input-container {
    display: flex; align-items: center; background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(212, 163, 95, 0.5); border-radius: 6px; width: 100%;
}
.prefix-lock-label {
    background: rgba(212, 163, 95, 0.15); color: #e4b066; padding: 11px 12px;
    font-weight: bold; font-family: monospace; border-right: 1px solid rgba(212, 163, 95, 0.4);
    user-select: none; font-size: 15px; white-space: nowrap;
}
.node-name-suffix-input { border: none !important; background: transparent !important; width: 100%; box-shadow: none !important; }

.pagination { display: flex; justify-content: center; gap: 6px; margin: 20px 0; flex-wrap: wrap; }
.page-link-btn {
    background: rgba(0, 0, 0, 0.3); border: 1px solid rgba(212, 163, 95, 0.3);
    color: #c9a26a; padding: 10px 16px; border-radius: 6px; cursor: pointer; min-height: 40px;
}
.page-link-btn.active { background: #d4a35f; color: #1d1812; font-weight: bold; }

.schema-actions-footer-btns { display: flex; gap: 10px; margin-top: 15px; }
@media (max-width: 480px) {
    .schema-actions-footer-btns { flex-direction: column; }
    .schema-actions-footer-btns .btn-mesh { width: 100%; }
}

.schema-sort-input { max-width: 70px; text-align: center; }
.status-indicator { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 8px; }
.status-online { background-color: #5ac97a; box-shadow: 0 0 8px #5ac97a; }
.status-offline { background-color: #c95a5a; box-shadow: 0 0 8px #c95a5a; }

.mesh-toast {
    position: fixed; top: 20px; left: 50%; transform: translateX(-50%) scale(0.9);
    background: rgba(30, 20, 12, 0.95); border: 2px solid #d4a35f;
    color: #f0d9b0; padding: 12px 25px; border-radius: 8px; z-index: 9999;
    text-align: center; font-size: 1rem; font-family: 'Philosopher', serif;
    opacity: 0; pointer-events: none; transition: all 0.25s ease;
    width: 90%; max-width: 400px; box-sizing: border-box;
}
.mesh-toast.active { opacity: 1; transform: translateX(-50%) scale(1); }

@keyframes modalFadeIn {
    from { transform: scale(0.96); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}