/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

/* Navbar */
.navbar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.nav-brand {
    color: white;
    font-size: 1.3rem;
    font-weight: 600;
    padding: 15px 0;
}

.nav-links {
    display: flex;
    gap: 5px;
}

.nav-link {
    color: rgba(255,255,255,0.9);
    text-decoration: none;
    padding: 15px 15px;
    transition: background 0.2s;
}

.nav-link:hover {
    background: rgba(255,255,255,0.1);
    color: white;
}

/* Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Cards */
.card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.card h2 {
    margin-bottom: 15px;
    font-size: 1.2rem;
    color: #444;
    border-bottom: 2px solid #667eea;
    padding-bottom: 10px;
}

/* Stats grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.stat-card {
    background: white;
    border-radius: 10px;
    padding: 25px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: #667eea;
}

.stat-label {
    color: #666;
    margin-top: 5px;
}

/* Dashboard layout */
.dashboard-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.dashboard-row .card.half {
    flex: 1;
}

/* Tables */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.data-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #555;
}

.data-table tr:hover {
    background: #f8f9fa;
}

.info-table {
    width: 100%;
}

.info-table th {
    text-align: left;
    padding: 8px 10px 8px 0;
    color: #666;
    font-weight: 500;
    width: 40%;
}

.info-table td {
    padding: 8px 0;
}

/* Status badges */
.status-completed { color: #28a745; }
.status-error { color: #dc3545; }
.status-processing { color: #ffc107; }
.status-pending { color: #6c757d; }

.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 15px;
    font-size: 0.85rem;
}

.badge-success {
    background: #d4edda;
    color: #155724;
}

.badge-secondary {
    background: #e9ecef;
    color: #6c757d;
}

.badge-danger {
    background: #f8d7da;
    color: #721c24;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    text-decoration: none;
    font-size: 0.95rem;
    transition: all 0.2s;
}

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

.btn-primary:hover {
    background: #5a6fd6;
}

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

.btn-secondary:hover {
    background: #5a6268;
}

.btn-success {
    background: #28a745;
    color: white;
}

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

.btn-small {
    padding: 5px 12px;
    font-size: 0.85rem;
}

.btn-large {
    padding: 12px 30px;
    font-size: 1.1rem;
}

.btn-block {
    display: block;
    width: 100%;
}

/* Forms */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #555;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: #888;
}

.form-actions {
    margin-top: 20px;
    text-align: center;
}

.inline-form {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.inline-form input {
    flex: 1;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.actions-row {
    margin-top: 15px;
}

/* Search form */
.search-form {
    display: flex;
    gap: 10px;
}

.search-form input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.page-info {
    color: #666;
}

/* Login page */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 80vh;
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 400px;
}

.login-box h1 {
    text-align: center;
    margin-bottom: 30px;
    color: #667eea;
}

/* Alerts */
.alert {
    padding: 12px 15px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Funnel */
.funnel {
    padding: 10px 0;
}

.funnel-step {
    margin-bottom: 15px;
}

.funnel-bar {
    height: 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 5px;
    min-width: 5%;
}

.funnel-label {
    margin-top: 5px;
    color: #666;
}

/* Page header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.page-header h1 {
    margin: 0;
}

/* Footer */
.footer {
    text-align: center;
    padding: 20px;
    color: #888;
    font-size: 0.9rem;
}

/* Text utilities */
.text-center { text-align: center; }
.text-muted { color: #888; }
.text-success { color: #28a745; }
.text-danger { color: #dc3545; }

/* Additional badges */
.badge-info {
    background: #d1ecf1;
    color: #0c5460;
}

.badge-warning {
    background: #fff3cd;
    color: #856404;
}

.badge-light {
    background: #f8f9fa;
    color: #666;
}

/* File input styles */
.file-input {
    padding: 5px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    background: white;
    font-size: 0.9rem;
}

.file-input-small {
    padding: 4px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    background: white;
    font-size: 0.85rem;
    max-width: 150px;
}

/* Btn warning */
.btn-warning {
    background: #ffc107;
    color: #212529;
}

.btn-warning:hover {
    background: #e0a800;
}

/* Responsive */
@media (max-width: 768px) {
    .dashboard-row {
        flex-direction: column;
    }

    .navbar {
        flex-direction: column;
        padding: 10px;
    }

    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
