/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #2e7d32;
    --primary-dark: #1b5e20;
    --primary-light: #4caf50;
    --secondary: #ff9800;
    --danger: #f44336;
    --warning: #ffc107;
    --info: #2196f3;
    --light: #f8f9fa;
    --dark: #343a40;
    --gray: #6c757d;
    --gray-light: #e9ecef;
    --border: #dee2e6;
    --shadow: 0 2px 10px rgba(0,0,0,0.1);
    --shadow-lg: 0 5px 20px rgba(0,0,0,0.15);
    --radius: 8px;
    --radius-lg: 12px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    color: var(--dark);
    line-height: 1.6;
}

.container-fluid {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Navigation */
.navbar {
    background: white;
    box-shadow: var(--shadow);
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
    border-radius: var(--radius);
    flex-wrap: wrap;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.nav-brand i {
    font-size: 2rem;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
    margin: 0;
    flex-wrap: wrap;
}

.nav-links a {
    text-decoration: none;
    color: var(--gray);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    transition: all 0.3s ease;
    font-weight: 500;
}

.nav-links a:hover {
    background: var(--primary-light);
    color: white;
    transform: translateY(-2px);
}

.nav-links li.active a {
    background: var(--primary);
    color: white;
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.user-info, .current-date {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--gray);
    font-weight: 500;
}

/* Alerts */
.alert {
    padding: 1rem 1.5rem;
    border-radius: var(--radius);
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: slideIn 0.3s ease;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-danger {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Page Header */
.page-header {
    margin-bottom: 2rem;
    text-align: center;
}

.page-header h1 {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.page-header p {
    color: var(--gray);
    font-size: 1.1rem;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.stat-card {
    background: white;
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 1.5rem;
    transition: all 0.3s ease;
    border-left: 4px solid var(--primary);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.stat-card.production { border-left-color: var(--info); }
.stat-card.sales { border-left-color: var(--secondary); }
.stat-card.stock { border-left-color: var(--warning); }
.stat-card.revenue { border-left-color: var(--primary); }

.stat-icon {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: white;
}

.stat-card.production .stat-icon { background: var(--info); }
.stat-card.sales .stat-icon { background: var(--secondary); }
.stat-card.stock .stat-icon { background: var(--warning); }
.stat-card.revenue .stat-icon { background: var(--primary); }

.stat-info h3 {
    font-size: 0.9rem;
    color: var(--gray);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-number {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 0.5rem;
}

.stat-trend {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--gray);
}

/* Dashboard Sections */
.dashboard-section {
    background: white;
    border-radius: var(--radius-lg);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
}

.section-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--gray-light);
}

.section-header h2 {
    color: var(--dark);
    font-size: 1.5rem;
}

.section-header i {
    color: var(--primary);
}

/* Stock Type Grid */
.stock-type-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.stock-type-card {
    background: var(--light);
    padding: 1.5rem;
    border-radius: var(--radius);
    border-left: 4px solid var(--primary);
}

.stock-type-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.stock-type-header h3 {
    color: var(--dark);
    font-size: 1.1rem;
}

.stock-badge {
    background: var(--primary);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.stock-details {
    text-align: center;
}

.stock-conversion span {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--primary);
}

/* Quick Actions */
.quick-actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.quick-action {
    background: white;
    padding: 2rem;
    border-radius: var(--radius);
    text-decoration: none;
    color: inherit;
    border: 2px solid var(--gray-light);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.quick-action:hover {
    border-color: var(--primary);
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    color: inherit;
}

.action-icon {
    width: 60px;
    height: 60px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
}

.action-text h3 {
    color: var(--dark);
    margin-bottom: 0.5rem;
}

.action-text p {
    color: var(--gray);
    font-size: 0.9rem;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--dark);
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.1);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.btn-secondary {
    background: var(--secondary);
    color: white;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-outline {
    background: transparent;
    border-color: var(--border);
    color: var(--dark);
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

/* Tables */
.table-responsive {
    overflow-x: auto;
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.data-table th {
    background: var(--light);
    font-weight: 600;
    color: var(--dark);
}

.data-table tr:hover {
    background: var(--gray-light);
}

/* Status Badges */
.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-badge.paid {
    background: #d4edda;
    color: #155724;
}

.status-badge.pending {
    background: #fff3cd;
    color: #856404;
}

.status-badge.failed {
    background: #f8d7da;
    color: #721c24;
}

/* Empty States */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--gray);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Footer */
.footer {
    text-align: center;
    padding: 2rem;
    margin-top: 4rem;
    color: var(--gray);
    border-top: 1px solid var(--border);
}

.footer-content p {
    margin-bottom: 0.5rem;
}

/* Action Bar */
.action-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.action-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Form Layouts */
.form-container {
    background: white;
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow);
    max-width: 1000px;
    margin: 0 auto;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.form-grid-4 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.form-section {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.form-section h3 {
    color: var(--primary);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
    gap: 1rem;
}

/* Total Display */
.total-display, .conversion-display {
    padding: 0.75rem;
    background: var(--light);
    border-radius: var(--radius);
    font-weight: 600;
    color: var(--primary);
    text-align: center;
}

/* Barns Grid */
.barns-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
}

.barn-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    border-left: 4px solid var(--primary);
    transition: all 0.3s ease;
}

.barn-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.barn-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.barn-header h3 {
    margin: 0;
    color: var(--primary);
}

.barn-info {
    margin-bottom: 1rem;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    color: var(--gray);
}

.barn-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 1rem;
    background: var(--light);
    border-radius: var(--radius);
}

.stat {
    text-align: center;
}

.stat-value {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--primary);
}

.stat-label {
    font-size: 0.8rem;
    color: var(--gray);
}

.barn-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Sortir Badge */
.sortir-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: capitalize;
}

.sortir-badge.perdana { background: #e3f2fd; color: #1976d2; }
.sortir-badge.kecil { background: #f3e5f5; color: #7b1fa2; }
.sortir-badge.sedang { background: #e8f5e8; color: #388e3c; }
.sortir-badge.besar { background: #fff3e0; color: #f57c00; }
.sortir-badge.super { background: #fce4ec; color: #c2185b; }
.sortir-badge.putih { background: #f5f5f5; color: #616161; }
.sortir-badge.retak { background: #ffebee; color: #d32f2f; }

/* Form Text */
.form-text {
    font-size: 0.8rem;
    color: var(--gray);
    margin-top: 0.25rem;
}

/* Text Utilities */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }
.mb-3 { margin-bottom: 1rem; }
.mt-3 { margin-top: 1rem; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 0.5rem; }

/* Enhanced Dashboard Styles */
.reports-dashboard {
    padding: 0;
}

.dashboard-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.header-content h1 {
    margin: 0 0 0.5rem 0;
    font-size: 2rem;
    font-weight: 700;
}

.header-content p {
    margin: 0;
    opacity: 0.9;
    font-size: 1.1rem;
}

.date-filter {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
}

/* Metrics Grid */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.metric-card {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    border-left: 4px solid;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.metric-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
}

.metric-card.primary { border-left-color: #667eea; }
.metric-card.success { border-left-color: #4CAF50; }
.metric-card.warning { border-left-color: #FF9800; }
.metric-card.info { border-left-color: #2196F3; }

.metric-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
}

.metric-card.primary .metric-icon { background: #667eea; }
.metric-card.success .metric-icon { background: #4CAF50; }
.metric-card.warning .metric-icon { background: #FF9800; }
.metric-card.info .metric-icon { background: #2196F3; }

.metric-content {
    flex: 1;
}

.metric-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 0.25rem;
}

.metric-label {
    font-size: 0.9rem;
    color: #718096;
    margin-bottom: 0.25rem;
}

.metric-subtext {
    font-size: 0.8rem;
    color: #a0aec0;
}

.metric-trend {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

.metric-trend.up {
    background: #c6f6d5;
    color: #22543d;
}

.metric-trend.down {
    background: #fed7d7;
    color: #742a2a;
}

/* Analytics Section */
.analytics-section {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e2e8f0;
    flex-wrap: wrap;
    gap: 1rem;
}

.section-header h2 {
    margin: 0;
    color: #2d3748;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.period-select {
    padding: 0.5rem 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: white;
    color: #4a5568;
    font-size: 0.9rem;
}

/* Charts Grid */
.charts-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
}

.chart-card {
    background: #f8fafc;
    border-radius: 8px;
    padding: 1rem;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.chart-header h3 {
    margin: 0;
    font-size: 1rem;
    color: #2d3748;
}

.chart-legend {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: #718096;
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 2px;
}

.legend-color.production { background: #667eea; }
.legend-color.sales { background: #4CAF50; }

/* Simple Chart */
.simple-chart {
    height: 200px;
    display: flex;
    align-items: flex-end;
}

.chart-bars {
    display: flex;
    align-items: flex-end;
    gap: 0.5rem;
    height: 100%;
    width: 100%;
}

.chart-bar-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    height: 100%;
}

.chart-bar {
    width: 20px;
    border-radius: 4px 4px 0 0;
    margin-bottom: 0.25rem;
}

.chart-bar.production {
    background: #667eea;
    height: 70%;
}

.chart-bar.sales {
    background: #4CAF50;
    height: 50%;
}

.chart-label {
    font-size: 0.7rem;
    color: #718096;
    margin-top: 0.5rem;
}

/* Pie Chart */
.pie-chart {
    display: flex;
    align-items: center;
    gap: 1rem;
    height: 200px;
    flex-wrap: wrap;
}

.donut {
    width: 120px;
    height: 120px;
}

.donut-segment {
    transform-origin: center;
    transform: rotate(-90deg);
    transition: stroke-dasharray 0.3s ease;
}

.pie-legend {
    flex: 1;
}

.pie-legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    font-size: 0.8rem;
}

.pie-legend-item .legend-color {
    width: 12px;
    height: 12px;
    border-radius: 2px;
}

.legend-label {
    flex: 1;
    color: #4a5568;
}

.legend-value {
    color: #718096;
    font-weight: 600;
}

/* Quick Stats */
.quick-stats-section {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.stats-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 8px;
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    background: #667eea;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
}

.stat-info {
    flex: 1;
}

.stat-number {
    font-size: 1.5rem;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.8rem;
    color: #718096;
}

/* Recent Activity */
.recent-activity-section {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.view-all-link {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
}

.activity-timeline {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 8px;
    transition: background-color 0.2s ease;
    flex-wrap: wrap;
}

.activity-item:hover {
    background: #edf2f7;
}

.activity-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1rem;
}

.activity-icon.success { background: #4CAF50; }
.activity-icon.primary { background: #667eea; }
.activity-icon.warning { background: #FF9800; }

.activity-content {
    flex: 1;
    min-width: 200px;
}

.activity-title {
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 0.25rem;
}

.activity-description {
    font-size: 0.9rem;
    color: #718096;
    margin-bottom: 0.25rem;
}

.activity-time {
    font-size: 0.8rem;
    color: #a0aec0;
}

.activity-amount {
    font-weight: 600;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.9rem;
}

.activity-amount.success { 
    background: #c6f6d5; 
    color: #22543d;
}
.activity-amount.primary { 
    background: #bee3f8; 
    color: #1a365d;
}
.activity-amount.warning { 
    background: #feebc8; 
    color: #744210;
}

/* No Data State */
.no-data {
    text-align: center;
    padding: 2rem;
    color: #a0aec0;
}

.no-data i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Enhanced Reports Styles */
.reports-page {
    padding: 0;
    background: #f8fafc;
    min-height: 100vh;
}

.reports-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem;
    border-radius: 0 0 20px 20px;
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.header-main h1 {
    margin: 0 0 0.5rem 0;
    font-size: 2.25rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-main p {
    margin: 0;
    opacity: 0.9;
    font-size: 1.1rem;
    font-weight: 300;
}

.header-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.date-range-picker {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.75rem 1.25rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
    font-weight: 500;
}

.date-range-picker:hover {
    background: rgba(255, 255, 255, 0.3);
}

.btn-refresh {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    padding: 0.75rem 1.25rem;
    border-radius: 12px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-refresh:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

/* Section Titles */
.section-title {
    margin-bottom: 2rem;
}

.section-title h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #2d3748;
    margin: 0 0 0.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.section-title p {
    color: #718096;
    margin: 0;
    font-size: 1rem;
}

/* Export Cards */
.export-section {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.export-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
}

.export-card {
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    gap: 1rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    flex-wrap: wrap;
}

.export-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: #667eea;
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.export-card:hover {
    border-color: #667eea;
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.export-card:hover::before {
    transform: scaleX(1);
}

.export-card.highlight {
    border-color: #4CAF50;
    background: linear-gradient(135deg, #f0fff4 0%, #ffffff 100%);
}

.export-card.highlight::before {
    background: #4CAF50;
}

.export-card.premium {
    border-color: #ff9800;
    background: linear-gradient(135deg, #fffaf0 0%, #ffffff 100%);
}

.export-card.premium::before {
    background: #ff9800;
}

.export-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    flex-shrink: 0;
}

.export-icon.production { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
.export-icon.sales { background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%); }
.export-icon.stock { background: linear-gradient(135deg, #ff9800 0%, #f57c00 100%); }
.export-icon.barn { background: linear-gradient(135deg, #2196F3 0%, #1976d2 100%); }
.export-icon.summary { background: linear-gradient(135deg, #9C27B0 0%, #7b1fa2 100%); }
.export-icon.complete { background: linear-gradient(135deg, #607d8b 0%, #455a64 100%); }

.export-content {
    flex: 1;
    min-width: 200px;
}

.export-content h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #2d3748;
}

.export-content p {
    margin: 0 0 1rem 0;
    color: #718096;
    font-size: 0.9rem;
    line-height: 1.4;
}

.export-stats {
    display: flex;
    gap: 1rem;
    font-size: 0.8rem;
    flex-wrap: wrap;
}

.export-stats .stat {
    background: #e2e8f0;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    color: #4a5568;
    font-weight: 500;
}

.export-stats .update {
    color: #a0aec0;
}

.export-actions {
    display: flex;
    align-items: flex-end;
}

.btn-export {
    background: #667eea;
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
}

.btn-export:hover {
    background: #5a6fd8;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.export-card.highlight .btn-export {
    background: #4CAF50;
}

.export-card.highlight .btn-export:hover {
    background: #45a049;
}

.export-card.premium .btn-export {
    background: #ff9800;
}

.export-card.premium .btn-export:hover {
    background: #f57c00;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .export-cards-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .charts-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1024px) {
    .charts-grid {
        grid-template-columns: 1fr;
    }
    
    .metrics-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }
    
    .nav-links {
        gap: 0.5rem;
    }
    
    .nav-links a {
        padding: 0.5rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .page-header h1 {
        font-size: 2rem;
    }
    
    .stat-card {
        padding: 1.5rem;
    }

    .dashboard-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .metrics-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-cards-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .section-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .pie-chart {
        flex-direction: column;
        text-align: center;
    }

    .reports-header {
        flex-direction: column;
        gap: 1.5rem;
        text-align: center;
    }
    
    .header-actions {
        flex-direction: column;
        width: 100%;
    }
    
    .date-range-picker,
    .btn-refresh {
        width: 100%;
        justify-content: center;
    }
    
    .export-cards-grid {
        grid-template-columns: 1fr;
    }
    
    .tabs-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .tabs-navigation {
        justify-content: center;
    }
    
    .tabs-actions {
        justify-content: center;
    }
    
    .search-input {
        width: 100%;
    }
    
    .modern-table {
        font-size: 0.8rem;
    }
    
    .modern-table th,
    .modern-table td {
        padding: 0.75rem 0.5rem;
    }

    .barns-grid {
        grid-template-columns: 1fr;
    }
    
    .form-grid-4 {
        grid-template-columns: 1fr;
    }
    
    .barn-stats {
        grid-template-columns: 1fr;
    }

    .activity-item {
        flex-direction: column;
        text-align: center;
    }
    
    .metric-card {
        flex-direction: column;
        text-align: center;
    }
    
    .metric-trend {
        align-self: center;
    }
}

@media (max-width: 480px) {
    .stats-cards-grid {
        grid-template-columns: 1fr;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .btn-action {
        width: 28px;
        height: 28px;
    }

    .reports-header {
        padding: 1.5rem;
    }
    
    .header-main h1 {
        font-size: 1.75rem;
    }
    
    .export-section,
    .performance-section,
    .data-preview-section {
        padding: 1.5rem;
    }
    
    .tabs-navigation {
        flex-direction: column;
    }
    
    .tab-btn {
        justify-content: center;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .btn-action {
        width: 28px;
        height: 28px;
    }

    .form-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .form-actions .btn {
        width: 100%;
        justify-content: center;
    }
}

/* Print Styles */
@media print {
    .navbar,
    .action-bar,
    .tabs-header,
    .action-buttons,
    .btn-export {
        display: none;
    }
    
    .reports-page {
        background: white;
        padding: 0;
    }
    
    .export-card,
    .performance-card,
    .stat-card {
        break-inside: avoid;
        border: 1px solid #ddd;
    }
    
    .modern-table {
        font-size: 10pt;
    }
    
    .page-header h1 {
        color: black;
    }
}

/* Loading and Notification Styles */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-spinner {
    text-align: center;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-spinner p {
    margin: 0;
    color: #4a5568;
    font-weight: 500;
}

.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    border-radius: 8px;
    padding: 1rem 1.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    border-left: 4px solid;
    display: flex;
    align-items: center;
    gap: 1rem;
    z-index: 1000;
    animation: slideInRight 0.3s ease;
    max-width: 400px;
}

.notification-success {
    border-left-color: #38a169;
}

.notification-info {
    border-left-color: #667eea;
}

.notification-warning {
    border-left-color: #d69e2e;
}

.notification-error {
    border-left-color: #e53e3e;
}

.notification-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
}

.notification-content i {
    font-size: 1.2rem;
}

.notification-success .notification-content i { color: #38a169; }
.notification-info .notification-content i { color: #667eea; }
.notification-warning .notification-content i { color: #d69e2e; }
.notification-error .notification-content i { color: #e53e3e; }

.notification-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: #a0aec0;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notification-close:hover {
    color: #718096;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}