/* ==========================================================================
   Panel EMYDA
   ========================================================================== */

:root {
    --bg: #f3f5f9;
    --surface: #ffffff;
    --ink: #111827;
    --ink-2: #374151;
    --muted: #6b7280;
    --line: #e5e7eb;
    --line-2: #f0f2f5;
    --side: #0b1020;
    --side-ink: #c7cede;
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-soft: #eff4ff;
    --ok: #15803d;
    --ok-soft: #e8f6ed;
    --warn: #b45309;
    --warn-soft: #fff6e5;
    --danger: #dc2626;
    --danger-soft: #fdecec;
    --radius: 12px;
    --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .06);
    --side-w: 248px;
    --top-h: 60px;
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
body {
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 14px; line-height: 1.5;
    color: var(--ink); background: var(--bg);
}
body.no-scroll { overflow: hidden; }
img { display: block; max-width: 100%; }
a { color: var(--primary); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
table { border-collapse: collapse; width: 100%; }
.is-hidden { display: none !important; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.right { text-align: right; }

/* --- Layout ---------------------------------------------------------------- */

.sidebar {
    position: fixed; inset: 0 auto 0 0; z-index: 40;
    width: var(--side-w);
    display: flex; flex-direction: column;
    background: var(--side); color: var(--side-ink);
}
.sidebar-brand {
    display: flex; align-items: center; gap: 10px;
    height: var(--top-h); padding: 0 20px;
    border-bottom: 1px solid rgba(255, 255, 255, .07);
}
.sidebar-brand img { width: 130px; height: auto; }
.sidebar-brand span {
    font-size: .7rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
    color: #7dd3fc; border: 1px solid rgba(125, 211, 252, .4); border-radius: 4px; padding: 1px 6px;
}
.nav { flex: 1; overflow-y: auto; padding: 12px; }
.nav-section {
    margin: 16px 10px 6px; font-size: .7rem; font-weight: 700;
    letter-spacing: .08em; text-transform: uppercase; color: #6b7590;
}
.nav-section:first-child { margin-top: 4px; }
.nav-link {
    display: flex; align-items: center; gap: 12px;
    padding: 9px 12px; border-radius: 8px;
    color: var(--side-ink); font-weight: 500;
}
.nav-link i { width: 18px; text-align: center; opacity: .8; }
.nav-link:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav-link.is-active { background: rgba(37, 99, 235, .22); color: #fff; }
.nav-link.is-active i { color: #93c5fd; opacity: 1; }
.nav-badge {
    margin-left: auto; min-width: 22px; height: 22px; padding: 0 7px;
    display: inline-grid; place-items: center;
    border-radius: 999px; background: #ef4444; color: #fff; font-size: .75rem;
}
.sidebar-foot { padding: 12px 20px 18px; display: grid; gap: 8px; border-top: 1px solid rgba(255, 255, 255, .07); }
.sidebar-foot a { color: var(--side-ink); font-size: .85rem; }
.sidebar-foot a:hover { color: #fff; }
.sidebar-foot i { width: 18px; }

.app { margin-left: var(--side-w); min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
    position: sticky; top: 0; z-index: 30;
    display: flex; align-items: center; gap: 12px;
    height: var(--top-h); padding: 0 24px;
    background: rgba(255, 255, 255, .92); backdrop-filter: blur(6px);
    border-bottom: 1px solid var(--line);
}
.topbar h1 { font-size: 1.15rem; font-weight: 700; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.topbar-user { color: var(--muted); font-size: .85rem; }
.menu-toggle { display: none; }

.alert-toggle {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 7px 12px; border-radius: 999px;
    border: 1px solid var(--line); color: var(--muted); font-weight: 600; font-size: .82rem;
}
.alert-toggle:hover { border-color: var(--primary); color: var(--primary); }
.alert-toggle.is-on { background: var(--ok-soft); border-color: #a7dbb8; color: var(--ok); }

.main { padding: 24px; max-width: 1400px; width: 100%; }
.nav-overlay { display: none; }

/* --- Componentes ---------------------------------------------------------- */

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.view > .card + .card { margin-top: 20px; }
.card-head {
    display: flex; align-items: center; flex-wrap: wrap; gap: 12px;
    padding: 16px 20px; border-bottom: 1px solid var(--line);
}
.card-head h2 { font-size: 1rem; font-weight: 700; }
.card-head .actions { margin-left: auto; display: flex; flex-wrap: wrap; gap: 8px; }
.card-body { padding: 20px; }

.page-head { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 20px; }
.page-head p { color: var(--muted); }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.breadcrumb { display: flex; align-items: center; gap: 8px; color: var(--muted); margin-bottom: 4px; font-size: .85rem; }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--primary); }

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    height: 38px; padding: 0 14px; border-radius: 8px;
    border: 1px solid var(--line); background: var(--surface);
    font-weight: 600; font-size: .875rem; color: var(--ink-2);
    transition: background-color .15s, border-color .15s, color .15s;
    white-space: nowrap;
}
.btn:hover:not(:disabled) { border-color: #cbd2dc; background: #f9fafb; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-success { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn-success:hover:not(:disabled) { background: #116a33; border-color: #116a33; }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover:not(:disabled) { background: #b91c1c; border-color: #b91c1c; }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover:not(:disabled) { background: var(--line-2); border-color: transparent; }
.btn-sm { height: 32px; padding: 0 10px; font-size: .8rem; }

.icon-btn {
    display: inline-grid; place-items: center;
    width: 36px; height: 36px; border-radius: 8px; color: var(--muted);
}
.icon-btn:hover { background: var(--line-2); color: var(--ink); }
.icon-btn.danger:hover { background: var(--danger-soft); color: var(--danger); }

.badge {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 2px 10px; border-radius: 999px;
    font-size: .75rem; font-weight: 600; white-space: nowrap;
}
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge--warn { background: var(--warn-soft); color: var(--warn); }
.badge--ok { background: var(--ok-soft); color: var(--ok); }
.badge--danger { background: var(--danger-soft); color: var(--danger); }
.badge--muted { background: var(--line-2); color: var(--muted); }
.badge--info { background: var(--primary-soft); color: var(--primary); }

/* Tabs / filtros */
.tabs { display: flex; gap: 4px; padding: 4px; background: var(--line-2); border-radius: 10px; max-width: 100%; overflow-x: auto; }
.tab {
    padding: 6px 14px; border-radius: 7px;
    font-weight: 600; font-size: .85rem; color: var(--muted);
    display: inline-flex; align-items: center; gap: 8px; white-space: nowrap;
}
.tab.is-active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.tab .count { font-size: .75rem; background: var(--line); border-radius: 999px; padding: 0 7px; }
.tab.is-active .count { background: var(--primary-soft); color: var(--primary); }

.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.search-box {
    display: flex; align-items: center; gap: 8px;
    height: 38px; padding: 0 12px; min-width: 240px;
    border: 1px solid var(--line); border-radius: 8px; background: var(--surface);
}
.search-box i { color: var(--muted); }
.search-box input { border: 0; outline: 0; flex: 1; min-width: 0; background: none; }
.search-box:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }

/* Formularios */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }
.field { display: grid; gap: 6px; }
.field > span { font-weight: 600; font-size: .82rem; color: var(--ink-2); }
.field small { color: var(--muted); font-size: .78rem; }
.input, .field input:not([type=checkbox]):not([type=radio]):not([type=file]), .field select, .field textarea, select.input {
    width: 100%; height: 38px; padding: 0 12px;
    border: 1px solid var(--line); border-radius: 8px; background: var(--surface);
    outline: 0;
}
.field textarea { height: auto; min-height: 84px; padding: 10px 12px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus, .input:focus {
    border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft);
}
/* Categoría nueva: recuadro aparte, debajo del desplegable */
.new-category { padding: 12px 14px; border: 1px dashed var(--primary); border-radius: 10px; background: var(--primary-soft); }
.new-category > span { color: var(--primary-dark); }
.new-category-row { display: flex; gap: 8px; align-items: center; }
.new-category-row input { flex: 1; min-width: 0; }
.check { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--primary); }
.dropzone {
    display: grid; place-items: center; gap: 6px; text-align: center;
    padding: 18px; border: 2px dashed var(--line); border-radius: 10px;
    color: var(--muted); cursor: pointer; transition: border-color .15s, background .15s;
}
.dropzone:hover { border-color: var(--primary); background: var(--primary-soft); }
.dropzone i { font-size: 1.4rem; }
.dropzone input { display: none; }
.thumbs { display: flex; flex-wrap: wrap; gap: 8px; }
.thumbs:empty { display: none; }
.thumb {
    position: relative; width: 76px; height: 76px;
    border: 1px solid var(--line); border-radius: 8px; overflow: hidden;
    display: grid; place-items: center; background: #fff; text-align: center;
}
.thumb img { width: 100%; height: 100%; object-fit: contain; }
.thumb small { font-size: .65rem; padding: 0 4px; word-break: break-all; }
.thumb .fa-file-pdf { color: var(--danger); font-size: 1.6rem; }
.thumb--new { border-color: #93c5fd; }
.thumb button {
    position: absolute; top: 3px; right: 3px; width: 22px; height: 22px; border-radius: 50%;
    background: rgba(17, 24, 39, .7); color: #fff; font-size: .7rem;
}
.thumb.is-removed { opacity: .3; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.form-error { color: var(--danger); font-weight: 600; font-size: .85rem; }
.form-error:empty { display: none; }

/* Tablas */
.table-wrap { overflow-x: auto; }
.table th {
    text-align: left; font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
    color: var(--muted); padding: 10px 16px; background: #fafbfc; border-bottom: 1px solid var(--line);
    white-space: nowrap;
}
.table td { padding: 12px 16px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #fafbfd; }
.table .row-actions { display: flex; justify-content: flex-end; gap: 2px; }
.table .cell-img { width: 44px; height: 44px; border-radius: 8px; border: 1px solid var(--line); object-fit: contain; background: #fff; }
.table .strong { font-weight: 600; }
.table .sub { color: var(--muted); font-size: .8rem; }

.pager { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 14px; color: var(--muted); font-size: .85rem; }
.pager:empty { display: none; }

.empty { display: grid; justify-items: center; gap: 6px; padding: 48px 20px; text-align: center; color: var(--muted); }
.empty i { font-size: 2rem; opacity: .35; margin-bottom: 6px; }
.empty h3 { color: var(--ink-2); font-size: 1rem; }
.loading { display: grid; place-items: center; padding: 60px; color: var(--muted); font-size: 1.5rem; }

/* --- KPIs y tablero de pedidos ---------------------------------------------- */

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.kpi { padding: 16px 18px; display: grid; gap: 4px; }
.kpi-label { color: var(--muted); font-size: .8rem; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.kpi-value { font-size: 1.6rem; font-weight: 700; letter-spacing: -.02em; }
.kpi-sub { color: var(--muted); font-size: .8rem; }
.kpi--alert { border-color: #fcd9a5; background: linear-gradient(180deg, #fffaf0, #fff); }
.kpi--alert .kpi-value { color: var(--warn); }

.orders-layout { display: grid; grid-template-columns: minmax(0, 1fr) 440px; gap: 20px; align-items: start; }
.order-list { list-style: none; }
.order-row {
    display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: center;
    padding: 14px 20px; border-bottom: 1px solid var(--line-2); cursor: pointer;
}
.order-row:hover { background: #fafbfd; }
.order-row.is-selected { background: var(--primary-soft); box-shadow: inset 3px 0 0 var(--primary); }
.order-row.is-new { animation: flash 2.4s ease-out; }
@keyframes flash { 0%, 30% { background: #fff1c2; } 100% { background: transparent; } }
.order-id { font-weight: 700; font-size: .95rem; min-width: 56px; }
.order-who { min-width: 0; }
.order-who strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.order-who span { color: var(--muted); font-size: .8rem; }
.order-side { text-align: right; display: grid; gap: 4px; justify-items: end; }
.order-side strong { font-size: .95rem; }

.order-detail { position: sticky; top: calc(var(--top-h) + 24px); max-height: calc(100vh - var(--top-h) - 48px); display: flex; flex-direction: column; }
.order-detail .card-body { overflow-y: auto; }
.detail-grid { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; font-size: .88rem; margin-bottom: 16px; }
.detail-grid dt { color: var(--muted); }
.detail-grid dd { font-weight: 500; overflow-wrap: anywhere; }
.note-box { background: var(--warn-soft); border: 1px solid #fcd9a5; border-radius: 8px; padding: 10px 12px; margin-bottom: 16px; font-size: .88rem; }
.note-box strong { display: block; font-size: .75rem; text-transform: uppercase; color: var(--warn); margin-bottom: 2px; }
.items-table td { padding: 8px 0; border-bottom: 1px solid var(--line-2); font-size: .88rem; }
.items-table td:not(:first-child) { text-align: right; padding-left: 10px; white-space: nowrap; }
.items-table .qty-edit { width: 64px; height: 30px; padding: 0 6px; border: 1px solid var(--line); border-radius: 6px; text-align: right; }
.items-table .low { color: var(--danger); font-size: .75rem; display: block; }
.totals { display: grid; gap: 4px; margin: 14px 0; padding: 12px; background: #fafbfc; border-radius: 8px; font-size: .88rem; }
.totals div { display: flex; justify-content: space-between; }
.totals .grand { font-size: 1.05rem; font-weight: 700; border-top: 1px solid var(--line); padding-top: 6px; margin-top: 2px; }
.detail-actions { display: flex; gap: 10px; padding: 16px 20px; border-top: 1px solid var(--line); }
.detail-actions .btn { flex: 1; }

/* --- Importar Excel, marcas y productos -------------------------------------- */

.step-n {
    display: inline-grid; place-items: center; width: 24px; height: 24px; margin-right: 8px;
    border-radius: 50%; background: var(--primary); color: #fff; font-size: .8rem;
}
.dropzone--big { min-height: 140px; flex-direction: column; justify-content: center; font-size: .95rem; }
.dropzone--big i { font-size: 2.2rem; color: #1d6f42; }
.dropzone.is-over { border-color: var(--primary); background: var(--primary-soft); }
.import-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; }
.import-options { display: grid; gap: 14px; padding: 16px; background: #fafbfc; border: 1px solid var(--line); border-radius: 10px; }
.map-table td { padding: 8px 10px; }
.map-table select { min-width: 160px; }
.map-table .sample { color: var(--muted); font-size: .8rem; max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kpis--import { margin-bottom: 0; }
.kpis--import .kpi { border: 1px solid var(--line); border-radius: 10px; }
.kpis--import .kpi span { color: var(--muted); font-size: .8rem; font-weight: 600; }
.kpis--import .kpi b { font-size: 1.5rem; }
.kpi--danger b { color: var(--danger); }
.table--compact th, .table--compact td { padding: 6px 10px; font-size: .82rem; }
.table .clip { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.alert { padding: 10px 14px; border-radius: 8px; background: var(--primary-soft); font-size: .88rem; }
.alert--warn { background: var(--warn-soft); color: var(--warn); }
.errors-box { border: 1px solid #f3c4c4; border-radius: 8px; padding: 10px 14px; background: var(--danger-soft); font-size: .85rem; }
.errors-box summary { cursor: pointer; font-weight: 600; color: var(--danger); }
.errors-box ul { margin: 8px 0 0 18px; max-height: 240px; overflow-y: auto; }
.table .code, .items-table .code { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .8rem; background: var(--line-2); padding: 1px 6px; border-radius: 4px; }
.table .cell-img--logo { width: 72px; object-fit: contain; padding: 4px; }

.banner-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 16px; padding: 20px; }
.banner-item { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.banner-versions { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 12px; padding: 12px; align-items: end; }
.banner-versions figure { margin: 0; display: grid; gap: 6px; }
.banner-versions figcaption { font-size: .75rem; font-weight: 600; color: var(--muted); }
.ad-preview { display: block; width: 100%; object-fit: contain; background: #1e1e30; border-radius: 6px; }
.ad-preview--pc { aspect-ratio: 8 / 1; }
.ad-preview--mob { aspect-ratio: 5 / 2; }
.ad-missing { aspect-ratio: 5 / 2; display: grid; place-content: center; text-align: center; gap: 4px; padding: 6px; border: 1px dashed #f3c27a; border-radius: 6px; background: var(--warn-soft); color: var(--warn); font-size: .72rem; }
.hint-ok { color: var(--ok); font-size: .78rem; }
.hint-warn { color: var(--warn); font-size: .78rem; }
.guide-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.guide-grid p { font-size: .85rem; color: var(--ink-2); margin-top: 8px; }
.guide-box { display: grid; place-content: center; background: linear-gradient(135deg, #0b1d3a, #1e3a6b); color: #fff; font-weight: 700; font-size: .8rem; border-radius: 8px; text-align: center; }
.guide-box--pc { aspect-ratio: 8 / 1; }
.guide-box--mob { aspect-ratio: 5 / 2; max-width: 260px; }
.guide-tips { grid-column: 1 / -1; font-size: .8rem !important; }
@media (max-width: 760px) { .guide-grid { grid-template-columns: 1fr; } .banner-grid { grid-template-columns: 1fr; } }
.banner-item .meta { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; color: var(--muted); font-size: .8rem; }

.price-change-preview { max-height: 320px; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; margin-top: 12px; }
.up { color: var(--ok); } .down { color: var(--danger); }

/* --- Modales y toasts --------------------------------------------------------- */

.modal-backdrop {
    position: fixed; inset: 0; z-index: 100;
    display: grid; place-items: center; padding: 20px;
    background: rgba(17, 24, 39, .5);
    animation: fade .15s ease-out;
}
@keyframes fade { from { opacity: 0; } }
.modal {
    width: 100%; max-height: calc(100vh - 40px);
    display: flex; flex-direction: column;
    background: var(--surface); border-radius: 14px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .25);
    animation: pop .15s ease-out;
}
@keyframes pop { from { transform: translateY(8px) scale(.98); } }
.modal--sm { max-width: 420px; }
.modal--md { max-width: 620px; }
.modal--lg { max-width: 860px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-head h2 { font-size: 1.05rem; }
.modal-content { padding: 20px; overflow-y: auto; }
.confirm-text { font-size: .95rem; margin-bottom: 6px; }

.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 200; display: grid; gap: 10px; }
.toast {
    display: flex; align-items: center; gap: 10px;
    min-width: 260px; max-width: 420px; padding: 12px 16px; border-radius: 10px;
    background: #111827; color: #fff; font-weight: 500;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .2);
    opacity: 0; transform: translateY(10px); transition: opacity .25s, transform .25s;
}
.toast.is-visible { opacity: 1; transform: none; }
.toast--ok i { color: #4ade80; }
.toast--warn i { color: #fbbf24; }
.toast--error { background: #7f1d1d; }
.toast--order { background: #1e3a8a; }

/* --- Responsive ---------------------------------------------------------------- */

@media (max-width: 1200px) {
    .orders-layout { grid-template-columns: minmax(0, 1fr); }
    .order-detail { position: static; max-height: none; }
    .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .import-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 900px) {
    .sidebar { transform: translateX(-100%); transition: transform .2s; }
    body.nav-open .sidebar { transform: none; }
    body.nav-open .nav-overlay { display: block; position: fixed; inset: 0; z-index: 35; background: rgba(0, 0, 0, .4); }
    .app { margin-left: 0; }
    .menu-toggle { display: inline-grid; }
    .main { padding: 16px; }
    .topbar { padding: 0 12px; }
    .topbar-user, .alert-toggle span { display: none; }
    .form-grid { grid-template-columns: 1fr; }
    .search-box { min-width: 0; flex: 1; }
    .map-table select { min-width: 0; width: 100%; }
    .map-table .sample, .map-table th:nth-child(3) { display: none; }
}

@media (max-width: 560px) {
    .kpis { grid-template-columns: 1fr 1fr; gap: 10px; }
    .kpi-value { font-size: 1.25rem; }
    .order-row { grid-template-columns: 1fr auto; grid-template-areas: "id side" "who who"; gap: 4px 12px; padding: 12px 14px; }
    .order-id { grid-area: id; }
    .order-who { grid-area: who; }
    .order-side { grid-area: side; }
    .card-head .actions { margin-left: 0; width: 100%; }
    .card-head .toolbar input[type=date] { flex: 1 1 40%; min-width: 0; }
    .card-head .search-box { flex: 1 1 100%; }
    .modal-backdrop { padding: 0; place-items: end stretch; }
    .modal { max-height: 94vh; border-radius: 14px 14px 0 0; }
}

/* Imágenes masivas */
.dropzone--images i { color: var(--primary); }
.radio-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; }
.radio-card { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; font-size: .9rem; }
.radio-card:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.radio-card input { margin-top: 3px; accent-color: var(--primary); }
.img-strip { display: flex; gap: 4px; flex-wrap: wrap; max-width: 240px; }
.progress { position: relative; height: 30px; border-radius: 8px; background: var(--line-2); overflow: hidden; }
.progress-bar { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--primary); transition: width .3s; }
.progress-text { position: relative; display: flex; align-items: center; height: 100%; padding: 0 12px; font-size: .85rem; font-weight: 600; mix-blend-mode: difference; color: #fff; }

/* WhatsApp */
.wa-link { color: #128c4b; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.wa-link i { font-size: 1.05em; }
.icon-btn--wa { color: #128c4b; }
.btn-wa { background: #25d366; border-color: #25d366; color: #fff; }
.btn-wa:hover { background: #1ebe5b; border-color: #1ebe5b; }
.wa-hint--bad { color: var(--danger); font-size: .78rem; }

/* Borrado masivo */
.btn-danger-outline { color: var(--danger); border-color: #f3c4c4; }
.btn-danger-outline:hover { background: var(--danger-soft); border-color: var(--danger); }
.alert--danger { background: var(--danger-soft); color: var(--danger); display: flex; gap: 10px; align-items: flex-start; }
.alert--danger i { margin-top: 3px; }
.radio-cards--stack { grid-template-columns: 1fr; }
.danger-big { font-size: 1.05rem; color: var(--danger); }
