/* Базовые стили портала (были в вашем style.css) */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #222;
    background-color: #f3f6f4;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.navbar {
    background-color: #2c3e50;
    color: white;
    padding: 1rem 0;
    margin-bottom: 2rem;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    color: white;
    font-size: 1.5rem;
    font-weight: bold;
    text-decoration: none;
}

.nav-links {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.nav-links a {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.nav-links a:hover {
    background-color: #34495e;
}

.nav-links span {
    color: #ecf0f1;
    margin-right: 1rem;
}

.alert {
    padding: 1rem;
    margin: 1rem 0;
    border-radius: 4px;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error,
.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.login-container {
    max-width: 400px;
    margin: 2rem auto;
    padding: 2rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    background-color: #fff;
}

.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 999px;
    cursor: pointer;
    text-decoration: none;
    font-size: 0.95rem;
    transition: background-color 0.2s, box-shadow 0.15s, transform 0.05s;
}

.btn:hover {
    background-color: #2980b9;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    transform: translateY(-1px);
}

.btn-primary {
    background-color: #3498db;
}

.btn-secondary {
    background-color: #e5e7eb;
    color: #111827;
}

.btn-secondary:hover {
    background-color: #d1d5db;
}

.btn-success {
    background-color: #27ae60;
}

.dashboard {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.user-info, .quick-actions, .recent-activity {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eee;
}

.action-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.demo-credentials {
    margin-top: 2rem;
    padding: 1rem;
    background-color: #f8f9fa;
    border-left: 4px solid #3498db;
}

/* === AGRARKA LAYOUT (из test.html) === */

/* Обёртка: сайдбар + контент */
.agro-layout {
    display: flex;
    min-height: 100vh;
}

/* SIDEBAR MENU */
.sidebar {
    width: 280px;
    background: #f0f7f2;
    border-right: 1px solid #d3e7d8;
    overflow-y: auto;
    padding: 16px;
    flex-shrink: 0;
}

.sidebar-header {
    padding: 12px;
    margin-bottom: 16px;
    background: #ffffff;
    border-radius: 8px;
    border: 1px solid #d3e7d8;
}

.sidebar-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: #14532d;
    margin-bottom: 4px;
}

.sidebar-hint {
    font-size: 0.75rem;
    color: #64748b;
}

.menu-item {
    margin-bottom: 6px;
}

.menu-btn {
    width: 100%;
    text-align: left;
    padding: 10px 12px;
    background: #ffffff;
    border: 1px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    color: #1f2933;
    transition: all 0.15s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.menu-btn:hover {
    background: #edf8f0;
    border-color: #c4e1cf;
}

.menu-btn-active {
    background: #dff5e5;
    border-color: #16a34a;
    color: #14532d;
    font-weight: 600;
}

.menu-btn .arrow {
    transition: transform 0.2s ease;
    font-size: 0.7rem;
    color: #6b7280;
}

.menu-btn.expanded .arrow {
    transform: rotate(90deg);
}

.submenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    padding-left: 12px;
    margin-top: 4px;
}

.submenu.open {
    max-height: 500px;
}

.submenu-item {
    padding: 8px 10px;
    background: #f7fbf8;
    border: 1px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    color: #1f2933;
    margin-bottom: 4px;
    transition: all 0.15s ease;
    display: block;          /* добавить */
    text-decoration: none;   /* добавить */
}

.submenu-item:hover {
    background: #edf8f0;
    border-color: #c4e1cf;
}

.submenu-item-active {
    background: #dff5e5;
    border-color: #16a34a;
    color: #14532d;
    font-weight: 600;
}
.submenu-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: #4b5563;
    text-transform: uppercase;
    margin: 8px 4px 4px;
}

.submenu-label-sub {
    font-size: 0.78rem;
    font-weight: 500;
    color: #6b7280;
    text-transform: none;
    margin-top: 10px;
}

/* MAIN CONTENT */
.page {
    flex: 1;
    background: #ffffff;
    padding: 28px 36px;
    overflow-y: auto;
}

.subtitle {
    color: #4b5563;
    margin-bottom: 18px;
    font-size: 0.9rem;
}

.section {
    margin-bottom: 26px;
    padding: 16px 18px 18px;
    border-radius: 10px;
    border: 1px solid #d3e7d8;
    background: #f7fbf8;
}

.section-title {
    margin: 0 0 8px;
    font-size: 1.05rem;
    font-weight: 600;
    color: #14532d;
}

.section-desc {
    margin: 0 0 10px;
    font-size: 0.9rem;
    color: #64748b;
}

/* Формы и таблицы страницы отчёта */
.form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 18px;
    margin-bottom: 10px;
}

.form-group {
    flex: 1 1 220px;
    min-width: 200px;
}

.form-group.full {
    flex-basis: 100%;
}

label {
    display: block;
    font-size: 0.85rem;
    margin-bottom: 4px;
    color: #374151;
}

input[type="text"],
input[type="number"],
textarea,
select {
    width: 100%;
    padding: 6px 8px;
    border-radius: 6px;
    border: 1px solid #cbd5e1;
    font-size: 0.9rem;
    background-color: #fff;
}

input[readonly] {
    background: #e5f3ea;
    cursor: default;
    border-color: #c4e1cf;
}

textarea {
    resize: vertical;
    min-height: 60px;
}

.hint {
    font-size: 0.8rem;
    color: #6b7280;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
    margin-top: 8px;
}

thead {
    background: #e3f1e7;
}

th,
td {
    border: 1px solid #d1e3d6;
    padding: 6px 8px;
    text-align: left;
    vertical-align: middle;
}

th {
    font-weight: 600;
    font-size: 0.85rem;
    color: #14532d;
}

.btn-row {
    margin-top: 10px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Переопределим вид кнопок чуть ближе к макету */
.btn-primary {
    background: #16a34a;
    color: #fff;
}

.btn-primary:hover {
    background: #15803d;
    box-shadow: 0 2px 6px rgba(21,128,61,0.35);
}

.btn-ghost {
    background: transparent;
    border: 1px dashed #9ca3af;
    color: #4b5563;
    padding-inline: 10px;
}

.btn-ghost:hover {
    background: #edf2f7;
}

.footer-actions {
    margin-top: 18px;
    padding-top: 10px;
    border-top: 1px solid #d1e3d6;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

.footer-actions-left,
.footer-actions-right {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

a.link-directory {
    font-size: 0.85rem;
    text-decoration: none;
    color: #166534;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

a.link-directory:hover {
    text-decoration: underline;
}

.checkbox-center {
    text-align: center;
}

@media (max-width: 1024px) {
    .sidebar {
        width: 240px;
    }
}
/* === AGRARKA layout для страницы отчёта по многолетним насаждениям === */

/* Обёртка: сайдбар + контент */
.agro-layout {
    display: flex;
    min-height: 100vh;
}

/* SIDEBAR MENU */
.sidebar {
    width: 280px;
    background: #f0f7f2;
    border-right: 1px solid #d3e7d8;
    overflow-y: auto;
    padding: 16px;
    flex-shrink: 0;
}

.sidebar-header {
    padding: 12px;
    margin-bottom: 16px;
    background: #ffffff;
    border-radius: 8px;
    border: 1px solid #d3e7d8;
}

.sidebar-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: #14532d;
    margin-bottom: 4px;
}

.sidebar-hint {
    font-size: 0.75rem;
    color: #64748b;
}

.menu-item {
    margin-bottom: 6px;
}

.menu-btn {
    width: 100%;
    text-align: left;
    padding: 10px 12px;
    background: #ffffff;
    border: 1px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    color: #1f2933;
    transition: all 0.15s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.menu-btn:hover {
    background: #edf8f0;
    border-color: #c4e1cf;
}

.menu-btn-active {
    background: #dff5e5;
    border-color: #16a34a;
    color: #14532d;
    font-weight: 600;
}

.menu-btn .arrow {
    transition: transform 0.2s ease;
    font-size: 0.7rem;
    color: #6b7280;
}

.menu-btn.expanded .arrow {
    transform: rotate(90deg);
}

.submenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    padding-left: 12px;
    margin-top: 4px;
}

.submenu.open {
    max-height: 500px;
}

.submenu-item {
    padding: 8px 10px;
    background: #f7fbf8;
    border: 1px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    color: #1f2933;
    margin-bottom: 4px;
    transition: all 0.15s ease;
}

.submenu-item:hover {
    background: #edf8f0;
    border-color: #c4e1cf;
}

.submenu-item-active {
    background: #dff5e5;
    border-color: #16a34a;
    color: #14532d;
    font-weight: 600;
}

/* MAIN CONTENT */
.page {
    flex: 1;
    background: #ffffff;
    padding: 28px 36px;
    overflow-y: auto;
}

.subtitle {
    color: #4b5563;
    margin-bottom: 18px;
    font-size: 0.9rem;
}

.section {
    margin-bottom: 26px;
    padding: 16px 18px 18px;
    border-radius: 10px;
    border: 1px solid #d3e7d8;
    background: #f7fbf8;
}

.section-title {
    margin: 0 0 8px;
    font-size: 1.05rem;
    font-weight: 600;
    color: #14532d;
}

.section-desc {
    margin: 0 0 10px;
    font-size: 0.9rem;
    color: #64748b;
}

/* Формы и таблицы страницы отчёта */
.form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 18px;
    margin-bottom: 10px;
}

.form-group {
    flex: 1 1 220px;
    min-width: 200px;
}

.form-group.full {
    flex-basis: 100%;
}

label {
    display: block;
    font-size: 0.85rem;
    margin-bottom: 4px;
    color: #374151;
}

input[type="text"],
input[type="number"],
textarea,
select {
    width: 100%;
    padding: 6px 8px;
    border-radius: 6px;
    border: 1px solid #cbd5e1;
    font-size: 0.9rem;
    background-color: #fff;
}

input[readonly] {
    background: #e5f3ea;
    cursor: default;
    border-color: #c4e1cf;
}

textarea {
    resize: vertical;
    min-height: 60px;
}

.hint {
    font-size: 0.8rem;
    color: #6b7280;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
    margin-top: 8px;
}

thead {
    background: #e3f1e7;
}

th,
td {
    border: 1px solid #d1e3d6;
    padding: 6px 8px;
    text-align: left;
    vertical-align: middle;
}

th {
    font-weight: 600;
    font-size: 0.85rem;
    color: #14532d;
}

.btn-row {
    margin-top: 10px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Кнопки в стиле макета */
.btn-primary {
    background: #16a34a;
    color: #fff;
}

.btn-primary:hover {
    background: #15803d;
    box-shadow: 0 2px 6px rgba(21,128,61,0.35);
}

.btn-ghost {
    background: transparent;
    border: 1px dashed #9ca3af;
    color: #4b5563;
    padding-inline: 10px;
}

.btn-ghost:hover {
    background: #edf2f7;
}

.footer-actions {
    margin-top: 18px;
    padding-top: 10px;
    border-top: 1px solid #d1e3d6;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

.footer-actions-left,
.footer-actions-right {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

a.link-directory {
    font-size: 0.85rem;
    text-decoration: none;
    color: #166534;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

a.link-directory:hover {
    text-decoration: underline;
}

.checkbox-center {
    text-align: center;
}

@media (max-width: 1024px) {
    .sidebar {
        width: 240px;
    }
}
.no-auth-layout {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #f3f6f4;
}

.no-auth-inner {
    width: 100%;
    max-width: 900px;
    padding: 24px;
}


/* Переопределения для длинных подменю и ссылок */
.submenu.open {
    max-height: 2000px;   /* чтобы не резало нижние пункты */
}

.submenu-item {
    display: block;
    text-decoration: none;
}

/* ===== Общие карточки шагов/секций ===== */
.card {
    background: #ffffff;
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

.card h2 {
    font-size: 1.1rem;
    margin-bottom: 8px;
}

.section-hint {
    font-size: 0.9rem;
    color: #6b7280;
    margin-bottom: 12px;
}

/* Подзаголовок под основным H1 */
.subtitle {
    font-size: 0.92rem;
    color: #4b5563;
    margin-bottom: 16px;
}

/* ===== Сетка для полей (2 колонки на десктопе) ===== */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 24px;
}

.form-grid .form-group {
    margin-bottom: 0; /* отступы контролируем через gap */
}

/* на узких экранах — в одну колонку */
@media (max-width: 900px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
}

/* ===== Блок одной культуры ===== */
.culture-block {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 16px;
    background: #f9fafb;
}

.culture-block-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.culture-block-title {
    font-weight: 600;
}

/* ===== Группы показателей внутри культуры ===== */
.fieldset-group {
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 10px 12px 6px;
    margin-bottom: 10px;
    background: #ffffff;
}

.fieldset-group legend {
    padding: 0 4px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #374151;
}

/* Чуть компактнее мелкие поля */
.input-sm {
    padding: 0.35rem 0.5rem;
    font-size: 0.9rem;
}

/* Кнопка "Добавить культуру" под блоками */
.form-actions-inline {
    margin-top: 8px;
}

/* Дополнительные стили кнопок (если нужно) */
.btn-secondary {
    background-color: #6b7280;
    color: #fff;
}

.btn-secondary:hover {
    background-color: #4b5563;
}

.btn-ghost {
    background: transparent;
    color: #6b7280;
    border: 1px solid #d1d5db;
}

.btn-ghost:hover {
    background: #e5e7eb;
}
/* ===== Второй уровень меню ===== */

.menu-sub-item {
    margin-top: 6px;
}

.menu-sub-btn {
    width: 100%;
    background: #f3f4f6;
    border: none;
    padding: 8px 10px;
    font-size: 13px;
    font-weight: 600;
    text-align: left;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    border-radius: 4px;
    color: #1f2937;
}

.menu-sub-btn:hover {
    background: #e5e7eb;
}

.menu-sub-btn.expanded {
    background: #d1fae5;
    color: #065f46;
}

.submenu-level2 {
    margin-left: 10px;
    margin-top: 4px;
}

.submenu-item.level2 {
    padding-left: 20px;
    font-size: 13px;
    background: #f9fafb;
}

.submenu-item.level2:hover {
    background: #e5f3e8;
}

.submenu-item.level2.active {
    background: #bfe3c6;
    font-weight: 600;
    border-left: 3px solid #059669;
}

.submenu-level3 {
    margin-left: 10px;
    margin-top: 4px;
}

.submenu-item.level3 {
    padding-left: 30px;
    font-size: 12px;
    background: #f3f4f6;
}

.submenu-item.level3:hover {
    background: #dbeafe;
}

.submenu-item.level3.active {
    background: #bfdbfe;
    font-weight: 600;
    border-left: 3px solid #2563eb;
}
.data-table td:nth-child(1),
.data-table th:nth-child(1){
    min-width:280px;
    white-space:nowrap;
}

.data-table td:nth-child(3),
.data-table th:nth-child(3){
    min-width:220px;
    white-space:nowrap;
}

/* flex применять только там, где реально есть кнопки действий */
.data-table .action-cell {
    display:flex;
    gap:6px;
    align-items:center;
}
.action-btn{
    display:inline-flex;
    gap:6px;
    align-items:center;
    padding:6px 8px;
    border:1px solid #e5e7eb;
    border-radius:10px;
    background:#fff;
    cursor:pointer;
    font-size:12px;
    white-space:nowrap;
}
.one-line-row{
    display:flex;
    gap:20px;
    align-items:flex-start;   /* было flex-end */
    flex-wrap:nowrap;
}

/* textarea в общей информации по высоте как input */
.one-line-row textarea{
    height: 36px;        /* под твои input padding 6px 8px */
    min-height: 36px;    /* перебивает общий min-height: 60px */
    resize: vertical;    /* можно оставить vertical, или поставить none */
    line-height: 1.2;
}

.one-line-row .form-group {
    flex: 1;
}

.one-line-row .form-group.full {
    flex: 2;
}


#land-resources-table {
    table-layout: fixed;
    width: 100%;
}

#land-resources-table th,
#land-resources-table td {
    vertical-align: middle;
}

#land-resources-table td input,
#land-resources-table td select {
    width: 100%;
    box-sizing: border-box;
}

#land-resources-table .checkbox-center {
    text-align: center;
}

/* Подблоки в таблицах итогов */
.subblock-row td{
    background: #f3f4f6;
    font-weight: 700;
    color: #111827;
    padding: 10px 12px;
    border-top: 2px solid #e5e7eb;
}

.total-row td{
    background: #f9fafb;
    font-weight: 700;
    border-top: 2px solid #e5e7eb;
}


/* === SUMMARY (сводка как на предыдущих страницах) === */
.summary-grid {
    display: grid;
    grid-template-columns: 1fr 260px; /* слева текст, справа поле */
    gap: 10px 16px;
    margin-top: 10px;
}

.summary-label {
    font-size: 0.9rem;
    color: #374151;
    font-weight: 600;
    line-height: 1.25;
    padding-top: 6px;
}

.summary-field input[type="number"],
.summary-field input[type="text"] {
    width: 100%;
}

/* если хочется чуть компактнее поля в сводке */
.summary-field input {
    padding: 6px 8px;
    border-radius: 6px; /* как у полей */
}

/* адаптив: на узких экранах в столбик */
@media (max-width: 860px) {
    .summary-grid {
        grid-template-columns: 1fr;
    }
    .summary-label {
        padding-top: 0;
    }
}
.btn-compact{
  padding: 6px 10px;
  font-size: 13px;
  line-height: 1;
  white-space: nowrap;
}
/* Фиксированная ширина таблицы */
#plantings-table {
  table-layout: fixed;
  width: 100%;
}

#plantings-table .row-num {
  width: 35px !important;
  max-width: 35px !important;
  text-align: center;
  padding: 4px !important;
}

#plantings-table td:first-child,
#plantings-table th:first-child {
  width: 35px !important;
  max-width: 35px !important;
}

/* Стили для загрузки файла */
.contract-file {
  font-size: 0;
  padding: 6px 8px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  cursor: pointer;
  max-width: 100%;
}

.contract-file::-webkit-file-upload-button {
  background: #f3f4f6;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
  margin-right: 0;
}

.contract-file::-webkit-file-upload-button:hover {
  background: #e5e7eb;
}

.file-status {
  font-weight: 500;
}

.contract-hint {
  font-size: 10px !important;
  color: #9ca3af !important;
  margin-top: 2px !important;
  line-height: 1.2;
}

.contract-col {
  min-width: 180px !important;
  max-width: 200px;
}
/* ===== Дополнительные стили для кнопок ===== */

/* Кнопка загрузки отчета */
.btn-load {
    background: #16a34a;
    color: white;
    padding: 8px 20px;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 24px;
    border-radius: 999px;
    transition: all 0.2s ease;
}

.btn-load:hover {
    background: #15803d;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(21, 128, 61, 0.2);
}

.btn-load:active {
    transform: translateY(0);
}

/* Кнопки действий над таблицей */
.btn-action {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    font-size: 0.9rem;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
}

.btn-action-success {
    background: #059669;
    color: white;
}

.btn-action-success:hover:not(:disabled) {
    background: #047857;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(5, 150, 105, 0.2);
}

.btn-action-warning {
    background: #d97706;
    color: white;
}

.btn-action-warning:hover:not(:disabled) {
    background: #b45309;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(217, 119, 6, 0.2);
}

/* Кнопки экспорта */
.btn-export {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    font-size: 0.9rem;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
}

.btn-export-excel {
    background: #059669;
    color: white;
}

.btn-export-excel:hover {
    background: #047857;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(5, 150, 105, 0.2);
}

.btn-export-pdf {
    background: #dc2626;
    color: white;
}

.btn-export-pdf:hover {
    background: #b91c1c;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(220, 38, 38, 0.2);
}

/* Иконки для кнопок */
.btn-icon {
    font-size: 1.1rem;
    line-height: 1;
}

/* Стили для выбора года */
.year-select {
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    background-color: white;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.year-select:focus {
    outline: none;
    border-color: #16a34a;
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.1);
}

.year-select:disabled {
    background-color: #f3f4f6;
    cursor: not-allowed;
}

/* Группа для выбора года и кнопки загрузки */
.year-group {
    display: flex;
    align-items: flex-end;
    gap: 16px;
    flex-wrap: wrap;
}

/* Отключаем transform для disabled кнопок */
.btn:disabled,
.btn-action-success:disabled,
.btn-action-warning:disabled,
.btn-export:disabled,
.btn-load:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* Адаптивность для мобильных */
@media (max-width: 768px) {
    .year-group {
        flex-direction: column;
        align-items: stretch;
    }
    
    .btn-load {
        margin-top: 0;
        justify-content: center;
    }
    
    .footer-actions {
        flex-direction: column;
        gap: 12px;
    }
    
    .footer-actions-left,
    .footer-actions-right {
        justify-content: center;
    }
}


/* Стили для badge статуса */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 20px;
    gap: 4px;
}

.badge-success {
    background-color: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.badge-warning {
    background-color: #fed7aa;
    color: #92400e;
    border: 1px solid #fdba74;
}

.badge-secondary {
    background-color: #e5e7eb;
    color: #374151;
    border: 1px solid #d1d5db;
}

/* ===== Таблицы с прокруткой ===== */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    margin-bottom: 16px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}

/* Фиксированная ширина для таблиц */
.perennials-table {
    min-width: 1200px; /* Минимальная ширина, чтобы все колонки помещались */
    width: 100%;
    border-collapse: collapse;
}

.perennials-table th,
.perennials-table td {
    padding: 8px 10px;
    white-space: nowrap; /* Запрещаем перенос текста */
}

/* Фиксированная ширина колонок */
.perennials-table th:nth-child(1) { width: 40px; }  /* № */
.perennials-table th:nth-child(2) { width: 260px; } /* Кадастр */
.perennials-table th:nth-child(3) { width: 260px; } /* Многолетние */
.perennials-table th:nth-child(4) { width: 340px; } /* Доп. тип */
.perennials-table th:nth-child(5) { width: 110px; } /* Договор */
.perennials-table th:nth-child(6) { width: 130px; } /* Тиражирование */
.perennials-table th:nth-child(7) { width: 90px; }  /* План */
.perennials-table th:nth-child(8) { width: 90px; }  /* Факт */
.perennials-table th:nth-child(9) { width: 90px; }  /* Орошаемые */

/* Стили для ячеек с выбором */
.perennials-table select,
.perennials-table input[type="number"] {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 13px;
}

/* Центрирование чекбоксов */
.perennials-table .checkbox-center {
    text-align: center;
    vertical-align: middle;
}

.perennials-table .irr-cb {
    width: 18px;
    height: 18px;
    margin: 0 auto;
    display: block;
}

/* Стили для кнопки договора */
.perennials-table .contract-btn {
    font-size: 0.85rem;
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid #d1d5db;
    background: #ffffff;
    color: #111827;
    cursor: pointer;
    white-space: nowrap;
    width: 100%;
    max-width: 100px;
    margin: 0 auto;
    display: block;
}

.perennials-table .contract-btn:hover:not(:disabled) {
    background: #f3f4f6;
}

.perennials-table .contract-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.perennials-table .contract-hidden {
    display: none !important;
}

.perennials-table .contract-done {
    background: #eef2ff;
    border-color: #c7d2fe;
}

/* Стили для проп-года */
.perennials-table .prop-year {
    width: 100%;
}

.perennials-table .prop-year:disabled {
    background-color: #f3f4f6;
    cursor: not-allowed;
}

/* Стили для скрытых колонок */
.perennials-table .prop-year-col {
    display: none;
}

.perennials-table .prop-year-col.visible {
    display: table-cell;
}

/* Стили для таблицы осеннего сева */
.autumn-table {
    min-width: 1400px;
    width: 100%;
    border-collapse: collapse;
}

.autumn-table th,
.autumn-table td {
    padding: 8px 10px;
    border: 1px solid #e5e7eb;
    vertical-align: middle;
}

.autumn-table th {
    background-color: #f9fafb;
    font-weight: 600;
}

.autumn-table select,
.autumn-table input[type="number"],
.autumn-table input[type="text"] {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 13px;
}

.autumn-table select:focus,
.autumn-table input:focus {
    outline: none;
    border-color: #16a34a;
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.1);
}

/* Стили для скрытых колонок */
.seed-class-col {
    display: none;
}

.contract-col {
    display: none;
}

/* Кнопка договора */
.contract-btn {
    font-size: 0.85rem;
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid #d1d5db;
    background: #ffffff;
    color: #111827;
    cursor: pointer;
    white-space: nowrap;
    width: 100%;
    max-width: 100px;
    margin: 0 auto;
    display: block;
}

.contract-btn:hover:not(:disabled) {
    background: #f3f4f6;
}

.contract-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.contract-hidden {
    display: none !important;
}

.contract-done {
    background: #eef2ff;
    border-color: #c7d2fe;
}

/* Адаптивность */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    margin-bottom: 16px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}

/* ===== Фиксированный макет для таблиц ввода данных ===== */
/* Без table-layout: fixed браузер игнорирует width на th при автоматическом расчёте */
.postproc-table,
.seeds-table,
.harvest-table,
.yield-table,
.rent-table,
.fin-table,
.debt-table,
.science-table,
.assets-table,
.autumn-table {
    table-layout: fixed;
}

/* Столбец "№" — узкая фиксированная ширина */
.postproc-table td.row-num, .postproc-table th.row-num,
.seeds-table td.row-num, .seeds-table th.row-num,
.harvest-table td.row-num, .harvest-table th.row-num,
.yield-table td.row-num, .yield-table th.row-num,
.rent-table td.row-num, .rent-table th.row-num,
.fin-table td.row-num, .fin-table th.row-num,
.debt-table td.row-num, .debt-table th.row-num,
.science-table td.row-num, .science-table th.row-num,
.assets-table td.row-num, .assets-table th.row-num,
.autumn-table td.row-num, .autumn-table th.row-num {
    width: 40px;
    max-width: 40px;
    min-width: 32px;
    text-align: center;
    padding: 4px 2px;
}

/* #income-table (fin_activity) — переопределяем правило .data-table nth-child(1) */
#income-table {
    table-layout: fixed;
}
#income-table td:nth-child(1),
#income-table th:nth-child(1) {
    min-width: unset;
    width: 40px;
    max-width: 40px;
    text-align: center;
    padding: 4px 2px;
}
/* ===== SIDEBAR LOGOUT ===== */
.sidebar {
    display: flex;
    flex-direction: column;
}

.sidebar-logout {
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid #d3e7d8;
}

.logout-btn {
    display: block;
    width: 100%;
    padding: 10px 14px;
    background: #fff;
    border: 1px solid #fca5a5;
    border-radius: 8px;
    color: #dc2626;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    transition: background 0.15s, color 0.15s;
    box-sizing: border-box;
}

.logout-btn:hover {
    background: #fef2f2;
    border-color: #dc2626;
}
