:root {
    --bg-main: #ffffff;
    --bg-white: #ffffff;
    --primary-green: #255741;
    --primary-hover: #1b4231;
    --light-green: #e9f2eb;
    --text-dark: #1e2924;
    --text-gray: #6b7270;
    
    --border-radius-lg: 32px;
    --border-radius-md: 20px;
    --border-radius-sm: 12px;
    --pill-radius: 50px;

    --shadow-soft: 0 8px 24px rgba(37, 87, 65, 0.06);
    --shadow-card: 0 4px 16px rgba(0, 0, 0, 0.04);
    --shadow-hover: 0 10px 25px rgba(37, 87, 65, 0.12);

    --font-heading: 'Poppins', sans-serif;
    --font-body: 'Inter', sans-serif;

    --nav-accent: #8cb068; 
    --nav-icon-inactive: #94a3b8;
    --badge-color: #f28b32; 
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    background-color: #e2e8f0; 
    color: var(--text-dark);
    font-family: var(--font-body);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

#app {
    width: 100%;
    max-width: 414px; 
    height: 100vh; /* Menggunakan 100% dari tinggi layar perangkat */
    /* Untuk mendukung browser mobile modern yang menyembunyikan address bar: */
    height: 100dvh; 
    background-color: var(--bg-main);
    position: relative;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
}
.screen { display: none; height: 100%; width: 100%; flex-direction: column; animation: fadeScreen 0.4s ease; }
.screen.active { display: flex; }
@keyframes fadeScreen { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.content-wrapper { padding: 30px 24px; display: flex; flex-direction: column; justify-content: center; height: 100%; gap: 24px; }
.main-bg { background-color: var(--bg-main); }
.mt-20 { margin-top: 20px; }
.mb-15 { margin-bottom: 15px; }
.mb-20 { margin-bottom: 20px; }
.hidden { display: none !important; }

/* TYPOGRAPHY */
h1, h2, h3, h4 { font-family: var(--font-heading); color: var(--text-dark); }
.brand-title { font-size: 2.2rem; line-height: 1.2; margin-bottom: 16px; color: var(--bg-white); text-shadow: 0 2px 4px rgba(0,0,0,0.3); }
.section-title { font-size: 1.1rem; font-weight: 600; }
.subtitle { color: rgba(255,255,255,0.9); font-size: 0.95rem; line-height: 1.6; font-weight: 500; margin-bottom: 30px; }

/* SPLASH SCREEN & ONBOARDING */
#splash-screen {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background-color: var(--primary-green);
    display: flex; justify-content: center; align-items: center; z-index: 999;
    transition: opacity 0.5s ease, visibility 0.5s;
}
.splash-logo h2 { color: white; font-size: 2.5rem; letter-spacing: 1px; }
.leaf-icon { font-size: 4rem; text-align: center; animation: bounce 2s infinite; }
@keyframes bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-15px); } }
.splash-logo-img {
    width: 120px;       /* Dibuat lebih besar dari 80px */
    height: 120px;      /* Dibuat lebih besar dari 80px */
    object-fit: contain;
    margin-bottom: 20px;
    display: block;
    margin-left: auto;  /* Memastikan posisi di tengah */
    margin-right: auto; /* Memastikan posisi di tengah */
    
    /* Menambahkan animasi mantul (bouncing) */
    animation: bounce 2s infinite ease-in-out;
}

/* Keyframes untuk animasi mantul */
@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-15px); /* Jarak pantulan */
    }
}
.onboarding-bg {
    background: linear-gradient(to bottom, rgba(0,0,0,0.2), rgba(0,0,0,0.8)), url('https://images.unsplash.com/photo-1625246333195-78d9c38ad449?auto=format&fit=crop&w=600&q=80') center/cover;
    justify-content: flex-end;
}
.onboarding-content { padding: 40px 24px 60px; }

/* AUTHENTICATION */
.auth-container {
    width: 100%; max-width: 350px;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px);
    border-radius: 32px; padding: 40px 25px;
    border: 1px solid rgba(255,255,255,0.8);
    box-shadow: var(--shadow-hover);
}
.auth-container .heading { text-align: center; font-weight: 700; font-size: 1.8rem; color: var(--primary-green); font-family: var(--font-heading); margin-bottom: 25px; }
.input-wrapper { position: relative; margin-bottom: 15px; }
.input {
    width: 100%; background: var(--bg-white); border: 1px solid #e2e8f0; padding: 16px 20px;
    border-radius: 16px; font-family: var(--font-body); font-size: 0.95rem;
    transition: all 0.3s ease;
}
.input:focus { outline: none; border-color: var(--primary-green); box-shadow: 0 0 0 4px var(--light-green); }
.login-button {
    width: 100%; background: var(--primary-green); color: white; padding: 16px;
    border-radius: 16px; border: none; font-family: var(--font-heading); font-weight: 600; font-size: 1rem;
    margin-top: 20px; cursor: pointer; transition: all 0.3s ease; display: flex; justify-content: center; align-items: center;
}
.login-button:hover { background: var(--primary-hover); transform: translateY(-2px); box-shadow: 0 10px 20px rgba(37,87,65,0.2); }
.social-account-container { margin-top: 30px; text-align: center; }
.social-accounts { display: flex; justify-content: center; margin-top: 15px; }
.social-button {
    background: var(--bg-white); border: 1px solid #e2e8f0; border-radius: 50%; width: 50px; height: 50px;
    display: flex; justify-content: center; align-items: center; cursor: pointer; transition: all 0.3s ease;
}
.social-button:hover { border-color: var(--primary-green); transform: scale(1.05); }

/* BUTTONS & FORMS */
.btn-pill {
    background-color: var(--primary-green); color: var(--bg-white); border: none; border-radius: var(--pill-radius);
    padding: 18px 24px; font-size: 1rem; font-weight: 600; font-family: var(--font-heading); cursor: pointer;
    transition: all 0.3s ease; width: 100%; display: flex; align-items: center; justify-content: center;
}
.btn-icon-right { justify-content: space-between; padding-left: 30px; padding-right: 8px; }
.icon-circle { background-color: var(--bg-white); color: var(--primary-green); width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; }
.btn-pill:hover { background-color: var(--primary-hover); }
.btn-small { padding: 10px 20px; font-size: 0.85rem; border-radius: 12px; }

.card { background-color: var(--bg-white); border-radius: var(--border-radius-md); box-shadow: var(--shadow-card); padding: 20px; border: 1px solid #f1f5f9; }
.form-card { padding: 24px; }
.input-group { display: flex; flex-direction: column; margin-bottom: 16px; }
.input-group label { font-size: 0.85rem; font-weight: 600; color: var(--text-dark); margin-bottom: 8px; }
.form-input { background-color: var(--bg-main); border: 1px solid #e2e8f0; border-radius: var(--border-radius-sm); padding: 14px 16px; font-size: 0.95rem; font-family: var(--font-body); color: var(--text-dark); outline: none; transition: all 0.2s; }
.form-input:focus { border-color: var(--primary-green); background-color: var(--bg-white); box-shadow: 0 0 0 3px var(--light-green); }

/* MAP PICKER CUSTOM UI */
.map-label { font-size: 0.85rem; font-weight: 600; margin-bottom: 8px; display: block; }
.mock-map { width: 100%; height: 110px; background: linear-gradient(135deg, #cad2d3 25%, #e1e7e8 100%); border-radius: var(--border-radius-sm); border: 2px dashed #94a3b8; display: flex; flex-direction: column; justify-content: center; align-items: center; cursor: pointer; transition: all 0.2s; margin-bottom: 10px; }
.mock-map:hover { border-color: var(--primary-green); background: #e2e8f0; }
.map-pin { font-size: 1.8rem; margin-bottom: 4px; animation: bounce 1.5s infinite; }
.mock-map p { font-size: 0.8rem; color: var(--text-gray); font-weight: 500; }
.geo-inputs { display: flex; gap: 10px; }
.text-center { text-align: center; }

/* DASHBOARD HEADER & CHIPS */
.dash-header { display: flex; justify-content: space-between; align-items: center; padding: 40px 24px 20px; background: var(--bg-main); position: sticky; top: 0; z-index: 10; }
.profile-area { display: flex; align-items: center; gap: 12px; }
.avatar-img { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; border: 2px solid var(--bg-white); box-shadow: var(--shadow-card); }
.user-info { display: flex; flex-direction: column; }
.welcome-text { font-size: 0.75rem; color: var(--text-gray); font-weight: 500; }
.user-name { font-size: 1rem; font-weight: 600; color: var(--text-dark); }
.icon-btn { width: 44px; height: 44px; background: var(--bg-white); border: none; border-radius: 50%; box-shadow: var(--shadow-card); cursor: pointer; display: flex; justify-content: center; align-items: center; font-size: 1.2rem; transition: transform 0.2s; }
.icon-btn:hover { transform: scale(1.05); }

.dash-content { padding: 0 24px 100px; height: calc(100% - 100px); overflow-y: auto; }
.dash-content::-webkit-scrollbar { display: none; }

.status-row { display: flex; gap: 12px; margin-bottom: 30px; overflow-x: auto; padding-bottom: 10px; }
.status-row::-webkit-scrollbar { display: none; }
.status-chip { flex: 0 0 auto; padding: 16px; border-radius: var(--border-radius-md); display: flex; flex-direction: column; gap: 4px; min-width: 135px; border: 1px solid rgba(255,255,255,0.5); }
.blue-chip { background: linear-gradient(135deg, #e6f3ff 0%, #cce5ff 100%); }
.yellow-chip { background: linear-gradient(135deg, #fff9e6 0%, #ffedb3 100%); }
.green-chip { background: linear-gradient(135deg, #e9f2eb 0%, #d1e5d5 100%); }
.chip-label { font-size: 0.75rem; color: var(--text-gray); font-weight: 500; }
.chip-val { font-size: 0.95rem; font-weight: 700; color: var(--text-dark); }

/* CARDS */
.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.farm-cards-row { display: flex; gap: 16px; margin-bottom: 30px; overflow-x: auto; padding-bottom: 15px; }
.farm-cards-row::-webkit-scrollbar { display: none; }
.farm-card { background: var(--bg-white); border-radius: var(--border-radius-md); box-shadow: var(--shadow-card); min-width: 170px; padding: 12px; cursor: pointer; transition: all 0.3s ease; border: 1px solid #f1f5f9; }
.farm-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-hover); }
.card-img-placeholder { height: 110px; border-radius: var(--border-radius-sm); margin-bottom: 12px; padding: 8px; background-size: cover; background-position: center; background-color: #e2e8f0; position: relative; }
.badge { position: absolute; left: 8px; bottom: 8px; background: rgba(255, 255, 255, 0.95); color: var(--text-dark); font-size: 0.7rem; font-weight: 700; padding: 6px 10px; border-radius: 12px; backdrop-filter: blur(4px); box-shadow: 0 2px 4px rgba(0,0,0,0.05); }
.card-body h4 { font-size: 1rem; margin-bottom: 4px; }
.card-body p { font-size: 0.75rem; color: var(--text-gray); }

/* ACTION LIST */
.action-list { display: flex; flex-direction: column; gap: 12px; }
.action-item { background: var(--bg-white); padding: 16px; border-radius: var(--border-radius-md); display: flex; align-items: center; box-shadow: var(--shadow-card); cursor: pointer; transition: transform 0.2s; border: 1px solid #f1f5f9; }
.action-item:hover { transform: scale(1.02); }
.action-icon { width: 44px; height: 44px; background-color: var(--light-green); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; margin-right: 16px; }
.action-text { flex: 1; }
.action-text h4 { font-size: 0.95rem; margin-bottom: 2px; }
.action-text p { font-size: 0.8rem; color: var(--text-gray); }
.arrow-icon { font-size: 1.5rem; color: #cbd5e1; font-weight: 300; }

/* BOTTOM NAV */
.bottom-nav { position: absolute; bottom: 24px; left: 24px; right: 24px; background: rgba(255, 255, 255, 0.9); backdrop-filter: blur(10px); border-radius: 50px; display: flex; justify-content: space-between; align-items: center; padding: 8px 16px; box-shadow: 0 12px 36px rgba(0, 0, 0, 0.08); z-index: 50; transition: opacity 0.3s ease, transform 0.3s ease; border: 1px solid rgba(255,255,255,0.5); }
.bottom-nav.hidden { opacity: 0; pointer-events: none; transform: translateY(20px); }
.nav-item { width: 48px; height: 48px; display: flex; justify-content: center; align-items: center; color: var(--nav-icon-inactive); transition: all 0.3s ease; text-decoration: none; position: relative; }
.nav-item.active { color: var(--primary-green); }
.nav-item.center-btn { background-color: var(--nav-accent); color: var(--bg-white); border-radius: 50%; width: 56px; height: 56px; box-shadow: 0 8px 16px rgba(140, 176, 104, 0.4); transform: translateY(-10px); }

/* POPULATION / REF CARDS */
.segmented-control { display: flex; background: #e2e8f0; border-radius: 50px; padding: 4px; gap: 4px; }
.segment-btn { flex: 1; padding: 12px 16px; border-radius: 50px; border: none; background: transparent; color: var(--text-gray); font-weight: 600; font-size: 0.85rem; cursor: pointer; transition: all 0.3; }
.segment-btn.active { background: var(--bg-white); color: var(--primary-green); box-shadow: var(--shadow-card); }
.ref-card { display: flex; background: var(--bg-white); border-radius: 20px; padding: 12px; gap: 16px; box-shadow: var(--shadow-card); border-left: 5px solid var(--primary-green); }
.ref-card-img { width: 90px; border-radius: 14px; background-size: cover; background-position: center; background-color: #e2e8f0; }
.ref-card-content { flex: 1; display: flex; flex-direction: column; }
.ref-card-header { display: flex; justify-content: space-between; }
.ref-card-header h4 { font-size: 1rem; line-height: 1.3; }
.ref-card-sub { font-size: 0.8rem; font-weight: 600; color: var(--primary-green); margin-top: 6px; }
.ref-card-stats { display: flex; justify-content: space-between; font-size: 0.75rem; color: var(--text-gray); margin-top: 4px; margin-bottom: 12px; font-weight: 500; }
.btn-card { padding: 10px; font-size: 0.85rem; margin-top: auto; border-radius: 12px; width: 100%; }

/* LOADERS */
.loader-small { border: 2px solid rgba(255,255,255,0.3); border-radius: 50%; border-top: 2px solid #fff; width: 18px; height: 18px; animation: spin 1s linear infinite; }
.loader-spinner { border: 4px solid rgba(255,255,255,0.3); border-radius: 50%; border-top: 4px solid #fff; width: 40px; height: 40px; animation: spin 1s linear infinite; margin: 0 auto; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

.skeleton-card { min-width: 170px; height: 180px; background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%); background-size: 200% 100%; animation: loading 1.5s infinite; border-radius: var(--border-radius-md); }
.skeleton-list { width: 100%; height: 120px; background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%); background-size: 200% 100%; animation: loading 1.5s infinite; border-radius: 20px; margin-bottom: 15px; }
@keyframes loading { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

.empty-state { text-align: center; padding: 40px 20px; color: var(--text-gray); }
.empty-state .icon { font-size: 3rem; margin-bottom: 10px; opacity: 0.5; }


/* Pastikan konten bisa di-scroll sampai ke bawah tanpa tertutup nav */
.dash-content { 
    padding: 0 24px 120px; /* Ubah padding bawah menjadi 120px */
    height: calc(100% - 100px); 
    overflow-y: auto; 
}

/* Rapikan Badge agar tidak menempel ke teks */
.badge-req {
    background-color: #fee2e2;
    color: #dc2626;
    font-size: 0.65rem;
    padding: 3px 8px;
    border-radius: 6px;
    margin-left: 8px;
    font-weight: 700;
    display: inline-block; /* Pastikan dia menjadi blok sebaris */
    transform: translateY(-2px); /* Angkat sedikit agar sejajar secara visual */
}

.badge-opt {
    background-color: #f1f5f9;
    color: #64748b;
    font-size: 0.65rem;
    padding: 3px 8px;
    border-radius: 6px;
    margin-left: 8px;
    font-weight: 600;
    display: inline-block;
    transform: translateY(-2px);
}

/* =========================================
   STYLE TAMBAHAN: DASHBOARD KOMPREHENSIF
   ========================================= */

/* Grid Ringkasan Produksi */
.summary-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.summary-box {
    background-color: var(--bg-white);
    padding: 14px 10px;
    border-radius: 14px;
    box-shadow: var(--shadow-card);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    border: 1px solid #f1f5f9;
}

.summary-label {
    font-size: 0.65rem;
    color: var(--text-gray);
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.summary-value {
    font-size: 1.2rem;
    font-weight: 700;
    font-family: var(--font-heading);
    margin-bottom: 2px;
}

.summary-unit {
    font-size: 0.7rem;
    color: var(--text-gray);
}

/* Horizontal Scroll Menu Edukasi */
.edu-scroll-row {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 10px;
    scroll-snap-type: x mandatory;
}

.edu-scroll-row::-webkit-scrollbar { display: none; }

.edu-card {
    scroll-snap-align: start;
    flex: 0 0 auto;
    width: 100px;
    background-color: var(--bg-white);
    padding: 14px 10px;
    border-radius: 16px;
    box-shadow: var(--shadow-card);
    text-align: center;
    text-decoration: none;
    color: var(--text-dark);
    transition: transform 0.2s;
    border: 1px solid #f1f5f9;
}

.edu-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.edu-icon {
    font-size: 1.8rem;
    margin-bottom: 8px;
}

.edu-card span {
    font-size: 0.75rem;
    font-weight: 600;
    display: block;
    line-height: 1.2;
}

/* Banner Seminar Ashda Nusantara */
.banner-seminar {
    background: linear-gradient(135deg, #1b4231 0%, #255741 100%);
    border-radius: 20px;
    padding: 20px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(37, 87, 65, 0.3);
    margin-bottom: 20px;
}

.banner-seminar::after {
    content: "📢";
    position: absolute;
    right: -10px;
    bottom: -20px;
    font-size: 8rem;
    opacity: 0.1;
    transform: rotate(-15deg);
}

.banner-content {
    position: relative;
    z-index: 2;
}

.banner-badge {
    background-color: #f59e0b;
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 8px;
    display: inline-block;
    margin-bottom: 10px;
    text-transform: uppercase;
}

.btn-banner {
    display: inline-block;
    background-color: var(--bg-white);
    color: var(--primary-green);
    font-size: 0.8rem;
    font-weight: 700;
    padding: 10px 16px;
    border-radius: 50px;
    text-decoration: none;
    transition: background-color 0.2s;
}

.btn-banner:hover {
    background-color: var(--light-green);
}

/* =========================================
   STYLE TAMBAHAN: AI CHAT / KONSULTASI
   ========================================= */
.ai-chat-card {
    background-color: var(--bg-white);
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 15px;
    box-shadow: var(--shadow-card);
    border: 1px solid #f1f5f9;
}

.ai-question {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-dark);
    background-color: #f1f5f9;
    padding: 12px;
    border-radius: 10px;
    margin-bottom: 12px;
    border-left: 3px solid #94a3b8;
}

.ai-answer {
    font-size: 0.85rem;
    line-height: 1.6;
    color: var(--text-dark);
}

.ai-answer strong {
    color: var(--primary-green);
}

.ai-timestamp {
    font-size: 0.7rem;
    color: var(--text-gray);
    text-align: right;
    margin-top: 10px;
    display: block;
}