:root {
    --accent-green: #3BD304;
    --accent-green-hover: #56a832;
    --accent-blue: #081d33;        /* Updated to match the dark navy letters in the logo */
    --accent-blue-light: #004AF7;
    --brand-green-soft: #eef9ea;
    --brand-blue-soft: #eaf1ff;
    --brand-grey: #475569;
    --brand-text: #10243b;
}

body {
    background-color: #f6f8fb;
    font-family: 'Inter', sans-serif;
    color: var(--brand-text);
}





.farm-top-header {
    background: #ffffff;
    padding: 20px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e2e8f0;
}

.farm-top-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.farm-top-left h1 {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    color: var(--brand-blue);
}

.farm-top-right {
    display: flex;
    align-items: center;
    gap: 20px;
    font-size: 13px;
    color: #475569;
}

.farm-top-right div {
    display: flex;
    align-items: center;
    gap: 6px;
}

.dropdown-farms {
    position: relative;
    display: inline-block;
    cursor: pointer;
}

.dropdown-farms-content {
    display: none;
    position: absolute;
    background-color: #ffffff;
    min-width: 200px;
    box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    margin-top: 5px;
    left: 0;
    max-height: 300px;
    overflow-y: auto;
}

.dropdown-farms-content a {
    color: #475569;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    border-bottom: 1px solid #f4fbf4;
    font-size: 14px;
    transition: 0.2s;
}

.dropdown-farms-content a:last-child {
    border-bottom: none;
}

.dropdown-farms-content a:hover {
    background-color: #f3f8f6;
    color: #004AF7;
}

.dropdown-farms.show .dropdown-farms-content {
    display: block;
}

.tab-content {
    display: none;
    padding: 30px;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    box-sizing: border-box;
}

.tab-content.active {
    display: flex;
    flex-direction: column;
}

/* Overview styles */
.overview-layout {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

.overview-row:last-child {
    border-bottom: none;
}

/* Photo Gallery styles */
.photo-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.photo-select-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

.photo-select-container select {
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid #d6e5d3;
    font-size: 14px;
    outline: none;
    cursor: pointer;
    color: #10243b;
    min-width: 200px;
}

.btn-upload-photo {
    padding: 8px 16px;
    background: var(--accent-blue-light);
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: 0.2s;
}

.btn-upload-photo:hover {
    background: #5cb035;
}

.btn-upload-photo:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}

.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.photo-delete-btn {
    color: #ef4444;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
}

.photo-delete-btn:hover {
    background: #fee2e2;
}

.note-list-card {
    padding: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    cursor: pointer;
    transition: 0.2s;
    margin-bottom: 10px;
}

.note-list-card:hover {
    border-color: #d6e5d3;
    background: #f3f8f6;
}

.note-list-card h4 {
    margin: 0 0 5px 0;
    font-size: 14px;
    color: #10243b;
}

.note-list-card span {
    font-size: 11px;
    color: #f97316;
    background: #fff7ed;
    padding: 2px 6px;
    border-radius: 4px;
    display: inline-block;
}

/* Ponds styles */
.ponds-container {
    display: flex;
    gap: 30px;
    flex: 1;
    min-height: 0;
    background: transparent;
}

.ponds-sidebar {
    flex: 1;
    max-width: 600px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
    border-radius: 14px;
    padding: 30px;
    display: flex;
    flex-direction: column;
    background: #fff;
    box-sizing: border-box;
}

.ponds-map-area {
    flex: 1;
    position: relative;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
    border-radius: 14px;
    background: #fff;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#map {
    flex: 1;
    width: 100%;
    height: 100%;
    border-radius: 12px;
    z-index: 1;
}

.ponds-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    font-weight: 700;
    color: #0d3a72;
    padding-bottom: 12px;
    border-bottom: 1px solid #e2e8f0;
    margin-top: 30px;
    text-transform: uppercase;
}

.pond-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 10px;
    border-bottom: 1px solid #e2e8f0;
    font-size: 13px;
    color: #475569;
    cursor: pointer;
    position: relative;
}

.pond-item:hover {
    background: #f4fbf4;
}

.pond-item .edit-icon,
.pond-item .delete-icon {
    display: none;
    margin-left: 10px;
}

.pond-item .edit-icon {
    color: #3b82f6;
}

.pond-item .delete-icon {
    color: #ef4444;
}

.pond-item:hover .edit-icon,
.pond-item:hover .delete-icon {
    display: inline-block;
}

.edit-ponds-btn {
    width: 100%;
    padding: 10px;
    background: #fff;
    border: 1px solid rgba(59, 211, 4, 0.4);
    border-radius: 6px;
    color: var(--brand-text);
    font-weight: 500;
    cursor: pointer;
    transition: 0.2s;
}

.edit-ponds-btn:hover {
    background: var(--accent-blue-light);
    border-color: var(--accent-blue-light);
    color: #ffffff;
}

.btn-outline-primary {
    border: 1px solid var(--accent-blue-light);
    color: var(--accent-blue-light);
    background: transparent;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

/* Notes styles */
.notes-grid {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 30px;
    height: 100%;
}

.note-editor {
    background: #fff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
    border-radius: 14px;
    padding: 30px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.note-list {
    background: #fff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
    border-radius: 14px;
    padding: 25px;
    display: flex;
    flex-direction: column;
}

.form-control-minimal {
    width: 100%;
    border: 1px solid #dbe4ee;
    padding: 12px 16px;
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    color: #10243b;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control-minimal:focus {
    border-color: #004AF7;
    box-shadow: 0 0 0 3px rgba(0, 74, 247, 0.10);
    outline: none;
}

.note-textarea {
    flex: 1;
    min-height: 250px;
    resize: vertical;
    border: 1px solid #e2e8f0;
    padding: 16px;
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    color: #10243b;
    background: #fbfbfc;
}

.empty-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 300px;
    color: #94a3b8;
    background: #fff;
    border-radius: 8px;
    border: 1px dashed #d6e5d3;
}

.infra-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.infra-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.infra-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #d6e5d3;
    transition: .4s;
}

.infra-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
}

input:checked+.infra-slider {
    background-color: #0d3a72;
}

input:focus+.infra-slider {
    box-shadow: 0 0 1px #0d3a72;
}

input:checked+.infra-slider:before {
    transform: translateX(20px);
}

.infra-slider.infra-round {
    border-radius: 24px;
}

.infra-slider.infra-round:before {
    border-radius: 50%;
}

/* --- Drop-in Replacement for main tabs --- */
.farm-tabs {
    background: #ffffff;
    padding: 0 40px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    gap: 32px;
}

.farm-tab {
    padding: 16px 0;
    color: #475569;
    font-weight: 600; /* Crisper weight */
    font-size: 14px;
    cursor: pointer;
    border-bottom: 2px solid transparent; /* Cleaner line thickness */
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
}

.farm-tab i {
    font-size: 15px;
    transition: transform 0.2s ease;
}

.farm-tab:hover {
    color: var(--accent-blue-light);
    border-bottom-color: var(--accent-blue-light);


}

.farm-tab:hover i {
    transform: translateY(-1px);
}

.farm-tab.active {
    color: var(--accent-blue-light);
    border-bottom-color: var(--accent-blue-light);
}

/* --- Drop-in Replacement for operation tabs --- */
.op-tab {
    padding: 14px 0;
    color: #475569;
    font-weight: 600;
    font-size: 13.5px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.op-tab:hover {
    color: var(--accent-blue-light);
    border-bottom-color: var(--accent-blue-light);
}

.op-tab.active {
    color: var(--accent-blue-light);
    border-bottom-color: var(--accent-blue-light);
}

/* --- Drop-in Replacement for side/inner sub-tabs (Pills) --- */
.ps-tab {
    padding: 8px 14px;
    margin-bottom: 6px;
    color: #475569;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.15s ease;
    background: transparent;
    border: 1px solid transparent;
}

.ps-tab:hover {
    color: #0d3a72;
    background: #f4fbf4;
}

.ps-tab.active {
    background: var(--accent-blue-light);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 74, 247, 0.25);
}

/* --- Drop-in Climate Metric Cards Replacement --- */
.climate-metric {
    text-align: center;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 16px 12px;
    flex: 1;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}

.climate-metric:hover {
    border-color: #d6e5d3;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.04);
}

.climate-metric.active {
    border-color: var(--accent-blue-light);
    background: #f5fbf5;
    box-shadow: 0 4px 12px rgba(59, 211, 4, 0.08);
}

.climate-metric .metric-title {
    font-size: 11px;
    font-weight: 700;
    color: #475569;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.climate-metric .metric-icon {
    color: #475569;
    font-size: 20px;
    margin-bottom: 8px;
    transition: transform 0.2s ease;
}

.climate-metric .metric-value {
    font-size: 20px;
    font-weight: 700;
    color: #10243b;
    letter-spacing: -0.02em;
}

/* Active Highlight Color Sync */
.climate-metric.active .metric-title { color: #0d3a72; }
.climate-metric.active .metric-icon  { color: #0d3a72; transform: scale(1.08); }
.climate-metric.active .metric-value { color: #0d3a72; }

/* --- Drop-in Overview Layout Module Replacement --- */
.overview-grid {
    flex: 1;
    max-width: 600px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
    overflow-y: auto;
}

.overview-map-container {
    flex: 1;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    position: relative;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.overview-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    border-bottom: 1px solid #f4fbf4;
    font-size: 14px;
}

.overview-label {
    color: #475569;
    font-weight: 600;
    flex-shrink: 0;
    width: 160px;
}

.overview-value {
    color: #10243b;
    font-weight: 500;
    text-align: right;
    flex-grow: 1;
}

/* Polishing form inputs/selects inside table containers */
.overview-row input,
.overview-row select {
    padding: 8px 12px;
    border: 1px solid #d6e5d3;
    border-radius: 6px;
    background-color: #ffffff;
    font-size: 13.5px;
    color: #10243b;
    outline: none;
    transition: all 0.15s ease;
}

.overview-row input:focus,
.overview-row select:focus {
    border-color: #0d3a72;
    box-shadow: 0 0 0 3px rgba(8, 74, 158, 0.1);
}

/* --- Drop-in Photo Grid Replacement --- */
.photo-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
    position: relative;
    transition: all 0.2s ease;
}

.photo-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.06);
    border-color: #d6e5d3;
}

.photo-card img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.photo-card:hover img {
    transform: scale(1.02);
}

.photo-card-info {
    padding: 12px 14px;
    font-size: 13px;
    font-weight: 500;
    color: #475569;
    background: #ffffff;
    border-top: 1px solid #f4fbf4;
}

/* Base utility state class */
.hidden-view {
    display: none !important;
}

@media (max-width: 768px) {
    .cycle-form-grid {
        grid-template-columns: 1fr; /* Fallback to single stacked column on mobile view screens */
    }
}

/* --- Production Cycle Form Layout Classes --- */
.cycle-form-panel {
    background-color: #fbfbfc; /* Matches your bg-shell theme color */
    border: 1px solid #e2e8f0;  /* Matches your border-shell theme color */
    border-radius: 8px;
    padding: 20px;
    margin-top: 20px;
}

.cycle-form-title {
    color: #10243b; /* Matches text-brand-dark */
    margin: 0 0 15px 0;
    font-size: 15px;
    font-weight: 900;
}

/* 3-Column Inputs Alignment Layout Grid */
.cycle-form-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 20px;
    align-items: end;
}

.form-field-group {
    display: flex;
    flex-direction: column;
}

.form-field-label {
    display: block;
    font-size: 13px;
    margin-bottom: 5px;
}

/* Base Uniform Heights Arrangement Rules */
.custom-input-aligned {
    margin-top: 5px;
    width: 100%;
    height: 38px;
    padding: 8px 16px !important;
    box-sizing: border-box;
}

/* FIX: Changed vertical padding here so select option items remain perfectly centered and completely visible */
.custom-select-aligned {
    margin-top: 5px;
    width: 100%;
    height: 38px;
    padding: 0 16px !important; /* Zero vertical padding keeps option text aligned natively */
    box-sizing: border-box;
    cursor: pointer;
}

/* Custom Dropdown Trigger Container */
.custom-multiselect-container {
    position: relative;
    margin-top: 5px;
    width: 100%;
}

.multiselect-trigger {
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    outline: none;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-width: 200px;
    height: 38px;
    box-sizing: border-box;
}

.multiselect-trigger i {
    font-size: 14px;
    color: #475569;
}

.multiselect-trigger span {
    color: #94a3b8;
}

/* Absolute Dropdown Overlay Content Window Panel */
.multiselect-dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background-color: #ffffff;
    border-radius: 6px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.08);
    z-index: 1050;
    margin-top: 4px;
    max-height: 220px;
    overflow-y: auto;
    box-sizing: border-box;
}

.multiselect-dropdown-content.show {
    display: flex;
    flex-direction: column;
}

/* Dropdown Checklist Item Rows Styling */
.multiselect-option-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    margin: 0;
    font-size: 14px;
    color: #10243b;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.multiselect-option-row:hover {
    background-color: #f8fafc;
}

.multiselect-option-row.selected {
    background-color: #eef9ea !important;
    font-weight: 500;
}

/* Action Trigger Control Buttons Section */
.cycle-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.btn-cycle-cancel {
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
}

.btn-cycle-save {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.dashboard-content {
            margin-left: 100px;
            padding: 0;
            height: 100vh;
            overflow: hidden;
            display: flex;
            flex-direction: column;
            width: calc(100% - 100px);
            transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1), width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        }

.btn-overview{
    background-color: var(--accent-blue-light);
    color: #ffffff;
}

.btn-overview:hover{
    background-color: #0d3a72;
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(13, 33, 66, 0.22);
}

.ctrl-btn{
    color: var(--accent-blue-light);
    border: 1px solid var(--accent-blue-light);
    background: #ffffff;
}

.ctrl-btn:hover{
    background-color: var(--accent-blue-light);
    color: #ffffff;
    box-shadow: 0 6px 14px rgba(13, 33, 66, 0.18);
}











/* ==========================================================================
   Extracted from farm-detail.html inline styles (refactor)
   Organized by page section. Elements whose visibility is toggled by JS
   keep a single inline `display` attribute in the HTML by design.
   ========================================================================== */

/* --- Top header ------------------------------------------------------- */
.farm-top-header--detail { padding: 15px 40px; }

.back-link { text-decoration: none; }
.back-link i { font-size: 20px; margin-right: 15px; }

.farm-title {
    margin-right: 10px;
    font-weight: 700;
    font-size: 24px;
    text-transform: uppercase;
}

.farm-title-caret { font-size: 14px; }

.farm-top-right--stats { display: flex; align-items: center; gap: 12px; }

.stat-pill {
    padding: 6px 16px;
    border-radius: 24px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    font-size: 14px;
}

.top-menu-btn {
    cursor: pointer;
    font-size: 18px;
    margin-left: 10px;
    display: flex;
    align-items: center;
    padding: 8px;
}

.top-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    border-radius: 8px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    width: 170px;
    z-index: 100;
    margin-top: 5px;
    flex-direction: column;
    overflow: hidden;
}

.dropdown-item {
    padding: 12px 16px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: 0.2s;
    display: flex;
    align-items: center;
}

.dropdown-item i { margin-right: 10px; font-size: 14px; }
.dropdown-item:hover { background: #f3f8f6; }
.dropdown-item--danger:hover { background: #fef2f2; }

.dropdown-divider { height: 1px; width: 100%; }

/* --- Tab panel layout variants ---------------------------------------- */
.tab-panel-flush { padding: 0; flex-direction: column; overflow: hidden; }
.tab-panel-scroll { padding: 30px; flex-direction: column; overflow-y: auto; }
.tab-content.tab-panel-row.active { flex-direction: row; }
.tab-panel-row { padding: 0; overflow: hidden; }

.tab-scroll-wrap {
    flex: 1;
    overflow: hidden;
    padding: 30px;
    display: flex;
    min-height: 0;
}

.overview-layout--fill {
    flex: 1;
    margin: 0;
    gap: 30px;
    align-items: stretch;
    height: 100%;
    min-height: 0;
}

.overview-left-col {
    flex: 1;
    max-width: 600px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    overflow-y: auto;
    padding-right: 10px;
    min-height: 0;
}

/* --- Overview cards ---------------------------------------------------- */
.overview-card {
    max-width: none;
    margin: 0;
    border-radius: 14px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
    overflow: hidden;
    flex-shrink: 0;
}

.overview-card--edit {
    padding: 20px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.card-section-title {
    padding: 20px;
    font-weight: 700;
    font-size: 13px;
    text-transform: uppercase;
}

.card-section-title--flush {
    padding: 0 0 20px 0;
    margin-bottom: 15px;
}

.map-card {
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
    overflow: hidden;
}

.map-fill { width: 100%; height: 100%; border-radius: 12px; z-index: 1; }

/* --- Bottom action bar -------------------------------------------------- */
.farm-bottom-bar {
    background: #ffffff;
    padding: 15px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #e2e8f0;
    width: 100%;
}

.action-btns { display: flex; gap: 15px; align-items: center; }

.btn-pill {
    border: none;
    padding: 10px 20px;
    border-radius: 24px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    transition: 0.2s;
}

.btn-pill--wide { padding: 10px 24px; }

/* --- Ponds tab ----------------------------------------------------------- */
.sidebar-title {
    font-size: 14px;
    margin: 0;
    font-weight: 700;
    text-transform: uppercase;
}

.ponds-list-scroll {
    overflow-y: auto;
    flex: 0 1 auto;
    margin-top: 10px;
    padding-right: 5px;
}

.list-loading { padding: 20px; text-align: center; font-size: 13px; }

.ponds-sidebar-footer {
    margin-top: auto;
    padding-top: 20px;
    display: flex;
    gap: 10px;
}

.btn-block-ctrl {
    flex: 1;
    border-radius: 8px;
    padding: 12px 16px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    transition: 0.2s;
}

.btn-save-pond { flex: 1; border-radius: 8px; border: none; font-weight: 500; }

/* --- Infrastructure tab -------------------------------------------------- */
.infra-card {
    border-radius: 14px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
    padding: 30px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
}

.infra-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.infra-title { font-size: 16px; margin: 0; font-weight: 700; }

.infra-group--view {
    padding-bottom: 15px;
    margin-bottom: 15px;
    border-bottom: 1px solid #e2e8f0;
}

.infra-group--last { padding-bottom: 25px; margin-bottom: 25px; }

.infra-label { font-size: 13px; font-weight: 500; display: block; margin-bottom: 8px; }
.infra-value { font-size: 14px; }

.infra-group--edit { margin-bottom: 15px; }
.infra-group--edit-last { margin-bottom: 25px; }

.infra-edit-label { font-size: 12px; font-weight: 600; display: block; margin-bottom: 5px; }

.infra-input { width: 100%; padding: 8px; border-radius: 4px; box-sizing: border-box; }

.infra-switch-row { margin-bottom: 15px; display: flex; align-items: center; gap: 10px; }
.infra-switch-label { font-size: 13px; font-weight: 500; cursor: pointer; }

.infra-view-actions { display: flex; }

.infra-edit-actions {
    margin-top: 20px;
    border-top: 1px solid #e2e8f0;
    padding-top: 15px;
    display: flex;
    gap: 10px;
}

.btn-form { flex: 1; padding: 10px 16px; border-radius: 4px; cursor: pointer; font-weight: 500; }
.btn-form--solid { border: none; }

/* --- Photo tab ------------------------------------------------------------ */
.panel-card-header {
    border-radius: 8px;
    padding: 15px 25px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.photo-select-container--flush { gap: 0; }

.photo-title-group { display: flex; align-items: center; gap: 10px; margin-right: 25px; }
.photo-title-group i { font-size: 16px; }

.panel-title { font-weight: 700; font-size: 16px; margin: 0; }

.v-divider { width: 1px; height: 24px; margin-right: 25px; }

.select-label { font-size: 14px; margin-right: 15px; font-weight: 500; }

select.select-input {
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    outline: none;
    cursor: pointer;
    min-width: 200px;
}

.btn-ctrl-md {
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: 0.2s;
}

.photo-grid-panel {
    border-radius: 8px;
    flex: 1;
    padding: 40px;
    min-height: 400px;
    margin-top: 0;
    position: relative;
}

.photo-empty {
    grid-column: 1 / -1;
    width: 100%;
    min-height: 320px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: none;
}

.empty-icon-box {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.empty-icon-box i { font-size: 24px; }

.empty-title { margin: 0 0 10px 0; font-size: 16px; font-weight: 700; }

.empty-text { margin: 0; font-size: 14px; max-width: 300px; line-height: 1.5; }

/* --- Notes tab -------------------------------------------------------------- */
.panel-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.btn-ctrl-sm {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: 0.2s;
}

.note-filter-select {
    padding: 10px 15px;
    border-radius: 6px;
    font-size: 13px;
    margin-bottom: 20px;
    outline: none;
    cursor: pointer;
}

.notes-list-scroll { flex: 1; overflow-y: auto; display: flex; flex-direction: column; }

.note-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.note-empty-state i { font-size: 40px; margin-bottom: 15px; color: #d6e5d3; }
.note-empty-state p { font-size: 14px; margin: 0; }

.note-pane { flex-direction: column; height: 100%; }

.icon-btn { font-size: 16px; cursor: pointer; }
.icon-btn--lg { font-size: 18px; }

.editor-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 20px;
    border-top: 1px solid #e2e8f0;
    padding-top: 20px;
}

.btn-form-sm {
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    font-size: 13px;
    transition: 0.2s;
}

.btn-form-sm--solid { border: none; }

.viewer-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 5px;
}

.viewer-title { margin: 0; font-size: 20px; }

.note-mention-tag {
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 15px;
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    max-width: max-content;
}

.note-view-content {
    flex: 1;
    overflow-y: auto;
    font-size: 14px;
    white-space: pre-wrap;
    line-height: 1.6;
}

.viewer-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 15px;
    border-top: 1px solid #e2e8f0;
    padding-top: 15px;
}

.btn-form-xs { padding: 8px 16px; border-radius: 4px; cursor: pointer; font-weight: 500; }
.btn-form-xs--solid { border: none; }

/* --- Cycles tab ------------------------------------------------------------- */
.cycles-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.cycles-title { font-size: 18px; margin: 0; }

.btn-new-cycle { border: none; padding: 8px 16px; }

.cycles-grid { display: grid; gap: 15px; }

.cycles-empty { text-align: center; padding: 40px; border-radius: 8px; }
.cycles-empty i { font-size: 30px; margin-bottom: 10px; }

.form-field-label--md { font-size: 14px; font-weight: 500; }

/* --- Operation tab ------------------------------------------------------------ */
.op-map-col {
    width: 400px;
    padding: 30px 0 30px 30px;
    display: flex;
    flex-direction: column;
}

.op-map { width: 100%; flex: 1; border-radius: 6px; z-index: 1; }

.op-content-col {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

/* Sticky wrapper keeps the toolbar AND the sub-tabs pinned while scrolling */
.op-sticky-head {
    position: sticky;
    top: 0;
    z-index: 10;
    background: #ffffff;
    box-shadow: 0 4px 10px rgba(13, 33, 66, 0.05);
}

.op-toolbar {
    padding: 15px 30px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.op-toolbar-left { display: flex; gap: 20px; align-items: center; }

.field-stack { display: flex; flex-direction: column; }

.field-label-xs { font-size: 11px; font-weight: 600; text-transform: uppercase; }

.op-cycle-select { padding: 4px 8px; font-size: 13px; min-width: 150px; margin-top: 2px; }

.op-toolbar-stats {
    display: flex;
    gap: 15px;
    font-size: 14px;
    font-weight: 500;
    align-items: center;
}

.op-tabs-bar { padding: 0 30px; border-bottom: 1px solid #e2e8f0; display: flex; gap: 30px; }

.op-dash-content { padding: 30px; flex-direction: column; gap: 20px; }

.op-stack { display: flex; flex-direction: column; gap: 20px; }

.op-row { display: flex; gap: 20px; }

.op-card { border-radius: 8px; padding: 20px; }
.op-card--center { text-align: center; }
.op-card--insights { margin-top: 10px; }

.op-card-title {
    margin: 0 0 15px 0;
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.op-card-title--tight { margin-bottom: 10px; }
.op-card-title--left { text-align: left; }
.op-card-title--lg { margin: 0 0 20px 0; font-size: 16px; }

.op-card-subtext { font-size: 12px; font-weight: 600; margin: 0 0 15px 0; }
.op-card-subtext--xs { font-size: 11px; }

.op-legend { display: flex; gap: 15px; font-size: 12px; font-weight: 600; margin-bottom: 15px; }
.op-legend--pad { margin-bottom: 20px; }

.legend-item { display: flex; align-items: center; gap: 4px; }
.legend-dot { width: 8px; height: 8px; border-radius: 50%; }
.legend-dot--blue { background: #3b82f6; }
.legend-dot--amber { background: #f59e0b; }

.op-chart-box { height: 120px; display: flex; align-items: center; justify-content: center; }
.op-chart-box--sm { height: 100px; margin-top: 10px; }

.op-donut {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 8px solid #f4fbf4;
    border-top-color: #3BD304;
}

.alerts-grid { display: grid; grid-template-columns: 1fr 1fr; font-size: 12px; row-gap: 8px; }
.alerts-row { display: flex; justify-content: space-between; }

.cost-bars {
    height: 100px;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    font-size: 11px;
}

.cost-bar-row { display: flex; justify-content: space-between; align-items: center; }
.cost-bar { height: 10px; border-radius: 2px; }

.srs-gauge-wrap {
    position: relative;
    width: 150px;
    height: 75px;
    margin: 15px auto 0 auto;
    overflow: hidden;
}

.srs-gauge-ring {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    border: 20px solid #e2e8f0;
    border-top-color: #ef4444;
    border-right-color: #eab308;
    border-bottom-color: #22c55e;
    border-left-color: #ef4444;
    transform: rotate(45deg);
    box-sizing: border-box;
}

.srs-gauge-needle {
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 4px;
    height: 50px;
    background: #10243b;
    transform-origin: bottom center;
    transform: translateX(-50%) rotate(-45deg);
    border-radius: 2px;
}

.srs-value { font-size: 20px; font-weight: bold; margin-top: 5px; }

.srs-legend-row {
    display: flex;
    justify-content: space-between;
    font-size: 9px;
    margin-top: 15px;
    font-weight: 600;
}

.srs-legend-row--tight { margin-top: 10px; }
.srs-legend-cell { text-align: left; }

.srs-legend-bar {
    width: 40px;
    height: 4px;
    background: #22c55e;
    margin-top: 4px;
    border-radius: 2px;
}

.ring-outer {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 2px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ring-inner { width: 70px; height: 70px; border-radius: 50%; border: 2px solid #e2e8f0; }
.ring-outer--sm { width: 90px; height: 90px; }
.ring-inner--sm { width: 60px; height: 60px; }

.co2-stats { display: flex; gap: 30px; }
.stat-label { font-size: 11px; font-weight: 600; }
.stat-sub { font-size: 10px; }
.stat-value { font-size: 18px; font-weight: bold; margin-top: 5px; }
.stat-value-inline { font-size: 18px; margin-left: 5px; }

.ps-tabs-bar { display: flex; gap: 10px; border-bottom: 1px solid #e2e8f0; margin-bottom: 15px; }

.table-scroll { overflow-x: auto; border-radius: 6px; }

.summary-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.summary-table thead tr { text-align: left; }
.summary-table th { padding: 12px 15px; font-weight: 600; border-bottom: 1px solid #e2e8f0; }
.summary-table .empty-cell { padding: 20px; text-align: center; }

.insights-title-group { display: flex; align-items: center; gap: 15px; }
.insights-title { margin: 0; font-size: 16px; font-weight: 700; }
.insights-subtitle { font-size: 12px; padding-left: 10px; }

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.metrics-placeholder { grid-column: 1 / -1; font-size: 14px; text-align: center; }

.chart-card {
    border-radius: 12px;
    padding: 25px;
    border: 1px solid rgba(0, 0, 0, 0.05);
    height: 300px;
    position: relative;
    margin-bottom: 30px;
}

.chart-empty {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 14px;
    text-align: center;
}

.chart-empty i { font-size: 32px; display: block; margin-bottom: 10px; opacity: 0.5; }

.chart-canvas { width: 100%; height: 100%; }

/* --- Climate sub-tab -------------------------------------------------------------- */
.climate-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 15px;
}

.btn-climate {
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.btn-climate--ghost { background: transparent; border: none; }

.climate-metrics-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 20px;
    margin-bottom: 30px;
}

.metric-unit { font-size: 10px; font-weight: normal; }

.climate-chart-wrap { height: 300px; padding: 20px; }
.climate-chart-title { text-align: center; margin-bottom: 10px; font-size: 15px; }

/* --- Pond modal -------------------------------------------------------------------- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.modal-box {
    width: 400px;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.modal-title { margin: 0 0 20px 0; font-size: 18px; }

.field-label { display: block; font-size: 13px; margin-bottom: 5px; }

.modal-actions { display: flex; justify-content: flex-end; gap: 10px; }

/* --- Generic utilities (kept last so they win ordering ties) ----------------------- */
.pos-relative { position: relative; }
.flex-1 { flex: 1; }
.flex-1-2 { flex: 1.2; }
.flex-1-5 { flex: 1.5; }
.flex-center { display: flex; align-items: center; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.icon-8 { font-size: 8px; margin-right: 6px; }
.icon-10 { font-size: 10px; }
.icon-12 { font-size: 12px; }
.w-60 { width: 60%; }
.w-40 { width: 40%; }
.w-20 { width: 20%; }
.mb-15 { margin-bottom: 15px; }
.mb-20 { margin-bottom: 20px; }
.mb-25 { margin-bottom: 25px; }
.icon-soft-green { color: #d6e5d3; }

/* --- Water Quality & Feed/FCR operation tabs --- */
.op-pane-empty { text-align: center; padding: 30px 10px; font-size: 13.5px; }
.wq-hint { font-size: 12.5px; margin: -8px 0 16px; }

.summary-table td { padding: 12px 15px; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }

.wq-pill {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 9px;
    border-radius: 10px;
    margin-top: 4px;
}
.wq-pill--ok    { background: #ecfdf3; color: #16a34a; }
.wq-pill--warn  { background: #fffbeb; color: #d97706; }
.wq-pill--alert { background: #fef2f2; color: #dc2626; }
.wq-pill--na    { background: #f1f5f9; color: #94a3b8; }

.wq-legend {
    font-size: 11px;
    color: #94a3b8;
    margin-top: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
}
.wq-legend-item strong { color: #64748b; }

.fcr-kpis {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}
.fcr-kpi {
    border: 1px solid #eef2f6;
    border-radius: 12px;
    padding: 16px;
    text-align: center;
}
.fcr-kpi-value { font-size: 20px; font-weight: 800; color: #10243b; }
.fcr-kpi-label { font-size: 11.5px; color: #64748b; font-weight: 600; margin-top: 4px; }

.feed-form {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    flex-wrap: wrap;
    margin-bottom: 20px;
    padding: 16px;
    border: 1px dashed #dbe4ee;
    border-radius: 12px;
}
.feed-form-field { display: flex; flex-direction: column; gap: 5px; }
.feed-form-field label { font-size: 11.5px; font-weight: 600; color: #64748b; }
.feed-form-field .form-control-minimal { padding: 9px 12px; }
.feed-add-btn {
    padding: 10px 18px;
    border-radius: 8px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}
.feed-del { color: #ef4444; cursor: pointer; padding: 4px 6px; border-radius: 6px; }
.feed-del:hover { background: #fee2e2; }

/* --- Lab water tests --- */
.lab-input { width: 96px; }
.lab-cell-empty { color: #cbd5e1; }
/* Pond hover tooltip.
   Distinct from .pond-label — that one is printed permanently inside the
   outline and has to stay quiet, this one appears above the pond on hover and
   should read clearly against a satellite image, which is the worst possible
   background for text. Hence the solid dark card rather than Leaflet's
   translucent default. */
.leaflet-tooltip.pond-hover {
    background: var(--nz-navy, #00243c);
    border: 0;
    border-radius: 8px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .28);
    color: #fff;
    font-size: 12.5px;
    line-height: 1.45;
    padding: 7px 11px;
    white-space: nowrap;
}

.leaflet-tooltip.pond-hover strong { font-weight: 700; }
.leaflet-tooltip.pond-hover em { font-style: normal; opacity: .7; }

.leaflet-tooltip.pond-hover.leaflet-tooltip-top::before {
    border-top-color: var(--nz-navy, #00243c);
}

/* =============================================================================
   SCROLLING — why the overview was cut off at "CAA registration".

   `.tab-content` already carried `flex: 1; min-height: 0; overflow-y: auto`.
   That only works when every ancestor up to the viewport is a height-bounded
   flex column; break the chain anywhere and `flex: 1` resolves against
   auto height, the element grows past the viewport, and `overflow-y: auto`
   never has anything to overflow. The content is simply below the fold with
   no scrollbar — which is exactly what happened.

   Capping the height in viewport units doesn't depend on the chain at all.
   The offset is the sticky header plus the tab strip.
   ========================================================================== */
.tab-content.active {
    max-height: calc(100vh - 200px);
    overflow-y: auto;
}

/* The overview's left column scrolls inside that, so the map beside it stays
   put while the farm details move — two independent scroll regions rather than
   one that drags the map off screen. */
.overview-left-col {
    max-height: 100%;
    overflow-y: auto;
}

@media (max-width: 900px) {
    /* Stacked on a phone: one scroll region, not two nested ones. Nested
       scrolling on touch is a known trap — the inner region swallows the
       gesture and the page appears frozen. */
    .tab-content.active { max-height: none; overflow-y: visible; }
    .overview-left-col { max-height: none; overflow-y: visible; }
    .main-workspace { overflow-y: auto; }
}
