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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #f0f2f5;
    color: #1a1a1a;
}

.screen { display: none; }
.screen.active { display: block; }
.hidden { display: none !important; }
.placeholder { color: #aaa; padding: 32px; text-align: center; }

/* ── Login ────────────────────────────────────────────────────────── */
#login-screen {
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #2d8a4e 0%, #1a5c32 100%);
}
#login-screen.active { display: flex; }

.login-card {
    background: #fff;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.15);
    width: 360px;
    text-align: center;
}
.login-card h1 { color: #2d8a4e; margin-bottom: 4px; font-size: 28px; }
.login-card .subtitle { color: #666; margin-bottom: 24px; font-size: 14px; }
.login-card input {
    width: 100%; padding: 12px 16px; margin-bottom: 12px;
    border: 1px solid #ddd; border-radius: 8px; font-size: 15px;
}
.login-card button {
    width: 100%; padding: 12px; background: #2d8a4e; color: #fff;
    border: none; border-radius: 8px; font-size: 16px; cursor: pointer;
}
.login-card button:hover { background: #246e3e; }
.error { color: #d32f2f; margin-top: 12px; font-size: 14px; }

/* ── Header ───────────────────────────────────────────────────────── */
header {
    background: #fff;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    position: sticky;
    top: 0;
    z-index: 100;
}
.header-left h2 { color: #2d8a4e; font-size: 18px; white-space: nowrap; }
#main-nav { display: flex; gap: 4px; flex: 1; }
.nav-btn {
    padding: 7px 14px; border: none; background: transparent;
    cursor: pointer; border-radius: 6px; font-size: 14px; color: #555;
}
.nav-btn:hover { background: #e8f5e9; }
.nav-btn.active { background: #2d8a4e; color: #fff; }
.header-right { display: flex; align-items: center; gap: 10px; white-space: nowrap; }
#user-info { font-size: 13px; color: #555; }
#logout-btn {
    padding: 5px 12px; border: 1px solid #ddd; background: #fff;
    border-radius: 6px; cursor: pointer; font-size: 13px;
}
#logout-btn:hover { background: #f5f5f5; }

/* ── Main layout ──────────────────────────────────────────────────── */
main { padding: 20px 20px 40px; }
.tab { display: none; }
.tab.active { display: block; }
h3 { margin-bottom: 16px; font-size: 20px; }

/* ── Generic table ────────────────────────────────────────────────── */
table {
    width: 100%; border-collapse: collapse;
    background: #fff; border-radius: 8px;
    overflow: hidden; box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
thead { background: #f8f9fa; }
th, td { padding: 9px 13px; text-align: left; border-bottom: 1px solid #eee; font-size: 14px; }
th { font-weight: 600; color: #555; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: #fafafa; }

.badge { padding: 3px 9px; border-radius: 12px; font-size: 12px; font-weight: 500; }
.badge-active { background: #e8f5e9; color: #2e7d32; }
.badge-needs-norm { background: #fff3e0; color: #e65100; }
.badge-inactive { background: #f5f5f5; color: #999; }

/* ── Harvest ──────────────────────────────────────────────────────── */
.harvest-controls, .bonus-controls {
    margin-bottom: 16px; display: flex; gap: 16px; align-items: center;
}
.harvest-controls input, .bonus-controls input {
    padding: 7px 11px; border: 1px solid #ddd; border-radius: 6px; font-size: 14px;
}
.bonus-controls button {
    padding: 7px 16px; background: #2d8a4e; color: #fff;
    border: none; border-radius: 6px; cursor: pointer; font-size: 14px;
}
.harvest-input {
    width: 90px; padding: 5px 9px; border: 1px solid #ddd;
    border-radius: 6px; font-size: 14px; text-align: right;
}
.save-btn {
    padding: 4px 11px; background: #2d8a4e; color: #fff;
    border: none; border-radius: 4px; cursor: pointer; font-size: 13px;
}
.save-btn:disabled { background: #ccc; cursor: default; }
.pct-good { color: #2e7d32; } .pct-warn { color: #f9a825; } .pct-bad { color: #d32f2f; }

/* ── Bonus ────────────────────────────────────────────────────────── */
.bonus-header {
    display: flex; gap: 28px; background: #fff;
    padding: 14px 18px; border-radius: 8px; margin-bottom: 16px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06); font-size: 15px;
}
.bonus-header strong { font-size: 17px; }
.zone-norm { color: #2e7d32; } .zone-yellow { color: #f9a825; font-weight: 600; }
.zone-red { color: #d32f2f; font-weight: 600; }
.zone-critical { color: #fff; background: #d32f2f; padding: 2px 7px; border-radius: 4px; font-weight: 700; }

/* ── Tasks ────────────────────────────────────────────────────────────────── */
.tasks-toolbar {
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
    padding: 8px 12px; border-bottom: 1px solid #eee; background: #fff;
}
.tasks-date-filter {
    display: flex; align-items: center; gap: 6px;
}
.tasks-toolbar .btn-primary {
    margin-left: auto;
}
.task-card-overdue {
    border: 2px solid #d32f2f !important;
    background: #fff5f5 !important;
}
.task-card-overdue .task-card-title {
    color: #d32f2f;
    font-weight: 700;
}
.task-card-overdue .task-card-top::before {
    content: "⚠ Просрочена";
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    color: #fff;
    background: #d32f2f;
    border-radius: 4px;
    padding: 1px 6px;
    margin-right: 6px;
}
.tasks-date-label { font-size: 13px; color: #555; font-weight: 500; }
.tasks-date-inp {
    padding: 5px 8px; border: 1px solid #ccc; border-radius: 6px;
    font-size: 13px; color: #222; cursor: pointer;
}
.tasks-date-inp:focus { outline: none; border-color: #1976D2; }
.tasks-date-clear {
    padding: 4px 10px; border: 1px solid #ccc; border-radius: 6px;
    background: #f5f5f5; color: #555; font-size: 12px; cursor: pointer;
}
.tasks-date-clear:hover { background: #e0e0e0; }

/* ── Kanban board ─────────────────────────────────────────────────── */
.kanban-board {
    display: flex;
    align-items: stretch;
    flex: 1;
    overflow: hidden;
    min-height: 0;
}
.kanban-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #e0e0e0;
    min-width: 0;
    overflow: hidden;
}
.kanban-col:last-child { border-right: none; }
.kanban-col-header {
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 700;
    border-bottom: 3px solid;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.kanban-count {
    background: rgba(0,0,0,0.10);
    border-radius: 10px;
    padding: 1px 7px;
    font-size: 11px;
    font-weight: 600;
}
.kanban-cards {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.kanban-empty {
    color: #bbb; text-align: center;
    padding: 28px 8px; font-size: 13px;
}
.task-card {
    background: #fff; border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.07);
    cursor: pointer; display: flex; overflow: hidden;
    transition: box-shadow 0.15s, transform 0.1s;
}
.task-card:hover { box-shadow: 0 3px 12px rgba(0,0,0,0.13); transform: translateY(-1px); }
.task-priority-bar { width: 5px; background: var(--pcolor, #999); flex-shrink: 0; }
.task-card-body { flex: 1; padding: 10px 12px; min-width: 0; }
.task-card-top {
    display: flex; justify-content: space-between; align-items: center;
    gap: 6px; margin-bottom: 5px;
}
.task-op-badge {
    font-size: 11px; background: #f0f4f8; color: #555;
    padding: 2px 7px; border-radius: 10px; white-space: nowrap;
}
.task-status-badge {
    font-size: 11px; color: #fff; padding: 2px 7px; border-radius: 10px; white-space: nowrap;
}
.task-card-title {
    font-size: 14px; font-weight: 600; margin-bottom: 4px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.task-card-location {
    font-size: 12px; color: #777; margin-bottom: 5px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.task-card-footer {
    display: flex; justify-content: space-between; align-items: center;
    font-size: 12px; color: #888; gap: 6px;
}
.task-assignee { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; }
.task-due     { color: #888; white-space: nowrap; }
.task-overdue { color: #d32f2f; font-weight: 600; white-space: nowrap; }

/* Task detail modal */
.modal-box-wide { width: 480px; max-width: 96vw; }
.modal-body-scroll { max-height: 70vh; overflow-y: auto; }

.task-detail-status {
    padding: 7px 14px; text-align: center; color: #fff;
    font-weight: 600; font-size: 14px; border-radius: 6px; margin-bottom: 12px;
}
.task-detail-section {
    background: #f8f9fa; border-radius: 6px; padding: 8px 12px; margin-bottom: 10px;
}
.task-detail-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 5px 0; font-size: 13px; border-bottom: 1px solid #eee; gap: 8px;
}
.task-detail-row:last-child { border-bottom: none; }
.task-detail-row > span:first-child { color: #888; flex-shrink: 0; }
.task-detail-desc {
    font-size: 13px; color: #444; background: #fff;
    border: 1px solid #eee; border-radius: 6px;
    padding: 8px 12px; margin-bottom: 10px; white-space: pre-wrap;
}
.task-detail-report {
    background: #e8f5e9; border-radius: 6px; padding: 10px 12px; margin-bottom: 10px;
}
.task-report-label {
    font-size: 11px; font-weight: 700; color: #2e7d32;
    text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 6px;
}
.task-report-photo {
    width: 100%; max-height: 220px; object-fit: cover;
    border-radius: 4px; margin-bottom: 6px; cursor: pointer;
}
.task-report-comment { font-size: 13px; color: #333; white-space: pre-wrap; }
.task-rejection-note {
    background: #fdecea; border: 1px solid #ef9a9a; border-radius: 6px;
    padding: 8px 12px; font-size: 13px; color: #d32f2f; margin-bottom: 10px;
}
.task-report-form { margin-top: 10px; }
.task-report-form textarea {
    width: 100%; padding: 8px 10px; border: 1px solid #ddd; border-radius: 6px;
    font-size: 13px; font-family: inherit; resize: vertical;
    margin-bottom: 8px; box-sizing: border-box;
}
.task-photo-label {
    font-size: 13px; color: #555; display: flex; align-items: center; gap: 8px; cursor: pointer;
}
.task-photo-label input { font-size: 12px; }
.task-reject-form textarea {
    width: 100%; padding: 8px 10px; border: 1px solid #ef9a9a; border-radius: 6px;
    font-size: 13px; font-family: inherit; resize: vertical; box-sizing: border-box;
}
.task-delete-btn { margin-right: auto; }

/* ── Reference / Справочник ───────────────────────────────────────────────── */
.ref-header { margin-bottom: 4px; }
.ref-subtitle { color: #888; font-size: 13px; margin: 4px 0 0; }

.ref-section { margin-bottom: 32px; }
.ref-section-hd {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 0 10px; border-bottom: 2px solid #e8f5e9; margin-bottom: 0;
}
.ref-section-icon { font-size: 20px; line-height: 1; }
.ref-section-hd h4 { margin: 0; font-size: 16px; font-weight: 700; color: #1a1a1a; }
.ref-section-sub { color: #999; font-size: 12px; margin-left: 4px; }
.ref-table-wrap { overflow-x: auto; }
.ref-table { width: 100%; border-collapse: collapse; }
.ref-table th {
    text-align: left; font-size: 12px; font-weight: 600; color: #666;
    padding: 9px 12px; border-bottom: 1px solid #e0e0e0;
    white-space: nowrap; background: #fafafa;
}
.ref-table td {
    padding: 8px 12px; border-bottom: 1px solid #f0f0f0;
    font-size: 13px; vertical-align: middle;
}
.ref-table tr:last-child td { border-bottom: none; }
.ref-table tr:hover td { background: #fafff8; }
.ref-table-micro th:not(:first-child) { text-align: center; }
.ref-table-micro td:not(:first-child) { text-align: center; }
.ref-edit-ro { color: #444; font-weight: 500; }

/* Flowers wide table */
.ref-table-flowers { min-width: 1100px; }
.ref-th-name { min-width: 140px; }
.ref-th-group {
    text-align: center; font-size: 11px; font-weight: 700; letter-spacing: 0.04em;
    text-transform: uppercase; border-bottom: 2px solid #e0e0e0; padding: 6px 8px;
}
.ref-th-input { background: #f1f8ff; color: #1565c0; border-left: 2px solid #bbdefb; }
.ref-th-calc  { background: #f1f8e9; color: #33691e; border-left: 2px solid #c5e1a5; }
.ref-calc-sep { border-left: 2px solid #c5e1a5; background: #fafff3; }
.ref-calc-val  { color: #2e7d32; font-weight: 600; }
.ref-calc-seeds { color: #e65100; font-weight: 700; }
.ref-table-flowers td { padding: 7px 8px; white-space: nowrap; }
.ref-table-flowers th { padding: 6px 8px; white-space: nowrap; font-size: 11px; }
.ref-name-cell { white-space: nowrap; min-width: 130px; }
.ref-sel-inp {
    font-size: 12px; padding: 3px 5px; border: 1px solid #ddd; border-radius: 4px;
    max-width: 130px; background: #fff;
}
.ref-lifespan-unit {
    font-size: 11px; padding: 3px 4px; border: 1px solid #ddd; border-radius: 4px;
    background: #fff;
}

.culture-dot {
    display: inline-block; width: 10px; height: 10px;
    border-radius: 50%; margin-right: 8px; vertical-align: middle; flex-shrink: 0;
}
.norm-cell-wrap { display: flex; align-items: center; gap: 6px; }
.norm-input {
    width: 80px; padding: 5px 8px;
    border: 1px solid #ddd; border-radius: 5px; font-size: 13px;
    text-align: right;
}
.norm-input:focus { outline: none; border-color: #2d8a4e; box-shadow: 0 0 0 2px #e8f5e9; }
.save-norm-btn {
    padding: 5px 10px; background: #2d8a4e; color: #fff;
    border: none; border-radius: 5px; cursor: pointer; font-size: 12px; white-space: nowrap;
}
.save-norm-btn:hover { background: #246e3e; }
.save-norm-btn:disabled { background: #aaa; cursor: default; }
.ref-no-data { color: #bbb; font-size: 12px; }
.ref-actual-val { color: #555; }
.ref-plan-val { font-weight: 600; color: #1a1a1a; }
.ref-fact-val { color: #2d8a4e; font-weight: 600; }

/* ── Bonus period label ────────────────────────────────────────────────────── */
.bonus-period-label { font-size: 14px; color: #2d8a4e; font-weight: 600; }

/* ══════════════════════════════════════════════════════════════════
   MAP
══════════════════════════════════════════════════════════════════ */
.map-page-header {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}
.map-page-header h3 { margin: 0; white-space: nowrap; }

/* Line tabs */
#map-line-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.line-tab {
    padding: 6px 14px; border: 1.5px solid #ddd;
    background: #fff; border-radius: 20px;
    cursor: pointer; font-size: 13px; color: #555;
    transition: all 0.15s;
}
.line-tab:hover { border-color: #2d8a4e; color: #2d8a4e; }
.line-tab.active { background: #2d8a4e; border-color: #2d8a4e; color: #fff; }

/* Line summary bar */
.line-summary {
    display: flex; gap: 20px; align-items: center;
    background: #fff; border-radius: 8px; padding: 10px 16px;
    margin-bottom: 14px; font-size: 13px; color: #555;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.line-summary strong { color: #2d8a4e; font-size: 15px; }

/* Blocks scroll container */
.blocks-scroll {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 12px;
    align-items: flex-start;
}
.blocks-scroll::-webkit-scrollbar { height: 6px; }
.blocks-scroll::-webkit-scrollbar-track { background: #f0f0f0; border-radius: 3px; }
.blocks-scroll::-webkit-scrollbar-thumb { background: #bbb; border-radius: 3px; }

/* Block card */
.block-card {
    background: #fff;
    border-radius: 8px;
    padding: 10px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.07);
    flex-shrink: 0;
    min-width: 0;
}
.block-label {
    font-size: 11px; font-weight: 700; color: #666;
    text-align: center; margin-bottom: 8px;
    text-transform: uppercase; letter-spacing: 0.3px;
}

/* Shelves side by side */
.shelves-row {
    display: flex;
    gap: 6px;
    align-items: flex-start;
}

/* Single shelf column */
.shelf-col { display: flex; flex-direction: column; gap: 3px; align-items: center; }
.shelf-label {
    font-size: 9px; color: #aaa; margin-bottom: 2px;
    text-transform: uppercase; letter-spacing: 0.2px;
}

/* Tier row inside shelf */
.tier-row { display: flex; align-items: center; gap: 3px; }
.tier-num {
    font-size: 9px; color: #ccc; width: 10px;
    text-align: right; flex-shrink: 0;
}

/* The tray cell */
.tray-cell {
    width: 52px;
    height: 30px;
    border-radius: 4px;
    border: 1px solid rgba(0,0,0,0.08);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 8.5px;
    font-weight: 600;
    color: rgba(0,0,0,0.55);
    background: #f0f0f0;
    overflow: hidden;
    transition: transform 0.1s, box-shadow 0.1s;
    text-align: center;
    line-height: 1.1;
    padding: 1px 2px;
    user-select: none;
}
.tray-cell:hover {
    transform: scale(1.08);
    box-shadow: 0 2px 8px rgba(0,0,0,0.18);
    z-index: 10;
    position: relative;
}
.tray-cell.occupied { color: rgba(255,255,255,0.95); text-shadow: 0 1px 2px rgba(0,0,0,0.3); }
.tray-cell.no-edit { cursor: default; }
.tray-cell.no-edit:hover { transform: none; box-shadow: none; }

/* Legend */
.map-legend {
    display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
    font-size: 11px; color: #666;
}
.legend-item { display: flex; align-items: center; gap: 4px; }
.legend-dot { width: 12px; height: 12px; border-radius: 3px; flex-shrink: 0; }

/* ── Split tray ───────────────────────────────────────────────────── */
.tray-cell.split-tray {
    overflow: hidden;
    position: relative;
}
.split-badge {
    position: absolute;
    bottom: 1px;
    right: 2px;
    font-size: 7px;
    font-weight: 700;
    color: rgba(255,255,255,0.9);
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
    line-height: 1;
    pointer-events: none;
}

/* ── Split modal styles ───────────────────────────────────────────── */

/* Structure editor (edit mode) */
.split-part-row {
    display: grid;
    grid-template-columns: 70px 1fr 24px;
    gap: 6px;
    align-items: center;
    margin-bottom: 8px;
}
.split-pct-input {
    padding: 6px 8px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    text-align: right;
    width: 100%;
    box-sizing: border-box;
}
.split-pct-label {
    font-size: 13px;
    color: #888;
}
.split-remove-btn {
    background: none;
    border: none;
    color: #d32f2f;
    cursor: pointer;
    font-size: 18px;
    padding: 0;
    line-height: 1;
}
.split-remove-btn:hover { color: #b71c1c; }

.add-part-btn {
    background: none;
    border: 1px dashed #2d8a4e;
    color: #2d8a4e;
    border-radius: 6px;
    padding: 6px 12px;
    cursor: pointer;
    font-size: 13px;
    width: 100%;
    margin-bottom: 10px;
}
.add-part-btn:hover { background: #e8f5e9; }

.split-total-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: #555;
    padding: 8px 0 2px;
    border-top: 1px solid #eee;
}
.split-ok { color: #2e7d32; font-weight: 600; }
.split-err { color: #d32f2f; font-weight: 600; }

/* Structure empty state */
.split-empty-hint {
    text-align: center;
    padding: 20px 0 12px;
    color: #888;
    font-size: 14px;
}

/* Culture assignment per part (normal mode, split tray) */
.split-culture-part {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f0f0f0;
}
.split-culture-part:last-child { border-bottom: none; margin-bottom: 0; }

.split-part-color {
    width: 10px;
    border-radius: 3px;
    flex-shrink: 0;
    align-self: stretch;
    min-height: 54px;
}
.split-part-pct {
    font-size: 12px;
    font-weight: 700;
    color: #555;
    min-width: 30px;
    padding-top: 9px;
    flex-shrink: 0;
}
.split-part-fields {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.split-part-fields select,
.split-part-fields input[type="date"] {
    width: 100%;
    padding: 7px 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 13px;
    font-family: inherit;
    box-sizing: border-box;
}

/* ── Edit mode controls ───────────────────────────────────────────── */
.edit-mode-btn {
    padding: 6px 14px;
    border: 1.5px solid #2d8a4e;
    background: #fff;
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
    color: #2d8a4e;
    transition: all 0.15s;
    margin-left: 6px;
}
.edit-mode-btn:hover { background: #e8f5e9; }
.edit-mode-btn.active { background: #2d8a4e; color: #fff; }
.edit-mode-btn.active:hover { background: #246e3e; }

.add-struct-btn {
    padding: 6px 12px;
    border: 1.5px solid #2d8a4e;
    background: #e8f5e9;
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
    color: #2d8a4e;
}
.add-struct-btn:hover { background: #c8e6c9; }

.del-line-btn {
    padding: 6px 12px;
    border: 1.5px solid #d32f2f;
    background: #fff;
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
    color: #d32f2f;
}
.del-line-btn:hover { background: #fdecea; }

/* Block card in edit mode */
.block-card.edit-mode { border: 1.5px dashed #ffb300; position: relative; }

.block-label { position: relative; }

.block-delete-btn {
    position: absolute;
    right: -6px;
    top: -6px;
    background: #d32f2f;
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    padding: 0;
    z-index: 5;
}
.block-delete-btn:hover { background: #b71c1c; }

/* Shelf delete button */
.shelf-delete-btn {
    font-size: 8px;
    background: #d32f2f;
    color: #fff;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    padding: 1px 3px;
    margin-left: 2px;
    vertical-align: middle;
}
.shelf-delete-btn:hover { background: #b71c1c; }

/* Add/delete tray buttons */
.add-tray-btn {
    width: 20px;
    height: 30px;
    background: #f1f8e9;
    border: 1.5px dashed #7cb342;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    color: #558b2f;
    line-height: 1;
    padding: 0;
    flex-shrink: 0;
}
.add-tray-btn:hover { background: #dcedc8; }

.tray-delete-btn {
    position: absolute;
    top: 1px;
    right: 1px;
    width: 13px;
    height: 13px;
    background: rgba(211,47,47,0.85);
    color: #fff;
    border: none;
    border-radius: 2px;
    font-size: 8px;
    cursor: pointer;
    line-height: 13px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
}
.tray-delete-btn:hover { background: #b71c1c; }
.tray-cell { position: relative; }

/* Add shelf column */
.add-shelf-col {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 0 4px;
}
.add-shelf-btn {
    padding: 6px 8px;
    background: #f1f8e9;
    border: 1.5px dashed #7cb342;
    border-radius: 4px;
    cursor: pointer;
    font-size: 11px;
    color: #558b2f;
    white-space: nowrap;
    writing-mode: vertical-lr;
    text-orientation: mixed;
}
.add-shelf-btn:hover { background: #dcedc8; }

/* ── Modal ────────────────────────────────────────────────────────── */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.45);
    display: flex; align-items: center; justify-content: center;
    z-index: 500;
}
.modal-box {
    background: #fff;
    border-radius: 12px;
    width: 360px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
    overflow: hidden;
}
.modal-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 14px 18px; border-bottom: 1px solid #eee;
}
.modal-header h4 { font-size: 15px; }
.modal-close { background: none; border: none; font-size: 18px; cursor: pointer; color: #888; }
.modal-body { padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; }
.modal-body label { font-size: 12px; font-weight: 600; color: #555; margin-bottom: -6px; }
.modal-body select,
.modal-body input[type="text"],
.modal-body input[type="number"],
.modal-body input[type="date"],
.modal-body textarea {
    width: 100%; padding: 8px 11px;
    border: 1px solid #ddd; border-radius: 6px; font-size: 14px;
    font-family: inherit;
    box-sizing: border-box;
}
.modal-body textarea { resize: vertical; min-height: 72px; }
.modal-info {
    background: #f0f7f0; border: 1px solid #c8e6c9;
    border-radius: 6px; padding: 8px 11px; font-size: 12px; color: #2e7d32;
}
.modal-footer {
    padding: 12px 18px; border-top: 1px solid #eee;
    display: flex; gap: 8px; justify-content: flex-end;
}
.btn-primary { padding: 7px 16px; background: #2d8a4e; color: #fff; border: none; border-radius: 6px; cursor: pointer; font-size: 14px; }
.btn-primary:hover { background: #246e3e; }
.btn-danger { padding: 7px 16px; background: #fff; color: #d32f2f; border: 1px solid #d32f2f; border-radius: 6px; cursor: pointer; font-size: 14px; }
.btn-danger:hover { background: #fdecea; }
.btn-secondary { padding: 7px 14px; background: #f5f5f5; color: #555; border: none; border-radius: 6px; cursor: pointer; font-size: 14px; }
.btn-secondary:hover { background: #ebebeb; }

/* ── Tasks tab map ────────────────────────────────────────────────── */
.tasks-map-section {
    background: #fff;
    border-bottom: 2px solid #e8f5e9;
    padding: 10px 16px 0;
}
.tasks-map-topbar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}
.tasks-map-hint {
    font-size: 12px;
    color: #2d8a4e;
    font-weight: 600;
    white-space: nowrap;
}
.tasks-map-line-tabs {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.tasks-map-line-tab {
    padding: 4px 14px;
    border-radius: 6px;
    border: 1px solid #ddd;
    cursor: pointer;
    background: #f5f5f5;
    font-size: 13px;
}
.tasks-map-line-tab.active { background: #2d8a4e; color: #fff; border-color: #2d8a4e; }
.tasks-map-line-tab:hover:not(.active) { background: #e8f5e9; border-color: #a5d6a7; }

.tasks-map-content {
    max-height: 46vh;
    overflow-x: auto;
    overflow-y: auto;
    padding-bottom: 10px;
}

/* Tasks-map tray: pointer cursor + hover effect */
.tasks-map-tray {
    cursor: pointer;
    position: relative;
    transition: transform 0.1s, box-shadow 0.1s;
}
.tasks-map-tray:hover {
    transform: scale(1.12);
    box-shadow: 0 0 0 2px #2d8a4e;
    z-index: 4;
}

/* Selected tray */
.tasks-map-tray-selected {
    outline: 3px solid #2e7d32 !important;
    z-index: 3;
}
.tray-sel-mark {
    position: absolute;
    top: 1px; right: 2px;
    font-size: 9px;
    color: #fff;
    background: #2e7d32;
    border-radius: 2px;
    line-height: 1.3;
    padding: 0 2px;
    font-weight: 700;
    z-index: 6;
}

/* Selection bar at bottom of map */
.tasks-map-sel-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: #f1f8e9;
    border-top: 1px solid #c8e6c9;
}
.tasks-map-sel-count {
    font-size: 13px;
    color: #33691e;
    font-weight: 600;
    flex: 1;
}

/* Task badge on tray (count of active tasks) */
.tray-task-badge {
    position: absolute;
    top: 1px;
    left: 1px;
    background: #F57C00;
    color: #fff;
    font-size: 8px;
    font-weight: 700;
    border-radius: 3px;
    min-width: 13px;
    height: 13px;
    line-height: 13px;
    text-align: center;
    padding: 0 2px;
    z-index: 5;
}

.tasks-list-section {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
    min-height: 0;
}
/* Height set via JS depending on whether map is shown */

/* Pre-filled tray info banner in create task form */
.task-form-tray-info {
    background: #e8f5e9;
    border: 1px solid #a5d6a7;
    border-radius: 6px;
    padding: 7px 11px;
    font-size: 12px;
    color: #2e7d32;
    font-weight: 600;
    margin-bottom: -2px;
}

/* Tray locations list in task detail — clickable */
.task-tray-link {
    cursor: pointer;
    border-radius: 6px;
    padding: 4px 6px;
    transition: background 0.15s;
}
.task-tray-link:hover { background: #e8f5e9; }
.task-tray-list {
    margin: 0;
    padding-left: 16px;
    font-size: 12px;
    color: #333;
    list-style: disc;
}
.task-tray-link-hint {
    display: block;
    font-size: 11px;
    color: #2d8a4e;
    font-weight: 600;
    margin-top: 3px;
}

/* Green badge for verified tasks */
.tray-task-badge-done {
    background: #2e7d32;
    right: 1px;
    left: auto;
    top: auto;
    bottom: 1px;
    font-size: 7px;
}

/* ── Tray view map modal ──────────────────────────────────────────── */
.modal-box-map-view {
    width: 880px;
    max-width: 97vw;
}
.tray-view-body {
    max-height: 60vh;
    overflow-x: auto;
    overflow-y: auto;
    background: #fafafa;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 8px;
}

/* Highlighted tray in view modal */
.tray-view-highlight {
    outline: 3px solid #2e7d32 !important;
    z-index: 5;
    animation: tray-pulse 1.8s ease-in-out infinite;
}
@keyframes tray-pulse {
    0%, 100% { box-shadow: 0 0 0 0   rgba(46,125,50,0.7); }
    50%       { box-shadow: 0 0 0 7px rgba(46,125,50,0); }
}
.tray-view-mark {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    font-size: 13px;
    z-index: 6;
    pointer-events: none;
}

/* ── Rounds ───────────────────────────────────────────────────────────── */
.rounds-tab-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}
.rounds-tab-header h3 { margin-bottom: 0; }

.rounds-start-btns { display: flex; gap: 8px; flex-wrap: wrap; }

.btn-round-plants {
    padding: 8px 16px;
    background: #2d8a4e;
    color: #fff;
    border: none;
    border-radius: 7px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
}
.btn-round-plants:hover { background: #246e3e; }
.btn-round-plants:disabled { opacity: 0.6; cursor: default; }

.btn-round-nutrients {
    padding: 8px 16px;
    background: #1565c0;
    color: #fff;
    border: none;
    border-radius: 7px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
}
.btn-round-nutrients:hover { background: #0d47a1; }
.btn-round-nutrients:disabled { opacity: 0.6; cursor: default; }

.round-badge-type-plants   { background: #e8f5e9; color: #2e7d32; }
.round-badge-type-nutrients { background: #e3f2fd; color: #1565c0; }

/* Round cards list */
#rounds-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 12px;
}
.round-card {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 1px 6px rgba(0,0,0,0.08);
    padding: 14px 16px;
    cursor: pointer;
    transition: box-shadow 0.15s, transform 0.1s;
    border-left: 4px solid #e0e0e0;
}
.round-card:hover { box-shadow: 0 3px 12px rgba(0,0,0,0.12); transform: translateY(-1px); }
.round-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}
.round-card-date  { font-weight: 600; font-size: 15px; color: #222; }
.round-card-time  { font-weight: 400; font-size: 13px; color: #888; }
.round-card-badges { display: flex; gap: 6px; flex-wrap: wrap; }
.round-card-meta  { display: flex; gap: 14px; font-size: 12px; color: #888; margin-bottom: 4px; }
.round-card-meta-item {}
.round-card-notes { font-size: 12px; color: #666; margin-top: 6px; font-style: italic; }

/* Status / alert badges */
.round-badge {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}
.round-badge-done  { background: #e8f5e9; color: #2e7d32; }
.round-badge-draft { background: #fff8e1; color: #f57f17; }
.round-badge-crit  { background: #fce4ec; color: #c62828; }
.round-badge-warn  { background: #fff3e0; color: #e65100; }

/* Round modal */
.modal-box-rounds {
    width: min(1100px, 96vw);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}
.round-meta-row {
    display: flex;
    gap: 18px;
    font-size: 13px;
    color: #666;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f0f0f0;
}

/* Line tabs in modal */
.rounds-line-tabs {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}
.rounds-line-tab {
    padding: 5px 13px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    color: #555;
}
.rounds-line-tab:hover  { background: #e8f5e9; border-color: #a5d6a7; }
.rounds-line-tab.active { background: #2d8a4e; color: #fff; border-color: #2d8a4e; }

/* Block check grid */
.round-blocks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 10px;
    margin-bottom: 20px;
}
/* ── Date picker (заменил календарь) ──────────────────────────────── */
.rounds-datepicker {
    background: #fff; border-radius: 10px;
    box-shadow: 0 1px 6px rgba(0,0,0,.08);
    padding: 12px 16px; display: flex; align-items: center; gap: 10px;
    flex: 0 0 auto;
}
.rounds-datepicker label { font-size: 13px; color: #555; font-weight: 600; }
.rounds-datepicker input[type="date"] {
    padding: 6px 10px; border: 1px solid #ddd; border-radius: 6px;
    font-size: 13px;
}
.rounds-datepicker .btn-secondary { padding: 6px 12px; font-size: 12px; }

/* ── Page tray area (главный экран обхода) ────────────────────────── */
.rounds-tray-area {
    background: #fff; border-radius: 10px;
    box-shadow: 0 1px 6px rgba(0,0,0,.08);
    padding: 16px 20px; margin-bottom: 16px;
}
.rounds-tray-empty {
    text-align: center; padding: 30px 20px;
}
.rounds-tray-empty h3 { margin: 0 0 10px; }
.rounds-tray-empty p { color: #777; margin-bottom: 16px; }
.rounds-tray-page-hd {
    display: flex; align-items: baseline; gap: 16px;
    padding-bottom: 10px; border-bottom: 2px solid #e8f5e9;
    margin-bottom: 14px;
}
.rounds-tray-page-hd h3 { margin: 0; color: #1b5e20; }
.rounds-tray-page-meta { font-size: 12px; color: #888; }

/* ── Round map inline (новый flow обхода) ─────────────────────────── */
.round-tray-map {
    background: #fafafa; padding: 12px;
    border: 1px solid #e8e8e8; border-radius: 8px;
    max-height: 400px; overflow-y: auto; overflow-x: auto;
    margin-bottom: 10px;
}
.round-tray-toolbar {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px; background: #e3f2fd;
    border-radius: 8px; margin-bottom: 10px;
    flex-wrap: wrap;
}
.round-tray-counter { font-size: 13px; color: #1565c0; }
.round-tray-counter b { font-size: 16px; }
.round-tray-edit-hint {
    font-size: 12px; color: #ef6c00; font-weight: 600;
    background: #fff3e0; padding: 4px 10px; border-radius: 12px;
}
.btn-task {
    background: #1565c0; color: #fff; border: none; border-radius: 6px;
    padding: 8px 16px; cursor: pointer; font-size: 13px; font-weight: 600;
}
.btn-task:hover { background: #0d47a1; }
.btn-task:disabled { opacity: .4; cursor: not-allowed; }
.round-inline-task {
    background: #e3f2fd; border: 2px solid #90caf9;
    border-radius: 10px; padding: 14px 16px; margin-bottom: 14px;
}
.round-inline-form {
    background: #f1f8e9; border: 2px solid #aed581;
    border-radius: 10px; padding: 14px 16px; margin-bottom: 14px;
}
.round-inline-form-hd {
    font-weight: 700; color: #1b5e20; font-size: 14px;
    margin-bottom: 10px; padding-bottom: 8px;
    border-bottom: 1px solid #c5e1a5;
}
.inline-photo-section {
    margin-top: 10px; padding-top: 8px; border-top: 1px dashed #c5e1a5;
}
.inline-photo-label { font-size: 11px; color: #555; font-weight: 600; margin-bottom: 6px; display: block; }
.inline-photo-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.inline-photo-section .tc-photo-add-btn {
    width: auto; height: auto; padding: 6px 16px; font-size: 13px;
    display: inline-flex; gap: 4px; cursor: pointer;
}
.round-inline-form-actions {
    display: flex; gap: 8px; margin-top: 12px;
}
.tc-card-fields-ro {
    font-size: 12px; color: #444;
    background: #fafafa; padding: 8px 10px;
    border-radius: 6px; margin: 8px 0;
    display: flex; flex-direction: column; gap: 3px;
}
.tc-card-fields-ro b { color: #666; font-weight: 600; }
.tray-sel-tray-used {
    opacity: 0.45; cursor: not-allowed !important;
    text-decoration: line-through;
}
.tray-select-used-hint {
    color: #888; font-size: 11px; margin-left: 6px;
}

/* ── Tray Checks (round по поддонам) ──────────────────────────────── */
.round-legacy-tag {
    display: inline-block; font-size: 10px; color: #999;
    font-weight: 400; padding: 2px 8px; border: 1px solid #ddd;
    border-radius: 10px; margin-left: 8px; vertical-align: middle;
}
.tc-toolbar {
    display: flex; align-items: center; gap: 14px;
    margin-bottom: 14px;
}
.tc-toolbar-hint { color: #888; font-size: 12px; }
.tc-list { display: flex; flex-direction: column; gap: 12px; }
.tc-card {
    background: #fff; border: 1px solid #e0e0e0;
    border-radius: 10px; padding: 12px 14px;
    box-shadow: 0 1px 4px rgba(0,0,0,.05);
}
.tc-card-hd {
    display: flex; align-items: center; gap: 10px;
    margin-bottom: 10px; padding-bottom: 8px;
    border-bottom: 1px dashed #eee;
}
.tc-card-title { flex: 1; font-size: 14px; }
.tc-btn-edit, .tc-btn-delete {
    font-size: 12px; padding: 4px 10px;
    border: 1px solid #ccc; border-radius: 5px;
    background: #fff; cursor: pointer;
}
.tc-btn-edit:hover { background: #f5f5f5; }
.tc-btn-delete { color: #c62828; border-color: #ef9a9a; }
.tc-btn-delete:hover { background: #ffebee; }

.tc-trays-list {
    display: flex; flex-wrap: wrap; gap: 6px;
    margin-bottom: 12px;
}
.tc-tray-chip {
    display: flex; align-items: center; gap: 6px;
    padding: 4px 10px; background: #f1f8e9;
    border: 1px solid #c8e6c9; border-radius: 12px;
    font-size: 11px;
}
.tc-tray-chip-loc { color: #555; }
.tc-tray-chip-cult { color: #2e7d32; font-weight: 600; }

.tc-photos { margin-top: 12px; padding-top: 10px; border-top: 1px dashed #eee; }
.tc-photos-label { font-size: 12px; color: #666; margin-bottom: 6px; }
.tc-photos-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tc-photo-item { position: relative; width: 72px; height: 72px; border-radius: 6px; overflow: hidden; }
.tc-photo-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tc-photo-del {
    position: absolute; top: 2px; right: 2px;
    background: rgba(0,0,0,.6); color: #fff; border: none;
    width: 20px; height: 20px; border-radius: 50%;
    font-size: 11px; cursor: pointer; line-height: 1;
}
.tc-photo-add-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 72px; height: 72px; border: 2px dashed #bdbdbd;
    border-radius: 6px; cursor: pointer; font-size: 28px; color: #888;
}
.tc-photo-add-btn:hover { background: #f5f5f5; border-color: #4caf50; color: #4caf50; }

/* ── Tray Selection Modal ──────────────────────────────────────────── */
.tray-select-counter {
    padding: 8px 12px; background: #e3f2fd;
    border-radius: 6px; margin-bottom: 12px; font-size: 13px; color: #1565c0;
}
.tray-sel-blocks {
    display: flex; flex-direction: column; gap: 16px;
}
.tray-sel-block {
    background: #fafafa; border: 1px solid #eee;
    border-radius: 8px; padding: 10px 12px;
}
.tray-sel-block-hd { font-weight: 600; margin-bottom: 8px; font-size: 13px; color: #333; }
.tray-sel-shelves { display: flex; flex-direction: row; gap: 8px; flex-wrap: wrap; }
.tray-sel-shelf {
    background: #fff; padding: 6px 8px; border-radius: 6px;
    border: 1px solid #f0f0f0;
    flex: 0 0 auto; min-width: 120px;
}
.tray-sel-shelf-name { font-size: 11px; color: #777; margin-bottom: 4px; }
.tray-sel-tier {
    display: flex; align-items: center; gap: 4px;
    flex-wrap: wrap; padding: 2px 0;
}
.tray-sel-tier-num {
    font-size: 10px; color: #888; min-width: 24px;
}
.tray-sel-tray {
    display: inline-block; min-width: 52px; padding: 4px 6px;
    font-size: 10px; text-align: center; cursor: pointer;
    border: 2px solid transparent; border-radius: 4px;
    user-select: none; white-space: nowrap; overflow: hidden;
    text-overflow: ellipsis;
}
.tray-sel-tray:hover { border-color: #666; }
.tray-sel-tray-on {
    border-color: #2e7d32 !important;
    box-shadow: 0 0 0 1px #2e7d32 inset;
    font-weight: 700;
}
.tray-sel-tray-on::before { content: "✓ "; color: #2e7d32; }
.tray-sel-tray-used {
    opacity: 0.45; cursor: not-allowed !important;
    filter: grayscale(60%);
    position: relative;
}
.tray-sel-tray-used:hover { border-color: transparent; }
.tray-select-used-hint { color: #888; font-size: 12px; }

.bcc-card {
    background: #fafafa;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    padding: 10px 12px;
    transition: border-color 0.15s;
}
.bcc-card:hover { border-color: #c8e6c9; }
.bcc-header {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 8px;
}
.bcc-name { font-weight: 600; font-size: 13px; color: #222; }
.bcc-checked-mark { margin-left: auto; font-size: 12px; color: #2e7d32; font-weight: 700; }

/* Status dot */
.bcc-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    border: 1.5px solid #ddd;
    background: #fff;
}
.bcc-dot-ok   { background: #66BB6A; border-color: #43A047; }
.bcc-dot-warn { background: #FFA726; border-color: #FB8C00; }
.bcc-dot-crit { background: #EF5350; border-color: #E53935; }
.bcc-dot-none { background: #e0e0e0; border-color: #bdbdbd; }

/* Block check fields */
.bcc-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}
.bcc-field { display: flex; flex-direction: column; gap: 4px; }
.bcc-field-wide { grid-column: 1 / -1; }
.bcc-field label { font-size: 10px; color: #999; font-weight: 600; text-transform: uppercase; letter-spacing: 0.3px; line-height: 1; margin-bottom: 0; }
.bcc-field select,
.bcc-field input[type="text"] {
    font-size: 12px;
    padding: 4px 6px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background: #fff;
    width: 100%;
    color: #333;
}
.bcc-field select:disabled,
.bcc-field input:disabled { background: #f5f5f5; color: #999; cursor: default; }

/* Notes + photo sections */
.round-notes-section { margin-bottom: 16px; }
.round-notes-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #333;
    line-height: 1.5;
    padding-top: 14px;
    margin-bottom: 6px;
}
.round-textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 7px;
    font-size: 13px;
    font-family: inherit;
    resize: vertical;
    color: #333;
}
.round-textarea:disabled { background: #f8f8f8; color: #777; }

.round-photo-section { margin-bottom: 8px; }
.round-photo-wrap { margin: 8px 0; }
.round-photo-img {
    max-width: 100%;
    max-height: 200px;
    border-radius: 8px;
    border: 1px solid #ddd;
    cursor: pointer;
    object-fit: contain;
}
.round-photo-upload-btn {
    display: inline-block;
    padding: 6px 14px;
    background: #f1f8e9;
    border: 1.5px dashed #7cb342;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    color: #558b2f;
    margin-top: 6px;
}
.round-photo-upload-btn:hover { background: #dcedc8; }

/* ── Rounds calendar ──────────────────────────────────────────────────── */
.rounds-topbar {
    display: flex; gap: 16px; margin-bottom: 16px;
    align-items: stretch;
}
.rounds-topbar > .rounds-calendar { margin-bottom: 0; flex: 0 0 auto; }
.farm-overview {
    flex: 1 1 auto; min-width: 0;
    background: #fff; border-radius: 10px;
    box-shadow: 0 1px 6px rgba(0,0,0,0.08);
    padding: 12px 16px;
    display: flex; flex-direction: column; gap: 8px;
}
.farm-overview-hd {
    font-size: 13px; font-weight: 700; color: #333;
    padding-bottom: 6px; border-bottom: 1px solid #eee;
}
.farm-overview-legend {
    display: flex; flex-wrap: wrap; gap: 10px;
    font-size: 11px; color: #666; padding: 2px 0 6px;
}
.fo-lg {
    display: inline-block; width: 12px; height: 12px;
    border-radius: 3px; vertical-align: middle; margin-right: 2px;
    border: 1px solid rgba(0,0,0,.1);
}
.fo-lg-gray    { background: #eeeeee; }
.fo-lg-partial { background: repeating-linear-gradient(45deg, #fff3e0, #fff3e0 4px, #ffb74d 4px, #ffb74d 8px); }
.fo-lg-ok      { background: #a5d6a7; }
.fo-lg-warn    { background: #ffb74d; }
.fo-lg-crit    { background: #ef5350; }

.fo-line { display: flex; align-items: center; gap: 10px; }
.fo-line-name {
    font-size: 11px; color: #666; font-weight: 600;
    min-width: 72px; text-align: right;
}
.fo-line-blocks {
    display: flex; flex-wrap: wrap; gap: 4px; flex: 1 1 auto;
}
.fo-block {
    min-width: 48px; padding: 5px 8px;
    font-size: 11px; font-weight: 600; text-align: center;
    border-radius: 5px; border: 1px solid rgba(0,0,0,.15);
    cursor: default; white-space: nowrap;
}
.fo-block-gray    { background: #eeeeee; color: #888; }
.fo-block-partial { background: repeating-linear-gradient(45deg, #fff3e0, #fff3e0 4px, #ffcc80 4px, #ffcc80 8px); color: #e65100; }
.fo-block-ok      { background: #c8e6c9; color: #1b5e20; }
.fo-block-warn    { background: #ffcc80; color: #bf360c; }
.fo-block-crit    { background: #ef9a9a; color: #b71c1c; border-color: #c62828; }
.fo-block-empty   { background: #fafafa; color: #bbb; font-style: italic; }

.rounds-calendar {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 1px 6px rgba(0,0,0,0.08);
    padding: 12px 16px 10px;
    margin-bottom: 16px;
    max-width: 340px;
}
.rcal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.rcal-month-label { font-weight: 600; font-size: 14px; color: #333; }
.rcal-nav {
    background: none;
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    width: 28px;
    height: 28px;
    font-size: 18px;
    cursor: pointer;
    color: #555;
    line-height: 1;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.rcal-nav:hover { background: #e8f5e9; border-color: #a5d6a7; }

.rcal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}
.rcal-dow {
    text-align: center;
    font-size: 10px;
    font-weight: 700;
    color: #aaa;
    text-transform: uppercase;
    padding: 3px 0 4px;
}
.rcal-day {
    position: relative;
    text-align: center;
    font-size: 13px;
    padding: 5px 2px 2px;
    border-radius: 6px;
    cursor: pointer;
    min-height: 36px;
    color: #333;
    line-height: 1.3;
    transition: background 0.1s;
}
.rcal-day:hover     { background: #e8f5e9; }
.rcal-empty         { cursor: default; }
.rcal-empty:hover   { background: none; }
.rcal-today         { font-weight: 700; color: #2d8a4e; border: 1.5px solid #a5d6a7; }
.rcal-selected      { background: #2d8a4e !important; color: #fff !important; }
.rcal-selected:hover { background: #246e3e !important; }
.rcal-has-rounds    { font-weight: 600; }

.rcal-dots {
    display: flex;
    justify-content: center;
    gap: 2px;
    margin-top: 2px;
}
.rcal-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    display: inline-block;
}
.rcal-dot-plants    { background: #2d8a4e; }
.rcal-dot-nutrients { background: #1565c0; }

.rcal-filter-hint {
    margin-top: 8px;
    font-size: 12px;
    color: #555;
    display: flex;
    align-items: center;
    gap: 8px;
}
.rcal-clear-btn {
    padding: 2px 8px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 5px;
    cursor: pointer;
    font-size: 11px;
    color: #d32f2f;
}
.rcal-clear-btn:hover { background: #fce4ec; }

/* Per-block photo */
.bcc-photo-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    padding-top: 6px;
    border-top: 1px solid #eee;
}
.bcc-photo-thumb {
    width: 52px;
    height: 52px;
    object-fit: cover;
    border-radius: 5px;
    border: 1px solid #ddd;
    cursor: pointer;
    flex-shrink: 0;
}
.bcc-photo-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    background: #f1f8e9;
    border: 1.5px dashed #7cb342;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    flex-shrink: 0;
    transition: background 0.15s;
}
.bcc-photo-btn:hover { background: #dcedc8; }

/* Round section title */
.round-section-title {
    font-size: 13px;
    font-weight: 700;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 18px 0 10px;
    padding-bottom: 6px;
    border-bottom: 2px solid #e8f5e9;
}

/* Nutrient nodes grid — 3 cards in a row */
.rn-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 4px;
}
@media (max-width: 740px) {
    .rn-grid { grid-template-columns: 1fr; }
}

/* Nutrient node card — same base as bcc-card */
.rn-card {
    background: #f0f7ff;
    border: 1px solid #bbdefb;
    border-radius: 8px;
    padding: 10px 12px;
}
.rn-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}
.rn-field { display: flex; flex-direction: column; gap: 4px; }
.rn-field-wide  { grid-column: 1 / -1; }
.rn-field-checks {
    grid-column: 1 / -1;
    flex-direction: row;
    gap: 14px;
    align-items: center;
    padding: 4px 0 2px;
}
.rn-field label {
    font-size: 10px;
    color: #78909c;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    line-height: 1;
    margin-bottom: 0;
}
.rn-check-label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
    color: #333 !important;
    font-weight: 500 !important;
    cursor: pointer;
}
.rn-check-label input[type="checkbox"] { width: 14px; height: 14px; cursor: pointer; }
.rn-field select,
.rn-field input[type="number"],
.rn-field input[type="text"] {
    font-size: 12px;
    padding: 4px 6px;
    border: 1px solid #90caf9;
    border-radius: 5px;
    background: #fff;
    width: 100%;
    color: #333;
}
.rn-field select:disabled,
.rn-field input:disabled { background: #f5f5f5; color: #999; cursor: default; border-color: #ddd; }

/* btn-danger for delete */
.btn-danger {
    padding: 8px 18px;
    border: 1px solid #d32f2f;
    background: #fff;
    color: #d32f2f;
    border-radius: 7px;
    cursor: pointer;
    font-size: 14px;
}
.btn-danger:hover { background: #fce4ec; }

/* ── Analytics ────────────────────────────────────────────────────────── */
.analytics-header { margin-bottom: 16px; }
.analytics-header h3 { margin-bottom: 10px; }

.analytics-period-row {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.period-btn {
    padding: 6px 14px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    color: #555;
    transition: background 0.15s;
}
.period-btn:hover  { background: #e8f5e9; border-color: #a5d6a7; }
.period-btn.active { background: #2d8a4e; color: #fff; border-color: #2d8a4e; }

.period-custom {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: 8px;
}
.period-custom input[type="date"] {
    padding: 5px 8px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 13px;
    color: #333;
}
.period-sep { color: #aaa; }

.analytics-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.analytics-card {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 1px 6px rgba(0,0,0,0.08);
    padding: 16px 18px 14px;
    overflow: hidden;
}
.analytics-card-wide { grid-column: 1 / -1; }

.analytics-card-hd {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.analytics-hint {
    font-size: 11px;
    font-weight: 400;
    color: #999;
}
.analytics-chart-wrap {
    position: relative;
    height: 280px;
}
.analytics-empty {
    text-align: center;
    color: #bbb;
    padding: 32px 16px;
    font-size: 13px;
}
.analytics-spinner {
    font-size: 12px;
    color: #aaa;
    text-align: center;
    padding: 6px 0 2px;
}
.analytics-select {
    margin-left: auto;
    padding: 4px 8px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 12px;
    color: #555;
    cursor: pointer;
    background: #fff;
}

/* Task log table */
.tasklog-scroll { overflow-x: auto; }
.tasklog-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.tasklog-table thead th {
    text-align: left;
    padding: 6px 10px;
    border-bottom: 2px solid #e8e8e8;
    color: #666;
    font-weight: 600;
    white-space: nowrap;
    background: #fafafa;
}
.tasklog-table tbody td {
    padding: 7px 10px;
    border-bottom: 1px solid #f2f2f2;
    vertical-align: middle;
}
.tasklog-table tbody tr:hover td { background: #f6fdf7; }
.tasklog-dt      { color: #999; white-space: nowrap; font-size: 12px; }
.tasklog-title   { font-weight: 500; max-width: 260px; }
.tasklog-optype  { color: #666; font-size: 12px; white-space: nowrap; }
.tasklog-badge {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 10px;
    color: #fff;
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
}

@media (max-width: 860px) {
    .analytics-grid { grid-template-columns: 1fr; }
    .analytics-card-wide { grid-column: auto; }
    .analytics-chart-wrap { height: 220px; }
}

/* ══ Reference table — new columns ════════════════════════════════════════════ */
.ref-type-sel {
    font-size: 12px; padding: 2px 4px; border: 1px solid #ddd; border-radius: 4px;
    background: #fafafa; cursor: pointer; max-width: 110px;
}
.ref-type-badge {
    font-size: 12px; color: #555; background: #f0f0f0;
    padding: 2px 6px; border-radius: 10px;
}

/* ══ Planting / Посадки tab ════════════════════════════════════════════════════ */

.planting-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 16px 10px; gap: 12px; flex-wrap: wrap;
}
.planting-header-left h3 { font-size: 18px; color: #2e7d32; margin: 0; }
.planting-header-btns { display: flex; gap: 8px; flex-wrap: wrap; }

.btn-pl-plan {
    padding: 7px 16px; border-radius: 6px; border: none; cursor: pointer;
    background: #2e7d32; color: #fff; font-size: 13px; font-weight: 600;
}
.btn-pl-plan:hover { background: #1b5e20; }
.btn-pl-germ {
    padding: 7px 16px; border-radius: 6px; border: none; cursor: pointer;
    background: #1565c0; color: #fff; font-size: 13px; font-weight: 600;
}
.btn-pl-germ:hover { background: #0d47a1; }

.planting-layout {
    display: grid; grid-template-columns: 1fr 380px; gap: 0;
    height: calc(100vh - 130px); overflow: hidden;
}

.planting-plan-col {
    display: flex; flex-direction: column; border-right: 1px solid #e0e0e0; overflow: hidden;
}
.planting-week-nav {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 14px; background: #f5f5f5; border-bottom: 1px solid #e0e0e0; flex-shrink: 0;
}
.planting-week-label { font-weight: 600; font-size: 14px; flex: 1; text-align: center; }

#planting-plan-body { flex: 1; overflow-y: auto; padding: 0; }

/* Plan table */
.plan-table {
    width: 100%; border-collapse: collapse; font-size: 13px;
}
.plan-table th {
    background: #f5f5f5; color: #555; font-weight: 600;
    padding: 7px 10px; text-align: left; border-bottom: 2px solid #e0e0e0;
    position: sticky; top: 0; z-index: 1;
}
.plan-table td { padding: 6px 10px; border-bottom: 1px solid #f0f0f0; vertical-align: middle; }
.plan-row:hover td { background: #fafafa; }
.plan-row-empty td { color: #bbb; }

.plan-date-cell {
    font-size: 12px; white-space: nowrap; min-width: 80px;
    display: flex; flex-direction: column; gap: 2px; padding: 6px 8px;
}
.plan-dow { font-weight: 700; font-size: 13px; color: #333; }
.plan-day-txt { font-size: 11px; color: #888; }
.plan-add-btn {
    margin-top: 2px; width: 20px; height: 20px; border-radius: 50%; border: none;
    background: #e8f5e9; color: #2e7d32; font-size: 14px; font-weight: 700;
    cursor: pointer; display: flex; align-items: center; justify-content: center; line-height: 1;
}
.plan-add-btn:hover { background: #c8e6c9; }
.plan-culture-cell { font-weight: 500; }
.plan-num-cell { text-align: center; font-weight: 600; }
.plan-act-cell { white-space: nowrap; }
.plan-empty-hint { color: #ccc; font-style: italic; font-size: 12px; }

/* Plan status badges */
.plan-badge { font-size: 11px; padding: 2px 7px; border-radius: 10px; font-weight: 600; white-space: nowrap; }
.plan-badge-ok      { background: #e8f5e9; color: #2e7d32; }
.plan-badge-warn    { background: #fff8e1; color: #f57c00; }
.plan-badge-crit    { background: #ffebee; color: #c62828; }
.plan-badge-neutral { background: #f5f5f5; color: #757575; }

/* Plan action buttons */
.plan-btn-done {
    width: 26px; height: 26px; border-radius: 5px; border: none; cursor: pointer;
    background: #e8f5e9; color: #2e7d32; font-size: 14px; font-weight: 700; margin-right: 4px;
}
.plan-btn-done:hover { background: #c8e6c9; }
.plan-btn-del {
    width: 26px; height: 26px; border-radius: 5px; border: none; cursor: pointer;
    background: #ffebee; color: #c62828; font-size: 14px; font-weight: 700;
}
.plan-btn-del:hover { background: #ffcdd2; }

/* ── Germinator column ─────────────────────────────────────────────────────── */
.germinator-col {
    display: flex; flex-direction: column; overflow: hidden; background: #fafafa;
}
.germinator-col-hd {
    display: flex; align-items: center; justify-content: space-between;
    padding: 8px 14px; background: #e3f2fd; border-bottom: 1px solid #bbdefb;
    font-weight: 600; font-size: 13px; flex-shrink: 0;
}
.germ-show-chk { font-size: 12px; font-weight: 400; color: #555; cursor: pointer; }

#germinator-body { flex: 1; overflow-y: auto; padding: 10px; display: flex; flex-direction: column; gap: 10px; }

/* Germinator batch cards */
.germ-card {
    background: #fff; border-radius: 8px; border-left: 4px solid #bdbdbd;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08); overflow: hidden;
}
.germ-card-germinating { border-left-color: #4caf50; }
.germ-card-ready       { border-left-color: #ff9800; }
.germ-card-overdue     { border-left-color: #f44336; background: #fff8f8; }
.germ-card-extracted   { border-left-color: #9e9e9e; opacity: 0.75; }

.germ-card-hd {
    display: flex; align-items: center; justify-content: space-between;
    padding: 8px 12px; border-bottom: 1px solid #f0f0f0;
}
.germ-culture-name { font-weight: 700; font-size: 14px; }
.germ-card-rows { padding: 8px 12px; display: flex; flex-direction: column; gap: 4px; }
.germ-row { display: flex; justify-content: space-between; font-size: 12px; gap: 8px; }
.germ-row span:first-child { color: #888; flex-shrink: 0; }
.germ-defect-info { color: #c62828 !important; }
.germ-ship-future { color: #1565c0; }
.germ-ship-future span:first-child { color: #1565c0 !important; }
.germ-ship-ready  { color: #2e7d32; font-weight: 600; }
.germ-ship-ready  span:first-child { color: #2e7d32 !important; }
.germ-notes { font-size: 11px; color: #888; padding: 4px 12px 8px; font-style: italic; }
.germ-card-ft {
    display: flex; gap: 6px; padding: 6px 12px 8px; border-top: 1px solid #f0f0f0;
}

/* Germinator status badges */
.germ-st-badge { font-size: 11px; padding: 2px 7px; border-radius: 10px; font-weight: 600; }
.germ-st-germinating { background: #e8f5e9; color: #2e7d32; }
.germ-st-ready       { background: #fff3e0; color: #e65100; }
.germ-st-overdue     { background: #ffebee; color: #c62828; }
.germ-st-extracted   { background: #f5f5f5; color: #9e9e9e; }

/* Germinator action buttons */
.btn-extract {
    flex: 1; padding: 5px 10px; border-radius: 5px; border: none; cursor: pointer;
    background: #1565c0; color: #fff; font-size: 12px; font-weight: 600;
}
.btn-extract:hover { background: #0d47a1; }
.btn-germ-del {
    width: 28px; height: 28px; border-radius: 5px; border: none; cursor: pointer;
    background: #ffebee; color: #c62828; font-size: 14px; font-weight: 700;
}
.btn-germ-del:hover { background: #ffcdd2; }

/* Batch extract preview */
.batch-extract-preview { margin-top: 4px; min-height: 18px; }
.batch-preview-txt { font-size: 12px; color: #1565c0; }

/* Extract / defect modal helpers */
.extract-info-txt   { font-size: 13px; color: #555; margin-bottom: 4px; font-weight: 600; }
.extract-autoplan-hint {
    font-size: 12px; color: #e65100; background: #fff3e0;
    border-radius: 5px; padding: 6px 10px; margin-top: 6px;
}

/* btn-danger */
.btn-danger {
    padding: 8px 18px; border-radius: 6px; border: none; cursor: pointer;
    background: #d32f2f; color: #fff; font-size: 13px; font-weight: 600;
}
.btn-danger:hover { background: #b71c1c; }

/* ── Plan matrix (pivot: rows=cultures, cols=days) ──────────────────────────── */
.plan-matrix-wrap { overflow-x: auto; width: 100%; }

.plan-matrix {
    border-collapse: collapse; font-size: 13px; width: 100%; table-layout: fixed;
}
.plan-matrix th, .plan-matrix td {
    border: 1px solid #e0e0e0; padding: 0; vertical-align: middle;
}

/* Culture name column (left, sticky) */
.pm-th-cult-lbl {
    background: #f5f5f5; color: #555; font-weight: 700; font-size: 12px;
    padding: 8px 12px; text-align: left; width: 160px; min-width: 140px;
    position: sticky; left: 0; z-index: 2; border-right: 2px solid #ddd;
}
.pm-cult-lbl {
    padding: 8px 12px; font-weight: 600; font-size: 13px; color: #333;
    background: #fafafa; border-right: 2px solid #ddd;
    position: sticky; left: 0; z-index: 1; white-space: nowrap;
    overflow: hidden; text-overflow: ellipsis; max-width: 160px;
}
.pm-cult-add-cell { background: #f9f9f9; padding: 8px 12px; }

/* Day column headers */
.pm-th-date {
    background: #f5f5f5; color: #333; font-weight: 600; font-size: 12px;
    padding: 6px 4px; text-align: center; min-width: 88px;
    display: table-cell; /* flex не работает в th */
}
.pm-th-date .plan-dow { display: block; font-weight: 700; }
.pm-th-date .plan-day-txt { display: block; color: #888; font-size: 11px; }
.pm-th-today { background: #e8f5e9 !important; border-bottom: 2px solid #66bb6a; }

/* Today column highlight */
.pm-col-today { background-color: rgba(102,187,106,0.06) !important; }
.pmc-done.pm-col-today    { background: #dcedc8; }
.pmc-partial.pm-col-today { background: #fff3cd; }
.pmc-overdue.pm-col-today { background: #ffcdd2; }

/* Row hover */
.pm-row:hover .pm-cell { filter: brightness(0.97); }
.pm-row:hover .pm-cult-lbl { background: #f0f0f0; }

/* Data cells */
.pm-cell {
    padding: 6px 5px; text-align: center; vertical-align: middle; min-width: 88px;
}
.pm-cell-empty { background: #fafafa; }

/* Cell status colors */
.pmc-done    { background: #e8f5e9; }
.pmc-partial { background: #fff8e1; }
.pmc-pending { background: #fff; }
.pmc-overdue { background: #ffebee; }

/* Numbers inside cell: "план / факт бок." */
.pmc-nums {
    display: flex; align-items: baseline; justify-content: center;
    gap: 2px; font-size: 13px; margin-bottom: 4px;
}
.pmc-plan { font-weight: 700; font-size: 14px; color: #333; }
.pmc-sep  { color: #bbb; font-size: 12px; }
.pmc-fact { font-weight: 600; color: #555; }
.pmc-unit { font-size: 10px; color: #999; margin-left: 1px; }

/* Action buttons inside cell */
.pmc-btns  { display: flex; gap: 4px; justify-content: center; }
.pmc-btn-done {
    width: 24px; height: 22px; border-radius: 4px; border: none; cursor: pointer;
    background: #c8e6c9; color: #2e7d32; font-size: 13px; font-weight: 700; line-height: 1;
}
.pmc-btn-done:hover { background: #a5d6a7; }
.pmc-btn-del {
    width: 22px; height: 22px; border-radius: 4px; border: none; cursor: pointer;
    background: #ffcdd2; color: #c62828; font-size: 12px; font-weight: 700; line-height: 1;
}
.pmc-btn-del:hover { background: #ef9a9a; }

/* Add button in empty cell */
.pmc-add-btn {
    width: 24px; height: 24px; border-radius: 50%; border: 1px dashed #bbb;
    background: transparent; color: #bbb; font-size: 16px; cursor: pointer;
    display: flex; align-items: center; justify-content: center; margin: auto; line-height: 1;
}
.pmc-add-btn:hover { background: #e8f5e9; border-color: #66bb6a; color: #2e7d32; }

/* Add culture row at bottom */
.pm-row-addcult td { border-top: 2px dashed #e0e0e0; }
.btn-pl-plan-sm {
    padding: 5px 14px; font-size: 12px; border-radius: 5px; border: none; cursor: pointer;
    background: #e8f5e9; color: #2e7d32; font-weight: 600;
}
.btn-pl-plan-sm:hover { background: #c8e6c9; }

/* Empty week */
.plan-empty-week { padding: 30px; text-align: center; color: #aaa; font-size: 14px; }

/* Today row highlight */
.plan-row-today td { background: #f1f8e9 !important; }
.plan-row-today .plan-date-cell { border-left: 3px solid #66bb6a; }
.plan-today-chip {
    display: inline-block; font-size: 10px; background: #66bb6a; color: #fff;
    border-radius: 8px; padding: 1px 6px; font-weight: 700; vertical-align: middle;
}

/* Today banner for workers */
.plan-today-banner {
    background: #e8f5e9; border-left: 4px solid #2e7d32; border-radius: 6px;
    margin: 10px 10px 8px; padding: 10px 14px;
}
.plan-today-hd { font-weight: 700; font-size: 14px; color: #2e7d32; margin-bottom: 8px; }
.plan-today-row {
    display: flex; align-items: center; gap: 10px; padding: 6px 0;
    border-bottom: 1px solid #c8e6c9; flex-wrap: wrap;
}
.plan-today-row:last-child { border-bottom: none; }
.plan-today-culture { font-weight: 600; font-size: 14px; flex: 1; min-width: 100px; }
.plan-today-nums { font-size: 13px; color: #555; white-space: nowrap; }
.plan-btn-done-lg {
    padding: 5px 14px; border-radius: 5px; border: none; cursor: pointer;
    background: #2e7d32; color: #fff; font-size: 13px; font-weight: 600;
}
.plan-btn-done-lg:hover { background: #1b5e20; }

/* Defect photo UI */
.defect-photo-row { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.defect-photo-label { font-size: 13px; color: #555; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.btn-attach-photo {
    padding: 5px 12px; border-radius: 5px; border: 1px solid #bbb; cursor: pointer;
    background: #f5f5f5; color: #333; font-size: 12px;
}
.btn-attach-photo:hover { background: #e0e0e0; }
.defect-photo-preview { display: flex; align-items: center; gap: 8px; }
.defect-thumb-preview {
    width: 64px; height: 64px; object-fit: cover; border-radius: 6px;
    border: 1px solid #ddd; cursor: pointer;
}
.defect-photo-name { font-size: 11px; color: #888; word-break: break-all; }

/* Defect photo in germinator card */
.germ-defect-photo-row { padding: 4px 12px 0; }
.defect-thumb {
    width: 72px; height: 72px; object-fit: cover; border-radius: 6px;
    border: 1px solid #ddd; cursor: pointer;
}
.germ-defect-photo-row + .germ-defect-photo-row { margin-top: 4px; }

/* ── Microgreens reference panel ──────────────────────────────────────────── */
.planting-ref-section {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    margin: 0 0 14px;
    overflow: hidden;
}
.planting-ref-hd {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: #f1f8e9;
    border-bottom: 1px solid #dce8cc;
    font-weight: 600;
    font-size: 15px;
    color: #2e7d32;
}
.btn-ref-close {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    color: #777;
    padding: 0 4px;
    line-height: 1;
}
.btn-ref-close:hover { color: #c62828; }
.planting-ref-filter {
    padding: 8px 16px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 13px;
    color: #555;
}
.planting-ref-table-wrap {
    overflow-x: auto;
    max-height: 380px;
    overflow-y: auto;
}
.planting-ref-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.planting-ref-table th {
    background: #fafafa;
    position: sticky;
    top: 0;
    z-index: 1;
    padding: 8px 10px;
    text-align: center;
    border-bottom: 2px solid #e0e0e0;
    white-space: nowrap;
    font-size: 12px;
    color: #555;
    font-weight: 600;
}
.planting-ref-table td {
    padding: 7px 10px;
    border-bottom: 1px solid #f5f5f5;
    vertical-align: middle;
}
.planting-ref-table tr:hover td { background: #f9fbe7; }
.prt-name { text-align: left !important; min-width: 130px; font-weight: 500; }
.prt-num  { text-align: center; min-width: 90px; }
.prt-save { width: 44px; text-align: center; }
.ref-inp {
    width: 74px;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 4px 6px;
    font-size: 13px;
    text-align: center;
    color: #222;
    background: #fafafa;
}
.ref-inp:focus { outline: none; border-color: #66bb6a; background: #fff; }
.ref-inp-int { width: 56px; }
.btn-ref-save {
    padding: 4px 8px;
    border: 1px solid #a5d6a7;
    border-radius: 5px;
    background: #e8f5e9;
    color: #2e7d32;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.15s;
}
.btn-ref-save:hover { background: #c8e6c9; }
.btn-ref-save:disabled { opacity: 0.5; cursor: default; }
.ref-empty { color: #bbb; font-style: italic; }
.btn-pl-ref {
    padding: 7px 14px;
    border-radius: 7px;
    border: 1px solid #a5d6a7;
    background: #f1f8e9;
    color: #2e7d32;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: background 0.15s;
}
.btn-pl-ref:hover       { background: #c8e6c9; }
.btn-pl-ref-active      { background: #a5d6a7; border-color: #66bb6a; }
.btn-pl-ref-active:hover { background: #81c784; }
.btn-pl-import {
    padding: 7px 14px; border-radius: 7px; border: 1px solid #b0bec5;
    background: #eceff1; color: #37474f; font-size: 13px; font-weight: 600;
    cursor: pointer; transition: background 0.15s;
}
.btn-pl-import:hover { background: #cfd8dc; }

/* ── Import plan modal ───────────────────────────────────────────────────── */
.import-format-hint {
    background: #f5f5f5; border-radius: 8px; padding: 12px 14px;
    margin-bottom: 14px; font-size: 13px;
}
.import-format-hint b { display: block; margin-bottom: 8px; color: #333; }
.import-format-table { overflow-x: auto; margin-bottom: 8px; }
.import-format-table table {
    border-collapse: collapse; font-size: 12px; width: auto;
}
.import-format-table th, .import-format-table td {
    border: 1px solid #ddd; padding: 4px 10px; text-align: center;
}
.import-format-table th { background: #e8f5e9; color: #2e7d32; font-weight: 600; }
.import-format-table td:first-child { text-align: left; font-weight: 500; }
.import-hint-note { color: #888; font-size: 11px; margin: 0; }

.import-file-label {
    display: flex; align-items: center; gap: 10px; cursor: pointer;
    border: 2px dashed #b0bec5; border-radius: 8px; padding: 14px 16px;
    background: #fafafa; transition: border-color 0.2s;
}
.import-file-label:hover { border-color: #66bb6a; background: #f1f8f1; }
.import-file-label input[type=file] { display: none; }
#import-file-name { color: #555; font-size: 13px; }

.import-result { margin-top: 14px; border-radius: 8px; padding: 12px 14px; }
.import-result-ok    { background: #e8f5e9; border: 1px solid #a5d6a7; }
.import-result-error { background: #ffebee; border: 1px solid #ef9a9a; color: #c62828; }
.import-stat-row {
    display: flex; justify-content: space-between; gap: 12px;
    font-size: 13px; padding: 3px 0;
}
.import-stat-row span:first-child { color: #555; }
.import-stat-row b { color: #1a1a1a; }
.import-unmatched { color: #e65100 !important; margin-top: 6px; }
.import-unmatched span:first-child { color: #e65100 !important; font-weight: 600; }

/* ── Batch-linked task tags ────────────────────────────────────────────────── */
.task-batch-tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 600;
    margin-left: 4px;
}
.task-batch-extract { background: #e3f2fd; color: #1565c0; }
.task-batch-ship    { background: #fff8e1; color: #e65100; }
.btn-task-extract   { background: #1565c0; }
.btn-task-extract:hover { background: #0d47a1; }
.btn-task-ship      { background: #e65100; }
.btn-task-ship:hover { background: #bf360c; }

@media (max-width: 900px) {
    .planting-layout { grid-template-columns: 1fr; height: auto; }
    .planting-plan-col { border-right: none; border-bottom: 1px solid #e0e0e0; max-height: 55vh; }
    .germinator-col { max-height: 60vh; }
}

/* ══════════════════════════════════════════════════════════════════════════════
   MOBILE  ≤ 600px
   ══════════════════════════════════════════════════════════════════════════════ */
/* ── Toast notifications ─────────────────────────────────────────────────── */
#toast-container {
    position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
    display: flex; flex-direction: column; align-items: center; gap: 8px;
    z-index: 9999; pointer-events: none;
}
.toast {
    padding: 10px 20px; border-radius: 8px; font-size: 14px; font-weight: 500;
    color: #fff; box-shadow: 0 4px 16px rgba(0,0,0,0.2);
    opacity: 0; transform: translateY(12px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    white-space: nowrap; max-width: 90vw; text-align: center;
}
.toast-visible { opacity: 1; transform: translateY(0); }
.toast-info    { background: #1976d2; }
.toast-success { background: #2e7d32; }
.toast-warning { background: #e65100; }
.toast-error   { background: #c62828; }

/* ── Shelf fill button (microgreens zone mode) ───────────────────────────── */
.shelf-fill-btn {
    display: inline-block;
    margin-left: 4px;
    padding: 1px 5px;
    font-size: 11px;
    border-radius: 4px;
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #a5d6a7;
    cursor: pointer;
    vertical-align: middle;
    line-height: 1.4;
}
.shelf-fill-btn:hover { background: #c8e6c9; }

/* ── Rotation Tab ────────────────────────────────────────────────────────── */
#tab-rotation { padding: 0 0 40px; }

.rot-section {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 1px 6px rgba(0,0,0,.08);
    margin-bottom: 24px;
    overflow: visible;
}
.rot-section .rot-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 0 0 10px 10px;
}
.rot-section-hd {
    display: flex;
    align-items: baseline;
    gap: 12px;
    padding: 14px 20px 10px;
    border-bottom: 1px solid #f0f0f0;
}
.rot-section-hd h4 { margin: 0; font-size: 15px; }
.rot-section-sub { font-size: 12px; color: #888; }

/* Summary table */
.rot-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.rot-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    table-layout: fixed;
}
.rot-table th, .rot-table td {
    padding: 3px 4px;
    border: 1px solid #e8e8e8;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.rot-table thead th { background: #f8f9fa; font-weight: 600; font-size: 11px; line-height: 1.2; }
.rot-table thead th small { font-size: 10px; color: #888; font-weight: 400; }
.rot-th-name { text-align: left; width: 14%; }
.rot-table col.rot-c-plan { width: 9%; }
.rot-table col.rot-c-ref  { width: 10%; }
.rot-table col.rot-c-area { width: 9%; }
.rot-table col.rot-c-res  { width: 10%; }
.rot-th-group { font-size: 11px; letter-spacing: .4px; }
.rot-th-input { background: #f3f6fb !important; color: #1565c0; }
.rot-th-rota  { background: #e8f0fe !important; color: #1a237e; }
.rot-th-sow   { background: #fffde7 !important; color: #827717; }
.rot-cell-rota { background: #f0f4ff; }
.rot-cell-sow  { background: #fffef0; }
.rot-col-ref   { background: #f5f5f5 !important; color: #9e9e9e; font-style: italic; }
.rot-col-edit  { background: #fff; }
.rot-col-result { background: #e8f5e9 !important; color: #1b5e20; font-weight: 600; }
.rot-inline-input {
    width: 48px; padding: 2px 4px;
    border: 1px solid #bbdefb; border-radius: 3px;
    font-size: 12px; text-align: right; background: #fff;
}
.rot-inline-input:focus { outline: none; border-color: #1976d2; box-shadow: 0 0 0 2px rgba(25,118,210,.2); }
.rot-inline-suffix { color: #888; font-size: 11px; margin-left: 2px; }
.rot-plan-input {
    width: 100%; max-width: 70px; padding: 2px 5px;
    border: 1px solid #a5d6a7; border-radius: 3px;
    font-size: 12px; text-align: right; background: #fff;
}
.rot-plan-input:focus { outline: none; border-color: #43a047; box-shadow: 0 0 0 2px rgba(67,160,71,.2); }
.rot-plan-input-cell { text-align: center; }
.rot-plan-ok  { font-size: 11px; color: #2e7d32; font-weight: 600; }
.rot-plan-gap { font-size: 11px; color: #c62828; font-weight: 600; }
.rot-table tbody tr:hover td { background: #fafafa; }
.rot-totals-row td { background: #f5f5f5 !important; font-weight: 600; border-top: 2px solid #ccc; }

/* ── Flower Batches Tab ──────────────────────────────────────────────── */
#tab-batches { padding: 20px 0 40px; }
.batches-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 20px;
}
.batches-header h3 { margin: 0; font-size: 18px; }
.batch-section {
    background: #fff; border-radius: 10px;
    box-shadow: 0 1px 6px rgba(0,0,0,.08);
    padding: 16px; margin-bottom: 20px;
}
.batch-section h4 { margin: 0 0 12px; font-size: 14px; }
.batch-pending h4  { color: #f57c00; }
.batch-sowed h4    { color: #2e7d32; }
.batch-checked h4  { color: #546e7a; }

.batch-card {
    border: 1px solid #e0e0e0; border-radius: 8px;
    padding: 12px 14px; margin-bottom: 10px;
    background: #fafafa;
}
.batch-card-pending_check { border-left: 4px solid #ff9800; background: #fff8e1; }
.batch-card-sowed         { border-left: 4px solid #4caf50; background: #f1f8e9; }
.batch-card-checked       { border-left: 4px solid #9e9e9e; background: #fafafa; }

.batch-card-hd {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 8px;
}
.batch-card-title strong { font-size: 15px; }
.batch-card-date { color: #777; font-size: 12px; margin-left: 8px; }
.batch-pct {
    display: inline-block; padding: 3px 10px; border-radius: 12px;
    font-weight: 700; font-size: 13px;
}
.batch-pct-good { background: #c8e6c9; color: #1b5e20; }
.batch-pct-mid  { background: #fff9c4; color: #827717; }
.batch-pct-bad  { background: #ffcdd2; color: #b71c1c; }
.batch-card-body { font-size: 13px; color: #444; }
.batch-stat { display: inline-block; margin-right: 16px; }
.batch-stat span { color: #888; }
.batch-notes { margin-top: 6px; font-style: italic; color: #555; }
.batch-author { margin-top: 4px; font-size: 11px; color: #999; }
.batch-card-actions {
    margin-top: 10px; display: flex; gap: 8px;
}
.batch-card-actions button { font-size: 12px; padding: 5px 12px; }
.batch-check-info-box {
    background: #f5f5f5; padding: 10px; border-radius: 6px;
    margin-bottom: 12px; font-size: 13px;
}
.batch-card-alert {
    border-left: 4px solid #d32f2f !important;
    background: #ffebee !important;
    box-shadow: 0 0 0 1px #ef9a9a;
}
.batch-alert-banner {
    background: #d32f2f; color: #fff;
    padding: 6px 10px; margin: -12px -14px 10px;
    border-radius: 8px 8px 0 0;
    font-size: 12px; font-weight: 600;
}
.batch-pct small { font-weight: 400; font-size: 10px; opacity: .75; }

.rot-name-cell { text-align: left; }
.rot-trays b { color: #1976d2; }
.rot-nd { color: #bbb; }
.rot-badge {
    display: inline-block;
    padding: 2px 7px;
    border-radius: 10px;
    background: #e3f2fd;
    color: #1565c0;
    font-size: 11px;
    white-space: nowrap;
}
.rot-badge-sow {
    display: inline-block;
    padding: 2px 7px;
    border-radius: 10px;
    background: #fffde7;
    color: #827717;
    font-size: 11px;
}

/* Schedule cards */
.rot-sched-card {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    margin: 12px 20px;
    overflow: hidden;
}
.rot-sched-has-work {
    border-color: #ffb74d;
}
.rot-sched-hd {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 14px;
    background: #fafafa;
    border-bottom: 1px solid #f0f0f0;
    font-size: 13px;
}
.rot-sched-meta {
    color: #888;
    font-size: 12px;
    margin-left: 4px;
}
.rot-badge-overdue {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    background: #ffebee;
    color: #c62828;
    font-size: 11px;
    font-weight: 600;
}
.rot-badge-due {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    background: #fff8e1;
    color: #e65100;
    font-size: 11px;
    font-weight: 600;
}
.rot-sched-ok {
    padding: 10px 14px;
    font-size: 13px;
    color: #43a047;
    margin: 0;
}
.rot-sched-trays { padding: 6px 8px 8px; }

.rot-tray-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px 8px;
    border-radius: 6px;
    margin-bottom: 3px;
    font-size: 12px;
}
.rot-tray-overdue { background: #ffebee; }
.rot-tray-due     { background: #fff8e1; }
.rot-tray-upcoming { background: #f1f8e9; }

.rot-tray-icon { font-size: 14px; flex-shrink: 0; }
.rot-tray-loc  { font-weight: 500; flex: 1; }
.rot-tray-date { color: #888; white-space: nowrap; }
.rot-tray-more {
    padding: 4px 8px 6px 28px;
    font-size: 12px;
    color: #888;
    font-style: italic;
}

/* Draft auto-rotation tasks */
.rot-draft-section { border-top: 3px solid #1976d2; }
.rot-draft-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    margin-left: auto;
}
.rot-btn-generate {
    padding: 6px 14px; font-size: 13px; border-radius: 6px;
    background: #e3f2fd; color: #1565c0; border: 1px solid #90caf9;
    cursor: pointer; white-space: nowrap;
}
.rot-btn-generate:hover { background: #bbdefb; }
.rot-btn-confirm-all {
    padding: 6px 14px; font-size: 13px; border-radius: 6px;
    background: #2e7d32; color: #fff; border: none; cursor: pointer;
}
.rot-btn-confirm-all:hover { background: #1b5e20; }
.rot-btn-discard-all {
    padding: 6px 14px; font-size: 13px; border-radius: 6px;
    background: #fff; color: #c62828; border: 1px solid #ef9a9a; cursor: pointer;
}
.rot-btn-discard-all:hover { background: #ffebee; }
.rot-draft-empty { padding: 16px 20px; color: #aaa; }

.rot-draft-group { margin: 12px 20px; }
.rot-draft-group-hd {
    font-size: 12px; font-weight: 700; color: #666;
    text-transform: uppercase; letter-spacing: .5px;
    padding: 4px 0 6px; border-bottom: 1px solid #eee; margin-bottom: 6px;
}

.rot-draft-card {
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    margin-bottom: 6px;
    overflow: hidden;
}
.rot-draft-remove { border-left: 4px solid #ef5350; }
.rot-draft-place  { border-left: 4px solid #66bb6a; }

.rot-draft-card-hd {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    padding: 8px 12px; background: #fafafa;
}
.rot-draft-icon { font-size: 16px; flex-shrink: 0; }
.rot-draft-title { font-size: 13px; font-weight: 600; flex: 1; }

.rot-draft-prio-high {
    font-size: 11px; padding: 2px 7px; border-radius: 10px;
    background: #ffebee; color: #c62828; font-weight: 600;
}
.rot-draft-prio-med {
    font-size: 11px; padding: 2px 7px; border-radius: 10px;
    background: #e8f5e9; color: #2e7d32;
}
.rot-draft-btns { display: flex; gap: 4px; margin-left: auto; }
.rot-btn-confirm-one {
    padding: 4px 10px; font-size: 12px; border-radius: 5px;
    background: #43a047; color: #fff; border: none; cursor: pointer;
}
.rot-btn-confirm-one:hover { background: #2e7d32; }
.rot-btn-delete-one {
    padding: 4px 8px; font-size: 12px; border-radius: 5px;
    background: #fff; color: #c62828; border: 1px solid #ef9a9a; cursor: pointer;
}
.rot-btn-delete-one:hover { background: #ffebee; }

.rot-draft-desc { padding: 6px 12px 8px 38px; background: #fff; }
.rot-draft-addr {
    font-size: 12px; color: #555; padding: 2px 0;
    border-bottom: 1px dotted #f0f0f0;
}
.rot-draft-addr:last-child { border-bottom: none; }

@media (max-width: 600px) {

    /* ── Global ─────────────────────────────────────────────────────────────── */
    main { padding: 10px 8px 80px; }
    h3   { font-size: 17px; margin-bottom: 10px; }

    /* ── Login ──────────────────────────────────────────────────────────────── */
    .login-card { width: calc(100vw - 32px); padding: 28px 18px; }
    .login-card h1 { font-size: 24px; }

    /* ── Header ─────────────────────────────────────────────────────────────── */
    header {
        padding: 6px 10px;
        gap: 6px;
        flex-wrap: nowrap;
    }
    .header-left h2 { font-size: 14px; white-space: nowrap; }
    #user-info { display: none; }
    #logout-btn { padding: 4px 8px; font-size: 11px; white-space: nowrap; }

    /* Nav — горизонтальный скролл вместо переноса */
    #main-nav {
        overflow-x: auto;
        flex-wrap: nowrap;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
        gap: 2px;
    }
    #main-nav::-webkit-scrollbar { display: none; }
    .nav-btn { padding: 5px 9px; font-size: 12px; white-space: nowrap; flex-shrink: 0; }

    /* ── Tables — горизонтальный скролл ─────────────────────────────────────── */
    table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: 6px; }
    th, td { padding: 8px 9px; font-size: 12px; white-space: nowrap; }

    /* ── Modals — снизу экрана (bottom sheet) ───────────────────────────────── */
    .modal-overlay { align-items: flex-end; padding: 0; }
    .modal-box {
        width: 100% !important;
        max-width: 100% !important;
        border-radius: 20px 20px 0 0 !important;
        max-height: 92vh;
        overflow-y: auto;
    }
    .modal-box-wide { width: 100% !important; max-width: 100% !important; }
    .modal-body  { padding: 14px 16px; gap: 12px; }
    .modal-footer { padding: 10px 16px; gap: 8px; }
    .modal-footer .btn-primary,
    .modal-footer .btn-secondary,
    .modal-footer .btn-danger { flex: 1; text-align: center; }

    /* Предотвращаем зум iOS при фокусе на input (font-size < 16px) */
    input, select, textarea { font-size: 16px !important; }

    /* ── Задачи ─────────────────────────────────────────────────────────────── */

    /* Карта поддонов на телефоне не нужна */
    .tasks-map-section { display: none; }

    /* Тулбар — столбиком */
    .tasks-toolbar { flex-direction: column; align-items: stretch; gap: 8px; padding: 10px 12px; }
    .tasks-date-filter { justify-content: space-between; }
    .tasks-toolbar .btn-primary { margin-left: 0; }
    .tasks-date-inp  { flex: 1; }
    .tasks-date-clear { white-space: nowrap; }

    /* Канбан — колонки друг под другом */
    .tasks-list-section { overflow: visible; flex: none; }
    .kanban-board {
        flex-direction: column;
        height: auto !important;
        overflow: visible;
    }
    .kanban-col {
        border-right: none;
        border-bottom: 2px solid #e0e0e0;
        max-height: none;
        overflow: visible;
    }
    .kanban-col:last-child { border-bottom: none; }
    .kanban-cards { max-height: none; overflow: visible; }

    /* Карточки задач — перенос заголовка */
    .task-card-title  { white-space: normal; font-size: 13px; }
    .task-card-top    { flex-wrap: wrap; gap: 4px; }
    .task-card-body   { padding: 8px 10px; }
    .task-op-badge, .task-status-badge { font-size: 10px; }
    .task-card-footer { font-size: 11px; }

    /* Детальная модалка задачи */
    .task-detail-row { font-size: 12px; }
    .task-report-photo { max-width: 100%; height: auto; }

    /* ── Посадки ────────────────────────────────────────────────────────────── */
    .planting-header { flex-direction: column; gap: 8px; align-items: flex-start; }
    .planting-header-btns { display: flex; flex-wrap: wrap; gap: 6px; }
    .planting-header-btns button { font-size: 13px; padding: 6px 10px; }
    .planting-week-label { font-size: 12px; }

    .planting-layout     { grid-template-columns: 1fr !important; height: auto !important; }
    .planting-plan-col   { max-height: none; border-right: none; border-bottom: 1px solid #eee; }
    .germinator-col      { max-height: none; }

    /* Матрица плана — скролл */
    .plan-matrix-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .pm-th-cult-lbl, .pm-cult-lbl { min-width: 90px; max-width: 90px; font-size: 11px; }
    .pm-th-date, .pm-col-today { min-width: 72px; }
    .pmc-nums { font-size: 10px; }

    /* Проращиватель */
    .germ-card { padding: 10px; }
    .germinator-col-hd { padding: 8px 10px; font-size: 13px; }

    /* Справочник */
    .planting-ref-hd { font-size: 13px; }
    .planting-ref-table-wrap { max-height: 280px; }
    .planting-ref-table th, .planting-ref-table td { padding: 6px 8px; font-size: 11px; }
    .prt-num { min-width: 70px; }
    .ref-inp  { width: 60px; font-size: 14px !important; }
    .ref-inp-int { width: 46px; }

    /* ── Сбор урожая ────────────────────────────────────────────────────────── */
    .harvest-controls { flex-wrap: wrap; }
    .harvest-input { width: 80px; }
    #harvest-table th:nth-child(2),
    #harvest-table td:nth-child(2) { display: none; }  /* скрыть "план на день" */

    /* ── Премия ─────────────────────────────────────────────────────────────── */
    .bonus-header { flex-wrap: wrap; gap: 8px; font-size: 13px; }
    .bonus-header strong { font-size: 15px; }

    /* ── Аналитика ──────────────────────────────────────────────────────────── */
    .analytics-header { flex-direction: column; gap: 8px; }
    .analytics-period-row { flex-wrap: wrap; gap: 6px; }
    .period-custom { flex-wrap: wrap; gap: 4px; width: 100%; }
    .analytics-grid { grid-template-columns: 1fr !important; }
    .analytics-card-wide { grid-column: auto !important; }

    /* ── Обходы ─────────────────────────────────────────────────────────────── */
    .rounds-tab-header { flex-direction: column; gap: 8px; align-items: flex-start; }
    .rounds-start-btns { display: flex; gap: 8px; flex-wrap: wrap; }
    .rounds-calendar { gap: 6px; }
    .rcal-day { min-width: 38px; font-size: 11px; padding: 4px; }
    #rounds-list { grid-template-columns: 1fr; }

    /* ── Справочник культур ─────────────────────────────────────────────────── */
    .ref-header h3 { font-size: 15px; }
    .ref-subtitle { font-size: 12px; }
    .ref-section-hd h4 { font-size: 14px; }
    .ref-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .ref-table th, .ref-table td { padding: 7px 8px; font-size: 12px; }
    .norm-input { width: 60px; font-size: 14px !important; }
}
