/* StockPro by VYCSOFT - estilos de la aplicación */
:root {
    --bg: #020617;
    --panel: #0f172a;
    --panel-2: #111c33;
    --border: #1e293b;
    --border-2: #334155;
    --text: #e2e8f0;
    --muted: #94a3b8;
    --dim: #64748b;
    --accent: #10b981;
    --accent-2: #34d399;
    --danger: #f43f5e;
    --warning: #f59e0b;
    --info: #38bdf8;
    --violet: #a78bfa;
    --radius: 12px;
    --company: #10b981;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.5; }
a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; line-height: 1.25; }
h1 { font-size: 22px; }
h2 { font-size: 16px; }
h3 { font-size: 14px; }
small { color: var(--muted); }
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.icon { width: 18px; height: 18px; flex-shrink: 0; }
.mono { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 12.5px; }
.right { text-align: right; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.green { color: var(--accent-2); }
.red { color: var(--danger); }
.amber { color: var(--warning); }

/* Shell */
.shell { display: flex; min-height: 100vh; }
.sidebar {
    width: 248px; flex-shrink: 0; background: var(--panel); border-right: 1px solid var(--border);
    position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: 16px 12px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 16px; color: var(--text); text-decoration: none !important; }
.brand strong { display: block; font-size: 16px; }
.brand small { display: block; font-size: 11px; letter-spacing: .04em; }
.brand-logo { flex-direction: column; align-items: flex-start; gap: 2px; padding: 0 4px 12px; }
.brand-logo img { width: 100%; max-width: 210px; height: auto; display: block; border-radius: 8px; }
.brand-logo small { padding-left: 8px; font-size: 11.5px; }
.login-logo { margin: -18px -18px 12px; background: #0d1b2f; border-radius: var(--radius) var(--radius) 0 0; padding: 8px 24px; }
.login-logo img { width: 100%; height: auto; display: block; }

/* Buscador de productos (nombre, referencia, código de barras) */
.combo { position: relative; }
.combo-native { position: absolute; left: 0; bottom: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.combo-input { padding-left: 30px; background: var(--bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.3-4.3'/%3E%3C/svg%3E") no-repeat 9px center; }
.combo-list {
    position: absolute; z-index: 60; left: 0; right: 0; top: calc(100% + 4px); max-height: 280px; overflow-y: auto; margin: 0; padding: 4px;
    list-style: none; background: var(--panel); border: 1px solid var(--border-2); border-radius: 10px; box-shadow: 0 12px 30px rgba(0, 0, 0, .45);
}
.combo-list li { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 7px 9px; border-radius: 6px; cursor: pointer; font-size: 13px; }
.combo-list li small { color: var(--dim); flex-shrink: 0; }
.combo-list li.active { background: rgba(16, 185, 129, .15); color: var(--accent-2); }
.combo-list li.disabled { opacity: .45; cursor: not-allowed; }
.combo-list li.empty-item { color: var(--muted); cursor: default; }

/* Modo sin conexión */
.net-banner { display: flex; align-items: center; gap: 10px; padding: 10px 24px; background: rgba(245, 158, 11, .14); border-bottom: 1px solid rgba(245, 158, 11, .4); color: #fbbf24; font-weight: 500; }
.net-banner a { color: #fde68a; text-decoration: underline; }
.nav-count-amber { background: var(--warning); color: #1f1300; }
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--border); }
.tab { background: none; border: 0; border-bottom: 2px solid transparent; color: var(--muted); padding: 8px 14px; font: inherit; font-weight: 600; cursor: pointer; }
.tab.active { color: var(--accent-2); border-bottom-color: var(--accent); }
.offline-line { border-bottom: 1px dashed var(--border); padding-bottom: 8px; margin-bottom: 10px; }

/* Selección de almacenes del evento */
.wh-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.wh-card { position: relative; margin: 0; cursor: pointer; }
.wh-card input { position: absolute; top: 12px; right: 12px; }
.wh-body { display: block; padding: 12px 34px 12px 12px; border: 1px solid var(--border-2); border-left: 4px solid var(--wh); border-radius: 10px; color: var(--text); font-weight: 400; }
.wh-body strong { display: block; font-size: 13.5px; }
.wh-body small { display: block; margin-top: 2px; }
.wh-card input:checked + .wh-body { border-color: var(--accent); border-left-color: var(--wh); background: rgba(16, 185, 129, .08); }
.wh-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.table tr.group-row td { background: rgba(30, 41, 59, .7); font-weight: 700; color: var(--text); }
.table tr.subtotal-row td { font-weight: 600; color: var(--muted); border-bottom: 2px solid var(--border-2); }

/* Filtros tipo chip (bares / ubicaciones) */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { margin: 0; cursor: pointer; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span { display: inline-flex; align-items: center; gap: 4px; padding: 6px 12px; border-radius: 99px; border: 1px solid var(--border-2); color: var(--muted); font-weight: 600; font-size: 12.5px; }
.chip span em { font-style: normal; font-size: 11px; background: var(--border); color: var(--text); border-radius: 99px; padding: 0 6px; }
.chip input:checked + span { border-color: var(--accent); background: rgba(16, 185, 129, .12); color: var(--accent-2); }
.chip input:focus-visible + span { box-shadow: 0 0 0 3px rgba(16, 185, 129, .25); }
.chart-card .chart-box { height: 300px; }

/* Instalador */
.install-card { width: 100%; max-width: 760px; }
.install-card h2 { font-size: 15px; margin-bottom: 12px; }
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; list-style: none; padding: 0; margin: 0 0 20px; counter-reset: step; }
.steps li { counter-increment: step; text-align: center; font-size: 12px; color: var(--dim); padding-top: 8px; border-top: 3px solid var(--border); }
.steps li::before { content: counter(step) ". "; }
.steps li.active { color: var(--accent-2); border-color: var(--accent); font-weight: 700; }
.steps li.done { color: var(--muted); border-color: rgba(16, 185, 129, .45); }
.choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.choice { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border: 1px solid var(--border-2); border-radius: 10px; cursor: pointer; color: var(--text); font-weight: 400; margin: 0; }
.choice:has(input:checked) { border-color: var(--accent); background: rgba(16, 185, 129, .08); }
.choice:has(input:disabled) { opacity: .5; cursor: not-allowed; }
.choice small { display: block; margin-top: 2px; }
.wizard-nav { border-top: 1px solid var(--border); padding-top: 14px; margin-top: 16px; }
@media (max-width: 640px) { .choice-grid { grid-template-columns: 1fr; } .steps li { font-size: 10.5px; } }
.brand-mark {
    width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; font-weight: 800;
    background: linear-gradient(135deg, var(--accent), #0ea5e9); color: #022c22;
}
.nav-section { font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--dim); margin: 14px 10px 6px; font-weight: 700; }
.nav-link {
    display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--muted);
    text-decoration: none !important; font-weight: 500;
}
.nav-link:hover { background: var(--panel-2); color: var(--text); }
.nav-link.active { background: rgba(16, 185, 129, .12); color: var(--accent-2); }
.nav-count { margin-left: auto; font-style: normal; background: var(--danger); color: #fff; font-size: 11px; border-radius: 99px; padding: 0 7px; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
    position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: 10px 24px;
    background: rgba(2, 6, 23, .85); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border);
}
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.company-switch { display: flex; align-items: center; gap: 8px; min-width: 0; }
.company-switch select { max-width: 260px; font-weight: 600; }
.company-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--company); box-shadow: 0 0 0 3px rgba(255,255,255,.06); flex-shrink: 0; }
.icon-btn {
    position: relative; display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 8px;
    border: 1px solid var(--border); background: var(--panel); color: var(--muted); cursor: pointer;
}
.icon-btn:hover { color: var(--text); border-color: var(--border-2); }
.dot-count { position: absolute; top: -6px; right: -6px; background: var(--danger); color: #fff; font-size: 10px; border-radius: 99px; padding: 0 5px; font-weight: 700; }
.user-chip { display: flex; align-items: center; gap: 8px; color: var(--text); text-decoration: none !important; padding: 2px 8px 2px 2px; border-radius: 99px; }
.user-chip:hover { background: var(--panel); }
.user-chip strong, .user-chip small { display: block; line-height: 1.2; }
.user-chip small { font-size: 11px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--company); color: #fff; font-weight: 700; }
.content { padding: 24px; flex: 1; width: 100%; max-width: 1400px; margin: 0 auto; }
.footer { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 14px 24px; border-top: 1px solid var(--border); color: var(--dim); font-size: 12px; }
.mobile-only { display: none; }
.backdrop { display: none; }

/* Encabezados de página */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* Tarjetas */
.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.card + .card { margin-top: 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head p { margin: 2px 0 0; color: var(--muted); font-size: 12.5px; }
.card.flush { padding: 0; overflow: hidden; }
.card.flush .card-head { padding: 16px 18px 0; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }
.stack > * + * { margin-top: 16px; }

.kpi { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; position: relative; overflow: hidden; }
.kpi .label { color: var(--muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.kpi .value { font-size: 24px; font-weight: 800; margin-top: 6px; letter-spacing: -.01em; }
.kpi .hint { color: var(--dim); font-size: 12px; margin-top: 2px; }
.kpi::after { content: ""; position: absolute; inset: auto 0 0 0; height: 3px; background: var(--tone, var(--accent)); opacity: .8; }

/* Tablas */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
.table th { font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--dim); font-weight: 700; background: rgba(15, 23, 42, .6); white-space: nowrap; }
.table tbody tr:hover { background: rgba(30, 41, 59, .35); }
.table tfoot td { font-weight: 700; background: rgba(15, 23, 42, .6); }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sub { display: block; font-size: 12px; color: var(--dim); }
.empty { padding: 32px; text-align: center; color: var(--muted); }

/* Badges */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 99px; font-size: 11.5px; font-weight: 600; border: 1px solid transparent; white-space: nowrap; }
.badge-slate { background: rgba(100, 116, 139, .15); color: #cbd5e1; border-color: rgba(100, 116, 139, .3); }
.badge-green { background: rgba(16, 185, 129, .12); color: var(--accent-2); border-color: rgba(16, 185, 129, .3); }
.badge-red { background: rgba(244, 63, 94, .12); color: #fb7185; border-color: rgba(244, 63, 94, .3); }
.badge-amber { background: rgba(245, 158, 11, .12); color: #fbbf24; border-color: rgba(245, 158, 11, .3); }
.badge-blue { background: rgba(56, 189, 248, .12); color: #7dd3fc; border-color: rgba(56, 189, 248, .3); }
.badge-violet { background: rgba(167, 139, 250, .12); color: #c4b5fd; border-color: rgba(167, 139, 250, .3); }
.badge-pink { background: rgba(236, 72, 153, .12); color: #f9a8d4; border-color: rgba(236, 72, 153, .3); }

/* Formularios */
label { display: block; font-size: 12.5px; color: var(--muted); font-weight: 600; margin-bottom: 5px; }
input, select, textarea {
    width: 100%; background: var(--bg); border: 1px solid var(--border-2); color: var(--text); border-radius: 8px;
    padding: 8px 10px; font: inherit; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(16, 185, 129, .15); }
input[type=checkbox], input[type=radio] { width: auto; accent-color: var(--accent); }
input[type=color] { padding: 2px; height: 38px; }
textarea { min-height: 80px; resize: vertical; }
.field { margin-bottom: 14px; }
.field .help { font-size: 12px; color: var(--dim); margin-top: 4px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.form-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 16px; }
.form-grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 16px; }
.full { grid-column: 1 / -1; }
.check { display: flex; align-items: center; gap: 8px; color: var(--text); font-weight: 500; cursor: pointer; margin-bottom: 8px; }
.form-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 8px; flex-wrap: wrap; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 16px; }
.filters .field { margin: 0; min-width: 150px; }
.filters .grow { flex: 1; min-width: 200px; }
fieldset { border: 1px solid var(--border); border-radius: 10px; padding: 14px; margin: 0 0 16px; }
legend { padding: 0 6px; color: var(--muted); font-weight: 700; font-size: 12.5px; }

/* Botones */
.btn {
    display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 8px; font: inherit; font-weight: 600;
    border: 1px solid var(--border-2); background: var(--panel-2); color: var(--text); cursor: pointer; text-decoration: none !important; white-space: nowrap;
}
.btn:hover { border-color: var(--muted); }
.btn .icon { width: 16px; height: 16px; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #022c22; }
.btn-primary:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn-danger { background: rgba(244, 63, 94, .12); border-color: rgba(244, 63, 94, .4); color: #fb7185; }
.btn-sm { padding: 5px 10px; font-size: 12.5px; }
.btn-block { width: 100%; justify-content: center; }
.btn-link { background: none; border: none; color: var(--accent-2); cursor: pointer; padding: 0; font: inherit; }

/* Mensajes */
.flash { padding: 10px 14px; border-radius: 10px; margin-bottom: 14px; border: 1px solid; font-weight: 500; }
.flash-success { background: rgba(16, 185, 129, .1); border-color: rgba(16, 185, 129, .35); color: var(--accent-2); }
.flash-error { background: rgba(244, 63, 94, .1); border-color: rgba(244, 63, 94, .35); color: #fb7185; }
.flash-info { background: rgba(56, 189, 248, .1); border-color: rgba(56, 189, 248, .35); color: #7dd3fc; }

/* Barras de progreso */
.bar { height: 8px; background: var(--border); border-radius: 99px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.bar.warn > span { background: var(--warning); }
.bar.danger > span { background: var(--danger); }

/* Alertas */
.alert-item { display: flex; gap: 12px; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--border); background: var(--panel); align-items: flex-start; }
.alert-item + .alert-item { margin-top: 8px; }
.alert-item.danger { border-left: 3px solid var(--danger); }
.alert-item.warning { border-left: 3px solid var(--warning); }
.alert-item.info { border-left: 3px solid var(--info); }
.alert-item p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }

/* Equation (eventos) */
.equation { display: flex; align-items: stretch; gap: 8px; flex-wrap: wrap; }
.equation .term { flex: 1; min-width: 120px; background: var(--panel-2); border: 1px solid var(--border); border-radius: 10px; padding: 12px; text-align: center; }
.equation .term strong { display: block; font-size: 20px; }
.equation .term small { font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; }
.equation .op { display: grid; place-items: center; font-size: 20px; color: var(--dim); font-weight: 800; }
.equation .term.result { border-color: rgba(236, 72, 153, .5); background: rgba(236, 72, 153, .08); }

/* POS */
.pos { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 16px; align-items: start; }
.pos-products { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; max-height: 70vh; overflow-y: auto; padding-right: 4px; }
.pos-item { text-align: left; background: var(--panel-2); border: 1px solid var(--border); border-radius: 10px; padding: 10px; color: var(--text); cursor: pointer; font: inherit; }
.pos-item:hover { border-color: var(--accent); }
.pos-item[disabled] { opacity: .45; cursor: not-allowed; }
.pos-item strong { display: block; font-size: 13px; line-height: 1.3; }
.pos-item .price { color: var(--accent-2); font-weight: 700; margin-top: 4px; }
.cart-line { display: grid; grid-template-columns: 1fr 70px 90px 26px; gap: 6px; align-items: center; padding: 6px 0; border-bottom: 1px dashed var(--border); }
.cart-line input { padding: 4px 6px; }
.cart-total { font-size: 26px; font-weight: 800; color: var(--accent-2); }
.sticky { position: sticky; top: 76px; }

/* Login */
.guest { background: radial-gradient(1200px 600px at 10% -10%, rgba(16,185,129,.18), transparent), radial-gradient(900px 500px at 110% 110%, rgba(14,165,233,.15), transparent), var(--bg); }
.guest-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.login-card { width: 100%; max-width: 420px; }
.login-card .brand { justify-content: center; padding-bottom: 8px; }
.login-card .brand-mark { width: 48px; height: 48px; font-size: 18px; }
.demo-box { margin-top: 16px; font-size: 12.5px; color: var(--muted); border-top: 1px solid var(--border); padding-top: 12px; }
.demo-box code { color: var(--accent-2); }
.chart-box { position: relative; height: 280px; }

.list-plain { list-style: none; margin: 0; padding: 0; }
.list-plain li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.list-plain li:last-child { border-bottom: 0; }
.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: middle; }
.perm-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 16px; }

/* Responsive */
@media (max-width: 1100px) {
    .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .pos { grid-template-columns: 1fr; }
    .sticky { position: static; }
}
@media (max-width: 860px) {
    .sidebar { position: fixed; left: 0; top: 0; z-index: 50; transform: translateX(-100%); transition: transform .2s ease; }
    body.nav-open .sidebar { transform: none; }
    body.nav-open .backdrop { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 40; }
    .mobile-only { display: inline-grid; }
    .grid-2, .grid-3, .form-grid, .form-grid-3, .form-grid-4, .perm-grid { grid-template-columns: 1fr; }
    .span-2 { grid-column: auto; }
    .content { padding: 16px; }
    .topbar { padding: 10px 16px; }
    .hide-sm { display: none !important; }
    .company-switch select { max-width: 170px; }
}
@media (max-width: 520px) {
    .grid-4 { grid-template-columns: 1fr 1fr; }
    .kpi .value { font-size: 19px; }
}
