@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800&display=swap');

/* --- Your Original CSS is Preserved --- */
:root {
    --primary-color: #2ecc71;
    --primary-dark: #27ae60;
    --secondary-color: #3498db;
    --background-color: #f0f4f2;
    --text-color: #333;
    --card-bg: rgba(255, 255, 255, 0.95);
    --border-color: #e0e0e0;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    --font-family: 'Poppins', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    background-color: var(--background-color);
    color: var(--text-color);
}

.page {
    display: none;
    animation: fadeIn 0.8s ease-in-out;
}

.page.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.btn {
    padding: 12px 30px;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    font-family: var(--font-family);
    cursor: pointer;
    transition: all 0.3s ease;
    background-color: var(--primary-color);
    color: #fff;
    text-decoration: none;
}

.btn:hover {
    background-color: var(--primary-dark);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(46, 204, 113, 0.4);
}

.btn.secondary {
    background-color: #bdc3c7;
}

.btn.secondary:hover {
    background-color: #95a5a6;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 5%;
    position: absolute;
    width: 100%;
    z-index: 10;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.4), transparent);
}

.main-header .logo {
    color: #fff;
    text-decoration: none;
    font-size: 1.5rem;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo img {
    height: 50px;
    width: auto;
}

/* MODIFIED: Auth Buttons */
.auth-buttons {
    display: flex;
    align-items: center;
    gap: 15px;
}

#userInfo {
    color: white;
    font-weight: 600;
    display: none;
}

.auth-buttons .btn {
    margin-left: 15px;
    padding: 10px 25px;
}

/* --- NEW: Phase 2 Master Hero Layout --- */
#homePage {
    background: url('../images/homepage.jpeg') no-repeat center center/cover;
    background-attachment: fixed;
    min-height: 100vh;
}

.master-hero-section {
    min-height: 100vh;
    padding: 0px 5% 50px 5%;
    /* Explicit 120px top padding pushes content very high up */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    /* Explicitly align to top rather than center */
    position: relative;
    z-index: 2;
}

/* Add overlay to make cards readable */
#homePage::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1;
}

.main-header {
    position: relative;
    z-index: 10;
}

.services-section,
.support-hub-section {
    position: relative;
    z-index: 2;
}

.master-hero-title {
    color: #fff;
    font-size: 2.5rem;
    font-weight: 800;
    text-shadow: 0 4px 10px rgba(0, 0, 0, 0.6);
    margin-bottom: 5px;
    text-align: center;
    margin-top: -60px;
}

.master-hero-subtitle {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.15rem;
    margin-bottom: 40px;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
    text-align: center;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
    width: 100%;
    max-width: 1200px;
}

.category-card {
    height: 400px;
    border-radius: 20px;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    background-size: cover;
    background-position: center;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
    transition: all 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.category-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, transparent 20%, rgba(2, 44, 34, 0.8) 100%);
    opacity: 0.6;
    transition: opacity 0.5s;
}

.category-card:hover {
    transform: translateY(-12px) scale(1.02);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5), 0 0 30px rgba(46, 204, 113, 0.2);
    border-color: rgba(46, 204, 113, 0.7);
}

.category-card:hover::before {
    opacity: 0.9;
}

.category-card-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 40px 24px 24px;
    background: linear-gradient(to top, rgba(2, 44, 34, 0.98) 0%, rgba(6, 78, 59, 0.7) 50%, transparent 100%);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    text-align: center;
    transition: all 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
    transform: translateY(60px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
}

.category-card:hover .category-card-content {
    transform: translateY(0);
    background: linear-gradient(to top, rgba(2, 44, 34, 1) 0%, rgba(6, 78, 59, 0.85) 60%, transparent 100%);
}

.category-card-content h3 {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 8px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.6);
    letter-spacing: 0.5px;
    background: linear-gradient(to right, #fff, #e2e8f0);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.category-card-content p {
    font-size: 1.05rem;
    color: #a7f3d0;
    margin-bottom: 20px;
    font-weight: 500;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
    opacity: 0.9;
    transition: opacity 0.3s;
}

.btn-explore {
    padding: 10px 32px;
    border-radius: 30px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    opacity: 0;
    transform: translateY(15px);
    box-shadow: 0 4px 15px rgba(46, 204, 113, 0.3);
    display: flex;
    align-items: center;
    gap: 8px;
}

.category-card:hover .btn-explore {
    opacity: 1;
    transform: translateY(0);
}

.btn-explore:hover {
    filter: brightness(1.15);
    transform: translateY(-3px) scale(1.05) !important;
    box-shadow: 0 10px 25px rgba(46, 204, 113, 0.6), inset 0 0 10px rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
}

/* Hide sub-sections initially via sub-views */
.sub-view {
    min-height: 100vh;
    width: 100%;
    animation: fadeIn 0.4s ease-in-out;
    position: relative;
    z-index: 2;
    padding-top: 80px;
}

.back-nav {
    position: absolute;
    top: 25px;
    left: 5%;
    z-index: 20;
    margin: 0;
    padding: 0;
    transition: all 0.3s ease;
}

@media (max-width: 768px) {
    .back-nav {
        top: 20px;
        left: 5%;
    }
}

.back-btn-dash {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #fff;
    font-size: 1.05rem;
    font-weight: 600;
    text-decoration: none;
    padding: 8px 20px;
    border-radius: 30px;
    background: rgba(6, 78, 59, 0.7);
    border: 1px solid rgba(46, 204, 113, 0.4);
    backdrop-filter: blur(8px);
    transition: all 0.3s;
}

.back-btn-dash:hover {
    background: rgba(6, 78, 59, 0.95);
    border-color: rgba(46, 204, 113, 0.8);
    box-shadow: 0 4px 15px rgba(46, 204, 113, 0.3);
    transform: translateX(-3px);
}

.services-section,
.support-hub-section {
    display: block;
    background: rgba(248, 250, 252, 0.6);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 20px;
    margin: 0 auto;
    padding: 30px 40px 50px 40px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
    max-width: 1200px;
    position: relative;
    z-index: 2;
    text-align: center;
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.services-section h2 {
    font-size: 2.5rem;
    margin-top: 10px;
    margin-bottom: 40px;
    color: #064e3b;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
}

.services-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 30px;
}

.service-card {
    flex: 1 1 300px;
    max-width: 350px;
    background: linear-gradient(145deg, #ffffff 0%, #f0fdf4 100%);
    padding: 40px 30px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    cursor: pointer;
    border: 1px solid rgba(134, 239, 172, 0.3);
    position: relative;
    overflow: hidden;
}

.service-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-dark));
    transform: scaleX(0);
    transition: transform 0.4s ease;
    transform-origin: left;
}

.service-card:hover {
    transform: translateY(-12px);
    box-shadow: 0 20px 40px rgba(46, 204, 113, 0.15);
    border-color: rgba(46, 204, 113, 0.5);
}

.service-card:hover::after {
    transform: scaleX(1);
}

.service-card.upcoming {
    opacity: 0.75;
    cursor: pointer;
}

.service-card .icon-wrapper {
    width: 75px;
    height: 75px;
    margin: 0 auto 20px auto;
    background: linear-gradient(135deg, rgba(46, 204, 113, 0.15), rgba(39, 174, 96, 0.05));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(46, 204, 113, 0.25);
    transition: all 0.4s ease;
}

.service-card:hover .icon-wrapper {
    background: linear-gradient(135deg, rgba(46, 204, 113, 0.3), rgba(39, 174, 96, 0.15));
    transform: scale(1.1);
    box-shadow: 0 10px 20px rgba(46, 204, 113, 0.2);
}

.service-card i {
    transition: all 0.4s ease;
    display: inline-block;
    margin: 0;
}

.service-card h3 {
    font-size: 1.5rem;
    margin-top: 15px;
    margin-bottom: 15px;
    color: #064e3b;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.service-card p {
    color: #115e59;
    font-size: 1rem;
    line-height: 1.6;
}

.tool-page-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    background-size: cover;
    background-position: center;
    transition: background-image 1s ease-in-out;
}

.step-1-bg {
    background-image: url('../images/bg-soil.jpg');
}

.step-2-bg {
    background-image: url('../images/bg-nutrients.jpg');
}

.step-3-bg {
    background-image: url('../images/bg-weather.jpg');
}

.step-4-bg {
    background-image: url('../images/bg-results.jpg');
}

.fert-module-bg {
    background-image: url('../images/bg-fertilizer.jpg');
}

.disease-module-bg {
    background-image: url('../images/bg-disease.jpg');
}

/* --- UPDATED: Main Container Form Background --- */
.form-container {
    background: rgba(255, 255, 255, 0.98);
    /* Less transparent for better contrast */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 16px;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
    padding: 35px;
    /* Shrunk padding */
    width: 100%;
    max-width: 950px;
    /* Scaled back max-width */
    overflow: visible;
}

.form-header {
    text-align: center;
    margin-bottom: 30px;
}

.form-header h1 {
    font-size: 2.5rem;
    color: var(--primary-dark);
}

/* --- UPDATED: Progress Bar --- */
.progress-bar {
    display: flex;
    justify-content: space-between;
    margin-bottom: 35px;
    position: relative;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.progress-track {
    position: absolute;
    top: 16px;
    left: 5%;
    width: 90%;
    height: 4px;
    background: #e2e8f0;
    z-index: 1;
    border-radius: 4px;
}

.progress-bar .step {
    text-align: center;
    position: relative;
    z-index: 2;
    flex: 1;
}

.progress-bar .bullet {
    height: 36px;
    width: 36px;
    border: 4px solid #e2e8f0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.95rem;
    font-weight: 700;
    color: #64748b;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

.progress-bar .bullet.active {
    border-color: transparent;
    background: var(--primary-color);
    color: #fff;
    transform: scale(1.15);
    box-shadow: 0 0 0 6px rgba(46, 204, 113, 0.15), 0 4px 10px rgba(46, 204, 113, 0.3);
}

.progress-bar .bullet.completed {
    border-color: var(--primary-color);
    background: var(--primary-color);
    color: #fff;
}

.progress-bar .step p {
    font-weight: 700;
    margin-top: 12px;
    font-size: 0.75rem;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

/* --- UPDATED: Inner Form Cards & Labels --- */
fieldset.step-content {
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    padding: 25px 30px;
    background: #ffffff;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.04);
    margin-top: 10px;
}

.step-content {
    display: none;
    animation: fadeIn 0.5s ease-in-out;
}

.step-content.active {
    display: block;
}

.step-content h2 {
    font-size: 1.4rem;
    color: #0f172a;
    margin-bottom: 25px;
    text-align: center;
    border-bottom: 1px solid #cbd5e1;
    padding-bottom: 15px;
}

.section-label {
    display: block;
    font-size: 1.05rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 12px;
    margin-top: 10px;
    text-align: left;
    border-bottom: none;
    padding-bottom: 0;
    border-left: 4px solid var(--primary-color);
    padding-left: 12px;
}

/* --- UPDATED: Season Buttons --- */
.season-slider {
    margin-bottom: 20px;
}

.season-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

.season-cards label {
    margin: 0;
    cursor: pointer;
}

.season-cards input {
    display: none;
}

.season-cards span {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 10px 15px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-weight: 600;
    color: #555;
    background: #fff;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.season-cards input:checked+span {
    border-color: var(--primary-color);
    background-color: #eaf8f2;
    color: var(--primary-dark);
    box-shadow: 0 4px 10px rgba(46, 204, 113, 0.15);
}

.season-cards span:hover {
    border-color: var(--primary-color);
}

/* --- UPDATED: Image Selection Grids (Soil & Irrigation) --- */
.symmetric-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
}

.soil-option {
    flex: 0 1 calc(33.333% - 15px);
    min-width: 170px;
    max-width: 220px;
    background: #fff;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.soil-option input[type="radio"] {
    display: none;
}

.soil-option img {
    width: 100%;
    height: 110px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 8px;
}

.soil-option span {
    display: block;
    font-weight: 500;
    font-size: 0.95rem;
    color: #444;
}

.soil-option:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    border-color: #bde4ce;
}

.soil-option input[type="radio"]:checked+img {
    outline: 4px solid var(--primary-color);
    outline-offset: 2px;
}

.soil-option input[type="radio"]:checked~span {
    color: var(--primary-dark);
    font-weight: 700;
}

/* --- Premium Input Fields & Containers --- */
.nutrient-inputs,
.fetched-data-inputs,
.manual-location-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    background: #f8fafc;
    /* Soft gray inner container */
    padding: 30px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.02);
}

.input-field {
    display: flex;
    flex-direction: column;
}

.input-field label {
    color: #475569;
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 8px;
}

/* --- Interactive Inputs with Hover Effects --- */
.input-field input,
.input-field select {
    border: 1px solid #cbd5e1;
    padding: 14px;
    font-size: 1.05rem;
    border-radius: 8px;
    background: #ffffff;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: #0f172a;
    width: 100%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
    /* Very subtle resting shadow */
}

/* New Hover Lift Effect */
.input-field input:hover,
.input-field select:hover {
    border-color: #94a3b8;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.06);
    /* Shadow expands on hover */
}

.input-field input:focus,
.input-field select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(46, 204, 113, 0.15);
    transform: translateY(-2px);
    /* Keeps it lifted while typing */
}

.button-group {
    margin-top: 40px;
    display: flex;
    justify-content: space-between;
    gap: 15px;
}

.loader {
    border: 8px solid var(--border-color);
    border-top: 8px solid var(--primary-color);
    border-radius: 50%;
    width: 80px;
    height: 80px;
    animation: spin 1s linear infinite;
    margin: 50px auto;
    display: none;
}

.loader.active {
    display: block;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

#results-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.result-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    animation: slideUp 0.5s ease-out;
}

.result-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.card-content {
    padding: 20px;
}

.card-content h3 {
    margin-bottom: 10px;
    color: var(--primary-dark);
}

.card-content p {
    font-size: 1.1rem;
}

.card-content span {
    font-weight: 600;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: #fff;
    padding: 30px 40px;
    border-radius: 12px;
    text-align: center;
    transform: scale(0.9);
    transition: all 0.3s ease;
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.modal-content h3 {
    margin-bottom: 20px;
}

.module-card {
    background-color: white;
    border-radius: 16px;
    box-shadow: var(--shadow);
    padding: 30px 40px;
    text-align: left;
}

.module-card h2 {
    color: var(--primary-dark);
    margin-bottom: 10px;
    font-size: 2rem;
    display: flex;
    align-items: center;
}

.module-card h2 i {
    margin-right: 15px;
}

.module-card p {
    color: #666;
    margin-bottom: 30px;
    line-height: 1.6;
}

#fertilizer-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

#fertilizer-form .radio-group {
    display: flex;
    gap: 20px;
    margin-top: 10px;
    flex-wrap: wrap;
}

#fertilizer-form .radio-group label {
    display: inline-flex;
    align-items: center;
    font-weight: normal;
    cursor: pointer;
}

#fertilizer-results {
    background-color: #f8f9fa;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 25px;
    margin-top: 30px;
}

#fertilizer-results h3 {
    color: var(--primary-dark);
    margin-bottom: 15px;
    font-size: 1.6em;
    display: flex;
    align-items: center;
}

#fertilizer-results h3 i {
    margin-right: 10px;
}

.error-message {
    color: #dc3545;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 5px;
    padding: 10px 15px;
    margin-top: 15px;
    font-size: 0.95em;
    display: none;
}

#fertilizer-results .recommendation-card {
    background-color: #fff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 15px;
}

#fertilizer-results .recommendation-card h4 {
    color: var(--primary-dark);
    font-size: 1.2rem;
    margin-bottom: 10px;
}

#fertilizer-results .rec-details {
    font-size: 0.95rem;
    line-height: 1.6;
}

#fertilizer-results .rec-details p {
    margin-bottom: 5px;
}

#fertilizer-results .rec-summary {
    font-weight: 600;
    margin-top: 15px;
    background-color: #e8f8ee;
    padding: 10px;
    border-radius: 6px;
    border-left: 4px solid var(--primary-color);
}

.upload-area {
    border: 3px dashed var(--border-color);
    border-radius: 12px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 20px;
}

.upload-area:hover {
    border-color: var(--primary-dark);
    background-color: #f8f9fa;
}

.upload-area i {
    font-size: 3rem;
    color: var(--secondary-color);
    margin-bottom: 15px;
}

.upload-area p {
    color: #666;
    font-weight: 600;
    margin: 0;
}

.image-preview {
    text-align: center;
    margin-bottom: 20px;
}

.image-preview img {
    max-width: 100%;
    max-height: 300px;
    border-radius: 8px;
    border: 2px solid var(--border-color);
    box-shadow: var(--shadow);
}

#disease-results {
    /* Container for V2 result card - styling handled by .result-card-v2 */
    width: 100%;
}

/* --- Gemini Feature Styles --- */
.gemini-btn {
    padding: 8px 16px;
    font-size: 0.85rem;
    margin-top: 15px;
    width: 100%;
    background-color: var(--secondary-color);
}

.gemini-btn:hover {
    background-color: #2980b9;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.4);
}

#geminiModal .modal-content {
    text-align: left;
    max-width: 700px;
}

#geminiModalContent {
    /* Container styling is now handled inline in index.html to create the white card effect */
}

/* Rich text formatting for AI Markdown Output */
#geminiModalContent h3,
#geminiModalContent h4 {
    color: #0f172a;
    font-weight: 800;
    margin-top: 1.5em;
    margin-bottom: 0.8em;
    line-height: 1.3;
}

#geminiModalContent h3 {
    font-size: 1.35rem;
    border-bottom: 2px solid #f1f5f9;
    padding-bottom: 8px;
}

#geminiModalContent h4 {
    font-size: 1.15rem;
    color: #334155;
}

#geminiModalContent p {
    color: #475569;
    margin-bottom: 1.2em;
    font-size: 1.05rem;
    line-height: 1.7;
}

#geminiModalContent strong {
    color: #0f172a;
    font-weight: 700;
    background: linear-gradient(120deg, rgba(16, 185, 129, 0.15) 0%, rgba(16, 185, 129, 0.05) 100%);
    padding: 0 4px;
    border-radius: 4px;
}

#geminiModalContent ul,
#geminiModalContent ol {
    margin-bottom: 1.5em;
    padding-left: 1.5em;
    color: #475569;
}

#geminiModalContent li {
    margin-bottom: 0.5em;
    line-height: 1.6;
}

#geminiModalContent li::marker {
    color: #10b981;
    font-weight: bold;
}

/* ================================================== */
/* PREMIUM CHATBOT — Dark Glassmorphism Theme          */
/* ================================================== */

/* ─── Toggle Button ─────────────────────────────── */
.cb-toggle {
    position: fixed;
    bottom: 28px;
    right: 28px;
    width: 82px;
    height: 82px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0f2d1a 0%, #1a4a2e 100%);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 9999;
    box-shadow:
        0 8px 32px rgba(46, 204, 113, 0.45),
        0 2px 8px rgba(0,0,0,0.4),
        inset 0 1px 0 rgba(255,255,255,0.1);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s;
    overflow: hidden;
    padding: 4px;
}

.cb-toggle img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    filter: drop-shadow(0 2px 8px rgba(46,204,113,0.4));
}

.cb-toggle:hover {
    transform: scale(1.1) rotate(-5deg);
    box-shadow:
        0 12px 40px rgba(46, 204, 113, 0.6),
        0 4px 16px rgba(0,0,0,0.5);
}

.cb-toggle-pulse {
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    background: conic-gradient(from 0deg, #2ecc71, #27ae60, #1abc9c, #2ecc71);
    opacity: 0.25;
    animation: cbPulseRing 2s ease-out infinite;
    pointer-events: none;
}

@keyframes cbPulseRing {
    0%   { transform: scale(1);   opacity: 0.35; }
    100% { transform: scale(1.6); opacity: 0; }
}

/* ─── Container ─────────────────────────────────── */
.cb-container {
    position: fixed;
    bottom: 120px;
    right: 28px;
    width: 450px;
    max-width: calc(100vw - 20px);
    max-height: 78vh;
    background: linear-gradient(160deg, #0b1f14 0%, #0e2318 60%, #091a10 100%);
    backdrop-filter: blur(32px) saturate(200%);
    -webkit-backdrop-filter: blur(32px) saturate(200%);
    border: 1.5px solid rgba(46, 204, 113, 0.28);
    border-radius: 24px;
    box-shadow:
        0 24px 70px rgba(0, 0, 0, 0.7),
        0 0 60px rgba(46, 204, 113, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 9998;
    transform: translateY(30px) scale(0.93);
    opacity: 0;
    visibility: hidden;
    transition: all 0.38s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.cb-container.active {
    transform: translateY(0) scale(1);
    opacity: 1;
    visibility: visible;
}

/* ─── Header ─────────────────────────────────────── */
.cb-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    background: linear-gradient(135deg, rgba(30, 90, 50, 0.7) 0%, rgba(20, 60, 38, 0.85) 100%);
    border-bottom: 1px solid rgba(46, 204, 113, 0.2);
    flex-wrap: nowrap;
    gap: 6px;
}

.cb-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 1;
    min-width: 0;
}

.cb-avatar {
    position: relative;
    width: 46px;
    height: 46px;
    flex-shrink: 0;
}

.cb-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2.5px solid rgba(46, 204, 113, 0.7);
    box-shadow: 0 0 16px rgba(46, 204, 113, 0.4), 0 0 0 4px rgba(46,204,113,0.1);
}

.cb-online-dot {
    position: absolute;
    bottom: 1px;
    right: 1px;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: #2ecc71;
    border: 2px solid #0e2318;
    box-shadow: 0 0 8px rgba(46, 204, 113, 0.8);
    animation: dotPulse 2s infinite;
}

@keyframes dotPulse {
    0%, 100% { box-shadow: 0 0 4px rgba(46,204,113,0.6); }
    50%       { box-shadow: 0 0 12px rgba(46,204,113,1); }
}

.cb-header-info {
    min-width: 0;
    flex: 1;
}

.cb-header-info h3 {
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    margin: 0;
    font-family: 'Poppins', sans-serif;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cb-status {
    font-size: 11px;
    color: #4ade80;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cb-header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
}

.cb-lang-select {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 22px 4px 8px;
    border-radius: 8px;
    cursor: pointer;
    outline: none;
    font-family: 'Poppins', sans-serif;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23aaa'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 6px center;
    background-size: 8px 5px;
    flex-shrink: 0;
}

.cb-icon-btn {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #94a3b8;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
    flex-shrink: 0;
}

.cb-icon-btn:hover {
    background: rgba(46, 204, 113, 0.15);
    color: #2ecc71;
    border-color: rgba(46, 204, 113, 0.3);
}

.cb-close {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.2);
}

.cb-close:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
    border-color: rgba(239, 68, 68, 0.4);
}

/* Chat Body */
.cb-body {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-height: 200px;
    max-height: 45vh;
    scrollbar-width: thin;
    scrollbar-color: rgba(46, 204, 113, 0.3) transparent;
}

.cb-body::-webkit-scrollbar {
    width: 5px;
}

.cb-body::-webkit-scrollbar-track {
    background: transparent;
}

.cb-body::-webkit-scrollbar-thumb {
    background: rgba(46, 204, 113, 0.3);
    border-radius: 10px;
}

/* Messages */
.cb-msg {
    display: flex;
    gap: 10px;
    animation: cbMsgIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes cbMsgIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.cb-msg.cb-bot {
    align-self: flex-start;
}

.cb-msg.cb-user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.cb-msg-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    margin-top: 2px;
    border: 2px solid rgba(0, 230, 118, 0.55);
    box-shadow: 0 0 10px rgba(0, 230, 118, 0.25);
}

.cb-msg-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cb-msg.cb-user .cb-msg-avatar {
    display: none;
}

.cb-msg-content {
    max-width: 82%;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.cb-bot .cb-msg-content {
    align-items: flex-start;
}

.cb-user .cb-msg-content {
    align-items: flex-end;
}

.cb-msg-bubble {
    padding: 13px 17px;
    border-radius: 18px;
    font-size: 13.5px;
    line-height: 1.62;
    word-wrap: break-word;
    font-family: 'Poppins', sans-serif;
    width: fit-content;
    transition: box-shadow 0.2s;
}

.cb-bot .cb-msg-bubble {
    background: linear-gradient(135deg,
        rgba(0, 40, 24, 0.92) 0%,
        rgba(0, 28, 18, 0.88) 100%);
    color: #b8f5d8;
    border: 1px solid rgba(0, 230, 118, 0.20);
    border-left: 3px solid #00e676;
    border-bottom-left-radius: 5px;
    box-shadow: 0 3px 16px rgba(0, 0, 0, 0.38),
                inset 0 1px 0 rgba(0,230,118,0.07);
}
.cb-bot .cb-msg-bubble:hover {
    box-shadow: 0 5px 22px rgba(0, 0, 0, 0.45),
                0 0 12px rgba(0,230,118,0.10);
}

.cb-user .cb-msg-bubble {
    background: linear-gradient(135deg, #00c853 0%, #00897b 100%);
    color: #f0fff8;
    border: 1px solid rgba(0, 230, 118, 0.4);
    border-bottom-right-radius: 5px;
    box-shadow: 0 4px 18px rgba(0, 200, 83, 0.28);
}
.cb-user .cb-msg-bubble:hover {
    box-shadow: 0 6px 24px rgba(0, 200, 83, 0.42);
}

.cb-msg-time {
    font-size: 10px;
    color: rgba(120, 200, 150, 0.5);
    padding: 0 4px;
}

.cb-msg.cb-user .cb-msg-time {
    text-align: right;
}

/* ============================================================== */
/* MOBILE RESPONSIVENESS & FARMER ACCESSIBILITY (MARKET MODULE)   */
/* ============================================================== */
@media (max-width: 768px) {
    .mkt-module-wrap {
        padding: 10px;
    }
    
    .mkt-hero {
        padding: 20px 15px;
        text-align: left;
    }
    
    .mkt-hero h2 {
        font-size: 1.6rem;
    }
    
    .mkt-select-row {
        flex-direction: column;
        gap: 15px;
    }
    
    /* Enhance touch targets for farmer accessibility */
    .custom-select-input {
        padding: 14px 15px !important;
        font-size: 1rem;
    }
    
    .mkt-fetch-btn {
        width: 100%;
        padding: 14px 15px;
        font-size: 1.1rem;
        margin-top: 5px;
    }
    
    .mkt-cards-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .mkt-advisory-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .mkt-chart-wrap {
        height: 250px !important; /* Smaller on mobile but strictly bounded */
    }
    
    .mkt-calc-grid {
        grid-template-columns: 1fr;
    }
    
    /* Ensure explanation cards wrap text properly on tiny screens */
    .mkt-intelligence-card p {
        word-break: break-word;
        font-size: 0.9rem !important;
    }
    
    /* Ensure tables don't break the layout */
    .mkt-table-scroll {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .mkt-price-table th, .mkt-price-table td {
        padding: 10px;
        font-size: 0.85rem;
    }
    
    /* Ensure the live monitoring grid stacks nicely */
    #live-traffic-content {
        flex-direction: column;
        gap: 15px;
    }
}

@media (max-width: 375px) {
    .mkt-hero h2 {
        font-size: 1.4rem;
    }
    .mkt-card-price {
        font-size: 1.6rem;
    }
}

/* ─── Chatbot Mobile Responsiveness ─────────────── */
@media (max-width: 480px) {
    .cb-toggle {
        width: 68px;
        height: 68px;
        bottom: 18px;
        right: 16px;
    }

    .cb-container {
        right: 0;
        bottom: 0;
        width: 100vw;
        max-width: 100vw;
        max-height: 90vh;
        border-radius: 20px 20px 0 0;
        border-left: none;
        border-right: none;
        border-bottom: none;
    }

    .cb-header {
        padding: 12px 14px;
    }

    .cb-header-info h3 {
        font-size: 13px;
    }

    .cb-lang-select {
        font-size: 11px;
        padding: 3px 18px 3px 6px;
    }

    .cb-icon-btn {
        width: 28px;
        height: 28px;
        font-size: 11px;
    }

    .cb-body {
        max-height: 55vh;
        padding: 12px;
    }

    .cb-msg-bubble {
        font-size: 13px;
        padding: 10px 13px;
    }

    .cb-input-bar {
        padding: 10px 12px;
    }
}


/* Typing Indicator */
.cb-typing {
    display: flex;
    gap: 10px;
    align-self: flex-start;
}

.cb-typing-dots {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-left: 3px solid rgba(46, 204, 113, 0.5);
    border-radius: 16px;
    border-bottom-left-radius: 4px;
}

.cb-typing-dots span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #2ecc71;
    animation: cbDotBounce 1.4s ease-in-out infinite;
}

.cb-typing-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.cb-typing-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes cbDotBounce {

    0%,
    60%,
    100% {
        transform: translateY(0);
        opacity: 0.4;
    }

    30% {
        transform: translateY(-8px);
        opacity: 1;
    }
}

/* Suggestion Chips */
.cb-chips {
    display: flex;
    gap: 8px;
    padding: 10px 16px;
    overflow-x: auto;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    scrollbar-width: none;
    flex-shrink: 0;
}

.cb-chips::-webkit-scrollbar {
    display: none;
}

.cb-chips.hidden {
    display: none;
}

.cb-chip {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 20px;
    color: #94a3b8;
    font-size: 12px;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.25s ease;
}

.cb-chip i {
    font-size: 11px;
    color: #2ecc71;
}

.cb-chip:hover {
    background: rgba(46, 204, 113, 0.12);
    border-color: rgba(46, 204, 113, 0.4);
    color: #d1fae5;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(46, 204, 113, 0.15);
}

/* ─── Input Bar ──────────────────────────────────── */
.cb-input-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
    background: linear-gradient(180deg, rgba(10,25,16,0.95) 0%, rgba(6,18,10,1) 100%);
    border-top: 1px solid rgba(46, 204, 113, 0.15);
}

.cb-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.07);
    border: 1.5px solid rgba(46, 204, 113, 0.2);
    border-radius: 14px;
    padding: 11px 16px;
    color: #f0fdf4;
    font-size: 13.5px;
    font-family: 'Poppins', sans-serif;
    outline: none;
    transition: border-color 0.25s, box-shadow 0.25s, background 0.25s;
}

.cb-input::placeholder {
    color: #4b6858;
}

.cb-input:focus {
    border-color: rgba(46, 204, 113, 0.6);
    background: rgba(46, 204, 113, 0.06);
    box-shadow: 0 0 0 4px rgba(46, 204, 113, 0.1);
}

.cb-mic-btn,
.cb-send-btn {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.25s;
}

.cb-mic-btn {
    background: rgba(0, 230, 118, 0.08);
    color: #5effa0;
    border: 1px solid rgba(0, 230, 118, 0.25);
    border-radius: 50%;
}

.cb-mic-btn:hover {
    background: rgba(0, 230, 118, 0.20);
    color: #00e676;
    box-shadow: 0 0 12px rgba(0,230,118,0.25);
}

.cb-mic-btn.recording {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
    border-color: rgba(239, 68, 68, 0.4);
    animation: cbMicPulse 1.2s infinite;
}

@keyframes cbMicPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
    50%       { box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
}

.cb-send-btn {
    background: linear-gradient(135deg, #00e676 0%, #00c853 100%);
    color: #003318;
    box-shadow: 0 4px 16px rgba(0, 230, 118, 0.45);
    font-weight: 700;
}

.cb-send-btn:hover {
    background: linear-gradient(135deg, #1de9b6 0%, #00e676 100%);
    transform: scale(1.1);
    box-shadow: 0 6px 22px rgba(0, 230, 118, 0.60);
}

/* Markdown Content in Bot Bubbles */
.cb-msg-bubble h1,
.cb-msg-bubble h2,
.cb-msg-bubble h3,
.cb-msg-bubble h4,
.cb-msg-bubble h5,
.cb-msg-bubble h6 {
    color: #2ecc71;
    margin: 8px 0 4px;
    font-weight: 700;
    line-height: 1.3;
}

.cb-msg-bubble h1 {
    font-size: 16px;
}

.cb-msg-bubble h2 {
    font-size: 15px;
}

.cb-msg-bubble h3 {
    font-size: 14px;
}

.cb-msg-bubble p {
    margin: 4px 0;
}

.cb-msg-bubble strong {
    color: #fff;
}

.cb-msg-bubble em {
    color: #a7f3d0;
}

.cb-msg-bubble ul,
.cb-msg-bubble ol {
    padding-left: 18px;
    margin: 6px 0;
}

.cb-msg-bubble li {
    margin-bottom: 3px;
}

.cb-msg-bubble code {
    background: rgba(46, 204, 113, 0.12);
    color: #a7f3d0;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
    font-family: 'Consolas', monospace;
}

.cb-msg-bubble pre {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 10px 12px;
    overflow-x: auto;
    margin: 6px 0;
}

.cb-msg-bubble pre code {
    background: none;
    padding: 0;
    font-size: 12px;
}

.cb-msg-bubble a {
    color: #2ecc71;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.cb-msg-bubble a:hover {
    color: #a7f3d0;
}

.cb-msg-bubble blockquote {
    border-left: 3px solid #2ecc71;
    padding-left: 10px;
    margin: 6px 0;
    color: #94a3b8;
    font-style: italic;
}

/* Responsive */
@media (max-width: 480px) {
    .cb-container {
        right: 0;
        bottom: 0;
        width: 100vw;
        max-width: 100vw;
        max-height: 85vh;
        border-radius: 22px 22px 0 0;
    }

    .cb-toggle {
        bottom: 18px;
        right: 18px;
        width: 56px;
        height: 56px;
    }

    .cb-body {
        max-height: 50vh;
    }
}

/* --- NEW: Login Page Styles --- */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.3)), url('../images/farm-bg.png') no-repeat center center/cover !important;
    position: relative;
    padding: 20px;
}

.top-right-lang {
    position: absolute;
    top: 20px;
    right: 30px;
    z-index: 10;
}

.login-box {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 420px;
    padding: 25px 40px 30px 40px;
    background: rgba(20, 30, 25, 0.65);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 24px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    text-align: center;
}

.login-box h2 {
    margin: 0 auto 30px auto;
    color: #fff;
    font-weight: 800;
    font-size: 2.2rem;
    line-height: 1.3;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
    text-align: center;
    width: 100%;
    display: block;
}

.login-box .input-field {
    text-align: left;
    margin-bottom: 12px;
}

.login-box label {
    color: #fff;
    font-weight: 600;
    font-size: 0.95rem;
    display: block;
    margin-bottom: 8px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.login-box input {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 14px 15px;
    border-radius: 12px;
    width: 100%;
    font-family: var(--font-family);
    font-weight: 500;
    font-size: 1rem;
    transition: 0.3s;
}

.login-box input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.login-box input:focus {
    background: rgba(255, 255, 255, 0.25);
    outline: none;
    border-color: var(--primary-color);
}

.login-box .btn {
    width: 100%;
    margin-top: 10px;
    border-radius: 12px;
    padding: 14px;
    font-size: 1.05rem;
}

.social-btn {
    background: #fff !important;
    color: #333 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-weight: 600;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    margin-top: 10px !important;
    transition: all 0.2s;
}

.social-btn:hover {
    background: #f8f9fa !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.signup-text {
    text-align: center;
    margin-top: 15px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.95rem;
}

.signup-text a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 700;
}

.signup-text a:hover {
    text-decoration: underline;
}

#auth-error {
    color: #ff6b6b;
    margin-top: 15px;
    font-size: 0.9em;
    display: none;
    background: rgba(0, 0, 0, 0.6);
    padding: 10px;
    border-radius: 8px;
    text-align: center;
    border: 1px solid #ff6b6b;
}

/* Password visibility toggle */
.pw-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.pw-wrapper input {
    flex: 1;
    padding-right: 46px !important;
}

.pw-eye-toggle {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    cursor: pointer;
    color: rgba(0, 0, 0, 0.55);
    font-size: 1rem;
    padding: 4px 6px;
    border-radius: 6px;
    transition: color 0.2s, background 0.2s;
    line-height: 1;
    display: flex;
    align-items: center;
}

.pw-eye-toggle:hover {
    color: #059669;
    background: rgba(0, 0, 0, 0.06);
}

.lang-selector {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.4);
    padding: 8px 15px;
    border-radius: 20px;
    font-family: var(--font-family);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    outline: none;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    transition: 0.3s;
}

.lang-selector:hover {
    background: rgba(255, 255, 255, 0.35);
    transform: scale(1.05);
}

.lang-selector option,
.scheme-lang-selector option,
.cb-lang-select option {
    background-color: #ffffff !important;
    color: #000000 !important;
    font-weight: 500;
}

@media (max-width: 768px) {
    .hero-content h1 {
        font-size: 2.5rem;
    }

    .nutrient-inputs,
    .fetched-data-inputs,
    .manual-location-inputs {
        grid-template-columns: 1fr;
    }

    .auth-buttons .lang-selector {
        display: inline-block;
        padding: 6px 10px;
        font-size: 0.8rem;
        margin-right: 8px;
        max-width: 95px;
    }

    .main-header .logo {
        font-size: 1.2rem;
        gap: 6px;
    }
    
    .auth-buttons {
        gap: 8px;
    }

    .progress-bar .step p {
        display: none;
    }

    .services-section {
        padding: 60px 5%;
    }

    .footer-content {
        text-align: center;
    }

    .login-box {
        padding: 30px 20px;
    }
}


    
    /* Fix profile card overflowing screen edge on mobile */
    .farm-snapshot-panel {
        position: fixed !important;
        top: 70px !important;
        right: 5% !important;
        left: 5% !important;
        width: 90% !important;
        min-width: 0 !important;
        max-width: 400px !important;
        margin: 0 auto;
    }
}

/* 1. Profile Dropdown Styles */
.profile-dropdown {
    position: relative;
    display: inline-block;
}

.profile-icon {
    font-size: 2.2rem;
    color: #fff;
    cursor: pointer;
}

.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    top: 120%;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    min-width: 190px;
    max-width: 240px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15), 0 1px 3px rgba(0, 0, 0, 0.05);
    z-index: 100;
    border-radius: 14px;
    overflow: hidden;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transform-origin: top right;
    animation: dropdownPop 0.18s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes dropdownPop {
    0% {
        opacity: 0;
        transform: scale(0.96) translateY(-8px);
    }

    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.dropdown-content #userInfo {
    color: #ffffff;
    padding: 12px 16px;
    display: block;
    font-size: 0.85rem;
    font-weight: 700;
    background: linear-gradient(135deg, #10b981, #059669);
    border-bottom: 1px solid #047857;
    margin-bottom: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dropdown-content #userInfo.guest-mode-hidden {
    display: none !important;
}

.guest-upgrade-promo {
    padding: 20px 18px;
    background: #fff;
    display: none;
    text-align: center;
}

.guest-upgrade-promo.active {
    display: block;
}

.promo-header {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--primary-dark);
    margin-bottom: 8px;
    display: block;
}

.promo-text {
    font-size: 0.85rem;
    color: #64748b;
    margin-bottom: 18px;
    line-height: 1.5;
}

.promo-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.promo-btn {
    width: 100%;
    padding: 12px;
    font-size: 0.95rem;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

.promo-login-btn {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 4px 12px rgba(46, 204, 113, 0.25);
}

.promo-login-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(46, 204, 113, 0.35);
}

.promo-signup-btn {
    background: #f8fafc;
    color: #475569;
    border: 1px solid #cbd5e1;
}

.promo-signup-btn:hover {
    background: #f1f5f9;
    color: #0f172a;
}

/* Common style for links inside dropdown */
.dropdown-content .dropdown-link {
    color: #475569;
    padding: 8px 16px;
    text-decoration: none;
    display: flex;
    align-items: center;
    font-size: 0.9rem;
    font-weight: 600;
    transition: background 0.2s ease, color 0.2s ease;
    background: none;
    border: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
}

.dropdown-content .dropdown-link i {
    width: 22px;
    font-size: 1.05rem;
    color: #10b981;
    transition: color 0.2s ease;
}

.dropdown-content .dropdown-link:hover {
    background-color: #f8fafc;
    color: var(--primary-dark);
}

.dropdown-content .dropdown-link:hover i {
    color: var(--primary-color);
}

.dropdown-content #logoutButton {
    border-top: none;
}

.dropdown-content.guest-active #logoutButton {
    display: none !important;
}

.dropdown-content #logoutButton i {
    color: #ef4444;
}

.dropdown-content #logoutButton:hover {
    background-color: #fef2f2;
    color: #dc2626;
}

.dropdown-content #logoutButton:hover i {
    color: #b91c1c;
}

.profile-dropdown.active .dropdown-content {
    display: block;
}

/* 2. Enhanced Button Hover Effect */
.hero-section .btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 25px rgba(46, 204, 113, 0.5);
}

/* 3. Chatbot Icon Pulsing Animation */
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(46, 204, 113, 0.7);
    }

    70% {
        box-shadow: 0 0 0 15px rgba(46, 204, 113, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(46, 204, 113, 0);
    }
}

/* ================================================== */
/* PREMIUM FOOTER STYLES */
/* ================================================== */
.main-footer {
    background: linear-gradient(145deg, #115e59, #064e3b);
    color: #e2e8f0;
    padding: 70px 5% 30px;
    position: relative;
    border-top: 1px solid rgba(46, 204, 113, 0.25);
}

.main-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--primary-color), transparent);
    opacity: 0.5;
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 50px;
    margin-bottom: 50px;
    max-width: 1200px;
    margin-inline: auto;
}

.footer-brand {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.footer-brand h3 {
    font-size: 1.8rem;
    font-weight: 800;
    background: linear-gradient(90deg, #fff, #a7f3d0);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 0;
}

.brand-col p {
    font-size: 1rem;
    line-height: 1.8;
    color: #e2e8f0;
    max-width: 90%;
}

.footer-column h4 {
    font-size: 1.25rem;
    margin-bottom: 25px;
    color: #fff;
    font-weight: 600;
    position: relative;
    display: inline-block;
    padding-bottom: 8px;
}

.footer-column h4::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 3px;
    background: var(--primary-color);
    border-radius: 2px;
}

.links-col ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.links-col ul li {
    margin-bottom: 12px;
}

.links-col a {
    color: #e2e8f0;
    text-decoration: none;
    font-size: 1rem;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
}

.links-col a::before {
    content: '›';
    color: #a7f3d0;
    font-size: 1.5rem;
    line-height: 1;
    margin-right: 8px;
    transition: transform 0.3s ease;
}

.links-col a:hover {
    color: #69f0ae;
}

.links-col a:hover::before {
    transform: translateX(4px);
}

.social-icons {
    display: flex;
    gap: 12px;
}

.social-icons a {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.1rem;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.social-icons a:hover {
    background: rgba(46, 204, 113, 0.25);
    color: #a7f3d0;
    border-color: rgba(46, 204, 113, 0.6);
    transform: translateY(-4px);
    box-shadow: 0 6px 15px rgba(46, 204, 113, 0.3);
}

.footer-bottom {
    text-align: center;
    padding-top: 25px;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    font-size: 0.95rem;
    color: #cbd5e1;
    max-width: 1200px;
    margin-inline: auto;
}

@media (max-width: 768px) {
    .footer-content {
        grid-template-columns: 1fr;
        gap: 40px;
        text-align: center;
    }

    .footer-brand {
        justify-content: center;
    }

    .brand-col p {
        margin: 0 auto;
    }

    .footer-column h4::after {
        left: 50%;
        transform: translateX(-50%);
    }

    .links-col a {
        justify-content: center;
    }

    .social-icons {
        justify-content: center;
    }
}

.service-card {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.service-card.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.form-error {
    color: #c0392b;
    font-size: 0.9rem;
    font-weight: 600;
    text-align: center;
    margin-top: 20px;
    display: none;
}

/* ================================================== */
/* FARMER SUPPORT HUB STYLES (UPGRADED DESIGN) */
/* ================================================== */
.support-hub-section {
    padding: 60px 20px;
    background-color: #ffffff;
}

.support-hub-section .container h2 {
    text-align: center;
    font-size: 2.2rem;
    color: var(--text-color);
    margin-bottom: 10px;
}

.hub-subtitle {
    font-size: 1.2rem;
    color: #666;
    text-align: center;
    max-width: 650px;
    margin: 0 auto 50px auto;
    line-height: 1.6;
}

/* Support Hub Sub-view Sections */
.support-module-section {
    padding: 0px 20px 60px;
    max-width: 1200px;
    margin: 0 auto;
}

.support-module-section .container {
    background: white;
    border-radius: 16px;
    padding: 35px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    border: 1px solid #e2e8f0;
}

.support-module-section h2 {
    text-align: center;
    font-size: 1.8rem;
    margin-bottom: 5px;
}

.support-hub-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
}

.support-card {
    background: var(--card-bg, white);
    border-radius: 12px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
}

.support-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
}

.support-card-header {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 25px;
}

.support-icon-placeholder {
    width: 60px;
    height: 60px;
    flex-shrink: 0;
    background-color: #eaf8f2;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color, #2ecc71);
    transition: all 0.3s ease-in-out;
}

.support-card:hover .support-icon-placeholder {
    transform: scale(1.1) rotate(-5deg);
}

.support-icon-placeholder.style-2 {
    background-color: #eaf3f9;
    color: var(--secondary-color, #3498db);
}

.support-icon-placeholder.style-3 {
    background-color: #fef5e7;
    color: #f39c12;
}

.support-card-header h3 {
    font-size: 1.5rem;
    color: var(--text-color, #333);
    line-height: 1.4;
    font-weight: 600;
    margin: 0;
    flex: 1;
}

.support-card-body {
    padding: 0 25px 25px 25px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    overflow: hidden;
}

.support-card-body p {
    font-size: 0.95rem;
    color: #555;
    line-height: 1.6;
    margin-bottom: 20px;
    flex-grow: 1;
}

.support-card-body .coming-soon-badge,
.support-card-body .btn {
    opacity: 0;
    transform: translateY(15px);
    transition: all 0.3s ease-in-out;
    transition-delay: 0.1s;
}

.support-card-body .btn {
    width: 100%;
    text-align: center;
}

.support-card-body .coming-soon-badge {
    font-size: 0.9rem;
    font-weight: 600;
    color: #e67e22;
    margin-bottom: 10px;
}

.support-card:hover .support-card-body .btn,
.support-card:hover .support-card-body .coming-soon-badge {
    opacity: 1;
    transform: translateY(0);
}

/* ================================================== */
/* P2P PREVIEW STYLES (NEW UPGRADED DESIGN)   */
/* ================================================== */
.p2p-preview-section {
    padding: 60px 20px;
    background-color: #ffffff;
}

.farmer-request-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
}

.farmer-request-card {
    background: var(--card-bg, white);
    border-radius: 12px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
}

.farmer-request-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.farmer-request-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background-color: #eee;
}

.farmer-card-content {
    padding: 25px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.fpo-badge {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary-dark);
    background-color: #eaf8f2;
    padding: 5px 10px;
    border-radius: 20px;
    display: inline-block;
    margin-bottom: 15px;
    align-self: flex-start;
}

.farmer-card-content h4 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 10px;
}

.farmer-card-content p {
    font-size: 0.95rem;
    color: #555;
    line-height: 1.6;
    flex-grow: 1;
    margin-bottom: 25px;
}

.goal-bar {
    width: 100%;
    background-color: var(--border-color, #f0f0f0);
    border-radius: 20px;
    height: 10px;
    margin-bottom: 10px;
}

.goal-bar-progress {
    width: 0%;
    height: 100%;
    background-color: var(--primary-color);
    border-radius: 20px;
}

.goal-details {
    display: flex;
    justify-content: space-between;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 20px;
}

.goal-details .amount {
    color: var(--primary-dark);
}

.related-schemes {
    margin-top: 15px;
    padding: 15px;
    border-radius: 8px;
    background-color: #f9f9f9;
    border-left: 3px solid var(--primary-color);
}

.related-schemes h5 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--primary-dark, #27ae60);
    margin-bottom: 10px;
}

.related-schemes ul {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.related-schemes li {
    margin-bottom: 5px;
}

.related-schemes li a {
    font-size: 0.9rem;
    color: var(--secondary-color, #3498db);
    text-decoration: none;
    font-weight: 500;
}

.related-schemes li a:hover {
    text-decoration: underline;
}

/* ================================================== */
/* SCHEME FINDER STYLES                     */
/* ================================================== */
.scheme-finder-section {
    padding: 60px 20px;
    background-color: var(--background-color, #f0f4f2);
}

.scheme-controls {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 20px;
    margin-bottom: 40px;
    background: #fff;
    padding: 20px;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.scheme-controls input[type="text"],
.scheme-controls select {
    width: 100%;
    padding: 12px;
    font-size: 1rem;
    border: 1px solid var(--border-color, #e0e0e0);
    border-radius: 8px;
    font-family: var(--font-family, 'Poppins', sans-serif);
}

@media (max-width: 768px) {
    .scheme-controls {
        grid-template-columns: 1fr;
    }
}

.scheme-results-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 25px;
}

.scheme-card {
    background: var(--card-bg, white);
    border-radius: 12px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    padding: 30px;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
}

.scheme-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.scheme-card-header {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.scheme-card-header h3 {
    font-size: 1.5rem;
    color: var(--primary-dark, #27ae60);
    margin-bottom: 5px;
    flex: 1;
}

.scheme-card-header h4 {
    font-size: 1.1rem;
    color: #555;
    font-weight: 400;
}

.scheme-tags {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.scheme-tag {
    font-size: 0.85rem;
    font-weight: 600;
    padding: 5px 12px;
    border-radius: 20px;
    background-color: #eaf8f2;
    color: var(--primary-dark);
}

.scheme-tag.state-tag {
    background-color: #eaf3f9;
    color: var(--secondary-color, #3498db);
}

.scheme-card-body h5 {
    font-size: 1.1rem;
    color: var(--text-color, #333);
    margin-bottom: 10px;
}

.scheme-card-body p,
.scheme-card-body ul {
    font-size: 0.95rem;
    color: #555;
    line-height: 1.6;
    margin-bottom: 20px;
}

.scheme-card-body ul {
    padding-left: 20px;
}

.scheme-links {
    margin-top: auto;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    padding-top: 20px;
    border-top: 1px solid #f0f0f0;
}

/* ================================================== */
/* BILINGUAL SCHEME STYLES                */
/* ================================================== */
.scheme-card-header h4.marathi-title {
    font-size: 1.1rem;
    color: #555;
    font-weight: 400;
    margin-top: 5px;
}

.marathi-text {
    color: #444;
    font-size: 0.95rem;
    margin-top: -10px;
    margin-bottom: 20px;
    padding: 10px;
    background-color: #f9f9f9;
    border-left: 3px solid var(--primary-color-light, #eaf8f2);
    border-radius: 0 4px 4px 0;
}

.scheme-card-body .marathi-text ul {
    margin-bottom: 0;
    padding-left: 20px;
}

/* ================================================== */
/* NGO DIRECTORY STYLES (NEW UPGRADED DESIGN) */
/* ================================================== */
.ngo-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
}

.ngo-card {
    background: var(--card-bg, white);
    border-radius: 12px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.ngo-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 12px 30px rgba(46, 204, 113, 0.15);
    border-color: rgba(46, 204, 113, 0.3);
    z-index: 2;
}

.ngo-card-header {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 25px;
    transition: all 0.3s ease;
}

.ngo-modern-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.search-wrapper,
.filter-wrapper {
    position: relative;
    width: 100%;
}

.search-wrapper i,
.filter-wrapper i {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: #64748b;
    font-size: 1.1rem;
    z-index: 2;
    pointer-events: none;
}

.search-wrapper input,
.filter-wrapper select {
    width: 100%;
    padding: 16px 16px 16px 45px !important;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    font-size: 1rem;
    color: #334155;
    outline: none;
    transition: all 0.3s ease;
    appearance: none;
    -webkit-appearance: none;
    position: relative;
    cursor: pointer;
}

.search-wrapper input {
    cursor: text;
}

.search-wrapper input:focus,
.filter-wrapper select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(46, 204, 113, 0.15);
    background: white;
}

@media (max-width: 600px) {
    .ngo-modern-controls {
        grid-template-columns: 1fr;
    }
}

.ngo-avatar {
    width: 60px;
    height: 60px;
    flex-shrink: 0;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.8rem;
    font-weight: 700;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.ngo-card-header h3 {
    font-size: 1.35rem;
    color: var(--text-color, #333);
    line-height: 1.4;
    font-weight: 700;
    flex: 1;
}

.ngo-card-body {
    padding: 0 25px 25px 25px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    justify-content: space-between;
}

.ngo-card-body p {
    font-size: 0.95rem;
    color: #555;
    line-height: 1.6;
    margin-bottom: 20px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 4.8em;
}

.ngo-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 25px;
    min-height: 30px;
}

.ngo-tag {
    font-size: 0.8rem;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 8px;
    background-color: #eaf3f9;
    color: var(--secondary-color, #3498db);
    text-transform: capitalize;
}

.ngo-tag:nth-child(2n) {
    background-color: #eaf8f2;
    color: var(--primary-dark, #27ae60);
}

.ngo-tag:nth-child(3n) {
    background-color: #fef5e7;
    color: #f39c12;
}

.ngo-card-body .btn {
    margin-top: auto;
    width: 100%;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* ========================================================= */
/* GOVERNMENT SCHEME FINDER — PREMIUM UI (COMPLETE OVERHAUL) */
/* ========================================================= */

/* ── Section Background (Floated as a container instead of edge-to-edge) ── */
.schemes-section-bg {
    background: transparent !important;
}

.schemes-section-bg .container {
    background: white;
    border-radius: 16px;
    padding: 35px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    border: 1px solid #e2e8f0;
    margin-top: 0px;
    margin-bottom: 60px;
}

/* ── Hero Header ── */
.schemes-hero-header {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 50%, #3b82f6 100%);
    border-radius: 20px;
    padding: 36px 40px;
    margin-bottom: 32px;
    overflow: hidden;
    box-shadow: 0 12px 40px rgba(37, 99, 235, 0.35);
}

.schemes-hero-bg-icon {
    position: absolute;
    right: -20px;
    top: -20px;
    font-size: 10rem;
    color: rgba(255, 255, 255, 0.06);
    pointer-events: none;
    line-height: 1;
}

.schemes-hero-content {
    flex: 1;
    z-index: 1;
}

.schemes-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.9);
    text-transform: uppercase;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    padding: 5px 14px;
    border-radius: 20px;
    margin-bottom: 12px;
    backdrop-filter: blur(6px);
}

.schemes-hero-title {
    font-size: 2.2rem;
    font-weight: 800;
    color: #ffffff !important;
    margin: 0 0 10px 0;
    line-height: 1.2;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.schemes-hero-subtitle {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.8);
    margin: 0;
    font-weight: 400;
    line-height: 1.5;
    max-width: 480px;
}

.schemes-hero-lang {
    z-index: 1;
    flex-shrink: 0;
}

/* ── Language Toggle (Hero style) ── */
.scheme-lang-selector {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    border: 1.5px solid rgba(255, 255, 255, 0.35);
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    outline: none;
    backdrop-filter: blur(8px);
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    -webkit-appearance: none;
    appearance: none;
}

.scheme-lang-selector:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.05);
}

/* ── Filter Bar ── */
.schemes-filter-bar {
    display: flex;
    gap: 16px;
    align-items: stretch;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.scheme-search-pill {
    flex: 1;
    min-width: 260px;
    position: relative;
    display: flex;
    align-items: center;
    background: #ffffff;
    border-radius: 14px;
    border: 1.5px solid #e2e8f0;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
}

.scheme-search-pill:focus-within {
    border-color: #3b82f6;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.12), 0 4px 16px rgba(0, 0, 0, 0.06);
}

.scheme-search-pill i {
    position: absolute;
    left: 18px;
    color: #94a3b8;
    font-size: 1rem;
    pointer-events: none;
}

.scheme-search-pill input {
    width: 100%;
    padding: 16px 18px 16px 48px !important;
    background: transparent;
    border: none;
    outline: none;
    font-size: 1rem;
    color: #1e293b;
    font-family: var(--font-family);
}

.scheme-search-pill input::placeholder {
    color: #94a3b8;
}

.scheme-select-group {
    display: flex;
    gap: 12px;
    flex-shrink: 0;
    flex-wrap: wrap;
}

.scheme-select-pill {
    position: relative;
    display: flex;
    align-items: center;
    background: #ffffff;
    border-radius: 14px;
    border: 1.5px solid #e2e8f0;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
    min-width: 180px;
}

.scheme-select-pill:focus-within {
    border-color: #3b82f6;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.12);
}

.scheme-select-pill i {
    position: absolute;
    left: 16px;
    color: #94a3b8;
    font-size: 0.95rem;
    pointer-events: none;
    z-index: 1;
}

.scheme-select-pill select {
    width: 100%;
    padding: 16px 16px 16px 44px !important;
    background: transparent;
    border: none;
    outline: none;
    font-size: 0.95rem;
    color: #1e293b;
    cursor: pointer;
    font-family: var(--font-family);
    -webkit-appearance: none;
    appearance: none;
}

/* ── Results Grid (Masonry-like equal rows via subgrid) ── */
.scheme-results-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-top: 4px;
    align-items: start;
}

@media (max-width: 1100px) {
    .scheme-results-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 680px) {
    .scheme-results-grid {
        grid-template-columns: 1fr;
    }
}

/* ── Premium Card Base ── */
.scheme-card.premium-card {
    background: #ffffff;
    border-radius: 18px;
    border: 1px solid #e8edf5;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    animation: cardFadeIn 0.4s ease both;
}

@keyframes cardFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.scheme-card.premium-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 48px rgba(37, 99, 235, 0.13);
    border-color: rgba(59, 130, 246, 0.35);
}

/* ── Card Header ── */
.scheme-card-header.premium-header {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 22px 22px 20px;
    background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    min-height: 90px;
    /* ensure consistent header height */
}

.scheme-header-icon {
    width: 46px;
    height: 46px;
    min-width: 46px;
    background: rgba(255, 255, 255, 0.18);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    flex-shrink: 0;
    margin-top: 2px;
}

.premium-header h3 {
    font-size: 1.08rem;
    margin: 0;
    font-weight: 700;
    line-height: 1.35;
    color: #ffffff !important;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

/* ── Tags Row ── */
.scheme-tags.premium-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    padding: 14px 18px 0;
}

.scheme-tag {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 5px 12px;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    text-transform: capitalize;
    line-height: 1.2;
    letter-spacing: 0.2px;
}

.scheme-tag.cat-tag {
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
}

.scheme-tag.state-tag {
    background: #fffbeb;
    color: #92400e;
    border: 1px solid #fde68a;
}

/* ── Card Body ── */
.scheme-card-body.premium-body {
    padding: 16px 18px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* Description (clamped 3 lines) */
.scheme-desc {
    color: #64748b;
    font-size: 0.88rem;
    line-height: 1.6;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-clamp: 3;
}

/* Section titles  */
.scheme-section h5 {
    font-size: 0.9rem;
    color: #1e293b;
    margin: 0 0 10px 0;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 7px;
}

/* List boxes — solid with colored left accent */
.scheme-list-box {
    background: #f8fafc;
    border-radius: 8px;
    padding: 12px 14px;
    border: 1px solid #e2e8f0;
    border-left: 3px solid #3b82f6;
}

.scheme-list-box.elig-box {
    border-left-color: #10b981;
}

.scheme-list-box ul {
    margin: 0;
    padding-left: 18px;
}

.scheme-list-box li {
    font-size: 0.85rem;
    color: #475569;
    line-height: 1.5;
    margin-bottom: 5px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-clamp: 3;
}

.scheme-list-box li:last-child {
    margin-bottom: 0;
}

/* ── Meta Info Row ── */
.scheme-meta-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #f0f4ff;
    border: 1px solid #e0e7ff;
    padding: 13px 14px;
    border-radius: 10px;
    margin-top: auto;
}

.meta-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.meta-label {
    font-size: 0.68rem;
    color: #6366f1;
    text-transform: uppercase;
    font-weight: 800;
    letter-spacing: 0.8px;
}

.meta-value {
    font-size: 0.85rem;
    color: #1e293b;
    font-weight: 500;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-clamp: 2;
}

.meta-value[style] {
    -webkit-line-clamp: unset;
    line-clamp: unset;
    overflow: visible;
}

/* Allow inline-colored deadline to show */

/* ── Card Footer (Buttons) ── */
.scheme-links.premium-footer {
    padding: 16px 18px;
    display: flex;
    gap: 10px;
    background: #fafbff;
    border-top: 1px solid #e8edf5;
}

.scheme-links.premium-footer .btn {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 7px;
    padding: 11px 14px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.88rem;
    transition: all 0.25s ease;
    white-space: nowrap;
}

.scheme-apply-btn {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #fff;
    border: none;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.3);
}

.scheme-apply-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.4);
    background: linear-gradient(135deg, #1d4ed8, #1e40af);
}

.scheme-vid-btn {
    background: #fff;
    color: #dc2626;
    border: 1.5px solid #fecaca;
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.1);
}

.scheme-vid-btn:hover {
    background: #fff5f5;
    border-color: #fca5a5;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(220, 38, 38, 0.2);
}

/* ── Loading State ── */
#scheme-loading-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: #94a3b8;
    text-align: center;
    grid-column: 1 / -1;
    min-height: 280px;
    gap: 14px;
}

/* ── Responsive Tweaks ── */
@media (max-width: 768px) {
    .schemes-hero-header {
        flex-direction: column;
        align-items: flex-start;
        padding: 28px 24px;
    }

    .schemes-hero-title {
        font-size: 1.7rem;
    }

    .schemes-filter-bar {
        flex-direction: column;
    }

    .scheme-select-group {
        width: 100%;
    }

    .scheme-select-pill {
        flex: 1;
    }

    .scheme-links.premium-footer {
        flex-direction: column;
    }
}

/* ========================================================= */
/* DIRECT FARMER AID (P2P) — PREMIUM UI                     */
/* ========================================================= */

/* ── Section Background (Floated as a container) ── */
.p2p-section-bg {
    background: transparent !important;
}

.p2p-section-bg .container {
    background: white;
    border-radius: 16px;
    padding: 35px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    border: 1px solid #e2e8f0;
    margin-top: 0px;
    margin-bottom: 60px;
}

/* ── Hero Header ── */
.p2p-hero-header {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    background: linear-gradient(135deg, #064e3b 0%, #059669 50%, #10b981 100%);
    border-radius: 20px;
    padding: 40px 44px;
    margin-bottom: 28px;
    overflow: hidden;
    box-shadow: 0 12px 40px rgba(5, 150, 105, 0.3);
}

.p2p-hero-bg-icon {
    position: absolute;
    right: -15px;
    top: -25px;
    font-size: 10rem;
    color: rgba(255, 255, 255, 0.06);
    pointer-events: none;
    line-height: 1;
}

.p2p-hero-content {
    flex: 1;
    z-index: 1;
}

.p2p-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.9);
    text-transform: uppercase;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    padding: 5px 14px;
    border-radius: 20px;
    margin-bottom: 12px;
    backdrop-filter: blur(6px);
}

.p2p-hero-title {
    font-size: 2.2rem;
    font-weight: 800;
    color: #ffffff !important;
    margin: 0 0 10px 0;
    line-height: 1.2;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.p2p-hero-subtitle {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.85);
    margin: 0;
    font-weight: 400;
    line-height: 1.6;
    max-width: 560px;
}

/* ── Trust / Flow Bar ── */
.p2p-trust-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    background: #ffffff;
    border-radius: 16px;
    padding: 22px 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    border: 1px solid #e8f5e9;
    margin-bottom: 36px;
    flex-wrap: wrap;
}

.p2p-trust-step {
    display: flex;
    align-items: center;
    gap: 12px;
}

.p2p-trust-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: #fff;
    flex-shrink: 0;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.p2p-trust-step span {
    font-size: 0.92rem;
    font-weight: 600;
    color: #1e293b;
    white-space: nowrap;
}

.p2p-trust-arrow {
    color: #cbd5e1;
    font-size: 0.9rem;
}

/* ── Role Selection Grid ── */
.p2p-role-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
}

/* ── Role Card Base ── */
.p2p-role-card {
    background: #ffffff;
    border-radius: 20px;
    border: 1.5px solid #e8edf5;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    overflow: hidden;
    transition: all 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);
    cursor: pointer;
    position: relative;
}

.p2p-role-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.1);
}

.p2p-donor-card:hover {
    border-color: #34d399;
}

.p2p-farmer-card:hover {
    border-color: #fbbf24;
}

.p2p-admin-card:hover {
    border-color: #818cf8;
}

/* ── Role Icon Wrapper ── */
.p2p-role-icon-wrap {
    width: 100%;
    padding: 36px 20px 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3.5rem;
    color: #fff;
    position: relative;
}

.p2p-role-icon-wrap::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 40px;
    background: #ffffff;
    border-radius: 50% 50% 0 0 / 100% 100% 0 0;
}

.p2p-donor-gradient {
    background: linear-gradient(135deg, #059669, #10b981, #34d399);
}

.p2p-farmer-gradient {
    background: linear-gradient(135deg, #d97706, #f59e0b, #fbbf24);
}

.p2p-admin-gradient {
    background: linear-gradient(135deg, #4f46e5, #6366f1, #818cf8);
}

/* ── Role Card Body ── */
.p2p-role-body {
    padding: 10px 28px 32px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    flex-grow: 1;
}

.p2p-role-body h3 {
    font-size: 1.35rem;
    font-weight: 800;
    color: #0f172a;
    margin: 0;
    line-height: 1.3;
}

.p2p-role-desc {
    font-size: 0.9rem;
    color: #64748b;
    line-height: 1.6;
    margin: 0;
    max-width: 280px;
}

/* Feature list */
.p2p-role-features {
    list-style: none;
    padding: 0;
    margin: 8px 0 0 0;
    width: 100%;
    text-align: left;
}

.p2p-role-features li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 0;
    font-size: 0.88rem;
    color: #475569;
    font-weight: 500;
    border-bottom: 1px solid #f1f5f9;
}

.p2p-role-features li:last-child {
    border-bottom: none;
}

.p2p-role-features li i {
    font-size: 0.85rem;
    flex-shrink: 0;
}

.p2p-donor-card .p2p-role-features li i {
    color: #059669;
}

.p2p-farmer-card .p2p-role-features li i {
    color: #d97706;
}

.p2p-admin-card .p2p-role-features li i {
    color: #6366f1;
}

/* ── CTA Buttons ── */
.p2p-role-btn {
    width: 100%;
    padding: 14px 20px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.95rem;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
    margin-top: auto;
    text-transform: none;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
}

.p2p-donor-btn {
    background: linear-gradient(135deg, #059669, #10b981);
    color: #fff;
}

.p2p-donor-btn:hover {
    background: linear-gradient(135deg, #047857, #059669);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(5, 150, 105, 0.35);
}

.p2p-farmer-btn {
    background: linear-gradient(135deg, #d97706, #f59e0b);
    color: #fff;
}

.p2p-farmer-btn:hover {
    background: linear-gradient(135deg, #b45309, #d97706);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(217, 119, 6, 0.35);
}

.p2p-admin-btn {
    background: linear-gradient(135deg, #4f46e5, #6366f1);
    color: #fff;
}

.p2p-admin-btn:hover {
    background: linear-gradient(135deg, #4338ca, #4f46e5);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.35);
}

/* ── Responsive ── */
@media (max-width: 960px) {
    .p2p-role-grid {
        grid-template-columns: 1fr;
        max-width: 420px;
        margin: 0 auto;
    }
}

@media (max-width: 768px) {
    .p2p-hero-header {
        flex-direction: column;
        align-items: flex-start;
        padding: 28px 24px;
    }

    .p2p-hero-title {
        font-size: 1.7rem;
    }

    .p2p-trust-bar {
        flex-direction: column;
        gap: 12px;
        padding: 18px 20px;
    }

    .p2p-trust-arrow {
        transform: rotate(90deg);
    }
}

/* ========================================================= */
/* P2P DONOR PORTAL — GRID, CARDS, MODALS                    */
/* ========================================================= */

/* ── Container Backgrounds for Sub-Views ── */
.p2p-donor-section-bg {
    background: transparent !important;
}

.p2p-donor-section-bg .container {
    background: white;
    border-radius: 16px;
    padding: 35px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    border: 1px solid #e2e8f0;
    margin-bottom: 60px;
}

.p2p-farmer-section-bg {
    background: transparent !important;
}

.p2p-farmer-section-bg .container {
    background: white;
    border-radius: 16px;
    padding: 35px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    border: 1px solid #e2e8f0;
    margin-bottom: 60px;
}

.p2p-admin-section-bg {
    background: transparent !important;
}

.p2p-admin-section-bg .container {
    background: white;
    border-radius: 16px;
    padding: 35px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    border: 1px solid #e2e8f0;
    margin-bottom: 60px;
}

/* ── Donor Grid & Cards ── */
.donor-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 28px;
}

.donor-card {
    background: #fff;
    border-radius: 20px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.04);
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
}

.donor-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.1);
    border-color: #34d399;
}

/* Discovery Image Wrap */
.donor-img-wrapper {
    height: 200px;
    overflow: hidden;
    position: relative;
}

.donor-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.donor-card:hover .donor-img-wrapper img {
    transform: scale(1.05);
}

/* Badges */
.donor-badge-verified {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(4px);
    color: #059669;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 6px 14px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.donor-badge-partner {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(0, 0, 0, 0.6);
    color: #fbbf24;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 8px;
    backdrop-filter: blur(4px);
}

/* Card Body */
.donor-card-body {
    padding: 24px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.donor-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.donor-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #e2e8f0;
}

.donor-farmer-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
}

.donor-farmer-loc {
    font-size: 0.85rem;
    color: #64748b;
    margin: 0;
}

.donor-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 10px 0;
    line-height: 1.3;
}

.donor-desc {
    font-size: 0.95rem;
    color: #475569;
    margin: 0 0 20px 0;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Progress Bar */
.donor-progress-wrapper {
    margin-top: auto;
    padding: 20px 24px;
    background: #f8fafc;
    border-top: 1px solid #f1f5f9;
}

.donor-stats-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.donor-stats-raised {
    font-size: 1.1rem;
    font-weight: 700;
    color: #059669;
}

.donor-stats-goal {
    font-size: 0.9rem;
    font-weight: 600;
    color: #64748b;
}

.donor-progress-bar-bg {
    height: 10px;
    background: #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 15px;
}

.donor-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #34d399, #059669);
    border-radius: 10px;
    transition: width 1s ease;
}

/* Buttons */
.btn-donate {
    width: 100%;
    background: linear-gradient(135deg, #059669, #10b981);
    color: #fff;
    padding: 12px;
    border-radius: 12px;
    font-weight: 700;
    border: none;
    font-size: 1.05rem;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.2);
}

.btn-donate:hover {
    background: linear-gradient(135deg, #047857, #059669);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(5, 150, 105, 0.35);
}

/* ── Payment Overlay Modal ── */
.payment-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
}

.payment-modal.active {
    display: flex;
}

.payment-content {
    background: #fff;
    width: 90%;
    max-width: 450px;
    border-radius: 24px;
    padding: 35px;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    animation: scaleUp 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.payment-close {
    position: absolute;
    top: 20px;
    right: 24px;
    font-size: 1.6rem;
    color: #94a3b8;
    cursor: pointer;
    transition: color 0.3s;
}

.payment-close:hover {
    color: #f43f5e;
}

.payment-header {
    text-align: center;
    margin-bottom: 25px;
}

.payment-icon {
    width: 64px;
    height: 64px;
    background: #ecfdf5;
    color: #059669;
    font-size: 1.8rem;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
}

.payment-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 5px 0;
}

.payment-subtitle {
    font-size: 0.95rem;
    color: #64748b;
    margin: 0;
    line-height: 1.4;
}

.amt-presets {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.amt-btn {
    padding: 14px 10px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    background: #fff;
    font-weight: 700;
    color: #475569;
    font-size: 1.05rem;
    cursor: pointer;
    transition: all 0.3s;
}

.amt-btn:hover {
    border-color: #34d399;
    color: #059669;
}

.amt-btn.active {
    border-color: #059669;
    background: #ecfdf5;
    color: #059669;
}

.amt-custom {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 1.2rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 24px;
    transition: border 0.3s;
    background: #f8fafc;
}

.amt-custom:focus {
    outline: none;
    border-color: #059669;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(5, 150, 105, 0.1);
}

.btn-pay-now {
    width: 100%;
    background: linear-gradient(135deg, #059669, #10b981);
    color: #fff;
    padding: 16px;
    border-radius: 12px;
    font-size: 1.15rem;
    font-weight: 800;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 8px 20px rgba(5, 150, 105, 0.25);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-pay-now:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 25px rgba(5, 150, 105, 0.35);
}


/* ========================================================= */
/* P2P FARMER REQUEST FORM — PREMIUM UI                      */
/* ========================================================= */

/* ── Step Indicator ── */
.farmer-step-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 36px;
    gap: 0;
    flex-wrap: nowrap;
}

.farmer-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.farmer-step-circle {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #e2e8f0;
    color: #94a3b8;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: 700;
    transition: all 0.4s ease;
    border: 2px solid #e2e8f0;
}

.farmer-step span {
    font-size: 0.8rem;
    font-weight: 600;
    color: #94a3b8;
    transition: color 0.3s;
    white-space: nowrap;
}

.farmer-step.active .farmer-step-circle {
    background: linear-gradient(135deg, #d97706, #fbbf24);
    color: #fff;
    border-color: #d97706;
    box-shadow: 0 4px 14px rgba(217, 119, 6, 0.35);
}

.farmer-step.done .farmer-step-circle {
    background: linear-gradient(135deg, #059669, #34d399);
    color: #fff;
    border-color: #059669;
}

.farmer-step.active span,
.farmer-step.done span {
    color: #1e293b;
    font-weight: 700;
}

.farmer-step-line {
    flex: 1;
    height: 2px;
    background: #e2e8f0;
    min-width: 40px;
    margin: 0 8px;
    margin-bottom: 24px;
    transition: background 0.4s ease;
}

.farmer-step-line.done {
    background: linear-gradient(90deg, #059669, #34d399);
}

/* ── Section Title ── */
.farmer-section-title {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 28px;
}

.farmer-section-title h3 {
    font-size: 1.3rem;
    font-weight: 800;
    color: #0f172a;
    margin: 0;
}

.farmer-section-title p {
    font-size: 0.9rem;
    color: #64748b;
    margin: 4px 0 0 0;
}

.farmer-section-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.3rem;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.15);
}

/* ── Form Grid ── */
.farmer-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.farmer-form-grid--full {
    grid-template-columns: 1fr 1fr;
}

.farmer-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.farmer-field--full {
    grid-column: 1 / -1;
}

.farmer-field label {
    font-size: 0.88rem;
    font-weight: 600;
    color: #374151;
    display: flex;
    align-items: center;
    gap: 7px;
}

.farmer-field label i {
    color: #d97706;
    width: 14px;
}

.farmer-field input,
.farmer-field select,
.farmer-field textarea {
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    padding: 13px 16px;
    font-size: 0.95rem;
    color: #1e293b;
    background: #fafafa;
    transition: all 0.3s;
    outline: none;
    font-family: inherit;
}

.farmer-field input:focus,
.farmer-field select:focus,
.farmer-field textarea:focus {
    border-color: #d97706;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(217, 119, 6, 0.1);
}

.farmer-field input.error-field,
.farmer-field select.error-field,
.farmer-field textarea.error-field {
    border-color: #f43f5e;
}

.farmer-field textarea {
    resize: vertical;
    min-height: 130px;
}

.field-error {
    color: #f43f5e;
    font-size: 0.82rem;
    font-weight: 600;
    min-height: 18px;
}

.char-counter {
    font-size: 0.8rem;
    color: #94a3b8;
    text-align: right;
    margin-top: 4px;
}

/* ── Nav Buttons ── */
.farmer-nav-btns {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    padding-top: 24px;
    border-top: 1px solid #f1f5f9;
}

.farmer-btn-next {
    background: linear-gradient(135deg, #d97706, #fbbf24);
    color: #fff;
    padding: 13px 28px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1rem;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s;
    box-shadow: 0 4px 14px rgba(217, 119, 6, 0.3);
}

.farmer-btn-next:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(217, 119, 6, 0.4);
}

.farmer-btn-back {
    background: #f1f5f9;
    color: #475569;
    padding: 13px 24px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
}

.farmer-btn-back:hover {
    background: #e2e8f0;
}

.farmer-btn-submit {
    background: linear-gradient(135deg, #059669, #10b981);
    color: #fff;
    padding: 14px 32px;
    border-radius: 12px;
    font-weight: 800;
    font-size: 1.05rem;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s;
    box-shadow: 0 4px 16px rgba(5, 150, 105, 0.3);
}

.farmer-btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(5, 150, 105, 0.4);
}

/* ── Upload Zones ── */
.upload-section {
    margin-top: 0;
}

.upload-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 1rem;
    color: #1e293b;
    margin-bottom: 6px;
}

.upload-label i {
    color: #d97706;
    font-size: 1.1rem;
}

.upload-hint {
    font-size: 0.85rem;
    color: #64748b;
    margin: 0 0 14px 0;
}

.upload-badge {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
    background: #fef9c3;
    color: #a16207;
    border: 1px solid #fde68a;
}

.upload-badge--optional {
    background: #f0fdf4;
    color: #059669;
    border-color: #bbf7d0;
}

.upload-dropzone {
    border: 2px dashed #d1d5db;
    border-radius: 16px;
    background: #fafafa;
    transition: all 0.3s;
    overflow: hidden;
}

.upload-dropzone.dragover {
    border-color: #d97706;
    background: #fffbeb;
    box-shadow: 0 0 0 4px rgba(217, 119, 6, 0.15);
}

.upload-dropzone-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 36px 20px;
    gap: 8px;
    text-align: center;
    color: #94a3b8;
}

.upload-dropzone-inner i {
    font-size: 2.5rem;
    margin-bottom: 8px;
}

.upload-dropzone-inner p {
    margin: 0;
    font-size: 0.95rem;
    color: #475569;
}

.upload-or {
    font-size: 0.82rem;
    color: #94a3b8;
}

.upload-browse-btn {
    display: inline-block;
    background: linear-gradient(135deg, #d97706, #fbbf24);
    color: #fff;
    padding: 10px 22px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(217, 119, 6, 0.25);
    margin-top: 6px;
}

.upload-browse-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(217, 119, 6, 0.35);
}

.upload-browse-btn--secondary {
    background: linear-gradient(135deg, #475569, #64748b);
    box-shadow: 0 4px 12px rgba(71, 85, 105, 0.2);
}

.upload-browse-btn--secondary:hover {
    box-shadow: 0 6px 16px rgba(71, 85, 105, 0.3);
}

/* Preview thumbnails */
.upload-preview-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 0 16px 16px;
}

.upload-thumb {
    width: 90px;
    height: 90px;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    border: 2px solid #e2e8f0;
    flex-shrink: 0;
}

.upload-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.upload-thumb-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    background: rgba(244, 63, 94, 0.9);
    border: none;
    color: #fff;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    font-size: 0.75rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.upload-thumb-remove:hover {
    background: #e11d48;
}

.upload-pdf-thumb {
    width: 90px;
    height: 90px;
    border-radius: 10px;
    background: #eef2ff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    border: 2px solid #c7d2fe;
    color: #4f46e5;
    font-size: 0.75rem;
    font-weight: 600;
    position: relative;
    padding: 6px;
    text-align: center;
}

.upload-pdf-thumb i {
    font-size: 1.8rem;
}

/* ── Declaration ── */
.farmer-declaration {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: #fefce8;
    border: 1px solid #fde68a;
    border-radius: 12px;
    padding: 18px;
    margin-top: 28px;
    margin-bottom: 6px;
}

.farmer-declaration input[type="checkbox"] {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    margin-top: 3px;
    accent-color: #d97706;
}

.farmer-declaration label {
    font-size: 0.88rem;
    color: #78350f;
    line-height: 1.5;
    cursor: pointer;
}

/* ── Success State ── */
.farmer-success-state {
    text-align: center;
    padding: 60px 40px;
    animation: fadeIn 0.5s ease;
}

.farmer-success-icon {
    font-size: 5rem;
    color: #059669;
    margin-bottom: 20px;
    animation: successPop 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.farmer-success-state h2 {
    font-size: 2rem;
    color: #0f172a;
    font-weight: 800;
    margin-bottom: 14px;
}

.farmer-success-state p {
    font-size: 1rem;
    color: #475569;
    max-width: 480px;
    margin: 0 auto 24px;
    line-height: 1.6;
}

.farmer-ref-box {
    display: inline-block;
    background: #f0fdf4;
    border: 1.5px solid #bbf7d0;
    border-radius: 12px;
    padding: 14px 28px;
    font-size: 1rem;
    color: #064e3b;
}

.farmer-ref-box strong {
    color: #059669;
    font-size: 1.1rem;
    letter-spacing: 0.5px;
}

@keyframes successPop {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }

    80% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* ── Responsive ── */
@media (max-width: 768px) {

    .farmer-form-grid,
    .farmer-form-grid--full {
        grid-template-columns: 1fr;
    }

    .farmer-step-indicator {
        gap: 0;
    }

    .farmer-step span {
        display: none;
    }

    .farmer-step-line {
        min-width: 24px;
    }
}


/* ========================================================= */
/* P2P ADMIN DASHBOARD — PREMIUM UI                          */
/* ========================================================= */

/* ── Stats Row ── */
.admin-stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 28px;
}

.admin-stat-card {
    background: #fff;
    border-radius: 16px;
    padding: 20px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    border: 1px solid #f1f5f9;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s, box-shadow 0.2s;
}

.admin-stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

.admin-stat-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}

.admin-stat-num {
    font-size: 2rem;
    font-weight: 800;
    color: #0f172a;
    margin: 0;
    line-height: 1;
}

.admin-stat-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: #64748b;
    margin: 4px 0 0 0;
}

/* ── Filter Tabs ── */
.admin-tab-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.admin-tab {
    padding: 10px 22px;
    border-radius: 30px;
    border: 1.5px solid #e2e8f0;
    background: #fff;
    color: #64748b;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s;
}

.admin-tab:hover {
    border-color: #818cf8;
    color: #4f46e5;
}

.admin-tab.active {
    background: linear-gradient(135deg, #4f46e5, #818cf8);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.3);
}

/* ── Table ── */
.admin-table-wrapper {
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table thead {
    background: linear-gradient(135deg, #4f46e5, #6366f1);
}

.admin-table thead th {
    color: #fff;
    padding: 16px 18px;
    font-size: 0.85rem;
    font-weight: 700;
    text-align: left;
    white-space: nowrap;
}

.admin-table tbody tr {
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.2s;
}

.admin-table tbody tr:last-child {
    border-bottom: none;
}

.admin-table tbody tr:hover {
    background: #f8fafc;
}

.admin-table td {
    padding: 16px 18px;
    font-size: 0.9rem;
    color: #374151;
    vertical-align: middle;
}

/* Farmer cell */
.admin-td-farmer {
    display: flex;
    align-items: center;
    gap: 10px;
}

.admin-td-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #e2e8f0;
    flex-shrink: 0;
}

.admin-td-name {
    font-weight: 700;
    color: #0f172a;
    margin: 0;
    font-size: 0.92rem;
}

.admin-td-loc {
    font-size: 0.78rem;
    color: #64748b;
    margin: 0;
}

/* Status Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
}

.status-pending {
    background: #fefce8;
    color: #a16207;
    border: 1px solid #fde68a;
}

.status-approved {
    background: #f0fdf4;
    color: #059669;
    border: 1px solid #bbf7d0;
}

.status-rejected {
    background: #fff1f2;
    color: #e11d48;
    border: 1px solid #fecdd3;
}

/* Action Buttons */
.btn-review {
    background: linear-gradient(135deg, #4f46e5, #6366f1);
    color: #fff;
    padding: 8px 16px;
    border-radius: 8px;
    border: none;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-review:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.35);
}

/* Approve/Reject in modal */
.btn-approve {
    background: linear-gradient(135deg, #059669, #10b981);
    color: #fff;
    padding: 14px 28px;
    border-radius: 12px;
    border: none;
    font-weight: 800;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
    box-shadow: 0 4px 14px rgba(5, 150, 105, 0.3);
}

.btn-approve:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(5, 150, 105, 0.4);
}

.btn-reject {
    background: #fff;
    color: #e11d48;
    border: 2px solid #fecdd3;
    padding: 14px 28px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
}

.btn-reject:hover {
    background: #fff1f2;
    border-color: #e11d48;
}

.btn-view-only {
    background: #f1f5f9;
    color: #64748b;
    border: none;
    padding: 14px 28px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    cursor: default;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Reject Reason textarea area */
.reject-reason-area {
    display: none;
    width: 100%;
    margin-top: 8px;
}

.reject-reason-area textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid #fecdd3;
    border-radius: 10px;
    font-size: 0.9rem;
    resize: none;
    outline: none;
    font-family: inherit;
    color: #374151;
    transition: border 0.3s;
}

.reject-reason-area textarea:focus {
    border-color: #e11d48;
    box-shadow: 0 0 0 3px rgba(225, 29, 72, 0.1);
}

.btn-confirm-reject {
    margin-top: 8px;
    background: #e11d48;
    color: #fff;
    border: none;
    padding: 10px 22px;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.2s;
}

.btn-confirm-reject:hover {
    background: #be123c;
}

/* ── Admin Detail Modal ── */
.admin-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.65);
    z-index: 1050;
    display: none;
    align-items: flex-start;
    justify-content: center;
    backdrop-filter: blur(6px);
    padding: 40px 20px;
    overflow-y: auto;
}

.admin-modal.active {
    display: flex;
}

.admin-modal-content {
    background: #fff;
    width: 100%;
    max-width: 680px;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.25);
    animation: scaleUp 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    margin: auto;
}

.admin-modal-header {
    background: linear-gradient(135deg, #312e81, #4f46e5);
    padding: 22px 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-modal-header h3 {
    color: #fff;
    margin: 0;
    font-size: 1.2rem;
    font-weight: 800;
}

.admin-modal-close {
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.8rem;
    cursor: pointer;
    transition: color 0.2s;
    line-height: 1;
}

.admin-modal-close:hover {
    color: #fff;
}

.admin-modal-body {
    padding: 28px;
    overflow-y: auto;
    max-height: 60vh;
}

.admin-modal-footer {
    padding: 20px 28px;
    background: #f8fafc;
    border-top: 1px solid #f1f5f9;
    display: flex;
    gap: 12px;
    align-items: flex-start;
    flex-wrap: wrap;
}

/* Modal detail rows */
.admin-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
}

.admin-detail-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.admin-detail-item label {
    font-size: 0.78rem;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.admin-detail-item span {
    font-size: 0.95rem;
    font-weight: 600;
    color: #1e293b;
}

.admin-story-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px;
    font-size: 0.9rem;
    color: #374151;
    line-height: 1.6;
    margin-bottom: 24px;
}

.admin-proof-label {
    font-size: 0.85rem;
    font-weight: 700;
    color: #475569;
    margin-bottom: 10px;
}

.admin-proof-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 24px;
}

.admin-proof-img {
    width: 120px;
    height: 100px;
    object-fit: cover;
    border-radius: 10px;
    border: 2px solid #e2e8f0;
    cursor: zoom-in;
    transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.admin-proof-img:hover {
    transform: scale(1.06);
    border-color: #6366f1;
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.3);
}

.admin-proof-doc {
    width: 120px;
    height: 100px;
    border-radius: 10px;
    background: #eef2ff;
    border: 2px solid #c7d2fe;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: #4f46e5;
    font-size: 0.8rem;
    font-weight: 600;
}

.admin-proof-doc i {
    font-size: 2rem;
}

/* Empty state */
.admin-empty-state {
    text-align: center;
    padding: 50px 20px;
}

.admin-empty-state i {
    font-size: 3.5rem;
    color: #c7d2fe;
    margin-bottom: 16px;
    display: block;
}

.admin-empty-state p {
    color: #64748b;
    font-size: 1rem;
}

/* ── Responsive ── */
@media (max-width: 900px) {
    .admin-stats-row {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 600px) {
    .admin-stats-row {
        grid-template-columns: 1fr;
    }

    .admin-table td:nth-child(4),
    .admin-table th:nth-child(4),
    .admin-table td:nth-child(5),
    .admin-table th:nth-child(5) {
        display: none;
    }

    .admin-detail-grid {
        grid-template-columns: 1fr;
    }
}


/* ========================================================= */
/* UPGRADED FARMER FORM — NEW COMPONENTS                     */
/* ========================================================= */

/* ── Draft Banner ── */
.draft-restore-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    background: #fffbeb;
    border: 1.5px solid #fde68a;
    border-radius: 12px;
    padding: 14px 20px;
    margin-bottom: 22px;
    font-size: 0.9rem;
    color: #78350f;
}

.draft-restore-banner i {
    color: #d97706;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.draft-restore-banner span {
    flex: 1;
}

.draft-btn-restore {
    background: #d97706;
    color: #fff;
    border: none;
    padding: 8px 18px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.2s;
}

.draft-btn-restore:hover {
    background: #b45309;
}

.draft-btn-clear {
    background: transparent;
    border: 1.5px solid #fde68a;
    color: #a16207;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.draft-btn-clear:hover {
    background: #fef9c3;
}

/* ── GPS Button ── */
.gps-btn {
    margin-left: auto;
    background: linear-gradient(135deg, #0ea5e9, #38bdf8);
    color: #fff;
    border: none;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(14, 165, 233, 0.3);
}

.gps-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.4);
}

.gps-btn.loading i {
    animation: spin 1s linear infinite;
}

.gps-status {
    font-size: 0.82rem;
    color: #0ea5e9;
    font-weight: 600;
    margin-top: 4px;
    display: block;
}

/* ── Aadhaar Input ── */
.aadhar-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.aadhar-input-wrap input {
    flex: 1;
    letter-spacing: 2px;
    font-weight: 600;
    font-size: 1rem;
}

.aadhar-toggle-btn {
    position: absolute;
    right: 12px;
    background: transparent;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    font-size: 1rem;
    padding: 4px;
    transition: color 0.2s;
}

.aadhar-toggle-btn:hover {
    color: #d97706;
}

.aadhar-privacy-note {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    color: #64748b;
    margin-top: 5px;
}

.aadhar-privacy-note i {
    color: #059669;
}

/* ── Voice Controls ── */
.story-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}

.voice-controls-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.voice-lang-select {
    padding: 7px 10px;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 600;
    color: #374151;
    background: #fff;
    cursor: pointer;
    outline: none;
    transition: border 0.2s;
}

.voice-lang-select:focus {
    border-color: #d97706;
}

.voice-mic-btn {
    background: linear-gradient(135deg, #dc2626, #f87171);
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.88rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 7px;
    transition: all 0.2s;
    box-shadow: 0 3px 10px rgba(220, 38, 38, 0.3);
}

.voice-mic-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(220, 38, 38, 0.35);
}

.voice-mic-btn.recording {
    background: linear-gradient(135deg, #991b1b, #dc2626);
    animation: micPulse 1.5s ease-in-out infinite;
}

@keyframes micPulse {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.4);
    }

    50% {
        box-shadow: 0 0 0 10px rgba(220, 38, 38, 0);
    }
}

.voice-status-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 10px;
    padding: 10px 16px;
    margin-bottom: 8px;
    font-size: 0.88rem;
    color: #991b1b;
}

.voice-pulse {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #dc2626;
    animation: micPulse 1s infinite;
    flex-shrink: 0;
}

.voice-stop-btn {
    margin-left: auto;
    background: #dc2626;
    color: #fff;
    border: none;
    padding: 6px 14px;
    border-radius: 7px;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: background 0.2s;
}

.voice-stop-btn:hover {
    background: #991b1b;
}

/* ── Upload Counter Badge ── */
.upload-counter {
    margin-left: auto;
    font-size: 0.82rem;
    font-weight: 700;
    background: #f1f5f9;
    color: #64748b;
    padding: 3px 10px;
    border-radius: 20px;
    border: 1px solid #e2e8f0;
    transition: all 0.3s;
}

.upload-counter.ready {
    background: #f0fdf4;
    color: #059669;
    border-color: #bbf7d0;
}

/* ── Scheme Suggestions (Step 3) ── */
.scheme-suggest-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
}

.scheme-suggest-card {
    background: #fff;
    border: 1.5px solid #e0e7ff;
    border-radius: 16px;
    padding: 20px;
    transition: all 0.3s;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.06);
}

.scheme-suggest-card:hover {
    border-color: #818cf8;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(79, 70, 229, 0.12);
}

.scheme-suggest-card-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 10px;
}

.scheme-suggest-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.scheme-suggest-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.3;
}

.scheme-suggest-desc {
    font-size: 0.82rem;
    color: #475569;
    line-height: 1.5;
    margin-bottom: 14px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.scheme-suggest-cta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, #4f46e5, #818cf8);
    color: #fff;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.2s;
}

.scheme-suggest-cta:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.scheme-suggest-empty {
    grid-column: 1/-1;
    text-align: center;
    padding: 32px;
    color: #64748b;
    background: #f8fafc;
    border-radius: 12px;
    border: 1.5px dashed #e2e8f0;
}

.scheme-suggest-empty i {
    font-size: 2.5rem;
    color: #c7d2fe;
    margin-bottom: 10px;
    display: block;
}

.scheme-suggest-divider {
    display: flex;
    align-items: center;
    gap: 16px;
    color: #94a3b8;
    font-size: 0.85rem;
    font-weight: 600;
    margin: 8px 0 24px;
}

.scheme-suggest-divider::before,
.scheme-suggest-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e2e8f0;
}

/* Scheme suggestion modal (opens scheme details inline) */
.scheme-suggest-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1100;
    display: none;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    padding: 20px;
}

.scheme-suggest-modal.active {
    display: flex;
}

.scheme-suggest-modal-inner {
    background: #fff;
    border-radius: 20px;
    max-width: 640px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    padding: 28px;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    animation: scaleUp 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.scheme-suggest-modal-close {
    position: absolute;
    top: 18px;
    right: 22px;
    font-size: 1.8rem;
    color: #94a3b8;
    cursor: pointer;
    transition: color 0.2s;
    line-height: 1;
}

.scheme-suggest-modal-close:hover {
    color: #e11d48;
}

/* ── WhatsApp Confirmation Block ── */
.whatsapp-confirmation {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    background: #f0fdf4;
    border: 1.5px solid #bbf7d0;
    border-radius: 16px;
    padding: 20px 24px;
    margin: 24px auto 0;
    max-width: 480px;
    text-align: left;
}

.wa-icon {
    font-size: 2.8rem;
    color: #25D366;
    flex-shrink: 0;
    line-height: 1;
}

.wa-title {
    font-size: 1rem;
    font-weight: 800;
    color: #064e3b;
    margin: 0 0 4px;
}

.wa-desc {
    font-size: 0.85rem;
    color: #047857;
    margin: 0 0 14px;
    line-height: 1.5;
}

.wa-send-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #25D366;
    color: #fff;
    padding: 11px 22px;
    border-radius: 10px;
    font-weight: 800;
    font-size: 0.9rem;
    text-decoration: none;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
}

.wa-send-btn:hover {
    background: #128C7E;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(37, 211, 102, 0.4);
}

/* ── Admin Auth Gate ── */
.admin-auth-gate {
    position: fixed;
    inset: 0;
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 50%, #1e1b4b 100%);
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.admin-auth-box {
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 28px;
    padding: 48px 40px;
    max-width: 440px;
    width: 100%;
    text-align: center;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.4);
    animation: scaleUp 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.admin-auth-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4f46e5, #818cf8);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: #fff;
    margin: 0 auto 20px;
    box-shadow: 0 8px 24px rgba(79, 70, 229, 0.5);
}

.admin-auth-title {
    font-size: 1.6rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 10px;
}

.admin-auth-subtitle {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.65);
    line-height: 1.6;
    margin-bottom: 28px;
}

.admin-auth-field {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.1);
    border: 1.5px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 0 14px;
    margin-bottom: 12px;
    transition: border 0.3s;
}

.admin-auth-field:focus-within {
    border-color: #818cf8;
    box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.2);
}

.admin-auth-field>i {
    color: rgba(255, 255, 255, 0.5);
    font-size: 1rem;
    flex-shrink: 0;
}

.admin-auth-field input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    padding: 16px 0;
    color: #fff;
    font-size: 1rem;
    letter-spacing: 2px;
}

.admin-auth-field input::placeholder {
    color: rgba(255, 255, 255, 0.35);
    letter-spacing: 0;
}

.admin-auth-field button {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    font-size: 0.95rem;
    padding: 4px;
    transition: color 0.2s;
}

.admin-auth-field button:hover {
    color: #fff;
}

.admin-auth-attempts {
    min-height: 22px;
    font-size: 0.85rem;
    color: #f87171;
    font-weight: 600;
    margin-bottom: 16px;
}

.admin-auth-attempts.lockout {
    color: #fbbf24;
}

.admin-auth-btn {
    width: 100%;
    background: linear-gradient(135deg, #4f46e5, #818cf8);
    color: #fff;
    border: none;
    padding: 16px;
    border-radius: 12px;
    font-size: 1.05rem;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s;
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.4);
    margin-bottom: 20px;
}

.admin-auth-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(79, 70, 229, 0.5);
}

.admin-auth-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.admin-auth-btn.shake {
    animation: shake 0.4s ease;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    20%,
    60% {
        transform: translateX(-8px);
    }

    40%,
    80% {
        transform: translateX(8px);
    }
}

.admin-auth-back a {
    color: rgba(255, 255, 255, 0.5);
    text-decoration: none;
    font-size: 0.88rem;
    transition: color 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.admin-auth-back a:hover {
    color: #fff;
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .scheme-suggest-grid {
        grid-template-columns: 1fr;
    }

    .story-label-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .voice-controls-row {
        width: 100%;
    }

    .whatsapp-confirmation {
        flex-direction: column;
    }

    .admin-auth-box {
        padding: 36px 24px;
    }
}


/* ================================================== */
.dashboard-header {
    background-color: var(--card-bg, white);
    padding: 20px;
    box-shadow: var(--shadow);
    border-bottom: 1px solid var(--border-color);
}

.dashboard-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.dashboard-header h1 {
    color: var(--primary-dark, #27ae60);
    font-size: 1.8rem;
}

/* ================================================== */
/* FULL PAGE LOADER STYLES                      */
/* ================================================== */
.full-page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--background-color, #f0f4f2);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.full-page-loader.active {
    opacity: 1;
    visibility: visible;
}

.loader-spinner {
    border: 8px solid var(--border-color);
    border-top: 8px solid var(--primary-color);
    border-radius: 50%;
    width: 80px;
    height: 80px;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

.full-page-loader p {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-color);
}

.confidence-bar-wrapper {
    margin-top: 10px;
}

.confidence-label {
    font-size: 0.9rem;
    margin-bottom: 4px;
    color: #444;
}

.confidence-bar {
    width: 100%;
    height: 8px;
    background: #e6e6e6;
    border-radius: 20px;
    overflow: hidden;
}

.confidence-fill {
    height: 100%;
    background: linear-gradient(90deg, #2ecc71, #27ae60);
    border-radius: 20px;
    transition: width 1s ease;
}

/* ================================================== */
/* LOCATION STEP STYLES (STARTUP UPGRADE)             */
/* ================================================== */
.location-step-container {
    text-align: center;
    padding: 20px;
    max-width: 500px;
    /* Constrains the width for a clean look */
    margin: 0 auto;
    /* Centers it in the form container */
    animation: fadeIn 0.5s ease-in-out;
}

/* The floating green location pin */
.location-icon-wrapper {
    width: 80px;
    height: 80px;
    background: #eaf8f2;
    color: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    margin: 0 auto 25px auto;
    box-shadow: 0 4px 15px rgba(46, 204, 113, 0.2);
    animation: pulse 2s infinite;
    /* Uses your existing pulse animation */
}

.location-step-container .form-header h1 {
    font-size: 2rem;
    color: #0f172a;
    margin-bottom: 12px;
}

.location-step-container .form-header p {
    font-size: 1rem;
    color: #64748b;
    line-height: 1.6;
    margin-bottom: 35px;
}

.location-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Big primary button with crosshair icon */
.location-btn-primary {
    width: 100%;
    padding: 15px;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

/* Secondary outline button */
.location-btn-secondary {
    width: 100%;
    background: transparent;
    color: #64748b;
    border: 2px solid #cbd5e1;
    padding: 13px;
    font-size: 1rem;
}

.location-btn-secondary:hover {
    background: #f8fafc;
    color: #0f172a;
    border-color: #94a3b8;
    box-shadow: none;
    transform: translateY(-2px);
}

/* Sleek "OR" Divider */
.divider {
    display: flex;
    align-items: center;
    text-align: center;
    color: #94a3b8;
    font-size: 0.9rem;
    font-weight: 600;
    margin: 10px 0;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid #e2e8f0;
}

.divider span {
    padding: 0 15px;
}

/* ================================================== */
/* RESULTS PAGE UPGRADES (STEP 4)                     */
/* ================================================== */

/* Smooth Card Hover Effects */
.result-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02);
    display: flex;
    flex-direction: column;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease;
    position: relative;
}

.result-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.08);
    border-color: #cbd5e1;
}

/* Fix Broken Images & Set Heights */
.result-card img {
    width: 100%;
    height: 180px;
    /* Locked height so all cards align perfectly */
    object-fit: cover;
    border-bottom: 1px solid #e2e8f0;
    background-color: #f8fafc;
}

/* Internal Card Formatting */
.card-content {
    padding: 25px 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.card-content h3 {
    margin-bottom: 15px;
    color: #0f172a;
    font-size: 1.4rem;
    font-weight: 700;
    text-align: center;
}

.agro-zone-tag {
    font-size: 0.9rem;
    color: #475569;
    margin-top: 20px;
    text-align: center;
    background: #f8fafc;
    padding: 10px;
    border-radius: 8px;
    border: 1px dashed #cbd5e1;
}

.agro-zone-tag i {
    color: #3498db;
    margin-right: 5px;
}

/* The Gold Top Match Badge */
.best-match-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: 20px;
    box-shadow: 0 4px 10px rgba(245, 158, 11, 0.3);
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Magical AI Button Transformation */
.gemini-btn {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    /* Sleek Indigo to Purple */
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1.05rem;
    padding: 14px 28px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.gemini-btn:hover {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.4);
}

/* Ensure dropdowns are professional and don't overflow the card */
select#fert-crop-select {
    max-height: 200px;
    overflow-y: auto;
    cursor: pointer;
}

/* Optional: Improve the visual grouping for the fertilizer form */
#fertilizer-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Fix for horizontal radio button groups */
.radio-group,
.season-options {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 10px;
    flex-wrap: wrap;
}

/* Ensure Fertilizer Radio Buttons look like modern pills */
.radio-group input[type="radio"] {
    display: none;
}

.radio-group label {
    padding: 10px 20px;
    background: #fff;
    border: 2px solid var(--border-color);
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    color: #64748b;
}

.radio-group input[type="radio"]:checked+label {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
    box-shadow: 0 4px 10px rgba(46, 204, 113, 0.2);
}

/* 1. Comparison Layout for 'Both' */
#fertilizer-results {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

/* 2. Enhanced Recommendation Cards */
.recommendation-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s ease;
    border-top: 4px solid #e2e8f0;
    /* Default border */
}

/* Dynamic colors based on status */
.recommendation-card.deficient {
    border-top-color: #f59e0b;
    background: #fffcf5;
}

.recommendation-card.sufficient {
    border-top-color: #10b981;
    background: #f0fdf4;
}

/* 3. Search Input Style */
.search-input-wrapper {
    position: relative;
    width: 100%;
}

.search-input-wrapper i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
}

.search-input-wrapper input {
    padding-left: 45px !important;
}

/* --- Custom Search Dropdown Styling --- */
.search-wrapper {
    position: relative;
    width: 100%;
}

.custom-dropdown-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    margin-top: 8px;
    max-height: 250px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    display: none;
    /* Hidden by default */
}

.dropdown-item {
    padding: 12px 20px;
    cursor: pointer;
    font-size: 0.95rem;
    color: #475569;
    transition: all 0.2s ease;
    border-bottom: 1px solid #f1f5f9;
}

.dropdown-item:last-child {
    border-bottom: none;
}

.dropdown-item:hover {
    background-color: #f0fdf4;
    color: var(--primary-dark);
    padding-left: 25px;
    /* Subtle slide effect on hover */
}

/* Styled Scrollbar for the list */
.custom-dropdown-results::-webkit-scrollbar {
    width: 6px;
}

.custom-dropdown-results::-webkit-scrollbar-track {
    background: #f1f5f9;
}

.custom-dropdown-results::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

.custom-dropdown-results::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Position the new dropdown triangle */
.dropdown-toggle-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    cursor: pointer;
    padding: 5px;
    transition: transform 0.3s ease, color 0.2s ease;
    z-index: 10;
}

.dropdown-toggle-icon:hover {
    color: var(--primary-color);
}

/* Rotate icon when list is open */
.dropdown-toggle-icon.open {
    transform: translateY(-50%) rotate(180deg);
}

/* Ensure the input doesn't overlap the icons */
#fert-crop-select {
    padding-left: 40px !important;
    padding-right: 40px !important;
}

/* Update the Input padding */
#fert-crop-select {
    width: 100%;
    padding-left: 15px !important;
    /* Reduced since search icon is gone */
    padding-right: 45px !important;
    /* Keep space for Arrow Icon */
    cursor: text;
}

#fert-crop-select {
    width: 100%;
    padding-left: 15px !important;
    /* Reduced since search icon is gone */
    padding-right: 45px !important;
    /* Keep space for Arrow Icon */
    cursor: text;
}

.dropdown-item:hover {
    background-color: var(--primary-color);
    color: white !important;
    font-weight: 600;
}

/* ================================================== */
/* DISEASE PREDICTION UPGRADES                        */
/* ================================================== */
.upload-area {
    position: relative;
    overflow: hidden;
}

/* Drag & Drop Visual Feedback */
.upload-area.drag-active {
    border-color: var(--primary-color);
    background-color: #eaf8f2;
    transform: scale(1.02);
    box-shadow: inset 0 0 20px rgba(46, 204, 113, 0.1);
}

.upload-area:hover .upload-icon {
    color: var(--primary-color) !important;
    transform: translateY(-5px);
}

/* Premium AI Scanning Animation Over Image */
.scanner-overlay {
    position: absolute;
    top: 15px;
    left: 15px;
    right: 15px;
    height: 4px;
    background: #2ecc71;
    box-shadow: 0 0 15px 4px rgba(46, 204, 113, 0.5);
    animation: scan 2.5s cubic-bezier(0.4, 0, 0.2, 1) infinite;
    z-index: 10;
    border-radius: 2px;
}

@keyframes scan {
    0% {
        top: 15px;
        opacity: 0;
    }

    15% {
        opacity: 1;
    }

    85% {
        opacity: 1;
    }

    100% {
        top: calc(100% - 90px);
        opacity: 0;
    }

    /* Scans down to just above the buttons */
}

/* --- Custom Tooltip for Guest --- */
.guest-tooltip {
    position: relative;
    overflow: visible !important;
}

.guest-tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 12px);
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: rgba(20, 30, 25, 0.95);
    color: #fff;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    /* bouncy appear */
    pointer-events: none;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
    z-index: 1000;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.guest-tooltip::before {
    content: '';
    position: absolute;
    bottom: calc(100% + 4px);
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    border-width: 8px;
    border-style: solid;
    border-color: rgba(20, 30, 25, 0.95) transparent transparent transparent;
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    pointer-events: none;
    z-index: 1000;
}

.guest-tooltip:hover::after,
.guest-tooltip:hover::before {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* ════════════════════════════════════════════════════════════════════════
   HYDROPONICS MODE SELECTION MODAL (homepage gateway)
   ════════════════════════════════════════════════════════════════════════ */

.mode-modal {
    max-width: 520px;
    text-align: center;
    padding: 40px 35px;
    border: 1px solid rgba(46, 204, 113, 0.3);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.5), inset 0 0 20px rgba(46, 204, 113, 0.05);
}

.mode-modal h3 {
    color: #fff;
    font-weight: 700;
    font-size: 1.6rem;
    letter-spacing: 0.5px;
}

.mode-modal h3 i {
    color: var(--primary-color);
}

.mode-options {
    display: flex;
    flex-direction: column;
    gap: 18px;
    margin-top: 25px;
}

.mode-opt {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 24px 22px;
    display: flex;
    align-items: center;
    gap: 22px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    text-align: left;
    position: relative;
    overflow: hidden;
}

.mode-opt::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.05), transparent);
    transition: all 0.5s ease;
}

.mode-opt:hover::after {
    left: 150%;
}

.mode-opt:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(46, 204, 113, 0.5);
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(46, 204, 113, 0.15);
}

#startLiveMode:hover {
    border-color: rgba(230, 126, 34, 0.5);
    box-shadow: 0 10px 30px rgba(230, 126, 34, 0.15);
}

.opt-icon {
    width: 58px;
    height: 58px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    color: #fff;
    flex-shrink: 0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.opt-text b {
    display: block;
    font-size: 1.15rem;
    color: #fff;
    margin-bottom: 6px;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.opt-text p {
    font-size: 0.88rem;
    color: #aaa;
    margin: 0;
    line-height: 1.5;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-15px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#farmerIdInput:focus {
    border-color: #e67e22 !important;
    box-shadow: 0 0 10px rgba(230, 126, 34, 0.2);
}

#connectLiveBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(230, 126, 34, 0.4) !important;
}

/* =====================================================
   ECOAGRIGRID — HYDROPONICS DASHBOARD CSS
   Premium Dark Theme with Per-Sensor Color Accents
   ===================================================== */


:root {
    --bg-base: transparent;
    --bg-surface: rgba(10, 20, 15, 0.45);
    /* Lighter surface for true glass depth */
    --border: rgba(255, 255, 255, 0.2);
    --green-primary: #2ecc71;
    --green-dark: #27ae60;
    --green-glow: rgba(46, 204, 113, 0.5);
    --text-primary: #ffffff;
    --text-secondary: #f1f5f9;
    --text-muted: #94a3b8;
    --font-main: 'Poppins', sans-serif;
    --font-display: 'Poppins', sans-serif;

    /* Sensor card accent colors */
    --color-ph: var(--green-primary);
    --color-ec: var(--green-primary);
    --color-wtemp: var(--green-primary);
    --color-atemp: var(--green-primary);
    --color-humidity: var(--green-primary);
    --color-wlevel: var(--green-primary);
    --color-light: var(--green-primary);
}

/* Hydoponics Background Fix */
#hydroponicsPage {
    background: url('../images/hydro_bg.png') no-repeat center center;
    background-size: cover;
    background-attachment: fixed;
    min-height: 100vh;
}

/* =====================================================
   HEADER
   ===================================================== */
.hydro-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(10, 20, 15, 0.55);
    /* Brighter glass header */
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 40px;
    height: 85px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

.hydro-logo {
    display: flex;
    align-items: center;
    gap: 16px;
    text-decoration: none;
    color: #ffffff;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 22px;
}

.logo-icon {
    font-size: 24px;
}

.header-center {
    text-align: center;
}

.header-title {
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 600;
    color: var(--green-primary);
    letter-spacing: 0.5px;
}

.header-node {
    font-size: 12px;
    color: #cbd5e1;
    margin-top: 2px;
}

.node-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: var(--green-primary);
    border-radius: 50%;
    margin-right: 6px;
    animation: pulse-dot 2s infinite;
    box-shadow: 0 0 6px var(--green-primary);
}

@keyframes pulse-dot {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.4;
    }
}

.agent-status-badge {
    background: rgba(80, 200, 120, 0.15);
    border: 1px solid var(--green-primary);
    color: var(--green-primary);
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.5px;
    transition: all 0.4s ease;
    animation: pulse-agent 4s infinite;
    max-width: 250px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    gap: 6px;
}

@keyframes pulse-agent {

    0%,
    100% {
        box-shadow: 0 0 5px rgba(80, 200, 120, 0.2);
        border-color: rgba(80, 200, 120, 0.5);
    }

    50% {
        box-shadow: 0 0 20px rgba(80, 200, 120, 0.4);
        border-color: var(--green-primary);
    }
}

/* =====================================================
   MAIN LAYOUT
   ===================================================== */
.hydro-main {
    max-width: 1500px;
    margin: 0 auto;
    padding: 25px 20px 40px;
}

.glass-card {
    background: var(--bg-surface);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    border-top: 1px solid rgba(255, 255, 255, 0.4);
    /* Premium lighting effect */
    border-left: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s;
}

.glass-card:hover {
    border-color: rgba(46, 204, 113, 0.5);
    box-shadow: 0 10px 40px rgba(46, 204, 113, 0.2);
    transform: translateY(-2px);
}

/* Mode Strip */
.mode-strip {
    display: flex;
    align-items: center;
    gap: 25px;
    padding: 16px 24px;
    margin-bottom: 22px;
}

.mode-strip-label {
    color: #cbd5e1;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 8px;
}

.mode-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.mode-btn {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #cbd5e1;
    padding: 10px 20px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
}

.mode-btn i {
    font-size: 16px;
    margin-bottom: 2px;
}

.mode-desc {
    font-size: 10px;
    font-weight: 400;
    opacity: 0.7;
    letter-spacing: 0.3px;
}

.mode-btn.active {
    background: rgba(46, 204, 113, 0.1);
    border-color: var(--green-primary);
    color: var(--green-dark);
    box-shadow: 0 4px 10px rgba(46, 204, 113, 0.15);
}

.mode-btn:hover:not(.active) {
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.1);
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 22px;
}

@media (max-width: 1100px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

.left-panel,
.right-panel {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

/* Section Headers */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-header h2 {
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-header h2 i {
    color: var(--green-primary);
}

.live-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 700;
    color: var(--green-primary);
    letter-spacing: 1px;
}

.pulse-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: var(--green-primary);
    border-radius: 50%;
    animation: pulse-dot 1.5s infinite;
    box-shadow: 0 0 8px var(--green-primary);
}

/* =====================================================
   SENSOR CARDS
   ===================================================== */
.sensor-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

@media (max-width: 700px) {
    .sensor-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.sensor-card {
    position: relative;
    padding: 18px 16px;
    border-radius: 12px;
    cursor: pointer;
    background: rgba(15, 25, 20, 0.70);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sensor-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    border-radius: 16px 16px 0 0;
    opacity: 0.8;
}

.sensor-card:hover {
    transform: translateY(-5px);
    border-color: var(--green-primary);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08), 0 0 0 1px rgba(46, 204, 113, 0.3);
}

/* Color Accents per sensor */
.sensor-card.ph::before {
    background: var(--color-ph);
}

.sensor-card.ph .sensor-icon {
    color: var(--color-ph);
}

.sensor-card.ec::before {
    background: var(--color-ec);
}

.sensor-card.ec .sensor-icon {
    color: var(--color-ec);
}

.sensor-card.wtemp::before {
    background: var(--color-wtemp);
}

.sensor-card.wtemp .sensor-icon {
    color: var(--color-wtemp);
}

.sensor-card.atemp::before {
    background: var(--color-atemp);
}

.sensor-card.atemp .sensor-icon {
    color: var(--color-atemp);
}

.sensor-card.humidity::before {
    background: var(--color-humidity);
}

.sensor-card.humidity .sensor-icon {
    color: var(--color-humidity);
}

.sensor-card.wlevel::before {
    background: var(--color-wlevel);
}

.sensor-card.wlevel .sensor-icon {
    color: var(--color-wlevel);
}

.sensor-card.light::before {
    background: var(--color-light);
}

.sensor-card.light .sensor-icon {
    color: var(--color-light);
}

.sensor-icon {
    font-size: 22px;
    margin-bottom: 4px;
    transition: transform 0.3s;
}

.sensor-card:hover .sensor-icon {
    transform: scale(1.15);
}

.sensor-value {
    font-family: var(--font-display);
    font-size: 30px;
    font-weight: 700;
    color: #ffffff;
    line-height: 1;
    letter-spacing: -0.5px;
}

.sensor-label {
    font-size: 11px;
    font-weight: 600;
    color: #cbd5e1;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.sensor-trend-icon {
    position: absolute;
    bottom: 12px;
    right: 12px;
    font-size: 11px;
    color: #cbd5e1;
    transition: color 0.3s;
}

.sensor-card:hover .sensor-trend-icon {
    color: var(--green-primary);
}

.sensor-status {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--green-primary);
}

.sensor-status.warning {
    background: #fbbf24;
    animation: pulse-dot 1s infinite;
}

.sensor-status.danger {
    background: #f87171;
    animation: pulse-dot 0.6s infinite;
}

/* =====================================================
   CHART SECTION
   ===================================================== */
.chart-section {
    flex: 1;
}

.chart-wrapper {
    height: 280px;
    position: relative;
    margin-top: 10px;
}

.chart-legend {
    display: flex;
    align-items: center;
    font-size: 12px;
    color: #cbd5e1;
}

.legend-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 5px;
}

/* =====================================================
   AI AGENT PANEL
   ===================================================== */
.ai-panel {
    padding: 0;
    overflow: hidden;
}

.ai-panel-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 22px 16px;
    background: rgba(46, 204, 113, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.ai-robot-img {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 14px;
    border: 2px solid rgba(80, 200, 120, 0.3);
    box-shadow: 0 0 20px rgba(80, 200, 120, 0.3);
}

.ai-panel-title h3 {
    font-family: var(--font-display);
    font-size: 15px;
    font-weight: 700;
    color: #ffffff;
}

.ai-panel-title p {
    font-size: 12px;
    color: #cbd5e1;
    margin-top: 3px;
}

.ai-logs-section {
    padding: 12px 22px 20px;
}

#approvalCardsContainer {
    padding: 0 22px;
}

.ai-logs-label {
    font-size: 12px;
    font-weight: 600;
    color: #cbd5e1;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.log-container {
    height: 260px;
    overflow-y: auto;
    font-family: 'Consolas', 'SF Mono', monospace;
    font-size: 11.5px;
    background: rgba(0, 0, 0, 0.35);
    padding: 14px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    scrollbar-width: thin;
    scrollbar-color: var(--green-primary) rgba(0, 0, 0, 0.05);
}

.log-placeholder {
    color: #94a3b8;
    font-style: italic;
}

.log-entry {
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.06);
    line-height: 1.5;
}

.log-time {
    color: #94a3b8;
    margin-right: 8px;
}

.log-message {
    color: #cbd5e1;
}

.log-message.advisory {
    color: #60a5fa;
}

.log-message.warning {
    color: #fbbf24;
}

.log-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.log-btn {
    padding: 4px 10px;
    font-size: 10px;
    font-weight: 700;
    border-radius: 4px;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    text-transform: uppercase;
}

.log-btn.approve {
    background: rgba(80, 200, 120, 0.2);
    color: #50c878;
    border: 1px solid rgba(80, 200, 120, 0.3);
}

.log-btn.approve:hover {
    background: #50c878;
    color: #000;
}

.log-btn.reject {
    background: rgba(231, 76, 60, 0.2);
    color: #e74c3c;
    border: 1px solid rgba(231, 76, 60, 0.3);
}

.log-btn.reject:hover {
    background: #e74c3c;
    color: #fff;
}

/* Inline Approval Cards — SEMI_AUTO mode */
.approval-card {
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.35);
    border-left: 3px solid #f59e0b;
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 8px;
    animation: slideUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.approval-card .approval-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    background: transparent;
    border: none;
    padding: 0;
}

.approval-card .approval-badge {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 1px;
    color: #f59e0b;
    background: rgba(245, 158, 11, 0.15);
    padding: 2px 7px;
    border-radius: 20px;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.approval-card .approval-time {
    font-size: 10px;
    color: #888;
}

.approval-card .approval-action {
    font-size: 13px;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 5px;
    background: transparent;
    border: none;
    display: block;
}

.approval-card .approval-reason {
    font-size: 11px;
    color: #d97706;
    line-height: 1.4;
    margin-bottom: 8px;
    background: rgba(0, 0, 0, 0.3);
    padding: 6px 8px;
    border-radius: 6px;
    max-height: 70px;
    overflow-y: auto;
}

.approval-card .approval-btns {
    display: flex;
    gap: 6px;
}


/* =====================================================
   DEVICES PANEL
   ===================================================== */
.devices-panel {
    flex: 1;
}

.override-note {
    font-size: 10px;
    color: #cbd5e1;
    background: rgba(0, 0, 0, 0.45);
    padding: 4px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.device-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 5px;
}

.device-placeholder {
    color: #94a3b8;
    font-style: italic;
    font-size: 14px;
    text-align: center;
    padding: 20px;
}

.device-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(15, 25, 20, 0.65);
    padding: 14px 16px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-left: 3px solid var(--green-primary);
    transition: background 0.2s, box-shadow 0.2s;
}

.device-item:hover {
    background: rgba(0, 0, 0, 0.35);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.device-info h4 {
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
    text-transform: capitalize;
}

.device-info small {
    font-size: 11px;
    color: #94a3b8;
}

/* Toggle Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 46px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #cbd5e1;
    transition: .3s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 4px;
    background-color: #7aad90;
    transition: .3s;
    border-radius: 50%;
}

input:checked+.slider {
    background-color: var(--green-primary);
    box-shadow: 0 0 12px var(--green-glow);
}

input:checked+.slider:before {
    transform: translateX(22px);
    background: rgba(255, 255, 255, 0.1);
}

/* =====================================================
   SENSOR GRAPH MODAL
   ===================================================== */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: rgba(15, 25, 20, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    padding: 28px;
    width: 90%;
    max-width: 820px;
    max-height: 90vh;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6);
    position: relative;
}

.modal-header h3 {
    font-family: var(--font-display);
    color: var(--green-primary);
    font-size: 20px;
    margin-bottom: 15px;
}

.modal-close {
    position: absolute;
    top: 18px;
    right: 22px;
    font-size: 28px;
    color: #94a3b8;
    cursor: pointer;
    background: none;
    border: none;
    transition: color 0.2s;
}

.modal-close:hover {
    color: #ffffff;
}

.modal-chart-container {
    height: 380px;
    position: relative;
}

/* =====================================================
   SEMI-AUTO APPROVAL MODAL
   ===================================================== */
.approval-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease;
}

.approval-overlay.active {
    display: flex;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.approval-modal {
    background: rgba(15, 25, 20, 0.65);
    border: 2px solid rgba(245, 158, 11, 0.3);
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    overflow: hidden;
    animation: slideUp 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

@keyframes slideUp {
    from {
        transform: translateY(40px);
        opacity: 0;
    }

    to {
        transform: none;
        opacity: 1;
    }
}

.approval-header {
    background: rgba(245, 158, 11, 0.05);
    border-bottom: 1px solid rgba(245, 158, 11, 0.15);
    padding: 18px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.approval-badge {
    font-weight: 700;
    font-size: 15px;
    color: #fcd34d;
}

.approval-mode-tag {
    background: rgba(255, 165, 0, 0.2);
    color: #f59e0b;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    border: 1px solid rgba(255, 165, 0, 0.35);
}

.approval-body {
    padding: 24px;
}

.approval-device {
    font-size: 22px;
    font-weight: 700;
    color: #ffffff;
    text-transform: capitalize;
    margin-bottom: 8px;
}

.approval-action {
    display: inline-block;
    background: rgba(255, 165, 0, 0.15);
    color: #f59e0b;
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 14px;
    border: 1px solid rgba(255, 165, 0, 0.3);
}

.approval-reasoning {
    font-size: 13px;
    color: #d4a76a;
    line-height: 1.6;
    background: rgba(0, 0, 0, 0.3);
    padding: 12px 14px;
    border-radius: 8px;
    border-left: 3px solid rgba(255, 165, 0, 0.45);
    margin-bottom: 10px;
    max-height: 200px;
    overflow-y: auto;
    scrollbar-width: thin;
}

.approval-duration {
    font-size: 12px;
    color: #94a3b8;
}

.approval-footer {
    display: flex;
    gap: 12px;
    padding: 18px 24px;
    background: rgba(0, 0, 0, 0.35);
    border-top: 1px solid rgba(245, 158, 11, 0.1);
}

.approval-btn {
    flex: 1;
    padding: 14px;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.approval-btn.reject {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.35);
}

.approval-btn.reject:hover {
    background: rgba(239, 68, 68, 0.3);
    transform: translateY(-2px);
}

.approval-btn.approve {
    background: var(--green-primary);
    color: #fff;
    box-shadow: 0 5px 20px var(--green-glow);
}

.approval-btn.approve:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(80, 200, 120, 0.6);
}

/* =====================================================
   CHAT WIDGET
   ===================================================== */
/* ── Chat Widget Floating Button ── */
.chat-widget-btn {
    position: fixed;
    bottom: 28px;
    right: 28px;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #00e676, #00c853, #1de9b6);
    color: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 26px;
    cursor: pointer;
    box-shadow:
        0 8px 32px rgba(0, 230, 118, 0.55),
        0 0 0 0 rgba(0, 230, 118, 0.4);
    z-index: 1001;
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s;
    border: 3px solid rgba(255, 255, 255, 0.25);
    animation: chatBtnPulse 2.8s ease-in-out infinite;
}

@keyframes chatBtnPulse {
    0%,100% { box-shadow: 0 8px 32px rgba(0,230,118,0.55), 0 0 0 0 rgba(0,230,118,0.4); }
    50%      { box-shadow: 0 12px 40px rgba(0,230,118,0.7), 0 0 0 14px rgba(0,230,118,0); }
}

.chat-widget-btn:hover {
    transform: scale(1.12) rotate(8deg);
    box-shadow: 0 14px 50px rgba(0, 230, 118, 0.75);
    animation: none;
}

/* ── Chat Panel ── */
.chat-panel {
    display: none;
    position: fixed;
    bottom: 110px;
    right: 24px;
    width: 420px;
    max-width: calc(100vw - 28px);
    height: 600px;
    max-height: 88vh;
    background:
        radial-gradient(ellipse at 10% 0%, rgba(0, 230, 118, 0.10) 0%, transparent 55%),
        radial-gradient(ellipse at 90% 100%, rgba(29, 233, 182, 0.07) 0%, transparent 50%),
        linear-gradient(165deg,
            rgba(3, 20, 12, 0.98) 0%,
            rgba(6, 32, 18, 0.98) 45%,
            rgba(2, 22, 13, 0.99) 100%);
    backdrop-filter: blur(40px) saturate(220%);
    -webkit-backdrop-filter: blur(40px) saturate(220%);
    border-radius: 24px;
    box-shadow:
        0 24px 70px rgba(0, 0, 0, 0.80),
        0 0 0 2px rgba(0, 230, 118, 0.40),
        0 0 50px rgba(0, 230, 118, 0.10),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
    z-index: 1000;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(20px) scale(0.95);
    opacity: 0;
    transition: all 0.38s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.chat-panel.active {
    display: flex;
    transform: translateY(0) scale(1);
    opacity: 1;
}

/* Animated top accent line */
.chat-panel::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, #00e676, #1de9b6, #00bcd4, #00e676);
    background-size: 200% 100%;
    animation: chatAccentSlide 3s linear infinite;
    border-radius: 24px 24px 0 0;
    z-index: 10;
}

@keyframes chatAccentSlide {
    0%   { background-position: 0% 0%; }
    100% { background-position: 200% 0%; }
}

@media (max-width: 500px) {
    .chat-panel {
        width: calc(100vw - 16px);
        right: 8px;
        bottom: 80px;
        height: 82vh;
        border-radius: 20px;
    }
}

.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: linear-gradient(135deg,
        rgba(0, 80, 40, 0.98) 0%,
        rgba(0, 60, 30, 0.97) 45%,
        rgba(0, 40, 22, 0.99) 100%);
    border-bottom: 2px solid rgba(0, 230, 118, 0.30);
    flex-wrap: nowrap;
    gap: 8px;
    font-weight: 700;
    color: #fff;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.40);
    min-height: 62px;
    overflow: hidden;
    position: relative;
    flex-shrink: 0;
}

/* Subtle shimmer on header */
.chat-header::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(105deg, transparent 30%, rgba(0,230,118,0.06) 50%, transparent 70%);
    background-size: 200% 100%;
    animation: headerShimmer 4s ease-in-out infinite;
    pointer-events: none;
}

@keyframes headerShimmer {
    0%,100% { background-position: -100% 0; }
    50%      { background-position: 200% 0; }
}

.chat-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: var(--font-display);
    font-size: 17px;
    white-space: nowrap;
    color: #5effa0;
    text-shadow: 0 0 18px rgba(0, 230, 118, 0.6);
    z-index: 1;
}

.chat-header-controls {
    display: flex;
    align-items: center;
    gap: 7px;
    flex-shrink: 0;
    flex-wrap: nowrap;
    z-index: 1;
}

/* Header selects */
.chat-panel .cb-lang-select {
    padding: 5px 8px;
    font-size: 12px;
    max-width: 90px;
    border-radius: 10px;
    background: rgba(0, 230, 118, 0.12);
    border: 1px solid rgba(0, 230, 118, 0.38);
    color: #a3ffcc;
    cursor: pointer;
    outline: none;
    transition: all 0.2s;
}
.chat-panel .cb-lang-select:hover {
    background: rgba(0, 230, 118, 0.22);
    border-color: rgba(0, 230, 118, 0.6);
}

.chat-panel .cb-icon-btn {
    width: 32px;
    height: 32px;
    font-size: 13px;
    padding: 0;
    flex-shrink: 0;
    border-radius: 50%;
    background: rgba(0,230,118,0.1);
    border: 1px solid rgba(0,230,118,0.3);
    color: #5effa0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}
.chat-panel .cb-icon-btn:hover {
    background: rgba(0,230,118,0.25);
    transform: scale(1.1);
}

.chat-close {
    cursor: pointer;
    color: #ff3b5c;
    background: rgba(239, 68, 68, 0.25);
    border-radius: 50%;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: bold;
    transition: all 0.22s;
    border: 1px solid rgba(239, 68, 68, 0.6);
    flex-shrink: 0;
}
.chat-close:hover {
    background: rgba(239, 68, 68, 0.6);
    color: #fff;
    transform: scale(1.1) rotate(90deg);
}

.chat-body {
    flex: 1;
    padding: 16px 18px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 14px;
    width: 100%;
    box-sizing: border-box;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 230, 118, 0.45) rgba(0,0,0,0.2);
    background:
        radial-gradient(ellipse at 50% 0%, rgba(0,230,118,0.04) 0%, transparent 60%);
}
.chat-body::-webkit-scrollbar { width: 5px; }
.chat-body::-webkit-scrollbar-track { background: rgba(0,0,0,0.15); border-radius: 10px; }
.chat-body::-webkit-scrollbar-thumb { background: rgba(0,230,118,0.38); border-radius: 10px; }
.chat-body::-webkit-scrollbar-thumb:hover { background: rgba(0,230,118,0.6); }

/* Ensure each message row fills the full width so alignment works */
.chat-body .cb-msg {
    width: 100%;
    box-sizing: border-box;
}
.chat-body .cb-msg.cb-user {
    justify-content: flex-start; /* flex-start on row-reverse pushes to the right */
}
.chat-body .cb-msg.cb-bot {
    justify-content: flex-start;
}

/* Legacy bubble classes */
.chat-bubble {
    padding: 14px 18px;
    border-radius: 20px;
    max-width: 82%;
    font-size: 15px;
    line-height: 1.65;
    animation: chatMsgPop 0.3s cubic-bezier(0.34,1.56,0.64,1);
    word-break: break-word;
    width: fit-content;
}

@keyframes chatMsgPop {
    from { opacity:0; transform: translateY(14px) scale(0.95); }
    to   { opacity:1; transform: translateY(0) scale(1); }
}

.chat-user {
    align-self: flex-end;
    background: linear-gradient(135deg, #00c853 0%, #00897b 100%);
    color: #fff;
    border-bottom-right-radius: 5px;
    box-shadow: 0 6px 22px rgba(0, 200, 83, 0.32);
    border: 1px solid rgba(0,230,118,0.45);
}

.chat-ai {
    align-self: flex-start;
    background: linear-gradient(135deg,
        rgba(0, 230, 118, 0.11) 0%,
        rgba(29, 233, 182, 0.07) 100%);
    color: #ccf5e0;
    border-bottom-left-radius: 5px;
    border: 1px solid rgba(0, 230, 118, 0.30);
    backdrop-filter: blur(12px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.22), inset 0 1px 0 rgba(255,255,255,0.07);
}

/* ── Chat Input Area ── */
.chat-input-area {
    display: flex;
    padding: 16px 20px;
    background: linear-gradient(0deg,
        rgba(2, 14, 8, 0.98) 0%,
        rgba(4, 22, 12, 0.92) 100%);
    border-top: 1px solid rgba(0, 230, 118, 0.22);
    gap: 12px;
    align-items: center;
    flex-shrink: 0;
}

.chat-input {
    flex: 1;
    background: rgba(0, 230, 118, 0.07);
    border: 1.5px solid rgba(0, 230, 118, 0.30);
    border-radius: 24px;
    color: #d4f5e5;
    padding: 14px 20px;
    outline: none;
    font-size: 14.5px;
    font-family: var(--font-main);
    transition: all 0.28s;
}
.chat-input::placeholder { color: rgba(150, 220, 180, 0.45); }
.chat-input:focus {
    border-color: #00e676;
    box-shadow: 0 0 0 3px rgba(0,230,118,0.18), 0 0 20px rgba(0,230,118,0.15);
    background: rgba(0, 230, 118, 0.12);
}

.chat-send {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #00e676 0%, #00c853 50%, #00897b 100%);
    border: none;
    border-radius: 50%;
    color: #003318;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    transition: all 0.25s;
    flex-shrink: 0;
    box-shadow: 0 5px 20px rgba(0, 230, 118, 0.45);
    font-weight: 700;
}
.chat-send:hover {
    transform: scale(1.1) rotate(-10deg);
    box-shadow: 0 8px 28px rgba(0, 230, 118, 0.65);
}

/* =====================================================
   RESPONSIVE — TABLET (≤900px)
   ===================================================== */
@media (max-width: 900px) {

    /* Header: reduce padding, shrink text */
    .hydro-header {
        padding: 0 16px;
        height: 56px;
    }

    .hydro-logo {
        font-size: 15px;
    }

    .header-title {
        font-size: 14px;
    }

    .agent-status-badge {
        font-size: 11px;
        padding: 5px 12px;
    }

    /* Mode strip: allow wrapping */
    .mode-strip {
        flex-wrap: wrap;
        gap: 12px;
        padding: 14px 16px;
    }

    .mode-buttons {
        flex-wrap: wrap;
    }

    .mode-btn {
        padding: 8px 14px;
        font-size: 12px;
    }

    /* Right panel moves below left panel (already handled at 1100px,
       but ensure AI panel appears above chart at 900px too) */
    .right-panel {
        order: -1;
        /* AI panel first on tablet */
    }
}

/* =====================================================
   RESPONSIVE — MOBILE (≤600px)
   ===================================================== */
@media (max-width: 600px) {

    /* Header: stack logo+title on top of status badge */
    .hydro-header {
        flex-direction: column;
        height: auto;
        padding: 10px 16px;
        gap: 8px;
        align-items: flex-start;
    }

    .header-center {
        order: -1;
        text-align: left;
    }

    .agent-status-badge {
        font-size: 11px;
        align-self: flex-end;
    }

    /* Main layout padding reduction */
    .hydro-main {
        padding: 14px 12px 60px;
    }

    /* Mode strip: vertical stack on very small screens */
    .mode-strip {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }

    .mode-buttons {
        width: 100%;
        justify-content: space-between;
    }

    .mode-btn {
        flex: 1;
        min-width: 0;
    }

    /* Sensor grid: 2 columns (already set at 700px, keep) */
    .sensor-grid {
        gap: 10px;
    }

    .sensor-value {
        font-size: 24px;
    }

    .sensor-icon {
        font-size: 18px;
    }

    /* Chart: reduce height on mobile */
    #sensorChart {
        max-height: 200px !important;
    }

    /* Glass card: reduce padding */
    .glass-card {
        padding: 16px;
    }

    /* Section headers */
    .section-header {
        flex-wrap: wrap;
        gap: 8px;
    }

    .section-header h2 {
        font-size: 14px;
    }

    /* Device controls: single column */
    .device-list {
        flex-direction: column;
    }

    /* Chat widget: raise above mobile browser nav bar */
    .chat-widget {
        bottom: 90px;
        right: 14px;
    }

    .chat-toggle-btn {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }

    /* Chat panel: near full screen on mobile */
    .chat-panel {
        width: calc(100vw - 28px);
        right: 0;
        bottom: 70px;
        max-height: 65vh;
    }
}

/* =====================================================
   RESPONSIVE — SMALL PHONES (≤480px)
   ===================================================== */
@media (max-width: 480px) {
    .sensor-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .sensor-card {
        padding: 14px 12px;
    }

    .sensor-value {
        font-size: 22px;
    }

    .mode-desc {
        display: none;
    }

    .mode-btn {
        padding: 10px 12px;
    }

    .logo-text {
        display: none;
    }

    .logo-icon {
        font-size: 22px;
    }
}

/* =====================================================
   AUTH RESTRICTION MODAL (Custom Alert)
   ===================================================== */
.auth-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 15, 12, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.auth-modal-overlay.active {
    display: flex;
    opacity: 1;
}

.auth-modal-content {
    background: #ffffff;
    width: 90%;
    max-width: 420px;
    padding: 40px 30px;
    border-radius: 24px;
    text-align: center;
    position: relative;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4), 0 0 40px rgba(46, 204, 113, 0.15);
    border: 1px solid rgba(46, 204, 113, 0.3);
    transform: translateY(30px) scale(0.95);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.auth-modal-overlay.active .auth-modal-content {
    transform: translateY(0) scale(1);
}

.auth-modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: transparent;
    border: none;
    font-size: 28px;
    color: #94a3b8;
    cursor: pointer;
    transition: color 0.3s;
}

.auth-modal-close:hover {
    color: #f43f5e;
}

.auth-modal-icon {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, rgba(46, 204, 113, 0.2), rgba(39, 174, 96, 0.1));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px auto;
    color: var(--primary-color);
    font-size: 30px;
    box-shadow: 0 10px 20px rgba(46, 204, 113, 0.15);
}

.auth-modal-content h3 {
    font-size: 1.6rem;
    color: #1e293b;
    margin-bottom: 12px;
    font-weight: 800;
}

.auth-modal-content p {
    font-size: 1.05rem;
    color: #64748b;
    line-height: 1.6;
    margin-bottom: 30px;
}

.auth-modal-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.auth-modal-actions button {
    padding: 12px 24px;
    border-radius: 30px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    flex: 1;
}

.auth-modal-actions .btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: #fff;
    border: none;
    box-shadow: 0 4px 15px rgba(46, 204, 113, 0.3);
}

.auth-modal-actions .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(46, 204, 113, 0.5);
    filter: brightness(1.1);
}

.auth-modal-actions .btn-outline {
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.auth-modal-actions .btn-outline:hover {
    background: rgba(46, 204, 113, 0.1);
    transform: translateY(-2px);
}

/* ═══════════════════════════════════════════════════════════
   DONOR PORTAL V2 — HERO BANNER
═══════════════════════════════════════════════════════════ */
.donor-hero-banner {
    background: linear-gradient(135deg, #064e3b 0%, #065f46 50%, #059669 100%);
    border-radius: 20px;
    padding: 36px 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
    margin-bottom: 28px;
    position: relative;
    overflow: hidden;
}

.donor-hero-banner::before {
    content: '\f4b9';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    right: -20px;
    top: -30px;
    font-size: 10rem;
    color: rgba(255, 255, 255, 0.05);
    line-height: 1;
    pointer-events: none;
}

.donor-hero-left {
    flex: 1;
}

.donor-hero-title {
    font-size: 1.9rem;
    font-weight: 800;
    color: #fff;
    margin: 6px 0 10px;
    line-height: 1.2;
}

.donor-hero-sub {
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.92rem;
    line-height: 1.6;
    max-width: 480px;
}

.donor-hero-stats {
    display: flex;
    gap: 14px;
    flex-shrink: 0;
}

.donor-stat-pill {
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 130px;
}

.donor-stat-pill>i {
    font-size: 1.4rem;
    color: #6ee7b7;
}

.donor-stat-num {
    display: block;
    font-size: 1.2rem;
    font-weight: 800;
    color: #fff;
    line-height: 1.2;
}

.donor-stat-label {
    display: block;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.65);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 2px;
}

/* ═══════════════════════════════════════════════════════════
   FILTER BAR V2
═══════════════════════════════════════════════════════════ */
.donor-filter-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.donor-search-wrap {
    flex: 1;
    min-width: 220px;
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fff;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 10px 16px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.donor-search-wrap:focus-within {
    border-color: #059669;
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.1);
}

.donor-search-wrap i {
    color: #94a3b8;
}

.donor-search-wrap input {
    border: none;
    outline: none;
    font-size: 0.9rem;
    width: 100%;
    background: transparent;
}

.donor-filter-selects {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.donor-select-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 10px 14px;
    transition: border-color 0.2s;
}

.donor-select-pill:focus-within {
    border-color: #059669;
}

.donor-select-pill i {
    color: #94a3b8;
    font-size: 0.85rem;
}

.donor-select-pill select {
    border: none;
    outline: none;
    font-size: 0.85rem;
    background: transparent;
    cursor: pointer;
}

/* Results + Live bar */
.donor-results-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.donor-result-count {
    font-size: 0.85rem;
    color: #64748b;
    font-weight: 600;
}

.donor-live-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #ecfdf5;
    color: #059669;
    border: 1px solid #6ee7b7;
    border-radius: 999px;
    padding: 4px 12px;
    font-size: 0.75rem;
    font-weight: 700;
}

.donor-live-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #059669;
    animation: pulse-dot 1.5s infinite;
}

@keyframes pulse-dot {

    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.5);
        opacity: 0.5;
    }
}

/* ═══════════════════════════════════════════════════════════
   DONOR CARD V2
═══════════════════════════════════════════════════════════ */
.donor-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

.donor-card-v2 {
    background: #fff;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    display: flex;
    flex-direction: column;
    border: 1px solid #f1f5f9;
}

.donor-card-v2:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.14);
}

/* Image area */
.donor-card-img-wrap {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.donor-card-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.donor-card-v2:hover .donor-card-img-wrap img {
    transform: scale(1.05);
}

.donor-card-img-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0) 40%, rgba(0, 0, 0, 0.55) 100%);
}

.donor-card-img-badges {
    position: absolute;
    top: 12px;
    left: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.donor-verified-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(5, 150, 105, 0.9);
    backdrop-filter: blur(4px);
    color: #fff;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.3px;
}

/* Urgency badge */
.donor-urgency-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 0.72rem;
    font-weight: 700;
}

.donor-urgency-critical {
    background: rgba(225, 29, 72, 0.9);
    color: #fff;
}

.donor-urgency-urgent {
    background: rgba(217, 119, 6, 0.9);
    color: #fff;
}

.donor-urgency-trending {
    background: rgba(79, 70, 229, 0.9);
    color: #fff;
}

/* Category chip */
.donor-cat-chip {
    position: absolute;
    bottom: 12px;
    right: 12px;
    border-radius: 999px;
    padding: 4px 12px;
    font-size: 0.72rem;
    font-weight: 700;
    backdrop-filter: blur(4px);
}

/* Card body */
.donor-card-body-v2 {
    padding: 18px 20px 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.donor-card-farmer-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.donor-avatar-v2 {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 2px solid #d1fae5;
    object-fit: cover;
}

.donor-farmer-name-v2 {
    font-size: 0.9rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
}

.donor-farmer-loc-v2 {
    font-size: 0.75rem;
    color: #94a3b8;
    margin: 2px 0 0;
}

.donor-farmer-loc-v2 i {
    margin-right: 3px;
}

.donor-date-chip {
    margin-left: auto;
    font-size: 0.7rem;
    color: #94a3b8;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    padding: 3px 8px;
    white-space: nowrap;
    flex-shrink: 0;
}

.donor-card-title-v2 {
    font-size: 1rem;
    font-weight: 800;
    color: #1e293b;
    margin: 0 0 8px;
    line-height: 1.3;
}

.donor-card-desc-v2 {
    font-size: 0.83rem;
    color: #64748b;
    line-height: 1.6;
    margin: 0 0 16px;
    flex: 1;
}

/* Photo Thumbnails */
.donor-thumbs-container {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.donor-mini-thumb {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    background-size: cover;
    background-position: center;
    border: 2px solid #e2e8f0;
    cursor: zoom-in;
    transition: transform 0.2s, border-color 0.2s;
}

.donor-mini-thumb:hover {
    transform: scale(1.1);
    border-color: #059669;
}

/* Progress */
.donor-card-progress {
    margin-bottom: 14px;
}

.donor-progress-meta {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 6px;
}

.donor-raised-text {
    font-size: 0.95rem;
    font-weight: 800;
    color: #0f172a;
}

.donor-raised-label {
    font-size: 0.75rem;
    color: #94a3b8;
    font-weight: 400;
    margin-left: 2px;
}

.donor-pct-badge {
    font-size: 0.8rem;
    font-weight: 700;
}

.donor-progress-track {
    height: 8px;
    background: #f1f5f9;
    border-radius: 999px;
    overflow: hidden;
}

.donor-progress-fill-v2 {
    height: 100%;
    border-radius: 999px;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Donate button */
.donor-btn-donate {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 13px;
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
    letter-spacing: 0.3px;
}

.donor-btn-donate:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(5, 150, 105, 0.35);
    background: linear-gradient(135deg, #047857 0%, #065f46 100%);
}

.donor-btn-donate i {
    font-size: 0.85rem;
}

/* ═══════════════════════════════════════════════════════════
   SKELETON LOADER
═══════════════════════════════════════════════════════════ */
.donor-skeleton {
    height: 420px;
    border-radius: 20px;
    background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
    background-size: 200% 100%;
    animation: shimmer 1.6s infinite;
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

/* Empty State */
.donor-empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: #94a3b8;
}

.donor-empty-state i {
    font-size: 3rem;
    margin-bottom: 16px;
    display: block;
}

.donor-empty-state h3 {
    font-size: 1.1rem;
    color: #475569;
    margin-bottom: 8px;
}

.donor-empty-state p {
    font-size: 0.9rem;
}

/* ═══════════════════════════════════════════════════════════
   PAYMENT MODAL V2
═══════════════════════════════════════════════════════════ */
.payment-content-v2 {
    position: relative;
    background: #fff;
    border-radius: 24px;
    padding: 32px;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.2);
    max-height: 90vh;
    overflow-y: auto;
}

.payment-close-v2 {
    position: absolute;
    top: 16px;
    right: 16px;
    background: #f1f5f9;
    border: none;
    border-radius: 50%;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.9rem;
    color: #64748b;
    transition: background 0.2s, color 0.2s;
}

.payment-close-v2:hover {
    background: #e2e8f0;
    color: #0f172a;
}

/* Farmer header */
.payment-farmer-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    background: #f8fafc;
    border-radius: 14px;
    margin-bottom: 20px;
}

.payment-farmer-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: 3px solid #d1fae5;
    object-fit: cover;
}

.payment-badge-tag {
    font-size: 0.72rem;
    color: #059669;
    font-weight: 700;
    margin: 0 0 3px;
}

.payment-badge-tag i {
    margin-right: 3px;
}

.payment-farmer-name-title {
    font-size: 1rem;
    font-weight: 800;
    color: #0f172a;
    margin: 0;
}

.payment-farmer-loc-sub {
    font-size: 0.78rem;
    color: #94a3b8;
    margin: 2px 0 0;
}

/* Progress mini bar */
.payment-progress-wrap {
    margin-bottom: 20px;
}

.payment-progress-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
}

/* Preset v2 */
.amt-presets-v2 {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

.amt-presets-v2 .amt-btn {
    flex: 1;
    min-width: 70px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 2px solid #e2e8f0;
    font-weight: 700;
    font-size: 0.88rem;
    cursor: pointer;
    background: #fff;
    transition: all 0.2s;
    color: #475569;
}

.amt-presets-v2 .amt-btn.active,
.amt-presets-v2 .amt-btn:hover {
    border-color: #059669;
    background: #ecfdf5;
    color: #059669;
}

/* Custom amount input */
.payment-input-wrap {
    display: flex;
    align-items: center;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 16px;
    transition: border-color 0.2s;
}

.payment-input-wrap:focus-within {
    border-color: #059669;
}

.payment-rupee-prefix {
    background: #f8fafc;
    padding: 12px 14px;
    font-weight: 700;
    color: #475569;
    font-size: 1rem;
    border-right: 2px solid #e2e8f0;
}

.amt-custom-v2 {
    border: none;
    outline: none;
    padding: 12px 14px;
    font-size: 1rem;
    font-weight: 700;
    color: #0f172a;
    flex: 1;
}

/* Trust bar */
.payment-trust-bar {
    display: flex;
    justify-content: space-around;
    gap: 8px;
    background: #f8fafc;
    border-radius: 10px;
    flex-wrap: wrap;
    padding: 10px;
    margin-bottom: 18px;
    font-size: 0.75rem;
    color: #475569;
    font-weight: 600;
}

.payment-trust-bar i {
    margin-right: 4px;
}

/* Pay button v2 */
.btn-pay-now-v2 {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    color: #fff;
    border: none;
    border-radius: 14px;
    font-weight: 800;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: transform 0.2s, box-shadow 0.2s;
    letter-spacing: 0.3px;
}

.btn-pay-now-v2:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(5, 150, 105, 0.35);
}

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    .donor-hero-banner {
        flex-direction: column;
        padding: 24px 20px;
    }

    .donor-hero-stats {
        width: 100%;
        justify-content: space-between;
    }

    .donor-stat-pill {
        flex: 1;
        min-width: unset;
        padding: 12px;
    }

    .donor-hero-title {
        font-size: 1.4rem;
    }

    .donor-grid {
        grid-template-columns: 1fr;
    }

    .payment-content-v2 {
        border-radius: 20px 20px 0 0;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        max-width: 100%;
    }
}

/* Module Back Button */
.module-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 18px;
    padding: 10px 20px;
    border-radius: 12px;
    font-size: 0.88rem;
    font-weight: 700;
    color: #064e3b;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(8px);
    text-decoration: none;
    border: 1px solid rgba(5, 150, 105, 0.15);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: all 0.25s;
}

.module-back-btn:hover {
    background: #fff;
    color: #059669;
    transform: translateX(-3px);
    box-shadow: 0 4px 16px rgba(5, 150, 105, 0.15);
}

.module-back-btn i {
    font-size: 0.85rem;
    transition: transform 0.2s;
}

.module-back-btn:hover i {
    transform: translateX(-3px);
}

/* ═══════════════════════════════════════════════════════════
   IRRIGATION SCHEDULING MODULE
═══════════════════════════════════════════════════════════ */
.irrigation-module-bg {
    background: url('../images/irrigation_bg.jpeg') no-repeat center center;
    background-size: cover;
    background-attachment: fixed;
    min-height: 100vh;
}

.irri-module-wrap {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.irri-hero {
    background: linear-gradient(135deg, #064e3b, #059669);
    border-radius: 20px;
    padding: 36px 32px;
    color: #fff;
    position: relative;
    overflow: hidden;
    margin-bottom: 28px;
}

.irri-hero::after {
    content: '\f043';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    right: -10px;
    bottom: -20px;
    font-size: 8rem;
    color: rgba(255, 255, 255, 0.06);
}

.irri-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.15);
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 700;
    margin-bottom: 12px;
}

.irri-hero h2 {
    font-size: 1.7rem;
    font-weight: 800;
    margin: 0 0 8px;
}

.irri-hero p {
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.9rem;
    margin: 0;
    max-width: 500px;
}

/* Wizard */
.irri-wizard {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 20px;
    padding: 28px;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.15);
    /* Stronger shadow for bright separation */
    margin-bottom: 24px;
}

.irri-step-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-bottom: 28px;
}

.irri-step-dot {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    opacity: 0.4;
    transition: opacity 0.3s;
}

.irri-step-dot.active {
    opacity: 1;
}

.irri-step-dot i {
    width: 40px;
    height: 40px;
    background: #ecfdf5;
    color: #059669;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    border: 2px solid #d1fae5;
}

.irri-step-dot.active i {
    background: #059669;
    color: #fff;
    border-color: #059669;
}

.irri-step-dot span {
    font-size: 0.72rem;
    font-weight: 600;
    color: #64748b;
}

.irri-step-line {
    width: 60px;
    height: 3px;
    background: #e2e8f0;
    border-radius: 999px;
    margin: 0 8px;
    margin-bottom: 18px;
}

.irri-step-panel h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.irri-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
}

.irri-form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.irri-form-group label {
    font-size: 0.82rem;
    font-weight: 700;
    color: #475569;
}

.irri-form-group select,
.irri-form-group input[type="range"] {
    padding: 10px 14px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 0.9rem;
    background: #f8fafc;
    outline: none;
    transition: border-color 0.2s;
}

.irri-form-group select:focus {
    border-color: #059669;
}

.irri-range-val {
    font-size: 0.8rem;
    font-weight: 700;
    color: #059669;
    text-align: center;
}

.irri-btn-next,
.irri-btn-generate {
    width: 100%;
    padding: 13px;
    border: none;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: linear-gradient(135deg, #059669, #047857);
    color: #fff;
    transition: transform 0.2s, box-shadow 0.2s, opacity 0.2s;
}

.irri-btn-next:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.irri-btn-next:not(:disabled):hover,
.irri-btn-generate:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(5, 150, 105, 0.3);
}

.irri-btn-back {
    padding: 13px 24px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    background: #fff;
    color: #475569;
    transition: all 0.2s;
}

.irri-btn-back:hover {
    border-color: #94a3b8;
}

.irri-btn-row {
    display: flex;
    gap: 12px;
}

/* Results */
.irri-results-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 20px;
}

.irri-priority-card,
.irri-info-card {
    background: #fff;
    border-radius: 14px;
    padding: 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
}

.irri-priority-icon,
.irri-info-icon {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.irri-priority-label,
.irri-info-label {
    font-size: 0.75rem;
    color: #94a3b8;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.irri-priority-level {
    font-size: 1.4rem;
    font-weight: 800;
}

.irri-info-value {
    font-size: 1rem;
    font-weight: 700;
    color: #0f172a;
    margin-top: 2px;
}

.irri-advisory-box,
.irri-weather-box {
    background: #fff;
    border-radius: 14px;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
    border-left: 4px solid #3b82f6;
}

.irri-advisory-box h4,
.irri-weather-box h4 {
    font-size: 0.95rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.irri-advisory-box p,
.irri-weather-box p {
    font-size: 0.88rem;
    color: #475569;
    margin: 0;
    line-height: 1.6;
}

.irri-critical-box {
    border-left-color: #e11d48;
    background: #fff5f5;
}

.irri-weather-hot {
    border-left-color: #f59e0b;
}

.irri-weather-rain {
    border-left-color: #3b82f6;
    background: #eff6ff;
}

.irri-weather-normal {
    border-left-color: #94a3b8;
}

.irri-section-tracker {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 14px;
    padding: 22px;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.15);
    /* Strong shadow for bright separation */
}

.irri-section-tracker h4 {
    font-size: 0.95rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.irri-section-table {
    width: 100%;
    border-collapse: collapse;
}

.irri-section-table th {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #94a3b8;
    font-weight: 700;
    padding: 8px 12px;
    border-bottom: 2px solid #f1f5f9;
    text-align: left;
}

.irri-section-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #f8fafc;
    font-size: 0.88rem;
    color: #475569;
}

.irri-check-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    color: #64748b;
}

.irri-section-check {
    width: 18px;
    height: 18px;
    accent-color: #059669;
    cursor: pointer;
}

.irri-progress-summary {
    text-align: center;
    margin-top: 14px;
    font-size: 0.9rem;
    font-weight: 700;
    color: #475569;
    padding: 10px;
    background: #f8fafc;
    border-radius: 10px;
}

/* ═══════════════════════════════════════════════════════════
   MARKET PRICE PREDICTION MODULE
═══════════════════════════════════════════════════════════ */
.market-module-bg {
    background: url('../images/mpp_bg.jpeg') no-repeat center center;
    background-size: cover;
    background-attachment: fixed;
    min-height: 100vh;
}

.mkt-module-wrap {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

.mkt-hero {
    background: linear-gradient(135deg, #1e3a5f, #2563eb);
    border-radius: 20px;
    padding: 36px 32px;
    color: #fff;
    position: relative;
    overflow: hidden;
    margin-bottom: 28px;
}

.mkt-hero::after {
    content: '\f200';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    right: -10px;
    bottom: -20px;
    font-size: 8rem;
    color: rgba(255, 255, 255, 0.06);
}

.mkt-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.15);
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 700;
    margin-bottom: 12px;
}

.mkt-hero h2 {
    font-size: 1.7rem;
    font-weight: 800;
    margin: 0 0 8px;
}

.mkt-hero p {
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.9rem;
    margin: 0;
    max-width: 500px;
}

.mkt-select-bar {
    background: #ffffff;
    /* backdrop-filter removed: creates stacking context that clips dropdown z-index */
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: 16px;
    padding: 22px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    margin-bottom: 24px;
    overflow: visible;
}

.mkt-select-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
    min-width: 200px;
    max-width: 380px;
    position: relative;
    /* positioning context for the absolute dropdown */
    overflow: visible;
}

.mkt-select-group label {
    font-size: 0.82rem;
    font-weight: 700;
    color: #475569;
    display: flex;
    align-items: center;
    gap: 6px;
}

.mkt-select-group select {
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 0.95rem;
    background: #f8fafc;
    outline: none;
    transition: border-color 0.2s;
}

.mkt-select-group select:focus {
    border-color: #2563eb;
}

/* Price Cards Grid */
.mkt-cards-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
}

.mkt-price-card {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 16px;
    padding: 22px;
    text-align: center;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.mkt-current {
    border-top: 4px solid #94a3b8;
}

.mkt-predicted {
    border-top: 4px solid #059669;
}

.mkt-card-label {
    font-size: 0.75rem;
    color: #94a3b8;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mkt-card-price {
    font-size: 1.8rem;
    font-weight: 800;
    color: #0f172a;
}

.mkt-card-unit {
    font-size: 0.78rem;
    color: #94a3b8;
}

.mkt-card-diff {
    font-size: 0.85rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.mkt-trend-card {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 16px;
    padding: 22px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
}

.mkt-trend-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}

.mkt-trend-label {
    font-size: 0.75rem;
    color: #94a3b8;
    font-weight: 700;
    text-transform: uppercase;
    display: block;
}

.mkt-trend-value {
    font-size: 1.4rem;
    font-weight: 800;
    display: block;
}

/* Risk Alert */
.mkt-risk-alert {
    background: #fff5f5;
    border: 1px solid #fecaca;
    border-left: 5px solid #e11d48;
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #b91c1c;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Chart */
.mkt-chart-card {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
}

.mkt-chart-card h4 {
    font-size: 1rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.mkt-chart-wrap {
    height: 300px;
    position: relative;
}

/* Advisory Grid */
.mkt-advisory-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
}

.mkt-advisory-card,
.mkt-supply-card {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 16px;
    padding: 22px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
}

.mkt-advisory-card h4,
.mkt-supply-card h4 {
    font-size: 0.95rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.mkt-advisory-value {
    font-size: 1.6rem;
    font-weight: 800;
    color: #2563eb;
    margin-bottom: 8px;
}

.mkt-advisory-card p {
    font-size: 0.85rem;
    color: #64748b;
    line-height: 1.5;
    margin: 0;
}

.mkt-sd-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
}

.mkt-sd-row span:first-child {
    font-size: 0.88rem;
    color: #475569;
    font-weight: 600;
}

.mkt-sd-badge {
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    background: #f1f5f9;
    color: #475569;
}

.mkt-sd-high,
.mkt-sd-veryhigh {
    background: #dcfce7;
    color: #15803d;
}

.mkt-sd-moderate {
    background: #fef3c7;
    color: #b45309;
}

.mkt-sd-low {
    background: #fee2e2;
    color: #b91c1c;
}

.mkt-sd-variable,
.mkt-sd-seasonal,
.mkt-sd-highseasonal {
    background: #ede9fe;
    color: #7e22ce;
}

/* Price Table */
.mkt-table-card {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 16px;
    padding: 22px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
}

.mkt-table-card h4 {
    font-size: 0.95rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.mkt-table-scroll {
    overflow-x: auto;
}

.mkt-price-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

.mkt-price-table th {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #94a3b8;
    font-weight: 700;
    padding: 8px 10px;
    border-bottom: 2px solid #f1f5f9;
    text-align: center;
}

.mkt-price-table td {
    padding: 10px;
    text-align: center;
    font-size: 0.85rem;
    color: #475569;
    font-weight: 600;
    border-bottom: 1px solid #f8fafc;
}

.mkt-price-table td:first-child,
.mkt-price-table th:first-child {
    text-align: left;
    font-weight: 700;
}

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE — IRRIGATION + MARKET
═══════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    .irri-form-grid {
        grid-template-columns: 1fr;
    }

    .irri-results-grid {
        grid-template-columns: 1fr;
    }

    .irri-hero h2 {
        font-size: 1.3rem;
    }

    .mkt-cards-grid {
        grid-template-columns: 1fr;
    }

    .mkt-advisory-grid {
        grid-template-columns: 1fr;
    }

    .mkt-hero h2 {
        font-size: 1.3rem;
    }

    .mkt-card-price {
        font-size: 1.4rem;
    }

    .mkt-select-row {
        flex-direction: column;
    }

    .mkt-calc-grid {
        grid-template-columns: 1fr;
    }
}

/* ═══════════════════════════════════════════════════════════
   V2 — NEW COMPONENT STYLES
═══════════════════════════════════════════════════════════ */

/* Weather Detect Button */
.irri-detect-weather-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 14px;
    border: 2px dashed #059669;
    border-radius: 12px;
    background: #ecfdf5;
    color: #059669;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    margin-bottom: 16px;
    transition: all 0.25s;
    justify-content: center;
}

.irri-detect-weather-btn:hover {
    background: #d1fae5;
    border-style: solid;
}

.irri-detect-weather-btn:disabled {
    opacity: 0.7;
    cursor: default;
}

/* Live Weather Card */
.irri-live-weather-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(135deg, #ecfdf5, #d1fae5);
    border-radius: 14px;
    padding: 14px 18px;
    margin-bottom: 16px;
    border: 1px solid rgba(5, 150, 105, 0.15);
}

.irri-live-weather-card img {
    width: 50px;
    height: 50px;
}

.irri-live-weather-card strong {
    font-size: 1rem;
    color: #064e3b;
}

/* AI Advisory Card */
.irri-ai-advisory {
    margin-bottom: 16px;
}

.irri-ai-loading {
    text-align: center;
    padding: 24px;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
    color: #7e22ce;
    font-weight: 700;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.irri-ai-card {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    border-radius: 14px;
    padding: 20px;
    border-left: 5px solid #7e22ce;
    box-shadow: 0 4px 20px rgba(126, 34, 206, 0.08);
}

.irri-ai-header {
    font-size: 0.95rem;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.irri-ai-badge {
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    background: linear-gradient(135deg, #7e22ce, #a855f7);
    color: #fff;
}

.irri-ai-body {
    font-size: 0.88rem;
    color: #475569;
    line-height: 1.7;
}

/* Past Sessions */
.irri-past-sessions {
    margin-top: 16px;
}

.irri-past-card {
    background: #fff;
    border-radius: 14px;
    padding: 20px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
}

.irri-past-card h4 {
    font-size: 0.95rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Market Select Row */
.mkt-select-row {
    display: flex;
    align-items: flex-end;
    gap: 16px;
    flex-wrap: wrap;
    width: 100%;
}

.mkt-fetch-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.9rem;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.25s;
    white-space: nowrap;
}

.mkt-fetch-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.3);
}

.mkt-fetch-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Storage vs Sell Calculator */
.mkt-calc-card {
    background: #fff;
    border-radius: 16px;
    padding: 22px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
    border-top: 4px solid #b45309;
}

.mkt-calc-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 14px;
}

.mkt-calc-input {
    padding: 10px 14px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 0.9rem;
    background: #f8fafc;
    outline: none;
    width: 100%;
    transition: border-color 0.2s;
}

.mkt-calc-input:focus {
    border-color: #b45309;
}

.mkt-calc-result {
    border-radius: 12px;
    overflow: hidden;
    margin-top: 8px;
}

.mkt-calc-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    font-size: 0.9rem;
    color: #0f172a;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.mkt-calc-row:nth-child(odd) {
    background: #fff;
}

.mkt-calc-verdict {
    padding: 14px 16px;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
}

.mkt-calc-verdict.store {
    background: #dcfce7;
    color: #15803d;
}

.mkt-calc-verdict.sell {
    background: #fee2e2;
    color: #b91c1c;
}

.mkt-calc-store {
    border: 2px solid #15803d;
}

.mkt-calc-sell {
    border: 2px solid #b91c1c;
}

/* Price Alert */
.mkt-alert-card {
    background: #fff;
    border-radius: 16px;
    padding: 22px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
    border-top: 4px solid #f59e0b;
}

.mkt-alert-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    font-size: 0.9rem;
    font-weight: 600;
    color: #475569;
}

.mkt-alert-input {
    padding: 8px 14px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 0.95rem;
    width: 120px;
    outline: none;
    font-weight: 700;
}

.mkt-alert-input:focus {
    border-color: #f59e0b;
}

.mkt-alert-set-btn {
    padding: 8px 18px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #fff;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.mkt-alert-set-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.3);
}

.mkt-active-alerts-wrap {
    margin-top: 10px;
}

.mkt-active-alerts-wrap h5 {
    font-size: 0.82rem;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0 0 8px;
}

.mkt-alert-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #fffbeb;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #475569;
    margin-bottom: 6px;
}

.mkt-alert-del {
    margin-left: auto;
    padding: 4px 8px;
    border: none;
    background: #fee2e2;
    color: #b91c1c;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s;
}

.mkt-alert-del:hover {
    background: #fecaca;
}

/* ML Coming Soon Banner */
.mkt-ml-banner {
    background: linear-gradient(135deg, #ede9fe, #f3e8ff);
    border: 1px solid #c4b5fd;
    border-radius: 14px;
    padding: 16px 22px;
    margin-bottom: 20px;
    font-size: 0.9rem;
    color: #6d28d9;
    display: flex;
    align-items: center;
    gap: 10px;
}

.mkt-ml-banner i {
    font-size: 1.2rem;
}


/* === DYNAMIC DESIGN UPDATES === */

@keyframes bgPan {
    0% {
        background-position: 0% 50%;
    }

    100% {
        background-position: 100% 50%;
    }
}

@keyframes aiBreathing {
    0% {
        box-shadow: 0 4px 20px rgba(126, 34, 206, 0.08);
        border-left-color: #7e22ce;
    }

    50% {
        box-shadow: 0 6px 28px rgba(168, 85, 247, 0.2);
        border-left-color: #a855f7;
    }

    100% {
        box-shadow: 0 4px 20px rgba(126, 34, 206, 0.08);
        border-left-color: #7e22ce;
    }
}

.irri-hero {
    background: linear-gradient(-45deg, #064e3b, #059669, #0f766e, #1e3a8a);
    background-size: 300% 300%;
    animation: bgPan 8s ease infinite;
    box-shadow: 0 8px 30px rgba(5, 150, 105, 0.3);
}

.irri-ai-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(248, 250, 252, 0.8) 100%);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(126, 34, 206, 0.1);
    border-left: 5px solid #7e22ce;
    animation: aiBreathing 4s infinite ease-in-out;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.irri-ai-card:hover {
    transform: translateY(-3px);
}

.irri-priority-card,
.irri-info-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid transparent;
}

.irri-priority-card:hover,
.irri-info-card:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.08);
    border-color: #e2e8f0;
}

.irri-check-wrap {
    transition: all 0.3s ease;
}

/* ═══ IRRIGATION V2 — AI ADVISORY ═══════════════════════════════ */
.irri-profile-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    border-radius: 10px;
    margin-bottom: 16px;
    background: #ecfdf5;
    color: #065f46;
    font-size: 0.85rem;
    font-weight: 500;
    border: 1px solid #a7f3d0;
}

.irri-profile-banner i {
    font-size: 1rem;
}

.irri-profile-banner--warn {
    background: #fffbeb;
    color: #92400e;
    border-color: #fde68a;
}

.irri-v2-card {
    background: #fff;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    margin-bottom: 20px;
}

.irri-v2-section {
    margin-bottom: 22px;
    padding-bottom: 20px;
    border-bottom: 1px solid #f1f5f9;
}

.irri-v2-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.irri-v2-section-title {
    font-size: 1rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.irri-v2-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

@media (max-width: 600px) {
    .irri-v2-grid {
        grid-template-columns: 1fr;
    }
}

/* Forecast strip */
.irri-forecast-strip {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: thin;
}

.irri-fc-day {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 52px;
    background: #f8fafc;
    border-radius: 10px;
    padding: 10px 8px;
    gap: 3px;
    border: 1px solid #e2e8f0;
}

.irri-fc-dow {
    font-size: 0.72rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
}

.irri-fc-icon {
    font-size: 1.1rem;
    color: #f59e0b;
}

.irri-fc-icon.fa-cloud-rain,
.irri-fc-icon.fa-bolt {
    color: #3b82f6;
}

.irri-fc-icon.fa-cloud {
    color: #94a3b8;
}

.irri-fc-temp {
    font-size: 0.82rem;
    font-weight: 700;
    color: #1e293b;
}

.irri-fc-rain {
    font-size: 0.7rem;
    color: #3b82f6;
    font-weight: 600;
    min-height: 14px;
}

/* Hot / rain day highlights on forecast strip */
.irri-fc-day--hot {
    background: #fff7ed;
    border-color: #fed7aa;
}

.irri-fc-day--hot .irri-fc-temp {
    color: #c2410c;
}

.irri-fc-day--hot .irri-fc-icon {
    color: #ea580c;
}

.irri-fc-day--rain {
    background: #eff6ff;
    border-color: #bfdbfe;
}

.irri-fc-day--rain .irri-fc-temp {
    color: #1d4ed8;
}

/* Timeline bar */
.irri-timeline-bar {
    display: flex;
    align-items: center;
    gap: 0;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 14px 18px;
    margin: 14px 0;
}

.irri-tl-item {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.irri-tl-item i {
    font-size: 1.4rem;
    color: #10b981;
    flex-shrink: 0;
}

.irri-tl-label {
    font-size: 0.72rem;
    color: #94a3b8;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.irri-tl-value {
    font-size: 0.9rem;
    color: #1e293b;
    font-weight: 700;
    margin-top: 2px;
}

.irri-tl-divider {
    width: 40px;
    height: 2px;
    background: #e2e8f0;
    flex-shrink: 0;
    position: relative;
    margin: 0 8px;
}

.irri-tl-divider::after {
    content: '';
    position: absolute;
    right: -5px;
    top: -4px;
    border: 5px solid transparent;
    border-left-color: #e2e8f0;
}

/* Risk chips */
.irri-risk-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.irri-risk-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    border-radius: 99px;
    font-size: 0.8rem;
    font-weight: 600;
}

.irri-risk-rain {
    background: #dbeafe;
    color: #1d4ed8;
}

.irri-risk-heat {
    background: #fee2e2;
    color: #b91c1c;
}

.irri-risk-humid {
    background: #fef9c3;
    color: #854d0e;
}

.irri-risk-ok {
    background: #dcfce7;
    color: #166534;
}

.irri-weather-summary-text {
    margin-top: 10px;
    font-size: 0.83rem;
    color: #475569;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Est. badge */
.irri-est-badge {
    display: inline-block;
    background: #fef3c7;
    color: #92400e;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: 99px;
    letter-spacing: 0.02em;
    vertical-align: middle;
}

/* Results header */
.irri-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #064e3b, #065f46);
    color: #fff;
    border-radius: 14px 14px 0 0;
    padding: 14px 18px;
    font-weight: 700;
    font-size: 0.95rem;
}

.irri-ai-badge {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 99px;
    margin-left: 8px;
    font-weight: 600;
}

/* Action points */
.irri-action-points {
    background: #f8fafc;
    border-radius: 12px;
    padding: 16px 18px;
    margin-top: 14px;
}

.irri-action-points h4 {
    font-size: 0.9rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 7px;
}

.irri-action-chips {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.irri-action-chip {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 0.85rem;
    color: #334155;
    border-left: 3px solid #10b981;
}

.irri-action-chip i {
    color: #10b981;
    margin-top: 2px;
    flex-shrink: 0;
}

/* Tracker toggle */
.irri-tracker-toggle {
    margin-top: 18px;
    padding: 12px 16px;
    background: #f0fdf4;
    border-radius: 10px;
    border: 1px dashed #86efac;
}

.mkt-hero {
    background: linear-gradient(-45deg, #1e3a5f, #2563eb, #4338ca, #3b0764);
    background-size: 300% 300%;
    animation: bgPan 8s ease infinite;
    box-shadow: 0 8px 30px rgba(37, 99, 235, 0.3);
}

.mkt-price-card {
    transition: all 0.3s ease;
}

.mkt-price-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.1);
}

/* === STUNNING UI UPGRADES FOR MARKET MODULE === */

.mkt-hero {
    background: linear-gradient(-45deg, #1e3a8a, #2563eb, #3b82f6, #1d4ed8) !important;
    background-size: 300% 300% !important;
    animation: bgPan 6s ease infinite alternate !important;
    box-shadow: 0 10px 30px rgba(37, 99, 235, 0.25) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.mkt-select-bar {
    /* backdrop-filter intentionally removed — it creates a CSS stacking context
       that traps dropdown z-index, making the menu render clipped inside the card */
    background: #ffffff !important;
    border: 1px solid rgba(226, 232, 240, 0.8) !important;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.04) !important;
    border-radius: 20px !important;
    overflow: visible !important;
}

.mkt-price-card {
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1) !important;
    border: 1px solid rgba(226, 232, 240, 0.6) !important;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%) !important;
}

.mkt-price-card:hover {
    transform: translateY(-5px) !important;
    box-shadow: 0 15px 30px rgba(37, 99, 235, 0.1) !important;
    border-color: rgba(37, 99, 235, 0.3) !important;
}

.mkt-calc-box,
.mkt-advice-card,
.mkt-table-card,
.mkt-chart-card {
    transition: all 0.3s ease !important;
    border: 1px solid rgba(226, 232, 240, 0.6) !important;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%) !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03) !important;
    border-radius: 16px !important;
}

.mkt-calc-box:hover,
.mkt-advice-card:hover,
.mkt-table-card:hover,
.mkt-chart-card:hover {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06) !important;
}

.mkt-calc-box input[type="number"] {
    background: #fff !important;
    padding: 12px 16px !important;
    border: 2px solid #e2e8f0 !important;
    border-radius: 12px !important;
    font-weight: 600 !important;
    color: #0f172a !important;
    transition: all 0.3s ease !important;
}

.mkt-calc-box input[type="number"]:focus {
    border-color: #2563eb !important;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15) !important;
    outline: none !important;
}

.mkt-calc-box button {
    background: linear-gradient(135deg, #059669, #047857) !important;
    border: none !important;
    padding: 14px !important;
    border-radius: 12px !important;
    font-size: 1rem !important;
    font-weight: bold !important;
    color: white !important;
    box-shadow: 0 6px 15px rgba(5, 150, 105, 0.25) !important;
    transition: all 0.2s ease !important;
}

.mkt-calc-box button:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 20px rgba(5, 150, 105, 0.4) !important;
}

@keyframes pulseMLBorder {
    0% {
        box-shadow: 0 0 0 0 rgba(168, 85, 247, 0.4);
        border-color: rgba(168, 85, 247, 0.4);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(168, 85, 247, 0);
        border-color: rgba(168, 85, 247, 0.8);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(168, 85, 247, 0);
        border-color: rgba(168, 85, 247, 0.4);
    }
}

.mkt-ml-banner {
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%) !important;
    color: #e0e7ff !important;
    border: 2px solid rgba(168, 85, 247, 0.5) !important;
    border-radius: 16px !important;
    padding: 24px 30px !important;
    display: flex !important;
    align-items: center !important;
    gap: 20px !important;
    margin-bottom: 24px !important;
    box-shadow: 0 8px 25px rgba(49, 46, 129, 0.4) !important;
    animation: pulseMLBorder 4s infinite ease-in-out !important;
}

.mkt-ml-banner i.fa-brain {
    font-size: 2.5rem !important;
    color: #c084fc !important;
    text-shadow: 0 0 15px rgba(192, 132, 252, 0.8) !important;
    animation: fa-bounce 2s infinite !important;
}

.mkt-ml-banner strong {
    font-size: 1.15rem !important;
    font-weight: 800 !important;
    color: #ffffff !important;
    letter-spacing: 0.5px !important;
    display: block !important;
    margin-bottom: 4px !important;
}

/* Button Upgrades */
.mkt-btn-get {
    background: linear-gradient(135deg, #2563eb, #1d4ed8) !important;
    color: #fff !important;
    border-radius: 12px !important;
    font-weight: bold !important;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.25) !important;
    transition: all 0.3s ease !important;
}

.mkt-btn-get:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.4) !important;
}

/* --- CROP RECOMMENDATION DETAIL MODAL --- */
.crop-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(8px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    padding: 20px;
}

.crop-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.crop-modal-content {
    background: #ffffff;
    width: 100%;
    max-width: 700px;
    max-height: 90vh;
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    padding: 30px;
    position: relative;
    overflow-y: auto;
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.crop-modal-overlay.active .crop-modal-content {
    transform: scale(1);
}

.crop-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid #f1f5f9;
}

.crop-modal-header h3 {
    font-size: 1.4rem;
    font-weight: 800;
    color: #0f172a;
    margin: 0;
}

.close-modal-btn {
    background: #f1f5f9;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s;
    line-height: 1;
}

.close-modal-btn:hover {
    background: #e2e8f0;
    color: #0f172a;
    transform: rotate(90deg);
}

/* --- USER PROFILE MODAL --- */
.profile-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(8px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    padding: 20px;
}

.profile-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.profile-modal-content {
    background: var(--card-bg, #ffffff);
    width: 100%;
    max-width: 850px;
    max-height: 90vh;
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    position: relative;
    overflow-y: auto;
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.profile-modal-overlay.active .profile-modal-content {
    transform: scale(1);
}

.profile-modal-close {
    position: absolute;
    top: 20px;
    right: 25px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #ffffff;
    cursor: pointer;
    transition: all 0.2s;
    line-height: 1;
    z-index: 10;
}

.profile-modal-close:hover {
    background: rgba(255, 255, 255, 0.4);
    color: #ffffff;
    transform: rotate(90deg);
}

/* --- PROFILE MODAL ADDITIONAL STYLES --- */
.profile-modal-body {
    padding: 30px;
}

.profile-modal-header {
    background: linear-gradient(135deg, #10b981, #059669);
    margin: -30px -30px 25px -30px;
    padding: 35px 30px 30px;
    border-radius: 24px 24px 0 0;
    color: white;
    text-align: center;
    position: relative;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.2);
}

.profile-modal-header h2 {
    color: white;
    font-size: 2rem;
    margin-bottom: 10px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.profile-modal-header p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.95rem;
    max-width: 650px;
    margin: 0 auto;
    line-height: 1.5;
}

.profile-section-title {
    font-size: 1.15rem;
    color: var(--primary-dark);
    margin-top: 25px;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
}

.profile-input-row {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.profile-input-row .input-field {
    flex: 1;
    margin-bottom: 0;
}

@media (max-width: 600px) {
    .profile-input-row {
        flex-direction: column;
        gap: 15px;
    }
}

.btn-gps {
    background: #eaf8f2;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    margin-bottom: 25px;
    padding: 10px 18px;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 700;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(46, 204, 113, 0.1);
    cursor: pointer;
}

.btn-gps i {
    font-size: 1.1rem;
}

.btn-gps:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(46, 204, 113, 0.3);
}

/* --- WIZARD STYLES --- */
.profile-progress-container {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    height: 8px;
    width: 100%;
    margin-top: 20px;
    overflow: hidden;
}

.profile-progress-bar {
    background: #ffffff;
    height: 100%;
    border-radius: 10px;
    transition: width 0.4s ease;
}

.form-step {
    animation: fadeIn 0.4s ease;
}

.step-subtitle {
    color: #64748b;
    font-size: 0.95rem;
    margin-bottom: 20px;
    margin-top: -5px;
}

.step-actions {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    margin-top: 30px;
    border-top: 1px solid #e2e8f0;
    padding-top: 20px;
}

.step-prev {
    background: #f8fafc;
    color: #64748b;
    border: 1px solid #e2e8f0;
}

.step-prev:hover {
    background: #e2e8f0;
    color: #0f172a;
}

details.advanced-location {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 20px;
}

details.advanced-location summary {
    font-weight: 600;
    color: #475569;
    cursor: pointer;
    user-select: none;
    outline: none;
}

.visual-chips-container {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 10px;
}

.visual-chip {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    padding: 10px 18px;
    cursor: pointer;
    font-weight: 600;
    color: #475569;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.visual-chip:hover {
    border-color: var(--primary-color);
    background: #f0fdf4;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(46, 204, 113, 0.1);
}

.visual-chip.selected {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(46, 204, 113, 0.3);
    transform: translateY(-2px);
}

.btn-scan {
    background: rgba(46, 204, 113, 0.05);
    color: var(--primary-color);
    border: 2px dashed var(--primary-color);
    border-radius: 12px;
    padding: 15px;
    font-size: 1.05rem;
    font-weight: 700;
    width: 100%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.btn-scan:hover {
    background: rgba(46, 204, 113, 0.15);
    transform: translateY(-2px);
}

.crop-suggestions-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 0 0 12px 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    max-height: 200px;
    overflow-y: auto;
    z-index: 100;
    display: none;
}

.crop-suggestions-dropdown.active {
    display: block;
}

.crop-suggestion-item {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid #f1f5f9;
    color: #334155;
    transition: background 0.2s;
}

.crop-suggestion-item:last-child {
    border-bottom: none;
}

.crop-suggestion-item:hover {
    background: #f8fafc;
    color: var(--primary-color);
    font-weight: 600;
}

/* ═══════════════════════════════════════════════════════════ */
/*  FARM SNAPSHOT PANEL — Rich Profile Dropdown               */
/* ═══════════════════════════════════════════════════════════ */

/* Trigger wrapper — positions the status dot over the icon */
.fsp-trigger {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.fsp-trigger-dot {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #10b981;
    border: 2px solid rgba(255, 255, 255, 0.9);
    display: none;
    /* shown via JS when logged in */
}

.fsp-trigger-dot.active {
    display: block;
}

/* Wider panel */
.farm-snapshot-panel {
    min-width: 300px !important;
    max-width: 320px !important;
    padding: 0 !important;
    overflow: visible !important;
}

/* ─── Header ─── */
.fsp-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: #fff;
    border-radius: 14px 14px 0 0;
    border-bottom: 1px solid #f1f5f9;
}

.fsp-avatar-wrap {
    flex-shrink: 0;
}

.fsp-avatar-icon {
    font-size: 2.4rem;
    color: #cbd5e1;
}

.fsp-user-meta {
    display: flex;
    flex-direction: column;
    gap: 3px;
    overflow: hidden;
}

.fsp-email-text {
    color: #475569;
    font-size: 0.82rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
    line-height: 1.2;
}


/* ─── Guest state ─── */
.guest-upgrade-promo {
    padding: 20px 18px;
    background: #fff;
    display: none;
    text-align: center;
}

.guest-upgrade-promo.active {
    display: block;
}

.fsp-guest-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 16px;
    gap: 8px;
}

.fsp-guest-icon {
    font-size: 2rem;
    color: #10b981;
}

.fsp-guest-text {
    font-size: 0.88rem;
    color: #475569;
    line-height: 1.5;
    font-weight: 500;
}

/* ─── Dividers ─── */
.fsp-divider {
    height: 1px;
    background: #f1f5f9;
    margin: 0;
}

.fsp-divider-slim {
    margin: 0 14px;
}

/* ─── Profile Completion Bar ─── */
.fsp-completion-wrap {
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin-top: 2px;
    width: 130px;
}

.fsp-completion-bar {
    width: 100%;
    height: 3px;
    background: #f1f5f9;
    border-radius: 4px;
    overflow: hidden;
}

.fsp-completion-fill {
    height: 100%;
    background: #10b981;
    border-radius: 4px;
    transition: width 0.5s ease;
}

.fsp-completion-label {
    font-size: 0.65rem;
    font-weight: 600;
    color: #64748b;
    white-space: nowrap;
}

/* ─── Snapshot section ─── */
.fsp-snapshot-section {
    padding: 14px 16px 6px;
}

/* ─── Flat Info Block (replaces nested card) ─── */
.fsp-info-block {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* Crop row: left green accent bar */
.fsp-crop-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 0 8px;
    border-bottom: 1px solid #f1f5f9;
}

.fsp-crop-dot {
    width: 3px;
    min-height: 36px;
    background: linear-gradient(180deg, #10b981, #059669);
    border-radius: 3px;
    flex-shrink: 0;
    margin-top: 2px;
}

.fsp-crop-detail {
    display: flex;
    flex-direction: column;
    gap: 3px;
    overflow: hidden;
    flex: 1;
}

.fsp-crop-name {
    font-size: 1rem;
    font-weight: 800;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}

.fsp-stage-days {
    font-size: 0.77rem;
    font-weight: 600;
    color: #059669;
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.fsp-est-badge {
    font-size: 0.62rem;
    background: #fdf4ff;
    color: #a855f7;
    border: 1px solid #e9d5ff;
    border-radius: 6px;
    padding: 1px 5px;
    font-weight: 700;
    letter-spacing: 0.02em;
}

/* Meta row: location · soil on one line */
.fsp-meta-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 0 4px;
    flex-wrap: wrap;
}

.fsp-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.74rem;
    color: #64748b;
    font-weight: 500;
    min-width: 0;
}

.fsp-meta-item i {
    font-size: 0.65rem;
    color: #94a3b8;
    flex-shrink: 0;
}

.fsp-meta-item span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 110px;
}

.fsp-meta-sep {
    color: #cbd5e1;
    font-size: 0.9rem;
    line-height: 1;
    flex-shrink: 0;
}

/* ─── Value hook ─── */
.fsp-value-hook {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-top: 8px;
    padding: 7px 10px;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 8px;
    font-size: 0.74rem;
    font-weight: 600;
    color: #92400e;
}

.fsp-value-hook i {
    color: #f59e0b;
    font-size: 0.85rem;
    flex-shrink: 0;
}

/* ─── Empty state ─── */
.fsp-empty-state {
    text-align: center;
    padding: 16px 10px 8px;
    color: #94a3b8;
}

.fsp-empty-icon {
    font-size: 1.5rem;
    color: #cbd5e1;
    margin-bottom: 7px;
    display: block;
}

.fsp-empty-state p {
    font-size: 0.82rem;
    margin-bottom: 4px;
}

.fsp-empty-hint {
    font-size: 0.72rem;
    color: #10b981;
    font-weight: 600;
}

/* ─── Actions (3-tier) ─── */
.fsp-actions {
    padding: 12px 14px 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* Tier 1: Primary CTA */
.fsp-cta-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    background: linear-gradient(135deg, #10b981, #059669);
    color: #fff;
    font-size: 0.88rem;
    font-weight: 700;
    border-radius: 10px;
    text-decoration: none;
    box-shadow: 0 3px 10px rgba(16, 185, 129, 0.3);
    transition: all 0.18s ease;
    letter-spacing: 0.01em;
}

.fsp-cta-btn:hover {
    background: linear-gradient(135deg, #059669, #047857);
    box-shadow: 0 5px 14px rgba(16, 185, 129, 0.4);
    transform: translateY(-1px);
    color: #fff;
}

.fsp-cta-btn i {
    font-size: 0.8rem;
}

/* Tier 2: Secondary link */
.fsp-secondary-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 600;
    color: #475569;
    transition: all 0.15s ease;
}

.fsp-secondary-link:hover {
    background: #f8fafc;
    color: #059669;
}

.fsp-secondary-link i {
    font-size: 0.78rem;
    color: #94a3b8;
    transition: color 0.15s;
}

.fsp-secondary-link:hover i {
    color: #059669;
}

/* Tier 3: Tertiary danger */
.fsp-tertiary-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 0.78rem;
    font-weight: 500;
    color: #94a3b8;
    transition: all 0.15s ease;
    border-top: 1px solid #f8fafc;
    margin-top: 2px;
}

.fsp-tertiary-link:hover {
    background: #fef2f2;
    color: #dc2626;
}

.fsp-tertiary-link i {
    font-size: 0.75rem;
    color: #fca5a5;
    transition: color 0.15s;
}

.fsp-tertiary-link:hover i {
    color: #dc2626;
}

/* Hide old/stale class references */
.farm-snapshot-panel .dropdown-link {
    display: none !important;
}

.fsp-sec-btn,
.fsp-secondary-actions,
.fsp-action-item,
.fsp-primary-block,
.fsp-secondary-row,
.fsp-snapshot-title {
    display: none !important;
}

/* ^ safety: hide old class names if any linger in DOM */

/* Guest mode */
.dropdown-content.guest-active .fsp-snapshot-section,
.dropdown-content.guest-active .fsp-actions,
.dropdown-content.guest-active .fsp-divider,
.dropdown-content.guest-active .fsp-header {
    display: none !important;
}



/* ─── Snapshot section ─── */
.fsp-snapshot-section {
    padding: 14px 18px 10px;
}

.fsp-snapshot-title {
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #059669;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 12px;
}

.fsp-snapshot-title i {
    font-size: 0.85rem;
}

/* ─── Primary Crop Hero Block ─── */
.fsp-primary-block {
    background: linear-gradient(135deg, #f0fdf4, #ecfdf5);
    border: 1px solid #bbf7d0;
    border-radius: 12px;
    padding: 12px 14px 10px;
    margin-bottom: 10px;
}

.fsp-crop-hero {
    display: flex;
    align-items: center;
    gap: 11px;
    margin-bottom: 10px;
}

.fsp-crop-icon {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, #10b981, #059669);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: #fff;
    flex-shrink: 0;
    box-shadow: 0 3px 8px rgba(16, 185, 129, 0.3);
}

.fsp-crop-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
    overflow: hidden;
}

.fsp-crop-name {
    font-size: 1.05rem;
    font-weight: 800;
    color: #064e3b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}

.fsp-stage-days {
    font-size: 0.78rem;
    font-weight: 600;
    color: #059669;
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.fsp-est-badge {
    font-size: 0.64rem;
    background: #fdf4ff;
    color: #a855f7;
    border: 1px solid #e9d5ff;
    border-radius: 8px;
    padding: 1px 5px;
    font-weight: 700;
    letter-spacing: 0.02em;
}

/* ─── Secondary Row (location + soil) ─── */
.fsp-secondary-row {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding-top: 8px;
    border-top: 1px dashed #bbf7d0;
}

.fsp-secondary-item {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 0.78rem;
    color: #475569;
    font-weight: 500;
}

.fsp-secondary-item i {
    font-size: 0.72rem;
    color: #10b981;
    width: 14px;
    text-align: center;
    flex-shrink: 0;
}

.fsp-secondary-item span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 210px;
}


/* ─── Empty state ─── */
.fsp-empty-state {
    text-align: center;
    padding: 16px 10px;
    color: #94a3b8;
}

.fsp-empty-icon {
    font-size: 1.6rem;
    color: #cbd5e1;
    margin-bottom: 8px;
    display: block;
}

.fsp-empty-state p {
    font-size: 0.82rem;
    margin-bottom: 4px;
}

.fsp-empty-hint {
    font-size: 0.72rem;
    color: #10b981;
    font-weight: 600;
}

/* ─── Actions ─── */
.fsp-actions {
    padding: 14px 14px 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Primary CTA Button */
.fsp-cta-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 11px 16px;
    background: linear-gradient(135deg, #10b981, #059669);
    color: #fff;
    font-size: 0.9rem;
    font-weight: 700;
    border-radius: 11px;
    text-decoration: none;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
    transition: all 0.2s ease;
    letter-spacing: 0.01em;
}

.fsp-cta-btn:hover {
    background: linear-gradient(135deg, #059669, #047857);
    box-shadow: 0 6px 18px rgba(16, 185, 129, 0.45);
    transform: translateY(-1px);
    color: #fff;
}

.fsp-cta-btn i {
    font-size: 0.85rem;
}

/* Secondary actions row */
.fsp-secondary-actions {
    display: flex;
    gap: 6px;
}

.fsp-sec-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 10px;
    border-radius: 9px;
    text-decoration: none;
    font-size: 0.78rem;
    font-weight: 600;
    color: #475569;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    transition: all 0.18s ease;
    text-align: center;
}

.fsp-sec-btn:hover {
    background: #f1f5f9;
    color: #1e293b;
    border-color: #cbd5e1;
}

.fsp-sec-btn i {
    font-size: 0.78rem;
    color: #94a3b8;
}

.fsp-sec-btn:hover i {
    color: #059669;
}

.fsp-sec-danger {
    color: #dc2626;
}

.fsp-sec-danger:hover {
    background: #fef2f2;
    color: #b91c1c;
    border-color: #fca5a5;
}

.fsp-sec-danger i {
    color: #ef4444;
}

.fsp-sec-danger:hover i {
    color: #b91c1c;
}


/* Hide old dropdown-link references if any stale ones exist */
.farm-snapshot-panel .dropdown-link {
    display: none !important;
}

/* Guest mode: hide snapshot fields and action buttons */
.dropdown-content.guest-active .fsp-snapshot-section,
.dropdown-content.guest-active .fsp-actions,
.dropdown-content.guest-active .fsp-divider,
.dropdown-content.guest-active .fsp-header {
    display: none !important;
}


/* ═══════════════════════════════════════════════════════════ */
/*  QUICK EDIT PROFILE MODAL                                   */
/* ═══════════════════════════════════════════════════════════ */

.qe-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.qe-overlay.active {
    display: flex;
}

.qe-card {
    background: #fff;
    border-radius: 20px;
    width: 100%;
    max-width: 460px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(255, 255, 255, 0.1);
    animation: qeSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    max-height: 90vh;
    overflow-y: auto;
    overflow-x: hidden;
}

@keyframes qeSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.97);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.qe-overlay.closing .qe-card {
    animation: qeSlideOut 0.2s ease forwards;
}

@keyframes qeSlideOut {
    to {
        opacity: 0;
        transform: translateY(16px) scale(0.97);
    }
}

/* Header */
.qe-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 22px 16px;
    border-bottom: 1px solid #f1f5f9;
    background: linear-gradient(135deg, #064e3b, #065f46);
    border-radius: 20px 20px 0 0;
}

.qe-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.qe-header-icon {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #a7f3d0;
    font-size: 0.9rem;
}

.qe-card-header h3 {
    color: #fff;
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0;
}

.qe-close-btn {
    background: rgba(255, 255, 255, 0.12);
    border: none;
    color: #a7f3d0;
    font-size: 1.3rem;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    line-height: 1;
}

.qe-close-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
}

/* Body */
.qe-card-body {
    padding: 22px 22px 10px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.qe-field-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.qe-label {
    font-size: 0.82rem;
    font-weight: 700;
    color: #374151;
    display: flex;
    align-items: center;
    gap: 6px;
}

.qe-label i {
    color: #10b981;
}

.qe-optional-badge {
    font-size: 0.65rem;
    background: #f0fdf4;
    color: #059669;
    border: 1px solid #bbf7d0;
    border-radius: 10px;
    padding: 1px 7px;
    font-weight: 600;
    letter-spacing: 0.03em;
}

.qe-input {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    font-size: 0.9rem;
    color: #1e293b;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    background: #fafafa;
    box-sizing: border-box;
    font-family: inherit;
}

.qe-input:focus {
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
    background: #fff;
}

select.qe-input {
    cursor: pointer;
}

.qe-autocomplete-wrap {
    position: relative;
}

.qe-days-live {
    font-size: 0.78rem;
    font-weight: 600;
    color: #059669;
    padding: 4px 10px;
    background: #ecfdf5;
    border-radius: 8px;
    border: 1px solid #d1fae5;
    display: none;
}

.qe-days-live.visible {
    display: block;
}

.qe-hint-text {
    font-size: 0.75rem;
    color: #94a3b8;
    display: flex;
    align-items: flex-start;
    gap: 5px;
    line-height: 1.4;
    margin: 0;
}

.qe-hint-text i {
    margin-top: 2px;
    color: #10b981;
    flex-shrink: 0;
}

/* Soil chips inside QE modal */
.qe-soil-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.qe-chip {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    background: #f1f5f9;
    color: #475569;
    cursor: pointer;
    border: 1.5px solid transparent;
    transition: all 0.18s ease;
    user-select: none;
}

.qe-chip:hover {
    background: #e2e8f0;
    color: #1e293b;
}

.qe-chip.selected {
    background: #d1fae5;
    color: #059669;
    border-color: #6ee7b7;
}

/* Footer */
.qe-card-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 22px 20px;
    border-top: 1px solid #f1f5f9;
}

.qe-btn-cancel {
    padding: 10px 20px;
    border-radius: 10px;
    border: 1.5px solid #e2e8f0;
    background: #fff;
    color: #64748b;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.qe-btn-cancel:hover {
    background: #f8fafc;
    color: #374151;
    border-color: #cbd5e1;
}

.qe-btn-save {
    padding: 10px 22px;
    border-radius: 10px;
    border: none;
    background: linear-gradient(135deg, #10b981, #059669);
    color: #fff;
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 7px;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
    transition: all 0.2s ease;
}

.qe-btn-save:hover {
    background: linear-gradient(135deg, #059669, #047857);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4);
}

.qe-btn-save:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Responsive */
@media (max-width: 480px) {
    .farm-snapshot-panel {
        min-width: 280px !important;
        max-width: 290px !important;
        right: -60px !important;
    }

    .qe-card {
        border-radius: 14px;
    }

    .qe-card-header {
        border-radius: 14px 14px 0 0;
    }
}

/* --- DISEASE MODULE PREMIUM ENHANCEMENTS --- */
.disease-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
}

.disease-card-premium {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 24px;
    padding: 50px 45px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.1);
    animation: slideUp 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}

.disease-header-v2 {
    text-align: center;
    margin-bottom: 40px;
}

.disease-header-v2 h1 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 2.8rem;
    font-weight: 800;
    background: linear-gradient(135deg, #064e3b 0%, #059669 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 12px;
}

.disease-header-v2 p {
    color: #64748b;
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

.upload-zone-premium {
    position: relative;
    border: 3px dashed #cbd5e1;
    border-radius: 20px;
    padding: 60px 40px;
    text-align: center;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(248, 250, 252, 0.5);
    cursor: pointer;
    overflow: hidden;
}

.upload-zone-premium:hover,
.upload-zone-premium.drag-active {
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.05);
    transform: translateY(-4px);
    box-shadow: 0 10px 30px rgba(16, 185, 129, 0.1);
}

.upload-icon-v2 {
    font-size: 4rem;
    color: #10b981;
    margin-bottom: 20px;
    transition: transform 0.4s ease;
}

.upload-zone-premium:hover .upload-icon-v2 {
    transform: scale(1.1) rotate(5deg);
}

.upload-actions-v2 {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-top: 30px;
    flex-wrap: wrap;
}

.btn-upload-v2 {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 28px;
    border-radius: 12px;
    font-weight: 700;
    transition: all 0.3s;
    border: none;
    cursor: pointer;
}

.btn-primary-v2 {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.btn-secondary-v2 {
    background: white;
    color: #064e3b;
    border: 2px solid #e2e8f0;
}

.btn-upload-v2:hover {
    transform: translateY(-2px);
    filter: brightness(1.05);
}

/* Result Styles Refined */
.result-card-v2 {
    background: white;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(226, 232, 240, 0.8);
    margin-top: 40px;
    animation: slideUp 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.result-header-v2 {
    padding: 35px 45px;
    display: flex;
    align-items: center;
    gap: 28px;
}

.result-header-v2.healthy {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border-bottom: 4px solid #10b981;
}

.result-header-v2.disease {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    border-bottom: 4px solid #ef4444;
}

.result-header-v2.invalid {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border-bottom: 4px solid #f59e0b;
}

.result-icon-v2 {
    width: 68px;
    height: 68px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    flex-shrink: 0;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
}

.healthy .result-icon-v2 {
    background: white;
    color: #10b981;
}

.disease .result-icon-v2 {
    background: white;
    color: #ef4444;
}

.invalid .result-icon-v2 {
    background: white;
    color: #f59e0b;
}

.result-body-v2 {
    padding: 45px;
}

.result-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 30px;
    margin-bottom: 35px;
}

.info-item-v2 {
    background: #f8fafc;
    padding: 24px;
    border-radius: 18px;
    border: 1px solid #f1f5f9;
    transition: transform 0.3s ease;
}

.info-item-v2:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.03);
}

.info-label-v2 {
    display: block;
    font-size: 0.8rem;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 12px;
}

.info-value-v2 {
    display: block;
    font-size: 1.35rem;
    font-weight: 800;
    color: #1e293b;
    line-height: 1.2;
}

.accuracy-container-v2 {
    margin-bottom: 40px;
}

.accuracy-label-v2 {
    display: flex;
    justify-content: space-between;
    margin-bottom: 14px;
    font-weight: 700;
    color: #64748b;
    font-size: 0.95rem;
}

.accuracy-bar-v2 {
    height: 18px;
    background: #f1f5f9;
    border-radius: 20px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

.remedy-card-v2 {
    background: #f8fafc;
    border-radius: 20px;
    padding: 35px 40px;
    border-left: 8px solid #f59e0b;
    margin-top: 40px;
    position: relative;
}

.remedy-card-v2 h4 {
    display: flex;
    align-items: center;
    gap: 14px;
    color: #92400e;
    margin-bottom: 20px;
    font-weight: 800;
    font-size: 1.2rem;
}

.remedy-content-v2 {
    color: #475569;
    font-size: 1.1rem;
    line-height: 1.8;
    margin: 0;
}

.gemini-btn {
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.gemini-btn:hover {
    transform: scale(1.02);
    box-shadow: 0 12px 30px rgba(16, 185, 129, 0.4);
}

/* Scanner Animation */
.scanner-container-v2 {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
}

.scanner-beam-v2 {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom,
            transparent 0%,
            rgba(16, 185, 129, 0.2) 50%,
            #10b981 50.5%,
            rgba(16, 185, 129, 0.2) 51%,
            transparent 100%);
    background-size: 100% 200%;
    z-index: 5;
    animation: scanningV2 2.5s infinite linear;
    display: none;
}

@keyframes scanningV2 {
    0% {
        transform: translateY(-100%);
    }

    100% {
        transform: translateY(100%);
    }
}

/* === Market Table Interactivity & Animations === */

.mkt-animate-fade {
    opacity: 0;
    transform: translateY(10px);
    animation: fadeUpIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1) forwards;
}

@keyframes fadeUpIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.mkt-col {
    transition: all 0.2s ease;
    cursor: pointer;
    border-radius: 4px;
}

.mkt-col:hover {
    background-color: #f1f5f9;
    transform: scale(1.05);
    font-weight: 700;
    color: #0f172a;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.mkt-current-month {
    background-color: #f0fdf4 !important;
    border: 1px solid #bbf7d0 !important;
    color: #166534 !important;
    font-weight: 700 !important;
}

.mkt-current-month:hover {}

/* === CUSTOM SEARCHABLE SELECT (single-input architecture) === */

.custom-select {
    position: relative;
    width: 100%;
    display: block;
}

.custom-select-input {
    width: 100%;
    min-height: 48px;
    padding: 12px 40px 12px 16px;
    font-size: 0.95rem;
    font-weight: 500;
    color: #1e293b;
    background: #ffffff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M7.5 1a6.5 6.5 0 1 0 4.473 11.187l2.92 2.92a.75.75 0 1 0 1.06-1.06l-2.92-2.921A6.5 6.5 0 0 0 7.5 1zm-5 6.5a5 5 0 1 1 10 0 5 5 0 0 1-10 0z'/%3E%3C/svg%3E") no-repeat right 14px center;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    outline: none;
    cursor: text;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
    user-select: none;
}

.custom-select-input:focus,
.custom-select.open .custom-select-input {
    border-color: #2563eb;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.custom-select-input::placeholder {
    color: #94a3b8;
    font-weight: 400;
}

.custom-select-menu {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    box-sizing: border-box;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    flex-direction: column;
    animation: dropdownSlideIn 0.15s ease forwards;
}

.custom-select.open .custom-select-menu {
    display: flex;
}

@keyframes dropdownSlideIn {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.custom-select-options {
    overflow-y: auto;
    padding: 6px;
    max-height: 200px;
    /* scrollable options area — search bar sits above this */
    /* Custom Scrollbar */
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}

.custom-select-options::-webkit-scrollbar {
    width: 6px;
}

.custom-select-options::-webkit-scrollbar-thumb {
    background-color: #cbd5e1;
    border-radius: 10px;
}

.custom-select-option {
    padding: 10px 14px;
    margin-bottom: 2px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95rem;
    color: #334155;
    transition: all 0.2s;
    min-height: 44px;
    /* Touch friendly */
    display: flex;
    align-items: center;
}

.custom-select-option:hover {
    background: #e0f2fe;
    color: #0369a1;
}

.custom-select-option.selected {
    background: #2563eb;
    color: #ffffff;
    font-weight: 600;
}

.custom-select-option.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f8fafc;
    color: #94a3b8;
}

.custom-select-option.disabled:hover {
    background: #f8fafc;
    color: #94a3b8;
}

.custom-select-no-results {
    padding: 12px;
    text-align: center;
    color: #64748b;
    font-size: 0.9rem;
    font-style: italic;
}

@media (max-width: 768px) {

    .custom-select,
    .custom-select-input {
        width: 100%;
    }

    .custom-select-option {
        font-size: 1.05rem;
        padding: 14px;
    }
}

/* Keyboard navigation highlight */
.custom-select-option.keyboard-highlight {
    background: #dbeafe;
    color: #1d4ed8;
    border-left: 3px solid #2563eb;
    font-weight: 600;
}

.mkt-module-wrap,
.mkt-select-bar,
.mkt-select-row,
.mkt-select-group,
.form-container {
    overflow: visible !important;
}

.custom-select-search {
    height: 40px;
    flex-shrink: 0;
}

/* ==================================================
   MOBILE-FIRST RESPONSIVENESS & TOUCH OPTIMIZATION
   ================================================== */
@media (max-width: 768px) {
    /* Touch Target Optimization */
    .custom-select-input, 
    .mkt-select-group select,
    .irri-form-group input,
    .irri-form-group select {
        padding: 12px 16px !important;
        font-size: 16px !important; /* Prevents iOS auto-zoom */
    }

    /* Vertical Stacking for Market UI */
    .mkt-select-row {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 15px !important;
    }
    
    .mkt-fetch-btn {
        width: 100%;
        margin-top: 10px;
        padding: 14px !important;
    }

    /* Market Prediction Cards Stacking */
    .mkt-cards-grid,
    .mkt-advisory-grid {
        grid-template-columns: 1fr !important;
        gap: 15px !important;
    }

    /* Chart Readability Fixes */
    .mkt-chart-wrap,
    .mkt-chart-card canvas {
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        min-height: 250px !important;
    }

    /* Intelligence Card text wrapping */
    .mkt-intelligence-card {
        padding: 12px !important;
    }
    
    .mkt-intelligence-card p {
        word-break: break-word;
        font-size: 0.9rem !important;
    }

    /* Live Monitoring Dashboard Mobile Fix */
    #live-traffic-content {
        flex-direction: column !important;
        gap: 15px !important;
    }
    
    #live-traffic-content > div {
        width: 100%;
    }
}
/* ================================================================
   MARKET PRICE MODULE — PREMIUM LOCATION PAGE (v3)
   ================================================================ */

/* ── Page wrapper ─────────────────────────────────────────────── */
.mkt-loc-page {
    padding: 0;
    min-height: 100%;
}

/* ── Back link ────────────────────────────────────────────────── */
.mkt-back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    margin: 16px 0 20px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #4b5563;
    background: rgba(255,255,255,0.7);
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 40px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
    backdrop-filter: blur(8px);
}
.mkt-back-link:hover {
    background: #fff;
    color: #111;
    transform: translateX(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

/* ── Hero v2 ──────────────────────────────────────────────────── */
.mkt-hero-v2 {
    position: relative;
    background: linear-gradient(135deg, #0f4c81 0%, #1a73e8 45%, #0d9488 100%);
    border-radius: 20px;
    padding: 36px 40px;
    margin-bottom: 20px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(26, 115, 232, 0.35), 0 2px 8px rgba(0,0,0,0.12);
}
.mkt-hero-v2::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 20% 50%, rgba(255,255,255,0.1) 0%, transparent 60%),
                radial-gradient(ellipse at 80% 20%, rgba(13,148,136,0.3) 0%, transparent 50%);
    pointer-events: none;
}
.mkt-hero-v2-glow {
    position: absolute;
    top: -30px; right: -30px;
    width: 200px; height: 200px;
    background: radial-gradient(circle, rgba(255,255,255,0.12) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}
.mkt-hero-v2-content {
    position: relative;
    z-index: 2;
}
.mkt-hero-v2-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255,255,255,0.18);
    border: 1px solid rgba(255,255,255,0.28);
    color: #fff;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 5px 14px;
    border-radius: 40px;
    margin-bottom: 14px;
    backdrop-filter: blur(6px);
}
.mkt-hero-v2-badge i { font-size: 0.7rem; }
.mkt-hero-v2-title {
    margin: 0 0 10px;
    font-size: 2rem;
    font-weight: 800;
    color: #fff;
    line-height: 1.15;
    letter-spacing: -0.02em;
    text-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.mkt-hero-v2-sub {
    margin: 0 0 18px;
    font-size: 0.95rem;
    color: rgba(255,255,255,0.82);
    line-height: 1.6;
    max-width: 520px;
}
.mkt-hero-v2-tags {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.mkt-hero-v2-tags span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    color: rgba(255,255,255,0.9);
    background: rgba(255,255,255,0.14);
    border: 1px solid rgba(255,255,255,0.22);
    padding: 4px 12px;
    border-radius: 20px;
}
.mkt-hero-v2-tags span i { font-size: 0.72rem; }
.mkt-hero-v2-chart-bg {
    position: absolute;
    bottom: 0; right: 0;
    width: 280px; height: 100%;
    pointer-events: none;
    opacity: 0.6;
}
.mkt-hero-v2-chart-bg svg {
    width: 100%; height: 100%;
}

/* ── Glassmorphism Location Card ──────────────────────────────── */
.mkt-loc-glass {
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.9);
    border-radius: 20px;
    padding: 32px 36px;
    max-width: 580px;
    margin: 0 auto;
    box-shadow:
        0 4px 24px rgba(0,0,0,0.07),
        0 1px 4px rgba(0,0,0,0.05),
        inset 0 1px 0 rgba(255,255,255,0.95);
}

/* ── Location Header ──────────────────────────────────────────── */
.mkt-loc-header {
    text-align: center;
    margin-bottom: 28px;
}
.mkt-loc-icon-ring {
    width: 64px; height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, #dcfce7, #bbf7d0);
    border: 2px solid #86efac;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    box-shadow: 0 4px 16px rgba(22,163,74,0.18);
}
.mkt-loc-icon-ring i {
    font-size: 1.4rem;
    color: #15803d;
}
.mkt-loc-title {
    margin: 0 0 10px;
    font-size: 1.45rem;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.02em;
}
.mkt-loc-desc {
    margin: 0;
    font-size: 0.9rem;
    color: #6b7280;
    line-height: 1.65;
}
.mkt-loc-desc strong { color: #374151; }

/* ── Actions area ─────────────────────────────────────────────── */
.mkt-loc-actions {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* ── Divider ──────────────────────────────────────────────────── */
.mkt-loc-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 10px 0;
    color: #9ca3af;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.mkt-loc-divider::before,
.mkt-loc-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e5e7eb;
}
.mkt-loc-divider span { white-space: nowrap; }

/* ── PRIMARY option: Use My Farm Location ─────────────────────── */
.mkt-loc-opt {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 16px 20px;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.22s cubic-bezier(0.4,0,0.2,1);
    margin-bottom: 10px;
    text-decoration: none;
}
.mkt-loc-primary {
    background: linear-gradient(135deg, #f0fdf4, #dcfce7);
    border: 1.5px solid #86efac;
    box-shadow: 0 4px 16px rgba(22,163,74,0.12);
}
.mkt-loc-primary:hover {
    transform: translateY(-2px);
    border-color: #16a34a;
    box-shadow: 0 8px 24px rgba(22,163,74,0.22);
    background: linear-gradient(135deg, #dcfce7, #bbf7d0);
}
.mkt-loc-opt-icon {
    width: 42px; height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1rem;
}
.mkt-loc-icon-primary {
    background: linear-gradient(135deg, #16a34a, #059669);
    color: #fff;
    box-shadow: 0 4px 12px rgba(22,163,74,0.3);
}
.mkt-loc-opt-body { flex: 1; min-width: 0; }
.mkt-loc-opt-title {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 0.96rem;
    font-weight: 700;
    color: #15803d;
    margin-bottom: 3px;
}
.mkt-loc-opt-title i { color: #16a34a; font-size: 0.9rem; }
.mkt-loc-opt-sub {
    font-size: 0.82rem;
    color: #4ade80;
    color: #16a34a;
    font-weight: 500;
}
.mkt-loc-coords {
    color: #6b7280;
    font-size: 0.78rem;
    font-weight: 400;
}
.mkt-loc-arrow {
    color: #16a34a;
    font-size: 0.9rem;
    transition: transform 0.2s ease;
}
.mkt-loc-primary:hover .mkt-loc-arrow {
    transform: translateX(3px);
}

/* ── Shared button base ───────────────────────────────────────── */
.mkt-loc-btn {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 14px 20px;
    border-radius: 13px;
    border: none;
    cursor: pointer;
    transition: all 0.22s cubic-bezier(0.4,0,0.2,1);
    text-align: left;
    font-family: inherit;
    margin-bottom: 10px;
}
.mkt-loc-btn-icon {
    width: 40px; height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1rem;
    transition: transform 0.2s ease;
}
.mkt-loc-btn:hover .mkt-loc-btn-icon {
    transform: scale(1.1);
}
.mkt-loc-btn-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.mkt-loc-btn-label {
    font-size: 0.94rem;
    font-weight: 700;
    display: block;
}
.mkt-loc-btn-hint {
    font-size: 0.78rem;
    font-weight: 400;
    opacity: 0.75;
    display: block;
}

/* ── SECONDARY button: Auto-Detect ───────────────────────────── */
.mkt-loc-btn-secondary {
    background: linear-gradient(135deg, #1a73e8, #1d4ed8);
    color: #fff;
    box-shadow: 0 4px 16px rgba(26,115,232,0.28);
}
.mkt-loc-btn-secondary .mkt-loc-btn-icon {
    background: rgba(255,255,255,0.2);
    color: #fff;
}
.mkt-loc-btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(26,115,232,0.38);
}
.mkt-loc-btn-secondary:active {
    transform: translateY(0);
}

/* ── TERTIARY button: Enter Manually ─────────────────────────── */
.mkt-loc-btn-tertiary {
    background: #fff;
    color: #374151;
    border: 1.5px solid #e5e7eb;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
    align-items: center;
}
.mkt-loc-btn-tertiary .mkt-loc-btn-icon {
    background: #f9fafb;
    color: #6b7280;
    border: 1px solid #e5e7eb;
}
.mkt-loc-btn-tertiary:hover {
    border-color: #9ca3af;
    background: #f9fafb;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.mkt-manual-chevron {
    color: #9ca3af;
    font-size: 0.8rem;
    transition: transform 0.25s ease;
}
.mkt-manual-chevron.open {
    transform: rotate(180deg);
}

/* ── Manual Coordinate inputs ─────────────────────────────────── */
.mkt-manual-inputs {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 18px;
    margin-bottom: 10px;
    animation: mktSlideDown 0.25s ease;
}
@keyframes mktSlideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}
.mkt-manual-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 14px;
}
.mkt-manual-field label {
    display: block;
    font-size: 0.8rem;
    font-weight: 700;
    color: #374151;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.mkt-manual-field input {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid #d1d5db;
    border-radius: 10px;
    font-size: 0.9rem;
    font-family: inherit;
    background: #fff;
    color: #111827;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}
.mkt-manual-field input:focus {
    border-color: #1a73e8;
    box-shadow: 0 0 0 3px rgba(26,115,232,0.12);
}
.mkt-loc-btn-confirm {
    background: linear-gradient(135deg, #0d9488, #059669);
    color: #fff;
    border: none;
    box-shadow: 0 4px 12px rgba(13,148,136,0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 0.92rem;
    font-weight: 700;
    width: 100%;
    cursor: pointer;
    transition: all 0.2s ease;
}
.mkt-loc-btn-confirm:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(13,148,136,0.35);
}

/* ── Status message ───────────────────────────────────────────── */
.mkt-loc-status {
    text-align: center;
    font-size: 0.86rem;
    min-height: 24px;
    padding: 4px 0;
}
.mkt-loc-status .err { color: #ef4444; }

/* ── Trust footer ─────────────────────────────────────────────── */
.mkt-loc-trust {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    flex-wrap: wrap;
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid #f1f5f9;
}
.mkt-loc-trust span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.76rem;
    font-weight: 600;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.mkt-loc-trust span i {
    font-size: 0.72rem;
    color: #10b981;
}

/* ── Mobile ───────────────────────────────────────────────────── */
@media (max-width: 640px) {
    .mkt-hero-v2 {
        padding: 24px 22px;
        border-radius: 16px;
    }
    .mkt-hero-v2-title { font-size: 1.5rem; }
    .mkt-hero-v2-sub { font-size: 0.85rem; }
    .mkt-hero-v2-chart-bg { display: none; }
    .mkt-loc-glass {
        padding: 22px 18px;
        border-radius: 16px;
    }
    .mkt-manual-grid { grid-template-columns: 1fr; }
    .mkt-loc-trust { gap: 12px; }
    .mkt-hero-v2-tags { gap: 7px; }
    .mkt-loc-btn { padding: 13px 16px; }
    .mkt-loc-opt { padding: 14px 16px; }
}

/* ================================================================
   MARKET LOCATION PAGE — COMPACT OVERRIDE (v3.1)
   Reduces scale ~20% across all sections for dashboard density
   ================================================================ */

/* ── Back link — tighter ─────────────────────────────────────── */
.mkt-back-link {
    padding: 6px 14px;
    margin: 10px 0 14px;
    font-size: 0.82rem;
}

/* ── Hero v2 — compact ───────────────────────────────────────── */
.mkt-hero-v2 {
    padding: 22px 28px;
    border-radius: 16px;
    margin-bottom: 12px;
}
.mkt-hero-v2-badge {
    font-size: 0.72rem;
    padding: 4px 11px;
    margin-bottom: 9px;
}
.mkt-hero-v2-title {
    font-size: 1.55rem;
    margin-bottom: 6px;
}
.mkt-hero-v2-sub {
    font-size: 0.86rem;
    margin-bottom: 12px;
    line-height: 1.5;
}
.mkt-hero-v2-tags {
    gap: 7px;
}
.mkt-hero-v2-tags span {
    font-size: 0.73rem;
    padding: 3px 10px;
}

/* ── Glass card — compact ────────────────────────────────────── */
.mkt-loc-glass {
    padding: 20px 26px;
    border-radius: 16px;
    max-width: 560px;
}

/* ── Location header — compact ───────────────────────────────── */
.mkt-loc-header {
    margin-bottom: 18px;
}
.mkt-loc-icon-ring {
    width: 48px;
    height: 48px;
    margin-bottom: 10px;
}
.mkt-loc-icon-ring i {
    font-size: 1.15rem;
}
.mkt-loc-title {
    font-size: 1.2rem;
    margin-bottom: 6px;
}
.mkt-loc-desc {
    font-size: 0.84rem;
    line-height: 1.55;
}

/* ── Primary farm location option — compact ──────────────────── */
.mkt-loc-opt {
    padding: 11px 16px;
    border-radius: 11px;
    margin-bottom: 6px;
}
.mkt-loc-opt-icon {
    width: 36px;
    height: 36px;
    font-size: 0.88rem;
}
.mkt-loc-opt-title {
    font-size: 0.88rem;
    margin-bottom: 2px;
}
.mkt-loc-opt-sub {
    font-size: 0.77rem;
}
.mkt-loc-coords {
    font-size: 0.73rem;
}

/* ── Divider — compact ───────────────────────────────────────── */
.mkt-loc-divider {
    margin: 6px 0;
    font-size: 0.7rem;
}

/* ── All buttons — compact ───────────────────────────────────── */
.mkt-loc-btn {
    padding: 10px 16px;
    border-radius: 11px;
    gap: 11px;
    margin-bottom: 6px;
}
.mkt-loc-btn-icon {
    width: 34px;
    height: 34px;
    font-size: 0.88rem;
}
.mkt-loc-btn-label {
    font-size: 0.88rem;
}
.mkt-loc-btn-hint {
    font-size: 0.73rem;
}

/* ── Manual inputs — compact ─────────────────────────────────── */
.mkt-manual-inputs {
    padding: 14px;
    border-radius: 10px;
    margin-bottom: 6px;
}
.mkt-manual-grid {
    gap: 10px;
    margin-bottom: 10px;
}
.mkt-manual-field label {
    font-size: 0.74rem;
    margin-bottom: 4px;
}
.mkt-manual-field input {
    padding: 9px 12px;
    font-size: 0.86rem;
    border-radius: 9px;
}
.mkt-loc-btn-confirm {
    padding: 10px 16px;
    font-size: 0.86rem;
    border-radius: 9px;
}

/* ── Trust row — compact ─────────────────────────────────────── */
.mkt-loc-trust {
    margin-top: 14px;
    padding-top: 12px;
    gap: 14px;
}
.mkt-loc-trust span {
    font-size: 0.7rem;
    gap: 4px;
}
.mkt-loc-trust span i {
    font-size: 0.66rem;
}

/* ── Status — compact ────────────────────────────────────────── */
.mkt-loc-status {
    font-size: 0.82rem;
    min-height: 18px;
}

/* ── Responsive compact ──────────────────────────────────────── */
@media (max-width: 640px) {
    .mkt-hero-v2 {
        padding: 18px 16px;
    }
    .mkt-hero-v2-title { font-size: 1.25rem; }
    .mkt-loc-glass { padding: 16px 14px; }
    .mkt-loc-title { font-size: 1.08rem; }
    .mkt-loc-trust { flex-direction: column; align-items: center; gap: 7px; }
}

/* ── Read-only location display in crop step select bar ────────── */
.mkt-loc-readonly {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 10px 14px;
    background: #f0fdf4;
    border: 1.5px solid #86efac;
    border-radius: 10px;
    font-size: 0.87rem;
    font-weight: 600;
    color: #15803d;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    cursor: default;
    box-shadow: 0 1px 4px rgba(22,163,74,0.1);
}
.mkt-loc-readonly span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #15803d;
}
/* Global Back to Modules Button */
.global-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.95rem;
    color: #10b981;
    background: rgba(16, 185, 129, 0.1);
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.05);
    font-family: 'Outfit', sans-serif;
}

.global-back-btn:hover {
    background: #10b981;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.global-back-btn:active {
    transform: translateY(0);
}

.global-back-btn i {
    transition: transform 0.3s ease;
}

.global-back-btn:hover i {
    transform: translateX(-4px);
}

/* --- MOBILE FIXES FOR FARMER SUPPORT HUB CONTAINERS --- */
@media (max-width: 768px) {
    /* Reduce the massive double-padding that causes right-side clipping */
    .support-module-section {
        padding: 20px 10px !important;
    }
    
    .schemes-section-bg .container,
    .p2p-section-bg .container,
    .p2p-donor-section-bg .container,
    .p2p-farmer-section-bg .container,
    .p2p-admin-section-bg .container,
    .support-module-section .container {
        padding: 12px !important;
    }

    /* Fix search pill forcing container to expand horizontally */
    .scheme-search-pill {
        min-width: 0 !important;
        width: 100%;
    }

    /* Tweak hero headers to fit better */
    .schemes-hero-header,
    .p2p-hero-header {
        padding: 20px 15px !important;
        gap: 15px !important;
    }
}

/* ── Global Overflow Prevention ── */
html, body {
    overflow-x: hidden;
    max-width: 100%;
}

/* ── Mobile: Crop/Tool Page Fixes ── */
@media (max-width: 768px) {
    /* Prevent title from overflowing viewport */
    .form-header h1 {
        font-size: 1.6rem !important;
        word-break: break-word;
    }

    .form-header h2 {
        font-size: 1.4rem !important;
        word-break: break-word;
    }

    /* Ensure form-container doesn't overflow */
    .form-container {
        padding: 18px !important;
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box;
    }

    .tool-page-container {
        padding: 10px !important;
        align-items: flex-start;
        padding-top: 80px !important; /* Fix overlap with header */
    }

    /* Services section on mobile: reduce padding so card still shows */
    .services-section,
    .support-hub-section {
        padding: 20px 12px 30px 12px !important;
        margin: 0 8px !important;
    }

    /* Dashboard header language toggle squeeze */
    .dash-header-inner {
        gap: 6px !important;
    }

    /* Crop Gateway Hero Title Wrap Fix */
    .crop-gateway-hero h2,
    .module-card h2 {
        font-size: 1.4rem !important;
        line-height: 1.4 !important;
        padding-bottom: 5px;
        word-break: break-word;
    }

    /* Fix module card horizontal squish */
    .module-card {
        padding: 20px 15px !important;
        box-sizing: border-box;
    }

    /* Market Calculator Storage vs Sell Mobile Fix */
    .mkt-calc-grid {
        grid-template-columns: 1fr !important;
    }

    /* Disease Upload Zone Mobile Fix */
    .upload-zone-premium {
        padding: 40px 15px !important;
        width: 100% !important;
        box-sizing: border-box;
    }

    /* Form specific fixes */
    .form-header h1 {
        font-size: 1.4rem !important;
        line-height: 1.3 !important;
    }

    /* Fix Past Recommendations grid shift & padding */
    .crop-gateway-card {
        padding: 20px 15px !important;
        box-sizing: border-box;
    }
    .crop-history-grid {
        grid-template-columns: 1fr !important;
    }

    /* Fix fertilizer name cut-off */
    #fertilizer-results > div > div:nth-child(2) > div:first-child {
        flex-wrap: wrap;
        gap: 8px !important;
    }
    #fertilizer-results > div > div:nth-child(2) > div:first-child span:last-child {
        margin-left: 0 !important;
        width: 100%;
        text-align: left;
    }

    /* Input layout fixes */
    .fetched-data-inputs, .manual-location-inputs, .nutrient-inputs {
        padding: 15px !important;
        gap: 12px !important;
        box-sizing: border-box !important;
    }
    
    .input-field input, .input-field select {
        box-sizing: border-box !important;
        max-width: 100% !important;
    }

    /* Fix market location text overflow & box padding */
    .mkt-select-bar,
    div[style*="padding:25px;border-radius:16px;box-shadow:0 4px 15px rgba(0,0,0,0.05);"] {
        padding: 15px !important;
        box-sizing: border-box !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
    }

    .mkt-select-group, 
    .mkt-select-row, 
    .custom-select, 
    .custom-select-input, 
    .mkt-loc-readonly {
        min-width: 0 !important;
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
    
    .mkt-loc-readonly span {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        min-width: 0;
        flex: 1;
    }

    /* Fix fertilizer result layout inline grids */
    #fertilizer-results [style*="grid-template-columns: 1fr 1fr"] {
        grid-template-columns: 1fr !important;
    }

    /* Allow tables and pre blocks to scroll instead of overflow */
    table, pre {
        max-width: 100%;
        overflow-x: auto;
        display: block;
    }

    /* ── Disease Result Card V2 – Mobile Fix ── */
    .result-card-v2 {
        margin-top: 20px !important;
        border-radius: 16px !important;
    }

    .result-header-v2 {
        padding: 20px 16px !important;
        gap: 14px !important;
        flex-direction: column !important;
        align-items: flex-start !important;
    }

    .result-icon-v2 {
        width: 50px !important;
        height: 50px !important;
        border-radius: 14px !important;
        font-size: 1.6rem !important;
    }

    .result-header-v2 h3 {
        font-size: 1.3rem !important;
        word-break: break-word !important;
    }

    .result-header-v2 p {
        font-size: 0.9rem !important;
    }

    .result-header-v2 span[style*="inline-block"] {
        font-size: 0.7rem !important;
        padding: 2px 8px !important;
    }

    .result-body-v2 {
        padding: 20px 16px !important;
    }

    .result-info-grid {
        grid-template-columns: 1fr !important;
        gap: 14px !important;
        margin-bottom: 20px !important;
    }

    .info-item-v2 {
        padding: 16px !important;
        border-radius: 12px !important;
    }

    .info-label-v2 {
        font-size: 0.7rem !important;
        letter-spacing: 1px !important;
        margin-bottom: 8px !important;
    }

    .info-value-v2 {
        font-size: 1.1rem !important;
        word-break: break-word !important;
    }

    .accuracy-container-v2 {
        margin-bottom: 20px !important;
    }

    .remedy-card-v2 {
        padding: 20px 16px !important;
        border-radius: 14px !important;
        border-left-width: 5px !important;
        margin-top: 20px !important;
    }

    .remedy-card-v2 h4 {
        font-size: 1rem !important;
        gap: 10px !important;
        margin-bottom: 14px !important;
    }

    .remedy-content-v2 {
        font-size: 0.95rem !important;
        line-height: 1.7 !important;
        word-break: break-word !important;
        overflow-wrap: break-word !important;
    }

    /* Ensure disease container itself respects viewport */
    .disease-card-premium {
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    #disease-results {
        max-width: 100% !important;
        overflow: hidden !important;
    }
}
