/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    color: #1e293b;
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    scroll-behavior: smooth;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Global Chart Fixes */
canvas {
    touch-action: none;
    user-select: none;
    -webkit-user-drag: none;
    -webkit-touch-callout: none;
}

/* Header Styles */
.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 0;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo-icon {
    background: linear-gradient(135deg, #16a34a, #059669);
    padding: 1rem;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(22, 163, 74, 0.3);
}

.logo-icon i {
    font-size: 2rem;
    color: white;
}

.logo-text h1 {
    font-size: 2rem;
    font-weight: 800;
    background: linear-gradient(135deg, #16a34a, #059669);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo-text p {
    color: #64748b;
    font-weight: 400;
}

.header-info {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.shed-selector {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.shed-label {
    font-size: 0.75rem;
    color: #64748b;
    font-weight: 500;
}

.shed-dropdown {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(22, 163, 74, 0.3);
    border-radius: 8px;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #1e293b;
    outline: none;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 180px;
}

.shed-dropdown:hover {
    border-color: rgba(22, 163, 74, 0.5);
    background: rgba(255, 255, 255, 1);
}

.shed-dropdown:focus {
    border-color: #16a34a;
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.1);
}

.shed-dropdown option {
    background: white;
    color: #1e293b;
    padding: 0.5rem;
}

.shed-notification {
    position: fixed;
    top: 100px;
    right: 20px;
    background: rgba(22, 163, 74, 0.95);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 0.875rem;
    box-shadow: 0 4px 20px rgba(22, 163, 74, 0.3);
    backdrop-filter: blur(10px);
    transform: translateX(100%);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 1000;
}

.shed-notification.show {
    transform: translateX(0);
    opacity: 1;
}

.shed-notification i {
    font-size: 1rem;
}

.live-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(239, 68, 68, 0.1);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.live-dot {
    width: 8px;
    height: 8px;
    background: #ef4444;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.time-display {
    text-align: right;
}

.time-label {
    font-size: 0.875rem;
    color: #64748b;
}

.time-value {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1e293b;
}

/* Navigation Tabs */
.nav-tabs {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
}

.tab-list {
    display: flex;
    gap: 0.5rem;
    padding: 1rem 0;
    overflow-x: auto;
}

.tab-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: transparent;
    border: none;
    color: #64748b;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.tab-btn:hover {
    background: rgba(22, 163, 74, 0.1);
    color: #16a34a;
}

.tab-btn.active {
    background: linear-gradient(135deg, #16a34a, #059669);
    color: white;
    box-shadow: 0 4px 20px rgba(22, 163, 74, 0.3);
}

.tab-btn i {
    font-size: 1rem;
}

/* Main Content */
.main-content {
    padding: 1rem 0;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Statistics Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 1.25rem 1rem;
    border: 1px solid rgba(226, 232, 240, 0.8);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    min-height: 140px;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    border-radius: 16px 16px 0 0;
}

.stat-card.blue::before { background: #16a34a; }
.stat-card.green::before { background: #059669; }
.stat-card.orange::before { background: #ea580c; }
.stat-card.red::before { background: #dc2626; }
.stat-card.purple::before { background: #7c3aed; }

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.75rem;
    font-size: 1.5rem;
}

.stat-card.blue .stat-icon { background: rgba(22, 163, 74, 0.2); color: #16a34a; }
.stat-card.green .stat-icon { background: rgba(5, 150, 105, 0.2); color: #059669; }
.stat-card.orange .stat-icon { background: rgba(234, 88, 12, 0.2); color: #ea580c; }
.stat-card.red .stat-icon { background: rgba(220, 38, 38, 0.2); color: #dc2626; }
.stat-card.purple .stat-icon { background: rgba(124, 58, 237, 0.2); color: #7c3aed; }

.stat-content h3 {
    font-size: 0.875rem;
    color: #64748b;
    margin-bottom: 0.5rem;
    font-weight: 500;
    line-height: 1.2;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 800;
    color: #1e293b;
    margin-bottom: 0.5rem;
    line-height: 1;
}

.stat-change {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    font-weight: 500;
}

.stat-change.positive { color: #059669; }
.stat-change.negative { color: #dc2626; }
.stat-change.neutral { color: #ea580c; }

/* Section Styles */
.section {
    margin-bottom: 1.5rem;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 1.5rem;
}

.section-title i {
    color: #3b82f6;
}

/* Inventory Grid */
.inventory-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
}

.inventory-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 1rem;
    border: 1px solid rgba(226, 232, 240, 0.8);
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    min-height: 110px;
}

.inventory-card.good { border-left: 4px solid #059669; }
.inventory-card.warning { border-left: 4px solid #ea580c; }
.inventory-card.critical { border-left: 4px solid #dc2626; }
.inventory-card.info { border-left: 4px solid #16a34a; }

.inventory-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.inventory-header h4 {
    font-weight: 600;
    color: #1e293b;
    font-size: 0.875rem;
    line-height: 1.2;
}

.days-left {
    font-size: 0.75rem;
    color: #64748b;
}

.inventory-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 0.25rem;
    line-height: 1;
}

.inventory-daily {
    font-size: 0.75rem;
    color: #64748b;
    margin-bottom: 0.5rem;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(226, 232, 240, 0.6);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #059669, #16a34a);
    border-radius: 4px;
    transition: width 0.3s ease;
}

/* Charts Section */
.charts-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.chart-container {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 8px;
    padding: 1rem;
    border: 1px solid rgba(226, 232, 240, 0.8);
    position: relative;
    height: 250px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.chart-container h3 {
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.75rem;
}

.chart-container canvas {
    position: relative !important;
    height: 180px !important;
    max-height: 180px !important;
    width: 100% !important;
}

/* Alerts Section */
.alerts-section {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 8px;
    padding: 1rem;
    border: 1px solid rgba(226, 232, 240, 0.8);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.alerts-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.alert-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    border-radius: 6px;
    border-left: 3px solid;
    transition: all 0.3s ease;
}

.alert-item.high {
    background: rgba(239, 68, 68, 0.1);
    border-left-color: #ef4444;
}

.alert-item.medium {
    background: rgba(245, 158, 11, 0.1);
    border-left-color: #f59e0b;
}

.alert-item.low {
    background: rgba(59, 130, 246, 0.1);
    border-left-color: #3b82f6;
}

.alert-item.success {
    background: rgba(16, 185, 129, 0.1);
    border-left-color: #10b981;
}

.alert-icon {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.alert-item.high .alert-icon {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.alert-item.medium .alert-icon {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
}

.alert-item.low .alert-icon {
    background: rgba(59, 130, 246, 0.2);
    color: #3b82f6;
}

.alert-item.success .alert-icon {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
}

.alert-content {
    flex: 1;
}

.alert-message {
    font-weight: 500;
    color: #1e293b;
    margin-bottom: 0.25rem;
}

.alert-time {
    font-size: 0.875rem;
    color: #64748b;
}

/* Live Monitoring Styles */
.live-monitoring-section {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 8px;
    padding: 1rem;
    border: 1px solid rgba(226, 232, 240, 0.8);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Video Section */
.video-section {
    margin-bottom: 1.5rem;
}

.video-container {
    position: relative;
    margin-bottom: 1rem;
}

.video-wrapper {
    position: relative;
    aspect-ratio: 16/9;
    border-radius: 8px;
    overflow: hidden;
    background: #000;
}

.video-wrapper iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 10;
}

.live-badge {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: rgba(239, 68, 68, 0.9);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
}

.live-badge .live-dot {
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.detection-count {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    border-radius: 8px;
    padding: 1rem;
    color: white;
}

.count-display {
    text-align: center;
}

.count-number {
    display: block;
    font-size: 2rem;
    font-weight: 800;
    color: #3b82f6;
    margin-bottom: 0.25rem;
}

.count-label {
    font-size: 0.875rem;
    color: #e2e8f0;
}

/* Detection Circles on Video */
.detection-circle {
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid;
    animation: detectPulse 2s infinite;
    z-index: 15;
}

.detection-circle.green {
    background: rgba(16, 185, 129, 0.3);
    border-color: #10b981;
}

.detection-circle.blue {
    background: rgba(59, 130, 246, 0.3);
    border-color: #3b82f6;
}

.detection-circle.yellow {
    background: rgba(245, 158, 11, 0.3);
    border-color: #f59e0b;
}

.detection-circle.red {
    background: rgba(239, 68, 68, 0.3);
    border-color: #ef4444;
}

@keyframes detectPulse {
    0%, 100% { 
        transform: scale(1); 
        opacity: 0.8; 
    }
    50% { 
        transform: scale(1.2); 
        opacity: 1; 
    }
}

/* Video Stats Overlay */
.video-stats {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    border-radius: 8px;
    padding: 0.75rem;
    color: white;
    min-width: 200px;
}

.stats-header {
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    text-align: center;
    color: #e2e8f0;
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.1);
}

.stat-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.stat-item.green .stat-dot { background: #059669; }
.stat-item.blue .stat-dot { background: #16a34a; }
.stat-item.yellow .stat-dot { background: #ea580c; }
.stat-item.red .stat-dot { background: #dc2626; }

.stat-number {
    font-weight: 700;
    font-size: 1rem;
    min-width: 20px;
}

.stat-text {
    font-size: 0.75rem;
    color: #d1d5db;
}

.farm-floor {
    margin-top: 1.5rem;
}

.farm-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.farm-header h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
}

.ai-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(16, 185, 129, 0.1);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.status-dot.active {
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.farm-simulation {
    position: relative;
    background: linear-gradient(135deg, #92400e, #a16207, #ca8a04);
    border-radius: 12px;
    height: 400px;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.chick-detection {
    position: absolute;
    z-index: 10;
}

.chick {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    position: relative;
    animation: chickMove 4s infinite alternate;
}

.chick.healthy { background: #fbbf24; }
.chick.active { background: #f59e0b; }
.chick.sick { background: #f97316; }
.chick.dead { background: #dc2626; }

.chick::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 6px;
    width: 6px;
    height: 6px;
    background: #ea580c;
    border-radius: 50%;
}

.chick::after {
    content: '';
    position: absolute;
    top: 4px;
    left: 8px;
    width: 2px;
    height: 2px;
    background: #000;
    border-radius: 50%;
}

@keyframes chickMove {
    0%, 100% { transform: translateX(0) translateY(0); }
    25% { transform: translateX(10px) translateY(-5px); }
    50% { transform: translateX(5px) translateY(10px); }
    75% { transform: translateX(-5px) translateY(5px); }
}

.detection-box {
    position: absolute;
    top: -4px;
    left: -4px;
    width: 32px;
    height: 32px;
    border: 2px solid;
    border-radius: 4px;
    animation: pulse 2s infinite;
}

.detection-box.healthy { border-color: #059669; }
.detection-box.active { border-color: #16a34a; }
.detection-box.sick { border-color: #ea580c; }
.detection-box.dead { border-color: #dc2626; }

.detection-label {
    position: absolute;
    top: -24px;
    left: 0;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    color: white;
}

.detection-label.healthy { background: #059669; }
.detection-label.active { background: #16a34a; }
.detection-label.sick { background: #ea580c; }
.detection-label.dead { background: #dc2626; }

.scan-line {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, #3b82f6, transparent);
    animation: scan 3s infinite;
}

@keyframes scan {
    0% { transform: translateY(0); opacity: 1; }
    100% { transform: translateY(400px); opacity: 0; }
}

.ai-overlay {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    border-radius: 8px;
    padding: 1rem;
    color: white;
    font-size: 0.875rem;
}

.ai-status-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.status-indicator {
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.ai-stats div {
    margin-bottom: 0.25rem;
}

.detection-legend {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    border-radius: 8px;
    padding: 1rem;
    color: white;
    font-size: 0.75rem;
}

.detection-legend h4 {
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.legend-color {
    width: 12px;
    height: 3px;
    border-radius: 2px;
}

.legend-color.healthy { background: #059669; }
.legend-color.active { background: #16a34a; }
.legend-color.sick { background: #ea580c; }
.legend-color.dead { background: #dc2626; }



/* Health Monitoring Styles */
.health-overview {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 8px;
    padding: 1rem;
    border: 1px solid rgba(226, 232, 240, 0.8);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.health-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.health-card {
    background: rgba(248, 250, 252, 0.8);
    border-radius: 8px;
    padding: 0.75rem;
    border: 1px solid rgba(226, 232, 240, 0.8);
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.health-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.health-card.primary { border-left: 4px solid #16a34a; }
.health-card.success { border-left: 4px solid #059669; }
.health-card.warning { border-left: 4px solid #ea580c; }
.health-card.danger { border-left: 4px solid #dc2626; }

.health-icon {
    width: 35px;
    height: 35px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.5rem;
    font-size: 1.25rem;
}

.health-card.primary .health-icon { background: rgba(22, 163, 74, 0.2); color: #16a34a; }
.health-card.success .health-icon { background: rgba(5, 150, 105, 0.2); color: #059669; }
.health-card.warning .health-icon { background: rgba(234, 88, 12, 0.2); color: #ea580c; }
.health-card.danger .health-icon { background: rgba(220, 38, 38, 0.2); color: #dc2626; }

.health-content h3 {
    font-size: 0.875rem;
    color: #64748b;
    margin-bottom: 0.25rem;
}

.health-score,
.health-count {
    font-size: 1.5rem;
    font-weight: 800;
    color: #1e293b;
    margin-bottom: 0.25rem;
}

.health-status,
.health-percentage,
.health-trend {
    font-size: 0.875rem;
    font-weight: 500;
}

.health-status.excellent,
.health-trend { color: #10b981; }
.health-percentage { color: #64748b; }

.health-trends {
    margin-top: 1rem;
    position: relative;
    height: 250px;
    overflow: hidden;
}

.health-trends h3 {
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.5rem;
}

.health-trends canvas {
    position: relative !important;
    height: 180px !important;
    max-height: 180px !important;
    width: 100% !important;
}

/* Environment Monitoring Styles */
.environment-section {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 8px;
    padding: 1rem;
    border: 1px solid rgba(226, 232, 240, 0.8);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.environment-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.env-card {
    background: rgba(248, 250, 252, 0.8);
    border-radius: 8px;
    padding: 0.75rem;
    border: 1px solid rgba(226, 232, 240, 0.8);
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.env-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.env-card.temperature { border-top: 4px solid #dc2626; }
.env-card.humidity { border-top: 4px solid #16a34a; }
.env-card.air-quality { border-top: 4px solid #059669; }
.env-card.lighting { border-top: 4px solid #ea580c; }

.env-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.5rem;
    font-size: 1.25rem;
}

.env-card.temperature .env-icon { background: rgba(220, 38, 38, 0.2); color: #dc2626; }
.env-card.humidity .env-icon { background: rgba(22, 163, 74, 0.2); color: #16a34a; }
.env-card.air-quality .env-icon { background: rgba(5, 150, 105, 0.2); color: #059669; }
.env-card.lighting .env-icon { background: rgba(234, 88, 12, 0.2); color: #ea580c; }

.env-content h3 {
    font-size: 0.875rem;
    color: #64748b;
    margin-bottom: 0.25rem;
}

.env-value {
    font-size: 1.75rem;
    font-weight: 800;
    color: #1e293b;
    margin-bottom: 0.25rem;
}

.env-status {
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.env-status.optimal { color: #059669; }
.env-status.good { color: #16a34a; }

.env-range {
    font-size: 0.75rem;
    color: #64748b;
}

.environment-chart {
    margin-top: 1rem;
    position: relative;
    height: 250px;
    overflow: hidden;
}

.environment-chart h3 {
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.5rem;
}

.environment-chart canvas {
    position: relative !important;
    height: 180px !important;
    max-height: 180px !important;
    width: 100% !important;
}

/* Profit & Loss Styles */
.profit-section {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 8px;
    padding: 1rem;
    border: 1px solid rgba(226, 232, 240, 0.8);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.profit-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.profit-card {
    background: rgba(248, 250, 252, 0.8);
    border-radius: 8px;
    padding: 0.75rem;
    border: 1px solid rgba(226, 232, 240, 0.8);
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.profit-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.profit-card.revenue { border-left: 4px solid #059669; }
.profit-card.expenses { border-left: 4px solid #dc2626; }
.profit-card.net-profit { border-left: 4px solid #16a34a; }
.profit-card.margin { border-left: 4px solid #7c3aed; }

.profit-icon {
    width: 35px;
    height: 35px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.5rem;
    font-size: 1.25rem;
}

.profit-card.revenue .profit-icon { background: rgba(5, 150, 105, 0.2); color: #059669; }
.profit-card.expenses .profit-icon { background: rgba(220, 38, 38, 0.2); color: #dc2626; }
.profit-card.net-profit .profit-icon { background: rgba(22, 163, 74, 0.2); color: #16a34a; }
.profit-card.margin .profit-icon { background: rgba(124, 58, 237, 0.2); color: #7c3aed; }

.profit-content h3 {
    font-size: 0.875rem;
    color: #64748b;
    margin-bottom: 0.25rem;
}

.profit-value {
    font-size: 1.25rem;
    font-weight: 800;
    color: #1e293b;
    margin-bottom: 0.25rem;
}

.profit-change {
    font-size: 0.875rem;
    font-weight: 500;
}

.profit-change.positive { color: #059669; }
.profit-change.negative { color: #dc2626; }

.expense-breakdown {
    margin-bottom: 1rem;
}

.expense-breakdown h3 {
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.5rem;
}

.expense-items {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.expense-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.expense-label {
    font-weight: 500;
    color: #64748b;
    flex: 1;
}

.expense-value {
    font-weight: 700;
    color: #1e293b;
    min-width: 100px;
    text-align: right;
}

.expense-bar {
    width: 100px;
    height: 6px;
    background: rgba(226, 232, 240, 0.6);
    border-radius: 3px;
    overflow: hidden;
}

.expense-fill {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.profit-chart {
    margin-top: 1rem;
    position: relative;
    height: 250px;
    overflow: hidden;
}

.profit-chart h3 {
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.5rem;
}

.profit-chart canvas {
    position: relative !important;
    height: 180px !important;
    max-height: 180px !important;
    width: 100% !important;
}

/* Footer */
.footer {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-top: 1px solid rgba(226, 232, 240, 0.8);
    padding: 2rem 0;
    margin-top: 4rem;
    box-shadow: 0 -1px 3px rgba(0, 0, 0, 0.1);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-left h3 {
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.footer-left p {
    color: #64748b;
}

.footer-right p {
    color: #64748b;
    font-size: 0.875rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .header-info {
        flex-direction: column;
        gap: 1rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.4rem;
    }
    
    .inventory-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.4rem;
    }
    
    .charts-section {
        grid-template-columns: 1fr;
    }
    
    .tab-list {
        justify-content: flex-start;
    }
    
    .footer-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .inventory-grid {
        grid-template-columns: 1fr;
    }
    
    .stat-card,
    .inventory-card,
    .chart-container,
    .health-card,
    .env-card,
    .profit-card {
        padding: 0.75rem;
    }
    
    .stat-value {
        font-size: 1.1rem;
    }
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #3b82f6;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }

/* Predictions Section Styles */
.predictions-section {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 8px;
    padding: 1rem;
    border: 1px solid rgba(226, 232, 240, 0.8);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.prediction-summary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.prediction-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 8px;
    padding: 1rem;
    border: 1px solid rgba(226, 232, 240, 0.8);
    position: relative;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.prediction-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    border-radius: 8px 8px 0 0;
}

.prediction-card.stock-alert::before { background: #ea580c; }
.prediction-card.weight-forecast::before { background: #16a34a; }
.prediction-card.mortality-risk::before { background: #059669; }
.prediction-card.profit-forecast::before { background: #7c3aed; }

.prediction-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.prediction-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    margin-bottom: 0.75rem;
}

.prediction-card.stock-alert .prediction-icon { background: rgba(234, 88, 12, 0.2); color: #ea580c; }
.prediction-card.weight-forecast .prediction-icon { background: rgba(22, 163, 74, 0.2); color: #16a34a; }
.prediction-card.mortality-risk .prediction-icon { background: rgba(5, 150, 105, 0.2); color: #059669; }
.prediction-card.profit-forecast .prediction-icon { background: rgba(124, 58, 237, 0.2); color: #7c3aed; }

.prediction-content h3 {
    font-size: 0.875rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.5rem;
}

.prediction-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 0.25rem;
}

.prediction-change {
    font-size: 0.75rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.prediction-change.warning { color: #ea580c; }
.prediction-change.positive { color: #16a34a; }
.prediction-change.good { color: #059669; }
.prediction-change.excellent { color: #7c3aed; }

.prediction-details {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.prediction-panel {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 8px;
    padding: 1rem;
    border: 1px solid rgba(226, 232, 240, 0.8);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.prediction-panel h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.prediction-panel h3 i {
    color: #16a34a;
}

.prediction-grid {
    display: grid;
    gap: 1rem;
}

.stock-prediction {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.stock-item {
    background: rgba(248, 250, 252, 0.8);
    border-radius: 8px;
    padding: 1rem;
    border: 1px solid rgba(226, 232, 240, 0.6);
}

.stock-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.stock-header h4 {
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
}

.prediction-accuracy {
    font-size: 0.75rem;
    background: rgba(22, 163, 74, 0.1);
    color: #16a34a;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-weight: 500;
}

.stock-details div {
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
    color: #475569;
}

.current-stock {
    font-weight: 600;
    color: #1e293b !important;
}

.days-remaining.critical {
    color: #dc2626 !important;
    font-weight: 600;
}

.days-remaining.warning {
    color: #ea580c !important;
    font-weight: 600;
}

.optimal-order {
    background: rgba(22, 163, 74, 0.1);
    color: #16a34a !important;
    padding: 0.5rem;
    border-radius: 6px;
    font-weight: 500;
    margin-top: 0.5rem;
}

.prediction-chart-mini {
    height: 80px;
    margin-top: 0.75rem;
}

.prediction-chart-mini canvas {
    height: 80px !important;
    max-height: 80px !important;
}

.growth-predictions {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
}

.growth-chart-container h4 {
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.75rem;
}

.growth-chart-container canvas {
    height: 200px !important;
    max-height: 200px !important;
    margin-bottom: 1rem;
}

.growth-insights {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.insight-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem;
    background: rgba(248, 250, 252, 0.8);
    border-radius: 6px;
    font-size: 0.875rem;
}

.insight-label {
    color: #64748b;
    font-weight: 500;
}

.insight-value {
    font-weight: 600;
}

.insight-value.success { color: #059669; }
.insight-value.positive { color: #16a34a; }
.insight-value.info { color: #0891b2; }

.mortality-prediction h4 {
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.75rem;
}

.risk-assessment {
    background: rgba(248, 250, 252, 0.8);
    border-radius: 8px;
    padding: 1rem;
}

.risk-indicator {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.risk-circle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: white;
    position: relative;
}

.risk-indicator.low .risk-circle {
    background: linear-gradient(135deg, #059669, #16a34a);
}

.risk-indicator.low .risk-circle::after {
    content: '✓';
    font-size: 1.5rem;
}

.risk-details {
    flex: 1;
}

.risk-level {
    font-size: 1.125rem;
    font-weight: 700;
    color: #059669;
    margin-bottom: 0.25rem;
}

.risk-percentage {
    font-size: 0.875rem;
    color: #64748b;
    margin-bottom: 0.75rem;
}

.risk-factors {
    font-size: 0.8rem;
    line-height: 1.6;
    color: #475569;
}

.financial-predictions {
    display: grid;
    gap: 1.5rem;
}

.revenue-forecast h4 {
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.75rem;
}

.revenue-forecast canvas {
    height: 250px !important;
    max-height: 250px !important;
}

.cost-optimization h4 {
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.75rem;
}

.optimization-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.optimization-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: rgba(248, 250, 252, 0.8);
    border-radius: 8px;
    border-left: 4px solid;
}

.optimization-item.high-impact {
    border-left-color: #059669;
}

.optimization-item.medium-impact {
    border-left-color: #ea580c;
}

.optimization-item.low-impact {
    border-left-color: #64748b;
}

.impact-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.optimization-item.high-impact .impact-indicator {
    background: #059669;
}

.optimization-item.medium-impact .impact-indicator {
    background: #ea580c;
}

.optimization-item.low-impact .impact-indicator {
    background: #64748b;
}

.optimization-content {
    flex: 1;
}

.optimization-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.25rem;
}

.optimization-desc {
    font-size: 0.8rem;
    color: #64748b;
    margin-bottom: 0.25rem;
}

.optimization-savings {
    font-size: 0.8rem;
    font-weight: 600;
    color: #059669;
}

.market-analysis {
    display: grid;
    gap: 1rem;
}

.price-trends {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.market-card {
    background: rgba(248, 250, 252, 0.8);
    border-radius: 8px;
    padding: 1rem;
    border: 1px solid rgba(226, 232, 240, 0.6);
    transition: all 0.3s ease;
}

.market-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.market-card.price-up {
    border-top: 4px solid #059669;
}

.market-card.price-stable {
    border-top: 4px solid #64748b;
}

.market-card.demand-high {
    border-top: 4px solid #dc2626;
}

.market-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    margin-bottom: 0.75rem;
}

.market-card.price-up .market-icon {
    background: rgba(5, 150, 105, 0.2);
    color: #059669;
}

.market-card.price-stable .market-icon {
    background: rgba(100, 116, 139, 0.2);
    color: #64748b;
}

.market-card.demand-high .market-icon {
    background: rgba(220, 38, 38, 0.2);
    color: #dc2626;
}

.market-content h4 {
    font-size: 0.875rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.5rem;
}

.market-value {
    font-size: 1.125rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 0.25rem;
}

.market-change {
    font-size: 0.8rem;
    font-weight: 500;
    color: #64748b;
    margin-bottom: 0.5rem;
}

.market-advice {
    font-size: 0.75rem;
    background: rgba(22, 163, 74, 0.1);
    color: #16a34a;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-weight: 500;
}

/* Predictions Mobile Responsiveness */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem 0;
    }
    
    .header-info {
        flex-direction: column;
        gap: 1rem;
    }
    
    .shed-dropdown {
        min-width: 160px;
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }
    
    .prediction-summary {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .stock-prediction {
        grid-template-columns: 1fr;
    }
    
    .growth-predictions {
        grid-template-columns: 1fr;
    }
    
    .price-trends {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .prediction-summary {
        grid-template-columns: 1fr;
    }
} 