/* ==========================================================================
   Общие стили — современный, чистый, профессиональный
   ========================================================================== */

:root {
    --primary: #2c3e50;
    --accent: #3498db;
    --success: #2ecc71;
    --warning: #f39c12;
    --danger: #e74c3c;
    --light: #f8f9fa;
    --white: #ffffff;
    --gray-200: #e9ecef;
    --gray-600: #6c757d;
    --gray-900: #212529;
    --border: #dee2e6;
    --shadow: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-lg: 0 4px 12px rgba(0,0,0,0.08);
}

* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--light);
    color: var(--gray-900);
    margin: 0;
    padding: 20px;
    font-size: 16px;
    line-height: 1.6;
}

/* Навигация */
.nav {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 16px 20px;
    background: var(--white);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    margin-bottom: 24px;
}

.nav a {
    text-decoration: none;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 8px;
    transition: all 0.2s ease;
    color: var(--accent);
}

.nav a:hover {
    background: rgba(52, 152, 219, 0.1);
}

.nav a.logout {
    color: var(--danger);
    margin-left: auto;
}

.nav a.logout:hover {
    background: rgba(231, 76, 60, 0.1);
}

/* Заголовки */
h2 {
    color: var(--primary);
    font-size: 28px;
    margin: 0 0 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--accent);
}

h3 {
    color: var(--primary);
    font-size: 22px;
    margin: 32px 0 16px;
}

/* Кнопки */
.btn {
    font-family: inherit;
    font-weight: 600;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-primary {
    background: var(--accent);
    color: white;
}

.btn-primary:hover {
    background: #2980b9;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(52, 152, 219, 0.3);
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-success:hover {
    background: #27ae60;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(46, 204, 113, 0.3);
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: #c0392b;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(231, 76, 60, 0.3);
}

.btn-warning {
    background: var(--warning);
    color: white;
}

.btn-warning:hover {
    background: #e67e22;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(243, 156, 18, 0.3);
}

/* Формы */
.form-group {
    display: contents;
}

.form-group label {
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--primary);
    font-size: 15px;
}

input[type="text"],
input[type="date"],
input[type="file"] {
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 16px;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
}

input[type="text"]:focus,
input[type="date"]:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

.note {
    font-size: 13px;
    color: var(--gray-600);
    margin-top: 6px;
}

/* Кастомный выпадающий список */
.custom-dropdown {
    position: relative;
    width: 100%;
}

.custom-dropdown .dropdown-input {
    width: 100%;
    padding: 12px 40px 12px 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 16px;
    font-family: inherit;
    cursor: pointer;
    background: white;
    transition: border-color 0.2s;
}

.custom-dropdown .dropdown-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

.custom-dropdown .arrow {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%) rotate(0deg);
    pointer-events: none;
    color: var(--gray-600);
    transition: transform 0.2s ease;
    font-size: 18px;
}

.custom-dropdown.open .arrow {
    transform: translateY(-50%) rotate(180deg);
    color: var(--accent);
}

.custom-dropdown .dropdown-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 8px 8px;
    max-height: 240px;
    overflow-y: auto;
    z-index: 1000;
    list-style: none;
    padding: 0;
    margin: 0;
    display: none;
    box-shadow: var(--shadow-lg);
}

.custom-dropdown.open .dropdown-list {
    display: block;
}

.custom-dropdown .dropdown-list li {
    padding: 12px 16px;
    cursor: pointer;
    color: var(--gray-900);
    font-size: 16px;
    transition: background 0.2s;
}

.custom-dropdown .dropdown-list li:hover,
.custom-dropdown .dropdown-list li.highlight {
    background: #f0f8ff;
    color: var(--accent);
}

/* Таблицы */
table {
    width: 100%;
    border-collapse: collapse;
    background: var(--white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    margin: 20px 0;
}

th,
td {
    padding: 16px;
    text-align: left;
    border-bottom: 1px solid var(--gray-200);
}

th {
    background: var(--primary);
    color: white;
    font-weight: 600;
    font-size: 16px;
}

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background: #f8f9fa;
}

/* Кнопки действий */
.action-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    color: white;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.action-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.preview-btn { background: var(--accent); }
.preview-btn:hover { background: #2980b9; }

.download-btn { background: #9b59b6; }
.download-btn:hover { background: #8e44ad; }

.edit-btn { background: var(--success); }
.edit-btn:hover { background: #27ae60; }

/* Сообщения */
.no-results {
    text-align: center;
    padding: 40px 20px;
    color: var(--gray-600);
    font-size: 18px;
    background: var(--white);
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.results-count {
    background: var(--white);
    padding: 12px 20px;
    border-radius: 12px;
    font-weight: 600;
    color: var(--primary);
    box-shadow: var(--shadow);
    display: inline-block;
    margin: 20px 0;
}

/* Drag & Drop */
.drop-area {
    border: 2px dashed var(--accent);
    border-radius: 12px;
    padding: 40px;
    text-align: center;
    background: #f0f8ff;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 20px 0;
}

.drop-area.highlight {
    background: #d4e9ff;
    border-color: var(--primary);
}

.drop-area p {
    margin: 10px 0;
    color: var(--gray-600);
    font-size: 18px;
}

/* Загрузка */
.loading {
    text-align: center;
    padding: 20px;
}

.spinner {
    border: 4px solid rgba(0,0,0,0.1);
    border-top: 4px solid var(--accent);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

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

/* Модальные окна */
#editModal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    padding: 20px;
}

#editModal > div {
    background: var(--white);
    max-width: 600px;
    margin: 40px auto;
    padding: 30px;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    max-height: 80vh;
    overflow-y: auto;
}

/* Адаптивность */
@media (max-width: 768px) {
    .nav {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .nav a.logout {
        margin-left: 0;
        margin-top: 10px;
    }
    
    table, 
    .table-wrapper {
        overflow-x: auto;
    }
    
    .form-group {
        flex-direction: column;
    }
    
    label {
        margin-bottom: 8px !important;
    }
}

/* Шапка */

.header_logo {
    background-color: #0b2e68;
}

.logo-image {
    padding: 10px;
    width: 33%;
    
}

.preview-btn {
    background: #0b2e68;
}
.download-btn {
    background: #878787;
}
.download-btn:hover {
    background:#3498db;
}


.footer-aps {
    display: flex
;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: var(--white);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    margin-bottom: 14px;
    margin-top: 10px;
}



.footer-aps a {
    text-decoration: none;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 8px;
    transition: all 0.2s ease;
    color: var(--accent);
}