/**
 * ABACAst - Centralized Stylesheet
 * Unified design system for all pages
 */

/* ==================== CSS VARIABLES ==================== */
:root {
    --primary: #2c6e49;
    --primary-light: #4c956c;
    --primary-dark: #1a4031;
    --secondary: #ffc9b9;
    --accent: #d68c45;
    --text-dark: #333333;
    --text-light: #f8f9fa;
    --background: #f0f7f4;
    --card-bg: #ffffff;
    --success: #2d936c;
    --danger: #e63946;
    --warning: #ee9b00;
    --info: #0077b6;
    --gold: #ffd700;
    --organic: #228b22;
    --font-family: 'Montserrat', sans-serif;
    --border-radius: 12px;
    --border-radius-sm: 8px;
    --border-radius-xs: 6px;
    --shadow: 0 4px 15px rgba(0,0,0,0.08);
    --shadow-lg: 0 6px 18px rgba(0,0,0,0.06);
    --shadow-hover: 0 12px 24px rgba(0,0,0,0.1);
    --transition: all 0.3s ease;
}

/* ==================== RESET & BASE ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    background-color: var(--background);
    color: var(--text-dark);
    line-height: 1.6;
    min-height: 100vh;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-dark);
}

/* ==================== HEADER / NAVBAR ==================== */
.app-header {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    color: var(--text-light);
    padding: 0 20px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 60px;
}

.logo {
    font-size: 20px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-light);
    text-decoration: none;
    white-space: nowrap;
}

.logo i {
    font-size: 24px;
}

.nav-menu {
    display: flex;
    list-style: none;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
}

.nav-menu a {
    color: var(--text-light);
    text-decoration: none;
    font-weight: 500;
    font-size: 13px;
    padding: 8px 14px;
    border-radius: var(--border-radius-xs);
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.nav-menu a:hover,
.nav-menu a.active {
    background-color: rgba(255,255,255,0.2);
    color: var(--text-light);
}

/* User info & logout in nav */
.nav-user {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-left: 15px;
    padding-left: 15px;
    border-left: 1px solid rgba(255,255,255,0.3);
}

.nav-user-name {
    font-size: 0.85rem;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.btn-logout {
    background: rgba(255,255,255,0.2);
    color: var(--text-light) !important;
    padding: 6px 14px;
    border-radius: var(--border-radius-xs);
    font-size: 0.85rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    transition: var(--transition);
    border: none;
    cursor: pointer;
}

.btn-logout:hover {
    background: rgba(255,255,255,0.35);
    color: var(--text-light) !important;
}

/* ==================== CONTAINER ==================== */
.container {
    max-width: 1400px;
    margin: 30px auto;
    padding: 0 20px;
}

/* ==================== SECTIONS / CARDS ==================== */
.section {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    padding: 25px;
    margin-bottom: 30px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
}

.section:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--primary-light);
    flex-wrap: wrap;
    gap: 10px;
}

.section-header h2 {
    color: var(--primary);
    font-weight: 600;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.card-header {
    padding: 20px 25px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h3 {
    font-size: 1.1rem;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-header h3 i {
    color: var(--primary);
}

.card-body {
    padding: 25px;
}

/* ==================== DASHBOARD STATS ==================== */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.stat-card {
    background: linear-gradient(45deg, var(--primary-light), var(--primary));
    color: var(--text-light);
    padding: 20px;
    border-radius: var(--border-radius-sm);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.stat-card > i {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 24px;
    opacity: 0.2;
}

.stat-card h3 {
    font-size: 13px;
    font-weight: 500;
    text-transform: uppercase;
    margin-bottom: 10px;
    opacity: 0.9;
}

.stat-card .value {
    font-size: 22px;
    font-weight: 700;
}

/* ==================== BUTTONS ==================== */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: var(--border-radius-xs);
    cursor: pointer;
    font-weight: 500;
    font-size: 14px;
    font-family: var(--font-family);
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    line-height: 1.4;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    color: white;
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-warning {
    background: var(--warning);
    color: var(--text-dark);
}

.btn-info {
    background: var(--info);
    color: white;
}

.btn-accent {
    background: var(--accent);
    color: white;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: white;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 16px;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

/* ==================== FORMS ==================== */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: var(--primary-dark);
    font-size: 13px;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: var(--border-radius-xs);
    font-size: 14px;
    font-family: var(--font-family);
    transition: var(--transition);
    background: white;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(44, 110, 73, 0.1);
}

select.form-control {
    appearance: auto;
}

.form-row {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: flex-end;
}

.form-row .form-group {
    flex: 1;
    min-width: 200px;
}

/* ==================== SEARCH BAR ==================== */
.search-wrapper {
    position: relative;
    width: 100%;
}

.search-wrapper .search-input {
    width: 100%;
    padding: 10px 14px 10px 38px;
    border: 1px solid #ddd;
    border-radius: var(--border-radius-xs);
    font-size: 14px;
    font-family: var(--font-family);
    transition: var(--transition);
    background: white;
}

.search-wrapper .search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(44, 110, 73, 0.1);
}

.search-wrapper .search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #888;
    font-size: 14px;
    pointer-events: none;
}

/* ==================== TABLES ==================== */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.data-table th,
.data-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.data-table th {
    background-color: var(--primary);
    color: white;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    font-weight: 600;
    position: sticky;
    top: 0;
}

.data-table tr:nth-child(even) {
    background-color: #f8f8f8;
}

.data-table tr:hover {
    background-color: #f1f1f1;
}

.table-responsive {
    overflow-x: auto;
    max-height: 500px;
}

.table-actions {
    display: flex;
    gap: 5px;
}

.icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    transition: var(--transition);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.icon-btn.edit { color: var(--warning); }
.icon-btn.delete { color: var(--danger); }
.icon-btn:hover { background-color: #f0f0f0; transform: scale(1.1); }

/* ==================== FILTER BAR ==================== */
.filter-bar {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: var(--border-radius-sm);
    align-items: center;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.filter-group label {
    margin-bottom: 0;
    white-space: nowrap;
    font-weight: 500;
    font-size: 13px;
    color: var(--primary-dark);
}

/* ==================== TOGGLE SWITCH ==================== */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 34px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .toggle-slider {
    background-color: var(--primary);
}

input:checked + .toggle-slider:before {
    transform: translateX(26px);
}

/* ==================== MESSAGES / ALERTS ==================== */
.message {
    padding: 12px 18px;
    border-radius: var(--border-radius-sm);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    animation: fadeIn 0.5s;
}

.message.success {
    background: #d4edda;
    color: #155724;
    border-left: 4px solid var(--success);
}

.message.error {
    background: #f8d7da;
    color: #721c24;
    border-left: 4px solid var(--danger);
}

.message.info {
    background: #cce5ff;
    color: #004085;
    border-left: 4px solid var(--info);
}

.message.warning {
    background: #fff3cd;
    color: #856404;
    border-left: 4px solid var(--warning);
}

/* ==================== BADGES ==================== */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-success { background: #dcfce7; color: #16a34a; }
.badge-danger { background: #fee2e2; color: #dc2626; }
.badge-warning { background: #fef3c7; color: #f59e0b; }
.badge-info { background: #cce5ff; color: #004085; }
.badge-primary { background: #e8f5e9; color: var(--primary); }

/* Priority badges */
.badge-urgent, .badge-critical { background: #f8d7da; color: var(--danger); }
.badge-high { background: #fff3cd; color: #856404; }
.badge-medium { background: #cce5ff; color: #004085; }
.badge-low { background: #d4edda; color: #155724; }

/* ==================== MODALS ==================== */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0; top: 0;
    width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: #fff;
    margin: 8% auto;
    padding: 30px;
    border-radius: var(--border-radius);
    width: 90%;
    max-width: 700px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    animation: slideDown 0.3s;
    max-height: 85vh;
    overflow-y: auto;
}

.modal-content .close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}

.modal-content .close:hover {
    color: #555;
}

/* ==================== CHART CONTAINER ==================== */
.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
}

/* ==================== EMPTY STATES ==================== */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #888;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 15px;
    opacity: 0.4;
    display: block;
}

.empty-state p {
    font-size: 0.9rem;
}

/* ==================== QUICK ACCESS GRID ==================== */
.quick-modules {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
}

.module-btn {
    background: linear-gradient(135deg, #f8fafc 0%, #e8f5e9 100%);
    border: 2px solid #e0e0e0;
    padding: 22px 18px;
    border-radius: var(--border-radius);
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    color: var(--text-dark);
    display: block;
}

.module-btn:hover {
    border-color: var(--primary);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(45,90,61,0.15);
    color: var(--text-dark);
}

.module-btn i {
    font-size: 1.8rem;
    color: var(--primary);
    margin-bottom: 10px;
    display: block;
}

.module-btn span {
    font-weight: 600;
    font-size: 0.9rem;
}

/* ==================== TABS ==================== */
.tabs {
    display: flex;
    gap: 5px;
    border-bottom: 2px solid #e0e0e0;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.tab {
    padding: 10px 20px;
    cursor: pointer;
    border: none;
    background: none;
    font-family: var(--font-family);
    font-size: 14px;
    font-weight: 500;
    color: #888;
    border-bottom: 3px solid transparent;
    transition: var(--transition);
    margin-bottom: -2px;
}

.tab:hover {
    color: var(--primary);
}

.tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    font-weight: 600;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* ==================== FOOTER ==================== */
.app-footer {
    background-color: var(--primary-dark);
    color: var(--text-light);
    padding: 30px 0;
    text-align: center;
    margin-top: 40px;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.footer-links a {
    color: var(--text-light);
    text-decoration: none;
    transition: color 0.3s;
    font-size: 0.9rem;
}

.footer-links a:hover {
    color: var(--secondary);
}

.footer-bottom {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(255,255,255,0.1);
    font-size: 0.85rem;
    opacity: 0.7;
}

/* ==================== ANIMATIONS ==================== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideDown {
    from { transform: translateY(-30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes slideUp {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* ==================== WELCOME BANNER ==================== */
.welcome-banner {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    padding: 30px;
    border-radius: var(--border-radius);
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.welcome-banner h2 {
    color: white;
    font-size: 1.6rem;
    margin-bottom: 8px;
}

.welcome-banner p {
    opacity: 0.9;
    font-size: 0.95rem;
    margin: 0;
}

.quick-stats {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.stat-box {
    background: rgba(255,255,255,0.2);
    padding: 18px 25px;
    border-radius: 10px;
    text-align: center;
}

.stat-box .value {
    font-size: 1.8rem;
    font-weight: 700;
}

.stat-box .label {
    font-size: 0.8rem;
    opacity: 0.9;
}

/* ==================== DASHBOARD GRID ==================== */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 25px;
}

/* ==================== RECOMMENDATION CARDS ==================== */
.recommendations-grid {
    display: grid;
    gap: 20px;
}

.recommendation-card {
    background: white;
    border-radius: var(--border-radius);
    border-left: 5px solid var(--primary);
    padding: 20px;
    display: flex;
    gap: 20px;
    align-items: flex-start;
    transition: var(--transition);
}

.recommendation-card:hover {
    transform: translateX(5px);
    box-shadow: var(--shadow-hover);
}

.recommendation-card.priority-Critical { border-left-color: var(--danger); }
.recommendation-card.priority-High { border-left-color: var(--warning); }
.recommendation-card.priority-Medium { border-left-color: var(--info); }
.recommendation-card.priority-Low { border-left-color: var(--primary-light); }

.rec-icon {
    width: 50px;
    height: 50px;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: white;
    flex-shrink: 0;
}

.priority-Critical .rec-icon { background: var(--danger); }
.priority-High .rec-icon { background: var(--warning); }
.priority-Medium .rec-icon { background: var(--info); }
.priority-Low .rec-icon { background: var(--primary-light); }

/* ==================== MAP ==================== */
.map-container {
    position: relative;
    height: 400px;
    width: 100%;
    overflow: hidden;
    border-radius: var(--border-radius-sm);
}

.map-container iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* ==================== RESPONSIVE ==================== */
@media screen and (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 10px;
        padding: 10px 0;
    }

    .nav-menu {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
        gap: 3px;
    }

    .nav-menu a {
        font-size: 11px;
        padding: 6px 8px;
    }

    .nav-user {
        margin-left: 0;
        padding-left: 0;
        border-left: none;
        padding-top: 8px;
        border-top: 1px solid rgba(255,255,255,0.3);
        width: 100%;
        justify-content: center;
    }

    .container {
        padding: 0 15px;
        margin: 15px auto;
    }

    .section {
        padding: 18px;
    }

    .welcome-banner {
        flex-direction: column;
        text-align: center;
    }

    .quick-stats {
        justify-content: center;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .quick-modules {
        grid-template-columns: 1fr 1fr;
    }

    .form-row {
        flex-direction: column;
    }

    .recommendation-card {
        flex-direction: column;
    }

    .filter-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-group {
        flex-direction: column;
        align-items: stretch;
    }
}

@media screen and (max-width: 480px) {
    .quick-modules {
        grid-template-columns: 1fr;
    }

    .dashboard-stats {
        grid-template-columns: 1fr;
    }
}

/* ==================== LANDING PAGE STYLES ==================== */
.landing-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 50%, var(--primary-light) 100%);
    padding: 20px;
}

.landing-container {
    width: 100%;
    max-width: 900px;
    text-align: center;
}

.landing-logo {
    margin-bottom: 40px;
    color: white;
}

.landing-logo .logo-icon {
    width: 100px;
    height: 100px;
    background: rgba(255,255,255,0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 3rem;
    color: white;
}

.landing-logo h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: white;
    margin-bottom: 8px;
}

.landing-logo p {
    font-size: 1rem;
    color: rgba(255,255,255,0.85);
    margin: 0;
}

.role-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 25px;
    margin-top: 30px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.role-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 35px 25px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    color: var(--text-dark);
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    border: 3px solid transparent;
}

.role-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.25);
    border-color: var(--primary-light);
    color: var(--text-dark);
}

.role-card .role-icon {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 18px;
    font-size: 1.8rem;
}

.role-card.admin-card .role-icon {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    color: white;
}

.role-card.farmer-card .role-icon {
    background: linear-gradient(135deg, var(--success), var(--primary-light));
    color: white;
}

.role-card h3 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-dark);
}

.role-card p {
    font-size: 0.85rem;
    color: #888;
    margin: 0;
    line-height: 1.5;
}

/* ==================== LOGIN PAGE STYLES ==================== */
.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 50%, var(--primary-light) 100%);
    padding: 20px;
}

.login-container {
    width: 100%;
    max-width: 440px;
}

.login-card {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.login-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    padding: 35px 30px;
    text-align: center;
    color: white;
}

.login-header .logo-icon {
    width: 70px;
    height: 70px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
    font-size: 2rem;
}

.login-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 5px;
    color: white;
}

.login-header p {
    font-size: 0.85rem;
    opacity: 0.9;
    margin: 0;
}

.login-body-form {
    padding: 35px 30px;
}

.input-group {
    position: relative;
}

.input-group i.input-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #888;
    font-size: 1rem;
}

.input-group .form-control {
    padding-left: 42px;
}

.btn-login {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    border-radius: var(--border-radius-sm);
    font-size: 1rem;
    font-weight: 600;
    font-family: var(--font-family);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(26, 71, 42, 0.3);
}

.login-footer {
    text-align: center;
    padding: 18px 30px;
    border-top: 1px solid #f0f0f0;
}

.login-footer p {
    color: #888;
    font-size: 0.8rem;
    margin: 0;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: rgba(255,255,255,0.9);
    text-decoration: none;
    font-size: 0.9rem;
    margin-top: 20px;
    transition: var(--transition);
}

.back-link:hover {
    color: white;
}

.demo-hint {
    background: #f8fafc;
    padding: 18px;
    border-radius: var(--border-radius-sm);
    margin-top: 20px;
}

.demo-hint h4 {
    font-size: 0.85rem;
    color: var(--text-dark);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.demo-hint ul {
    list-style: none;
    font-size: 0.8rem;
    color: #666;
}

.demo-hint li {
    padding: 4px 0;
    display: flex;
    justify-content: space-between;
}

.demo-hint .role {
    font-weight: 500;
    color: var(--primary);
}

/* ==================== ALERT BOXES ==================== */
.alert {
    padding: 15px;
    border-radius: var(--border-radius-sm);
    margin-bottom: 20px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-error {
    background: #fee2e2;
    color: #dc2626;
    border: 1px solid #fca5a5;
}

.alert-success {
    background: #dcfce7;
    color: #16a34a;
    border: 1px solid #86efac;
}

/* ==================== LANDING RESPONSIVE ==================== */
@media (max-width: 768px) {
    .role-cards {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .landing-logo h1 {
        font-size: 2rem;
    }
}

@media (max-width: 480px) {
    .login-header {
        padding: 25px 20px;
    }

    .login-body-form {
        padding: 25px 20px;
    }
}

/* ========================================================= */
/* ====== GLOBAL RESPONSIVENESS OVERRIDES & FIXES ========== */
/* ========================================================= */

@media screen and (max-width: 900px) {
    /* Collapse widely used specific grids */
    .form-grid, .stats-grid, .two-col, .detail-grid, 
    .plot-grid, .fm-stats, .fm-form-row, .stats-row, 
    .form-row, .dashboard-grid, .quick-modules,
    .role-cards, .grade-legend {
        grid-template-columns: 1fr !important;
        display: grid !important;
        gap: 15px !important;
    }

    /* Force tables to scroll */
    .table-container, .table-responsive, [style*="overflow-x: auto"] {
        width: 100% !important;
        overflow-x: auto !important;
        display: block !important;
        -webkit-overflow-scrolling: touch;
    }

    .data-table {
        min-width: 600px; /* Ensures table doesn't crush but scrolls */
    }

    /* Tabs responsive */
    .tabs {
        flex-direction: column !important;
        width: 100% !important;
    }
    
    .tab {
        width: 100% !important;
        text-align: center !important;
        border-bottom: 1px solid #ccc !important;
    }

    /* Fix hardcoded inline styles in PHP files via attribute selector */
    div[style*="grid-template-columns: 1fr 1fr"],
    div[style*="grid-template-columns: repeat(2, 1fr)"],
    div[style*="grid-template-columns: repeat(3, 1fr)"],
    div[style*="grid-template-columns: repeat(4, 1fr)"],
    div[style*="grid-template-columns:1fr 1fr"],
    div[style*="grid-template-columns:1fr 1fr 1fr"] {
        grid-template-columns: 1fr !important;
        display: flex !important;
        flex-direction: column !important;
    }
    
    /* Navigation and Headers */
    .nav-menu {
        flex-direction: column !important;
        align-items: center !important;
        gap: 10px !important;
        width: 100% !important;
    }
    
    .section-header, .page-header, .fm-section-header, .modal-header, .practice-header {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 15px !important;
    }
    
    .logo {
        margin-bottom: 10px !important;
    }
    
    .btn, .action-btn {
        width: 100% !important;
        text-align: center !important;
        display: block !important;
        margin-bottom: 8px !important;
    }
    
    td .btn, th .btn, .table-actions .btn, .icon-btn, .fm-btn-sm, td .action-btn {
        width: auto !important;
        display: inline-block;
        margin-bottom: 0;
    }

    /* Charts sizing */
    .chart-container, canvas, [style*="height: 300px"], [style*="height: 350px"] {
        max-height: 300px !important;
        width: 100% !important;
    }

    /* Forms */
    .form-group, .input-group, input, select {
        width: 100% !important;
    }
    
    /* Modals should be fully responsive */
    .modal-content, .fm-modal {
        width: 95% !important;
        margin: 10% auto !important;
        padding: 15px !important;
        box-sizing: border-box;
    }

    /* Wrap tables to scroll instead of breaking layout */
    table, .data-table, .fm-table, .farmers-table, .disease-table, .saved-recs-table {
        display: block !important;
        width: 100% !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;
    }

    /* Keep essential inline-flex items horizontal */
    .btn, label, span, .icon, i, .stats, .badge, .status-badge, .logo, .info-row {
        flex-direction: row;
        align-items: center;
    }

    /* Prevent breaking images */
    img, video, canvas {
        max-width: 100% !important;
        height: auto !important;
    }
}
