@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700;800&display=swap');

:root {
    --primary: #f97316;
    --primary-dark: #ea580c;
    --primary-light: #fff7ed;
    --secondary: #2563eb;
    --secondary-light: #eff6ff;
    --success: #10b981;
    --danger: #ef4444;
    --bg-body: #f8fafc;
    --bg-light: #f1f5f9;
    --card-bg: #ffffff;
    --text-main: #111827;
    --text-muted: #6b7280;
    --border-color: #e5e7eb;
    --shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --radius: 1.5rem;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.5;
}

/* --- NAVBAR --- */
.topbar {
    background: white;
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 50;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 800;
    font-size: 1.5rem;
    color: var(--primary);
    text-decoration: none;
}

.user-badge {
    background: var(--bg-light);
    padding: 0.4rem 0.8rem;
    border-radius: 99px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #475569;
    margin-right: 0.5rem;
}

/* --- CONTENEDORES --- */
.page-container {
    max-width: 1100px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

/* --- PESTAÑAS (TABS) CON DIVISOR --- */
.tabs-container {
    padding: 6px !important;
    margin-bottom: 2rem;
    background: white;
}

.tabs-flex {
    display: flex;
    background: var(--bg-light);
    padding: 4px;
    border-radius: 14px;
    gap: 0; 
}

.tab-link {
    flex: 1;
    text-align: center;
    padding: 10px;
    border-radius: 10px;
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    position: relative;
}

/* Divisor visual entre pestañas */
.tab-link:first-child::after {
    content: "";
    position: absolute;
    right: 0;
    top: 25%;
    height: 50%;
    width: 1.5px;
    background-color: #cbd5e1;
}

/* Ocultar divisor cuando la pestaña está activa */
.tab-link.active::after {
    display: none;
}

.tab-link.active {
    background: white;
    color: var(--text-main);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

/* --- BIENVENIDA --- */
.welcome-card {
    padding: 3rem 2rem !important;
    text-align: center;
    border: 1px solid var(--border-color);
    margin-bottom: 2rem;
}

.welcome-card h2 {
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 1rem;
}

.welcome-card p {
    font-size: 1.1rem;
    margin-bottom: 2rem;
    color: var(--text-muted);
}

/* --- BOTONES --- */

/* Botón Crear mi pedido (Corregido Hover) */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: var(--primary);
    color: white !important;
    padding: 0.8rem 1.8rem;
    border-radius: 12px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.2);
    border: 2px solid var(--primary);
}

.btn-primary:hover {
    background-color: white;
    color: var(--primary) !important; /* Letras naranja en hover */
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(249, 115, 22, 0.1);
}

.btn-logout {
    color: var(--danger);
    font-weight: 600;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: background 0.2s;
}

.btn-logout:hover {
    background: #fef2f2;
}

/* Botón Enviar Pedido (Full Width) */
.btn-primary-full {
    width: 100%;
    background: var(--primary);
    color: white;
    padding: 16px;
    border: none;
    border-radius: 16px;
    font-weight: 800;
    font-size: 1.1rem;
    cursor: pointer;
    margin-top: 10px;
    transition: background 0.2s, transform 0.2s;
}

.btn-primary-full:hover {
    background: var(--primary-dark);
    transform: scale(1.01);
}

/* --- FORMULARIO --- */
.label-bold {
    display: block;
    font-weight: 700;
    color: #334155;
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.input-modern {
    width: 100%;
    padding: 14px;
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    outline: none;
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.input-modern:focus {
    border-color: var(--primary);
}

/* --- GRID TIENDA --- */
.store-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: start;
}

@media (max-width: 800px) {
    .store-grid { grid-template-columns: 1fr; }
}

/* --- ESTADOS (BADGES) --- */
.badge {
    padding: 0.35rem 0.8rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.badge-warning { background: #fef3c7; color: #92400e; }
.badge-info { background: #dbeafe; color: #1e40af; }
.badge-success { background: #dcfce7; color: #166534; }
.badge-danger { background: #fee2e2; color: #991b1b; }

/* MEJORAS PARA LAS TARJETAS DE PEDIDOS ACTIVOS */
.order-card {
    padding: 1.5rem !important;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.order-card h4 {
    font-size: 1.2rem;
    font-weight: 800;
    margin: 0.5rem 0;
}

/* El área de detalles del pedido (lo que pidió el cliente) */
.order-details-box {
    background: var(--bg-light);
    padding: 1rem;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-main);
    border: 1px solid var(--border-color);
}

/* Ajuste de los formularios de acción en las tarjetas */
.order-actions-new {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.action-row {
    display: flex;
    gap: 0.5rem;
    width: 100%;
}

.input-group-price {
    flex: 1;
    display: flex;
    align-items: center;
    background: #fff;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    padding-left: 0.75rem;
}

.input-group-price input {
    border: none;
    padding: 0.75rem;
    width: 100%;
    font-weight: 700;
    outline: none;
}

/* Botones más grandes y fáciles de presionar */
.btn-action-primary {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    font-weight: 800;
    cursor: pointer;
    flex: 2;
}

.btn-action-danger {
    background: #fee2e2;
    color: var(--danger);
    border: none;
    padding: 0.75rem;
    border-radius: 10px;
    width: 45px;
    font-weight: 800;
    cursor: pointer;
}

.btn-action-success {
    width: 100%;
    background: var(--success);
    color: white;
    border: none;
    padding: 1rem;
    border-radius: 12px;
    font-weight: 800;
    font-size: 1rem;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

/* AMAZON STYLE ORDER BOARD */
.order-container-amazon {
    border: 1px solid #ddd;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    overflow: hidden;
    background: white;
}

.order-header-amazon {
    background-color: #f6f6f6;
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid #ddd;
    font-size: 0.85rem;
    color: #565959;
}

.order-body-amazon {
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.order-info-main h4 {
    color: #c45500; /* Naranja Amazon */
    margin: 0 0 5px 0;
}

.btn-amazon-primary {
    background: #FFD814;
    border: 1px solid #FCD200;
    border-radius: 8px;
    padding: 8px 20px;
    font-weight: 600;
    box-shadow: 0 2px 5px rgba(213,217,217,.5);
    cursor: pointer;
}

.btn-amazon-primary:hover { background: #F7CA00; }


/* AMAZON DESIGN SYSTEM */
.amazon-order-box {
    border: 1px solid #D5D9D9;
    border-radius: 8px;
    margin-bottom: 20px;
    background: white;
    font-family: 'Arial', sans-serif;
}

.amazon-order-header {
    background-color: #F0F2F2;
    padding: 14px 20px;
    border-bottom: 1px solid #D5D9D9;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 15px;
    border-radius: 8px 8px 0 0;
}

.header-col { display: flex; flex-direction: column; }
.header-label { font-size: 11px; color: #565959; font-weight: 400; }
.header-value { font-size: 13px; color: #565959; font-weight: 400; }
.customer-link { color: #007185; cursor: pointer; }

.amazon-order-body {
    padding: 20px;
    display: flex;
    justify-content: space-between;
    gap: 20px;
}

.amazon-status-text { font-size: 18px; font-weight: 700; color: #0F1111; }
.amazon-details-text { margin-top: 10px; color: #0F1111; font-size: 14px; line-height: 1.4; }

/* BOTONES ESTILO AMAZON */
.btn-amazon-primary {
    background: #FFD814;
    border: 1px solid #FCD200;
    border-radius: 8px;
    padding: 8px 15px;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(213,217,217,.5);
}

.btn-amazon-secondary {
    background: #FFF;
    border: 1px solid #D5D9D9;
    border-radius: 8px;
    padding: 8px 12px;
    cursor: pointer;
}

.btn-amazon-success {
    background: #22c55e;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 12px;
    font-weight: 700;
    width: 100%;
    cursor: pointer;
}

.amazon-price-input {
    display: flex;
    align-items: center;
    border: 1px solid #D5D9D9;
    border-radius: 8px;
    padding: 4px 8px;
    background: white;
}

.amazon-price-input input { border: none; outline: none; width: 60px; font-weight: 700; padding: 5px; }


/* AMAZON STYLE ORDER BOARD */
.amazon-order-container {
    background: #fff;
    border: 1px solid #D5D9D9;
    border-radius: 8px;
    margin-bottom: 20px;
    overflow: hidden;
}

.amazon-order-header {
    background: #F0F2F2;
    padding: 12px 20px;
    border-bottom: 1px solid #D5D9D9;
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: #565959;
}

.amazon-order-body {
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.amazon-btn-atender {
    background: #FFD814;
    border: 1px solid #FCD200;
    border-radius: 8px;
    padding: 8px 20px;
    font-weight: 600;
    cursor: pointer;
}

.amazon-btn-atender:hover { background: #F7CA00; }

.amazon-btn-declinar {
    background: transparent;
    color: #007185;
    border: none;
    text-decoration: underline;
    cursor: pointer;
    font-size: 0.85rem;
}

/* =========================================
   ESTILOS DE LA PANTALLA DE LOGIN
   ========================================= */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background-color: var(--bg-light);
    margin: 0;
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 1rem;
}

.login-card {
    background: white;
    padding: 2.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    text-align: center;
}

.login-card .brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-bottom: 2rem;
}

.login-card .brand-icon {
    font-size: 3.5rem;
    margin-bottom: 0.5rem;
}

.login-card h1 {
    margin: 0;
    color: var(--primary);
    font-weight: 800;
    font-size: 1.8rem;
}

.login-card p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.form-group {
    text-align: left;
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.form-group input {
    width: 100%;
    padding: 0.9rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.2s ease;
    font-family: inherit;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}