/* ===== RESET Y ESTILOS BASE ===== */
* {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    min-height: 100vh;
    margin: 0;
}

main {
    padding: 40px;
    max-width: 1200px;
    margin: 0 auto;
}

/* ===== ANIMACIONES ===== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== LAYOUT ===== */
.row {
    display: flex;
    width: 100%;
    gap: 16px;
    margin: 16px 0;
}

.row div {
    flex: 1;
}

/* ===== COMPONENTES DE FORMULARIO ===== */
.login-form {
    width: 100%;
}

.login-container {
    background: #fff;
    padding: 40px;
    border-radius: 16px;
    color: #000;
    max-width: 440px;
    margin: 40px auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    border-top: 10px solid var(--color-main);
}

.login-container h2 {
    color: #000;
    margin-bottom: 24px;
    font-weight: 600;
    text-align: center;
    font-size: 1.75rem;
}

.login-container h3 {
    text-align: center;
    color: #000;
    padding-top: 8px;
}

.login-container h3 a {
    color: var(--color-main-dark);
    text-decoration: none;
    transition: color 0.2s ease;
}

.login-container h3 a:hover {
    color: var(--color-main-focus);
}

.login-container label {
    display: block;
    font-weight: 600;
    margin-top: 16px;
    font-size: 0.9rem;
}

.login-container input {
    width: 100%;
    padding: 14px 12px;
    margin-top: 6px;
    border: 1px solid #aaa;
    border-radius: 8px;
    box-sizing: border-box;
    background: rgba(255, 255, 255, 0.95);
    transition: all 0.2s ease;
    font-size: 1rem;
    position: relative;
}

.login-container input:focus {
    outline: none;
    border-color: var(--color-main-focus);
    background: white;
}

.login-container button[type="submit"] {
    width: 100%;
    margin-top: 24px;
    padding: 14px;
    background: linear-gradient(135deg, var(--color-main-light), var(--color-main));
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    color: var(--color-text-primary);
    font-size: 1rem;
    transition: all 0.2s ease;
}

.login-container button[type="submit"]:hover {
    background: linear-gradient(135deg, var(--color-main), var(--color-main-dark));
}

/* ===== COMPONENTES DE PASSWORD ===== */
.password-div {
    position: relative;
}

.view-password {
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background-color: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
}

.view-password img {
    width: 24px;
    height: 24px;
    opacity: 0.7;
}

/* ===== COMPONENTES DE NAVEGACIÓN ===== */
.go-back {
    text-decoration: none;
    color: var(--color-text-primary);
    position: absolute;
    top: 24px;
    left: 16px;
}

.close-button, .back-button {
    background-color: var(--color-text-primary);
    font-weight: 600;
    padding: 10px 20px;
    text-decoration: none;
    color: #000;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
}

.close-button:hover, .back-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

/* ===== COMPONENTES VISUALES ===== */
.logo {
    display: block;
    margin: auto;
    padding-top: 24px;
    max-width: 200px;
    filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.2));
}

.error {
    list-style: none;
    width: 100%;
    background-color: #dc3545;
    border: 1px solid #b02a37;
    font-weight: 500;
    padding: 12px;
    box-sizing: border-box;
    margin-top: 12px;
    border-radius: 8px;
    text-align: center;
    color: white;
}

/* ===== ENLACES Y BOTONES ESPECIALES ===== */
.forgot-password {
    text-align: center;
    text-decoration: none;
    color: #333;
    display: block;
    margin: 16px auto 0;
    transition: color 0.2s ease;
}

.forgot-password:hover {
    color: var(--color-text-secondary);
}

.recuperar-volver {
    text-align: center;
    margin-top: 20px;
}

.recuperar-volver a {
    color: var(--color-text-primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 16px;
    transition: color 0.2s ease;
}

.recuperar-volver a:hover {
    color: var(--color-main-focus);
}

/* ===== DASHBOARD ===== */
.dashboard-header {
    background: var(--color-main);
    padding: 16px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.dashboard-header .left h1 {
    color: var(--color-text-primary);
    font-size: 1.6rem;
    font-weight: 700;
}

.dashboard-header .left p {
    color: var(--color-text-secondary);
    font-size: 1rem;
    margin: 0;
}

.dashboard-header .right {
    display: flex;
    gap: 16px;
    align-items: stretch;
}

.dashboard-header .profile-button{
    background-color: var(--color-main-light);
    padding: 8px;
    aspect-ratio: 1;
    border-radius: 100%;
    border: 2px solid #ddd;
    transition: transform .3s;
}

.dashboard-header .profile-button:hover{
    transform: scale(1.05);
    cursor: pointer;
}
.profile-button svg{
    color: var(--color-text-primary);
}

.dashboard-container {
    margin: auto;
    display: flex;
    justify-content: center;
    flex-direction: column;
    align-items: center;
    background-color: var(--color-text-primary);
    padding: 40px;
    border-radius: 16px;
    color: var(--color-text-primary);
    max-width: 1000px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.dashboard-container h1 {
    color: #000;
    margin-bottom: 24px;
}

.dashboard-container .buttons-container {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
}

.dashboard-container .buttons-container a,
.dashboard-container button {
    background: linear-gradient(135deg, var(--color-main-light), var(--color-main));
    border: none;
    font-weight: 600;
    font-size: 16px;
    color: var(--color-text-primary);
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.dashboard-container .buttons-container a:hover,
.dashboard-container button:hover {
    transform: translateY(-2px);
    background: linear-gradient(135deg, var(--color-main), var(--color-main-dark));
}

.dashboard-container .card {
    color: #000;
    width: 100%;
    margin: auto;
    text-align: center;
}

/* ===== BOTONES DEL DASHBOARD ===== */
.btn-secondary {
    display: block;
    height: 100%;
    background: rgba(255, 255, 255, 0.15);
    color: var(--color-text-primary);
    padding: 12px 24px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-1px);
    color: var(--color-text-primary);
}

.btn-session {
    display: block;
    background-color: transparent;
    box-shadow: none;
    margin: auto;
    height: 100%;
    color: rgb(214, 5, 5);
    border: none;
    margin-top: 24px;
    border-radius: 8px;
    font-weight: 600;
}

.btn-session:hover {
    cursor: pointer;
}

/* ===== PEDIDOS ===== */
.pedidos-container {
    width: 90%;
    max-width: 900px;
    margin: 40px auto;
    font-family: 'Inter', system-ui, sans-serif;
    text-align: left;
    color: #1a1a1a;
}

.pedidos-container h2 {
    font-size: 1.8rem;
    font-weight: 600;
    color: #222;
    text-align: center;
    margin-bottom: 32px;
}

.descripcion {
    text-align: center;
    color: var(--color-text-muted);
    font-size: 1.1rem;
    margin-bottom: 40px;
}

/* ===== TARJETAS DE PEDIDO ===== */
.pedido-card {
    background: var(--color-text-primary);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #f0f0f0;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    animation: fadeInUp 0.4s ease;
    cursor: pointer;
}

.pedido-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--color-main);
}

.pedido-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.pedido-card:nth-child(odd) {
    animation-delay: 0.1s;
}

.pedido-card:nth-child(even) {
    animation-delay: 0.2s;
}

.pedido-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
}

.pedido-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #1a1a1a;
}

.pedido-meta {
    display: flex;
    gap: 16px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.pedido-meta span {
    color: var(--color-text-muted);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 4px;
}

.pedido-body {
    margin-bottom: 16px;
    padding: 16px;
    background: #f8f9fa;
    border-radius: 8px;
}

.pedido-body p {
    margin: 0;
    color: var(--color-text-muted);
    font-style: italic;
}

.pedido-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 16px;
    border-top: 1px solid #e9ecef;
}

.pedido-footer span {
    color: var(--color-text-muted);
    font-weight: 500;
}

.pedido-footer strong {
    font-size: 1.25rem;
    color: var(--color-main);
    font-weight: 700;
}

/* ===== DETALLES DE PEDIDO (OCULTOS INICIALMENTE) ===== */
.pedido-detalles {
    display: none;
    margin-top: 16px;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

.pedido-detalles.active {
    display: block;
}

/* ===== TABLAS ===== */
.tabla-detalles {
    width: 100%;
    border-collapse: collapse;
    margin-top: 16px;
    overflow: hidden;
    border-radius: 8px;
}

.tabla-detalles th,
.tabla-detalles td {
    padding: 12px;
    font-size: 0.9rem;
    text-align: left;
}

.tabla-detalles th {
    background-color: #f8f9fa;
    color: #333;
    font-weight: 600;
    border-bottom: 1px solid #e0e0e0;
}

.tabla-detalles tr {
    border-bottom: 1px solid #f0f0f0;
}

.tabla-detalles tr:hover {
    background-color: #f8f9fa;
}

/* ===== TABLAS DE PEDIDOS ===== */
.pedido-tabla {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    background: var(--color-text-primary);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    font-size: 0.95rem;
}

.pedido-tabla thead {
    background: linear-gradient(135deg, var(--color-main-light), var(--color-main));
}

.pedido-tabla thead th {
    color: var(--color-text-primary);
    font-weight: 600;
    padding: 16px 12px;
    text-align: left;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.pedido-tabla tbody tr {
    transition: all 0.2s ease;
    border-bottom: 1px solid #f0f0f0;
}

.pedido-tabla tbody tr:last-child {
    border-bottom: none;
}

.pedido-tabla tbody tr:hover {
    background-color: #f8f9fa;
}

.pedido-tabla tbody td {
    padding: 14px 12px;
    color: #333;
    border-bottom: 1px solid #f0f0f0;
}

.pedido-tabla tbody tr:last-child td {
    border-bottom: none;
}

.pedido-tabla td:first-child,
.pedido-tabla th:first-child {
    padding-left: 20px;
}

.pedido-tabla td:last-child,
.pedido-tabla th:last-child {
    padding-right: 20px;
}

.pedido-tabla td:nth-child(3),
.pedido-tabla th:nth-child(3),
.pedido-tabla td:nth-child(4),
.pedido-tabla th:nth-child(4),
.pedido-tabla td:nth-child(5),
.pedido-tabla th:nth-child(5) {
    text-align: center;
}

.pedido-tabla td:nth-child(1) {
    color: var(--color-main);
    font-weight: 600;
}

/* ===== ESTADOS DE PEDIDO ===== */
.estado {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.estado.Pendiente {
    background: #fff3cd;
    color: #856404;
}

.estado.Completado {
    background: #d1edff;
    color: #004085;
}

.estado.Procesando {
    background: #d4edda;
    color: #155724;
}

.estado.Cancelado {
    background: #f8d7da;
    color: #721c24;
}

.estado.Enviado {
    background: #e7f3ff;
    color: #0066cc;
}

.estado.Entregado {
    background: #e7f7ed;
    color: #00a854;
}

/* ===== MODALES ===== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
    z-index: 999;
    backdrop-filter: blur(4px);
}

.modal.show {
    display: flex;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: #fff;
    padding: 40px;
    border-radius: 16px;
    color: #000;
    max-width: 460px;
    margin: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    border-top: 10px solid var(--color-main);
    animation: slideUp 0.3s ease;
    position: relative;
}

.modal-content h2 {
    text-align: center;
    margin-bottom: 20px;
}

.modal-content .row {
    display: flex;
    gap: 12px;
}

/* ===== CAMPOS EN MODO VISTA ===== */
.modal-content input {
    width: 100%;
    padding: 14px 12px;
    margin-top: 6px;
    border: none;
    border-bottom: 2px solid #eee;
    border-radius: 0;
    background: transparent;
    color: #000;
    box-sizing: border-box;
    pointer-events: none;
}

/* ===== MODO EDICIÓN ===== */
.modal-content.edit-mode input {
    border: 2px solid #ddd;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.95);
    pointer-events: auto;
}

.modal-content.edit-mode input:focus {
    outline: none;
    border-color: var(--color-main);
    background: #fff;
    box-shadow: 0 0 8px rgba(206, 158, 0, 0.3);
}

.modal-content label {
    display: block;
    font-weight: 600;
    margin-top: 16px;
}

/* ===== BOTONES ===== */
.modal-content .buttons {
    display: flex;
    gap: 10px;
    margin-top: 24px;
}
.modal-content .close-button{
    background-color: transparent;
    position: absolute;
    top: 8px;
    right: 8px;
    border: none;
    box-shadow: none;
    animation: none;
}
.modal-content .close-button:hover{
    cursor: pointer;
    animation: none;
}
.modal-content .btn-edit,
.modal-content .btn-save {
    flex: 1;
    padding: 14px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

/* Botón EDITAR */
.modal-content .btn-edit {
    background: linear-gradient(135deg, var(--color-main-light), var(--color-main));
    border: none;
    color: white;
}

.modal-content .btn-edit:hover {
    background: linear-gradient(135deg, var(--color-main), var(--color-main-dark));
    transform: translateY(-2px);
}

/* Botón GUARDAR */
.modal-content .btn-save {
    background: transparent;
    border: 2px solid var(--color-main);
    color: var(--color-main);
}

.modal-content .btn-save:enabled:hover {
    background: var(--color-main);
    color: white;
}
.no-pedidos {
    text-align: center;
    color: var(--color-text-muted);
    font-size: 1.1rem;
    padding: 60px 20px;
    background: var(--color-text-primary);
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .dashboard-header {
        padding: 20px;
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }

    .dashboard-header .right {
        width: 100%;
        justify-content: center;
    }

    .btn-secondary,
    .btn-session {
        width: fit-content;
        text-align: center;
    }

    main {
        padding: 20px;
    }

    .pedido-header {
        flex-direction: column;
        align-items: stretch;
    }

    .estado {
        align-self: flex-start;
    }

    .pedido-meta {
        flex-direction: column;
        gap: 8px;
    }

    .pedidos-container h2 {
        font-size: 1.5rem;
    }

    .pedido-tabla {
        font-size: 0.85rem;
    }
    
    .pedido-tabla thead th {
        padding: 12px 8px;
        font-size: 0.8rem;
    }
    
    .pedido-tabla tbody td {
        padding: 10px 8px;
    }
    
    .pedido-tabla td:first-child,
    .pedido-tabla th:first-child {
        padding-left: 12px;
    }
    
    .pedido-tabla td:last-child,
    .pedido-tabla th:last-child {
        padding-right: 12px;
    }
}

@media (max-width: 600px) {
    .login-container,
    .modal-content {
        padding: 24px;
        margin: 20px;
    }

    .login-container h2 {
        margin: 8px 0;
    }

    .row {
        display: block;
    }

    .dashboard-container .buttons-container {
        flex-direction: column;
        width: 100%;
    }

    .dashboard-container .buttons-container a,
    .dashboard-container button {
        width: 100%;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .dashboard-header .left h1 {
        font-size: 1.4rem;
    }

    .pedido-card {
        padding: 20px;
    }

    .pedido-footer {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }

    .pedido-tabla {
        min-width: 500px;
    }
}