/* =========================================================
   AI Smart Farming Management System - Master Stylesheet
   Modern Agricultural & Green Technology UI Design System
   ========================================================= */

:root {
    /* Color Palette */
    --bg-primary: #080e11;
    --bg-secondary: #0c1518;
    --bg-card: rgba(16, 27, 31, 0.85);
    --bg-card-hover: rgba(22, 38, 43, 0.95);
    --bg-card-subtle: rgba(255, 255, 255, 0.03);
    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-emerald: rgba(16, 185, 129, 0.25);
    --border-glow: rgba(16, 185, 129, 0.4);

    /* Brand Green & Accents */
    --emerald-50: #ecfdf5;
    --emerald-400: #34d399;
    --emerald-500: #10b981;
    --emerald-600: #059669;
    --emerald-glow: rgba(16, 185, 129, 0.28);

    /* Environmental Telemetry Colors */
    --soil-color: #10b981;
    --temp-color: #f59e0b;
    --humidity-color: #06b6d4;
    --rain-color: #3b82f6;
    --light-color: #fbbf24;
    --air-color: #8b5cf6;
    --danger-color: #ef4444;
    --danger-glow: rgba(239, 68, 68, 0.25);

    /* Text Colors */
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --text-white: #ffffff;

    /* Typography */
    --font-main: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    /* Shadows & Transitions */
    --shadow-card: 0 10px 30px -10px rgba(0, 0, 0, 0.5), 0 0 1px 1px rgba(255, 255, 255, 0.05);
    --shadow-glow: 0 0 35px -5px rgba(16, 185, 129, 0.25);
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 26px;
    --transition-fast: 0.18s ease;
    --transition-smooth: 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ----------------------------------------------------
   Reset & Baseline
   ---------------------------------------------------- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-main);
    -webkit-font-smoothing: antialiased;
}

body {
    min-height: 100vh;
    background: radial-gradient(circle at 15% 10%, rgba(16, 185, 129, 0.08) 0%, transparent 45%),
                radial-gradient(circle at 85% 80%, rgba(6, 182, 212, 0.06) 0%, transparent 50%),
                var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

button, input, select {
    font-family: inherit;
}

code {
    font-family: var(--font-mono);
}

/* ----------------------------------------------------
   Auth / Login Page Styles
   ---------------------------------------------------- */
.auth-body {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.auth-wrapper {
    width: 100%;
    max-width: 440px;
    margin: auto;
}

.auth-card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-emerald);
    box-shadow: var(--shadow-card), var(--shadow-glow);
    border-radius: var(--radius-xl);
    padding: 2.5rem 2rem;
    position: relative;
    overflow: hidden;
}

.auth-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #10b981, #34d399, #06b6d4);
}

.auth-brand {
    text-align: center;
    margin-bottom: 2rem;
}

.brand-badge-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(6, 182, 212, 0.2));
    border: 1px solid var(--emerald-400);
    border-radius: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    color: var(--emerald-400);
    margin-bottom: 1rem;
    box-shadow: 0 0 20px var(--emerald-glow);
}

.brand-title {
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, #ffffff 30%, var(--emerald-400) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.brand-subtitle {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 0.35rem;
}

.auth-alert {
    padding: 0.85rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 1.25rem;
}

.alert-error {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

.alert-success {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid var(--border-emerald);
    color: var(--emerald-400);
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.45rem;
}

.form-group label i {
    color: var(--emerald-400);
    margin-right: 0.3rem;
}

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(8, 14, 17, 0.75);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.95rem;
    outline: none;
    transition: var(--transition-fast);
}

.form-input:focus {
    border-color: var(--emerald-500);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
    background: rgba(8, 14, 17, 0.95);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.35rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    border: none;
    transition: var(--transition-fast);
}

.btn-primary {
    background: linear-gradient(135deg, var(--emerald-500), var(--emerald-600));
    color: #ffffff;
    box-shadow: 0 4px 15px var(--emerald-glow);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--emerald-400), var(--emerald-500));
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.btn-block {
    width: 100%;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--emerald-500);
    color: var(--emerald-400);
}

.btn-sm {
    padding: 0.45rem 0.85rem;
    font-size: 0.8rem;
}

.btn-xs {
    padding: 0.3rem 0.6rem;
    font-size: 0.75rem;
}

.auth-hint {
    background: rgba(255, 255, 255, 0.03);
    border: 1px dashed var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
    margin-top: 1.5rem;
    font-size: 0.78rem;
}

.hint-header {
    font-weight: 600;
    color: var(--temp-color);
    margin-bottom: 0.3rem;
}

.hint-body {
    display: flex;
    gap: 1rem;
    color: var(--text-secondary);
}

.hint-body code {
    color: var(--emerald-400);
    background: rgba(16, 185, 129, 0.1);
    padding: 0.15rem 0.35rem;
    border-radius: 4px;
}

.auth-footer {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.auth-hostinger-tag {
    color: var(--emerald-400);
    margin-top: 0.25rem;
}

/* ----------------------------------------------------
   App Layout Structure (Sidebar + Main)
   ---------------------------------------------------- */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.app-sidebar {
    width: 260px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    transition: transform var(--transition-smooth);
}

.sidebar-brand {
    padding: 1.5rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 1px solid var(--border-subtle);
}

.brand-logo-glow {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.25), rgba(6, 182, 212, 0.2));
    border: 1px solid var(--emerald-400);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--emerald-400);
    font-size: 1.25rem;
    box-shadow: 0 0 15px var(--emerald-glow);
}

.brand-text .brand-title {
    font-size: 1.05rem;
    font-weight: 700;
    display: block;
    line-height: 1.2;
}

.brand-text .brand-tag {
    font-size: 0.7rem;
    color: var(--text-muted);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.sidebar-close-btn {
    display: none;
    margin-left: auto;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
}

.sidebar-nav {
    flex: 1;
    padding: 1.25rem 0.85rem;
    overflow-y: auto;
}

.nav-section-title {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    padding: 0.5rem 0.75rem;
    margin-top: 0.5rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.85rem;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.86rem;
    font-weight: 500;
    margin-bottom: 0.2rem;
    transition: var(--transition-fast);
    position: relative;
}

.nav-link i {
    font-size: 1rem;
    width: 20px;
    text-align: center;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
}

.nav-link.active {
    background: rgba(16, 185, 129, 0.12);
    color: var(--emerald-400);
    font-weight: 600;
}

.nav-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 15%;
    bottom: 15%;
    width: 3px;
    background: var(--emerald-400);
    border-radius: 0 4px 4px 0;
    box-shadow: 0 0 10px var(--emerald-400);
}

.nav-badge {
    margin-left: auto;
    background: var(--danger-color);
    color: #fff;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    box-shadow: 0 0 10px var(--danger-glow);
}

.sidebar-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(8, 14, 17, 0.5);
}

.device-mini-status {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.pulse-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    position: relative;
}

.pulse-indicator.online {
    background-color: var(--emerald-400);
    box-shadow: 0 0 10px var(--emerald-400);
}

.pulse-indicator.online::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid var(--emerald-400);
    top: -2px;
    left: -2px;
    animation: pulseRing 2s infinite;
}

.pulse-indicator.offline {
    background-color: var(--danger-color);
    box-shadow: 0 0 10px var(--danger-color);
}

@keyframes pulseRing {
    0% { transform: scale(1); opacity: 0.8; }
    100% { transform: scale(2.6); opacity: 0; }
}

.mini-status-text .label {
    display: block;
    font-size: 0.65rem;
    color: var(--text-muted);
}

.mini-status-text .status {
    display: block;
    font-size: 0.78rem;
    color: var(--text-primary);
}

.btn-logout {
    color: var(--text-muted);
    font-size: 1rem;
    padding: 0.4rem;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
}

.btn-logout:hover {
    color: var(--danger-color);
    background: rgba(239, 68, 68, 0.1);
}

/* ----------------------------------------------------
   Main Content Area
   ---------------------------------------------------- */
.main-wrapper {
    flex: 1;
    margin-left: 260px;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* Top Navbar */
.top-navbar {
    height: 70px;
    background: rgba(8, 14, 17, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    position: sticky;
    top: 0;
    z-index: 90;
}

.navbar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.mobile-toggle-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.25rem;
    cursor: pointer;
}

.page-title {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.page-subtitle {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.navbar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Device Pill */
.device-pill {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.85rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    border: 1px solid var(--border-subtle);
    background: rgba(255, 255, 255, 0.03);
}

.device-pill.online {
    border-color: var(--border-emerald);
    background: rgba(16, 185, 129, 0.08);
}

.device-pill.online .pill-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--emerald-400);
    box-shadow: 0 0 8px var(--emerald-400);
}

.device-pill.offline {
    border-color: rgba(239, 68, 68, 0.3);
    background: rgba(239, 68, 68, 0.08);
}

.device-pill.offline .pill-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--danger-color);
    box-shadow: 0 0 8px var(--danger-color);
}

.pill-time {
    color: var(--text-muted);
    font-size: 0.72rem;
    padding-left: 0.25rem;
    border-left: 1px solid var(--border-subtle);
}

.alert-bell {
    position: relative;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    transition: var(--transition-fast);
}

.alert-bell:hover {
    border-color: var(--emerald-500);
    color: var(--emerald-400);
    background: rgba(255, 255, 255, 0.04);
}

.bell-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--danger-color);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--bg-primary);
}

.user-profile-menu {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.3rem 0.6rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
}

.user-profile-menu .avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--emerald-500), #06b6d4);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.85rem;
}

.user-info .user-name {
    font-size: 0.82rem;
    font-weight: 600;
    display: block;
    line-height: 1.1;
}

.user-info .user-role {
    font-size: 0.68rem;
    color: var(--text-muted);
}

/* ----------------------------------------------------
   Dashboard Content & Grid Cards
   ---------------------------------------------------- */
.dashboard-content {
    flex: 1;
    padding: 2rem;
}

/* Shared Card Styles */
.dashboard-card {
    background: var(--bg-card);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    position: relative;
    overflow: hidden;
    transition: border-color var(--transition-smooth), transform var(--transition-smooth);
}

.dashboard-card:hover {
    border-color: rgba(255, 255, 255, 0.14);
}

.card-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.card-header-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.card-header-title h3 {
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.2;
}

.card-header-title .subtitle {
    font-size: 0.74rem;
    color: var(--text-muted);
}

.icon-chip {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.chip-ai {
    background: rgba(16, 185, 129, 0.15);
    color: var(--emerald-400);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.chip-pump {
    background: rgba(6, 182, 212, 0.15);
    color: var(--humidity-color);
    border: 1px solid rgba(6, 182, 212, 0.3);
}

.chip-soil-chart {
    background: rgba(16, 185, 129, 0.15);
    color: var(--emerald-400);
}

.chip-temp-chart {
    background: rgba(245, 158, 11, 0.15);
    color: var(--temp-color);
}

.chip-alert {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger-color);
}

.chip-hardware {
    background: rgba(139, 92, 246, 0.15);
    color: var(--air-color);
}

.chip-sim {
    background: rgba(251, 191, 36, 0.15);
    color: var(--light-color);
}

.live-pill {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--emerald-400);
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid var(--border-emerald);
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
}

.live-pill i {
    animation: blinkDot 1.5s infinite;
}

@keyframes blinkDot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.card-body {
    padding: 1.5rem;
}

/* ----------------------------------------------------
   Hero Grid: AI Recommendation + Pump Control
   ---------------------------------------------------- */
.hero-grid {
    display: grid;
    grid-template-columns: 1.35fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* AI Recommendation Hero Card */
.ai-hero-card {
    border-color: var(--border-emerald);
    background: linear-gradient(145deg, rgba(16, 27, 31, 0.95), rgba(12, 38, 30, 0.6));
    box-shadow: var(--shadow-card), 0 0 35px -10px rgba(16, 185, 129, 0.2);
}

.ai-status-banner {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
    border-radius: var(--radius-md);
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-subtle);
    margin-bottom: 1.25rem;
    transition: var(--transition-fast);
}

.ai-status-banner[data-status="Irrigation Required"] {
    border-color: rgba(245, 158, 11, 0.4);
    background: linear-gradient(90deg, rgba(245, 158, 11, 0.15), rgba(245, 158, 11, 0.05));
}

.ai-status-banner[data-status="Irrigation Not Required"] {
    border-color: var(--border-emerald);
    background: linear-gradient(90deg, rgba(16, 185, 129, 0.15), rgba(16, 185, 129, 0.05));
}

.ai-status-banner[data-status="Monitor Farm"] {
    border-color: rgba(6, 182, 212, 0.4);
    background: linear-gradient(90deg, rgba(6, 182, 212, 0.15), rgba(6, 182, 212, 0.05));
}

.ai-status-banner[data-status="Emergency: Fire Hazard"] {
    border-color: rgba(239, 68, 68, 0.8) !important;
    background: linear-gradient(90deg, rgba(239, 68, 68, 0.25), rgba(239, 68, 68, 0.08)) !important;
    box-shadow: 0 0 30px rgba(239, 68, 68, 0.35) !important;
    animation: hazardPulse 1.8s infinite;
}

.ai-status-indicator {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--emerald-400);
}

.ai-status-content {
    flex: 1;
}

.ai-status-label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.ai-status-title {
    font-size: 1.35rem;
    font-weight: 800;
    color: #ffffff;
    line-height: 1.2;
}

.ai-confidence-badge {
    text-align: right;
    padding-left: 1rem;
    border-left: 1px solid var(--border-subtle);
}

.conf-label {
    display: block;
    font-size: 0.68rem;
    color: var(--text-muted);
}

.conf-val {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--emerald-400);
    font-family: var(--font-mono);
}

.ai-reason-box {
    background: rgba(0, 0, 0, 0.25);
    border-left: 3px solid var(--emerald-400);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    padding: 1rem 1.25rem;
    margin-bottom: 1.25rem;
    position: relative;
}

.quote-icon {
    position: absolute;
    top: 0.6rem;
    right: 0.8rem;
    font-size: 1.5rem;
    color: rgba(255, 255, 255, 0.05);
}

.ai-reason-text {
    font-size: 0.92rem;
    line-height: 1.6;
    color: #e2e8f0;
    font-weight: 500;
}

.ai-factors-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.85rem;
}

.factor-item {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 0.65rem 0.85rem;
}

.factor-head {
    display: flex;
    justify-content: space-between;
    font-size: 0.72rem;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
}

.factor-head strong {
    color: var(--text-primary);
}

.progress-bar-bg {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    border-radius: 999px;
    transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.fill-soil { background: linear-gradient(90deg, #10b981, #34d399); }
.fill-evapo { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.fill-rain { background: linear-gradient(90deg, #3b82f6, #60a5fa); }
.fill-sun { background: linear-gradient(90deg, #8b5cf6, #a78bfa); }
.fill-emerald { background: linear-gradient(90deg, #059669, #10b981, #34d399); }

/* Pump Status Card */
.mode-badge {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.3rem 0.75rem;
    border-radius: 999px;
    text-transform: capitalize;
}

.mode-badge.automatic {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid var(--border-emerald);
    color: var(--emerald-400);
}

.mode-badge.manual {
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: var(--temp-color);
}

.pump-visual-container {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1.25rem;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    margin-bottom: 1.25rem;
}

.pump-motor-graphic {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.04);
    border: 2px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.pump-motor-graphic .turbine-icon {
    font-size: 1.8rem;
    color: var(--text-muted);
    transition: color 0.3s;
}

.pump-motor-graphic.running {
    border-color: var(--emerald-400);
    box-shadow: 0 0 25px var(--emerald-glow);
}

.pump-motor-graphic.running .turbine-icon {
    color: var(--emerald-400);
    animation: rotateTurbine 1.2s linear infinite;
}

@keyframes rotateTurbine {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.pump-meta .pump-status-label {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 600;
}

.pump-meta .pump-status-headline {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: 0.02em;
}

.status-active {
    color: var(--emerald-400);
    text-shadow: 0 0 15px var(--emerald-glow);
}

.status-inactive {
    color: var(--text-muted);
}

.pump-runtime {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.pump-runtime strong {
    font-family: var(--font-mono);
    color: var(--text-primary);
}

.pump-controls-wrapper {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 1rem;
}

.control-group-title {
    margin-bottom: 0.75rem;
}

.control-group-title span {
    font-size: 0.82rem;
    font-weight: 700;
    display: block;
}

.control-group-title small {
    font-size: 0.74rem;
    color: var(--text-muted);
}

.mode-toggle-pills {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.btn-mode-pill {
    padding: 0.6rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
    background: rgba(8, 14, 17, 0.5);
    color: var(--text-secondary);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    transition: var(--transition-fast);
}

.btn-mode-pill:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}

.btn-mode-pill.active {
    border-color: var(--emerald-500);
    background: rgba(16, 185, 129, 0.15);
    color: var(--emerald-400);
    box-shadow: 0 0 10px var(--emerald-glow);
}

.manual-buttons-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.btn-pump {
    padding: 0.7rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
    font-weight: 700;
    font-size: 0.86rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: var(--transition-fast);
    background: rgba(8, 14, 17, 0.8);
    color: var(--text-secondary);
}

.btn-pump-on:hover, .btn-pump-on.is-active {
    background: linear-gradient(135deg, #059669, #10b981);
    color: #fff;
    border-color: #34d399;
    box-shadow: 0 0 15px var(--emerald-glow);
}

.btn-pump-off:hover, .btn-pump-off.is-active {
    background: linear-gradient(135deg, #b91c1c, #ef4444);
    color: #fff;
    border-color: #f87171;
    box-shadow: 0 0 15px var(--danger-glow);
}

/* ----------------------------------------------------
   Live Sensor Cards Grid (7 Sensors)
   ---------------------------------------------------- */
.sensors-section {
    margin-bottom: 2.5rem;
}

.section-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}

.section-title-row h2 {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.01em;
}

.section-subtitle {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.refresh-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.refresh-spinner i {
    animation: spinRefresh 4s linear infinite;
    color: var(--emerald-400);
}

@keyframes spinRefresh {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.sensor-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
}

.sensor-card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.sensor-card:hover {
    transform: translateY(-2px);
    border-color: var(--border-emerald);
    box-shadow: var(--shadow-card), 0 5px 20px -5px rgba(16, 185, 129, 0.15);
}

.sensor-card.highlight-card {
    border-color: var(--border-emerald);
    background: linear-gradient(160deg, rgba(16, 27, 31, 0.95), rgba(12, 38, 25, 0.5));
}

.card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.sensor-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.icon-soil { background: rgba(16, 185, 129, 0.15); color: var(--soil-color); }
.icon-temp { background: rgba(245, 158, 11, 0.15); color: var(--temp-color); }
.icon-humidity { background: rgba(6, 182, 212, 0.15); color: var(--humidity-color); }
.icon-rain { background: rgba(59, 130, 246, 0.15); color: var(--rain-color); }
.icon-light { background: rgba(251, 191, 36, 0.15); color: var(--light-color); }
.icon-air { background: rgba(139, 92, 246, 0.15); color: var(--air-color); }
.icon-fire { background: rgba(239, 68, 68, 0.18); color: #ef4444; border: 1px solid rgba(239, 68, 68, 0.35); }
.icon-esp { background: rgba(16, 185, 129, 0.15); color: var(--emerald-400); }

.sensor-chip {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    text-transform: capitalize;
}

.chip-success { background: rgba(16, 185, 129, 0.15); color: var(--emerald-400); border: 1px solid rgba(16, 185, 129, 0.3); }
.chip-normal { background: rgba(255, 255, 255, 0.05); color: var(--text-secondary); border: 1px solid var(--border-subtle); }
.chip-dry { background: rgba(255, 255, 255, 0.05); color: var(--text-secondary); }
.chip-rain { background: rgba(59, 130, 246, 0.2); color: #93c5fd; border: 1px solid rgba(59, 130, 246, 0.4); }
.chip-light { background: rgba(251, 191, 36, 0.15); color: var(--light-color); }
.chip-online { background: rgba(16, 185, 129, 0.15); color: var(--emerald-400); }
.chip-offline { background: rgba(239, 68, 68, 0.15); color: var(--danger-color); }
.chip-fire-safe { background: rgba(16, 185, 129, 0.15); color: var(--emerald-400); border: 1px solid rgba(16, 185, 129, 0.3); }
.chip-fire-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #ffffff;
    border: 1px solid #f87171;
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.6);
    animation: flameDangerPulse 1.2s infinite ease-in-out;
}

.text-fire-danger {
    color: #ef4444 !important;
    text-shadow: 0 0 12px rgba(239, 68, 68, 0.6);
    animation: flameFlicker 0.8s infinite alternate;
}
.text-fire-safe {
    color: #34d399 !important;
}

.sensor-card.fire-hazard {
    border-color: rgba(239, 68, 68, 0.8) !important;
    background: linear-gradient(160deg, rgba(35, 12, 12, 0.95), rgba(50, 15, 15, 0.7)) !important;
    box-shadow: var(--shadow-card), 0 0 35px rgba(239, 68, 68, 0.45) !important;
    animation: hazardBorderPulse 1.5s infinite;
}

@keyframes flameDangerPulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 10px rgba(239, 68, 68, 0.5); }
    50% { transform: scale(1.05); box-shadow: 0 0 20px rgba(239, 68, 68, 0.9); }
}

@keyframes flameFlicker {
    0% { opacity: 0.9; text-shadow: 0 0 8px rgba(239, 68, 68, 0.4); }
    100% { opacity: 1; text-shadow: 0 0 18px rgba(249, 115, 22, 0.8); }
}

@keyframes hazardBorderPulse {
    0%, 100% { border-color: rgba(239, 68, 68, 0.5); }
    50% { border-color: rgba(239, 68, 68, 1); box-shadow: 0 0 40px rgba(239, 68, 68, 0.6); }
}

@keyframes hazardPulse {
    0%, 100% { box-shadow: 0 0 20px rgba(239, 68, 68, 0.25); }
    50% { box-shadow: 0 0 35px rgba(239, 68, 68, 0.55); }
}

.card-middle {
    margin-bottom: 1rem;
}

.sensor-name {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.sensor-value-wrap {
    display: flex;
    align-items: baseline;
    gap: 0.3rem;
    margin-top: 0.25rem;
}

.sensor-value {
    font-size: 2.2rem;
    font-weight: 800;
    color: #ffffff;
    font-family: var(--font-mono);
    line-height: 1;
}

.sensor-unit {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-muted);
}

.sensor-text-value {
    font-size: 1.35rem;
    font-weight: 700;
    color: #ffffff;
}

.scale-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-top: 0.4rem;
}

.sensor-substat {
    display: flex;
    justify-content: space-between;
    font-size: 0.72rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border-subtle);
    padding-top: 0.6rem;
}

/* ----------------------------------------------------
   Charts Section
   ---------------------------------------------------- */
.charts-section {
    margin-bottom: 2.5rem;
}

.chart-controls {
    display: flex;
    gap: 0.4rem;
}

.btn-chart-range {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
}

.btn-chart-range.active {
    background: rgba(16, 185, 129, 0.15);
    border-color: var(--emerald-500);
    color: var(--emerald-400);
    font-weight: 600;
}

.charts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.chart-card {
    min-height: 340px;
}

.chart-legend-badge {
    font-size: 0.75rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
}

.badge-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 0.4rem;
}

.dot-emerald { background: var(--emerald-400); }
.dot-amber { background: var(--temp-color); }
.dot-cyan { background: var(--humidity-color); }

.chart-canvas-container {
    position: relative;
    height: 240px;
    width: 100%;
}

/* ----------------------------------------------------
   Alerts & Diagnostics Grid
   ---------------------------------------------------- */
.alerts-device-grid {
    display: grid;
    grid-template-columns: 1.25fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.alerts-list {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    max-height: 320px;
    overflow-y: auto;
}

.alert-row {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.85rem 1rem;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-subtle);
    transition: var(--transition-fast);
}

.alert-row.severity-danger {
    border-left: 3px solid var(--danger-color);
    background: rgba(239, 68, 68, 0.05);
}

.alert-row.severity-warning {
    border-left: 3px solid var(--temp-color);
    background: rgba(245, 158, 11, 0.05);
}

.alert-row.severity-info {
    border-left: 3px solid var(--humidity-color);
    background: rgba(6, 182, 212, 0.05);
}

.alert-row.is-resolved {
    opacity: 0.45;
}

.alert-icon-wrap {
    font-size: 1.15rem;
}

.text-danger { color: var(--danger-color); }
.text-warning { color: var(--temp-color); }
.text-info { color: var(--humidity-color); }

.alert-info {
    flex: 1;
}

.alert-text {
    font-size: 0.85rem;
    font-weight: 500;
    line-height: 1.3;
}

.alert-time {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.btn-resolve {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid var(--border-subtle);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn-resolve:hover {
    border-color: var(--emerald-400);
    color: var(--emerald-400);
    background: rgba(16, 185, 129, 0.15);
}

.resolved-check {
    color: var(--emerald-400);
    font-size: 1.1rem;
}

.empty-state {
    text-align: center;
    padding: 2.5rem 1rem;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 2.5rem;
    color: var(--emerald-400);
    margin-bottom: 0.75rem;
    display: block;
}

/* Device Diagnostics Card */
.chip-firmware {
    font-size: 0.72rem;
    font-family: var(--font-mono);
    color: var(--emerald-400);
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid var(--border-emerald);
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
}

.device-diag-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.85rem;
    margin-bottom: 1.25rem;
}

.diag-item {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 0.85rem;
}

.diag-label {
    display: block;
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-bottom: 0.3rem;
    text-transform: uppercase;
}

.diag-value {
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.status-indicator-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.status-indicator-dot.online {
    background: var(--emerald-400);
    box-shadow: 0 0 8px var(--emerald-400);
}

.status-indicator-dot.offline {
    background: var(--danger-color);
    box-shadow: 0 0 8px var(--danger-color);
}

.endpoint-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.endpoint-box code {
    font-size: 0.78rem;
    color: var(--emerald-400);
}

.btn-copy {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.85rem;
    padding: 0.2rem;
}

.btn-copy:hover {
    color: var(--emerald-400);
}

.hardware-links-banner {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(6, 182, 212, 0.05));
    border: 1px solid var(--border-emerald);
    border-radius: var(--radius-md);
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.banner-icon {
    font-size: 1.5rem;
    color: var(--emerald-400);
}

.banner-content {
    flex: 1;
}

.banner-content h4 {
    font-size: 0.88rem;
    font-weight: 700;
}

.banner-content p {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* ----------------------------------------------------
   Simulator Modal
   ---------------------------------------------------- */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-smooth), visibility var(--transition-smooth);
    padding: 1.5rem;
}

.modal-backdrop.show {
    opacity: 1;
    visibility: visible;
}

.modal-card {
    width: 100%;
    max-width: 580px;
    background: var(--bg-card);
    border: 1px solid var(--border-emerald);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-card), var(--shadow-glow);
    overflow: hidden;
    transform: scale(0.95);
    transition: transform var(--transition-smooth);
}

.modal-backdrop.show .modal-card {
    transform: scale(1);
}

.modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title-wrap {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.modal-title-wrap h3 {
    font-size: 1.15rem;
    font-weight: 700;
}

.modal-title-wrap .subtitle {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.btn-icon {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.25rem;
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn-icon:hover {
    color: #fff;
}

.modal-body {
    padding: 1.5rem;
}

.sim-intro {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 1.25rem;
}

.scenario-buttons-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.85rem;
}

.scenario-btn {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    cursor: pointer;
    text-align: left;
    transition: var(--transition-fast);
}

.scenario-btn:hover {
    background: rgba(16, 185, 129, 0.1);
    border-color: var(--emerald-400);
    transform: translateX(4px);
}

.scenario-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.scenario-icon.dry { background: rgba(245, 158, 11, 0.2); color: var(--temp-color); }
.scenario-icon.rain { background: rgba(59, 130, 246, 0.2); color: var(--rain-color); }
.scenario-icon.heat { background: rgba(239, 68, 68, 0.2); color: var(--danger-color); }
.scenario-icon.optimal { background: rgba(16, 185, 129, 0.2); color: var(--emerald-400); }
.scenario-icon.fire-danger { background: rgba(239, 68, 68, 0.25); color: #ef4444; box-shadow: 0 0 15px rgba(239, 68, 68, 0.3); }
.scenario-icon.smoke-warn { background: rgba(168, 85, 247, 0.25); color: #c084fc; }

.scenario-btn.scenario-fire-hazard:hover {
    background: rgba(239, 68, 68, 0.12);
    border-color: #ef4444;
    box-shadow: 0 5px 20px -5px rgba(239, 68, 68, 0.35);
}

.scenario-info strong {
    display: block;
    font-size: 0.95rem;
    margin-bottom: 0.2rem;
}

.scenario-info span {
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* ----------------------------------------------------
   Toast Notifications
   ---------------------------------------------------- */
.toast-container {
    position: fixed;
    top: 85px;
    right: 25px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    pointer-events: none;
}

.toast {
    pointer-events: auto;
    background: var(--bg-card);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid var(--border-emerald);
    border-radius: var(--radius-sm);
    padding: 0.85rem 1.25rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-primary);
    font-size: 0.85rem;
    min-width: 280px;
    animation: toastSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.toast.toast-danger {
    border-color: var(--danger-color);
}

.toast.toast-warning {
    border-color: var(--temp-color);
}

@keyframes toastSlideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ----------------------------------------------------
   Settings Page Styles
   ---------------------------------------------------- */
.settings-grid {
    display: grid;
    grid-template-columns: 1.35fr 1fr;
    gap: 1.5rem;
}

.settings-form .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.help-text {
    display: block;
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 400;
    margin-top: 0.15rem;
}

.input-with-copy {
    display: flex;
    gap: 0.5rem;
}

.code-font {
    font-family: var(--font-mono);
}

.section-divider {
    border: none;
    border-top: 1px solid var(--border-subtle);
    margin: 1.75rem 0;
}

.server-info-box h4 {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

.server-specs {
    list-style: none;
    font-size: 0.82rem;
}

.server-specs li {
    display: flex;
    justify-content: space-between;
    padding: 0.45rem 0;
    border-bottom: 1px solid var(--border-subtle);
}

.server-specs li span {
    color: var(--text-muted);
}

.server-specs li strong {
    font-family: var(--font-mono);
    color: var(--emerald-400);
}

.banner-alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.banner-success {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid var(--border-emerald);
    color: var(--emerald-400);
}

.banner-danger {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

/* ----------------------------------------------------
   Footer
   ---------------------------------------------------- */
.app-footer {
    padding: 1.25rem 2rem;
    border-top: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-muted);
    background: rgba(8, 14, 17, 0.5);
}

.footer-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.system-time {
    font-family: var(--font-mono);
    color: var(--emerald-400);
}

/* ----------------------------------------------------
   Responsive Breakpoints
   ---------------------------------------------------- */
@media (max-width: 1200px) {
    .hero-grid {
        grid-template-columns: 1fr;
    }
    .charts-grid {
        grid-template-columns: 1fr;
    }
    .alerts-device-grid {
        grid-template-columns: 1fr;
    }
    .settings-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    .app-sidebar {
        transform: translateX(-100%);
    }

    .app-sidebar.show {
        transform: translateX(0);
        box-shadow: 0 0 50px rgba(0, 0, 0, 0.8);
    }

    .sidebar-backdrop {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.6);
        backdrop-filter: blur(4px);
        z-index: 95;
    }

    .sidebar-backdrop.show {
        display: block;
    }

    .sidebar-close-btn {
        display: block;
    }

    .main-wrapper {
        margin-left: 0;
    }

    .mobile-toggle-btn {
        display: block;
    }

    .top-navbar {
        padding: 0 1.25rem;
    }

    .dashboard-content {
        padding: 1.25rem;
    }
}

@media (max-width: 600px) {
    .hide-mobile {
        display: none;
    }

    .settings-form .form-row {
        grid-template-columns: 1fr;
    }

    .ai-factors-grid {
        grid-template-columns: 1fr;
    }

    .device-diag-grid {
        grid-template-columns: 1fr;
    }

    .sensor-cards-grid {
        grid-template-columns: 1fr;
    }

    .section-title-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}

/* ----------------------------------------------------
   Export Formats Dropdown & Modal Styles
   ---------------------------------------------------- */
.chart-action-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.export-dropdown-wrapper {
    position: relative;
}

.btn-export-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.42rem 0.85rem;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid var(--border-emerald);
    color: var(--emerald-400);
    transition: var(--transition-fast);
}

.btn-export-toggle:hover {
    background: rgba(16, 185, 129, 0.18);
    border-color: var(--emerald-400);
    color: #ffffff;
    box-shadow: 0 0 15px var(--emerald-glow);
}

.btn-export-toggle .caret-icon {
    font-size: 0.65rem;
    transition: transform 0.2s ease;
}

.export-dropdown-wrapper.open .caret-icon {
    transform: rotate(180deg);
}

.export-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 270px;
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-emerald);
    border-radius: var(--radius-md);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6), var(--shadow-glow);
    padding: 0.6rem;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.export-dropdown-wrapper.open .export-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.export-dropdown-header {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    padding: 0.4rem 0.6rem 0.5rem;
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: 0.4rem;
}

.export-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.75rem;
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    transition: var(--transition-fast);
}

.export-item:hover {
    background: rgba(16, 185, 129, 0.12);
    color: var(--emerald-400);
}

.export-icon {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.csv-icon {
    background: rgba(16, 185, 129, 0.15);
    color: var(--emerald-400);
}

.excel-icon {
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
}

.json-icon {
    background: rgba(6, 182, 212, 0.15);
    color: var(--humidity-color);
}

.export-item-info strong {
    display: block;
    font-size: 0.82rem;
    line-height: 1.2;
}

.export-item-info span {
    font-size: 0.68rem;
    color: var(--text-muted);
}

/* Format selection modal cards */
.format-selection-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin-top: 0.5rem;
}

@media (max-width: 600px) {
    .format-selection-grid {
        grid-template-columns: 1fr;
    }
}

.format-card {
    position: relative;
    cursor: pointer;
}

.format-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.format-card-content {
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.02);
    padding: 1rem 0.75rem;
    text-align: center;
    transition: var(--transition-fast);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
}

.format-card-content i {
    font-size: 1.8rem;
    margin-bottom: 0.2rem;
}

.format-card-content strong {
    font-size: 0.85rem;
}

.format-card-content span {
    font-size: 0.68rem;
    color: var(--text-muted);
    line-height: 1.3;
}

.format-card input[type="radio"]:checked + .format-card-content {
    border-color: var(--emerald-400);
    background: rgba(16, 185, 129, 0.12);
    box-shadow: 0 0 15px var(--emerald-glow);
}

/* ----------------------------------------------------
   WhatsApp Messenger UI Styles
   ---------------------------------------------------- */
.btn-whatsapp {
    background: linear-gradient(135deg, #25D366, #128C7E);
    color: #ffffff !important;
    border: none;
    box-shadow: 0 0 15px rgba(37, 211, 102, 0.35);
}

.btn-whatsapp:hover {
    background: linear-gradient(135deg, #128C7E, #075E54);
    transform: translateY(-1px);
    box-shadow: 0 0 20px rgba(37, 211, 102, 0.5);
    color: #ffffff !important;
}

.btn-wa-alert {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid rgba(37, 211, 102, 0.4);
    background: rgba(37, 211, 102, 0.1);
    color: #25D366;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.85rem;
    transition: var(--transition-fast);
    margin-right: 0.35rem;
}

.btn-wa-alert:hover {
    background: #25D366;
    color: #ffffff;
    box-shadow: 0 0 12px rgba(37, 211, 102, 0.6);
    transform: scale(1.08);
}

.bg-whatsapp {
    background: rgba(37, 211, 102, 0.15) !important;
    color: #25D366 !important;
    border: 1px solid rgba(37, 211, 102, 0.3) !important;
}

.header-icon-badge {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
}

.settings-section-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.settings-section-header h4 {
    font-size: 0.95rem;
    font-weight: 700;
}

.test-whatsapp-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1rem 0;
    flex-wrap: wrap;
}

.test-result-text {
    font-size: 0.8rem;
    font-weight: 500;
}

.provider-fields {
    background: rgba(255, 255, 255, 0.02);
    border: 1px dashed var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 1rem;
    margin: 0.75rem 0 1.25rem;
}

/* ----------------------------------------------------
   Autonomous AI Agents Fleet & AgriCopilot Styles
   ---------------------------------------------------- */
.ai-agents-section {
    margin-bottom: 2.5rem;
}

.agent-section-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #34d399;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(6, 182, 212, 0.1));
    border: 1px solid rgba(16, 185, 129, 0.35);
    padding: 0.3rem 0.85rem;
    border-radius: 999px;
    margin-bottom: 0.5rem;
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.15);
}

.agent-section-badge .badge-pulse-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 8px #10b981;
    animation: blinkDot 1.5s infinite;
}

.btn-copilot {
    background: linear-gradient(135deg, #059669, #0284c7);
    color: #ffffff !important;
    border: none;
    box-shadow: 0 4px 15px rgba(2, 132, 199, 0.3);
}

.btn-copilot:hover {
    background: linear-gradient(135deg, #10b981, #06b6d4);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(6, 182, 212, 0.4);
    color: #ffffff !important;
}

.nav-agent-pill {
    margin-left: auto;
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid var(--border-emerald);
    color: var(--emerald-400);
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.15rem 0.45rem;
    border-radius: 999px;
}

/* 4-Column Responsive Grid */
.agents-grid {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 1.25rem !important;
    margin-top: 1.25rem !important;
}

@media (max-width: 1280px) {
    .agents-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 720px) {
    .agents-grid {
        grid-template-columns: 1fr !important;
    }
}

/* Base Agent Card with Glassmorphism */
.agent-card {
    background: linear-gradient(160deg, rgba(16, 27, 34, 0.95) 0%, rgba(10, 18, 24, 0.98) 100%) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-radius: 18px !important;
    overflow: hidden !important;
    position: relative !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.28s ease, box-shadow 0.28s ease !important;
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5) !important;
    padding: 0 !important;
}

.agent-card:hover {
    transform: translateY(-4px) !important;
}

/* Glowing Top Accent Bar for Each Agent */
.agent-accent-bar {
    height: 3px;
    width: 100%;
}

.bar-hydro {
    background: linear-gradient(90deg, #06b6d4, #10b981);
    box-shadow: 0 0 12px rgba(6, 182, 212, 0.6);
}
.agent-card#agent-hydro:hover {
    border-color: rgba(6, 182, 212, 0.5) !important;
    box-shadow: 0 15px 35px -10px rgba(0, 0, 0, 0.6), 0 0 25px rgba(6, 182, 212, 0.25) !important;
}

.bar-aero {
    background: linear-gradient(90deg, #3b82f6, #06b6d4);
    box-shadow: 0 0 12px rgba(59, 130, 246, 0.6);
}
.agent-card#agent-aero:hover {
    border-color: rgba(59, 130, 246, 0.5) !important;
    box-shadow: 0 15px 35px -10px rgba(0, 0, 0, 0.6), 0 0 25px rgba(59, 130, 246, 0.25) !important;
}

.bar-phyto {
    background: linear-gradient(90deg, #10b981, #a3e635);
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.6);
}
.agent-card#agent-phyto:hover {
    border-color: rgba(16, 185, 129, 0.5) !important;
    box-shadow: 0 15px 35px -10px rgba(0, 0, 0, 0.6), 0 0 25px rgba(16, 185, 129, 0.25) !important;
}

.bar-sentinel {
    background: linear-gradient(90deg, #a855f7, #ec4899);
    box-shadow: 0 0 12px rgba(168, 85, 247, 0.6);
}
.agent-card#agent-sentinel:hover {
    border-color: rgba(168, 85, 247, 0.5) !important;
    box-shadow: 0 15px 35px -10px rgba(0, 0, 0, 0.6), 0 0 25px rgba(168, 85, 247, 0.25) !important;
}

/* Agent Card Header */
.agent-card-header {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 1.15rem 1.25rem 0.9rem 1.25rem !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
    gap: 0.75rem !important;
}

.agent-header-meta {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    flex: 1;
    min-width: 0;
}

/* Agent Avatar with glowing pulse */
.agent-avatar {
    width: 46px !important;
    height: 46px !important;
    border-radius: 14px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 1.3rem !important;
    position: relative !important;
    flex-shrink: 0 !important;
    transition: transform 0.2s ease;
}

.agent-card:hover .agent-avatar {
    transform: scale(1.05);
}

.avatar-hydro {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.22), rgba(16, 185, 129, 0.15)) !important;
    color: #22d3ee !important;
    border: 1px solid rgba(6, 182, 212, 0.45) !important;
    box-shadow: 0 0 18px rgba(6, 182, 212, 0.25) !important;
}

.avatar-aero {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.22), rgba(6, 182, 212, 0.15)) !important;
    color: #60a5fa !important;
    border: 1px solid rgba(59, 130, 246, 0.45) !important;
    box-shadow: 0 0 18px rgba(59, 130, 246, 0.25) !important;
}

.avatar-phyto {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.22), rgba(163, 230, 53, 0.15)) !important;
    color: #34d399 !important;
    border: 1px solid rgba(16, 185, 129, 0.45) !important;
    box-shadow: 0 0 18px rgba(16, 185, 129, 0.25) !important;
}

.avatar-sentinel {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.22), rgba(236, 72, 153, 0.15)) !important;
    color: #c084fc !important;
    border: 1px solid rgba(168, 85, 247, 0.45) !important;
    box-shadow: 0 0 18px rgba(168, 85, 247, 0.25) !important;
}

.agent-pulse {
    position: absolute !important;
    top: -2px !important;
    right: -2px !important;
    width: 9px !important;
    height: 9px !important;
    border-radius: 50% !important;
    background: #10b981 !important;
    box-shadow: 0 0 8px #10b981 !important;
    animation: pingDot 2s cubic-bezier(0, 0, 0.2, 1) infinite;
}

@keyframes pingDot {
    0% { transform: scale(0.9); opacity: 1; }
    50% { transform: scale(1.3); opacity: 0.8; }
    100% { transform: scale(0.9); opacity: 1; }
}

.agent-info {
    flex: 1;
    min-width: 0;
}

.agent-name-row {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.agent-info h4 {
    font-size: 1.02rem !important;
    font-weight: 700 !important;
    color: #f8fafc !important;
    margin: 0 !important;
    line-height: 1.2 !important;
    letter-spacing: -0.01em !important;
}

.agent-type-chip {
    font-size: 0.62rem;
    font-weight: 600;
    color: #94a3b8;
    background: rgba(255, 255, 255, 0.05);
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.agent-specialty {
    font-size: 0.72rem !important;
    color: #94a3b8 !important;
    font-weight: 500 !important;
    display: block !important;
    margin-top: 0.2rem !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

/* Agent Status Capsule Badges */
.agent-status-badge {
    font-size: 0.68rem !important;
    font-weight: 700 !important;
    padding: 0.3rem 0.75rem !important;
    border-radius: 999px !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
    white-space: nowrap !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.35rem !important;
    line-height: 1 !important;
}

.agent-status-badge.chip-success,
.agent-status-badge.chip-optimal,
.agent-status-badge.chip-balanced,
.agent-status-badge.chip-active,
.agent-status-badge.chip-low\ risk {
    background: rgba(16, 185, 129, 0.16) !important;
    color: #34d399 !important;
    border: 1px solid rgba(16, 185, 129, 0.4) !important;
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.2) !important;
}

.agent-status-badge.chip-info {
    background: rgba(6, 182, 212, 0.16) !important;
    color: #22d3ee !important;
    border: 1px solid rgba(6, 182, 212, 0.4) !important;
    box-shadow: 0 0 12px rgba(6, 182, 212, 0.2) !important;
}

.agent-status-badge.chip-warning {
    background: rgba(245, 158, 11, 0.16) !important;
    color: #fbbf24 !important;
    border: 1px solid rgba(245, 158, 11, 0.4) !important;
    box-shadow: 0 0 12px rgba(245, 158, 11, 0.2) !important;
}

.agent-status-badge.chip-danger {
    background: rgba(239, 68, 68, 0.16) !important;
    color: #f87171 !important;
    border: 1px solid rgba(239, 68, 68, 0.4) !important;
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.2) !important;
}

/* Agent Card Body */
.agent-card-body {
    padding: 1.15rem 1.25rem 1.25rem 1.25rem !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 0.9rem !important;
    flex: 1 !important;
}

/* Dual Metrics Highlight Grid */
.agent-metric-highlight {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 0.65rem !important;
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

.metric-block {
    background: rgba(0, 0, 0, 0.4) !important;
    border: 1px solid rgba(255, 255, 255, 0.06) !important;
    border-radius: 12px !important;
    padding: 0.65rem 0.8rem !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 0.25rem !important;
    transition: background 0.2s ease, border-color 0.2s ease !important;
}

.agent-card:hover .metric-block {
    background: rgba(0, 0, 0, 0.55) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

.metric-block .metric-title {
    display: flex !important;
    align-items: center !important;
    gap: 0.35rem !important;
    font-size: 0.66rem !important;
    color: #64748b !important;
    text-transform: uppercase !important;
    font-weight: 600 !important;
    letter-spacing: 0.04em !important;
}

.metric-block .metric-title i {
    font-size: 0.75rem;
    opacity: 0.8;
}

.metric-block strong {
    font-size: 1.15rem !important;
    font-family: var(--font-mono) !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    line-height: 1.2 !important;
}

/* Agent Insight / Autonomous Recommendation Box */
.agent-insight-box {
    background: rgba(0, 0, 0, 0.35) !important;
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
    border-radius: 12px !important;
    padding: 0.85rem 0.95rem !important;
    font-size: 0.8rem !important;
    line-height: 1.5 !important;
    color: #cbd5e1 !important;
    display: flex !important;
    align-items: flex-start !important;
    gap: 0.65rem !important;
    min-height: 64px !important;
    position: relative !important;
}

.agent-insight-box.insight-hydro {
    border-left: 3px solid #06b6d4 !important;
}
.agent-insight-box.insight-hydro .insight-icon {
    color: #22d3ee !important;
}

.agent-insight-box.insight-aero {
    border-left: 3px solid #3b82f6 !important;
}
.agent-insight-box.insight-aero .insight-icon {
    color: #60a5fa !important;
}

.agent-insight-box.insight-phyto {
    border-left: 3px solid #10b981 !important;
}
.agent-insight-box.insight-phyto .insight-icon {
    color: #34d399 !important;
}

.agent-insight-box.insight-sentinel {
    border-left: 3px solid #a855f7 !important;
}
.agent-insight-box.insight-sentinel .insight-icon {
    color: #c084fc !important;
}

.insight-icon-wrap {
    flex-shrink: 0;
    margin-top: 1px;
}

.insight-icon {
    font-size: 0.85rem !important;
}

.agent-insight-box p {
    margin: 0 !important;
    font-size: 0.8rem !important;
    line-height: 1.45 !important;
    color: #cbd5e1 !important;
    font-weight: 400 !important;
}

/* Agent Card Footer */
.agent-card-footer {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding-top: 0.65rem !important;
    border-top: 1px solid rgba(255, 255, 255, 0.05) !important;
    margin-top: auto !important;
}

.agent-footer-status {
    font-size: 0.68rem;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-weight: 500;
}

.agent-footer-status i {
    font-size: 0.72rem;
    color: #10b981;
}

.btn-agent-talk {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 999px;
    padding: 0.22rem 0.65rem;
    font-size: 0.68rem;
    font-weight: 600;
    color: #94a3b8;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    transition: all 0.2s ease;
}

.btn-agent-talk:hover {
    background: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.4);
    color: #34d399;
}

/* ----------------------------------------------------
   AgriCopilot Chat Modal
   ---------------------------------------------------- */
.copilot-modal {
    max-width: 650px;
    height: 600px;
    display: flex;
    flex-direction: column;
}

.copilot-body {
    padding: 1.25rem 1.5rem;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

.copilot-chat-history {
    flex: 1;
    overflow-y: auto;
    padding-right: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1rem;
}

.copilot-msg {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    max-width: 90%;
}

.copilot-msg.msg-ai {
    align-self: flex-start;
}

.copilot-msg.msg-user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.copilot-msg .msg-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.msg-ai .msg-avatar {
    background: linear-gradient(135deg, var(--emerald-500), #06b6d4);
    color: #ffffff;
}

.msg-user .msg-avatar {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
}

.copilot-msg .msg-bubble {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    line-height: 1.5;
}

.msg-ai .msg-bubble {
    background: rgba(16, 27, 31, 0.95);
    border: 1px solid var(--border-emerald);
    color: #e2e8f0;
    border-top-left-radius: 2px;
}

.msg-user .msg-bubble {
    background: linear-gradient(135deg, var(--emerald-600), #0d9488);
    color: #ffffff;
    border-top-right-radius: 2px;
}

.copilot-quick-prompts {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    margin-bottom: 0.85rem;
}

.quick-chip {
    padding: 0.3rem 0.65rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    font-size: 0.74rem;
    cursor: pointer;
    transition: var(--transition-fast);
}

.quick-chip:hover {
    border-color: var(--emerald-400);
    color: var(--emerald-400);
    background: rgba(16, 185, 129, 0.1);
}

.copilot-input-area {
    display: flex;
    gap: 0.5rem;
}

.copilot-input-area input {
    flex: 1;
}

.btn-send-copilot {
    padding: 0 1.25rem;
}



