/* --- RESET & LAYOUT --- */
.agri-dashboard {
    box-sizing: border-box;
    width: 100%;
    padding: 40px;
    background-color: #f8fafc; /* Ultra Light Slate */
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* --- VARIABLES --- */
:root {
    --primary: #10b981;       /* Emerald */
    --radius: 16px;
    --text-dark: #1e293b;     /* Slate 800 - Very Dark */
    --text-muted: #64748b;    /* Slate 500 */
}

/* --- 1. HERO BANNER --- */
.hero-banner {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    border-radius: var(--radius);
    padding: 35px 45px;
    color: #ffffff !important;
    margin-bottom: 50px; /* increased spacing */
    box-shadow: 0 10px 25px -5px rgba(16, 185, 129, 0.4);
    position: relative;
    overflow: hidden;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Decorative Background */
.hero-banner::before {
    content: "";
    position: absolute;
    top: -50px;
    right: -50px;
    width: 200px;
    height: 200px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
}
.hero-banner::after {
    content: "";
    position: absolute;
    bottom: -30px;
    left: 20%;
    width: 100px;
    height: 100px;
    background: rgba(255,255,255,0.05);
    border-radius: 50%;
}

.hero-text h1 {
    margin: 0;
    font-size: 2rem;
    font-weight: 800;
    color: #ffffff !important;
    letter-spacing: -0.02em;
}

.hero-text p {
    margin: 8px 0 0;
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.95) !important;
}

.time-badge {
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(8px);
    padding: 10px 20px;
    border-radius: 50px;
    color: #ffffff !important;
    font-weight: 700;
    border: 1px solid rgba(255,255,255,0.3);
}

/* --- 2. STATS ROW --- */
.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-bottom: 60px; /* Spacing after stats */
}

.stat-card {
    background: #ffffff;
    padding: 25px;
    border-radius: var(--radius);
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    border: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 20px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px -5px rgba(0, 0, 0, 0.1);
}

.icon-box {
    width: 60px;
    height: 60px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    flex-shrink: 0;
}

.stat-info h4 {
    margin: 0;
    font-size: 0.85rem;
    text-transform: uppercase;
    color: #64748b !important;
    font-weight: 700;
    letter-spacing: 0.05em;
}

.stat-info .value {
    margin-top: 5px;
    font-size: 2.2rem;
    font-weight: 800;
    color: #0f172a !important;
    line-height: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}


/* --- 3. SECTION TITLES (THE GAP FIX) --- */
.section-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: #1e293b !important; /* Force Dark Color */
    margin-bottom: 30px;
    margin-top: 60px; /* <--- THIS ADDS THE GAP YOU WANTED */
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Remove margin top for the very first section so it sits close to stats */
.section-title.first {
    margin-top: 0;
}

.section-title::before {
    content: "";
    display: block;
    width: 6px;
    height: 32px;
    background-color: var(--primary);
    border-radius: 4px;
}

.bento-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
    margin-bottom: 0; /* Margin handled by section titles now */
}

/* --- 4. CARDS (TEXT VISIBILITY FIX) --- */
a.dash-item {
    background: #ffffff;
    border-radius: var(--radius);
    padding: 30px;
    text-decoration: none !important;
    border: 1px solid #f1f5f9;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    position: relative;
    overflow: hidden;
}

/* Hover Top-Border Effect */
a.dash-item::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: transparent;
    transition: background 0.3s;
}

a.dash-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    border-color: transparent;
}

.item-icon {
    width: 54px;
    height: 54px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    margin-bottom: 20px;
    transition: transform 0.3s;
}

a.dash-item:hover .item-icon {
    transform: scale(1.1) rotate(5deg);
}

/* FORCE DARK TEXT */
.item-content h3 {
    margin: 0 0 10px 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: #0f172a !important; /* Pure Black/Blue */
}

.item-content p {
    margin: 0;
    font-size: 1rem;
    color: #475569 !important; /* Dark Grey */
    line-height: 1.5;
}

.action-arrow {
    margin-top: 25px;
    font-weight: 600;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: gap 0.2s;
}

a.dash-item:hover .action-arrow {
    gap: 12px;
}

/* --- THEMES --- */
.green .icon-box, .green .item-icon { background: #d1fae5; color: #10b981; }
.green .action-arrow { color: #10b981 !important; }
a.dash-item.green:hover::before { background: #10b981; }

.blue .icon-box, .blue .item-icon { background: #dbeafe; color: #3b82f6; }
.blue .action-arrow { color: #3b82f6 !important; }
a.dash-item.blue:hover::before { background: #3b82f6; }

.orange .icon-box, .orange .item-icon { background: #fef3c7; color: #f59e0b; }
.orange .action-arrow { color: #f59e0b !important; }
a.dash-item.orange:hover::before { background: #f59e0b; }

.red .icon-box, .red .item-icon { background: #fee2e2; color: #ef4444; }
.red .action-arrow { color: #ef4444 !important; }
a.dash-item.red:hover::before { background: #ef4444; }

/* --- FOOTER --- */
.dashboard-footer {
    margin-top: 80px; /* Big gap before footer */
    text-align: center;
    padding: 20px;
    color: #94a3b8;
    font-size: 0.9rem;
    border-top: 1px solid #e2e8f0;
}

/* --- RESPONSIVE --- */
@media (max-width: 768px) {
    .agri-dashboard { padding: 20px; }
    .hero-banner { flex-direction: column; align-items: flex-start; gap: 15px; }
    .stats-container, .bento-grid { grid-template-columns: 1fr; }
}