/* =========================================
   STYLE.CSS — ОСНОВНОЙ ДИЗАЙН (DESKTOP)
   ========================================= */

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

html, body {
    width: 100%;
    height: 100vh;
    height: 100dvh;
    margin: 0;
    padding: 0;
    overflow: hidden;
    font-family: 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #e0eafc, #cfdef3);
    
    display: flex;
    flex-direction: column;
}

/* --- ВЕРХНЯЯ ПАНЕЛЬ АДМИНА --- */
.admin-top-panel {
    width: 100%;
    min-height: 60px; 
    background: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 15px;
    border-bottom: 1px solid #ddd;
    z-index: 3000;
    flex-shrink: 0;
}

.admin-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Скрытые элементы */
.column-hidden { display: none !important; }
.mobile-select-container { display: none; }

/* --- ГЛАВНЫЙ КОНТЕЙНЕР --- */
.main-container {
    flex: 1; 
    height: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px;
    width: 100%;
    overflow: hidden;
}

/* --- СЕКЦИЯ ФОРМЫ (РЕГИСТРАЦИЯ) --- */
#formSection {
    background: white;
    padding: 25px;
    border-radius: 20px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 450px;
    margin: auto;
}

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

.form-group { display: flex; gap: 10px; width: 100%; }
.form-group input { flex: 1; min-width: 0; }

input { padding: 12px; border: 1px solid #ddd; border-radius: 8px; width: 100%; }
button { padding: 10px; border: none; border-radius: 10px; font-weight: 600; cursor: pointer; }

/* Кнопки формы */
.form-actions-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 10px;
}
#addBtn { grid-column: span 2; width: 100%; background: #4a90e2; color: white; }
#searchBtn { background: #34495e; color: white; width: 100%; }
#resetBtn { background: #95a5a6; color: white; width: 100%; }
.secondary-btn { background: #3e658c; color: white; width: 100%; margin-top: 15px; }

/* --- СЕКЦИЯ ТАБЛИЦЫ --- */
#tableSection {
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Шапка таблицы (Липкая) */
.sticky-table-header {
    flex-shrink: 0;
    padding: 10px 15px;
    background: white;
    border-bottom: 1px solid #eee;
    z-index: 2000;
}

.nav-controls { display: flex; justify-content: flex-end; margin-bottom: 10px; }
.action-group { display: flex; gap: 10px; }

.table-controls {
    width: 100%;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

/* Кнопки в таблице */
.nav-controls button, .toggle-btn {
    padding: 6px 12px; font-size: 13px; border-radius: 8px; border: none; cursor: pointer;
}
.nav-controls button { color: white; }
#downloadPdfBtn { background: #3498db; }
#printBtn { background: #34495e; }
.filter-active { background: #27ae60 !important; border: 2px solid #2ecc71; }

.toggle-btn { border: 1px solid #ddd; background: #f8f9fa; }
.toggle-btn.active { background: #4a90e2; color: white; }

#modalSearchInput { width: 100%; }

/* Сама Таблица (ПК вид) */
.table-scroll-area { flex: 1; width: 100%; overflow-y: auto; padding: 0 15px 15px; }
table { width: 100%; border-collapse: collapse; }
th { position: sticky; top: 0; background: #4a90e2; color: white; padding: 10px; text-align: left; z-index: 10; }
td { padding: 10px; border-bottom: 1px solid #eee; }

/* Кнопки действий внутри строк */
.edit-btn { background: #f39c12; color: white; padding: 6px 12px; border-radius: 8px; cursor: pointer; }
.del-btn { background: #e74c3c; color: white; padding: 6px 12px; border-radius: 8px; cursor: pointer; }

/* --- МОДАЛЬНЫЕ ОКНА --- */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex; justify-content: center; align-items: center; z-index: 5000;
}
.modal-card {
    background: white; padding: 25px; border-radius: 20px;
    width: 90%; max-width: 350px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}
.modal-actions { display: flex; gap: 10px; margin-top: 20px; }

/* --- ПОИСК С КРЕСТИКОМ --- */
.search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

#modalSearchInput {
    width: 100%;
    padding-right: 30px; 
}

.clear-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #999;
    font-weight: bold;
    font-size: 16px;
    display: none; 
    user-select: none;
    height: auto;
    width: auto;
    background: transparent;
    border: none;
}
.clear-btn:hover { color: #e74c3c; }


/* --- ВЫДЕЛЕНИЕ ИМЕНИ И ФАМИЛИИ (ЖИРНЫМ) --- */
/* ИСПРАВЛЕНО: Применяем только к TD (ячейкам тела), шапку не трогаем! */
#peopleTable td:nth-child(2),
#peopleTable td:nth-child(3) {
    font-weight: 700;
    color: #2c3e50;
    background-color: #fcfcfc;
}

