/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.app-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e0e0e0;
}

.app-header h1 {
    color: #2c3e50;
    font-size: 2.2rem;
    margin-bottom: 8px;
}

.subtitle {
    color: #7f8c8d;
    font-size: 1.1rem;
}

/* Alert Box */
.alert-box {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 25px;
    font-size: 0.95rem;
}

.alert-box.info {
    background-color: #e3f2fd;
    border-left: 4px solid #2196f3;
    color: #0d47a1;
}

.alert-box.warning {
    background-color: #fff3e0;
    border-left: 4px solid #ff9800;
    color: #e65100;
}

.alert-box.danger {
    background-color: #ffebee;
    border-left: 4px solid #f44336;
    color: #b71c1c;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.dashboard-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid #e0e0e0;
}

.dashboard-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
}

.dashboard-card.alert {
    border-color: #ffcdd2;
}

.dashboard-card.has-alerts {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { border-color: #ffcdd2; }
    50% { border-color: #f44336; }
    100% { border-color: #ffcdd2; }
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.card-header h3 {
    font-size: 1.1rem;
    color: #2c3e50;
    font-weight: 600;
}

.card-badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.card-badge.success {
    background-color: #e8f5e9;
    color: #2e7d32;
}

.card-badge.danger {
    background-color: #ffebee;
    color: #c62828;
}

.card-badge.stock {
    background-color: #e3f2fd;
    color: #1565c0;
}

.card-content {
    margin-bottom: 15px;
}

.kpi-value {
    font-size: 2rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 5px;
}

.kpi-label {
    font-size: 0.9rem;
    color: #7f8c8d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.card-footer {
    font-size: 0.85rem;
    color: #95a5a6;
    padding-top: 10px;
    border-top: 1px solid #f5f5f5;
}

/* Quick Actions */
.quick-actions {
    background: white;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.quick-actions h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.3rem;
}

.action-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 20px;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    gap: 8px;
}

.btn-primary {
    background-color: #dc3545;
    color: white;
}

.btn-primary:hover {
    background-color: #c82333;
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background-color: #5a6268;
    transform: translateY(-1px);
}

.btn-outline {
    background-color: transparent;
    color: #6c757d;
    border: 2px solid #dee2e6;
}

.btn-outline:hover {
    border-color: #6c757d;
    background-color: #f8f9fa;
}

/* Recent Activity */
.recent-activity {
    background: white;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.recent-activity h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.3rem;
}

.activity-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.activity-item {
    display: flex;
    align-items: center;
    padding: 15px;
    border-radius: 8px;
    background-color: #f8f9fa;
    transition: background-color 0.2s;
}

.activity-item:hover {
    background-color: #e9ecef;
}

.activity-item.has-errors {
    background-color: #fff3f3;
    border-left: 4px solid #dc3545;
}

.activity-icon {
    font-size: 1.5rem;
    margin-right: 15px;
    min-width: 40px;
}

.activity-content {
    flex: 1;
}

.activity-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

.activity-title strong {
    color: #2c3e50;
    font-size: 1.05rem;
}

.activity-amount {
    font-weight: 600;
    color: #2c3e50;
}

.activity-details {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    color: #6c757d;
}

.error-tag {
    background-color: #ffebee;
    color: #c62828;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
}

.success-tag {
    background-color: #e8f5e9;
    color: #2e7d32;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #95a5a6;
    font-style: italic;
}

/* Footer */
.app-footer {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
    text-align: center;
    color: #7f8c8d;
    font-size: 0.9rem;
}

.system-info {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.system-info code {
    background-color: #f1f3f4;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
}

.app-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.app-links a {
    color: #6c757d;
    text-decoration: none;
    transition: color 0.2s;
}

.app-links a:hover {
    color: #495057;
}

.text-danger {
    color: #dc3545 !important;
}

.timeline-item.clickable {
    cursor: pointer;
}

.timeline-item.clickable:hover {
    cursor: pointer;
    background: #e9ecef;
}

.text-danger:hover {
    color: #c82333 !important;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .action-buttons {
        grid-template-columns: 1fr;
    }
    
    .kpi-value {
        font-size: 1.8rem;
    }
    
    .system-info, .app-links {
        flex-direction: column;
        gap: 8px;
    }
}

/* Print Styles */
@media print {
    .btn, .app-footer {
        display: none;
    }
    
    .dashboard-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ccc;
    }
}