/* Basic Color Palette */
:root {
    --primary-color: #538136; /* Dark green */
    --secondary-color: #D8C99B; /* Light off-white  */
    --background-color: #F2F5EA; /* Light brown */
    --text-color: #2B2C28; /* Very dark gray */
    --button-primary-color: #704E2E; /* Brown */
    --button-primary-color-hover: #5A3F22; /* Darker Brown for hover */
    --button-secondary-color: #BBC7A4; /* Muted green */
    --button-secondary-color-hover: #A3AF8E; /* Darker Muted green for hover */
    --accent-color: #D6DBD2; /* Light gray */
    --highlight-color: #BF8B67; /* Warm orange */
    --crop-info-container-color: #3a9137;
    --crop-info-box-color: #a15f2f;
    --activity-section: rgba(83, 129, 54, 0.82);
    --crops-section: #704E2E;
}

/* General Styles */
body {
    background-color: var(--background-color);
    color: var(--text-color);
    font-family: Arial, sans-serif;
    font-size: 16px;
    margin: 0 10px 10px 10px;
    padding: 0;
}

.header-tight h1 {
    margin-bottom: 10px;
  }
  
.header-tight p {
    margin-top: 0;
}

/* Ion Icon */
ion-icon.custom-icon {
    font-size:32px;
    color:green;
}

#map-page-wrapper,
#locations-page-wrapper,
#activities-page-wrapper,
#crops-page-wrapper {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 140px); /* 60px navbar + 60px footer padding + 20px main margin-bottom */
}

.main-map {
    flex: 1;
    border-radius: 10px;
}

.map-layer-selector {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

.map-layer-selector label {
    font-weight: 700;
    font-size: 0.9rem;
    letter-spacing: 0.05em;
    opacity: 0.7;
    color: #1a1a1a;
}

.map-layer-selector input[type="checkbox"] {
    accent-color: var(--primary-color);
}


/* Locations section */
/* Farm List */
#locations-container {
    min-height: calc(100vh - 160px);
    box-sizing: border-box;
}
.layout-1 {
    display: grid;
    grid-template-columns: 1fr;  
    grid-template-rows: 1fr;  
}

.layout-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr; 
    gap: 1rem;
}

.layout-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr); 
    grid-template-rows: 1fr; 
    gap: 1rem;
}

.layout-4 {
    display: grid;
    grid-template-columns: 1fr 1fr ;
    grid-template-rows: 1fr 1fr; 
    gap: 1rem;
}

.layout-5 {
    display: grid;
    grid-template-columns: repeat(3, 1fr); 
    grid-template-rows: 1fr 1fr;      
    gap: 1rem;
}

.location-card {
    position: relative;
    overflow: hidden;
    border: 1px solid #ccc;
    border-radius: 1rem;
    background-color: var(--background-color);
    height: 100%;
    box-sizing: border-box;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    overflow: hidden;
    display: block; 
}

.location-card-map {
    flex: 1;               
    width: 100%;            
    height: 100%;          
}

.location-title {
    position: absolute;
    top: 0.3rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3000;
    color: white;
    background-color: var(--button-secondary-color);
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-size: 1.2rem;
}

/* Location view */
.layout-location-container {
    display: grid;
    height: calc(100vh - 140px); /* +10px del margin-top */
    width: 100%;
    gap: 10px;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 100%;
    grid-template-areas: "location-data location-map";
}
.location-data {
    grid-area: location-data;
    display: flex;
    flex-direction: column;
    padding: 10px;
    margin-top: 20px;
    border: 1px solid var(--primary-color);
    border-radius: 10px;
    background-color: var(--background-color);
    overflow: hidden;
}
.location-data-title {
    display: flex;
    align-items: center;       
    gap:10px;
    margin-top:0px;
}
.location-data-title h2 {
    margin: 0;
    font-size: 1.8rem;
}

.location-data-title .edit-icon,
.location-data-title .add-icon {
    background: var(--location-accent, var(--primary-color));
    color: #fff;
    border-radius: 6px;
    padding: 4px 8px;
    margin-left: 0;
    transition: filter 0.15s;
}

.location-data-title .edit-icon:hover,
.location-data-title .add-icon:hover {
    filter: brightness(0.82);
}

.location-data-title .edit-icon.selected,
.location-data-title .add-icon.selected {
    filter: brightness(0.75);
    box-shadow: 0 0 0 2px rgba(0,0,0,0.18);
}

.location-map {
    display: flex;
    flex-direction: column;
    grid-area: location-map;
    margin-top: 20px;
    border: 1px solid var(--primary-color);
    border-radius: 10px;
    background-color: var(--background-color);
}
.location-childs {
    grid-area: location-childs;
    margin-right: 10px;
    border: 1px solid var(--primary-color);
    border-radius: 10px;
    background-color: var(--background-color);
}


/* Crops */

/* Main container */
#addCrop {
    display: flex; /* Flexbox to split into columns */
    justify-content: space-between; /* Space between elements */
    align-items: flex-start; /* Align elements at the top vertically */
    gap: 100px; /* Spacing between the form and the map */
    margin: 10px; /* Spacing around the container */
}

/* Form */
#cropForm {
    width: 40%; /* Takes half the width */
    max-width: 600px; /* Maximum width */
}

/* Map */
#addCropMap {
    width: 60%; /* Takes half the width */
    height: 700px; /* Fixed height for the map */
    border: 1px solid #ccc; /* Border around the map */
    border-radius: 15px; /* Rounded corners */
    background-color: #f0f0f0; /* Background color if the map doesn't load */
}

.add-activity,
.add-crop {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    height: calc(100vh - 140px);
    margin-top: 10px;
    padding: 10px 0;
    box-sizing: border-box;
}

.add-activity-left,
.add-crop-left {
    display: flex;
    flex-direction: column; 
    width: 40%;
    max-width: 700px;
    height: 100%;
}

.add-activity-title,
.add-crop-title {
    text-align: center;
    font-size: 26px;
    font-weight: 700;
    margin: 0 0 10px 0;
}

.add-form {
    flex: 1; 
    overflow-y: auto;
    min-height: 0; 
}

.add-form-map {
    padding: 10px;
    flex: 1;
    height: 100%;
    border: 1px solid #ccc;
    border-radius: 15px;
    background-color: #f0f0f0;
    box-sizing: border-box;
}

.form-field__label {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--primary-color);
}
.form-field__input {
    flex: 1;
}
.form-field__input input,
.form-field__input select,
.form-field__input textarea {
    font-size: 16px;
    width: 100%;
    box-sizing: border-box;
}
/* Form selects */
#farmSelect,
#plotSelect,
#cropSelect,
#cropTypeSelect,
#varietySelect,
#nameInput,
#plannedPlantingSelect,
#plannedHarvestSelect,
#cropArrangementSelect,
#batchSelect,
#destinationSelect,
#activityTypeSelect,
#plannedStartSelect,
#plannedEndSelect,
#recurrencySelect {
    font-size: 16px;
    padding: 10px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}
select.add-option-available option:last-child {
    color: #a52626;
    font-style: italic;
    background-color: #f8f9fa;
}
.vertical {
    display:flex;
    flex-direction: column;
    width: 100%;
}

#addCropTypeContainer,
#addVarietyContainer {
    display: flex;
    align-items: center;
    gap: 6px;
    width: fit-content; /* ← Esto fuerza el ancho al contenido */
}

#addCropTypeContainer .form-field__input input,
#addVarietyContainer .form-field__input input {
    width: 160px;
    padding: 3px 6px;
    font-size: 13px;
}

#addCropTypeContainer .btn,
#addVarietyContainer .btn {
    white-space: nowrap;
}
.select2-container--default .select2-selection--multiple {
    min-height: 30px !important;    
    max-height: 35px !important;    
    overflow-y: auto !important;   
}

.select2-container--default .select2-results > .select2-results__options {
    max-height: 70px !important;    
    overflow-y: auto !important;    
}

.select2-container {
    width: 100% !important;
    min-width: 200px !important;
}

.select2-search--inline .select2-search__field {
    min-width: 150px !important;
}
.form-field__checkbox {
    position: relative;
    display: inline-block;
    width: 20px;
    height: 20px;
}

.form-field__checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
    cursor: pointer;
    accent-color: green; 
}
.form-field__content {
    display: flex;
    align-items: center;
    gap: 18px; 
    margin-bottom: 5px;

    transition: all 0.8s ease-in-out;
    opacity: 1;
    overflow: hidden;
}
.form-optional-field__content {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 3px;

    transition: all 0.8s ease-in-out;
    opacity: 1;
    overflow: hidden;
}
.form-optional-field__content .form-field__input input,
.form-optional-field__content .form-field__input select,
.form-optional-field__content .form-field__input textarea {
    padding: 4px 8px !important;
    font-size: 0.9rem;
}

.form-field__content.is-hidden {
    opacity: 0;
    max-height: 0;
    margin-bottom: 0;
    pointer-events: none; 
}

/* Delete margin for button */
.form-field__content:last-child {
    margin-bottom: 0;
}
.form-optional {
    transition: all 0.8s ease-in-out;
    opacity: 1;
    overflow: hidden;
    background-color: rgb(229, 194, 128);
    border: 1px solid orange;
    border-radius: 10px;
    padding: 5px;
    margin-bottom: 5px;
}
.form-optional.is-hidden {
    opacity: 0;
    max-height: 0;
    margin-bottom: 0;
    pointer-events: none; 
}

.form-field__status-indicator {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid #ddd;
    transition: all 0.8s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: transparent;
}

.form-field__extra-options{
    display:flex;
    gap:10px;
    align-items: center;
    margin-bottom: 12px;
}
.form-field__label-option {
    font-weight: 400;
}

.form-field__button {
    width: 30px;
    height: 30px;
    border: 2px solid orange;
    background: white;
    color: orange;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    transition: all 0.8s ease;
}

.form-field__button.pressed {
    transform: rotate(180deg); 
}

.form-field__status-indicator.completed {
    background-color: #4CAF50;
    border-color: #4CAF50;
    color: white;
    font-weight: bold;
}

.location-info-container{
    background-color: var(--secondary-color);
    padding: 20px;
    border-radius: 10px;
    margin-left:40px;
}

.crop-info-container,
.activity-info-container {
    background-color: var(--secondary-color);
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 10px;
}
.progress-container {
    background-color: var(--accent-color); 
    border-radius: 5px; 
    height: 20px; 
    position: relative;
    overflow: hidden;
    flex: 1; 
}

.progress-bar {
    background-color: orange;
    height: 100%;
    width: 0; 
    position: absolute;
    left: 0;
    top: 0;
}

.progress-bar.is-complete {
    background-color: green; 
  }

.info-container {
    display: flex;               
    justify-content: center;     
    align-items: center;         
    gap: 15%;
    margin-top: 10px;            
}

.info-container div {
    text-align: center;         
}
.parent-link {
    color: var(--button-primary-color);
    text-decoration: underline;
    font-weight: bold;
}
.location-parent {
    font-size: 0.8em;
    color: #777;
}
.crop-link {
    color: var(--text-color);
    font-size: 1.1rem;
    border-radius: 3px;
    text-decoration: underline;
    font-weight: 600;
}

.activity-link {
    color: var(--text-color);
    font-size: 1.1rem;
    border-radius: 3px;
    text-decoration: underline;
    font-weight: 600;
}

.secondary-link {
    color: var(--text-color);
    font-size: 1rem;
    border-radius: 3px;
    text-decoration: underline;
    font-weight: 500;
}

.farm-link  { color: var(--farm-accent); }
.field-link { color: var(--field-accent); }
.plot-link  { color: var(--plot-accent); }

.custom-popup .crop-link{
    color: var(--button-primary-color);
    font-size: 16px; 
    border-radius: 3px; /* Optional: Add rounded corners */
    text-decoration: underline;
    font-weight: bold;
}
.custom-popup .title .crop-link {
    font-size: 22px; 
}

.secondary-link:hover {
    color: #2B2C28;
    text-decoration: underline;
}

/* Same as crop and activity link without underline decoration */
.highlight-3 {
    color: var(--button-primary-color);
    font-size: 1.2em; 
    border-radius: 3px; /* Optional: Add rounded corners */
    text-decoration: none;
    font-weight: bold;
}

/* Active objects */
.ACTIVE-crop,
.IN_PROGRESS-activity,
.ON_EXECUTION-mission {
    color: orange; 
    font-weight: bold;
}
/* Paused objects */
.PAUSED-activity,
.SELF_PAUSED-mission,
.USER_PAUSED-mission {
    color: rgb(255, 123, 0);
    font-weight: bold;
}

/* Text blink animation */
  @keyframes textBlink {
    0%, 100% {
      color: rgba(255, 255, 255, 1); /* Fully visible */
    }
    50% {
      color: rgba(255, 255, 255, 0.3); /* Partially faded */
    }
  }
/* Wagus blink animation */
@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.1; }
}

@keyframes blinkWithBackground {
    0%, 100% { 
        opacity: 1;
        background-color: white;
    }
    50% { 
        opacity: 0.5;
        background-color: black;
    }
}

.blinking-icon {
    animation: blink 1s infinite;
}

/* Aborted objects */
.ABORTED-crop,
.ABORTED-activity,
.EXPIRED-activity,
.SELF_ABORTED-mission,
.USER_ABORTED-mission,
.REJECTED-mission,
.ERROR-mission,
.BRINGUP_ERROR-rover,
.ERROR_HANDLING-rover,
.ALARM-rover {
    color: red;
    font-weight: bold;
}
.BRINGUP-rover {
    color:white;
    font-weight: bold;
}
.ON_MISSION-rover {
    color : blue;
    font-weight: bold;
}
.MANUAL-rover {
    color:purple;
    font-weight: bold;

}
.BATTERY_CRITICAL-rover {
    color:rgb(138, 138, 4);
    font-weight: bold;
}
.OPERATOR_NEEDED-rover {
    color:orange;
    font-weight: bold;
}
.PENDING-activity {
    color: rgb(134, 58, 4);
    font-weight: bold;
}
.DISCONNECTED-rover{
    color:gray;
    font-weight: bold;
}

.COMPLETED-crop,
.COMPLETED-activity,
.FINISHED-mission,
.IDLE-rover {
    color: green;
    font-weight: bold;
}

.LOCKED-rover{
    color: rgb(228, 228, 0);
    font-weight: bold;
}

.PLANNED-crop,
.SCHEDULED-activity,
.ASSIGNED-mission,
.SENT-mission,
.RECEIVED-mission,
.ACCEPTED-mission {
    color: black; 
    font-weight: bold;
}

.RESCHEDULED-activity{
    color:purple;
    font-weight: bold;
}


/* Styles for activities*/

.from-to-container{
    display:flex;
    align-items: center;
    gap:10px;
}

.is-hidden {
    display: none !important;
}

.planned-start-container {
    display: flex; 
    align-items: center; 
    justify-content: center;
    gap: 10px; 
}

.planned-start-field {
    flex: 1; 
}

.planned-start-asap {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px; 
}

@keyframes expand {
    from {
        max-height: 0;
    }
    to {
        max-height: 500px;
    }
}

@keyframes collapse {
    from {
        max-height: 500px;
    }
    to {
        max-height: 0;
    }
}
.box-container {
    max-height: 500px;
    overflow-y: scroll;
}
.box-container.expanding {
    animation: expand 2s ease forwards;
}
.box-container.collapsing {
    animation: collapse 1s ease forwards;
}

.beds-list {
    column-count: 2;
    column-fill: auto;    /* fill column 1 top-to-bottom before starting column 2 */
    max-height: 300px;    
    overflow: visible;
    margin: 0;
    padding: 0;
    list-style: none;
}

.beds-list .bed-item {
    break-inside: avoid; /* keep each bed item in one column */
}

.beds-list.expanding {
    animation: expand 2s ease forwards;
}

.beds-list.collapsing {
    animation: collapse 1s ease forwards;
}
/* Toggle Button */
.toggle-button {
    display: inline-block;
    margin-top: 10px;
    padding: 5px 10px;
    background-color: green;
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
}
.toggle-button-object {
    padding: 5px 10px;
    background-color: var(--background-color);
    border: none;
    border-radius: 3px;
    cursor: pointer;
}

.toggle-button:hover {
    background-color: green;
}
strong {
    font-weight: bold;
}

.rover-object-mission {
    flex: 1; 
    display: flex;
    flex-direction: column; 
    justify-content: flex-start; 
    padding: 10px;
    border-radius: 5px;
}
.missions-header {
    display: flex;
    align-items: center;
    gap: 10px;
}

.mission-details {
    display: flex;
    align-items: center;
    flex-wrap: wrap; 
    gap: 10px;
}

.mission-detail-box.expanding {
    animation: expand 2s ease forwards;
}
.mission-detail-box.collapsing {
    animation: collapse 1s ease forwards;
}

.rover-object-mission, .object-item {
    flex: 0 0 250px;
}

.button-wrapper {
    display: flex;
    gap: 5px;
}

.active-crops-wrapper {
    max-height: 250px;            
    overflow-y: auto;        
    overflow-x: hidden;
}
.rover-objects-wrapper {
    max-height: 120px;            
    overflow-y: auto;        
    overflow-x: hidden;
}
.farm-objects-wrapper {
    max-height: 180px;            
    overflow-y: auto;        
    overflow-x: hidden;
}

.field-objects-wrapper {
    max-height: 300px;
    overflow-y: auto;
    overflow-x: hidden;
}

/* ── farm_data layout ──────────────────────────────────────────────── */
.farm-data-layout,
.field-data-layout,
.plot-data-layout {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.farm-section--static,
.field-section--static,
.plot-section--static {
    flex-shrink: 0;
}

.farm-section--crops,
.farm-section--activities,
.field-section--crops,
.field-section--activities,
.plot-sections--mid,
.plot-section--crop,
.plot-section--inprogress,
.plot-section--future {
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.farm-section--crops,
.field-section--crops       { flex: 4; }

.farm-section--activities,
.field-section--activities  { flex: 2; }

/* plot: mid=1, future=1 → 50/50 of remaining space after static */
.plot-sections--mid         { flex: 1; }
.plot-section--future       { flex: 1; }

/* inside mid: crop and inprogress split 50/50 */
.plot-section--crop,
.plot-section--inprogress   { flex: 1; }

.farm-section--crops .farm-objects-wrapper,
.farm-section--activities .farm-objects-wrapper,
.field-section--crops .field-objects-wrapper,
.field-section--activities .field-objects-wrapper,
.plot-section--crop .plot-objects-wrapper,
.plot-section--inprogress .plot-objects-wrapper,
.plot-section--future .plot-objects-wrapper {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    max-height: none;
    overflow-y: unset;
}

/* ── location type accent theming ──────────────────────────────────── */
:root {
    --farm-accent:  #5379a4;
    --field-accent: #478547;
    --plot-accent:  #af4645;
}

.location-accent-strip {
    height: 5px;
    background-color: var(--location-accent, var(--primary-color));
    margin: -10px -10px 10px -10px;
    border-radius: 9px 9px 0 0;
    flex-shrink: 0;
}

.location-theme .location-data-title h2,
.farm-data-layout .location-data-title h2,
.field-data-layout .location-data-title h2,
.plot-data-layout .location-data-title h2 {
    border-left: 4px solid var(--location-accent, var(--primary-color));
    padding-left: 10px;
}

.farm-divider {
    border: none;
    border-top: 1px solid var(--location-accent, var(--primary-color));
    opacity: 0.35;
    margin: 10px 0;
}

.farm-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    border-left: 3px solid var(--location-accent, var(--primary-color));
    padding-left: 8px;
    margin-bottom: 6px;
}

.section-title-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

.section-count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 18px;
    padding: 0 5px;
    background-color: var(--location-accent, var(--primary-color));
    color: #fff;
    border-radius: 10px;
    font-size: 0.72rem;
    font-weight: 600;
}


.farm-info-table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.farm-info-table th,
.farm-info-table td {
    width: 33.33%;
}

.farm-info-table th {
    text-align: left;
    padding: 6px 8px;
    border-bottom: 2px solid var(--location-accent, var(--primary-color));
    color: var(--location-accent, var(--primary-color));
    white-space: nowrap;
}

.farm-info-table td {
    padding: 6px 8px;
    vertical-align: top;
}

.farm-person-tag {
    display: inline-block;
    background-color: rgba(0, 0, 0, 0.06);
    border-radius: 4px;
    padding: 1px 6px;
    margin: 1px 2px;
    font-size: 0.82rem;
}

.farm-no-data {
    color: #999;
    font-style: italic;
    font-size: 0.85rem;
}

.plot-objects-wrapper {
    max-height: 110px;            
    overflow-y: auto;        
    overflow-x: hidden;
}

.info-header {
    display:flex;
    align-items: center;
    gap:10px;
}
.location-box {
    display:flex;
    align-items: center;
    gap:10px;

}
.location-info-box {
    background-color:var(--background-color);
    display: flex;
    align-items: center;
    gap:20px;
    padding: 15px;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 10px;
    position: relative;
}

.info-box {
    background-color: var(--background-color);
    padding: 0px 10px;
    border-radius: 5px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    margin-bottom: 10px;
    position: relative;
}

.activity-group .info-box {
    border-color: rgba(83, 129, 54, 0.65);
}

.crop-group .info-box {
    border-color: rgba(112, 78, 46, 0.65);
}

.info-location-box {
    background-color: var(--secondary-color);
    padding: 15px;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 10px;
    position: relative;
}

.info-box .highlight {
    color: var(--highlight-color);
    font-weight: bold;
}

.info-container-act {
    display: flex;               
    justify-content: center;     
    align-items: center;         
    gap: 5%;
    margin-top: 5px;            
}
.row-list-content {
    align-items: center;
    display: flex;
    flex-wrap: wrap;  /* Allow new elements on next line */
    gap: 10px; /
}
.object-item {
    flex: 0 0 210px; /* Fixed size 210px */
}
.object-item-time {
    flex: 0 0 280px; /* Fixed size 280px */
}
.object-item-buttons {
    flex: 0 0 290px; /* Fixed size 290px */
}
.object-location-item{
    flex: 0 0 180px;
}
.object-location-time-item{
    flex: 0 0 230px;
}

.info-container-act div {
    text-align: center;         
}

.highlight-2 {
    display: inline-block;
    color: var(--text-color);
    background-color: var(--button-secondary-color); /* Optional: Add background for more emphasis */
    padding: 5px 10px; /* Optional: Add padding for more emphasis */
    font-size: 1.2em; 
    border-radius: 3px; /* Optional: Add rounded corners */
    text-decoration: none;
    font-weight: bold;
}

.hidden {
    display: none;
    opacity: 0;
}

.visible {
    display: block;
    opacity: 1;
}

/* Activity View */
.layout-container {
    display: flex;
    flex-direction: row;
    gap: 10px;
    height: calc(100vh - 140px);
    margin-top: 10px;
    padding: 10px 0;
    box-sizing: border-box;
}

/* Left panel: Activity info + Missions */
.left-panel {
    flex: 0 0 40%;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
}

.activity-info-card {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px 16px;
    border: 1px solid var(--primary-color);
    border-radius: 10px;
    background-color: var(--background-color);
}

.activity-info-row2 {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 0.9rem;
}

.time-planned {
    color: rgb(138, 138, 138);
    font-style: italic;
}

.activity-info-sep {
    color: #ccc;
    font-weight: 300;
}

.missions-panel {
    flex: 1;
    min-height: 0;
    padding: 10px;
    border: 1px solid var(--primary-color);
    border-radius: 10px;
    background-color: var(--background-color);
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow: hidden;
}

.missions-carousel-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 0;
    overflow: hidden;
}

#mission-detail-box {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
    height: 100%;
}

.mission-slide {
    display: none;
}

.mission-slide.active {
    display: block;
}

.missions-nav {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid var(--primary-color);
    background: transparent;
    color: var(--primary-color);
    font-size: 15px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease, color 0.15s ease;
    line-height: 1;
}

.missions-nav:hover:not(:disabled) {
    background: var(--primary-color);
    color: white;
}

.missions-nav:disabled {
    opacity: 0.25;
    cursor: default;
}

.mission-number-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    background-color: var(--activity-section);
    color: white;
    border-radius: 50%;
    font-size: 11px;
    font-weight: bold;
    flex-shrink: 0;
    margin-left: 6px;
    vertical-align: middle;
}

.staff-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    background-color: #E8D9C7; /* Light brown, staff-only highlight */
    color: var(--crops-section);
    border-radius: 6px;
}

/* Right panel: Layer selection + Map */
.right-panel {
    flex: 0 0 60%;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.missions-layer-selector {
    position: absolute;
    bottom: 8px;
    left: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px 10px;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(4px);
    border-radius: 6px;
    padding: 5px 8px;
    pointer-events: auto;
}

.missions-layer-selector label {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.78rem;
    font-weight: 600;
    opacity: 0.75;
    color: #1a1a1a;
    cursor: pointer;
    white-space: nowrap;
}

.missions-layer-selector input[type="checkbox"] {
    accent-color: var(--primary-color);
    cursor: pointer;
}

/* Bed items in missions */
.mission-beds-divider {
    border: none;
    border-top: 1px solid rgba(0, 0, 0, 0.12);
    margin: 8px 0;
}

.bed-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 3px 0;
}

.bed-item__label {
    white-space: nowrap;
    min-width: 70px;
    font-size: 0.95rem;
    font-weight: 600;
}

.bed-item__bar {
    flex: 1;
    min-width: 0;
}

/* Flipper — the element that rotates */
.activity-detail-flipper {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.6s ease;
}

/* Flipped state — triggered by JS */
.activity-detail-flipper.is-flipped {
    transform: rotateY(180deg);
}

/* Shared face styles */
.activity-detail-face {
    position: absolute;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

/* Back face starts rotated so it is hidden by default */
.activity-detail-face--back {
    transform: rotateY(180deg);
}

/* Main container — grid position managed by wrapper */
.activity-detail-container {
    padding: 10px;
    display: flex;
    flex-direction: column;
    overflow: auto;
    border: 1px solid var(--primary-color);
    border-radius: 10px;
    background-color: var(--background-color);
}

.activity-detail-title {
    font-size: 22px;
    font-weight: 700;
    margin-top: 0;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: default;
}

.activity-detail-section {
    padding: 10px 0;
    border-top: 1px solid #e5e7eb;
}

.activity-detail-section:first-of-type {
    border-top: none;
}

/* Flip button */
.flip-btn {
    align-self: flex-start;
    background: none;
    border: none;
    color: var(--primary-color);
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    padding: 0;
    margin-bottom: 6px;
}

/* Description text — wraps long words and scrolls if needed */
.activity-detail-description-text {
    overflow-wrap: break-word;
    word-break: break-word;
    overflow: auto;
}

.activity-mission-divider {
    border: none;
    border-top: 1px solid rgba(0, 0, 0, 0.12);
    margin: 12px 0;
}

.map-container {
    flex: 1;
    min-height: 0;
    border-radius: 10px;
    background-color: var(--background-color);
}

.map-section .map-container {
    flex: 1;
    min-height: 0;
}

#layer-selection-form {
    width: fit-content;
    padding: 10px;
    margin-top: 10px;
    border: 2px solid var(--primary-color);
    border-radius: 10px;
    background-color: var(--background-color);
    box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.2);
}
.activity-schedule-table {
    width: 100%;
    max-width: 600px;
    max-height: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 12px; /* ← from 14px to 12px */
    margin: 0 auto;
}

.activity-schedule-table th,
.activity-schedule-table td {
    padding: 4px 6px; /* ← from 10px 12px to 8px 10px */
    border: 1px solid #000000;
    text-align: center;
    vertical-align: middle;
}

.activity-schedule-table thead th {
    background: var(--button-secondary-color);
    font-weight: 600;
    font-size: 0.9rem; 
}

.activity-schedule-table tbody td {
    font-weight: 600;
    font-size: 0.9rem; /* ← from 1rem to 0.9rem */
}

.activity-schedule-table tbody th {
    background: var(--button-secondary-color);
    font-weight: 600;
    font-size: 0.9rem;
    width: 90px;
}

.activity-schedule-table tr:hover td {
    background: var(--button-secondary-color-hover);
}

.activity-schedule-table thead th:first-child { border-top-left-radius: 10px; }
.activity-schedule-table thead th:last-child  { border-top-right-radius: 10px; }
.activity-schedule-table tbody tr:last-child th:first-child { border-bottom-left-radius: 10px; }
.activity-schedule-table tbody tr:last-child td:last-child  { border-bottom-right-radius: 10px; }

.delete-activity-type {
    position: absolute;
    right: 10px;
    bottom: 10px;
}
.leaflet-popup-content-wrapper {
    border: 2px solid var(--primary-color) !important;
    box-shadow: none !important;
    padding: 0 !important;
}

.leaflet-popup-tip {
    border-top: 2px solid var(--primary-color);
    box-shadow: none !important;
}

.custom-popup {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    color: var(--background-color);
    border-radius: 5px;
    padding: 10px;
    background-color: white;
    font-family: Arial, sans-serif;
    font-size: 16px;
    width: max-content;
    max-width: 280px;
}

.custom-popup p {
    margin: 0;
    padding: 0;
}


.custom-popup .title {
    align-self: center;
    font-size: 22px;
    text-align: center;
    color: var(--text-color);
    font-weight: bold;
    width: 100%;
    margin-bottom: 5px;
}

.custom-popup .title a { color: #2B2C28; }
.custom-popup .title a:hover { color: #2B2C28; }
.custom-popup a.secondary-link,
.custom-popup a.secondary-link:hover { color: #2B2C28; font-weight: bold; font-size: 1.1em; }

.location-data-title a.secondary-link,
.location-data-title a.secondary-link:hover { color: #2B2C28; font-weight: bold; font-size: 1.1em; }

.custom-popup .subtitle {
    align-self: center; 
    font-size: 19px;
    text-align: center; 
    color: var(--text-color);
    font-weight: bold;
    width: 100%; 
    margin-bottom: 5px;
}
.pop-up-label {
    color: var(--primary-color);
    font-weight: 700;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.pop-up-value {
    color: var(--text-color);
    text-transform: none;
    font-size: 1rem;
    font-weight: normal;
    letter-spacing: normal;
}


/* Footer with divider and icon */
.popup-footer {
    position: relative;
}

/* Divider line with flexbox */
.popup-divider {
    display: flex; /* Aligns the elements horizontally */
    justify-content: space-between; /* Pushes elements to the edges */
    align-items: center; /* Centers elements vertically */
    border-top: 1px solid #ccc; /* Creates the divider line */
    margin: 10px auto;
    padding-top: 10px; /* Adds space between the line and the buttons */
    width: 100%; /* Ensures the divider spans the full width */
    gap: 5px;
}
/* Styles for the Delete button */
.delete-icon {
    display: flex; /* Ensures it participates in the flexbox layout */
    align-items: center; /* Centers the icon vertically */
    font-size: 16px; /* Adjusts the icon size */
    color: red; /* Sets the icon color to red */
    cursor: pointer; /* Changes the cursor to a pointer on hover */
}

.delete-icon:hover {
    color: darkred; /* Changes the color when hovered */
}
.edit-icon {
    display: flex; /* Ensures it participates in the flexbox layout */
    align-items: center; /* Centers the icon vertically */
    font-size: 20px; /* Adjusts the icon size */
    color: black; /* Sets the icon color to red */
    cursor: pointer; /* Changes the cursor to a pointer on hover */
}
.add-icon {
    display: flex; /* Ensures it participates in the flexbox layout */
    align-items: center; /* Centers the icon vertically */
    font-size: 20px; /* Adjusts the icon size */
    color: black; /* Sets the icon color to red */
    cursor: pointer; /* Changes the cursor to a pointer on hover */
}
.locked-icon {
    display:flex;
    align-items: start;
    font-size: 20px;
    color: black;
    cursor: pointer;
}
.unlocked-icon {
    display:flex;
    align-items: start;
    font-size: 20px;
    color: black;
    cursor: pointer;
}
.locked-icon--pending,
.unlocked-icon--pending {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 2px;
}
.pending-transition-icon__current {
    color: black;
}
.pending-transition-icon__target {
    color: #d3d3d3;
}
.pending-transition-icon__dots {
    font-size: 12px;
    font-weight: bold;
    color: #999;
    line-height: 1;
}
.save-point-icon {
    display: flex;
    align-items: start;
    cursor: pointer;
}
/* Modal Overlay */
.loading-overlay {
    position: absolute;     
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5); 
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    visibility: hidden; /* Default: Hidden */
}

/* Loading message */
.loading-message {
    background: white;
    padding: 20px;
    font-size: 18px;
    font-weight: bold;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
}
/* Tooltip style */
.tooltip {
    position: absolute;
    background: #444;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 14px;
    white-space: nowrap;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
    z-index: 9999;
}

/* Tooltip arrow */
.tooltip::after {
    content: "";
    position: absolute;
    top: 50%;
    left: -8px; /* Moves the arrow to the left */
    transform: translateY(-50%);
    border-width: 5px;
    border-style: solid;
    border-color: transparent #444 transparent transparent;
}
/* Login messages */
.messages {
    margin: 10px 0;
    padding: 10px;
    text-align: center;
}

.messages-review {
    margin: 0px;
    padding: 10px;
    text-align: center;
    width: 300px;
}

.alert {
    padding: 10px;
    border-radius: 5px;
    font-weight: bold;
    text-align: center;
}

.alert-error {
    background-color: #ffdddd;
    color: #a94442;
    border: 1px solid #a94442;
    display: block; 
    margin-bottom: 5px;
}

.alert-success {
    background-color: #ddffdd;
    color: #3c763d;
    border: 1px solid #3c763d;
}
#bedSelect + .select2-container {
    margin-left: 0px !important;
    margin-bottom: 10px;
}

/* Planning Gant */
/* Row crop object */
.ganttCrop {
    height: 58px !important;
    line-height: 58px !important;
    display:flex;
    align-items: center;
    background-color: var(--secondary-color) !important;  /* Dark Brown */
    color: black !important;               /* Visible */
    border: 1px solid black !important;  /* Darker brown */
}

/* Plot name */
.row.name {
    background-color: var(--background-color) !important;
    height: 60px !important;
    line-height: 60px !important;
    display: flex;
    align-items: center;
}

/* Rows */
.row.day.wd,
.row.date.wd,
.row.month,
.row.year,
.row.spacer,
.navigate {
    background-color: var(--background-color) !important;
}

/* Account */
.account-tables-layout {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    justify-content: center;
    margin-top: 20px;
    margin-bottom: 20px;
}

.account-section {
    min-width: 220px;
}

.account-roles-section {
    flex: 0 0 auto;
}

.account-section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.account-section-header h3 {
    margin: 0;
    white-space: nowrap;
}

.account-section__separator {
    flex: 1;
    height: 1px;
    background: var(--text-color);
    opacity: 0.2;
}

.account-section__actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-delete-circle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--highlight-color);
    opacity: 0.82;
    color: #fff;
    font-size: 22px;
    font-weight: 400;
    border: none;
    cursor: pointer;
    flex-shrink: 0;
    text-decoration: none;
}

.btn-delete-circle:hover {
    opacity: 1;
}

.btn-edit-circle {
    position: relative;
    display: inline-block;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--button-secondary-color);
    opacity: 0.9;
    color: #fff;
    border: none;
    cursor: pointer;
    flex-shrink: 0;
    text-decoration: none;
}

.btn-edit-circle svg {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.btn-edit-circle:hover {
    opacity: 1;
}

.btn-circle-sm {
    width: 28px !important;
    height: 28px !important;
    font-size: 18px !important;
    line-height: 1 !important;
}

.account-section-footer {
    margin-top: 10px;
}

.account-layout-divider {
    width: 1px;
    align-self: stretch;
    background: var(--text-color);
    opacity: 0.12;
    flex-shrink: 0;
}

.account-permissions-section {
    flex: 0 0 auto;
}

.account-permissions-section .role-permissions-matrix {
    border-color: var(--primary-color);
    font-size: 0.88rem;
}

.account-permissions-section .matrix-cell {
    padding: 0 14px;
}

.account-admin-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border-radius: 10px;
    border: 2px solid var(--primary-color);
    overflow: hidden;
    font-size: 0.9rem;
}

.account-admin-table td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--accent-color);
    color: var(--text-color);
}

.account-admin-table tr:last-child td {
    border-bottom: none;
}

.account-admin-empty {
    color: #aaa;
    font-style: italic;
}

#users-farms-roles-matrix {
    width: auto;
    border-collapse: separate;
    border-spacing: 0;
    border-radius: 10px;
    border: 2px solid var(--primary-color);
    overflow: hidden;
    font-size: 0.88rem;
}

#users-farms-roles-matrix th {
    background: var(--primary-color);
    color: #fff;
    padding: 10px 14px;
    font-weight: 600;
    text-align: left;
}

#users-farms-roles-matrix td {
    padding: 8px 14px;
    border-bottom: 1px solid var(--accent-color);
}

#users-farms-roles-matrix tbody tr:last-child td {
    border-bottom: none;
}

#users-farms-roles-matrix tbody tr:hover {
    background: rgba(83, 129, 54, 0.06);
}

/* User Info Layout */
.user-info-layout {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 20px;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.user-info-top-row {
    display: flex;
    gap: 20px;
}

.user-info-card {
    flex: 1;
    border-collapse: separate;
    border-spacing: 0;
    border-radius: 10px;
    border: 2px solid var(--primary-color);
    overflow: hidden;
}

.user-info-card thead th {
    background: var(--primary-color);
    color: #fff;
    padding: 10px 16px;
    font-weight: 600;
}

.user-info-card__header {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-info-card__header span {
    white-space: nowrap;
    font-size: 0.95rem;
}

.user-info-card__separator {
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.4);
}

.user-info-card tbody td {
    padding: 10px 16px;
    font-size: 0.95rem;
}

.user-info-farms-section {
    width: 100%;
}

.user-farms-roles-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border-radius: 10px;
    border: 2px solid var(--primary-color);
    overflow: hidden;
    font-size: 0.88rem;
}

.user-farms-roles-table th {
    background: var(--primary-color);
    color: #fff;
    padding: 8px 14px;
    font-weight: 600;
    text-align: left;
}

.user-farms-roles-table td {
    padding: 7px 14px;
    border-bottom: 1px solid var(--accent-color);
}

.user-farms-roles-table tbody tr:last-child td {
    border-bottom: none;
}

.user-farms-roles-table tbody tr:hover {
    background: rgba(83, 129, 54, 0.06);
}

.user-info-card__actions {
    display: flex;
    gap: 10px;
    margin-top: 16px;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    justify-content: center;
}

/* Tutorial */
.tutorial-column.account {
    flex: 0 0 auto;        
    width: 590px !important;
    height: 240px !important;
    justify-content: center;
    align-items: center;
  }
.tutorial-permission-legend{
    text-align: left;
    width: 590px !important;
    padding: 10px 0 0 10px; 
    margin: 0;            
}
.tutorial-permission-legend  p {
    margin: 0;
    padding: 0;
    font-size: 12px;
    font-family: 'Roboto', sans-serif;
}
.role-permissions-matrix {
    display:flex;
    justify-content: space-between;
    border: 3px solid black;
    border-radius: 10px;
}
.matrix-column {
    display:flex;
    flex-direction: column;
    margin-top:20px;
}

.matrix-cell.full-access {
    color: green; 
    font-weight: bold;
}
.matrix-cell.view-only {
    color: orange; 
    font-weight: bold;
}
.matrix-cell.no-access {
    color: red; 
    font-weight: bold;
}

.matrix-column.first {
    margin-left:20px;
}
.matrix-column.last {
    margin-right:20px;
}
.matrix-cell.title {
    font-weight: bold;
}
.matrix-cell.header {
    margin-top:10px;
}

.matrix-cell {
    height:30px;
}

#tutorial-modal {
    position: fixed;
    top: 73px;
    left: 0;
    width: 100%;
    height: calc(100vh - 73px);
    background-color: #5381364D;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    overflow-y: auto;
    z-index: 3000;
    padding: 20px;
    box-sizing: border-box;
}

.tutorial-title {
    font-weight: 900;
    font-size: 24px;
    color:  #1F1F1F;  
}

.tutorial-subtitle {
    margin-top:0px;
    font-size: 20px;
    font-weight: 600;
    color:  #1F1F1F;  
}
.tutorial-description {
    margin: 0;                 
    padding: 2px 0;            
    font-size: 18px;           
    line-height: 1.4;          
    color: #1F1F1F;               
}

.tutorial-modal-content {
    position: relative;
    background-color: var(--secondary-color);
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 0 15px rgba(0,0,0,0.3);
    max-width: 1200px;
    width: 80%;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin: auto;
    flex-shrink: 0;
  }
  
  .close-tutorial-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #555;
  }
  
  .close-btn:hover {
    color: red;
  }
  .tutorial-columns {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin-top: 20px;
    flex-wrap: wrap;
  }
  .tutorial-rows {
    display:flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 5px;
    flex-wrap: wrap;
  }
  .tutorial-row {
    flex: 1;
    min-width: 200px;
    width: 300px;
    text-align: center;
    justify-content: center;   /* Horizontal */
    align-items: center;       /* Vertical */
    border-radius: 5px;
  }
  
  .tutorial-column {
    flex: 1;
    min-width: 50px;
    text-align: center;
  }

  .tutorial-row.field {
    background-color: rgba(41, 192, 41, 0.7);
  }
  .tutorial-row.plot {
    background-color: rgba(197, 10, 10, 0.7);
  }
  .tutorial-row.bed {
    background-color: rgb(250, 162, 0, 0.7);
  }

  .tutorial-row p.description {
    padding: 0 10px 10px 10px;
  }
  
  .tutorial-row p.title {
    font-weight: 900;
    font-size: 20px;
    margin-bottom: 10px;
  }
  .tutorial-column p.title {
    align-items: center;
    text-align: center;
    font-weight: 900;
    font-size: 20px;
    margin-bottom: 10px;
  }
  
  .tutorial-column video {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9; /* For browsers that support it */
    max-width: 800px;     
    max-height: 500px;     
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
  }

  .is-hidden {
    display:none !important;
  }

/* Maximum width for Fungi Slide */
.fungicide-slide { max-width: 1200px; margin: 0 auto; }

/* Three columns */
.three-cols {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 28px;
  align-items: start;
  margin-top:5px;
}

/* Header: Number + Title */
.step-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 8px;
}
.step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px; height: 30px;
  border-radius: 999px;
  background: #111827; color: #fff;
  font-weight: 700; font-size: 14px;
  flex: 0 0 auto;
}
.step-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
}

/* Separator */
.step-sep {
  height: 2px;
  background: #111827;
  opacity: 0.1;
  margin-bottom: 10px;
}

/* Step body */
.step-body { display: grid; gap: 8px; }
.tutorial-description u { text-underline-offset: 3px; }

/* Preparation List */
.tutorial-ol { margin: 0; padding-left: 18px; display: grid; gap: 6px; }
.tutorial-ol li { margin:0 ;}

/* Execution List */
.tutorial-actions { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 8px; }
.tutorial-actions li { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: start; }
.badge {
  display: inline-flex; align-items: center; white-space: nowrap;
  font-weight: 700; padding: 2px 10px; border-radius: 999px;
  border: 1px solid currentColor; background: #fff;
}
.action-text { line-height: 1.4; }

/* Status */
.status-green { color: #16a34a; }
.status-orange { color: #d97706; }
.status-red { color: #dc2626; }

/* Tutorials library page */
.tutorials-page {
    height: calc(100vh - 73px);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 100px 40px;
    box-sizing: border-box;
    overflow: hidden;
}
.tutorials-page__header { flex-shrink: 0; margin-bottom: 10px; align-self: center; text-align: center; }
.tutorials-page__header h1 { font-size: 22px; margin: 0; }

.tutorials-grid {
    width: 100%;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.tutorials-row {
    display: flex;
    justify-content: center;
    gap: 40px;
    flex: 1;
    min-height: 0;
    max-height: 280px;
}
.tutorial-card {
    display: flex;
    flex-direction: column;
    min-height: 0;
    flex: 1;
}
.tutorials-row--bottom .tutorial-card {
    flex: 0 0 calc(50% - 20px);
    max-width: calc(50% - 20px);
}
.tutorial-card .tutorial-modal-content {
    position: static;
    width: 100%;
    max-width: 100%;
    flex: 1;
    min-height: 0;
    overflow: hidden;
    padding: 10px 12px 8px;
    margin: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    justify-content: flex-start;
    align-items: stretch;
}
.tutorial-card__topic {
    font-size: 14px;
    font-weight: 700;
    text-align: center;
    color: #1F1F1F;
    margin: 0 0 8px;
    flex-shrink: 0;
}
.tutorial-card__media {
    flex: 1;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.tutorial-card__media video,
.tutorial-card__media img {
    flex: 1;
    min-width: 0;
    min-height: 0;
    max-width: 100%;
    max-height: 100%;
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 6px;
    display: block;
}
.tutorial-card__media--no-video {
    align-items: flex-start;
    justify-content: flex-start;
    overflow-y: auto;
    font-size: 12px;
}
.tutorial-card__media--no-video .role-permissions-matrix {
    width: 100%;
}
.tutorial-card__media--no-video .tutorial-title,
.tutorial-card__media--no-video .tutorial-subtitle {
    display: none;
}
.tutorial-card__media--no-video .three-cols {
    width: 100%;
    gap: 8px;
    grid-template-columns: 1fr 1fr;
}
.tutorial-card__media--no-video .tutorial-actions {
    grid-template-columns: 1fr 1fr 1fr;
}
.tutorial-card__media--no-video .tutorial-actions li {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
    align-items: start;
}
.tutorial-card__media--centered {
    justify-content: center !important;
    align-items: center !important;
}
.tutorial-card__media--no-video .tutorial-description {
    font-size: 11px;
    line-height: 1.3;
}
.tutorial-card__media--no-video .step-title {
    font-size: 12px;
}
.tutorial-card__media--no-video .tutorial-ol,
.tutorial-card__media--no-video .tutorial-actions {
    gap: 4px;
}

/* Action icons row */
.tutorial-card__actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 6px 0 2px;
    flex-shrink: 0;
}
.tutorial-card__seen-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    flex-shrink: 0;
}
.tutorial-card__seen-icon svg { width: 15px; height: 15px; }
.tutorial-card__seen-icon.seen   { background-color: #16a34a; color: #fff; }
.tutorial-card__seen-icon.unseen { background-color: #d1d5db; color: #6b7280; }
.tutorial-card__reset-form { margin: 0; }
.tutorial-card__reset-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background-color: #f97316;
    border: none;
    cursor: pointer;
    color: #fff;
    transition: background-color 0.2s;
}
.tutorial-card__reset-btn:hover { background-color: #ea6c0a; }
.tutorial-card__reset-btn svg { width: 15px; height: 15px; }

  /* Staff */
.registration-review-header {
    display: flex;
    align-items: center;
    gap:10px;
    margin-bottom:0px;
}
.staff-registration-view{
    overflow-y: auto;
    display:flex;
    flex-direction: column;
    gap: 20px;
}
.registration-info {
    display:flex;
    flex-direction: row;
    gap:20px;
}

.staff-questionnarie-info{
    display: flex;
    gap: 30px;
}
.staff-personal-info{
    display: flex;
    gap:20px;
    margin-top:0px;
}

.staff-account-info{
    width: 300px;
    padding:10px;
    border: 2px solid black;
    border-radius: 10px;
}

.staff-user-info{
    width: 500px;
    padding:10px;
    border: 2px solid black;
    border-radius: 10px;
}
.staff-questionnarie-info{
    display: flex;
    flex-direction: column;
    padding:10px;
    border: 2px solid black;
    border-radius: 10px;
}
.farms-questionnarie-info {
    display:flex;
    gap:30px;
}

/* Register */
.registration-process-btns {
    display: flex;
    gap: 10px;
}

.registration-pending-status,
.registration-accepted-status,
.registration-rejected-status {
    display: inline-block;
    font-size: 0.75rem;
    line-height: 1;
    padding: 8px 12px;
    margin-left: 12px;
    vertical-align: middle;
    border-radius: 4px;
    font-weight: bold;
}

.registration-pending-status {
    background-color: #8B5E3C;
    color: #FDF6EC;
    border: 1px solid #5C3B21;
}

.registration-accepted-status {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.registration-rejected-status {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

  /* Variety */
  .variety-title {
    color: var(--crops-section);
  }
  .variety-title .crop-type-name {
    color: var(--crops-section);
  }
  .variety-item {
    color: var(--crops-section);
    font-weight: 600;
  }
  .add-variety {
    margin-top:10px;
  }
  .add-variety-btn{
    margin-top:10px;
  }

  .crop-type-object-btns {
    display: flex;
    width: 100%;              
    justify-content: space-between;
    align-items: center;
  }    
  .delete-variety-button {
    width: 20px;
    height: 20px;
    border: none;
    border-radius: 50%;
    background-color: #ff4d4f;
    color: white;
    font-size: 14px;
    line-height: 1;
    text-align: center;
    cursor: pointer;
    margin-left: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
  }
  
  .delete-variety-button:hover {
    background-color: #d9363e;
  }

/* Onboarding */
.onboarding-header {
    display:flex;
    gap:80px;
}

/* New Add Location 
.add-location{
    display: flex;
    flex-direction: column;
    gap:10px;
}
.add-location-steps {
    display: flex;
    height: 100px;
    gap:10px;
}
.add-location-step-title {
    margin-top:0px;
    margin-bottom: 0px;
}
.add-location-steps > div {
    width: 300px; 
    background-color: rgb(211, 209, 209);
    border: 1px black solid;
    border-radius: 5px;
    padding: 10px;
}
.location-type-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap:2px;
    margin-top:5px;
    position: relative;
}
.location-type-option {
    display: flex;
    justify-content: center;  
    align-items: center;       
    text-align: center;
    font-weight: bold;
    height: 25px;             
    border: 1px solid black;
    border-radius: 4px;
    cursor: pointer;
    color: white;
    user-select: none;
}
.add-location-location-type.selected{
    background-color: rgb(82, 165, 82);
}
.location-type-option.selected {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    font-size: 1.4em;
    z-index: 1;
    transition: all 0.5s ease;
}
*/
/* Hide non-selected */
.location-type-option.hidden {
    opacity: 0;
    pointer-events: none;
    transform: scale(0.5);
    transition: all 0.5s ease;
}
/* Farm */
.location-type-option.farm {background-color: rgb(170, 162, 211);}
.location-type-option.farm:hover,
.location-type-option.farm.selected {background-color: blue;}
/* Field */
.location-type-option.field {background-color: rgb(157, 196, 157);}
.location-type-option.field:hover,
.location-type-option.field.selected {background-color: green;}
/* Plot */
.location-type-option.plot {background-color: rgb(216, 135, 135);}
.location-type-option.plot:hover,
.location-type-option.plot.selected {background-color: red;}
/* Bed */
.location-type-option.bed {background-color: rgb(228, 200, 148);}
.location-type-option.bed:hover,
.location-type-option.bed.selected {background-color: orange;}

.add-location-where-parents{
    margin-top:10px;
    display:flex;
    gap:10px;
}
.add-location-parent {
    display: flex;
    flex-direction: column;
}

.label-farm{
    color:blue;
    font-weight: bold;
}
.label-field {
    color:green;
    font-weight: bold;
}
.label-plot{
    color:red;
    font-weight: bold;
}

.location-type-methods {
    margin-top:5px;
    display: flex;
    flex-direction: column;
    height: 40px;
    gap:10px;
  }
  
  .location-type-draw,
  .location-type-file {
    flex: 1; 
    display: flex;
    justify-content: center; 
    align-items: center;     
    border: 1px solid black;
    border-radius: 5px;
    background-color: darkgray;
  }

  /* Location View */
  .location-view-title {
    padding-left: 5px;
    padding-top:5px;
    margin: 0;
  }
  
  .location-details {
    display: flex;
    padding: 5px;
    gap: 8px;
  }
  #size {
    width: 60px;
  }
  #bed-width,
  #crop-width {
    width: 40px;
  }
  .location-name,
  .location-beds,
  .location-size,
  .location-description,
  .location-bed-width,
  .location-crop-width {
    display: none;
    align-items: center;
    gap: 5px;
    margin: 0;
    padding: 0;
  }
  .adjacent-plots{
    display: none;
    align-items: center;
    gap: 20px;
    margin: 0;
    padding: 0;
  }
  .bed-parallel-method,
  .bed-manual-method {
    display: none;
  }
  
  .bed-parallel-method {
    align-items: center;
    margin-right:5px;
    gap:20px;
  }

  .btn-primary.selected{
    background-color: var(--primary-color); /* Darker shade for hover */
  }

  .location-data {
    position: relative; 
    padding-bottom: 50px; 
    overflow-y: auto;
  }

 .location-data .bottom-right-btn {
    position: absolute;
    bottom: 0;
    right: 0;
    margin: 10px;
 }

 .reset-password-content-container {
    display: flex;               /* Use flexbox layout */
    flex-direction: column;      /* Stack children vertically */
    gap: 10px;                    /* Space between items */
}


.schedule-table {
    width: 100%;
    max-width: 600px;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 14px;
    margin: 0 auto;  
  }
  
  .schedule-table th,
  .schedule-table td {
    padding: 10px 12px;
    border: 1px solid #000000;
    text-align: center;
    vertical-align: middle;
  }
  
  .schedule-table thead th {
    background: var(--button-secondary-color);
    font-weight: 600;
  }

  .schedule-table tbody td {
     font-weight: 600;   /* Bold */
     font-size: 1rem;  
  }

  .schedule-table tbody th {
    background: var(--button-secondary-color);    /* PLANNED / ACTUAL */
    font-weight: 600;
    width: 90px;
  }

  .schedule-table tr:hover td {
    background: var(--button-secondary-color-hover);
  }
  
  /* Bordes redondeados bonitos */
  .schedule-table thead th:first-child { border-top-left-radius: 10px; }
  .schedule-table thead th:last-child  { border-top-right-radius: 10px; }
  .schedule-table tbody tr:last-child th:first-child { border-bottom-left-radius: 10px; }
  .schedule-table tbody tr:last-child td:last-child  { border-bottom-right-radius: 10px; }

  /* Crop details */
  /* Layout 50/50 */
.crop-layout {
    position: fixed;
    top: 70px;    /* justo debajo del navbar */
    bottom: 70px; /* justo encima del footer */
    left: 0;
    right: 0;
    display: flex;
    gap: 16px;
    padding: 10px;
    box-sizing: border-box;
    overflow: hidden;
    z-index: 1;
  }
  
  /* Left pane card — 40% width */
  .crop-detail-container {
    flex: 2;  /* 2/5 = 40% */
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    background: var(--background-color);
    border: 1px solid var(--primary-color);
    border-radius: 10px;
    padding: 16px;
    overflow-y: auto;
  }

  .crop-detail-container .detail-section:last-child {
    margin-top: auto;
  }
  
  /* Title centered and large */
  .crop-detail-title {
    text-align: center;
    font-size: 28px;
    font-weight: 700;
    margin: 4px 0 8px 0;
  }
  
  /* Generic section with divider line */
  .detail-section {
    padding: 8px 0;
    border-top: 1px solid #e5e7eb;
  }
  .detail-section:first-of-type {
    border-top: none;
  }
  
  .row-split {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 1fr;  /* 50% | 50% */
    align-items: center;
    width: 100%;             
  }
  
  /* Vertical line */
  .row-split::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 1px;
    background: #000000;            
    transform: translateX(-0.5px); 
  }
  
  /* Center content */
  .row-split > div {
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;            
    padding: 4px 8px;
  }
  
  .row-split p { margin: 0; }
  
    /* Right column — 60% width */
    .right-pane {
        flex: 3;  /* 3/5 = 60% */
        min-width: 0;
        min-height: 0;
        display: flex;
        flex-direction: column;
        gap: 16px;
        overflow: hidden;
    }

    /* Use the same class name as in HTML: .crop-map */
    .crop-map {
        flex: 1;
        min-height: 0;
        overflow: hidden;
    }

    .activities-wrap {
        flex: 1;
        min-height: 0;
        overflow: auto;
    }

    /* Map must have explicit height */
    .crop-map .crop-map-frame {
        height: 100%;
        border-radius: 12px;
        border: 1px solid #e5e7eb; 
    }

    /* Activities panel styles */
    .activities-wrap {
        border: 1px solid var(--primary-color);
        border-radius: 12px;
        padding: 12px;
        overflow: auto;
    }
  
  
  /* Tiny tweaks inside activities panel */
  .view-switch {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 8px;
  }
  
  .schedule-table { margin: 4px 0; }

  /* Crop-scoped schedule table: usar crops-section color */
  .crop-detail-container .schedule-table thead th,
  .crop-detail-container .schedule-table tbody th {
    background: var(--crops-section);
    color: #fff;
  }
  .crop-detail-container .schedule-table tr:hover td {
    background: rgba(112, 78, 46, 0.1);
  }

  /* Progress bar border */
  .crop-detail-container .progress-container {
    border: 2px solid var(--crops-section);
    border-radius: 6px;
  }

  /* Crop icon buttons */
  .crop-btn-edit {
    background: var(--crops-section);
  }
  .crop-btn-add-activity {
    background: var(--activity-section);
  }
  
  /* Responsive */
  @media (max-width: 1024px) {
    .crop-layout {
      position: static;
      flex-direction: column;
      height: auto;
    }
    .right-pane {
      min-height: 60dvh;
    }
  }

  /* Objects shell scrollable */
.objects-shell {
    margin-top:10px;
    flex: 1;
    max-width: 1800px;
    border: 1px solid #d9d4c0;
    border-radius: 12px;
    background: var(--secondary-color);
    overflow-y: auto; /* Vertical scroll */
    padding: 12px;
    box-sizing: border-box;
  }

  .objects-shell > .block.farm {
    margin-bottom: 14px;
  }

  
  /* Shared grid row */
  .grid-row {
    display: grid;
    grid-template-columns: minmax(80px, 1fr) 200px 200px 220px 220px;
    gap: 20px;
    align-items: center;
    padding: 12px;
    border-radius: 12px;
    margin: 8px 0;
  }

  /* Column text align center */
  .col.center { text-align: center; }
  .col.object { font-weight: 700; }
  
  .level-2 .object { padding-left: 12px; }
  .block.field .plot.grid-row {
    margin-inline-start: 16px; /* Separation between Field and Plot */
  }
  
  /* Blocks and colors */
  .block.farm   > summary.grid-row { background: #5379a4; color: #f2f2f2; }
  .block.field  > summary.grid-row { background: #478547; color: #f2f2f2; }
  .plot.grid-row { background: #af4645; color: #f2f2f2; }
  
  /* Inner borders to remark hierarchy */
  .block.farm   { border-radius: 14px; padding: 6px; background: rgba(9, 95, 207, 0.3); }
  .block.field  { border-radius: 12px; padding: 6px 0 6px 6px; margin: 8px 0 8px 16px; background: rgb(0, 128, 0, 0.4);}
  
  /* Interactions */
  .clickable { cursor: pointer; user-select: none; }
  
  /* Caret */
  summary .caret {
    display: inline-block;
    width: 0; height: 0;
    border-left: 6px solid currentColor;
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
    margin-right: 8px;
    transform: rotate(0deg);
    transition: transform .15s ease;
  }
  details[open] > summary .caret { transform: rotate(90deg); }
  
  /* Delete details marker */
  summary { list-style: none; }
  summary::-webkit-details-marker { display: none; }
  
  /* Title and hyperlink */
  .col.object a,
  .col.center a {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 2px;
  }

  summary:focus-visible { outline: 2px solid #222; outline-offset: 2px; }

  .user-management-form{
    display:flex;
    flex-direction: column;
    gap:10px;
    max-width: 200px;
  }
.user-management-form input, 
.user-management-form select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

  /* Alarm Message */

  .alarmMessageForm {
    display:flex;
    flex-direction: column;
    gap:5px;
  }

/* ====== Contenedor general de la lista ====== */
.beds-percentage-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-height: 600px;
    overflow-y: auto;
}

.beds-design-container {
    display: flex;
    flex-direction: column;
    gap: 5px;
    max-height: 700px;
    overflow-y: auto;
}
/* Cada bed */
.bed-percentage-container {
    display: flex;
    flex-direction: column;
}

/* ====== Details resumen + contenido ====== */
.bed-details {
    border-bottom: 1px solid #ddd;
    padding-bottom: 0.25rem;
}

/* Línea superior: Bed + ID + porcentaje, TODO a la izquierda */
.bed-summary {
    display: flex;
    align-items: center;
    gap: 0.5rem;        /* separación entre "Bed", ID y % */
    list-style: none;   /* quitamos la viñeta del summary */
    cursor: pointer;
}

/* Quitamos el marker por defecto en algunos navegadores */
.bed-summary::-webkit-details-marker {
    display: none;
}

/* Flechita personalizada */
.bed-summary::before {
    content: "▸";
    display: inline-block;
    margin-right: 0.25rem;
    transition: transform 0.2s ease;
}

/* Cuando está abierto, rotamos la flecha */
.bed-details[open] .bed-summary::before {
    transform: rotate(90deg);
}

/* ====== Porcentaje ====== */
.bed-completeness {
    font-weight: 700;
    font-size: 1.1rem;
    text-decoration: none;
}

/* Colores tipo Leaflet (los mismos que usas en los markers) */
.bed-completeness--green {
    color: green;
}

.bed-completeness--orange {
    color: orange;
}
.bed-completeness--black {
    color: black;
}

/* ====== Panel de opciones ====== */
.bed-options {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.bed-options span {
    white-space: nowrap;
}

.bed-options .pointSelect {
    min-width: 90px;
}

.bed-options .completenessInput {
    width: 70px;
}

.plot-start {
    font-weight: bold;
    color:var(--button-primary-color);
}
.plot-finish {
    font-weight: bold;
    color:var(--button-primary-color);
}

.object-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: center;
}

.delete-activity-btn.icon-only {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 8px;
    line-height: 1;

    background-color: #F2F5EA; /* Light brown */
    border: none;
    border-radius: 4px;

    cursor: pointer;
}

.delete-activity-btn.icon-only ion-icon {
    font-size: 18px;
    color: #d32f2f; 
    display: block;
}

.repeat-activity-btn.icon-only {
    background-color: #F2F5EA;
    border: none;
    border-radius: 4px;
    padding: 6px 8px;
    cursor: pointer;
}

.repeat-activity-btn.icon-only ion-icon {
    font-size: 18px;
    color: #1976d2; 
}

.edit-activity-btn.icon-only {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 6px 8px;
    line-height: 1;

    background-color: #F2F5EA; 
    border: none;
    border-radius: 4px;

    cursor: pointer;
}

.edit-activity-btn.icon-only ion-icon {
    font-size: 18px;
    color: black !important; 
    display: block;
}

.uvc-warmup-control {
  background: rgba(20, 20, 20, 0.85);
  color: #fff;
  padding: 10px 12px;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
  min-width: 180px;
  pointer-events: auto;
}

.uvc-warmup-title {
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  opacity: 0.85;
  margin-bottom: 8px;
}

.uvc-warmup-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.uvc-warmup-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  font-size: 12px;
}

.uvc-warmup-big {
  font-size: 14px;
  font-weight: 700;
}

.uvc-warmup-muted {
  opacity: 0.75;
}

.uvc-hidden {
  display: none;
}


/* Activities page header row */
.page-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 20px;
    margin-bottom: 16px;
}

.page-header h1 {
    margin: 0;
}

.page-header__separator {
    width: 1px;
    height: 28px;
    background: var(--text-color);
    opacity: 0.25;
}

.page-header__actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.week-selector {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 8px;
}

.week-selector--current {
    background: rgba(83, 129, 54, 0.10);
    border: 1px solid rgba(83, 129, 54, 0.30);
}

.week-selector__body {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    min-width: 130px;
}

.week-selector__title {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    opacity: 0.6;
}

.week-selector--current .week-selector__title {
    opacity: 0.85;
    font-weight: 600;
}

.week-label {
    font-size: 13px;
    white-space: nowrap;
    font-weight: 700;
}

.week-nav-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    font-size: 20px;
    line-height: 1;
    color: inherit;
    text-decoration: none;
    border-radius: 50%;
    transition: background 0.15s;
}

.week-nav-btn:hover {
    background: rgba(0, 0, 0, 0.08);
}

.btn-add-circle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--primary-color);
    opacity: 0.82;
    color: #fff;
    font-size: 22px;
    font-weight: 400;
    line-height: 34px;
    text-align: center;
    text-decoration: none;
    flex-shrink: 0;
    border: none;
    cursor: pointer;
}

.btn-add-circle:hover {
    opacity: 1;
}

/* Activities view selector */
.activities-view-selector {
    border-color: var(--activity-section);
    display: flex;
    gap: 20px;
    align-items: center;
    width: fit-content;
    position: relative;
}

.activities-view-selector input[type="radio"] {
    accent-color: var(--activity-section);
}

/* Crops pages — scoped overrides */
.crops-view-selector {
    border-color: var(--crops-section);
    display: flex;
    gap: 20px;
    align-items: center;
    width: fit-content;
    margin-bottom: 8px;
}

.crops-view-selector input[type="radio"] {
    accent-color: var(--crops-section);
}

#crops-page-wrapper .shell {
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

#crops-page-wrapper .objects-header {
    flex-shrink: 0;
    position: static;
}

#crop-view-active,
#crop-view-future,
#crop-view-past {
    flex: 1 1 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.crops-section-wrapper .btn-add-circle {
    background: var(--crops-section);
    opacity: 1;
}

.crops-section-wrapper .activity-type-widget__name {
    color: var(--crops-section);
}

.crops-section-wrapper .info-box {
    border-color: rgba(83, 129, 54, 0.7);
}

.crops-section-wrapper .activity-type-widget {
    border-color: rgba(83, 129, 54, 0.85);
}

.crop-group__summary .section-count-badge {
    background-color: var(--crops-section);
    margin-left: 6px;
}

.activity-group__summary .section-count-badge {
    background-color: var(--activity-section);
    margin-left: 6px;
}

/* Activities page — scoped button overrides */
#activities-page-wrapper .btn-primary,
.activity-section .btn-primary,
#addActivityBtnContainer .btn-primary,
#activityModal .btn-primary {
    background-color: var(--activity-section);
}

#activities-page-wrapper .btn-primary:hover,
.activity-section .btn-primary:hover,
#addActivityBtnContainer .btn-primary:hover,
#activityModal .btn-primary:hover {
    background-color: var(--primary-color);
}

#activities-page-wrapper .btn-add-circle {
    background: var(--activity-section);
    opacity: 1;
}

/* Activities shell — single box wrapping all category groups */
.shell {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    border: 1px solid var(--primary-color);
    border-radius: 12px;
    background: var(--secondary-color);
    padding: 10px 12px 12px;
    box-sizing: border-box;
}

.objects-header {
    position: sticky;
    top: 0;
    z-index: 10;
    border: 2px solid var(--primary-color);
    border-radius: 10px;
    background-color: var(--background-color);
    box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.2);
    padding: 10px;
    margin: 0 0 10px;
    font-weight: 700;
    font-size: 0.9rem;
    letter-spacing: 0.05em;
    opacity: 0.7;
}

/* Collapsible category group */
.activity-group {
    margin-bottom: 6px;
    border-radius: 10px;
    overflow: hidden;
}

.activity-group__summary {
    display: flex;
    align-items: center;
    padding: 10px 14px;
    background: var(--activity-section);
    color: #f2f2f2;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    border-radius: 10px;
    list-style: none;
    user-select: none;
}

.activity-group__summary::-webkit-details-marker { display: none; }

.activity-group[open] > .activity-group__summary {
    border-radius: 10px 10px 0 0;
}

.activity-group__summary .caret {
    display: inline-block;
    width: 0;
    height: 0;
    border-left: 6px solid currentColor;
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
    margin-right: 10px;
    transform: rotate(0deg);
    transition: transform .15s ease;
}

.activity-group[open] > .activity-group__summary .caret {
    transform: rotate(90deg);
}

.activity-group__body {
    background: var(--background-color);
    border-radius: 0 0 10px 10px;
    border: 1px solid var(--activity-section);
    border-top: none;
    padding: 4px 8px;
}

/* Collapsible category group — Crops */
.crop-group {
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    flex: 1 1 0;
    min-height: 0;
}

.crop-group__summary {
    display: flex;
    align-items: center;
    padding: 10px 14px;
    background: var(--button-primary-color);
    color: #f2f2f2;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    border-radius: 10px;
    list-style: none;
    user-select: none;
    flex-shrink: 0;
}

.crop-group__summary::-webkit-details-marker { display: none; }

.crop-group[open] > .crop-group__summary {
    border-radius: 10px 10px 0 0;
}

.crop-group__summary .caret {
    display: inline-block;
    width: 0;
    height: 0;
    border-left: 6px solid currentColor;
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
    margin-right: 10px;
    transform: rotate(0deg);
    transition: transform .15s ease;
}

.crop-group[open] > .crop-group__summary .caret {
    transform: rotate(90deg);
}

.crop-group__body {
    background: var(--background-color);
    border-radius: 0 0 10px 10px;
    border: 1px solid var(--button-primary-color);
    border-top: none;
    padding: 4px 8px;
    flex: 1 1 0;
    min-height: 0;
    overflow-y: auto;
}

/* Row list activities */
.row-list-activities {
    display: grid;
    grid-template-columns: 
        minmax(0, 1.2fr)  /* Type */
        minmax(0, 1fr)  /* Plot */
        minmax(0, 0.8fr)  /* State */
        minmax(0, 0.8fr)  /* Day */
        minmax(0, 0.8fr)  /* Time */
        minmax(0, 0.8fr)  /* Completeness */
        minmax(0, 0.8fr)  /* Name */
        70px;           /* Actions */
    align-items: center;
    width: 100%;
}

.row-list-activities-location {
    display: grid;
    grid-template-columns: 
        minmax(0, 1fr)  /* Type */
        minmax(0, 1fr)  /* State */
        minmax(0, 1fr)  /* Day */
        minmax(0, 1fr)  /* Time */
        minmax(0, 1fr);  /* Completeness */
    align-items: center;
    width: 100%;
}

.row-list-activities > *,
.row-list-activities-location > * {
    min-width: 0;
    overflow: hidden;
}

.row-list-activities > * p,
.row-list-activities > * a,
.row-list-activities-location > * p,
.row-list-activities-location > * a {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.row-list-activities > :nth-child(n+2),
.row-list-activities-location > :nth-child(n+2) {
    justify-content: center;
}

.row-list-activities > div,
.row-list-activities-location > div,
.row-list-crops > div,
.row-list-crops-location > div,
.row-list-rovers > div {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    text-align: left;
    white-space: nowrap;
}


.row-list-activities .object-actions {
    justify-content: flex-end;
    gap: 0.5rem;
}

.row-list-crops {
    display: grid;
    grid-template-columns: 
        minmax(0, 1fr)  /* Type */
        minmax(0, 1fr)  /* Plot */
        minmax(0, 0.8fr)  /* State */
        minmax(0, 1fr)  /* Day */
        minmax(0, 1fr)  /* Time */
        minmax(0, 1fr)  /* Completeness */
        minmax(0, 0.8fr);  /* Name */
    align-items: center;
    width: 100%;
}

.row-list-crops-location {
    display: grid;
    grid-template-columns: 
        minmax(0, 1fr)  /* Type */
        minmax(0, 1fr)  /* Plot */
        minmax(0, 1fr); /* Progress */
    align-items: center;
    width: 100%;
}

.row-list-activities > :nth-child(n+2),
.row-list-crops > :nth-child(n+2),
.row-list-crops-location > :nth-child(n+2),
.row-list-rovers > :nth-child(n+2),
.row-list-locations > :nth-child(n+2) {
    justify-content: center;
}

.row-list-crops > div:last-child {
    overflow: hidden;
}

.row-list-crops > div:last-child p {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

.row-list-crops p,
.row-list-rovers p {
    font-size: 0.975rem;
    font-weight: 500;
    color: var(--text-color);
}

.row-list-activities p,
.row-list-activities-location {
    font-size: 0.975rem;
    font-weight: 500;
    color: var(--text-color);
}

.row-list-rovers {
    display: grid;
    grid-template-columns: 
        minmax(0, 1fr)  /* ID */
        minmax(0, 1fr)  /* Type */
        minmax(0, 1fr) /* State */
        minmax(0, 1.2fr) /* Battery Percentage */
        minmax(0, 1.2fr) /* Battery Voltage */
        minmax(0, 1fr); /* Actions */
    align-items: center;
    width: 100%;
}

.row-list-rovers .object-actions {
    width: auto;
}

.row-list-locations {
    display: grid;
    grid-template-columns: minmax(80px, 1fr) 200px 200px 220px 220px;
    gap: 20px;
    align-items: center;
}

.row-list-locations > :nth-child(n+2) {
    text-align: center;
}

/* Progress bar inside grid cells */
.row-progress-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    width: 100%;
    min-width: 0;
    padding: 2px 6px;
    box-sizing: border-box;
}

.row-progress__label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-color);
    line-height: 1;
    width: 100%;
    max-width: 90px;
    text-align: center;
}

.row-progress__track {
    width: 100%;
    max-width: 90px;
    height: 5px;
    background: var(--accent-color, #ddd);
    border-radius: 3px;
    overflow: hidden;
}

.row-progress__fill {
    height: 100%;
    border-radius: 3px;
    background: orange;
    transition: width 0.3s ease;
}

.row-progress__fill--complete {
    background: #16a34a;
}

.row-progress__fill--low {
    background: #d32f2f;
}

.row-progress__fill--mid {
    background: orange;
}

.row-progress__fill--high {
    background: #16a34a;
}

.row-list-arrangements {
    display: grid;
    grid-template-columns:
        minmax(0, 1fr)   /* Name */
        minmax(0, 1fr)   /* Planting Pattern */
        minmax(0, 0.6fr) /* Rows */
        minmax(0, 0.8fr) /* Row Spacing */
        minmax(0, 0.8fr) /* Plant Spacing */
        90px;            /* Actions */
    align-items: center;
    width: 100%;
}

.row-list-arrangements > * {
    min-width: 0;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    white-space: nowrap;
}

.row-list-arrangements > :nth-child(n+2) {
    justify-content: center;
}

.row-list-arrangements p {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-color);
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.row-list-arrangements .object-actions {
    justify-content: flex-end;
    gap: 0.5rem;
}

.row-list-batches {
    display: grid;
    grid-template-columns:
        minmax(0, 1fr)   /* Lot Number */
        minmax(0, 0.9fr) /* Date */
        minmax(0, 1fr)   /* Seed Type */
        minmax(0, 0.8fr) /* Type */
        minmax(0, 0.8fr) /* Quantity */
        minmax(0, 1fr)   /* Supplier */
        60px;            /* Actions */
    align-items: center;
    width: 100%;
}

.row-list-batches > * {
    min-width: 0;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    white-space: nowrap;
}

.row-list-batches > :nth-child(n+2) {
    justify-content: center;
}

.row-list-batches p {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-color);
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.row-list-batches .object-actions {
    justify-content: flex-end;
    gap: 0.5rem;
}

.edit-crop-arrangement-btn.icon-only,
.delete-crop-arrangement-btn.icon-only,
.delete-batch-btn.icon-only {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 8px;
    line-height: 1;
    background-color: #F2F5EA;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.edit-crop-arrangement-btn.icon-only ion-icon {
    font-size: 18px;
    color: black;
    display: block;
}

.delete-crop-arrangement-btn.icon-only ion-icon,
.delete-batch-btn.icon-only ion-icon {
    font-size: 18px;
    color: #d32f2f;
    display: block;
}

/* Activity type catalog — two-row shell */
.catalog-shell {
    display: block;
}

.catalog-column {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.catalog-column__divider {
    height: 1px;
    width: 100%;
    background: var(--primary-color);
    opacity: 0.3;
    margin: 16px 0;
}

.catalog-column__header {
    font-weight: 700;
    font-size: 0.7rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--crops-section);
    display: flex;
    align-items: center;
    gap: 6px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--crops-section);
    margin-bottom: 2px;
}

.catalog-column__header-icon {
    font-size: 13px;
}

/* Widget grid */
.activity-type-catalog-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-content: flex-start;
}

.activity-type-widget {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--background-color);
    border: 1px solid var(--primary-color);
    border-radius: 8px;
}

.activity-type-widget__name {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--activity-section);
    white-space: nowrap;
}

.activity-type-widget__rover-icon {
    font-size: 13px;
    color: var(--primary-color);
    flex-shrink: 0;
    opacity: 0.75;
}

.activity-type-widget__varieties {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 3px 5px;
    background: transparent;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.15s;
}

.activity-type-widget__varieties:hover {
    opacity: 1;
}

.activity-type-widget__varieties i {
    font-size: 14px;
    color: var(--primary-color);
}

.activity-type-widget__delete {
    margin-left: 2px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 3px 5px;
    background: transparent;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    opacity: 0.35;
    transition: opacity 0.15s;
}

.activity-type-widget__delete:hover {
    opacity: 1;
}

.activity-type-widget__delete ion-icon {
    font-size: 15px;
    color: #d32f2f;
    display: block;
}

.confirm-btn {
    padding: 0.5rem 1.2rem;
    border-radius: 6px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: background-color 0.15s ease, transform 0.1s ease;
}

/* 🔒 LOCK */
.confirm-btn--accept.lock {
    background-color: #16a34a; /* green-600 */
    color: #ffffff;
}

.confirm-btn--accept.lock:hover {
    background-color: #15803d; /* green-700 */
}

.confirm-btn--accept.lock:active {
    background-color: #166534; /* green-800 */
    transform: translateY(1px);
}

/* 🔓 UNLOCK */
.confirm-btn--accept.unlock {
    background-color: #22c55e; /* green-500 */
    color: #ffffff;
}

.confirm-btn--accept.unlock:hover {
    background-color: #16a34a; /* green-600 */
}

.confirm-btn--accept.unlock:active {
    background-color: #15803d; /* green-700 */
    transform: translateY(1px);
}

.security-link {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #ddd;
}

/* Price List */
.price-lists-tables {
    display: flex;
    flex-direction: row;
    gap: 20px;
    flex-wrap: wrap;
}

.pl-card {
    background: #f9fafb;  /* gris muy suave para las inactivas */
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1rem 1.25rem;
    min-width: 260px;
}

.pl-card--active {
    background: #ffffff;  /* blanco puro para la activa — destaca sobre el gris */
    border: 2px solid var(--primary-color);
}

.pl-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e5e7eb;
}

.pl-name {
    font-size: 15px;
    font-weight: 500;
    margin: 0;
    color: #111827;
}

.pl-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    padding: 3px 10px;
    border-radius: 999px;
}

.pl-badge.active {
    background: #d1fae5;
    color: var(--primary-color);
}

.pl-badge.inactive {
    background: #f3f4f6;
    color: #9ca3af;  /* gris más claro que antes */
}

.pl-badge.inactive .pl-badge-dot {
    background: #9ca3af;
}

.pl-badge-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
}

.pl-badge.active .pl-badge-dot {
    background: var(--primary-color);
}

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

.pl-table th {
    color: #6b7280;
    font-weight: 400;
    text-align: left;
    padding: 4px 8px 4px 0;
    border-bottom: 1px solid #e5e7eb;
    white-space: nowrap;
}

.pl-table td {
    color: #111827;
    padding: 7px 8px 7px 0;
    border-bottom: 1px solid #e5e7eb;
    white-space: nowrap;
}

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

.pl-amount {
    font-weight: 500;
}

.pl-currency {
    color: #6b7280;
    margin-left: 2px;
    font-size: 12px;
}

.pl-dates {
    color: #6b7280;
    font-size: 12px;
}
.pl-create-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 24px;
    max-width: 1100px;
}

.pl-create-section h3 {
    font-size: 14px;
    font-weight: 500;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0 0 12px 0;
}

.pl-field-row {
    display: flex;
    align-items: flex-end;
    gap: 16px;
    flex-wrap: wrap;
}

.pl-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.pl-field label {
    font-size: 13px;
    color: #6b7280;
}

.pl-field input[type="text"],
.pl-field input[type="number"] {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 14px;
    color: #111827;
    background: #f9fafb;
    outline: none;
}

.pl-field input:focus {
    border-color: var(--primary-color);
    background: #ffffff;
}

.pl-field--checkbox {
    flex-direction: row;
    align-items: center;
    gap: 8px;
    padding-bottom: 2px;
}

.pl-field--checkbox label {
    font-size: 14px;
    color: #111827;
}

.pl-create-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 8px 0;
    font-size: 13px;
    table-layout: fixed;
}

.pl-create-table th:nth-child(1),
.pl-create-table td:nth-child(1) { width: 180px; }

.pl-create-table th:nth-child(2),
.pl-create-table td:nth-child(2) { width: 110px; }

.pl-create-table th:nth-child(3),
.pl-create-table td:nth-child(3) { width: 100px; }

.pl-create-table th:nth-child(4),
.pl-create-table td:nth-child(4) { width: 210px; }

.pl-create-table th:nth-child(5),
.pl-create-table td:nth-child(5) { width: 210px; }

.pl-create-table th:nth-child(6),
.pl-create-table td:nth-child(6) { width: 40px; }

.pl-create-table th {
    color: #6b7280;
    font-weight: 400;
    text-align: left;
    padding: 4px 0 8px 0;
    border-bottom: 1px solid #e5e7eb;
    white-space: nowrap;
}

.pl-create-table td {
    padding: 8px 0;
    border-bottom: 1px solid #f3f4f6;
    vertical-align: middle;
}

.pl-create-table input,
.pl-create-table select {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 5px 8px;
    font-size: 13px;
    color: #111827;
    background: #f9fafb;
    outline: none;
    width: 100%;
    box-sizing: border-box;
}

.pl-create-table input:focus,
.pl-create-table select:focus {
    border-color: var(--primary-color);
    background: #ffffff;
}

.pl-remove-row {
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    font-size: 14px;
    padding: 4px 8px;
    border-radius: 6px;
}

.pl-remove-row:hover {
    background: #fee2e2;
    color: #dc2626;
}

.btn-add-row {
    margin-top: 12px;
    background: none;
    border: 1px dashed #d1d5db;
    border-radius: 8px;
    padding: 6px 14px;
    font-size: 13px;
    color: #6b7280;
    cursor: pointer;
    width: 100%;
}

.btn-add-row:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.pl-create-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.pl-error {
    font-size: 12px;
    color: #dc2626;
}

/* Container */
.beds-table {
    width: fit-content;
    min-width: 320px;
    border: 1px solid #d0d7de;
    border-radius: 6px;
    overflow: hidden;
    background: #fff;
    margin-top: 8px;
    font-size: 13px;
}

/* Header */
.beds-table__header {
    background: #f6f8fa;
    padding: 6px 12px;
    font-weight: 600;
    color: #444;
    border-bottom: 1px solid #d0d7de;
}

/* Grid */
.beds-table__grid {
    display: flex;
    flex-direction: column;
}

/* Row base */
.beds-table__row {
    display: grid;
    grid-template-columns: 40px 1fr auto;
    align-items: center;
    padding: 6px 12px;
    border-bottom: 1px solid #eaecef;
    gap: 8px;
    transition: background 0.2s;
}

.beds-table__row:last-child {
    border-bottom: none;
}

/* Order badge */
.beds-table__order {
    font-weight: 700;
    color: #666;
    font-size: 12px;
}

/* Length */
.beds-table__length {
    font-weight: 600;
    color: #333;
    text-align: right;
    white-space: nowrap;
}

/* Label */
.beds-table__label {
    color: #555;
    font-size: 12px;
}

/* Current bed — blinking orange */
.beds-table__row--current {
    background: rgba(255, 140, 0, 0.08);
}

.beds-table__row--current .beds-table__order {
    color: #e67e00;
}

.beds-table__row--current .beds-table__length {
    color: #e67e00;
    animation: blink-orange 1s ease-in-out infinite;
}

@keyframes blink-orange {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.3; }
}
/* Current bed — blinking orange */
.beds-table__row--current {
    background: rgba(255, 140, 0, 0.85);
}

.beds-table__row--current .beds-table__order,
.beds-table__row--current .beds-table__label,
.beds-table__row--current .beds-table__length {
    color: #fff;
    animation: blink-orange 1s ease-in-out infinite;
}

/* Discovered bed — blue */
.beds-table__row--discovered {
     background: #3388ff;
}

.beds-table__row--discovered .beds-table__order,
.beds-table__row--discovered .beds-table__label,
.beds-table__row--discovered .beds-table__length {
    color: #fff;
}

/* ===== Rover Detail Page ===== */
.rover-detail-layout {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    margin-top: 24px;
    margin-bottom: 24px;
}

.rover-list-layout {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 24px;
    margin-bottom: 24px;
}

.rover-list-card {
    background: var(--background-color);
    border: 1px solid var(--primary-color);
    border-radius: 12px;
    overflow: hidden;
    flex: 0 0 280px;
    cursor: pointer;
    transition: box-shadow 0.15s, border-color 0.15s;
}

.rover-list-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.10);
    border-color: var(--primary-color-hover, var(--primary-color));
}

.rover-list-card__photo img {
    display: block;
    width: 100%;
    height: 160px;
    object-fit: cover;
    object-position: center;
}

.rover-list-card__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
}

.rover-list-item {
    padding: 7px 14px;
    border-bottom: 1px solid var(--accent-color);
}

.rover-list-item--right {
    border-left: 1px solid var(--accent-color);
}

.rover-list-item:nth-last-child(-n+2) {
    border-bottom: none;
}

.rover-list-item__label {
    display: block;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-color);
    opacity: 0.5;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 2px;
}

.rover-list-item__value {
    display: block;
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text-color);
}

.rover-list-item__value--id {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-color);
}

.rover-list-card__actions {
    padding: 10px 14px;
    border-top: 1px solid var(--accent-color);
    display: flex;
    justify-content: center;
}

.rover-lock-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    padding: 0;
    font-size: 22px;
    color: var(--text-color);
    cursor: pointer;
    opacity: 0.75;
    transition: opacity 0.15s;
}

.rover-lock-btn:hover {
    opacity: 1;
}

.rover-lock-btn--pending {
    opacity: 1;
    cursor: pointer;
    gap: 2px;
}

.rover-list-card .row-progress-cell {
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    padding: 0;
    gap: 6px;
}

.rover-list-card .row-progress__label {
    flex-shrink: 0;
    font-size: 0.92rem;
    font-weight: 600;
    text-align: left;
    width: auto;
    max-width: none;
}

.rover-list-card .row-progress__track {
    flex-shrink: 0;
    width: 50px;
    max-width: 50px;
}

.rover-card {
    background: var(--background-color);
    border: 1px solid var(--primary-color);
    border-radius: 12px;
    overflow: hidden;
}

.rover-card--main {
    flex: 0 0 380px;
}

.rover-card__photo img {
    display: block;
    width: 100%;
    height: 210px;
    object-fit: cover;
    object-position: center;
}

.rover-card__info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
}

.rover-info-item {
    padding: 7px 14px;
    border-bottom: 1px solid var(--accent-color);
}

.rover-info-item--left {
    border-right: 1px solid var(--accent-color);
}

.rover-info-item:nth-last-child(-n+2) {
    border-bottom: none;
}

.rover-info-item__label {
    display: block;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-color);
    opacity: 0.5;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 2px;
}

.rover-info-item__value {
    display: block;
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text-color);
}

.rover-info-item__value--id {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--primary-color);
}

.rover-card--errors {
    flex: 0 0 auto;
    min-width: 180px;
    max-width: 320px;
}

.rover-card--alarms {
    flex: 0 0 auto;
    min-width: 180px;
    max-width: 320px;
}

.rover-card__header {
    padding: 10px 14px;
    font-weight: 700;
    font-size: 0.95rem;
    border-bottom: 1px solid transparent;
}

.rover-card__header--error {
    background: rgba(211, 47, 47, 0.07);
    color: #d32f2f;
    border-color: rgba(211, 47, 47, 0.2);
}

.rover-card__header--alarm {
    background: rgba(245, 124, 0, 0.07);
    color: #f57c00;
    border-color: rgba(245, 124, 0, 0.2);
}

.rover-card__body {
    padding: 12px 14px;
    font-size: 0.9rem;
    color: var(--text-color);
    line-height: 1.5;
}

.rover-card__empty {
    opacity: 0.35;
    font-style: italic;
}

.alarm-delay-row {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
}

.alarm-delay-row label {
    flex: 0 0 auto;
    margin-right: 10px;
}

.alarm-delay-row__input.form-control {
    width: 55px;
    padding: 6px 8px;
    flex: 0 0 auto;
    margin: 0;
}

.alarm-delay-row__unit {
    margin-left: 5px;
}

.rover-card__actions {
    padding: 10px 14px;
    border-top: 1px solid var(--accent-color);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
}

.rover-card .row-progress-cell {
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    padding: 0;
    gap: 6px;
}

.rover-card .row-progress__label {
    flex-shrink: 0;
    font-size: 0.92rem;
    font-weight: 600;
    text-align: left;
    width: auto;
    max-width: none;
}

.rover-card .row-progress__track {
    flex-shrink: 0;
    width: 60px;
    max-width: 60px;
}

.rover-info-item--action {
    border-bottom: none;
    padding-top: 10px;
}

.rover-msg-btn {
    width: 100%;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    transition: opacity 0.15s;
}

.rover-msg-btn:hover {
    opacity: 0.75;
}

.rover-msg-btn--error {
    background-color: rgba(211, 47, 47, 0.07);
    color: #d32f2f;
    border-color: rgba(211, 47, 47, 0.25);
}

.rover-msg-btn--alarm {
    background-color: rgba(245, 124, 0, 0.07);
    color: #f57c00;
    border-color: rgba(245, 124, 0, 0.25);
}

.rover-msg-btn--silent {
    background-color: transparent;
    color: var(--accent-color);
    border-color: var(--accent-color);
}

.rover-info-item__value--id {
    text-decoration: none;
}

.rover-info-item__value--id:hover {
    text-decoration: underline;
}

/* Full Discovered Bed - green */
.beds-table__row--full-discovered{
    background-color: green;
}

.beds-table__row--full-discovered .beds-table__order,
.beds-table__row--full-discovered .beds-table__label,
.beds-table__row--full-discovered .beds-table__length {
    color: #fff;
}

/* ── Staff: Generic Form ─────────────────────────────────────────────── */
.staff-form {
    max-width: 480px;
    background-color: var(--background-color);
    border: 1px solid var(--primary-color);
    border-radius: 12px;
    padding: 16px 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    margin-top: 16px;
}

.staff-form__group {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 8px;
}

.staff-form__label {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--primary-color);
}

.staff-form__input input,
.staff-form__input select,
.staff-form__input textarea {
    width: 100%;
    padding: 5px 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 0.9rem;
    color: var(--text-color);
    background-color: #fff;
    box-sizing: border-box;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.staff-form__input input:focus,
.staff-form__input select:focus,
.staff-form__input textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(83, 129, 54, 0.15);
}

.staff-form__error {
    font-size: 0.75rem;
    color: #c0392b;
    margin: 1px 0 0;
}

.staff-form__actions {
    margin-top: 12px;
}

/* ── Staff: Account Invoices ─────────────────────────────────────────── */
.row-list-invoices {
    display: grid;
    grid-template-columns:
        minmax(0, 1.2fr)  /* Date */
        minmax(0, 1fr)    /* Total incl */
        minmax(0, 0.8fr)  /* State */
        minmax(0, 1fr);   /* Actions */
    align-items: center;
    width: 100%;
}

.row-list-invoices > div {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    text-align: left;
    white-space: nowrap;
}

.row-list-invoices > :nth-child(n+2) {
    justify-content: center;
}

.pl-error {
    font-size: 12px;
    color: #dc2626;
}

.form-input-number {
    display: flex;
    align-items: center;
    gap: 14px;
}

.form-input-number input[type="number"] {
    width: 40px;
}

.form-input-unit {
    font-size: 0.9em;
    color: #666;
}

.form-row {
    display: flex;
    flex-direction: row;
    justify-content: start;
    gap: 8px;
}
.form-row .form-optional-field__content {
    gap: 6px !important;
}
#doseContainer {
    gap: 18px !important;
}
.form-row .form-field__label {
    white-space: nowrap;
    font-size: 0.75rem;
}

.row-list-invoices > :last-child {
    justify-content: flex-end;
    gap: 0.5rem;
}

.row-list-invoices p {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-color);
}
/* ── Fungicide map table control ─────────────────────────────── */
.fungicide-table {
    background: var(--background-color);
    border: 1px solid var(--primary-color);
    border-radius: 5px;
    padding: 8px 10px;
    width: 300px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    font-size: 0.82rem;
}

.fungicide-table__header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
}

.fungicide-table__title {
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--primary-color);
    letter-spacing: 0.03em;
}

.fungicide-table__day {
    font-size: 0.78rem;
    font-weight: 600;
    opacity: 0.7;
    white-space: nowrap;
}

.fungicide-table__divider {
    border: none;
    border-top: 1px solid var(--primary-color);
    margin: 6px 0;
    opacity: 0.4;
}

.fungicide-table__table {
    width: 100%;
    border-collapse: collapse;
}

.fungicide-table__row:not(:last-child) td {
    border-bottom: 1px solid rgba(83, 129, 54, 0.15);
}

.fungicide-table__cell {
    padding: 4px 6px;
    vertical-align: middle;
}

.fungicide-table__cell--state {
    text-align: center;
}

.fungicide-table__cell--time {
    white-space: nowrap;
    text-align: right;
    opacity: 0.75;
}

.fungicide-table__empty {
    padding: 6px;
    text-align: center;
    opacity: 0.5;
}

.fungicide-table__row--link {
    cursor: pointer;
}

.fungicide-table__row--link:hover td {
    background: rgba(83, 129, 54, 0.08);
}

/* ── In-progress activities table control ────────────────────── */
.inprogress-table {
    background: #FFFBEB;
    border: 1px solid #D97706;
    border-radius: 5px;
    padding: 6px 10px;
    width: 300px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    font-size: 0.82rem;
}

.inprogress-table__header {
    display: flex;
    align-items: baseline;
}

.inprogress-table__title {
    font-weight: 700;
    font-size: 0.85rem;
    color: #B45309;
    letter-spacing: 0.03em;
}

.inprogress-table__divider {
    border: none;
    border-top: 1px solid #D97706;
    margin: 5px 0;
    opacity: 0.4;
}

.inprogress-table__table {
    width: 100%;
    border-collapse: collapse;
}

.inprogress-table__row:not(:last-child) td {
    border-bottom: 1px solid rgba(217, 119, 6, 0.15);
}

.inprogress-table__row--finishing td {
    animation: blink 1s infinite;
}

.inprogress-table__cell--link {
    cursor: pointer;
}

.inprogress-table__cell--link:hover {
    background: rgba(217, 119, 6, 0.08);
    border-radius: 3px;
}

.inprogress-table__cell {
    padding: 4px 5px;
    vertical-align: middle;
}

.inprogress-table__cell--name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 110px;
    font-weight: 600;
}

.inprogress-table__bar-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    min-width: 70px;
}

.inprogress-table__bar-label {
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1;
}

.inprogress-table__bar-track {
    width: 100%;
    height: 5px;
    background: var(--accent-color, #ddd);
    border-radius: 3px;
    overflow: hidden;
}

.inprogress-table__bar-fill {
    height: 100%;
    border-radius: 3px;
    background: orange;
    transition: width 0.3s ease;
}

.inprogress-table__bar-fill--complete {
    background: #16a34a;
}

.inprogress-table__actions {
    display: flex;
    gap: 4px;
    justify-content: flex-end;
}


.inprogress-table__empty {
    padding: 6px;
    text-align: center;
    opacity: 0.5;
}

/* ── Add-activity popup: form inputs ──────────────────────────── */
.custom-popup select[id^="addActivity-type"],
.custom-popup select[id^="addActivity-destination"],
.custom-popup input[id^="addActivity-start"] {
    width: 100%;
    height: 36px;
    padding: 0 8px;
    margin: 4px 0 0;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.85rem;
    box-sizing: border-box;
}

/* ── Add-activity popup: icon buttons ─────────────────────────── */
.popup-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    background: transparent;
    transition: background 0.15s;
}

.popup-footer__sep {
    width: 1px;
    height: 20px;
    background: rgba(83, 129, 54, 0.3);
    flex-shrink: 0;
}

.popup-icon-btn ion-icon {
    font-size: 18px;
    display: block;
}

.popup-icon-btn--save {
    background: #16a34a;
    color: #fff;
}

.popup-icon-btn--save:hover {
    background: #15803d;
}

.popup-icon-btn--back {
    background: var(--accent-color, #e5e7eb);
    color: #374151;
}

.popup-icon-btn--back:hover {
    background: #d1d5db;
}

/* ── Add-activity popup: toggle switch ────────────────────────── */
.popup-toggle {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 20px;
    flex-shrink: 0;
    cursor: pointer;
}

.popup-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.popup-toggle__slider {
    position: absolute;
    inset: 0;
    background: #d1d5db;
    border-radius: 20px;
    transition: background 0.2s;
}

.popup-toggle__slider::before {
    content: '';
    position: absolute;
    width: 14px;
    height: 14px;
    left: 3px;
    top: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.popup-toggle input:checked + .popup-toggle__slider {
    background: #16a34a;
}

.popup-toggle input:checked + .popup-toggle__slider::before {
    transform: translateX(16px);
}
