/* ═══════════════════════════════════════════════════
   LA VASQUITA — TEMA BOUTIQUE CÁLIDO (Opción C)
   Inspiración: café gourmet / pastelería parisina
   ═══════════════════════════════════════════════════ */

/* ───────────────────────────────────────────────────
   GLOBAL — sin subrayado en ningún enlace, sin outline al click
   Reglas con máxima especificidad. NO TOCAR.
   ─────────────────────────────────────────────────── */
html a,
html a:link,
html a:visited,
html a:hover,
html a:active,
html a:focus,
html a:focus-visible,
html button,
html button:hover,
html button:focus,
html *[onclick]:hover {
    text-decoration: none !important;
    text-decoration-line: none !important;
    text-decoration-color: transparent !important;
}

button:focus,
button:active,
input:focus,
select:focus,
textarea:focus {
    outline: none;
}

/* Foco accesible solo con teclado (Tab), no con click */
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible {
    outline: 2px solid #886644;
    outline-offset: 2px;
}

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500&family=Raleway:wght@300;400;500;600;700&display=swap');

:root {
    /* Paleta cálida boutique */
    --bq-bg:              #F5EFE7;  /* fondo crema oscura */
    --bq-bg-soft:         #FAF6F1;
    --bq-card:            #FFFFFF;
    --bq-card-warm:       #FFFCF7;
    --bq-cream:           #EBDAC6;
    --bq-cream-light:     #F5EFE7;
    --bq-brown-deep:      #292017;  /* marrón muy oscuro */
    --bq-brown:           #886644;  /* marrón principal */
    --bq-brown-mid:       #A99886;
    --bq-brown-soft:      #6B5340;
    --bq-tan:             #C9B89E;
    --bq-text:            #292017;
    --bq-text-muted:      #886644;
    --bq-text-light:      #A99886;
    --bq-border:          #EBDAC6;
    --bq-border-strong:   #C9B89E;
    
    /* Estados */
    --bq-success:         #5A7A3F;
    --bq-success-bg:      #ECF4DF;
    --bq-warning:         #C7811A;
    --bq-warning-bg:      #FFF8EA;
    --bq-danger:          #C7212C;
    --bq-danger-bg:       #FEE2E2;
    
    /* Tipografías */
    --bq-serif:           'Playfair Display', 'Times New Roman', serif;
    --bq-sans:            'Raleway', -apple-system, sans-serif;
    
    /* Radios generosos */
    --bq-r-sm:            10px;
    --bq-r-md:            14px;
    --bq-r-lg:            18px;
    --bq-r-pill:          999px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bq-bg);
    color: var(--bq-text);
    font-family: var(--bq-sans);
    font-size: 15px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--bq-brown); text-decoration: none; }
a:hover { text-decoration: none; }

/* ═══════════════════════════════════════════════════
   TOPBAR (cabecera oscura redondeada)
   ═══════════════════════════════════════════════════ */
.topbar {
    background: var(--bq-brown-deep);
    color: white;
    padding: 18px 0;
    margin-bottom: 22px;
}
.topbar-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}
.topbar h1 {
    font-family: var(--bq-serif);
    font-size: 22px;
    font-weight: 500;
    margin: 0;
    color: white;
    letter-spacing: 0.02em;
}
.topbar-subtitle {
    font-size: 12px;
    color: var(--bq-tan);
    font-style: italic;
    margin: 2px 0 0;
    letter-spacing: 0.05em;
}
.topbar-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}
.btn-link {
    color: white;
    text-decoration: none;
    padding: 8px 16px;
    background: rgba(255,255,255,0.08);
    border-radius: var(--bq-r-pill);
    font-size: 13px;
    font-weight: 500;
    transition: 0.15s;
}
.btn-link:hover {
    background: rgba(255,255,255,0.18);
    text-decoration: none;
}
.role-badge {
    background: var(--bq-brown);
    color: white;
    padding: 4px 14px;
    border-radius: var(--bq-r-pill);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

/* ═══════════════════════════════════════════════════
   CONTENIDO
   ═══════════════════════════════════════════════════ */
.contenido {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 28px 60px;
}

/* ═══════════════════════════════════════════════════
   CARDS (tarjetas blancas elegantes)
   ═══════════════════════════════════════════════════ */
.card, .seccion, .resumen-card, .pedido-card, .dia-card, .stat-card,
.suc-card, .persona-card {
    background: var(--bq-card);
    border-radius: var(--bq-r-md);
    border: none;
    box-shadow: 0 2px 8px rgba(41, 32, 23, 0.04);
    transition: 0.2s;
}
.card:hover, .seccion:hover {
    box-shadow: 0 4px 16px rgba(41, 32, 23, 0.07);
}

/* ═══════════════════════════════════════════════════
   STATS / NÚMEROS GRANDES
   ═══════════════════════════════════════════════════ */
.stats-grid, .stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}
.stat-card {
    text-align: center;
    padding: 22px 16px;
}
.stat-card .num {
    font-family: var(--bq-serif);
    font-size: 32px;
    font-weight: 500;
    color: var(--bq-brown);
    line-height: 1;
    margin-bottom: 6px;
}
.stat-card .label, .stat-card .lbl {
    font-size: 12px;
    color: var(--bq-brown-soft);
    letter-spacing: 0.04em;
    text-transform: none;
    font-weight: 500;
}
.stat-card.urgente { background: var(--bq-warning-bg); }
.stat-card.urgente .num { color: var(--bq-warning); }
.stat-card.alerta .num { color: var(--bq-warning); }
.stat-card.success .num { color: var(--bq-success); }

/* ═══════════════════════════════════════════════════
   BOTONES Y ACCIONES
   ═══════════════════════════════════════════════════ */
.btn-primary, .btn-guardar, .btn-procesar, .btn-confirmar, .btn-enviar,
.btn-importar {
    background: var(--bq-brown);
    color: white !important;
    border: none;
    padding: 12px 28px;
    border-radius: var(--bq-r-pill);
    font-weight: 500;
    cursor: pointer;
    font-family: var(--bq-sans);
    font-size: 14px;
    letter-spacing: 0.02em;
    text-decoration: none;
    display: inline-block;
    transition: 0.15s;
}
.btn-primary:hover, .btn-guardar:hover, .btn-procesar:hover,
.btn-confirmar:hover, .btn-enviar:hover, .btn-importar:hover {
    background: var(--bq-brown-deep);
    text-decoration: none;
}
.btn-confirmar:disabled, .btn-enviar:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}
.btn-cancelar, .btn-cerrar, .modal-cerrar, .btn-cerrar-cal {
    background: white;
    color: var(--bq-brown-soft);
    border: 1px solid var(--bq-border);
    padding: 10px 22px;
    border-radius: var(--bq-r-pill);
    font-family: var(--bq-sans);
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    font-size: 14px;
}
.btn-cancelar:hover, .btn-cerrar:hover, .modal-cerrar:hover {
    background: var(--bq-cream-light);
    text-decoration: none;
}
.btn-eliminar-todo {
    background: var(--bq-danger);
    color: white;
    border: none;
    padding: 12px 22px;
    border-radius: var(--bq-r-pill);
    font-weight: 500;
    cursor: pointer;
    font-family: var(--bq-sans);
    font-size: 14px;
}

/* Botones de acción tipo grid (panel) */
.accion-btn, .accion-tartas {
    background: white;
    color: var(--bq-text) !important;
    border: none;
    padding: 22px 18px;
    border-radius: var(--bq-r-md);
    font-weight: 500;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    transition: 0.15s;
    box-shadow: 0 2px 8px rgba(41, 32, 23, 0.04);
    font-family: var(--bq-sans);
}
.accion-btn:hover, .accion-tartas:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(41, 32, 23, 0.1);
    text-decoration: none;
}
.accion-btn .icon, .accion-tartas .icon {
    font-size: 26px;
}
.accion-btn .titulo, .accion-tartas .titulo {
    font-family: var(--bq-serif);
    font-size: 16px;
    font-weight: 500;
    color: var(--bq-text);
}
.accion-btn .sub, .accion-tartas .sub {
    font-size: 12px;
    color: var(--bq-brown-soft);
    font-weight: 400;
    font-style: italic;
}
.accion-btn.principal, .accion-tartas.principal {
    background: var(--bq-brown-deep);
    color: white !important;
}
.accion-btn.principal .titulo, .accion-tartas.principal .titulo {
    color: white;
}
.accion-btn.principal .sub, .accion-tartas.principal .sub {
    color: var(--bq-tan);
}
.acciones-grid, .acciones-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

/* ═══════════════════════════════════════════════════
   TIPOGRAFÍA SECCIONES
   ═══════════════════════════════════════════════════ */
.seccion-header, .card-header, .resumen-header {
    padding: 16px 22px;
    background: linear-gradient(to right, var(--bq-cream-light), white);
    border-bottom: 1px solid var(--bq-border);
    border-radius: var(--bq-r-md) var(--bq-r-md) 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.seccion-header h2, .seccion-header h3, .card-header,
.resumen-titulo h3 {
    font-family: var(--bq-serif);
    font-size: 16px;
    font-weight: 500;
    margin: 0;
    color: var(--bq-text);
    letter-spacing: 0.01em;
}
.section-title {
    font-family: var(--bq-serif);
    font-size: 18px;
    font-weight: 500;
    color: var(--bq-text);
    margin: 24px 0 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--bq-border);
    letter-spacing: 0.02em;
}

/* ═══════════════════════════════════════════════════
   BADGES (píldoras)
   ═══════════════════════════════════════════════════ */
.suc-badge, .badge-stats, .estado-badge, .total-tartas-pill,
.cnt, .badge-count {
    background: var(--bq-cream);
    color: var(--bq-brown-soft);
    padding: 5px 14px;
    border-radius: var(--bq-r-pill);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.02em;
    text-transform: none;
}
.estado-badge {
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.06em;
}
.estado-pendiente { background: #FFF8EA; color: #C7811A; }
.estado-enviado { background: var(--bq-success-bg); color: var(--bq-success); }
.estado-procesando { background: #DBEAFE; color: #1E40AF; }
.estado-recibido { background: var(--bq-cream); color: var(--bq-brown-soft); }

.codigo, .codigo-mini {
    font-family: 'Courier New', monospace;
    font-size: 12px;
    background: var(--bq-cream-light);
    padding: 3px 10px;
    border-radius: var(--bq-r-sm);
    color: var(--bq-brown-soft);
    font-weight: 500;
}

/* ═══════════════════════════════════════════════════
   FORMULARIOS
   ═══════════════════════════════════════════════════ */
input[type="text"], input[type="number"], input[type="date"],
input[type="time"], input[type="email"], input[type="password"],
select, textarea {
    padding: 11px 16px;
    border: 1px solid var(--bq-border);
    border-radius: var(--bq-r-sm);
    font-family: var(--bq-sans);
    font-size: 14px;
    background: white;
    color: var(--bq-text);
    transition: 0.15s;
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--bq-brown);
    box-shadow: 0 0 0 3px rgba(136, 102, 68, 0.08);
}
.form-group {
    margin-bottom: 14px;
}
.form-group label {
    display: block;
    font-size: 12px;
    color: var(--bq-brown-soft);
    margin-bottom: 6px;
    font-weight: 500;
    letter-spacing: 0.02em;
}

/* ═══════════════════════════════════════════════════
   ALERTAS
   ═══════════════════════════════════════════════════ */
.alert {
    padding: 14px 20px;
    border-radius: var(--bq-r-md);
    margin-bottom: 16px;
    font-size: 14px;
    font-weight: 500;
}
.alert-ok, .alert-success { background: var(--bq-success-bg); color: var(--bq-success); }
.alert-err, .alert-error { background: var(--bq-danger-bg); color: var(--bq-danger); }
.alert-warn, .alert-warning { background: var(--bq-warning-bg); color: var(--bq-warning); }
.info-banner {
    background: var(--bq-warning-bg);
    border-left: 3px solid var(--bq-warning);
    padding: 14px 18px;
    border-radius: var(--bq-r-sm);
    color: var(--bq-warning);
    font-size: 13px;
    margin-bottom: 16px;
    line-height: 1.5;
}

/* ═══════════════════════════════════════════════════
   TABLAS
   ═══════════════════════════════════════════════════ */
.tabla, .items-tabla, .tabla-tartas {
    width: 100%;
    border-collapse: collapse;
}
.tabla thead th, .items-tabla thead th, .tabla-tartas thead th {
    background: var(--bq-cream-light);
    padding: 12px 16px;
    text-align: left;
    font-family: var(--bq-serif);
    font-weight: 500;
    color: var(--bq-text);
    font-size: 13px;
    letter-spacing: 0.02em;
    border-bottom: 1px solid var(--bq-border);
}
.tabla td, .items-tabla td, .tabla-tartas td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--bq-cream-light);
    font-size: 14px;
}
.tabla tr:last-child td { border-bottom: none; }
.tabla tr.clickable { cursor: pointer; transition: 0.1s; }
.tabla tr.clickable:hover { background: var(--bq-cream-light); }

/* ═══════════════════════════════════════════════════
   LOGO
   ═══════════════════════════════════════════════════ */
.brand-logo {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    line-height: 1;
}
.brand-logo .brand-name {
    font-family: var(--bq-serif);
    font-size: 24px;
    font-weight: 500;
    letter-spacing: 0.15em;
}
.brand-logo .brand-tagline {
    font-size: 10px;
    letter-spacing: 0.25em;
    opacity: 0.85;
    margin-top: 4px;
}
.brand-logo.small .brand-name { font-size: 16px; }
.brand-logo.small .brand-tagline { font-size: 8px; }
.brand-logo.large .brand-name { font-size: 32px; }
.brand-logo.large .brand-tagline { font-size: 12px; margin-top: 5px; }
.brand-logo .brand-stripes {
    display: flex;
    flex-direction: column;
    margin-top: 4px;
    gap: 0;
    width: 68px;
}
.brand-logo.small .brand-stripes { width: 50px; }
.brand-logo.large .brand-stripes { width: 90px; margin-top: 5px; }
.brand-logo .brand-stripes .red { background: #C7212C; height: 3px; }
.brand-logo .brand-stripes .yellow { background: #FFBF2F; height: 5px; }
.brand-logo.small .brand-stripes .red { height: 2px; }
.brand-logo.small .brand-stripes .yellow { height: 3px; }

/* ═══════════════════════════════════════════════════
   ÍTEMS DE LISTA
   ═══════════════════════════════════════════════════ */
.pedido-item, .desglose-item, .tarta-row, .item-row, .ing-item,
.suc-row, .stock-item, .tarta-row {
    transition: 0.1s;
}
.pedido-item, .item-row {
    padding: 16px 22px;
    border-bottom: 1px solid var(--bq-cream-light);
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}
.pedido-item:last-child, .item-row:last-child { border-bottom: none; }

/* ═══════════════════════════════════════════════════
   FILTROS / TABS
   ═══════════════════════════════════════════════════ */
.filtros, .tabs-pedido {
    background: white;
    border-radius: var(--bq-r-md);
    padding: 12px;
    margin-bottom: 18px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
    box-shadow: 0 2px 8px rgba(41, 32, 23, 0.04);
}
.filtros a, .tabs-pedido a {
    padding: 9px 18px;
    border-radius: var(--bq-r-pill);
    text-decoration: none;
    color: var(--bq-brown-soft);
    font-weight: 500;
    font-size: 13px;
    background: transparent;
    transition: 0.15s;
}
.filtros a:hover, .tabs-pedido a:hover { background: var(--bq-cream-light); }
.filtros a.activo, .filtros a.activa, .tabs-pedido a.activa {
    background: var(--bq-brown);
    color: white;
}

/* ═══════════════════════════════════════════════════
   EMPTY STATE
   ═══════════════════════════════════════════════════ */
.empty, .empty-mini, .empty-hero, .empty-ing {
    padding: 50px 30px;
    text-align: center;
    color: var(--bq-text-light);
    font-style: italic;
    font-size: 14px;
}

/* ═══════════════════════════════════════════════════
   TOAST
   ═══════════════════════════════════════════════════ */
#toast, .toast {
    position: fixed;
    bottom: 28px;
    right: 28px;
    padding: 14px 22px;
    border-radius: var(--bq-r-md);
    font-weight: 500;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s;
    z-index: 1000;
    box-shadow: 0 10px 30px rgba(41, 32, 23, 0.2);
    max-width: 360px;
    background: var(--bq-card);
    color: var(--bq-text);
}

/* ═══════════════════════════════════════════════════
   TOOLBAR
   ═══════════════════════════════════════════════════ */
.toolbar {
    background: white;
    padding: 14px 22px;
    border-radius: var(--bq-r-md);
    margin: 0 0 16px;
    box-shadow: 0 2px 8px rgba(41, 32, 23, 0.04);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

/* ═══════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════ */
@media (max-width: 700px) {
    .contenido { padding: 0 16px 40px; }
    .topbar-content { padding: 0 16px; }
    .topbar h1 { font-size: 18px; }
    .stat-card .num { font-size: 26px; }
    .acciones-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
}

/* Print */
@media print {
    .topbar, .topbar-actions, .filtros, .tabs-pedido,
    .barra-confirmar, .acciones-pedido, .nav-fechas, .nav-semana {
        display: none !important;
    }
    body { background: white; }
}

/* ═══════════════════════════════════════════════════════════
 * OVERRIDE FINAL — sin subrayado en ningún sitio (v16)
 * Estas reglas van AL FINAL del archivo para ganar especificidad
 * ═══════════════════════════════════════════════════════════ */
html body a,
html body a:link,
html body a:visited,
html body a:hover,
html body a:active,
html body a:focus,
html body a:focus-visible,
html body a *,
html body a:hover *,
html body button:hover {
    text-decoration: none !important;
    text-decoration-line: none !important;
    border-bottom: 0 !important;
}

html body .topbar a,
html body .topbar a:hover,
html body .topbar-actions a,
html body .topbar-actions a:hover,
html body .topbar-actions a > * {
    text-decoration: none !important;
    border-bottom: 0 !important;
    box-shadow: none !important;
}

html body button:focus:not(:focus-visible),
html body a:focus:not(:focus-visible) {
    outline: none !important;
}
