/* ============================================================
   agro-ui.css — openAgro Light Theme
   Follows openHealth dental module UI pattern:
   clean white cards / slate-100 background / brand accent edges.
   ============================================================ */

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

body {
    margin: 0; min-height: 100vh; overflow-x: hidden;
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    color: #1e293b;
    background-color: #f1f5f9;
}

/* ── App card (glass-card kept as alias for backward compat) ─── */
.glass-card, .app-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06), 0 0 1px rgba(0,0,0,0.04);
}

/* ── Animations ──────────────────────────────────────────────── */
.widget-enter { animation: agFadeIn 0.4s ease-out both; }
.screen-enter { animation: agFadeIn 0.3s ease-out both; }

@keyframes agFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Footer (dark — intentional, matches dental pattern) ────── */
.footer-shell {
    border-top: 1px solid #e2e8f0;
    background: #1e293b;
    padding: 2rem 1.5rem;
    text-align: center;
}
.footer-disclaimer {
    max-width: 42rem; margin: 0 auto 0.5rem;
    color: rgba(255, 255, 255, 0.65); font-size: 0.75rem; line-height: 1.7;
}
.footer-year {
    color: rgba(255, 255, 255, 0.35); font-size: 0.625rem;
    font-family: monospace; font-weight: 700;
    letter-spacing: 0.08em; text-transform: uppercase;
}

/* ── Section heading ─────────────────────────────────────────── */
.ag-section-title {
    font-size: 0.6875rem; font-weight: 800; letter-spacing: 0.12em;
    text-transform: uppercase; color: #64748b; margin-bottom: 0.25rem;
}

/* ── Form elements ───────────────────────────────────────────── */
.ag-label {
    display: block; font-size: 0.8125rem; font-weight: 700;
    color: #475569; margin-bottom: 0.375rem;
    letter-spacing: 0.04em; text-transform: uppercase;
}
.ag-input {
    width: 100%; padding: 0.875rem 1rem; border-radius: 0.75rem;
    font-size: 0.9375rem; color: #1e293b;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-left: 6px solid #22c55e;
    outline: none; transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
    font-family: inherit;
}
.ag-input:focus {
    border-color: #22c55e;
    border-left-color: #22c55e;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.12);
    background: #ffffff;
}
.ag-input::placeholder { color: #94a3b8; }
select.ag-input option { background: #ffffff; color: #1e293b; }
textarea.ag-input { resize: vertical; min-height: 6rem; }

/* ── Buttons ─────────────────────────────────────────────────── */
.ag-btn-primary {
    display: inline-flex; align-items: center; justify-content: center;
    gap: 0.5rem; padding: 0.9375rem 1.5rem; border-radius: 0.875rem;
    font-weight: 700; font-size: 0.9375rem; font-family: inherit;
    color: #ffffff; background: #22c55e; border: none; cursor: pointer;
    width: 100%; transition: background 0.15s, transform 0.1s;
}
.ag-btn-primary:hover { background: #16a34a; }
.ag-btn-primary:active { transform: scale(0.98); }
.ag-btn-primary:disabled { opacity: 0.55; cursor: not-allowed; }

.ag-btn-secondary {
    display: inline-flex; align-items: center; justify-content: center;
    gap: 0.5rem; padding: 0.625rem 1.125rem; border-radius: 0.75rem;
    font-weight: 600; font-size: 0.875rem; font-family: inherit;
    color: #64748b; background: #f8fafc;
    border: 1px solid #e2e8f0; cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
.ag-btn-secondary:hover { background: #f1f5f9; border-color: #cbd5e1; }

.ag-btn-danger {
    display: inline-flex; align-items: center; justify-content: center;
    gap: 0.375rem; padding: 0.5rem 0.875rem; border-radius: 0.625rem;
    font-weight: 600; font-size: 0.8125rem; font-family: inherit;
    color: #dc2626; background: #fef2f2;
    border: 1px solid #fecaca; cursor: pointer;
    transition: background 0.15s;
}
.ag-btn-danger:hover { background: #fee2e2; }

.ag-btn-icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 2.5rem; height: 2.5rem; border-radius: 0.75rem;
    background: rgba(34, 197, 94, 0.10);
    border: 1px solid rgba(34, 197, 94, 0.25);
    color: #16a34a; cursor: pointer; transition: background 0.15s;
    flex-shrink: 0; font-family: inherit;
}
.ag-btn-icon:hover { background: rgba(34, 197, 94, 0.18); }

/* ── Status badge ────────────────────────────────────────────── */
.ag-badge {
    display: inline-flex; align-items: center; gap: 0.25rem;
    padding: 0.125rem 0.625rem; border-radius: 999px;
    font-size: 0.6875rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.06em;
}

/* ── List item ───────────────────────────────────────────────── */
.ag-list-item {
    display: flex; align-items: center; gap: 0.875rem;
    padding: 1rem 1.125rem; border-radius: 1rem;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    transition: background 0.15s, border-color 0.15s;
}
.ag-list-item:hover { background: #f8fafc; border-color: rgba(34, 197, 94, 0.30); }

/* ── Icon shell ──────────────────────────────────────────────── */
.ag-icon-shell {
    width: 2.75rem; height: 2.75rem; border-radius: 0.875rem;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}

/* ── Stat card ───────────────────────────────────────────────── */
.ag-stat {
    background: #ffffff; border-radius: 0.875rem;
    border: 1px solid #e2e8f0; padding: 1rem;
    text-align: center;
}
.ag-stat-value { font-size: 1.25rem; font-weight: 800; color: #0f172a; line-height: 1.2; }
.ag-stat-label {
    font-size: 0.6875rem; font-weight: 600; color: #64748b;
    text-transform: uppercase; letter-spacing: 0.08em; margin-top: 0.25rem;
}

/* ── Empty state ─────────────────────────────────────────────── */
.ag-empty {
    text-align: center; padding: 3rem 1.5rem; color: #94a3b8;
}
.ag-empty p { margin: 0.5rem 0 0; }

/* ── Chat bubbles ───────────────────────────────────────────── */
.ag-chat-box {
    min-height: 300px; max-height: 55vh; overflow-y: auto;
    padding: 1rem; border-radius: 1rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    display: flex; flex-direction: column; gap: 0.75rem;
}
.ag-bubble-bot {
    align-self: flex-start; max-width: 85%;
    padding: 0.75rem 1rem; border-radius: 1rem 1rem 1rem 0.25rem;
    background: rgba(34, 197, 94, 0.08); border: 1px solid rgba(34, 197, 94, 0.2);
    font-size: 0.9rem; line-height: 1.6; color: #1e293b;
}
.ag-bubble-user {
    align-self: flex-end; max-width: 85%;
    padding: 0.75rem 1rem; border-radius: 1rem 1rem 0.25rem 1rem;
    background: rgba(34, 197, 94, 0.15); border: 1px solid rgba(34, 197, 94, 0.30);
    font-size: 0.9rem; line-height: 1.6; color: #0f172a;
}
.ag-chip-row { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.5rem; }
.ag-chip {
    padding: 0.375rem 0.875rem; border-radius: 999px;
    font-size: 0.8125rem; font-weight: 600; font-family: inherit; cursor: pointer;
    background: #ffffff; border: 1px solid #e2e8f0;
    color: #475569; transition: background 0.15s, border-color 0.15s;
}
.ag-chip:hover { background: rgba(34, 197, 94, 0.08); border-color: rgba(34, 197, 94, 0.30); color: #166534; }

/* ── Info card ──────────────────────────────────────────────── */
.ag-info-card {
    border-radius: 1rem; padding: 1.25rem;
    border: 1px solid #e2e8f0;
    background: #ffffff;
}
.ag-info-card h5 { margin: 0 0 0.75rem; font-size: 1rem; font-weight: 700; color: #0f172a; }
.ag-info-card p, .ag-info-card li { font-size: 0.875rem; color: #475569; line-height: 1.6; margin: 0 0 0.5rem; }
.ag-info-card ul { padding-left: 0; list-style: none; }

/* ── Divider ────────────────────────────────────────────────── */
.ag-divider { height: 1px; background: #e2e8f0; margin: 1.25rem 0; }

/* ── Lucide icon sizing ────────────────────────────────────── */
[data-lucide] { display: inline-block; vertical-align: middle; }

/* ── Home screen card (shared pattern across all openApps) ──── */
.home-card {
    background: #ffffff;
    padding: 1.25rem;
    border-radius: 1.125rem;
    border: 1px solid #e2e8f0;
    min-height: 210px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    transition: border-color 0.2s, transform 0.15s, box-shadow 0.2s;
}
.home-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.10);
}
.home-card:active { transform: scale(0.98); }

/* ── Alert strip ────────────────────────────────────────────── */
.ag-alert {
    display: flex; align-items: flex-start; gap: 0.625rem;
    padding: 0.75rem 1rem; border-radius: 0.75rem;
    font-size: 0.875rem; font-weight: 500; line-height: 1.5;
}
.ag-alert-success { background: #f0fdf4; border: 1px solid #86efac; color: #166534; }
.ag-alert-error   { background: #fef2f2; border: 1px solid #fca5a5; color: #dc2626; }
.ag-alert-warning { background: #fffbeb; border: 1px solid #fde68a; color: #d97706; }
.ag-alert-info    { background: #eff6ff; border: 1px solid #bfdbfe; color: #1d4ed8; }

/* ── Ghost button (secondary text-only) ─────────────────────── */
.ag-btn-ghost {
    display: flex; align-items: center; justify-content: center; gap: 0.375rem;
    padding: 0.75rem 1.25rem; border-radius: 0.875rem;
    font-size: 0.9375rem; font-weight: 600; font-family: inherit;
    background: transparent; border: 1px solid #e2e8f0;
    color: #64748b; cursor: pointer; transition: background 0.15s, border-color 0.15s;
    width: 100%;
}
.ag-btn-ghost:hover  { background: #f8fafc; border-color: #cbd5e1; }
.ag-btn-ghost:active { transform: scale(0.98); }

/* ── Setup step container ───────────────────────────────────── */
.setup-step h2  { color: #0f172a; }
