/* ─── Vendora Pan · Sistema de diseño ─────────────────────────────────────
   Tema panadería: cálido (ámbar/pan), con acentos semánticos del POS. */

:root {
    /* Marca */
    --primary:        #E08A1E;   /* ámbar pan */
    --primary-dark:   #B96C0C;
    --primary-light:  #F6B84D;
    --primary-soft:   #FDF3E3;

    /* Semánticos POS (según mockup) */
    --qty:            #2E9E4F;   /* verde: cantidad */
    --qty-dark:       #1E7D3B;
    --price:          #2472C8;   /* azul: precios */
    --price-dark:     #1A559B;
    --cat:            #E67E22;   /* naranja: categorías */
    --success:        #2ECC71;
    --danger:         #E4483C;
    --danger-dark:    #C0392B;
    --warning:        #F39C12;

    /* Superficies */
    --bg:             #FBF6EE;
    --surface:        #FFFFFF;
    --surface-2:      #F6EFE3;
    --border:         #E8DECB;
    --text:           #2A2016;
    --text-muted:     #8A7B66;

    /* Formas */
    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 22px;
    --shadow-xs: 0 1px 2px rgba(120,80,20,.05), 0 1px 3px rgba(120,80,20,.04);
    --shadow-sm: 0 2px 6px rgba(120,80,20,.06), 0 4px 12px rgba(120,80,20,.05);
    --shadow-md: 0 8px 24px rgba(120,80,20,.10);
    --shadow-lg: 0 22px 55px rgba(120,80,20,.18);

    --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

* , *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    line-height: 1.5;
}

a { color: var(--primary-dark); text-decoration: none; }

button, input, select, textarea { font-family: inherit; font-size: 1rem; }

/* ── Botones ─────────────────────────────────────────────────────────────── */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
    padding: .7rem 1.2rem; border: none; border-radius: 12px;
    font-weight: 700; cursor: pointer; color: var(--text);
    background: #fff;
    box-shadow: inset 0 0 0 1px var(--border), 0 1px 2px rgba(120,80,20,.05);
    transition: transform .12s ease, box-shadow .16s ease, background .15s; min-height: 46px;
}
.btn:hover { transform: translateY(-1px); background: #fffdf9; box-shadow: inset 0 0 0 1px rgba(216,140,32,.35), 0 4px 12px rgba(120,80,20,.08); }
.btn:active { transform: translateY(0); }
/* Botones sólidos, planos y modernos (sin brillo/glossy) */
.btn-primary { color: #fff; background: var(--primary);
    box-shadow: 0 1px 2px rgba(185,108,12,.25), 0 6px 16px rgba(216,140,32,.20); }
.btn-primary:hover { background: var(--primary-dark); box-shadow: 0 2px 4px rgba(185,108,12,.28), 0 10px 22px rgba(216,140,32,.26); }
.btn-success { color: #fff; background: var(--qty);
    box-shadow: 0 1px 2px rgba(30,125,59,.25), 0 6px 16px rgba(46,158,79,.20); }
.btn-success:hover { background: var(--qty-dark); box-shadow: 0 2px 4px rgba(30,125,59,.28), 0 10px 22px rgba(46,158,79,.26); }
.btn-danger  { color: #fff; background: var(--danger);
    box-shadow: 0 1px 2px rgba(192,57,43,.25), 0 6px 16px rgba(228,72,60,.20); }
.btn-danger:hover { background: var(--danger-dark); box-shadow: 0 2px 4px rgba(192,57,43,.28), 0 10px 22px rgba(228,72,60,.26); }
.btn-ghost   { background: #fff; box-shadow: inset 0 0 0 1.5px var(--border); }
.btn-ghost:hover { background: #fffdf9; box-shadow: inset 0 0 0 1.5px var(--primary-light), 0 3px 10px rgba(120,80,20,.07); }

/* Chips de rango rápido (Hoy / Semana / Mes) */
.chip-row { display: inline-flex; gap: .4rem; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: .35rem; padding: .5rem .9rem; border: none; cursor: pointer;
    border-radius: 999px; font-weight: 700; font-size: .82rem; color: var(--text-muted);
    background: #fff; box-shadow: inset 0 0 0 1.5px var(--border); transition: color .14s, box-shadow .14s, background .14s; }
.chip:hover { color: var(--primary-dark); box-shadow: inset 0 0 0 1.5px var(--primary-light); }
.chip.active { color: #fff; background: var(--primary); box-shadow: 0 3px 10px rgba(216,140,32,.22); }
.btn-block   { width: 100%; }
.btn-lg      { padding: 1rem 1.5rem; font-size: 1.1rem; min-height: 56px; border-radius: 14px; }

/* ── Cards ───────────────────────────────────────────────────────────────── */
.card {
    background: var(--surface); border: 1px solid rgba(232,222,203,.6);
    border-radius: var(--radius-md); box-shadow: var(--shadow-sm);
}

/* ── Inputs ──────────────────────────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: .4rem; margin-bottom: 1rem; }
.field label { font-size: .82rem; font-weight: 700; color: var(--text-muted); }
.input, select.input, textarea.input {
    width: 100%; padding: .72rem .95rem; border: none; color: var(--text);
    border-radius: 11px; background: #fffdf9;
    box-shadow: inset 0 0 0 1.5px var(--border), var(--shadow-xs);
    transition: box-shadow .15s ease;
}
.input:focus { outline: none; box-shadow: inset 0 0 0 2px var(--primary), 0 0 0 4px var(--primary-soft); }

/* ── Dropzone (subida de archivos moderna) ───────────────────────────────── */
.dropzone { position: relative; border-radius: 14px; background: #fffdf9; cursor: pointer; overflow: hidden;
    box-shadow: inset 0 0 0 2px var(--border); transition: box-shadow .15s ease, background .15s ease; min-height: 128px; }
.dropzone:hover { box-shadow: inset 0 0 0 2px var(--primary-light); background: var(--primary-soft); }
.dropzone.dz-over { box-shadow: inset 0 0 0 2.5px var(--primary), 0 0 0 4px var(--primary-soft); background: var(--primary-soft); }
.dropzone .dz-input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.dz-body { min-height: 128px; }
.dz-prompt { min-height: 128px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .45rem; padding: 1.2rem; text-align: center; }
.dz-prompt .dz-ic { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; color: var(--primary-dark);
    background: linear-gradient(150deg, #fff, var(--primary-soft)); box-shadow: 0 4px 12px rgba(216,140,32,.18), inset 0 0 0 1px rgba(216,140,32,.15); }
.dz-prompt .dz-text { font-size: .9rem; color: var(--text-muted); } .dz-prompt .dz-text strong { color: var(--primary-dark); }
.dz-prompt small { color: var(--text-muted); font-size: .74rem; letter-spacing: .02em; }
.dz-thumb { position: relative; min-height: 128px; background-size: cover; background-position: center; }
.dz-thumb::after { content: ''; position: absolute; inset: 0; background: linear-gradient(transparent 55%, rgba(0,0,0,.28)); }
.dz-remove { position: absolute; top: .5rem; right: .5rem; z-index: 2; width: 30px; height: 30px; border: none; border-radius: 9px;
    background: rgba(255,255,255,.92); color: var(--danger); display: grid; place-items: center; cursor: pointer; box-shadow: 0 2px 6px rgba(0,0,0,.2); }
.dz-remove:hover { background: #fff; }
.dz-change { position: absolute; left: .6rem; bottom: .5rem; z-index: 2; display: inline-flex; align-items: center; gap: .3rem;
    color: #fff; font-size: .8rem; font-weight: 700; text-shadow: 0 1px 3px rgba(0,0,0,.4); }

/* ── Tablas ──────────────────────────────────────────────────────────────── */
.table { width: 100%; border-collapse: collapse; background: var(--surface); }
.table th, .table td { padding: .8rem .9rem; text-align: left; border-bottom: 1px solid var(--border); }
.table th { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; font-weight: 800; color: var(--text-muted);
    background: linear-gradient(180deg, var(--surface-2), #f1e7d6); }
.table tbody tr { transition: background .12s ease; }
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: var(--primary-soft); }

/* ── Utilidades ──────────────────────────────────────────────────────────── */
.badge { display: inline-flex; align-items: center; gap: .3em; padding: .28em .7em; border-radius: 999px; font-size: .72rem; font-weight: 800; letter-spacing: .01em; }
.badge-success { background: #dff5e6; color: #1E7D3B; box-shadow: inset 0 0 0 1px rgba(46,158,79,.18); }
.badge-muted   { background: var(--surface-2); color: var(--text-muted); box-shadow: inset 0 0 0 1px rgba(138,123,102,.15); }
.text-muted { color: var(--text-muted); }
.text-right { text-align: right; }
.flex { display: flex; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-1 { gap: .5rem; } .gap-2 { gap: 1rem; }

/* ── Toast ───────────────────────────────────────────────────────────────── */
#toast-wrap { position: fixed; top: 1rem; right: 1rem; z-index: 9999; display: flex; flex-direction: column; gap: .5rem; }
.toast { background: var(--text); color: #fff; padding: .8rem 1.2rem; border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md); font-weight: 600; animation: toastIn .25s ease; max-width: 320px; }
.toast.success { background: var(--success); } .toast.error { background: var(--danger); }
@keyframes toastIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } }

/* ── Modal ───────────────────────────────────────────────────────────────── */
.modal-backdrop { position: fixed; inset: 0; background: rgba(40,30,15,.45); backdrop-filter: blur(3px);
    display: flex; align-items: center; justify-content: center; z-index: 1000; padding: 1rem; animation: fadeIn .15s ease; }
.modal { background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
    width: 100%; max-width: 460px; max-height: 92vh; overflow-y: auto; animation: modalIn .22s cubic-bezier(.2,.9,.3,1.2); }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalIn { from { opacity: 0; transform: translateY(14px) scale(.97); } to { opacity: 1; transform: none; } }
.modal-head { padding: 1.2rem 1.5rem; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.modal-head h3 { font-size: 1.15rem; display: flex; align-items: center; gap: .5rem; }
.modal-body { padding: 1.5rem; }
.modal-foot { padding: 1rem 1.5rem; border-top: 1px solid var(--border); display: flex; gap: .7rem; justify-content: flex-end; }

/* ── Scrollbars sutiles ──────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(180,150,100,.28); border-radius: 99px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: rgba(180,150,100,.45); background-clip: padding-box; }
[hidden] { display: none !important; }
