/* ===== RESET & BASE ===== */
* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    margin: 0;
    padding: 0;
    background: #f5f6f8;
    color: #333;
    line-height: 1.5;
}

a {
    color: #1976d2;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* ===== НАВИГАЦИЯ ===== */
.nav {
    background: #2d5016;
    padding: 0 20px;
    position: relative;
    z-index: 1000;
}

.nav-container {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 8px 0;
}

.nav-logo {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.nav-logo .logo-img {
    height: 45px;
    width: auto;
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 5px;
    margin-left: auto;
}

.nav-menu {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex: 1;
}

.nav-links {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    align-items: center;
}

.nav-links > a {
    color: white;
    text-decoration: none;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 14px;
}

.nav-links > a:hover,
.nav-links > a.active {
    background: rgba(255,255,255,0.2);
}

.nav-btn-add {
    background: #ff9800 !important;
    color: white !important;
    padding: 8px 14px !important;
    border-radius: 4px !important;
    font-weight: 500 !important;
    text-decoration: none;
    font-size: 14px;
    border: 2px solid #ffb74d;
    transition: all 0.2s;
}

.nav-btn-add:hover {
    background: #f57c00 !important;
    border-color: #ffa726;
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-name {
    color: rgba(255,255,255,0.8);
    font-size: 14px;
}

.btn-logout {
    color: white;
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 13px;
    background: rgba(255,255,255,0.1);
}

.btn-logout:hover {
    background: rgba(255,255,255,0.2);
}

/* ===== ВЫПАДАЮЩЕЕ МЕНЮ ===== */
.nav-dropdown {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.nav-dropdown-toggle {
    color: white;
    text-decoration: none;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
}

.nav-dropdown-toggle:hover,
.nav-dropdown-toggle.active {
    background: rgba(255,255,255,0.2);
}

.nav-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    min-width: 200px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    border-radius: 8px;
    z-index: 1001;
    padding: 8px 0;
}

.nav-dropdown:hover .nav-dropdown-menu {
    display: block;
}

.nav-dropdown-menu a {
    display: block;
    padding: 10px 16px;
    color: #333;
    text-decoration: none;
    font-size: 14px;
}

.nav-dropdown-menu a:hover {
    background: #f5f6f8;
}

.nav-dropdown-divider {
    height: 1px;
    background: #ccc;
    margin: 8px 12px;
    display: block;
}

/* Мобильное меню */
@media (max-width: 900px) {
    .nav-container {
        flex-wrap: wrap;
    }
    
    .nav-logo {
        width: 100%;
        text-align: center;
        padding: 10px 0;
        border-bottom: 1px solid rgba(255,255,255,0.2);
    }
    
    .nav-toggle {
        display: block;
        position: absolute;
        right: 20px;
        top: 15px;
    }

    .nav-menu {
        display: none;
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
        padding-top: 10px;
    }

    .nav-menu.open {
        display: flex;
    }

    .nav-links {
        flex-direction: column;
        width: 100%;
        gap: 0;
    }

    .nav-links > a {
        padding: 12px 0;
        border-bottom: 1px solid rgba(255,255,255,0.1);
        border-radius: 0;
        width: 100%;
    }
    
    .nav-btn-add {
        border: none !important;
        border-bottom: 1px solid rgba(255,255,255,0.1) !important;
        border-radius: 0 !important;
    }
    
    .nav-dropdown {
        width: 100%;
        display: block;
    }
    
    .nav-dropdown-toggle {
        padding: 12px 0;
        border-bottom: 1px solid rgba(255,255,255,0.1);
        border-radius: 0;
        display: block;
        width: 100%;
    }
    
    .nav-dropdown-menu {
        display: none;
        position: static;
        box-shadow: none;
        background: rgba(0,0,0,0.2);
        border-radius: 0;
        min-width: 100%;
        padding: 0;
    }
    
    .nav-dropdown.open .nav-dropdown-menu {
        display: block;
    }
    
    .nav-dropdown:hover .nav-dropdown-menu {
        display: none;
    }
    
    .nav-dropdown.open:hover .nav-dropdown-menu {
        display: block;
    }
    
    .nav-dropdown-menu a {
        color: white;
        padding: 12px 20px;
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }
    
    .nav-dropdown-menu a:hover {
        background: rgba(255,255,255,0.1);
    }

    .nav-user {
        margin-top: 15px;
        padding-top: 15px;
        border-top: 1px solid rgba(255,255,255,0.2);
        width: 100%;
        justify-content: space-between;
    }
}

/* Исправление z-index для карты */
.leaflet-control-zoom {
    z-index: 500 !important;
}

.leaflet-top,
.leaflet-bottom {
    z-index: 500 !important;
}

/* ===== КОНТЕЙНЕР ===== */
.container {
    max-width: 1000px;
    margin: 24px auto;
    padding: 0 20px;
}

/* ===== ЗАГОЛОВКИ ===== */
h1 {
    color: #1a1a1a;
    margin: 0 0 20px 0;
    font-size: 26px;
    font-weight: 600;
}

h2 {
    color: #333;
    margin: 0 0 16px 0;
    font-size: 20px;
    font-weight: 600;
}

h3 {
    color: #333;
    margin: 0 0 12px 0;
    font-size: 17px;
    font-weight: 600;
}

/* ===== КНОПКИ ===== */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    background: #2d5016;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.15s;
}

.btn-primary:hover {
    background: #3d6a1e;
    text-decoration: none;
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    background: #f0f0f0;
    color: #333;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.15s;
}

.btn-secondary:hover {
    background: #e0e0e0;
    text-decoration: none;
}

.btn-add {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    background: #4caf50;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.15s;
}

.btn-add:hover {
    background: #43a047;
    text-decoration: none;
}

.btn-add-primary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    background: #2d5016;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.15s;
}

.btn-add-primary:hover {
    background: #3d6a1e;
    text-decoration: none;
}

.btn-cancel {
    display: inline-flex;
    align-items: center;
    padding: 10px 18px;
    background: #f0f0f0;
    color: #555;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
}

.btn-cancel:hover {
    background: #e0e0e0;
    text-decoration: none;
}

.btn-icon {
    width: 36px;
    height: 36px;
    border: none;
    background: #f0f0f0;
    border-radius: 6px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #555;
    font-size: 14px;
    transition: all 0.15s;
}

.btn-icon:hover {
    background: #e0e0e0;
    text-decoration: none;
}

.btn-icon-danger:hover {
    background: #ffebee;
    color: #c62828;
}

/* Старые кнопки для совместимости */
button {
    padding: 10px 18px;
    background: #2d5016;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    white-space: nowrap;
}

button:hover {
    background: #3d6a1e;
}

.btn-delete {
    background: #dc3545;
    padding: 6px 12px;
    border-radius: 6px;
}

.btn-delete:hover {
    background: #c82333;
}

.btn-edit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    background: #f0f0f0;
    color: #555;
    text-decoration: none;
    border-radius: 6px;
    font-size: 14px;
}

.btn-edit:hover {
    background: #e0e0e0;
    text-decoration: none;
}

.btn-edit-small {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: transparent;
    color: #888;
    text-decoration: none;
    border-radius: 4px;
    font-size: 14px;
}

.btn-edit-small:hover {
    background: #e0e0e0;
    color: #333;
    text-decoration: none;
}

.btn-delete-small {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: transparent;
    color: #888;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    padding: 0;
}

.btn-delete-small:hover {
    background: #ffebee;
    color: #c62828;
}

.btn-approve {
    background: #2d5016;
    padding: 6px 12px;
}

.btn-approve:hover {
    background: #3d6a1e;
}

.btn-save {
    background: #2d5016;
    color: white;
}

.btn-save:hover {
    background: #3d6a1e;
}

/* ===== КАРТОЧКИ ===== */
.card {
    background: white;
    border-radius: 10px;
    padding: 20px 24px;
    margin-bottom: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

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

.card-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin: 0;
}

/* ===== ФОРМЫ ===== */
.form-inline {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="password"],
input[type="number"],
input[type="date"],
select,
textarea {
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.15s;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #2d5016;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="password"] {
    flex: 1;
    min-width: 150px;
}

textarea {
    width: 100%;
    min-height: 80px;
    resize: vertical;
}

.form-card {
    max-width: 560px;
    background: white;
    padding: 24px;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.form-edit {
    max-width: 560px;
    background: white;
    padding: 24px;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

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

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    font-size: 14px;
    color: #555;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
}

.form-row {
    display: flex;
    gap: 16px;
}

.form-row .form-group {
    flex: 1;
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.form-hint {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: #888;
}

/* ===== TOOLBAR ===== */
.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 20px;
}

.toolbar-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

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

.search-form input[type="text"] {
    min-width: 220px;
}

/* ===== SUMMARY ===== */
.summary {
    background: white;
    padding: 14px 20px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
    color: #555;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.summary strong {
    color: #333;
}

/* ===== ТАБЛИЦЫ ===== */
.table-wrapper {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    border: 1px solid #e0e0e0;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    background: #f8f9fa;
    padding: 14px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: #666;
    border-bottom: 1px solid #ddd;
    border-right: 1px solid #eee;
}

th:last-child {
    border-right: none;
}

td {
    padding: 14px 16px;
    border-bottom: 1px solid #e8e8e8;
    border-right: 1px solid #f0f0f0;
    font-size: 14px;
    vertical-align: middle;
}

td:first-child {
    white-space: nowrap;
}

/* Для таблиц где нужны переносы в первом столбце (севооборот) */
.allow-wrap-first-col td:first-child {
    white-space: normal;
}

td:last-child {
    border-right: none;
}

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

tbody tr:hover {
    background: #fafafa;
}

.sort-link {
    color: #666;
    text-decoration: none;
    white-space: nowrap;
}

.sort-link:hover {
    color: #333;
    text-decoration: none;
}

.sort-link.active {
    color: #2d5016;
    font-weight: 700;
}

/* ===== СЕЗОНЫ ===== */
.season-card {
    background: white;
    border-radius: 10px;
    margin-bottom: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    overflow: hidden;
}

.season-header {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    cursor: pointer;
    gap: 16px;
    transition: background 0.15s;
}

.season-header:hover {
    background: #f8f9fa;
}

.season-toggle {
    font-size: 12px;
    color: #888;
    width: 16px;
}

.season-title {
    font-size: 18px;
    font-weight: 600;
}

.season-meta {
    color: #888;
    font-size: 14px;
}

.season-actions {
    display: flex;
    gap: 4px;
    margin-left: auto;
}

.events-section {
    border-top: 1px solid #eee;
    padding: 20px;
    background: #fafafa;
}

.events-table {
    font-size: 14px;
}

/* ===== BADGES ===== */
.badge {
    display: inline-block;
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: 500;
}

.badge-default {
    background: #e9ecef;
    color: #495057;
}

.plot-badge {
    background: #e9ecef;
    color: #495057;
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 4px;
}

.tech-card-badge {
    background: #e3f2fd;
    color: #1565c0;
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 4px;
}

/* ===== INFO CARD ===== */
.info-card {
    background: white;
    padding: 20px 24px;
    border-radius: 10px;
    margin-bottom: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.info-row {
    display: flex;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

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

.info-label {
    width: 140px;
    color: #888;
    font-size: 14px;
}

.info-value {
    flex: 1;
    font-size: 14px;
    color: #333;
}

/* ===== FIELD HEADER ===== */
.field-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

/* ===== EMPTY STATE ===== */
.empty-message {
    text-align: center;
    padding: 40px 24px;
    color: #888;
    font-size: 15px;
}

.empty-message-small {
    text-align: center;
    padding: 24px;
    color: #888;
    font-size: 14px;
}

/* ===== SUBTITLE ===== */
.subtitle {
    color: #888;
    font-size: 14px;
    margin-bottom: 20px;
}

.subtitle a {
    color: #2d5016;
}

/* ===== ОТЧЁТЫ ===== */
.report-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.report-table th {
    background: #f8f9fa;
    padding: 12px 10px;
    text-align: left;
    font-weight: 600;
    font-size: 12px;
    color: #555;
    border-bottom: 1px solid #ddd;
    white-space: nowrap;
    cursor: pointer;
}

.report-table th:hover {
    background: #f0f0f0;
}

.report-table th.sorted {
    background: #e8f5e9;
    color: #2d5016;
}

.report-table td {
    padding: 10px;
    border-bottom: 1px solid #eee;
    vertical-align: top;
}

.report-filters {
    background: white;
    padding: 16px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.report-filters select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}

.report-summary {
    background: #e8f5e9;
    padding: 14px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid #2d5016;
}

.report-summary p {
    margin: 0;
    font-size: 15px;
}

.report-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
}

.total-summary {
    background: #e8f5e9;
    padding: 14px 20px;
    border-radius: 8px;
    margin: 20px 0;
    font-size: 15px;
}

.report-empty {
    background: white;
    padding: 48px;
    text-align: center;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.report-empty p {
    color: #888;
    font-size: 15px;
}

/* ===== QUERY BUILDER ===== */
.table-container {
    overflow-x: auto;
}

.results-table {
    border-collapse: collapse;
    min-width: 100%;
    font-size: 13px;
}

.results-table th {
    padding: 12px 10px;
    text-align: left;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    color: #555;
    background: #f8f9fa;
    position: sticky;
    top: 0;
    z-index: 10;
    white-space: nowrap;
    border-bottom: 1px solid #ddd;
}

.results-table td {
    padding: 10px;
    border-bottom: 1px solid #f0f0f0;
}

.results-table tbody tr:hover {
    background: #f8f9fa;
}

/* Столбцы Query Builder */
.evcol-date { width: 90px; }
.evcol-name { width: 150px; }
.evcol-operation { width: 200px; }
.evcol-field { width: 130px; }

.btn-remove-small {
    background: none;
    border: none;
    color: #dc3545;
    font-size: 18px;
    cursor: pointer;
    padding: 5px;
    line-height: 1;
}

.btn-remove-small:hover {
    color: #c82333;
}

.btn-add-cond {
    background: #f0f0f0;
    border: 1px solid #ddd;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    color: #555;
}

.btn-add-cond:hover {
    background: #e0e0e0;
}

.query-block {
    background: white;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    margin-bottom: 16px;
    border-left: 4px solid #e0e0e0;
}

.query-header {
    padding: 14px 20px;
    background: #f8f9fa;
    border-radius: 10px 10px 0 0;
}

.query-name-input {
    border: 1px solid transparent;
    background: transparent;
    font-size: 15px;
    font-weight: 600;
    padding: 6px 8px;
    width: 200px;
    border-radius: 4px;
}

.query-name-input:hover,
.query-name-input:focus {
    border-color: #ddd;
    background: white;
    outline: none;
}

.query-body {
    padding: 20px;
}

.query-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.query-row:last-child {
    margin-bottom: 0;
}

.query-row label {
    min-width: 80px;
    font-weight: 500;
    color: #666;
    font-size: 14px;
}

.query-row select {
    padding: 8px 12px;
}

.cond-select {
    min-width: 150px;
}

.hidden {
    display: none !important;
}

.query-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

#addEventColBtn {
    background: #f0f0f0;
    border: 1px dashed #ccc;
    padding: 8px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    color: #555;
}

#addEventColBtn:hover {
    background: #e8e8e8;
}

/* ===== КАРТА В ОТЧЁТАХ ===== */
.map-header-qb {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 24px 0 16px 0;
    flex-wrap: wrap;
    gap: 10px;
}

.map-header-qb h3 {
    margin: 0;
    font-size: 17px;
}

.map-controls-qb {
    display: flex;
    align-items: center;
    gap: 10px;
}

.toggle-labels {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: normal;
}

.toggle-labels input {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.results-map {
    height: 500px;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    margin-bottom: 16px;
    background: #ffffff;
}

.map-legend {
    background: white;
    padding: 16px;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    margin-bottom: 20px;
}

.legend-title {
    font-weight: 600;
    margin-bottom: 10px;
    font-size: 14px;
}

.legend-items {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.legend-color {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    border: 1px solid rgba(0,0,0,0.1);
}

.legend-color-striped {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    border: 1px solid #333;
    background: repeating-linear-gradient(
        45deg,
        #e41a1c,
        #e41a1c 4px,
        #377eb8 4px,
        #377eb8 8px
    );
}

.field-label-small {
    background: rgba(255,255,255,0.9);
    border: none;
    padding: 2px 6px;
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
    border-radius: 3px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.leaflet-control-attribution {
    display: none !important;
}

/* ===== ПЕЧАТЬ ===== */
@media print {
    .nav, .report-filters, .report-summary, .report-actions, .map-header-qb, .map-legend, .total-summary, h1, .query-builder-form, .table-container {
        display: none !important;
    }
    
    .results-map {
        height: 100vh;
        border-radius: 0;
        box-shadow: none;
        page-break-before: always;
    }
    
    .container {
        max-width: 100%;
        margin: 0;
        padding: 0;
    }
}

/* ===== СОХРАНЁННЫЕ ЗАПРОСЫ ===== */
.saved-queries-section {
    margin-bottom: 20px;
}

.saved-queries-section h3 {
    margin-bottom: 12px;
    font-size: 15px;
}

.saved-queries-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 10px;
    min-height: 40px;
}

.saved-queries-list .loading-text,
.saved-queries-list .empty-text,
.saved-queries-list .error-text {
    color: #888;
    font-size: 13px;
    padding: 5px 0;
}

.saved-queries-list .error-text {
    color: #c00;
}

.saved-query-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    border: 2px solid #4caf50;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 14px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
    transition: all 0.2s;
}

.saved-query-item:hover {
    border-color: #2d5016;
    box-shadow: 0 3px 8px rgba(45,80,22,0.2);
    transform: translateY(-1px);
}

.sq-name {
    cursor: pointer;
    color: #1b5e20;
    font-weight: 600;
}

.sq-name:hover {
    text-decoration: underline;
}

.sq-scope {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 3px;
    text-transform: uppercase;
    font-weight: 500;
}

.sq-scope-global {
    background: #e3f2fd;
    color: #1565c0;
}

.sq-scope-organization {
    background: #fff3e0;
    color: #e65100;
}

.sq-scope-personal {
    background: #f3e5f5;
    color: #7b1fa2;
}

.sq-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0 3px;
    font-size: 14px;
    line-height: 1;
    opacity: 0.5;
}

.sq-btn:hover {
    opacity: 1;
}

.sq-edit {
    color: #1976d2;
}

.sq-delete {
    color: #c62828;
    font-size: 16px;
}

.saved-queries-actions {
    margin-top: 8px;
}

/* ===== МОДАЛЬНЫЕ ОКНА ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.modal-content {
    background: #fff;
    padding: 0;
    border-radius: 12px;
    min-width: 320px;
    max-width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #eee;
}

.modal-header h3 {
    margin: 0;
    font-size: 18px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #888;
    padding: 0;
    line-height: 1;
}

.modal-close:hover {
    color: #333;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding: 16px 24px;
    border-top: 1px solid #eee;
}

.modal-buttons {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 16px;
}

.modal-small {
    max-width: 420px;
    padding: 24px;
}

.modal-small h3 {
    margin: 0 0 16px 0;
    font-size: 18px;
    color: #333;
}

.modal-small .form-group {
    margin-bottom: 16px;
}

.modal-small label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    color: #555;
}

.modal-small textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    resize: vertical;
}

.modal-small textarea:focus {
    outline: none;
    border-color: #2d5016;
}

.modal-small .form-success {
    background: #e8f5e9;
    color: #2d5016;
    padding: 16px;
    border-radius: 8px;
    font-size: 14px;
    text-align: center;
}

/* ===== СТРАНИЦА РЕГИСТРАЦИИ ===== */
.register-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f6f8;
    padding: 20px;
}

.register-card {
    background: white;
    padding: 32px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 400px;
}

.register-logo {
    text-align: center;
    margin-bottom: 24px;
}

.register-logo img {
    height: 60px;
}

.register-title {
    text-align: center;
    margin-bottom: 24px;
    color: #333;
}

/* ===== ПРОЧЕЕ ===== */
.events-count {
    white-space: nowrap;
}

.scrollbar-spacer {
    padding: 0 !important;
}

/* ===== СВОДНАЯ ТАБЛИЦА (REPORT CONTROLS) ===== */
.report-controls {
    background: white;
    border-radius: 10px;
    padding: 20px 24px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    border: 1px solid #e0e0e0;
}

.control-section {
    margin-bottom: 20px;
}

.control-section:last-child {
    margin-bottom: 0;
}

.control-section h3 {
    font-size: 14px;
    font-weight: 600;
    color: #555;
    margin: 0 0 12px 0;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.columns-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.column-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s;
    user-select: none;
}

.column-checkbox:hover {
    background: #eee;
    border-color: #ccc;
}

.column-checkbox.checked {
    background: #e8f5e9;
    border-color: #2d5016;
    color: #2d5016;
}

.column-checkbox input[type="checkbox"] {
    margin: 0;
    width: 14px;
    height: 14px;
}

.filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.filter-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.filter-item label {
    font-size: 12px;
    font-weight: 500;
    color: #666;
}

.filter-item select,
.filter-item input {
    padding: 8px 10px;
    font-size: 14px;
    border: 1px solid #ddd;
    border-radius: 6px;
    width: 100%;
    box-sizing: border-box;
}

.filter-item-wide {
    grid-column: span 2;
}

.date-filter {
    display: flex;
    align-items: center;
    gap: 8px;
}

.date-filter input {
    flex: 1;
    min-width: 0;
}

.date-filter span {
    color: #888;
}

.area-filter {
    display: flex;
    align-items: center;
    gap: 6px;
}

.area-filter select {
    width: 50px;
    padding: 8px 6px;
}

.area-filter input {
    width: 80px;
}

.area-filter span {
    color: #888;
    font-size: 13px;
}

.buttons-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding-top: 16px;
    border-top: 1px solid #eee;
}

.btn-action {
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s;
}

.btn-action.btn-primary {
    background: #2d5016;
    color: white;
}

.btn-action.btn-primary:hover {
    background: #3d6a1e;
}

.btn-action.btn-secondary {
    background: #f0f0f0;
    color: #333;
}

.btn-action.btn-secondary:hover {
    background: #e0e0e0;
}

.results-count {
    margin-left: auto;
    font-size: 14px;
    color: #666;
}

/* Контейнер таблицы отчёта */
.table-container {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    border: 1px solid #e0e0e0;
}

.table-header-wrapper {
    overflow: hidden;
    border-bottom: 2px solid #ddd;
}

.table-header-scroll {
    overflow: hidden;
}

.table-body-wrapper {
    max-height: 500px;
    overflow: auto;
}

.report-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.report-table th {
    background: #f8f9fa;
    padding: 12px 14px;
    text-align: left;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: #555;
    white-space: nowrap;
    cursor: pointer;
    border-right: 1px solid #eee;
}

.report-table th:last-child {
    border-right: none;
}

.report-table th:hover {
    background: #f0f0f0;
}

.report-table th.sorted {
    background: #e8f5e9;
    color: #2d5016;
}

.report-table td {
    padding: 10px 14px;
    font-size: 13px;
    border-bottom: 1px solid #e8e8e8;
    border-right: 1px solid #f0f0f0;
    white-space: nowrap;
}

.report-table td:last-child {
    border-right: none;
}

.report-table tbody tr:hover {
    background: #fafafa;
}

.report-table tbody tr:last-child td {
    border-bottom: none;
}

@media (max-width: 768px) {
    .filters-grid {
        grid-template-columns: 1fr;
    }
    
    .filter-item-wide {
        grid-column: span 1;
    }
    
    .buttons-row {
        flex-direction: column;
        align-items: stretch;
    }
    
    .results-count {
        margin-left: 0;
        text-align: center;
    }
}

/* ===== СТРАНИЦЫ АВТОРИЗАЦИИ ===== */
.auth-container {
    max-width: 400px;
    margin: 60px auto;
    padding: 40px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.1);
}

.auth-logo {
    text-align: center;
    margin-bottom: 24px;
}

.auth-logo img {
    max-width: 180px;
    height: auto;
}

.auth-container h2 {
    text-align: center;
    margin: 0 0 24px 0;
    font-size: 24px;
    color: #333;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.auth-form .form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.auth-form label {
    font-size: 14px;
    font-weight: 500;
    color: #555;
}

.auth-form input {
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 15px;
    transition: border-color 0.15s;
}

.auth-form input:focus {
    outline: none;
    border-color: #2d5016;
}

.auth-form button {
    padding: 14px;
    background: #2d5016;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    margin-top: 8px;
    transition: background 0.15s;
}

.auth-form button:hover {
    background: #3d6a1e;
}

.auth-link {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
    color: #666;
}

.auth-link a {
    color: #2d5016;
    font-weight: 500;
}

.auth-container .success {
    padding: 12px;
    background: #e8f5e9;
    border-left: 3px solid #4caf50;
    border-radius: 4px;
    margin-bottom: 16px;
    font-size: 14px;
    color: #2d5016;
}

.auth-container .error {
    padding: 12px;
    background: #ffebee;
    border-left: 3px solid #f44336;
    border-radius: 4px;
    margin-bottom: 16px;
    font-size: 14px;
    color: #c62828;
}

.auth-register {
    max-width: 450px;
}

.auth-form h3 {
    margin: 20px 0 12px 0;
    font-size: 14px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #eee;
    padding-bottom: 8px;
}

.auth-form h3:first-of-type {
    margin-top: 0;
}

.auth-note {
    margin-top: 16px;
    padding: 12px;
    background: #f5f5f5;
    border-radius: 6px;
    font-size: 13px;
    color: #666;
    text-align: center;
}

/* ===== АДМИНКА ===== */
.admin-badge {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 8px;
    background: rgba(255,255,255,0.2);
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.admin-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
}

.admin-container h1 {
    margin: 0 0 24px 0;
    font-size: 24px;
    color: #333;
}

.admin-container .table-wrapper {
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    overflow: hidden;
}

.admin-container table {
    width: 100%;
    border-collapse: collapse;
}

.admin-container table th {
    background: #f8f9fa;
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 12px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    border-bottom: 1px solid #eee;
}

.admin-container table td {
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
}

.admin-container table tr:hover td {
    background: #f8f9fa;
}

.admin-container table a {
    color: #2d5016;
    font-weight: 500;
}

.status-pending {
    display: inline-block;
    padding: 4px 8px;
    background: #fff3e0;
    color: #e65100;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.status-active {
    display: inline-block;
    padding: 4px 8px;
    background: #e8f5e9;
    color: #2d5016;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.status-blocked {
    display: inline-block;
    padding: 4px 8px;
    background: #ffebee;
    color: #c62828;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.btn-approve {
    padding: 6px 12px;
    background: #2d5016;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
}

.btn-approve:hover {
    background: #3d6a1e;
}

.btn-delete {
    padding: 6px 12px;
    background: #c62828;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
}

.btn-delete:hover {
    background: #d32f2f;
}

/* ===== АЛЕРТЫ ===== */
.alert {
    padding: 14px 18px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
}

.alert-success {
    background: #e8f5e9;
    border-left: 4px solid #4caf50;
    color: #2d5016;
}

.alert-success a {
    color: #2d5016;
    font-weight: 500;
}

.alert-error {
    background: #ffebee;
    border-left: 4px solid #f44336;
    color: #c62828;
}

.alert-warning {
    background: #fff8e1;
    border-left: 4px solid #ff9800;
    color: #e65100;
}

/* Success message в онбординге */
.success-message {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px;
    background: #e8f5e9;
    border-radius: 8px;
    margin-bottom: 24px;
    font-size: 16px;
    color: #2d5016;
}

.success-icon {
    font-size: 24px;
    color: #4caf50;
}

/* ===== EMPTY STATES ===== */
.empty-state-card {
    text-align: center;
    padding: 60px 40px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    max-width: 500px;
    margin: 40px auto;
}

.empty-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.empty-state-card h2 {
    margin: 0 0 12px 0;
    font-size: 22px;
    color: #333;
}

.empty-state-card p {
    margin: 0 0 24px 0;
    color: #666;
    font-size: 15px;
    line-height: 1.5;
}

.empty-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.empty-state-card .hint-box {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #f8f9fa;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 13px;
    color: #666;
}

.empty-state-card .hint-icon {
    font-size: 16px;
}

/* ===== МОБИЛЬНАЯ АДАПТАЦИЯ ===== */

/* Планшеты и крупные телефоны */
@media (max-width: 768px) {
    /* Контейнер */
    .container {
        margin: 16px auto;
        padding: 0 16px;
    }
    
    /* Заголовки */
    h1 {
        font-size: 22px;
        margin-bottom: 16px;
    }
    
    h2 {
        font-size: 18px;
    }
    
    /* Кнопки - увеличенные для тач */
    .btn-primary,
    .btn-secondary,
    .btn-add,
    .btn-cancel {
        padding: 12px 20px;
        font-size: 15px;
        min-height: 44px;
    }
    
    .btn-icon {
        width: 44px;
        height: 44px;
        font-size: 16px;
    }
    
    /* Формы */
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="number"],
    input[type="date"],
    input[type="tel"],
    select,
    textarea {
        padding: 12px;
        font-size: 16px; /* Предотвращает зум на iOS */
        min-height: 44px;
    }
    
    /* Таблицы - горизонтальный скролл */
    .table-wrapper,
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    table {
        min-width: 600px;
    }
    
    table th,
    table td {
        padding: 10px 12px;
        font-size: 13px;
    }
    
    /* Toolbar */
    .toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .toolbar-buttons {
        width: 100%;
        justify-content: stretch;
    }
    
    .toolbar-buttons > * {
        flex: 1;
        text-align: center;
        justify-content: center;
    }
    
    .search-form {
        width: 100%;
    }
    
    .search-form input[type="text"] {
        flex: 1;
        min-width: 0;
    }
    
    /* Карточки */
    .card,
    .info-card,
    .dashboard-card,
    .empty-state-card {
        padding: 20px;
        border-radius: 12px;
    }
    
    /* Авторизация */
    .auth-container {
        margin: 30px 16px;
        padding: 24px;
    }
    
    .auth-container h2 {
        font-size: 20px;
    }
    
    /* Админка */
    .admin-container {
        padding: 16px;
    }
}

/* Телефоны */
@media (max-width: 480px) {
    /* Контейнер */
    .container {
        margin: 12px auto;
        padding: 0 12px;
    }
    
    /* Заголовки */
    h1 {
        font-size: 20px;
    }
    
    h2 {
        font-size: 17px;
    }
    
    h3 {
        font-size: 15px;
    }
    
    /* Кнопки в ряд - вертикально */
    .button-group,
    .actions,
    .form-actions,
    .empty-actions,
    .onboarding-actions {
        flex-direction: column;
        width: 100%;
    }
    
    .button-group > *,
    .actions > *,
    .form-actions > *,
    .empty-actions > *,
    .onboarding-actions > * {
        width: 100%;
        justify-content: center;
    }
    
    /* Формы - полная ширина */
    .form-row {
        flex-direction: column;
    }
    
    .form-group {
        width: 100%;
    }
    
    /* Фильтры */
    .filters {
        padding: 16px;
    }
    
    .filter-row {
        flex-direction: column;
        gap: 12px;
    }
    
    /* Карточки */
    .empty-state-card {
        padding: 30px 20px;
    }
    
    .empty-icon {
        font-size: 48px;
    }
    
    .empty-state-card h2 {
        font-size: 18px;
    }
    
    .empty-state-card p {
        font-size: 14px;
    }
    
    /* Авторизация */
    .auth-container {
        margin: 20px 12px;
        padding: 20px;
        border-radius: 8px;
    }
    
    .auth-logo img {
        max-width: 140px;
    }
    
    /* Модальные окна - полноэкранные */
    .modal-content {
        width: 100%;
        max-width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
        margin: 0;
    }
    
    .modal-overlay {
        padding: 0;
    }
    
    /* Page header */
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .page-header-actions {
        width: 100%;
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .page-header-actions > * {
        flex: 1;
        min-width: 120px;
        justify-content: center;
    }
}

/* Стили для списка полей на мобильных */
@media (max-width: 600px) {
    .field-list .field-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        padding: 16px;
    }
    
    .field-item-info {
        width: 100%;
    }
    
    .field-item-actions {
        width: 100%;
        display: flex;
        gap: 8px;
    }
    
    .field-item-actions > * {
        flex: 1;
    }
}

/* Карта на мобильных */
@media (max-width: 768px) {
    .map-page {
        flex-direction: column;
    }
    
    .map-sidebar {
        width: 100%;
        max-height: 40vh;
        order: 2;
    }
    
    .map-container {
        height: 50vh;
        min-height: 300px;
        order: 1;
    }
    
    #map {
        height: 100%;
    }
    
    .map-controls {
        flex-wrap: wrap;
    }
}

/* Севооборот на мобильных */
@media (max-width: 768px) {
    .crop-rotation-table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .crop-rotation-table th,
    .crop-rotation-table td {
        min-width: 80px;
        padding: 8px;
        font-size: 12px;
    }
    
    .crop-rotation-table th:first-child,
    .crop-rotation-table td:first-child {
        position: sticky;
        left: 0;
        background: white;
        z-index: 1;
        min-width: 120px;
    }
}

/* Техкарты на мобильных */
@media (max-width: 768px) {
    .tc-header {
        flex-direction: column;
        gap: 16px;
    }
    
    .tc-header-actions {
        width: 100%;
        display: flex;
        gap: 8px;
    }
    
    .tc-header-actions > * {
        flex: 1;
    }
    
    .tc-table {
        display: block;
        overflow-x: auto;
    }
    
    .tc-add-form .form-row {
        flex-direction: column;
    }
    
    .tc-add-form .form-row > * {
        width: 100%;
    }
}

/* План работ на мобильных */
@media (max-width: 768px) {
    .work-plan-header {
        flex-direction: column;
        gap: 12px;
    }
    
    .work-plan-filters {
        flex-wrap: wrap;
        width: 100%;
    }
    
    .work-plan-filters > * {
        flex: 1;
        min-width: 100px;
    }
    
    .operation-group-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .operation-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .operation-item-actions {
        width: 100%;
        display: flex;
        gap: 8px;
    }
    
    .operation-item-actions > * {
        flex: 1;
    }
}

/* Отчёты на мобильных */
@media (max-width: 600px) {
    .reports-list {
        grid-template-columns: 1fr;
    }
    
    .report-card {
        padding: 14px;
    }
    
    .report-icon {
        font-size: 24px;
    }
}

/* Quick access на дашборде */
@media (max-width: 600px) {
    .quick-access {
        flex-direction: column;
    }
    
    .quick-btn {
        width: 100%;
        justify-content: center;
    }
}

/* Улучшенный тач для чекбоксов и радио */
@media (max-width: 768px) {
    input[type="checkbox"],
    input[type="radio"] {
        width: 20px;
        height: 20px;
        margin-right: 8px;
    }
    
    label {
        display: flex;
        align-items: center;
        padding: 8px 0;
    }
}

/* Прокрутка внутри модалок */
@media (max-width: 480px) {
    .modal-content {
        overflow-y: auto;
        padding: 20px;
    }
    
    .modal-buttons {
        position: sticky;
        bottom: 0;
        background: white;
        padding: 16px 0;
        margin: 0 -20px -20px;
        padding-left: 20px;
        padding-right: 20px;
        border-top: 1px solid #eee;
    }
}

/* Безопасные зоны для iPhone с notch */
@supports (padding: max(0px)) {
    .nav {
        padding-left: max(20px, env(safe-area-inset-left));
        padding-right: max(20px, env(safe-area-inset-right));
    }
    
    .container {
        padding-left: max(16px, env(safe-area-inset-left));
        padding-right: max(16px, env(safe-area-inset-right));
    }
}

/* ===== Печать таблиц ===== */
.print-table-area {
    display: none;
}

body.print-table-mode .print-table-area {
    display: block;
}

@media print {
    body.print-table-mode > *:not(.print-table-area) {
        display: none !important;
    }
    
    body.print-table-mode .print-table-area {
        display: block !important;
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        background: white;
    }
    
    body.print-table-mode .print-table-area table {
        width: 100%;
        border-collapse: collapse;
        font-size: 11px;
    }
    
    body.print-table-mode .print-table-area th,
    body.print-table-mode .print-table-area td {
        border: 1px solid #333;
        padding: 6px 8px;
        text-align: left;
    }
    
    body.print-table-mode .print-table-area th {
        background: #f0f0f0 !important;
        font-weight: 600;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
}
