:root {
    --primary-green: #2ecc71;
    --primary-green-hover: #27ae60;
    --dark-bg: #0f151f;
    /* Matching the dark header/hero */
    --card-bg: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --accent-blue: #3498db;
    --bg-body: #f1f5f9;
    --danger: #ef4444;
    --warning: #f59e0b;

    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);

    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
}

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

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.5;
}

/* Header */
header {
    background-color: var(--dark-bg);
    color: white;
    padding: 0.75rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    line-height: 1;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 700;
    font-size: 1.5rem;
    color: white;
    text-decoration: none;
}

.logo-subtitle {
    font-size: 0.6rem;
    color: var(--primary-green);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    margin-left: 2.25rem;
    /* Align under text */
    margin-top: -2px;
}

.logo span {
    color: var(--primary-green);
}

nav ul {
    display: flex;
    gap: 2rem;
    list-style: none;
}

nav a {
    color: #94a3b8;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

nav a:hover,
nav a.active {
    color: white;
}

nav a.active {
    background: rgba(255, 255, 255, 0.1);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    background: var(--primary-green);
    color: white;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.avatar {
    width: 40px;
    height: 40px;
    background-color: #334155;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    border: 2px solid var(--primary-green);
}

/* Main Container */
.container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 2rem;
}

/* Hero Section */
.hero {
    background-color: #0f172a;
    /* Slightly lighter/bluer dark */
    color: white;
    padding: 4rem;
    border-radius: 2rem;
    position: relative;
    overflow: hidden;
    margin-bottom: 3rem;
    box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    text-align: left;
}

.hero h1 {
    font-size: 2.75rem;
    margin-bottom: 1rem;
    font-weight: 800;
    letter-spacing: -0.025em;
}

.hero p {
    color: #94a3b8;
    margin-bottom: 2.5rem;
    max-width: 600px;
    font-size: 1.1rem;
}

.search-bar {
    display: flex;
    background: #1e293b;
    padding: 0.35rem;
    border-radius: 0.75rem;
    max-width: 600px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.search-bar input {
    background: transparent;
    border: none;
    color: white;
    padding: 0.75rem 1.25rem;
    flex: 1;
    outline: none;
    font-size: 1rem;
}

.search-bar input::placeholder {
    color: #64748b;
}

.search-bar button {
    background-color: var(--primary-green);
    color: white;
    border: none;
    padding: 0.5rem 2rem;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
    font-size: 1rem;
}

.search-bar button:hover {
    background-color: var(--primary-green-hover);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.stat-card {
    background: var(--card-bg);
    padding: 1.5rem 2rem;
    border-radius: 1rem;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.05);
    display: flex;
    align-items: center;
    gap: 1.5rem;
    border: none;
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.stat-icon.blue {
    background-color: #e0f2fe;
    color: #0284c7;
}

.stat-icon.green {
    background-color: #dcfce7;
    color: #16a34a;
}

.stat-icon.purple {
    background-color: #f3e8ff;
    color: #9333ea;
}

.stat-icon.orange {
    background-color: #ffedd5;
    color: #ea580c;
}

.stat-info h3 {
    font-size: 0.7rem;
    text-transform: uppercase;
    font-weight: 700;
    color: #94a3b8;
    margin-bottom: 0.1rem;
    letter-spacing: 0.05em;
}

.stat-info .value {
    font-size: 1.75rem;
    font-weight: 800;
    color: #0f172a;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
}

@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.section-header h2 {
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.section-header a {
    color: var(--primary-green);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.875rem;
}

/* Advice Card */
.advice-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    margin-bottom: 2rem;
}

.advice-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.tag {
    background: #dcfce7;
    color: #166534;
    padding: 0.25rem 0.75rem;
    border-radius: 100px;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
}

.advice-card h3 {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
}

.advice-card p {
    color: var(--text-muted);
    font-style: italic;
    margin-bottom: 2rem;
}

.action-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.step-circle {
    width: 24px;
    height: 24px;
    background: #f1f5f9;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
}

/* AI Diagnose Card */
.ai-card {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: white;
    border-radius: 1.25rem;
    padding: 2.5rem;
    display: flex;
    align-items: center;
    gap: 2rem;
    box-shadow: 0 10px 15px -3px rgba(37, 99, 235, 0.4);
    margin-top: 2rem;
}

.ai-icon {
    width: 64px;
    height: 64px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    flex-shrink: 0;
}


.ai-content {
    flex: 1;
}

.ai-content h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.ai-content p {
    font-size: 0.9rem;
    opacity: 0.9;
    margin-bottom: 0;
}

.btn-white {
    background: white;
    color: #2563eb;
    text-decoration: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    white-space: nowrap;
}

/* Product List - Sidebar */
.product-card-container {
    background: var(--card-bg);
    border-radius: 1.25rem;
    padding: 1.5rem;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.05);
}

.product-item {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.product-item:last-child {
    border-bottom: none;
    padding-bottom: 0.5rem;
}

.product-item:first-child {
    padding-top: 0.5rem;
}

.product-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.25rem;
}

.vendor {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: #94a3b8;
    font-weight: 700;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
    display: block;
}

.product-item h4 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 0.5rem;
}

.tag-sm {
    font-size: 0.65rem;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-weight: 700;
    text-transform: uppercase;
}

.tag-fungicide {
    background: #eff6ff;
    color: #3b82f6;
}

.tag-insecticide {
    background: #fff7ed;
    color: #f97316;
}

.meta-info {
    font-size: 0.85rem;
    margin-bottom: 1rem;
    color: #64748b;
}

.badge-group {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.badge {
    background: #f8fafc;
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
    font-size: 0.75rem;
    color: #64748b;
    border: 1px solid #e2e8f0;
    font-weight: 500;
}

.product-footer {
    display: flex;
    justify-content: flex-end;
}

.link-arrow {
    font-size: 0.8rem;
    color: #64748b;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-weight: 600;
    transition: color 0.2s;
}

.link-arrow:hover {
    color: var(--primary-green);
}

.catalog-link {
    display: block;
    background: #f8fafc;
    text-align: center;
    padding: 1rem;
    border-radius: 0.75rem;
    color: #475569;
    font-weight: 600;
    text-decoration: none;
    margin-top: 1rem;
    font-size: 0.9rem;
    transition: background 0.2s;
}

.catalog-link:hover {
    background: #f1f5f9;
}