body { 
    font-family: 'Open Sans', sans-serif; 
    margin: 0; 
    color: #333; 
    background-image: url('background.jpg'); 
    background-size: cover; 
    background-attachment: fixed; 
    padding-bottom: 60px; 
}

h1, h2, h3, .brand-font { 
    font-family: 'Montserrat', sans-serif; 
    font-weight: 800; 
    letter-spacing: -0.5px; 
}

footer { 
    position: fixed; 
    bottom: 0; 
    left: 0; 
    width: 100%; 
    background: rgba(0,0,0,0.9); 
    color: white; 
    text-align: center; 
    padding: 15px; 
    font-size: 0.8em; 
    z-index: 1000; 
    border-top: 3px solid #43a047; 
}

.footer-credit { 
    display: inline; 
}

.footer-link {
    color: #81c784; 
    text-decoration: none; 
    font-weight: bold;
    transition: color 0.2s;
}

.footer-link:hover {
    color: #fff;
}

#login-overlay { 
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; 
    background: rgba(0,0,0,0.7); 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    z-index: 999; 
}

.login-box { 
    background: white; 
    padding: 25px; 
    border-radius: 10px; 
    width: 280px; 
    text-align: center; 
    border-top: 5px solid #43a047; 
}

.login-logo { 
    max-width: 250px; 
    margin-bottom: 25px; 
}

.login-status { 
    color: green; 
    margin-top: 15px; 
    font-weight: bold; 
}

nav { 
    background: #43a047; 
    padding: 0 20px; 
    height: 80px; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    color: white; 
    box-shadow: 0 10px 25px rgba(0,0,0,0.5); 
    position: sticky; 
    top: 0; 
    z-index: 100; 
    box-sizing: border-box;
    width: 100%;
}

.nav-brand-left { 
    order: 1; 
    display: flex; 
    align-items: center; 
    min-width: 150px; 
}

.nav-tabs { 
    order: 2; 
    display: flex; 
    height: 100%; 
    gap: 2px; 
    overflow-x: auto; 
    flex: 1; 
    justify-content: flex-start; 
    align-items: center; 
    padding: 0; 
}

.nav-tabs::-webkit-scrollbar { 
    display: none; 
}

.nav-controls-right { 
    order: 3; 
    display: flex; 
    justify-content: flex-end; 
    align-items: center; 
    min-width: 150px; 
}

.app-dashboard-logo { 
    height: 65px; 
    cursor: pointer; 
    transition: transform 0.2s; 
} 

.app-dashboard-logo:hover { 
    transform: scale(1.05); 
}

.mobile-logo { 
    display: none; 
}

.mobile-only-btn { 
    display: none; 
}

.nav-tab-btn { 
    background: transparent; 
    border: none; 
    color: #222; 
    font-weight: 700; 
    font-size: 13px; 
    cursor: pointer; 
    height: 40px; 
    padding: 0 5px; 
    border-bottom: 3px solid transparent; 
    white-space: nowrap; 
    transition: 0.3s; 
}

.nav-tab-btn.active { 
    color: #000; 
    border-bottom: 3px solid #000; 
}

.nav-tab-btn:hover { 
    color: #000; 
}

.mobile-text {
    display: none;
}

.btn-logout { 
    background: transparent; 
    border: 1px solid rgba(255,255,255,0.8); 
    padding: 8px 18px; 
    font-size: 0.9em; 
    white-space: nowrap; 
    border-radius: 4px; 
    color: white; 
    font-weight: bold; 
    cursor: pointer; 
    transition: 0.3s; 
}

.btn-logout:hover { 
    background: rgba(255,255,255,0.2); 
    border-color: white; 
}

.hamburger { 
    display: none; 
    background: transparent; 
    border: none; 
    color: #222; 
    font-size: 28px; 
    cursor: pointer; 
    padding: 0; 
    font-weight:bold; 
}

#app-view { 
    display: none; 
}

.container { 
    max-width: 1000px; 
    margin: 30px auto; 
    padding: 30px; 
    background: rgba(255,255,255,0.95); 
    border-radius: 8px; 
    min-height: 80vh; 
    box-shadow: 0 10px 30px rgba(0,0,0,0.2); 
}

.form-grid { 
    display: grid; 
    grid-template-columns: 1fr 1fr; 
    gap: 15px; 
    margin-bottom: 15px; 
    position: relative; 
}

.input-wrapper { 
    position: relative; 
    display: flex; 
    flex-direction: column; 
}

label { 
    font-size: 0.8em; 
    font-weight: bold; 
    color: #555; 
    display: block; 
    margin-bottom: 4px; 
}

input, select, textarea { 
    width: 100%; 
    padding: 10px; 
    border: 1px solid #ccc; 
    border-radius: 4px; 
    box-sizing: border-box; 
    transition: outline 0.2s; 
    font-family: inherit;
}

select[multiple] { 
    height: auto; 
    min-height: 80px; 
    padding: 5px; 
}

.error-text { 
    color: #d32f2f; 
    font-size: 0.75em; 
    font-weight: bold; 
    margin-top: 4px; 
    display: block; 
    animation: fadeIn 0.3s; 
}

@keyframes fadeIn { 
    from { opacity: 0; transform: translateY(-5px); } 
    to { opacity: 1; transform: translateY(0); } 
}

.section-header { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    border-bottom: 2px solid #eee; 
    padding-bottom: 10px; 
    margin-bottom: 20px; 
    flex-wrap:wrap; 
    gap:10px; 
}

.section-title { 
    color: #2e7d32; 
    margin: 0; 
}

/* Change table headers from ALL CAPS to normal text */
th {
    text-transform: none !important;
    font-variant: normal;
}

button { 
    cursor: pointer; 
    font-weight: bold; 
    border-radius: 4px; 
    padding: 10px; 
    border: none; 
    color: white; 
}

.btn-green { background: #f57f17; width: 100%; } 
.btn-brown { background: #f57f17; width: 100%; } 
.btn-blue { background: #f57f17; width: 100%; }
.btn-orange { background: #f57f17; width: 100%; } 
.btn-teal { background: #f57f17; width: 100%; } 
.btn-grey { background: #f57f17; width: 100%; }
.btn-cyan { background: #f57f17; width: 100%; } 
.btn-purple { background: #f57f17; width: 100%; } 
.btn-black { background: #f57f17; width: 100%; }
.btn-pink { background: #f57f17; width: 100%; }
.btn-cancel { background: #f80000; width: 100px; display:none; }
.btn-pdf { background: #555; padding: 8px 15px; font-size: 0.8em; width: auto; }
.btn-google { background: white; border: 1px solid #ccc; color: #444; width: 100%; display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 20px; }

.list-item { 
    padding: 15px; 
    border-bottom: 1px solid #eee; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    background: white; 
    margin-bottom: 10px; 
    border-left: 5px solid #ccc; 
    border-radius: 4px; 
    box-shadow: 0 2px 4px rgba(0,0,0,0.05); 
    transition: background-color 0.2s; 
}

.clickable-list-item:hover { background-color: #f1f8e9; }
.crop-item { border-left-color: #f57f17 } 
.cattle-item { border-left-color: #f57f17; } 
.finance-item { border-left-color: #f57f17; } 
.income-item { border-left-color: #f57f17; } 
.equip-item { border-left-color: #f57f17; } 
.task-item { border-left-color: #f57f17 } 
.rain-item { border-left-color: #f57f17; } 
.inv-item { border-left-color: #f57f17 } 
.farm-item { border-left-color: #f57f17; } 
.soil-item { border-left-color: #f57f17; } 
.contact-item { border-left-color: #f57f17; }
.hr-item { border-left-color: #f57f17 } 
.scm-item { border-left-color: #f57f17; }

.tag { 
    font-size: 0.75em; 
    padding: 3px 8px; 
    background: #eee; 
    border-radius: 12px; 
    color: #555; 
    margin-right: 5px; 
    font-weight: 600; 
}

.inv-item.low-stock { border-left-color: #d32f2f; background-color: #ffebee; }
.task-item.overdue { border-left-color: #d32f2f; background-color: #ffebee; }
.equip-item.overdue { border-left-color: #d32f2f; background-color: #ffebee; }
.cattle-item.overdue { border-left-color: #d32f2f; background-color: #ffebee; }
.scm-item.overdue { border-left-color: #d32f2f; background-color: #ffebee; }

.action-group { display: flex; gap: 10px; } 
.action-btn { background: none; border: none; cursor: pointer; font-size: 1.1em; padding: 2px; }

.dashboard-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); 
    gap: 15px; 
    margin-bottom: 30px; 
}

.dash-card { 
    background: #f9f9f9; 
    padding: 15px; 
    border-radius: 8px; 
    text-align: center; 
    border: 1px solid #eee; 
    display:flex; 
    flex-direction:column; 
    justify-content:center; 
    transition: transform 0.2s, box-shadow 0.2s;
}

.clickable-card { cursor: pointer; }
.clickable-card:hover { transform: translateY(-3px); box-shadow: 0 6px 12px rgba(0,0,0,0.1); border-color: #ccc; }

.dash-card h4 { margin: 0 0 10px 0; color: #666; font-size: 0.9em; transition: color 0.3s; }
.dash-card .val { font-size: 1.2em; font-weight: 800; color: #333; }

.dash-card.total { background: #e1f5fe; border: 1px solid #b3e5fc; } 
.dash-card.profit { background: #e8f5e9; border: 1px solid #a5d6a7; } 
.dash-card.loss { background: #ffebee; border: 1px solid #ef9a9a; } 
.dash-card.rain { background: #e3f2fd; border: 1px solid #90caf9; } 
.dash-card.variance { background: #fffde7; border: 1px solid #fff59d; }

.controls-row { 
    display: flex; 
    gap: 20px; 
    background: #e3f2fd; 
    padding: 15px; 
    border-radius: 8px; 
    margin-bottom: 20px; 
    align-items: flex-end; 
    border: 1px solid #bbdefb; 
    flex-wrap: wrap; 
}

.month-input { 
    padding: 8px; 
    font-size: 14px; 
    border: 1px solid #0277bd; 
    border-radius: 4px; 
    color: #0277bd; 
    font-weight: bold; 
}

.budget-input { 
    padding: 8px; 
    font-size: 14px; 
    border: 1px solid #0277bd; 
    border-radius: 4px; 
    width: 100px; 
}

.currency-select { 
    padding: 8px; 
    font-size: 14px; 
    border: 1px solid #0277bd; 
    border-radius: 4px; 
    font-weight:bold; 
    color:#333; 
}

.chart-grid { 
    display: grid; 
    grid-template-columns: 1fr 1fr; 
    gap: 20px; 
    margin-bottom: 30px; 
}

.chart-box { 
    background: white; 
    padding: 15px; 
    border-radius: 8px; 
    border: 1px solid #eee; 
    box-shadow: 0 2px 4px rgba(0,0,0,0.05); 
    height: 300px; 
}

.chart-box.full { grid-column: 1 / -1; }

@media (max-width: 1250px) {
    .nav-tab-btn {
        font-size: 12px;
        padding: 0 4px;
    }
    .app-dashboard-logo {
        height: 50px;
    }
    .nav-brand-left {
        min-width: 80px;
    }
    .nav-controls-right {
        min-width: 100px;
    }
}

/* === MOBILE AND RESPONSIVE FIXES === */
@media (max-width: 950px) { 
    .mobile-text {
        display: inline;
    }

    nav { 
        height: 60px; 
        padding: 0 15px; 
        display: flex; 
        flex-direction: row; 
        justify-content: space-between; 
        align-items: center; 
        position: relative; 
    }
    
    .nav-controls-right { display: none; } 
    
    .nav-brand-left { 
        order: 1; 
        display: flex; 
        align-items: center; 
        min-width: auto; 
    } 
    
    .desktop-logo { display: none !important; }
    .mobile-logo { display: block !important; height: 50px; }
    
    .hamburger { 
        display: block; 
        order: 3; 
        flex: 0; 
        margin-left: auto;
    } 

    .nav-tabs { 
        display: none; 
        width: auto; 
        min-width: 200px; 
        flex-direction: column; 
        
        background: rgba(46, 125, 50, 0.85); 
        backdrop-filter: blur(8px); 
        -webkit-backdrop-filter: blur(8px); 
        
        position: absolute; 
        top: 60px; 
        right: 0; 
        left: auto; 
        z-index: 101; 
        border-radius: 0 0 0 12px; 
        box-shadow: -4px 4px 15px rgba(0,0,0,0.2); 
        height: auto; 
    } 
    
    .nav-tabs.show-mobile { 
        display: flex; 
        padding-top: 10px; 
        padding-bottom: 10px; 
    } 
    
    .nav-tab-btn { 
        padding: 12px 20px; 
        text-align: right; 
        border-bottom: none; 
        color: #fff; 
        height: auto; 
        font-size: 15px;
    } 
    
    .nav-tab-btn.active { 
        color: #fff; 
        border-bottom: none; 
        border-left: none; 
        border-right: 4px solid white; 
        background: rgba(255,255,255,0.15); 
    }

    .mobile-only-btn { 
        display: block !important; 
        border-top: 1px solid rgba(255,255,255,0.2); 
        margin-top: 5px; 
        padding-top: 15px !important; 
        color: #ffab91 !important; 
    }
    
    .footer-credit { 
        display: block; 
        margin-top: 5px; 
        font-size: 0.9em; 
        color: #ccc; 
    }
    footer { padding: 10px; line-height: 1.4; }
    .form-grid { grid-template-columns: 1fr; } 
    .controls-row { flex-direction: column; align-items: flex-start; } 
    .chart-grid { grid-template-columns: 1fr; } 
}

/* --- Dashboard Header Styling --- */
.chart-container-box {
    background: #f5f5f5; 
    padding: 20px; 
    border-radius: 8px; 
    margin-bottom: 30px;
}

.dash-subtitle {
    color: #555;
    font-size: 1.2rem;
    margin-top: 0;
    border-bottom: 2px solid #ddd;
    padding-bottom: 10px;
    white-space: nowrap;
}

/* --- Mobile Specific Fix --- */
@media (max-width: 600px) {
    .chart-container-box {
        padding: 12px; /* Give more room to the titles */
    }
    .dash-subtitle {
        font-size: 4.2vw !important; /* Scales perfectly to stay on one line */
        letter-spacing: -0.3px;
    }
}

/* --- Center all Section Titles --- */
.section-title {
    text-align: center !important;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    padding-left: 0;
    padding-right: 0;
}

/* Rainfall History Section - Blue Theme */
#list-rain {
    background-color: #e3f2fd; /* Light blue background */
    border-left: 5px solid #2196f3; /* Stronger blue accent */
    padding: 15px;
    border-radius: 8px;
    margin-top: 25px; /* Extra space between the button and the list */
    color: #0d47a1; /* Dark blue text for readability */
}

/* Individual record styling inside the list */
.rain-record {
    background: white;
    padding: 10px;
    margin-bottom: 8px;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

