:root {
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --bg-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --text-main: #1f2937;
    --text-muted: #6b7280;
    --white: #ffffff;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', -apple-system, sans-serif;
}

body {
    background: var(--bg-gradient);
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Estilos para el login (existentes) */
.auth-card {
    background: var(--white);
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    width: 100%;
    max-width: 400px;
    transition: all 0.3s ease;
}

.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.logo-text {
    font-weight: 800;
    font-size: 2rem;
    color: var(--primary);
    margin-bottom: 10px;
    letter-spacing: -1px;
}

.logo-text span {
    color: var(--text-main);
}

.auth-header h1 {
    font-size: 1.5rem;
    color: var(--text-main);
}

.auth-header p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 5px;
}

.input-group input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.btn-primary {
    width: 100%;
    background-color: var(--primary);
    color: white;
    padding: 12px;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
}

.auth-footer {
    margin-top: 25px;
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.auth-footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.hidden {
    display: none;
}

/* Nuevos estilos para el dashboard y CRUD */
.dashboard-container {
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: #f5f5f5;
}

.dashboard-header {
    background: var(--bg-gradient);
    color: var(--white);
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.welcome-section {
    display: flex;
    align-items: center;
    gap: 15px;
}

.welcome-section h1 {
    font-size: 1.3rem;
    font-weight: 600;
}

.user-badge {
    background: rgba(255, 255, 255, 0.2);
    padding: 6px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
}

.logout-btn {
    background: var(--danger);
    color: var(--white);
    padding: 8px 20px;
    border: none;
    border-radius: 20px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 3px 10px rgba(239, 68, 68, 0.3);
}

.logout-btn:hover {
    background: #dc2626;
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(239, 68, 68, 0.4);
}

.main-content {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    gap: 20px;
}

.btn-add {
    background: var(--bg-gradient);
    color: var(--white);
    padding: 12px 25px;
    border: none;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-add:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.search-box {
    position: relative;
    width: 300px;
}

.search-input {
    width: 100%;
    padding: 10px 40px 10px 15px;
    border: 2px solid #e5e7eb;
    border-radius: 25px;
    font-size: 0.9rem;
    transition: border-color 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
}

.search-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.ordenes-table {
    background: var(--white);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th {
    background: var(--bg-gradient);
    color: var(--white);
    padding: 15px;
    text-align: left;
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
}

.table td {
    padding: 15px;
    border-bottom: 1px solid #f3f4f6;
    font-size: 0.85rem;
    vertical-align: middle;
}

.table tr:hover {
    background-color: #f9fafb;
}

.table tr:last-child td {
    border-bottom: none;
}

.progress-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.progress-bar {
    width: 80px;
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--success), #34d399);
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
}

.action-buttons {
    display: flex;
    gap: 8px;
}

.btn-action {
    padding: 6px 12px;
    border: none;
    border-radius: 15px;
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.btn-edit {
    background: var(--info);
    color: var(--white);
}

.btn-edit:hover {
    background: #2563eb;
    transform: translateY(-1px);
}

.btn-delete {
    background: var(--danger);
    color: var(--white);
}

.btn-delete:hover {
    background: #dc2626;
    transform: translateY(-1px);
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state h3 {
    font-size: 1.3rem;
    margin-bottom: 10px;
    color: var(--text-main);
}

.empty-state p {
    font-size: 0.95rem;
}

.alert {
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-weight: 500;
}

.alert-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-success {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .dashboard-header {
        flex-direction: column;
        gap: 15px;
        padding: 20px;
    }

    .welcome-section {
        flex-direction: column;
        text-align: center;
        gap: 8px;
    }

    .content-header {
        flex-direction: column;
        align-items: stretch;
    }

    .search-box {
        width: 100%;
    }

    .table {
        font-size: 0.75rem;
    }

    .table th, .table td {
        padding: 10px 5px;
    }

    .action-buttons {
        flex-direction: column;
        gap: 5px;
    }

    .main-content {
        padding: 20px 15px;
    }
}

@media (max-width: 480px) {
    .auth-card {
        padding: 30px 20px;
        margin: 20px;
    }

    .dashboard-header {
        padding: 15px;
    }

    .welcome-section h1 {
        font-size: 1.1rem;
    }

    .btn-add {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
}
