.agro-portal {
    display: flex;
    min-height: 80vh;
    background: #f6f8fb;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid #e6e9f0;
}

.agro-portal-sidebar {
    width: 260px;
    background: #111827;
    color: #f9fafb;
    padding: 24px 20px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.agro-portal-brand {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.agro-portal-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.agro-portal-nav a {
    color: #d1d5db;
    text-decoration: none;
    padding: 10px 12px;
    border-radius: 8px;
    transition: background 0.2s ease, color 0.2s ease;
}

.agro-portal-nav a:hover,
.agro-portal-nav a.is-active {
    background: #1f2937;
    color: #ffffff;
}

.agro-portal-user {
    margin-top: auto;
    border-top: 1px solid #374151;
    padding-top: 16px;
    font-size: 14px;
}

.agro-portal-user-name {
    font-weight: 600;
    margin-bottom: 6px;
}

.agro-portal-logout {
    color: #f87171;
    text-decoration: none;
}

.agro-portal-content {
    flex: 1;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.agro-portal-section {
    background: #ffffff;
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.06);
}

.agro-portal-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.agro-portal-header h1 {
    margin: 0 0 6px;
    font-size: 24px;
}

.agro-portal-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.agro-equipment-status {
    font-size: 12px;
    color: #6b7280;
}

#agro-equipment-list,
#agro-tractors-list,
#agro-tools-list {
    width: 100%;
    margin: 10px 0;
    padding: 10px;
    border-radius: 10px;
    border: 1px solid #d1d5db;
    resize: vertical;
}

.agro-portal-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.agro-kpi {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 16px;
}

.agro-kpi-title {
    font-size: 12px;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 8px;
}

.agro-kpi-value {
    font-size: 22px;
    font-weight: 700;
    color: #111827;
}

.agro-kpi-note {
    font-size: 12px;
    color: #6b7280;
    margin-top: 6px;
}

.agro-portal-alerts {
    margin-top: 20px;
}

.agro-alert {
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 14px;
}

.agro-alert-info {
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
}

.agro-portal-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 16px;
}

.agro-fields-layout {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) minmax(280px, 1.2fr);
    gap: 20px;
    margin-bottom: 20px;
}

.agro-fields-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.agro-fields-form input,
.agro-fields-form select {
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid #d1d5db;
}

.agro-fields-coords {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
}

.agro-fields-note {
    font-size: 12px;
    color: #6b7280;
}

.agro-fields-note.is-error {
    color: #b91c1c;
}

.agro-fields-note.is-success {
    color: #047857;
}

.agro-fields-map {
    min-height: 320px;
}

#agro-field-map {
    height: 100%;
    min-height: 320px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e5e7eb;
}

.agro-fields-list h3 {
    margin-top: 0;
}

.agro-fields-table {
    display: grid;
    gap: 8px;
}

.agro-fields-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    cursor: pointer;
}

.agro-fields-row:hover {
    background: #f9fafb;
}

.agro-fields-name {
    font-weight: 600;
}

.agro-fields-meta {
    font-size: 12px;
    color: #6b7280;
}

.agro-portal-forecast {
    margin-top: 20px;
}

.agro-portal-fields-summary {
    margin-top: 20px;
}

.agro-forecast-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.agro-forecast-controls select {
    padding: 6px 8px;
    border-radius: 8px;
    border: 1px solid #d1d5db;
}

.agro-forecast-controls input {
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid #d1d5db;
    min-width: 200px;
}

.agro-forecast-status {
    font-size: 12px;
    color: #6b7280;
}

.agro-forecast-list {
    display: grid;
    gap: 8px;
}

.agro-forecast-row {
    display: grid;
    grid-template-columns: 1.2fr 1fr 1fr;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.agro-forecast-date {
    font-weight: 600;
}

.agro-forecast-temp,
.agro-forecast-prcp {
    text-align: right;
    color: #374151;
}

.agro-forecast-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

.agro-forecast-card {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.agro-forecast-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: #6b7280;
}

.agro-forecast-date {
    font-weight: 600;
    color: #111827;
}

.agro-forecast-code {
    background: #e0f2fe;
    color: #0369a1;
    padding: 2px 6px;
    border-radius: 999px;
    font-size: 11px;
}

.agro-forecast-temp-range {
    display: flex;
    justify-content: center;
    gap: 8px;
    font-size: 18px;
    font-weight: 700;
    color: #111827;
}

.agro-forecast-temp-avg {
    text-align: center;
    font-size: 12px;
    color: #6b7280;
}

.agro-forecast-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 6px;
    font-size: 12px;
    color: #4b5563;
}

.agro-forecast-metric {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 6px 8px;
}

.agro-portal-field-select {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.agro-portal-field-select select {
    min-width: 220px;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid #d1d5db;
}

.agro-table-empty {
    padding: 20px;
    background: #f9fafb;
    border-radius: 10px;
    color: #6b7280;
    text-align: center;
}

.agro-portal-btn {
    border: 1px solid #d1d5db;
    background: #ffffff;
    color: #111827;
    border-radius: 8px;
    padding: 10px 16px;
    cursor: pointer;
    font-weight: 600;
}

.agro-portal-btn.primary {
    background: #2563eb;
    color: #ffffff;
    border-color: #2563eb;
}

.agro-portal-btn:hover {
    opacity: 0.9;
}

.agro-portal-login {
    max-width: 420px;
    margin: 0 auto;
    background: #ffffff;
    padding: 32px;
    border-radius: 16px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.agro-portal-login h2 {
    margin-top: 0;
}

.agro-ai-placeholder {
    margin-top: 12px;
    padding: 14px;
    background: #f3f4f6;
    border-radius: 10px;
    color: #6b7280;
}

.agro-portal-list {
    padding-left: 18px;
    color: #6b7280;
}

.agro-my-fields-list {
    display: grid;
    gap: 16px;
}

.agro-my-field-card {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 16px;
    background: #ffffff;
}

.agro-my-field-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.agro-my-field-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.agro-my-field-title {
    font-weight: 700;
    font-size: 16px;
    color: #111827;
}

.agro-my-field-meta {
    font-size: 12px;
    color: #6b7280;
    margin-top: 4px;
}

.agro-my-field-body {
    margin-top: 16px;
    border-top: 1px solid #e5e7eb;
    padding-top: 16px;
}

.agro-my-field-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.agro-my-field-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 12px;
}

.agro-my-field-section h4 {
    margin: 0 0 4px;
    font-size: 14px;
    color: #111827;
}

.agro-my-field-section input,
.agro-my-field-section select,
.agro-my-field-section textarea {
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid #d1d5db;
}

.agro-repeatable-list {
    display: grid;
    gap: 8px;
}

.agro-repeatable-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)) auto;
    gap: 8px;
    align-items: center;
}

.agro-repeatable-row button {
    padding: 6px 10px;
}

.agro-repeatable-add {
    margin-top: 8px;
}

.agro-season-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    align-items: center;
}

.agro-season-input {
    margin-top: 6px;
}

.agro-my-field-map {
    min-height: 200px;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #d1d5db;
}

.agro-my-field-map-section {
    padding: 0;
    overflow: hidden;
    display: none;
}

.agro-my-field-map-section h4 {
    padding: 12px 12px 0;
}

.agro-my-field-map-section.is-visible {
    display: block;
}

.agro-my-field-footer {
    margin-top: 16px;
    display: flex;
    justify-content: flex-end;
}

.agro-my-field-card.is-open .agro-my-field-toggle {
    background: #1f2937;
    color: #ffffff;
    border-color: #1f2937;
}

@media (max-width: 900px) {
    .agro-portal {
        flex-direction: column;
    }
    
    .agro-portal-sidebar {
        width: 100%;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
    }
    
    .agro-portal-nav {
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    .agro-portal-user {
        width: 100%;
        margin-top: 12px;
    }
}
