/* =============================================
   SHAMBA SALAMA — Design System
   Inspired by Twiga Foods, Apollo Agriculture,
   Hello Tractor, Farmers Business Network
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
    --green-50:  #f0fdf4;
    --green-100: #dcfce7;
    --green-200: #bbf7d0;
    --green-500: #22c55e;
    --green-600: #16a34a;
    --green-700: #15803d;
    --green-800: #166534;
    --green-900: #14532d;

    --amber-50:  #fffbeb;
    --amber-100: #fef3c7;
    --amber-400: #fbbf24;
    --amber-500: #f59e0b;
    --amber-600: #d97706;

    --blue-50:  #eff6ff;
    --blue-200: #bfdbfe;
    --blue-500: #3b82f6;
    --blue-600: #2563eb;

    --gray-50:  #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;

    --primary:   var(--green-700);
    --primary-hover: var(--green-800);
    --surface:   #ffffff;
    --surface-2: var(--gray-50);
    --border:    var(--gray-200);
    --text:      var(--gray-900);
    --text-muted: var(--gray-500);

    --radius-sm: 8px;
    --radius:    12px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow:    0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -1px rgba(0,0,0,0.04);
    --shadow-md: 0 10px 15px -3px rgba(0,0,0,0.07), 0 4px 6px -2px rgba(0,0,0,0.04);
    --shadow-lg: 0 20px 25px -5px rgba(0,0,0,0.08), 0 10px 10px -5px rgba(0,0,0,0.03);
}

/* ---- Base ---- */
*, *::before, *::after { box-sizing: border-box; }

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--gray-50);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
    font-weight: 700;
    line-height: 1.25;
    color: var(--gray-900);
}

/* ---- Navbar ---- */
.navbar {
    background: rgba(22, 101, 52, 0.97) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255,255,255,0.08);
    padding: 0.75rem 0;
}

.navbar-brand {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 800;
    font-size: 1.3rem !important;
    letter-spacing: -0.3px;
    color: #fff !important;
}

.navbar-brand .leaf-icon {
    display: inline-flex;
    width: 32px;
    height: 32px;
    background: var(--green-500);
    border-radius: 8px;
    align-items: center;
    justify-content: center;
    margin-right: 8px;
    font-size: 1rem;
}

.navbar .nav-link {
    font-weight: 500;
    font-size: 0.9rem;
    color: rgba(255,255,255,0.85) !important;
    padding: 0.5rem 0.9rem !important;
    border-radius: var(--radius-sm);
    transition: all 0.15s ease;
}

.navbar .nav-link:hover,
.navbar .nav-link.active {
    color: #fff !important;
    background: rgba(255,255,255,0.1);
}

.navbar .dropdown-menu {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 0.5rem;
    min-width: 200px;
}

.navbar .dropdown-item {
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.55rem 0.85rem;
    color: var(--gray-700);
    transition: background 0.12s;
}

.navbar .dropdown-item:hover {
    background: var(--green-50);
    color: var(--green-700);
}

.navbar-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.3);
    object-fit: cover;
}

/* ---- Buttons ---- */
.btn {
    font-weight: 600;
    font-size: 0.875rem;
    border-radius: var(--radius-sm);
    transition: all 0.15s ease;
    letter-spacing: 0.01em;
}

.btn-success,
.btn-primary-green {
    background: var(--green-700) !important;
    border-color: var(--green-700) !important;
    color: #fff !important;
    box-shadow: 0 1px 2px rgba(21,128,61,0.2);
}

.btn-success:hover {
    background: var(--green-800) !important;
    border-color: var(--green-800) !important;
    box-shadow: 0 4px 12px rgba(21,128,61,0.3);
    transform: translateY(-1px);
}

.btn-success:active { transform: translateY(0); }

.btn-outline-success {
    color: var(--green-700) !important;
    border-color: var(--green-700) !important;
    background: transparent !important;
}

.btn-outline-success:hover {
    background: var(--green-700) !important;
    color: #fff !important;
    transform: translateY(-1px);
}

.btn-warning {
    background: var(--amber-500) !important;
    border-color: var(--amber-500) !important;
    color: #fff !important;
}

.btn-warning:hover {
    background: var(--amber-600) !important;
    border-color: var(--amber-600) !important;
    color: #fff !important;
}

.btn-lg { padding: 0.75rem 1.75rem; font-size: 0.95rem; border-radius: var(--radius); }
.btn-sm { padding: 0.4rem 0.85rem; font-size: 0.8rem; }

/* ---- Cards ---- */
.card {
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-lg) !important;
    box-shadow: var(--shadow-sm);
    background: var(--surface);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.card-header {
    border-radius: var(--radius-lg) var(--radius-lg) 0 0 !important;
    border-bottom: 1px solid var(--border) !important;
    background: var(--surface) !important;
    padding: 1rem 1.25rem;
}

.card-header.bg-success,
.card-header.bg-green {
    background: var(--green-700) !important;
    border-bottom: none !important;
    color: #fff !important;
}

.card-header.bg-warning {
    background: var(--amber-500) !important;
    border-bottom: none !important;
}

/* ---- Listing Cards ---- */
.listing-card {
    cursor: pointer;
}

.listing-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md) !important;
    border-color: var(--green-200) !important;
}

/* ---- Feature Cards ---- */
.feature-card {
    border: 1px solid var(--border) !important;
    transition: all 0.2s ease;
}

.feature-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-md) !important;
    border-color: var(--green-200) !important;
}

.feature-icon {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
}

/* ---- Hero Section ---- */
.hero-section {
    background: linear-gradient(135deg, #0d4a1f 0%, #166534 40%, #15803d 100%);
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(34,197,94,0.15) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 20%, rgba(251,191,36,0.08) 0%, transparent 50%);
    pointer-events: none;
}

.hero-section .container { position: relative; z-index: 1; }

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(251,191,36,0.15);
    border: 1px solid rgba(251,191,36,0.3);
    color: var(--amber-400);
    padding: 6px 14px;
    border-radius: 100px;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    margin-bottom: 1.25rem;
}

.hero-title {
    font-size: clamp(2rem, 5vw, 3.25rem);
    font-weight: 800;
    line-height: 1.15;
    color: #fff;
    letter-spacing: -0.5px;
    margin-bottom: 1.25rem;
}

.hero-title .highlight { color: var(--amber-400); }

.hero-subtitle {
    font-size: 1.05rem;
    color: rgba(255,255,255,0.8);
    line-height: 1.7;
    max-width: 480px;
    margin-bottom: 2rem;
}

.hero-stat-card {
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    text-align: center;
    backdrop-filter: blur(8px);
    min-width: 130px;
    transition: background 0.2s;
}

.hero-stat-card:hover { background: rgba(255,255,255,0.12); }
.hero-stat-number { font-size: 2rem; font-weight: 800; color: var(--amber-400); line-height: 1; }
.hero-stat-label { font-size: 0.75rem; color: rgba(255,255,255,0.75); margin-top: 4px; font-weight: 500; }

/* ---- Section Styles ---- */
.section-label {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--green-700);
    background: var(--green-50);
    border: 1px solid var(--green-200);
    padding: 4px 12px;
    border-radius: 100px;
    margin-bottom: 0.75rem;
}

.section-title {
    font-size: clamp(1.5rem, 3vw, 2.25rem);
    font-weight: 800;
    color: var(--gray-900);
    letter-spacing: -0.3px;
}

.section-subtitle {
    font-size: 1rem;
    color: var(--text-muted);
    max-width: 520px;
    margin: 0 auto;
    line-height: 1.7;
}

/* ---- Forms ---- */
.form-control, .form-select {
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    padding: 0.6rem 0.875rem;
    color: var(--gray-800);
    background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.form-control:focus, .form-select:focus {
    border-color: var(--green-500);
    box-shadow: 0 0 0 3px rgba(34,197,94,0.12);
    outline: none;
}

.form-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 0.4rem;
}

.form-text {
    font-size: 0.78rem;
    color: var(--gray-400);
}

.input-group-text {
    background: var(--gray-50);
    border: 1.5px solid var(--gray-200);
    color: var(--gray-500);
}

/* ---- Badges ---- */
.badge {
    font-weight: 600;
    font-size: 0.72rem;
    letter-spacing: 0.02em;
    padding: 0.35em 0.7em;
    border-radius: 6px;
}

/* ---- Alerts ---- */
.alert {
    border: none;
    border-radius: var(--radius);
    border-left: 4px solid transparent;
    font-size: 0.875rem;
}

.alert-success { background: var(--green-50); border-left-color: var(--green-500); color: var(--green-800); }
.alert-warning { background: var(--amber-50); border-left-color: var(--amber-500); color: #92400e; }
.alert-danger  { background: #fef2f2; border-left-color: #ef4444; color: #991b1b; }
.alert-info    { background: #eff6ff; border-left-color: #3b82f6; color: #1e40af; }

/* ---- Tables ---- */
.table {
    font-size: 0.875rem;
    color: var(--gray-700);
}

.table thead th {
    font-weight: 600;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-500);
    background: var(--gray-50);
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 1rem;
}

.table td {
    padding: 0.875rem 1rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--gray-100);
}

.table-hover tbody tr:hover { background: var(--green-50); }

/* ---- Dashboard ---- */
.dashboard-stat {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    transition: box-shadow 0.2s;
}

.dashboard-stat:hover { box-shadow: var(--shadow-md); }

.dashboard-stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}

/* ---- Progress Steps ---- */
.step-indicator {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.step-indicator.active {
    background: var(--green-700);
    color: #fff;
    box-shadow: 0 0 0 4px var(--green-100);
}

.step-indicator.done {
    background: var(--green-600);
    color: #fff;
}

.step-indicator.pending {
    background: var(--gray-100);
    color: var(--gray-400);
    border: 2px solid var(--gray-200);
}

/* ---- ShambaBot Chat ---- */
#chat-messages {
    scroll-behavior: smooth;
    background: var(--gray-50);
}

.chat-bubble-bot {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 0 var(--radius) var(--radius) var(--radius);
    padding: 0.875rem 1rem;
    font-size: 0.9rem;
    line-height: 1.65;
    white-space: pre-wrap;
    box-shadow: var(--shadow-sm);
}

.chat-bubble-user {
    background: var(--green-700);
    color: #fff;
    border-radius: var(--radius) 0 var(--radius) var(--radius);
    padding: 0.875rem 1rem;
    font-size: 0.9rem;
    line-height: 1.65;
}

.chat-avatar-bot {
    width: 36px;
    height: 36px;
    background: var(--green-700);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.chat-avatar-user {
    width: 36px;
    height: 36px;
    background: var(--gray-200);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* ---- Footer ---- */
.footer {
    background: var(--gray-900);
    color: rgba(255,255,255,0.7);
    font-size: 0.875rem;
}

.footer-brand { font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 800; color: #fff; }
.footer a { color: rgba(255,255,255,0.55); text-decoration: none; transition: color 0.15s; }
.footer a:hover { color: var(--green-400); }
.footer-divider { border-color: rgba(255,255,255,0.1); }

/* ---- Utility ---- */
.bg-green-50  { background: var(--green-50); }
.bg-green-700 { background: var(--green-700) !important; }
.text-green   { color: var(--green-700) !important; }
.text-muted   { color: var(--gray-400) !important; }
.border-green { border-color: var(--green-200) !important; }

.rounded-xl { border-radius: var(--radius-xl) !important; }
.rounded-lg { border-radius: var(--radius-lg) !important; }

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--gray-100); }
::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--gray-400); }

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .hero-title { font-size: 2rem; }
    .hero-section { padding: 3rem 0; }
    .hero-stat-card { min-width: 100px; padding: 1rem; }
    .hero-stat-number { font-size: 1.5rem; }
}
