@font-face {
    font-family: 'Public Sans';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("../fonts/PublicSans-Regular.a0d45ec6cee2.woff2") format('woff2');
}

@font-face {
    font-family: 'Public Sans';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url("../fonts/PublicSans-Medium.38b89f627846.woff2") format('woff2');
}

@font-face {
    font-family: 'Public Sans';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url("../fonts/PublicSans-SemiBold.2fe33dfe398c.woff2") format('woff2');
}

@font-face {
    font-family: 'Public Sans';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url("../fonts/PublicSans-Bold.fe554289d33b.woff2") format('woff2');
}

@font-face {
    font-family: 'Public Sans';
    font-style: normal;
    font-weight: 800;
    font-display: swap;
    src: url("../fonts/PublicSans-ExtraBold.f9431f495e67.woff2") format('woff2');
}

:root {
    --v-50: #f2f0fc;
    --v-100: #e6e2f8;
    --v-200: #cdc5f0;
    --v-400: #8a7be4;
    --v-500: #6a5acd;
    --v-600: #5847c4;
    --v-700: #4533a8;
    --v-800: #372a86;
    --ink-900: #1b1b27;
    --ink-700: #3a3a4c;
    --ink-600: #56566a;
    --ink-500: #71717f;
    --ink-400: #9a9aa7;
    --ink-300: #c5c5cf;
    --line: #e7e7ee;
    --line-2: #f0f0f5;
    --surface: #ffffff;
    --bg: #f4f5f8;
    --bg-2: #eceef3;
    --green-600: #18a06b;
    --green-50: #e3f6ee;
    --amber-600: #cf8a00;
    --amber-50: #fbf0d8;
    --red-600: #d6455a;
    --red-50: #fbe4e8;
    --blue-600: #2f6fd6;
    --blue-50: #e4eefb;
    --sh-xs: 0 1px 2px rgba(24, 24, 46, 0.05);
    --sh-sm: 0 1px 2px rgba(24, 24, 46, 0.05), 0 1px 3px rgba(24, 24, 46, 0.06);
    --sh-md: 0 4px 12px rgba(40, 32, 90, 0.08);
    --sh-lg: 0 12px 28px rgba(40, 32, 90, 0.12);
    --r-sm: 8px;
    --r-md: 12px;
    --r-lg: 16px;
    --r-pill: 999px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: 'Public Sans', system-ui, -apple-system, sans-serif;
    color: var(--ink-700);
    background:
        radial-gradient(circle at top left, rgba(106, 90, 205, 0.12), transparent 28%),
        linear-gradient(180deg, #f8f9fc 0%, var(--bg) 32%, #eef1f7 100%);
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.num {
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum";
}

a {
    color: inherit;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--v-600);
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06), var(--sh-sm);
}

.topbar-inner {
    max-width: 1280px;
    margin: 0 auto;
    min-height: 60px;
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 10px 24px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #fff;
    text-decoration: none;
}

.brand-mark {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    flex: none;
    background: rgba(0, 0, 0, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.16);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 19px;
}

.brand-logo {
    height: 46px;
    width: auto;
    flex: none;
    display: block;
}

.brand-txt {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}

.brand-txt strong {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0;
}

.brand-txt small {
    font-size: 10.5px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.7);
}

.topnav {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: 8px;
}

.topnav a {
    color: rgba(255, 255, 255, 0.82);
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    padding: 10px 16px;
    border-radius: var(--r-sm);
    transition: background 0.15s, color 0.15s;
}

.topnav a:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.topnav a.active {
    background: #fff;
    color: var(--v-700);
    font-weight: 600;
}

.topbar-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 14px;
}

.status-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #fff;
    font-size: 12.5px;
    padding: 6px 12px;
    border-radius: var(--r-pill);
    background: rgba(255, 255, 255, 0.12);
}

.status-chip .dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #4ade80;
    box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.25);
}

.user-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px 10px 5px 5px;
    border-radius: var(--r-pill);
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    text-decoration: none;
    border: none;
}

.user-chip:hover,
.user-chip:focus {
    color: #fff;
    background: rgba(255, 255, 255, 0.18);
}

.user-chip::after {
    margin-left: 4px;
}

.user-chip img {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
    background: #fff;
}

.user-chip .um {
    line-height: 1.1;
}

.user-chip .um strong {
    display: block;
    font-size: 12.5px;
    font-weight: 600;
}

.user-chip .um small {
    display: block;
    font-size: 10.5px;
    color: rgba(255, 255, 255, 0.7);
}

.shell-menu {
    border: 1px solid rgba(27, 27, 39, 0.08);
    border-radius: var(--r-md);
    box-shadow: var(--sh-md);
    padding: 0.5rem;
}

.shell-menu .dropdown-header {
    color: var(--ink-500);
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding-bottom: 0.5rem;
}

.shell-menu .dropdown-item {
    border-radius: var(--r-sm);
}

.logout-form {
    margin: 0;
}

.logout-form .dropdown-item {
    width: 100%;
    text-align: left;
    border: none;
    background: transparent;
}

.page {
    max-width: 1280px;
    margin: 0 auto;
    padding: 16px 24px 96px; /* sin barra de arriba: poco aire arriba en todas las pantallas */
}

.card {
    border: 1px solid var(--line);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: var(--sh-sm);
    position: relative;
    overflow: hidden;
}

/* .page-shell: plain layout wrapper — content sits directly on the page
   background (no card surface), per the "menos cajas, más aire" direction.
   Individual sections (.panel, .card, etc.) provide their own surfaces. */
.page-shell {
    position: relative;
}

.card::before {
    content: '';
    position: absolute;
    inset: 1px;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.72);
    pointer-events: none;
}

.card {
    box-shadow: var(--sh-sm);
}

.card.shadow-sm {
    box-shadow: var(--sh-md) !important;
}

.card-title,
.page-title {
    color: var(--ink-900);
    font-weight: 700;
}

.page-title {
    font-size: 2.2rem;
    margin-bottom: 1.25rem;
    letter-spacing: 0;
}

.bg-primary-mate {
    background: linear-gradient(120deg, var(--v-600), var(--v-700)) !important;
    color: #fff;
}

.bg-success-mate {
    background: linear-gradient(135deg, var(--green-600), #138a5b) !important;
    color: #fff;
}

.card.bg-primary-mate::before,
.card .card-header.bg-primary-mate::before,
.card-header.bg-primary-mate::before,
.modal-header.bg-primary-mate::before {
    display: none;
}

.btn,
.btn-primary-mate,
.btn-outline-primary-mate,
.btn-production {
    font-family: inherit;
    font-weight: 600;
    font-size: 13.5px;
    border-radius: var(--r-sm);
    padding: 9px 16px;
    transition: transform 0.08s, background 0.15s, box-shadow 0.15s, border-color 0.15s, color 0.15s;
}

.btn:active,
.btn-primary-mate:active,
.btn-outline-primary-mate:active,
.btn-production:active {
    transform: scale(0.98);
}

.btn-primary,
.btn-primary-mate {
    background: var(--v-600);
    border-color: var(--v-600);
    color: #fff;
    box-shadow: 0 1px 2px rgba(72, 51, 168, 0.4);
}

.btn-primary:hover,
.btn-primary-mate:hover {
    background: var(--v-700);
    border-color: var(--v-700);
    color: #fff;
}

.btn-secondary {
    background: #fff;
    color: var(--v-700);
    border-color: var(--v-200);
}

.btn-secondary:hover {
    background: var(--v-50);
    color: var(--v-700);
    border-color: var(--v-200);
}

.btn-outline-primary-mate {
    color: var(--v-700);
    border-color: var(--v-200);
    background: #fff;
}

.btn-outline-primary-mate:hover {
    color: var(--v-700);
    background: var(--v-50);
    border-color: var(--v-200);
}

.btn-outline-primary-mate.active,
.btn-outline-primary-mate.active:hover {
    color: #fff;
    background: var(--v-600);
    border-color: var(--v-600);
}

.btn-production {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
}

.btn-production:hover,
.btn-production.active {
    background: #fff;
    color: var(--v-700);
    border-color: #fff;
}

.form-control,
.form-select {
    border-radius: 14px;
    border: 1px solid rgba(106, 90, 205, 0.18);
    background: rgba(255, 255, 255, 0.98);
    box-shadow: inset 0 1px 2px rgba(27, 27, 39, 0.02);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--v-500);
    box-shadow: 0 0 0 0.2rem rgba(106, 90, 205, 0.14);
}

.table {
    border-collapse: separate;
    border-spacing: 0 8px;
}

.table thead {
    background: transparent;
}

.table thead th {
    background: rgba(106, 90, 205, 0.07);
    color: var(--ink-500);
    text-transform: uppercase;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    border-bottom: 0;
}

.table tbody tr {
    background: rgba(255, 255, 255, 0.96);
    box-shadow: var(--sh-xs);
}

.table tbody tr td {
    vertical-align: middle;
}

.table tbody tr td:first-child,
.table thead tr th:first-child {
    border-top-left-radius: 14px;
    border-bottom-left-radius: 14px;
}

.table tbody tr td:last-child,
.table thead tr th:last-child {
    border-top-right-radius: 14px;
    border-bottom-right-radius: 14px;
}

.alert {
    border-radius: 18px;
    border: 1px solid rgba(27, 27, 39, 0.05);
    box-shadow: var(--sh-sm);
}

.alert-production {
    border-radius: 14px;
}

.production-header {
    background: linear-gradient(120deg, var(--v-600), var(--v-700)) !important;
    color: #fff;
    border: none;
    box-shadow: var(--sh-md) !important;
}

.production-header h2 {
    color: #fff;
}

.search-filter-bar .search-input-wrapper {
    position: relative;
}

.search-filter-bar .search-icon {
    left: 14px;
    color: var(--ink-400);
    pointer-events: none;
}

.search-filter-bar .search-input {
    min-height: 46px;
    padding-left: 42px;
    padding-right: 44px;
    border-radius: var(--r-md);
    border-color: var(--line);
    font-weight: 600;
}

.search-filter-bar .search-clear {
    right: 10px;
    width: 30px;
    height: 30px;
    border: none;
    border-radius: var(--r-pill);
    background: var(--bg);
    color: var(--ink-500);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
}

.search-filter-bar .search-clear:hover {
    color: var(--ink-900);
    background: var(--v-50);
}

.search-filter-bar .search-clear.d-none {
    display: none !important;
}

.filters-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

@keyframes pulse-card {
    0% { transform: scale(1); }
    50% { transform: scale(1.025); }
    100% { transform: scale(1); }
}

.home-portal {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.home-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}

.home-head h1 {
    margin: 0 0 4px;
    font-size: 26px;
    font-weight: 800;
    color: var(--ink-900);
    letter-spacing: 0;
}

.home-head p {
    margin: 0;
    font-size: 14px;
    color: var(--ink-500);
}

.home-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.home-actions .btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.kpi {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    padding: 18px 20px;
    box-shadow: var(--sh-sm);
}

.kpi .kh {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.kpi .klbl {
    font-size: 11px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ink-400);
    font-weight: 700;
}

.kpi .kic {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
}

.kic-violet {
    background: var(--v-50);
    color: var(--v-600);
}

.kic-green {
    background: var(--green-50);
    color: var(--green-600);
}

.kic-amber {
    background: var(--amber-50);
    color: var(--amber-600);
}

.kpi .kval {
    font-size: 30px;
    line-height: 1;
    font-weight: 800;
    color: var(--ink-900);
    letter-spacing: 0;
}

.kpi .kfoot {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    font-size: 12.5px;
    color: var(--ink-500);
    flex-wrap: wrap;
}

.delta {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: 700;
    font-size: 12px;
    padding: 2px 7px;
    border-radius: var(--r-pill);
}

.delta.up {
    color: var(--green-600);
    background: var(--green-50);
}

.delta.flat {
    color: var(--ink-500);
    background: var(--bg-2);
}

.tiles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
}

.tile {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    box-shadow: var(--sh-sm);
    overflow: hidden;
    transition: transform 0.16s, box-shadow 0.16s, border-color 0.16s;
}

.tile:hover {
    transform: translateY(-3px);
    box-shadow: var(--sh-md);
    border-color: var(--v-200);
}

.tile-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
}

.tile-ic {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 20px;
}

.tile--pos .tile-ic {
    background: linear-gradient(140deg, var(--v-500), var(--v-700));
}

.tile--prod .tile-ic {
    background: linear-gradient(140deg, #1fb877, #138a5b);
}

.tile--costos .tile-ic {
    background: linear-gradient(140deg, #e7a417, #cf8a00);
}

.tile h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: var(--ink-900);
    letter-spacing: 0;
}

.tile p {
    margin: 0;
    font-size: 13px;
    color: var(--ink-500);
    line-height: 1.45;
}

.tile-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 20px;
    border-top: 1px solid var(--line-2);
    background: #fcfcfe;
}

.tile-foot .st {
    font-size: 12px;
    color: var(--ink-500);
    display: flex;
    align-items: center;
    gap: 6px;
}

.tile-foot .go {
    color: var(--v-600);
    font-weight: 700;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 2px;
    white-space: nowrap;
}

.two-col {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
    gap: 16px;
}

.panel {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    box-shadow: var(--sh-sm);
    overflow: hidden;
}

.panel-head {
    padding: 16px 20px;
    border-bottom: 1px solid var(--line-2);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.panel-head h3 {
    margin: 0;
    font-size: 14.5px;
    font-weight: 700;
    color: var(--ink-900);
}

.panel-head .link {
    font-size: 12.5px;
    color: var(--v-600);
    font-weight: 600;
    text-decoration: none;
}

.panel-body {
    padding: 8px 12px;
}

.todo,
.sale-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: var(--r-md);
}

.todo:hover,
.sale-row:hover {
    background: var(--bg);
}

.ti,
.sale-m {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
}

.ti-green,
.m-ef {
    background: var(--green-50);
    color: var(--green-600);
}

.ti-amber {
    background: var(--amber-50);
    color: var(--amber-600);
}

.ti-violet,
.m-ta {
    background: var(--v-50);
    color: var(--v-600);
}

.ti-blue,
.m-tr {
    background: #e2f6fb;
    color: #0c93b4;
}

.m-ot {
    background: var(--bg-2);
    color: var(--ink-600);
}

.tt,
.sale-info {
    flex: 1;
    line-height: 1.2;
}

.tt strong,
.sale-info strong {
    display: block;
    font-size: 13.5px;
    color: var(--ink-900);
    font-weight: 600;
}

.tt span,
.sale-info span {
    font-size: 12px;
    color: var(--ink-500);
}

.sale-amt {
    font-weight: 700;
    font-size: 14px;
    color: var(--ink-900);
}

.home-empty {
    padding: 18px 12px;
    color: var(--ink-500);
    font-size: 13px;
}

.mobile-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: 74px;
    display: none;
    background: #fff;
    border-top: 1px solid var(--line);
    box-shadow: 0 -4px 16px rgba(40, 32, 90, 0.06);
    z-index: 40;
    padding: 8px 6px 14px;
}

.mobile-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    text-decoration: none;
    color: var(--ink-500);
    font-size: 15px;
    font-weight: 600;
    border-radius: 12px;
    min-height: 52px;
}

.mobile-nav-item i {
    font-size: 24px;
}

.mobile-nav-item.active {
    color: var(--v-600);
}

.costos-quick-nav {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.costos-quick-nav .btn {
    border-radius: var(--r-pill);
    border: 1px solid rgba(106, 90, 205, 0.2);
    background: rgba(255, 255, 255, 0.9);
    color: var(--ink-700);
}

.costos-quick-nav .btn.active,
.costos-quick-nav .btn:hover {
    background: var(--v-50);
    border-color: var(--v-200);
    color: var(--v-700);
}

.costos-hero {
    background: linear-gradient(135deg, rgba(106, 90, 205, 0.12), rgba(138, 127, 189, 0.12));
    border-radius: 18px;
}

.stat-pill {
    min-width: 140px;
    padding: 0.75rem 1rem;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(106, 90, 205, 0.18);
    text-align: center;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
    cursor: pointer;
}

.toggle-switch input[type="checkbox"] {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.toggle-slider {
    position: absolute;
    inset: 0;
    background-color: #ccc;
    border-radius: 26px;
    transition: background-color 0.3s ease;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: #fff;
    border-radius: 50%;
    transition: transform 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-switch input:checked + .toggle-slider {
    background-color: var(--v-500);
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(24px);
}

.toggle-switch input:focus + .toggle-slider {
    box-shadow: 0 0 0 3px rgba(106, 90, 205, 0.25);
}

.row-inactive {
    opacity: 0.5;
}

.row-inactive:hover {
    opacity: 0.75;
}

.articulo-card {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(106, 90, 205, 0.15);
    border-radius: 12px;
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.articulo-card:hover {
    box-shadow: 0 4px 12px rgba(106, 90, 205, 0.15);
    border-color: rgba(106, 90, 205, 0.3);
}

.articulo-nombre {
    font-weight: 500;
    color: var(--ink-900);
    font-size: 0.95rem;
}

.articulo-precio input {
    width: 110px;
    text-align: right;
    border-radius: 8px;
}

.floating-save-btn {
    position: fixed;
    right: 30px;
    bottom: 30px;
    z-index: 1000;
}

.floating-save-btn .btn {
    border-radius: 50px;
    padding: 12px 28px;
    box-shadow: 0 8px 25px rgba(106, 90, 205, 0.35);
}

.floating-save-btn .btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(106, 90, 205, 0.45);
}

.floating-help-btn {
    position: fixed;
    left: 30px;
    bottom: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--v-500), var(--v-700));
    color: #fff;
    border: none;
    font-size: 1.4rem;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(106, 90, 205, 0.35);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.floating-help-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 8px 25px rgba(106, 90, 205, 0.45);
}

.help-panel {
    position: fixed;
    top: 0;
    right: -380px;
    width: 350px;
    height: 100vh;
    background: #fff;
    box-shadow: -5px 0 30px rgba(0, 0, 0, 0.15);
    z-index: 1100;
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
}

.help-panel.open {
    right: 0;
}

.help-panel-header {
    background: linear-gradient(135deg, var(--v-500), var(--v-700));
    color: #fff;
    padding: 1.25rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.help-panel-header h5 {
    margin: 0;
    font-weight: 600;
}

.help-panel-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

.help-section {
    margin-bottom: 1.5rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid rgba(106, 90, 205, 0.1);
}

.help-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.help-section h6 {
    color: var(--v-600);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.help-section p {
    color: var(--ink-600);
    font-size: 0.9rem;
    margin: 0;
    line-height: 1.5;
}

.help-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1050;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.help-overlay.open {
    opacity: 1;
    visibility: visible;
}

.open-register-container {
    padding: 2rem 0;
}

.open-register-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto;
    background: linear-gradient(135deg, var(--v-500), var(--v-700));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 30px rgba(106, 90, 205, 0.28);
}

.open-register-icon i {
    font-size: 2.5rem;
    color: #fff;
}

.open-register-card,
.last-session-card {
    border: none;
    box-shadow: var(--sh-md);
}

.last-session-info {
    font-size: 0.95rem;
}

.session-header {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(248, 249, 250, 0.95));
    border: 1px solid rgba(106, 90, 205, 0.15);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

@media (max-width: 991px) {
    .topnav,
    .status-chip,
    .user-chip .um {
        display: none;
    }

    .user-chip {
        padding-right: 5px;
    }

    .page {
        padding: 24px 18px 104px;
    }

    .two-col {
        grid-template-columns: 1fr;
    }

    .mobile-nav {
        display: flex;
    }

    .production-header .btn-production {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .home-actions {
        width: 100%;
    }

    .home-actions .btn {
        flex: 1 1 100%;
        justify-content: center;
    }

    .table-responsive {
        overflow-x: auto;
        white-space: nowrap;
    }

    .table-responsive .cart-table {
        min-width: 500px;
    }

    .cart-product-col {
        min-width: 200px;
    }

    .cart-quantity-col {
        min-width: 120px;
    }

    .cart-action-col {
        min-width: 80px;
    }

    .cart-quantity-col .btn,
    .cart-action-col .btn {
        padding: 0.3rem 0.6rem;
        font-size: 0.9rem;
    }

    .cart-table thead {
        display: none;
    }

    .cart-table tr {
        display: block;
        border: 1px solid #ddd;
        border-radius: 8px;
        margin-bottom: 1rem;
        padding: 0.5rem;
    }

    .cart-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        border: none;
        padding: 0.3rem 0;
    }

    .cart-table td::before {
        content: attr(data-label);
        font-weight: bold;
        margin-right: 1rem;
    }

    .cart-table .cart-product-col {
        font-size: 1.1rem;
        font-weight: bold;
        justify-content: center;
        padding-bottom: 0.5rem;
        border-bottom: 1px solid #eee;
        margin-bottom: 0.5rem;
    }

    .cart-table .cart-product-col::before {
        display: none;
    }

    .cart-table .cart-quantity-col::before {
        content: "Cantidad:";
    }

    .cart-table .text-end::before {
        content: "Precio:";
    }

    .cart-table .cart-action-col::before {
        content: "Eliminar:";
    }

    .empty-cart-message {
        display: block;
        text-align: center;
        padding: 1.5rem;
        border: 1px dashed #ccc;
        border-radius: 8px;
        background-color: #f8f9fa;
    }

    .cart-updating {
        opacity: 0.5;
        transition: opacity 0.3s ease-in-out;
    }
}

@media (max-width: 576px) {
    .topbar-inner {
        padding: 10px 16px;
    }

    .page {
        padding: 20px 14px 104px;
    }

    .home-head h1 {
        font-size: 22px;
    }

    .kpi .kval {
        font-size: 24px;
    }

    .tile-foot,
    .todo,
    .sale-row {
        align-items: flex-start;
    }

    .tile-foot {
        flex-direction: column;
    }

    .help-panel {
        width: 100%;
        right: -100%;
    }

    .floating-help-btn {
        left: 20px;
        bottom: 92px;
        width: 45px;
        height: 45px;
    }

    .floating-save-btn {
        right: 20px;
        bottom: 92px;
    }
}

.session-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: rgba(40, 167, 69, 0.1);
    border-radius: 20px;
    color: #28a745;
}

.status-indicator {
    width: 10px;
    height: 10px;
    background: #28a745;
    border-radius: 50%;
    animation: pulse-green 2s infinite;
}

@keyframes pulse-green {
    0% { box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.7); }
    70% { box-shadow: 0 0 0 8px rgba(40, 167, 69, 0); }
    100% { box-shadow: 0 0 0 0 rgba(40, 167, 69, 0); }
}

.session-info-item {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: rgba(106, 90, 205, 0.08);
    border-radius: 15px;
    font-size: 0.9rem;
    color: #555;
}

.session-info-item i {
    color: var(--v-600);
}

.session-total {
    background: rgba(40, 167, 69, 0.1);
    color: #28a745;
}

.session-total i {
    color: #28a745;
}

/* POS - Product Cards */
.product-card {
    background: white;
    border: 1px solid rgba(106, 90, 205, 0.12);
    border-radius: 12px;
    padding: 12px;
    transition: all 0.2s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    border-color: rgba(106, 90, 205, 0.3);
    box-shadow: 0 4px 15px rgba(106, 90, 205, 0.12);
    transform: translateY(-2px);
}

.product-card-body {
    flex: 1;
    margin-bottom: 10px;
}

.product-card-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #1f1f2b;
    margin-bottom: 4px;
    line-height: 1.3;
}

.product-card-price {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--v-600);
    margin: 0;
}

.product-card.adding {
    animation: pulse-add 0.3s ease;
}

@keyframes pulse-add {
    0% { transform: scale(1); }
    50% { transform: scale(0.95); background: rgba(106, 90, 205, 0.1); }
    100% { transform: scale(1); }
}

/* Frequent Products */
.frequent-products-card {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.08), rgba(255, 193, 7, 0.02));
    border: 1px solid rgba(255, 193, 7, 0.2);
}

.product-quick-btn {
    background: white;
    border: 1px solid rgba(106, 90, 205, 0.2);
    border-radius: 10px;
    padding: 10px 8px;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.product-quick-btn:hover {
    background: rgba(106, 90, 205, 0.1);
    border-color: var(--v-600);
    transform: scale(1.02);
}

.product-quick-btn:active {
    transform: scale(0.98);
}

.product-quick-name {
    font-size: 0.75rem;
    font-weight: 600;
    color: #1f1f2b;
    text-align: center;
    line-height: 1.2;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-quick-price {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--v-600);
}

/* Search Input */
.search-input-wrapper {
    position: relative;
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #aaa;
}

.search-input {
    padding-left: 38px;
    padding-right: 30px;
    border-radius: 10px;
}

.search-clear {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #aaa;
    font-size: 1.2rem;
    line-height: 1;
}

.search-clear:hover {
    color: #666;
}

/* Cart Styles */
/* Sin sticky: la grilla ya scrollea sola y la lista de ventas, debajo, se le montaba encima. */
.cart-card {
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 250px);
}

.cart-header {
    border-bottom: 1px solid rgba(0,0,0,0.08);
}

.cart-items-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
    min-height: 200px;
    max-height: 450px;
}

.cart-footer {
    border-top: 1px solid rgba(0,0,0,0.08);
    background: #fafafa;
}

.cart-item {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 8px 10px;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.cart-item:last-child {
    margin-bottom: 0;
}

.cart-item-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.cart-item-name {
    font-weight: 600;
    font-size: 0.8rem;
    color: #1f1f2b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cart-item-price {
    font-size: 0.7rem;
}

.cart-item-controls {
    display: flex;
    align-items: center;
    gap: 6px;
}

.quantity-control {
    display: flex;
    align-items: center;
}

.quantity-control .btn {
    padding: 2px 6px;
    font-size: 0.75rem;
}

.quantity-control .form-control {
    width: 36px;
    text-align: center;
    padding: 2px 4px;
    font-size: 0.8rem;
    border-radius: 0;
    border-left: none;
    border-right: none;
}

.quantity-control .btn:first-child {
    border-radius: 6px 0 0 6px;
}

.quantity-control .btn:last-child {
    border-radius: 0 6px 6px 0;
}

.cart-item-subtotal {
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--v-600);
    min-width: 55px;
    text-align: right;
}

.cart-item .remove-from-cart {
    padding: 2px 6px;
    font-size: 0.7rem;
}

.cart-empty {
    text-align: center;
    padding: 30px 20px;
    color: #aaa;
}

.cart-empty i {
    font-size: 2.5rem;
    margin-bottom: 10px;
    display: block;
}

.cart-empty p {
    margin: 0;
    font-size: 0.95rem;
}

/* Cart add animation */
.cart-card.item-added {
    animation: cart-bounce 0.3s ease;
}

@keyframes cart-bounce {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); box-shadow: 0 0 20px rgba(106, 90, 205, 0.3); }
    100% { transform: scale(1); }
}

.text-primary-mate {
    color: var(--v-600) !important;
}

/* Recent Sales Card */
.recent-sales-card,
.summary-card {
    border: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.recent-sales-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sale-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: #f8f9fa;
    border-radius: 10px;
    transition: background 0.2s ease;
}

.sale-item:hover {
    background: #f0f0f5;
}

.sale-item-main {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
}

.sale-item-info {
    display: flex;
    flex-direction: column;
    min-width: 60px;
}

.sale-id {
    font-weight: 600;
    font-size: 0.85rem;
    color: #1f1f2b;
}

.sale-time {
    font-size: 0.75rem;
    color: #888;
}

.sale-item-details {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sale-method {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
}

.sale-method.method-efectivo {
    background: rgba(40, 167, 69, 0.15);
    color: #28a745;
}

.sale-method.method-tarjeta {
    background: rgba(13, 110, 253, 0.15);
    color: #0d6efd;
}

.sale-method.method-transferencia {
    background: rgba(13, 202, 240, 0.15);
    color: #0dcaf0;
}

.sale-method.method-otro {
    background: rgba(108, 117, 125, 0.15);
    color: #6c757d;
}

.sale-total {
    font-weight: 700;
    font-size: 0.95rem;
    color: #1f1f2b;
}

.sale-item-actions {
    display: flex;
    gap: 4px;
}

.sale-item-actions .btn {
    padding: 4px 8px;
    font-size: 0.75rem;
}

/* Summary Card */
.summary-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.summary-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 10px;
}

.summary-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.bg-success-subtle {
    background: rgba(40, 167, 69, 0.15);
}

.bg-primary-subtle {
    background: rgba(13, 110, 253, 0.15);
}

.bg-info-subtle {
    background: rgba(13, 202, 240, 0.15);
}

.bg-secondary-subtle {
    background: rgba(108, 117, 125, 0.15);
}

.summary-data {
    display: flex;
    flex-direction: column;
}

.summary-label {
    font-size: 0.75rem;
    color: #888;
}

.summary-value {
    font-weight: 600;
    font-size: 0.95rem;
    color: #1f1f2b;
}

.summary-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: var(--v-50);
    border-radius: 12px;
    color: white;
}

.summary-total span:first-child {
    font-size: 0.9rem;
}

.summary-total .total-value {
    font-size: 1.25rem;
    font-weight: 700;
}

/* All Sales Modal */
.all-sales-list {
    display: flex;
    flex-direction: column;
}

.all-sales-item {
    padding: 12px 20px;
    border-bottom: 1px solid #eee;
    transition: background 0.15s ease;
}

.all-sales-item:hover {
    background: #f8f9fa;
}

.all-sales-item:last-child {
    border-bottom: none;
}

.sale-row-main {
    display: flex;
    align-items: center;
    gap: 20px;
}

.sale-row-id {
    display: flex;
    flex-direction: column;
    min-width: 70px;
}

.sale-datetime {
    font-size: 0.75rem;
    color: #888;
}

.sale-row-method {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 130px;
}

.sale-method-text {
    font-size: 0.85rem;
    color: #555;
}

.sale-row-total {
    font-weight: 700;
    font-size: 1.1rem;
    color: #1f1f2b;
    min-width: 100px;
    text-align: right;
    flex: 1;
}

.sale-row-actions {
    display: flex;
    gap: 6px;
}

.sale-row-actions .btn {
    padding: 4px 8px;
}

/* Close Cash Register Modal */
.section-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #555;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #eee;
}

.close-summary-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 10px;
    height: 100%;
}

.close-summary-card .label {
    display: block;
    font-size: 0.7rem;
    color: #888;
    text-transform: uppercase;
}

.close-summary-card .value {
    display: block;
    font-weight: 700;
    font-size: 0.95rem;
    color: #1f1f2b;
}

.summary-icon-sm {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.close-sales-list {
    max-height: 180px;
    overflow-y: auto;
    background: #f8f9fa;
    border-radius: 10px;
    padding: 8px;
}

.close-sale-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 10px;
    background: white;
    border-radius: 8px;
    margin-bottom: 6px;
}

.close-sale-row:last-child {
    margin-bottom: 0;
}

.close-sale-row .sale-id {
    font-weight: 600;
    font-size: 0.8rem;
    min-width: 50px;
}

.close-sale-row .sale-time {
    font-size: 0.75rem;
    color: #888;
    min-width: 40px;
}

.close-sale-row .sale-total {
    font-weight: 700;
    margin-left: auto;
}

.calculation-grid {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 15px;
}

.calc-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px dashed #ddd;
}

.calc-row:last-child {
    border-bottom: none;
}

.calc-row.calc-expected {
    background: rgba(106, 90, 205, 0.1);
    margin: 10px -15px -15px -15px;
    padding: 12px 15px;
    border-radius: 0 0 10px 10px;
    border-bottom: none;
}

.calc-value {
    font-weight: 600;
}

.final-balance-input .form-control {
    font-size: 1.25rem;
    font-weight: 600;
}

.balance-diff {
    padding: 10px 15px;
    border-radius: 8px;
    font-weight: 600;
}

.balance-diff.positive {
    background: rgba(40, 167, 69, 0.15);
    color: #28a745;
}

.balance-diff.negative {
    background: rgba(220, 53, 69, 0.15);
    color: #dc3545;
}

.balance-diff.exact {
    background: rgba(106, 90, 205, 0.15);
    color: var(--v-600);
}

.close-total-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: var(--v-50);
    border-radius: 12px;
    color: white;
}

.close-total-banner span:first-child {
    font-size: 1rem;
}

.close-total-banner .total-value {
    font-size: 1.5rem;
    font-weight: 700;
}

/* Fix para modal de cerrar caja - footer siempre visible */
#closeCashRegisterModal .modal-content {
    display: flex;
    flex-direction: column;
    max-height: 90vh;
}

#closeCashRegisterModal form {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

#closeCashRegisterModal .modal-body {
    flex: 1;
    overflow-y: auto;
}

#closeCashRegisterModal .modal-footer {
    flex-shrink: 0;
    border-top: 1px solid #dee2e6;
    background: #fff;
}

/* Costos Inicio - Vista compacta */
.costos-inicio-view {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 180px);
    min-height: 400px;
}

.costos-table-container {
    flex: 1;
    overflow-y: auto;
    border-radius: 14px;
    border: 1px solid rgba(106, 90, 205, 0.12);
    background: rgba(255, 255, 255, 0.95);
}

.costos-table-container .table {
    margin-bottom: 0;
    border-spacing: 0;
}

.costos-table-container thead {
    position: sticky;
    top: 0;
    z-index: 10;
    background: rgba(248, 249, 250, 0.98);
    backdrop-filter: blur(4px);
}

.costos-table-container thead th {
    border-bottom: 1px solid rgba(106, 90, 205, 0.15);
    padding: 12px 16px;
}

.costos-table-container tbody tr {
    transition: background 0.15s ease;
    cursor: pointer;
}

.costos-table-container tbody tr:hover {
    background: rgba(106, 90, 205, 0.06);
}

.costos-table-container tbody td {
    padding: 10px 16px;
    vertical-align: middle;
}

.costos-search-wrapper {
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .costos-inicio-view {
        height: calc(100vh - 200px);
    }

    .costos-table-container tbody td,
    .costos-table-container thead th {
        padding: 8px 10px;
    }
}

@media (max-width: 768px) {

    .filters-row {
        align-items: stretch;
    }

}

@media (max-width: 360px) {
    .filters-row {
        flex-direction: column;
    }

}

/* =================================================================
   PRODUCCIÓN — Reporte (handoff redesign)
   Recreación fiel de produccion/index.html · produccion.css del
   bundle de diseño (violeta = acento, superficies blancas, bordes
   finos, sombras sutiles). Usa los tokens --v-*/--ink-*/--sh-*/--r-*
   ya declarados arriba en este archivo.
   ================================================================= */

.num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }

/* Page head, seg-tabs y toasts vivían acá duplicados: las únicas pantallas que
   los usan (base_pos.html, base_produccion.html) están dentro de .negocio-page,
   donde negocio.css los define con más especificidad y siempre ganaba.
   .toast-prod no lo usaba ningún template. */

/* ---- Reporte: "Producción de hoy" + mini-stats ---- */
.report-top {
    display: grid;
    grid-template-columns: 1.15fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}
.today {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    padding: 22px 24px;
    box-shadow: var(--sh-sm);
    display: flex;
    flex-direction: column;
}
.today-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: .78rem;
    font-weight: 600;
    color: var(--ink-500);
}
.today-eyebrow .sb-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--green-600);
    box-shadow: 0 0 0 3px var(--green-50);
}

.today-unit { font-size: 1rem; font-weight: 600; color: var(--ink-400); }
.today-sub { font-size: .85rem; color: var(--ink-500); }
.today-chips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 18px; }
.tchip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: var(--bg);
    border: 1px solid var(--line);
    padding: 5px 11px;
    border-radius: var(--r-pill);
    font-size: .8rem;
    color: var(--ink-600);
    font-weight: 500;
}
.tchip b { color: var(--v-700); font-weight: 700; }
.tchip-more { color: var(--ink-400); font-weight: 600; }

.mini-stat {
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    border-right: 1px solid var(--line-2);
    border-bottom: 1px solid var(--line-2);
}

.mini-stat .l { font-size: .74rem; color: var(--ink-500); font-weight: 500; }
.mini-stat .v { font-size: 1.5rem; font-weight: 800; color: var(--ink-900); letter-spacing: -.02em; }
.mini-stat .v.up { color: var(--green-600); }

@media (max-width: 920px) {
    .report-top { grid-template-columns: 1fr; }
}

/* ---- Panels (filtros / gráfico / tabla) ---- */
.panel {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    box-shadow: var(--sh-sm);
    overflow: hidden;
    margin-bottom: 16px;
}
.panel-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--line-2);
    gap: 10px;
    flex-wrap: wrap;
}
.panel-head h6 { margin: 0; font-weight: 700; color: var(--ink-900); font-size: .92rem; }
.panel-count { font-size: .78rem; color: var(--ink-500); white-space: nowrap; }
.chart-body { padding: 20px; height: 290px; }

/* ---- Filtros (chips de rango + inputs inline) ---- */
/* Renombrada: antes se llamaba .filters-row igual que la de la barra de carga
   (más arriba en este archivo) y, al estar definida después, le imponía su
   padding al workbar de add_produccion.html. */
.filters-row-report {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
    padding: 16px 20px;
}
.date-chips {
    display: inline-flex;
    background: var(--bg-2);
    border-radius: var(--r-pill);
    padding: 3px;
    gap: 2px;
    flex-wrap: wrap;
}
.date-chips .chip-btn {
    display: inline-flex;
    align-items: center;
    min-height: 48px;
    text-decoration: none;
    padding: 10px 18px;
    border: none;
    border-radius: var(--r-pill);
    background: transparent;
    color: var(--ink-700);
    font-size: 17px;
    font-weight: 600;
    cursor: pointer;
    transition: .15s;
}
.date-chips .chip-btn:hover { color: var(--ink-700); }
.date-chips .chip-btn.active { background: var(--v-600); color: #fff; box-shadow: var(--sh-xs); }
.filters-inline { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.filters-inline input[type="date"] {
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    padding: 8px 11px;
    font-size: .85rem;
    color: var(--ink-900);
    font-family: inherit;
    min-width: 0;
}
.filters-inline input[type="date"]:focus {
    outline: none;
    border-color: var(--v-400);
    box-shadow: 0 0 0 3px var(--v-50);
}
.date-arrow { color: var(--ink-400); font-size: .9rem; }
/* Autocomplete de producto (mantiene #productoSearch / #productoId / #autocompleteDropdown) */
.filter-product-wrap { position: relative; min-width: 200px; }
.filter-product-wrap .autocomplete-icon {
    position: absolute;
    left: 13px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--ink-400);
    font-size: 14px;
    pointer-events: none;
}
.filter-product {
    width: 100%;
    min-width: 180px;
    border: 1px solid var(--line);
    border-radius: var(--r-pill);
    padding: 8px 34px;
    font-size: .85rem;
    color: var(--ink-900);
    font-family: inherit;
    transition: .15s;
}
.filter-product::placeholder { color: var(--ink-400); }
.filter-product:focus {
    outline: none;
    border-color: var(--v-400);
    box-shadow: 0 0 0 3px var(--v-50);
}
.filter-product-clear {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: var(--bg-2);
    color: var(--ink-500);
    /* El botón visible sigue siendo chico, pero el área táctil llega a 32px:
       a 22×22 era el control más difícil de tocar de toda la app. */
    width: 32px;
    height: 32px;
    background-clip: content-box;
    padding: 5px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 11px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}
.autocomplete-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    box-shadow: var(--sh-md);
    z-index: 60;
    max-height: 280px;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity .15s, transform .15s, visibility .15s;
}
.autocomplete-dropdown.show { opacity: 1; visibility: visible; transform: translateY(0); }
.autocomplete-item {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 9px 13px;
    cursor: pointer;
    font-size: .85rem;
    color: var(--ink-700);
    transition: background .12s;
}
.autocomplete-item:hover, .autocomplete-item.highlighted { background: var(--v-50); color: var(--v-700); }
.autocomplete-item-icon {
    width: 26px;
    height: 26px;
    border-radius: var(--r-sm);
    background: var(--bg-2);
    color: var(--ink-400);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    flex: none;
}
.autocomplete-item.highlighted .autocomplete-item-icon,
.autocomplete-item:hover .autocomplete-item-icon { background: var(--v-100); color: var(--v-600); }
.autocomplete-item mark { background: var(--v-100); color: var(--v-700); border-radius: 3px; padding: 0 1px; }
.autocomplete-empty {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 16px 13px;
    color: var(--ink-400);
    font-size: .85rem;
}

/* ---- Tabla de detalle ---- */
/* .ptable, .pagination-prod, .no-results-prod y .btn-filter se eliminaron:
   producción ahora usa .neg-table, .pager y .empty de negocio.css, que ya
   hacían lo mismo. Sólo queda lo que no tiene equivalente ahí. */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
/* Siempre visibles: con opacity 0 + hover no se veían en el celular. */
.row-actions { display: inline-flex; gap: 4px; }
.btn-act {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: var(--r-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: .15s;
    background: transparent;
    color: var(--ink-500);
}
.btn-act-edit:hover { background: var(--v-50); color: var(--v-600); }
.btn-act-del:hover { background: var(--red-50); color: var(--red-600); }

/* ---- Modales ligeros (Editar / Eliminar) ---- */
.modal-content-prod {
    border: none;
    border-radius: var(--r-lg);
    box-shadow: var(--sh-lg);
    overflow: hidden;
}
.modal-head-prod {
    padding: 18px 22px 4px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    border: none;
}
.modal-head-prod h5 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--ink-900);
    display: flex;
    align-items: center;
    gap: 9px;
}
.modal-head-prod.danger h5 { color: var(--red-600); }
.modal-body-prod { padding: 14px 22px 4px; }
.modal-foot-prod { padding: 18px 22px; display: flex; justify-content: flex-end; gap: 10px; border: none; }
.edit-field { display: flex; flex-direction: column; gap: 7px; }
.edit-field label { font-size: 17px; font-weight: 700; color: var(--ink-900); }
.edit-cant { display: flex; gap: 8px; }
.edit-cant input { flex: 1; min-width: 0; }
.edit-cant .carga-btn { width: 56px; border: 1px solid var(--line); border-radius: var(--r-sm); }
.borrar-confirma { margin-top: 16px; padding: 14px; border-radius: var(--r-sm); background: var(--red-50); display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.borrar-confirma[hidden] { display: none; }
.borrar-confirma p { margin: 0; width: 100%; font-size: 16px; }
.edit-field input {
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    padding: 14px;
    font-size: 1.4rem;
    font-weight: 700;
    text-align: center;
    color: var(--ink-900);
    width: 100%;
    font-variant-numeric: tabular-nums;
}
.edit-field input:focus {
    outline: none;
    border-color: var(--v-400);
    box-shadow: 0 0 0 3px var(--v-50);
}

/* ---- Responsive: Reporte ---- */
/* Los botones de fila se revelaban con :hover y sólo se forzaban visibles por
   debajo de 768px, así que en una tablet apaisada (sin hover) quedaban
   invisibles. La condición correcta es la capacidad del dispositivo. */
@media (hover: none) {
    .row-actions { opacity: 1; }
}
@media (max-width: 768px) {
    .btn-act { width: 44px; height: 44px; }
}
@media (max-width: 680px) {
    .filters-row-report { flex-direction: column; align-items: stretch; }
    .filters-inline { justify-content: space-between; }
    .filter-product-wrap { flex: 1; min-width: 0; }

}

/* El panel del selector recorta su contenido (overflow: hidden, heredado de
   .panel para redondear las esquinas), lo que clipea el dropdown del
   autocompletado justo donde empieza la siguiente card — dando la sensación
   de que "el gráfico tapa el selector". El selector no tiene contenido propio
   que necesite ese recorte, así que lo desactivamos acá y dejamos que el
   dropdown (position:absolute{
    overflow: visible;
    position: relative;
    z-index: 5;
}

/* Encabezado del producto seleccionado */
.compare-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    box-shadow: var(--sh-sm);
    padding: 22px 24px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.compare-eyebrow {
    display: block;
    font-size: .76rem;
    font-weight: 600;
    color: var(--ink-500);
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-bottom: 4px;
}
.compare-head h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -.02em;
    color: var(--ink-900);
}
.compare-sub { margin: 4px 0 0; font-size: .85rem; color: var(--ink-500); }
.compare-month-name { display: block; font-size: .72rem; color: var(--ink-400); margin-top: 2px; }

.compare-trend {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 15px;
    border-radius: var(--r-pill);
    font-weight: 700;
    font-size: .84rem;
    white-space: nowrap;
}
.compare-trend.trend-up { background: var(--green-50); color: var(--green-600); }
.compare-trend.trend-down { background: var(--red-50); color: var(--red-600); }
.compare-trend.trend-equal { background: var(--bg-2); color: var(--ink-500); }

/* Detalle por mes */
.month-list { display: flex; flex-direction: column; }
.month-row {
    display: grid;
    grid-template-columns: minmax(112px, .9fr) 2fr auto auto;
    align-items: center;
    gap: 14px;
    padding: 12px 20px;
    border-bottom: 1px solid var(--line-2);
    transition: background .12s;
}
.month-row:last-child { border-bottom: none; }
.month-row:hover { background: var(--bg); }
.month-row-latest { background: var(--v-50); }
.month-row-latest:hover { background: var(--v-50); }
.month-name {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    font-weight: 600;
    color: var(--ink-900);
    font-size: .87rem;
}
.month-badge {
    font-size: .63rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .03em;
    padding: 2px 7px;
    border-radius: var(--r-pill);
    background: var(--v-600);
    color: #fff;
    line-height: 1.5;
}
.month-badge-best { background: var(--amber-600); }
.month-bar-track {
    height: 8px;
    background: var(--bg-2);
    border-radius: var(--r-pill);
    overflow: hidden;
}
.month-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--v-400), var(--v-600));
    border-radius: var(--r-pill);
}
.month-value {
    font-weight: 700;
    color: var(--v-700);
    font-size: .94rem;
    text-align: right;
    min-width: 48px;
}

@media (max-width: 768px) {
    .compare-head { flex-direction: column; align-items: flex-start; }

}

@media (max-width: 640px) {
    .month-row {
        grid-template-columns: 1fr auto;
        grid-template-areas:
            "name value"
            "bar  bar"
            "delta delta";
        row-gap: 8px;
    }
    .month-name { grid-area: name; }
    .month-value { grid-area: value; }
    .month-bar-track { grid-area: bar; }

}

/* ==========================================================================
   Inicio: resumen de la fábrica. Letra grande y pocas cosas: lo usan personas
   que quieren saber cómo viene el negocio, no analizarlo.
   ========================================================================== */
.resumen {
    max-width: 980px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.resumen-head h1 {
    margin: 0;
    font-size: 30px;
    font-weight: 800;
    color: var(--ink-900);
}

.resumen-head p {
    margin: 4px 0 0;
    font-size: 17px;
    color: var(--ink-600);
}

.resumen-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
    gap: 16px;
}

/* Inicio: un solo botón grande para cargar, que dice a qué día va. */
.btn-cargar-hoy {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    min-height: 64px;
    margin-bottom: 16px;
    border-radius: var(--r-lg);
    font-size: 20px;
    font-weight: 700;
}
.btn-cargar-hoy i { font-size: 24px; }

.tarjeta {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    box-shadow: var(--sh-sm);
    padding: 22px 24px;
    min-width: 0;
}

.tarjeta h2 {
    margin: 0 0 14px;
    font-size: 19px;
    font-weight: 800;
    color: var(--ink-900);
}

.dato {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
}

.dato-mes {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid var(--line-2);
}

.dato-l {
    font-size: 16px;
    font-weight: 600;
    color: var(--ink-600);
}

.dato-v {
    font-size: 36px;
    line-height: 1.1;
    font-weight: 800;
    color: var(--ink-900);
}

.dato-v small,
.meses small {
    font-size: 16px;
    font-weight: 600;
    color: var(--ink-500);
}

.dato-nota,
.tarjeta-pie {
    font-size: 15px;
    color: var(--ink-600);
}

.tarjeta-pie {
    margin: 14px 0 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px 16px;
    flex-wrap: wrap;
}

.aviso {
    margin: 0;
    padding: 14px 18px;
    border-radius: var(--r-md);
    background: var(--green-50);
    color: #0f7a50;
    font-size: 17px;
    font-weight: 600;
}

.aviso-error { background: var(--red-50); color: #a3293c; }

.dato-falta {
    margin: 0;
    font-size: 18px;
    color: var(--ink-600);
}

.estado {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 12px;
    border-radius: var(--r-pill);
    font-size: 16px;
    font-weight: 700;
}

.estado-mejor { background: var(--green-50); color: #0f7a50; }
.estado-menos { background: var(--amber-50); color: #8a5a00; }
.estado-parecido { background: var(--bg-2); color: var(--ink-700); }

.desglose {
    list-style: none;
    margin: 16px 0 0;
    padding: 0;
}

.desglose li {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 0;
    border-top: 1px solid var(--line-2);
    font-size: 17px;
    color: var(--ink-700);
}

.ranking {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.ranking li {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px 12px;
    font-size: 17px;
    color: var(--ink-900);
}

.ranking-nombre { overflow-wrap: anywhere; }
.ranking .barra { grid-column: 1 / -1; }

.barra {
    display: block;
    height: 8px;
    border-radius: var(--r-pill);
    background: var(--bg-2);
    overflow: hidden;
}

.barra i {
    display: block;
    height: 100%;
    border-radius: var(--r-pill);
    background: var(--v-500);
}

.meses {
    width: 100%;
    border-collapse: collapse;
    font-size: 17px;
}

.meses th {
    padding: 0 0 8px;
    font-size: 15px;
    font-weight: 600;
    color: var(--ink-600);
    text-align: left;
}

.meses td {
    padding: 12px 0;
    border-top: 1px solid var(--line-2);
    color: var(--ink-900);
    white-space: nowrap;
}

.meses .der { text-align: right; padding-left: 20px; }
.meses .col-barra { width: 28%; padding-left: 24px; }

.solo-cel { display: none; }

@media (max-width: 576px) {
    .resumen-head h1 { font-size: 26px; }
    .tarjeta { padding: 18px 16px; }
    .dato-v { font-size: 31px; }
    /* En el celular cada mes es un renglón propio: una tabla de tres
       columnas no entra y obligaba a deslizar de costado. */
    .meses thead,
    .meses .col-barra { display: none; }
    .meses,
    .meses tbody { display: block; }
    .meses tr {
        display: flex;
        flex-direction: column;
        gap: 3px;
        padding: 12px 0;
        border-top: 1px solid var(--line-2);
    }
    .meses td { padding: 0; border: 0; white-space: normal; }
    .meses td:first-child { font-weight: 700; }
    .meses .der { text-align: left; padding-left: 0; }
    .solo-cel { display: inline; color: var(--ink-600); }
}

/* ==========================================================================
   Cargar producción. Lista de una columna (nombre cerca de su cantidad) y un
   panel fijo a la derecha con el día, lo anotado y Guardar, como una caja.
   En el celular: día arriba, lista, y Guardar en una barra abajo.
   ========================================================================== */
.carga {
    display: grid;
    grid-template-columns: minmax(0, 680px) 340px;
    gap: 20px;
    align-items: start;
    max-width: 1180px;
}

.carga-main { min-width: 0; display: flex; flex-direction: column; gap: 10px; }

.carga-buscar { position: sticky; top: 8px; z-index: 5; }
.carga-buscar i { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--ink-400); font-size: 17px; }
.carga-buscar input {
    width: 100%;
    height: 50px;
    padding: 0 16px 0 44px;
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    background: #fff;
    font: inherit;
    font-size: 17px;
    color: var(--ink-900);
    box-shadow: var(--sh-sm);
}
.carga-buscar input:focus { outline: none; border-color: var(--v-400); box-shadow: 0 0 0 3px var(--v-100); }

.carga-lista {
    list-style: none;
    margin: 0;
    padding: 0;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    overflow: hidden;
}

.carga-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 7px 10px 7px 18px;
    border-bottom: 1px solid var(--line-2);
}
.carga-item:last-child { border-bottom: none; }
.carga-item:hover { background: var(--bg); }
.carga-item[hidden] { display: none; }

/* Los nombres vienen mezclados (MIGA JAMON… / miga jyq); se muestran igual. */
.carga-nombre {
    flex: 1;
    min-width: 0;
    font-size: 16px;
    font-weight: 500;
    color: var(--ink-700);
    text-transform: lowercase;
}
.carga-nombre::first-letter { text-transform: uppercase; }

/* − cantidad + como un solo control. */
.carga-cant {
    display: inline-flex;
    align-items: stretch;
    flex-shrink: 0;
    height: 48px;
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    background: #fff;
    overflow: hidden;
}
.carga-cant input {
    width: 56px;
    border: none;
    border-left: 1px solid var(--line-2);
    border-right: 1px solid var(--line-2);
    border-radius: 0;
    padding: 0;
    text-align: center;
    font-size: 17px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--ink-500);
    background: transparent;
    box-shadow: none;
    -moz-appearance: textfield;
}
.carga-cant input::-webkit-inner-spin-button,
.carga-cant input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.carga-cant input:focus { outline: none; color: var(--ink-900); background: var(--v-50); box-shadow: none; }
.carga-cant:focus-within { border-color: var(--v-400); box-shadow: 0 0 0 3px var(--v-100); }

.carga-btn {
    width: 48px;
    border: none;
    background: transparent;
    color: var(--ink-500);
    font-size: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.carga-btn:hover { background: var(--v-50); color: var(--v-700); }
.carga-btn:focus-visible { outline: 2px solid var(--v-400); outline-offset: -2px; }

.carga-item.tiene .carga-nombre { color: var(--ink-900); font-weight: 700; }
.carga-item.tiene .carga-cant { border-color: var(--v-400); }
.carga-item.tiene .carga-cant input { color: var(--v-700); background: var(--v-50); }

.carga-vacio { margin: 0; padding: 28px; text-align: center; color: var(--ink-500); background: #fff; border: 1px solid var(--line); border-radius: var(--r-md); }

/* Panel lateral */
.carga-lado {
    position: sticky;
    top: 8px;
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    box-shadow: var(--sh-sm);
    max-height: calc(100vh - 16px);
}
.carga-dia { padding: 16px 18px; border-bottom: 1px solid var(--line-2); display: flex; flex-direction: column; gap: 8px; }
.carga-dia-t { font-size: 17px; font-weight: 700; color: var(--ink-900); }
.carga-dias { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.carga-diab {
    min-height: 60px;
    border: 2px solid var(--line);
    border-radius: var(--r-sm);
    background: #fff;
    font: inherit;
    font-size: 19px;
    font-weight: 700;
    color: var(--ink-900);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    line-height: 1.2;
}
.carga-diab small { font-size: 14px; font-weight: 500; color: var(--ink-600); }
.carga-diab.activo { background: var(--v-600); border-color: var(--v-600); color: #fff; }
.carga-diab.activo small { color: #fff; }
.carga-otro { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 16px; font-weight: 600; color: var(--ink-600); }
.carga-otro.activo { color: var(--v-700); }
.carga-otro input { flex: 1; min-width: 0; }
.carga-ya { display: block; margin-top: 2px; font-size: 14px; font-weight: 600; color: var(--green-600); text-transform: none; }
.carga-mas { margin: 0; padding: 14px 18px; font-size: 16px; color: var(--ink-600); }
.carga-mas[hidden] { display: none; }
.carga-dia input {
    height: 46px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    background: var(--bg);
    font: inherit;
    font-size: 17px;
    font-weight: 600;
    color: var(--ink-900);
}
.carga-dia input:focus { outline: none; border-color: var(--v-400); box-shadow: 0 0 0 3px var(--v-100); }
.carga-aviso { margin: 0; font-size: 14px; line-height: 1.4; color: var(--ink-500); }
.carga-aviso i { color: var(--green-600); }
.carga-aviso a { font-weight: 700; color: var(--v-700); }

.carga-anotado { padding: 14px 18px; overflow-y: auto; min-height: 0; flex: 1; }
.carga-anotado h2 { margin: 0 0 6px; font-size: 13px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-500); }
.carga-anotado ul { list-style: none; margin: 0; padding: 0; }
.carga-anotado li { display: flex; align-items: center; gap: 10px; padding: 4px 0; font-size: 15px; border-bottom: 1px dashed var(--line); }
.carga-anotado li span { flex: 1; min-width: 0; }
.carga-anotado li span { text-transform: lowercase; color: var(--ink-700); }
.carga-anotado li span::first-letter { text-transform: uppercase; }
.carga-anotado li b { color: var(--v-700); font-variant-numeric: tabular-nums; }
.carga-anotado-vacio { margin: 4px 0 0; font-size: 14px; color: var(--ink-400); }

.carga-guardar {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 14px 18px 18px;
    border-top: 1px solid var(--line-2);
}
.carga-total {
    border: none;
    background: none;
    padding: 0;
    text-align: left;
    font: inherit;
    font-weight: 700;
    color: var(--ink-700);
    font-variant-numeric: tabular-nums;
    cursor: default;
}
.carga-ver { display: none; }
.carga-quitar {
    border: none;
    background: none;
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    border-radius: var(--r-sm);
    color: var(--ink-400);
    cursor: pointer;
}
.carga-quitar:hover { background: var(--red-50); color: var(--red-600); }
.carga-guardar .btn { min-height: 50px; font-size: 17px; justify-content: center; width: 100%; }

.carga-resumen { list-style: none; margin: 0; padding: 0; }
.carga-resumen li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line-2); font-size: 16px; }
.carga-resumen li span,
.nombre-prod { text-transform: lowercase; }
.carga-resumen li span::first-letter,
.nombre-prod::first-letter { text-transform: uppercase; }
.carga-resumen li:last-child { border-bottom: none; }
.carga-resumen b { color: var(--v-700); }

@media (max-width: 991px) {
    .carga { grid-template-columns: minmax(0, 1fr); gap: 10px; padding-bottom: 150px; }
    .carga-lado { display: contents; }
    .carga-dia {
        order: -1;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        padding: 10px 14px;
        background: #fff;
        border: 1px solid var(--line);
        border-radius: var(--r-md);
    }
    .carga-dia input { height: 42px; flex: 1; min-width: 0; }
    .carga-aviso { flex-basis: 100%; }
    /* Lista de lo anotado: se abre desde la barra de abajo, como una hoja. */
    .carga-anotado {
        display: none;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 140px;
        z-index: 44;
        max-height: 55vh;
        padding: 16px 18px 12px;
        background: #fff;
        border-top: 1px solid var(--line);
        border-radius: var(--r-lg) var(--r-lg) 0 0;
        box-shadow: 0 -12px 32px rgba(40, 32, 90, .16);
    }
    .carga-lado.abierto .carga-anotado { display: block; }
    .carga-total { cursor: pointer; display: flex; flex-direction: column; gap: 2px; }
    .carga-total:disabled { cursor: default; }
    .carga-total:not(:disabled) .carga-ver { display: inline-flex; gap: 5px; align-items: center; font-size: 14px; font-weight: 700; color: var(--v-700); }
    .carga-lado.abierto .carga-ver i { transform: rotate(180deg); }
    .carga-guardar {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 74px;
        z-index: 45;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        padding: 10px 16px;
        background: #fff;
        border-top: 1px solid var(--line);
        box-shadow: 0 -4px 16px rgba(40, 32, 90, .06);
    }
    .carga-guardar .btn { width: auto; min-height: 46px; padding: 0 24px; }
}

@media (max-width: 640px) {
    .carga-item { gap: 10px; padding: 6px 6px 6px 14px; }
    .carga-cant input { width: 52px; }
}

/* Filtros de Lo cargado en el celular: cada cosa en su renglón, nada tapado. */
@media (max-width: 640px) {
    .filters-row-report { padding: 12px; }
    .date-chips { display: grid; grid-template-columns: repeat(3, 1fr); width: 100%; border-radius: var(--r-md); }
    .date-chips .chip-btn { min-height: 44px; padding: 6px 4px; }
    .filters-inline { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
    .filters-inline input[type="date"] { width: 100%; min-height: 44px; }
    .filters-inline .date-arrow { display: none; }
    .filters-inline .filter-product-wrap,
    .filters-inline .btn { grid-column: 1 / -1; }
    .filters-inline .btn { justify-content: center; min-height: 44px; }
}

/* Ventas del día en el POS: en el celular los botones bajan de renglón en vez
   de empujar la pantalla hacia el costado. */
@media (max-width: 640px) {
    .sale-row { flex-wrap: wrap; }
    .sale-row-main { flex-wrap: wrap; gap: 6px 14px; min-width: 0; }
    .sale-row-actions { width: 100%; justify-content: flex-end; }
}

/* ==========================================================================
   Caja (Punto de venta): cabecera de una línea, cobro con vuelto, cierre
   corto y, en el celular, barra fija con el total y Cobrar.
   ========================================================================== */
.caja-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 10px;
    padding: 10px 14px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--r-md);
}
.caja-estado { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; color: var(--ink-700); }

.cobro-titulo { margin: 14px 0 6px; font-weight: 700; color: var(--ink-700); display: block; }
.cobro-titulo:first-child { margin-top: 0; }
.cobro-titulo small { font-weight: 500; color: var(--ink-400); }
.cobro-lista { list-style: none; margin: 0; padding: 0; max-height: 30vh; overflow-y: auto; }
.cobro-lista li { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--line-2); font-size: 15px; }
.cobro-metodos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.cobro-metodos .btn, .negocio-page .cobro-metodos .btn { border: 2px solid var(--line); background: #fff; color: var(--ink-700); font-size: 15px; padding: 12px 6px; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.cobro-metodos .btn i { font-size: 22px; }
.cobro-metodos .btn-check:checked + .btn, .negocio-page .cobro-metodos .btn-check:checked + .btn { border-color: var(--v-600); background: var(--v-600); color: #fff; } /* elegido = lleno, que no haya dudas */
.cobro-vuelto[hidden] { display: none; }
.cobro-vuelto-res { margin: 10px 0 0; font-size: 24px; font-weight: 800; color: var(--green-700, #147a52); }
.cobro-vuelto-res.falta { color: var(--red-600); }

.cierre-fila { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-2); font-size: 16px; }
.cierre-fila strong { font-size: 20px; color: var(--ink-900); white-space: nowrap; }
.cierre-fila small { display: block; font-size: 13px; color: var(--ink-500); }
.cierre-esperado strong { color: var(--v-700); }
.balance-diff { font-size: 20px; font-weight: 800; }

.pos-toast { bottom: 0; z-index: 1090; }
.pos-barra { display: none; }

@media (max-width: 767px) {
    .pos-grid { max-height: none !important; overflow: visible !important; }
    .pos-barra:not([hidden]) {
        display: flex;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 74px;
        z-index: 45;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding: 10px 16px;
        background: #fff;
        border-top: 1px solid var(--line);
        box-shadow: 0 -4px 16px rgba(40, 32, 90, .08);
        font-size: 16px;
    }
    .pos-toast { bottom: 150px; }
    .cobro-metodos .btn { font-size: 14px; }
}

/* Corregir venta en el celular: producto, cantidad y sacar, sin scroll lateral. */
@media (max-width: 575px) {
    .edit-venta th, .edit-venta td { padding-left: 6px; padding-right: 6px; }
    .edit-venta td:first-child { word-break: break-word; }
}

/* ==========================================================================
   Gráficos de Inicio: torta de "dónde se vendió" y líneas mes por mes.
   ========================================================================== */
.donde { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line-2); }
.donde h3 { margin: 0 0 10px; font-size: 16px; font-weight: 700; color: var(--ink-700); }
.donde-cuerpo { display: flex; align-items: center; gap: 18px; }
.torta { width: 120px; height: 120px; flex-shrink: 0; position: relative; }
.donde .desglose { flex: 1; min-width: 0; margin: 0; }
.donde .desglose li { align-items: center; }
.donde .desglose li:first-child { border-top: none; }
.donde .desglose li > span { flex: 1; }
.donde .desglose li > span b { color: var(--ink-900); }
.muestra { width: 12px; height: 12px; border-radius: 3px; flex-shrink: 0; }
.grafico { position: relative; height: 220px; }
.grafico-chico { height: 180px; }
.meses-detalle summary { cursor: pointer; font-weight: 700; color: var(--v-700); font-size: 16px; }
.meses-detalle[open] summary { margin-bottom: 12px; }
@media (max-width: 480px) {
    .donde-cuerpo { flex-direction: column; align-items: stretch; }
    .torta { align-self: center; width: 140px; height: 140px; }
    .grafico { height: 200px; }
}


/* ==========================================================================
   Caja: alineada al resto del sistema (tarjetas blancas de borde fino, violeta
   de marca) y con controles grandes para dedos y ojos grandes.
   ========================================================================== */
.product-card, .cart-card, .recent-sales-card, .summary-card { border: 1px solid var(--line); box-shadow: none; border-radius: var(--r-md); }
.pos-grid .product-card-title { font-size: .95rem; text-transform: none; }
.product-card-price, .cart-item-subtotal { color: var(--v-600); }
.summary-total { color: var(--v-700); }
.product-card.en-venta { border: 2px solid var(--v-600); position: relative; }
.product-card.en-venta::after { content: attr(data-cant); position: absolute; top: 6px; right: 8px; background: var(--v-600); color: #fff; border-radius: 99px; padding: 0 8px; font-weight: 700; font-size: .85rem; }

.quantity-control .btn { min-width: 40px; min-height: 40px; font-size: 1.1rem; }
.quantity-control .form-control { width: 48px; min-height: 40px; font-size: 1rem; }
.cart-item .remove-from-cart { min-width: 40px; min-height: 40px; }
.cart-item-name { font-size: .95rem; white-space: normal; }
.cart-item-price { font-size: .85rem; }

.caja-head { flex-wrap: nowrap; padding: 6px 12px; }
.caja-head .btn { padding: 6px 12px; font-size: 14px; white-space: nowrap; }

.venta-fila { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 2px; border-bottom: 1px solid var(--line-2); color: var(--ink-700); text-decoration: none; font-size: 15px; }
.venta-fila:last-child { border-bottom: none; }
.venta-fila:hover { background: var(--bg); color: var(--ink-900); }
.venta-fila b { color: var(--ink-900); white-space: nowrap; }
.vendido-total { display: flex; justify-content: space-between; align-items: baseline; font-size: 17px; font-weight: 700; color: var(--ink-700); }
.vendido-total b { font-size: 22px; color: var(--v-700); }
.vendido-metodos { list-style: none; margin: 8px 0 0; padding: 0; }
.vendido-metodos li { display: flex; justify-content: space-between; padding: 4px 0; color: var(--ink-600); font-size: 15px; }

.edit-venta { white-space: normal; }
.edit-venta .quantity-input { min-height: 44px; font-size: 1rem; }

@media (max-width: 767px) {
    .cart-card { max-height: none; }
    .page:has(.pos-barra:not([hidden])) { padding-bottom: 170px; }
}
@media (max-height: 700px) {
    .cobro-lista { max-height: 18vh; }
}
.product-card.en-venta .product-card-title { padding-right: 38px; }
.pos-grid .product-card-title, .cart-item-name, .cobro-lista li span { text-transform: lowercase; }
.pos-grid .product-card-title::first-letter, .cart-item-name::first-letter, .cobro-lista li span::first-letter { text-transform: uppercase; }
.pos-grid .product-card-title, .cart-item-name { display: block; }

input[type=checkbox] { accent-color: var(--v-600); }
.sub-h { font-size: 13px; font-weight: 500; color: var(--ink-500); }
.grafico-cab { display: flex; justify-content: space-between; align-items: baseline; gap: 10px 16px; flex-wrap: wrap; }
.leyenda { list-style: none; margin: 0 0 8px; padding: 0; display: flex; gap: 16px; color: var(--ink-700); font-weight: 600; font-size: 15px; }
.leyenda li { display: flex; align-items: center; gap: 6px; }

/* Salir siempre a la vista (antes escondido en un menú del avatar). */
.topbar-right { display: flex; align-items: center; gap: 12px; }
.user-nombre { color: #fff; font-size: 15px; font-weight: 600; }
.salir { min-height: 44px; padding: 8px 16px; border: 0; border-radius: var(--r-pill); background: rgba(255, 255, 255, .14); color: #fff; font-size: 16px; font-weight: 600; white-space: nowrap; }
.salir:hover { background: rgba(255, 255, 255, .24); }
.btn-grande { min-height: 48px; font-size: 16px; }
@media (max-width: 520px) { .user-nombre { display: none; } }

/* Caja: nombre a todo el ancho y controles abajo, en cualquier pantalla (en tablet la
   columna del carrito es angosta y el nombre desaparecía). Montos rápidos; vuelto final. */
.cart-item { flex-wrap: wrap; }
.cart-item-info { flex-basis: 100%; }
.cart-item-controls { width: 100%; justify-content: space-between; flex-wrap: wrap; } /* en tablet la × se salía del carrito */
/* Celular: la barra de abajo ya tiene total y Cobrar; no repetirlos en el carrito. */
@media (max-width: 767px) { .cart-footer { display: none; } }
/* Botones principales (Cobrar, Abrir y Cerrar caja, montos): letra grande en toda la app. */
.btn-lg { font-size: 18px; min-height: 52px; }
.caja-vieja { color: #8a5a00; background: var(--amber-50, #fdf6e7); border: 1px solid var(--amber-200, #f3d9a4); border-radius: 10px; padding: 6px 12px; }
.cobro-rapidos { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 8px 0; }
.cobro-rapidos:empty { display: none; }
.cobro-listo { text-align: center; font-size: 20px; font-weight: 700; color: var(--ink-700); margin: 8px 0 0; }
.cobro-vuelto-final { text-align: center; font-size: 40px; }
.nombre-prod { text-transform: lowercase; }
.nombre-prod::first-letter { text-transform: uppercase; }
.otras-fechas { margin-top: 12px; border-top: 1px solid var(--line-2); padding-top: 10px; }
.otras-fechas summary { cursor: pointer; font-weight: 600; color: var(--v-600); min-height: 44px; display: flex; align-items: center; }
.btn-corregir { min-height: 44px; padding: 6px 14px; font-weight: 600; color: var(--v-700); }
/* Hoja "Vas anotando": fondo oscurecido detrás; tocarlo la cierra. */
@media (max-width: 991px) {
    .carga-lado.abierto::before { content: ""; position: fixed; inset: 0; z-index: 43; background: rgba(0, 0, 0, .35); }
}
.carga-resumen-total { border-top: 2px solid var(--line); font-size: 17px; }
span.nombre-prod { display: inline-block; }
.cobro-listo-solo { font-size: 26px; padding: 24px 0; color: var(--green-600, #1f8a4c); }
/* Inicio: lo que falta cobrar del reparto */
.por-cobrar { margin-top: 14px; border: 1px solid var(--amber-200, #f3d9a4); background: var(--amber-50, #fdf6e7); border-radius: 12px; }
.por-cobrar summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 52px; padding: 10px 14px; font-size: 16px; color: var(--ink-900); }
.por-cobrar summary::-webkit-details-marker { display: none; }
.por-cobrar summary small { color: var(--ink-600); }
.por-cobrar[open] summary i { transform: rotate(180deg); }
.por-cobrar ul { list-style: none; margin: 0; padding: 0 14px 8px; max-height: 360px; overflow-y: auto; }
.por-cobrar li { display: flex; justify-content: space-between; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line-2); }
.por-cobrar li small { display: block; color: var(--ink-500); font-size: 13px; }
.por-cobrar li b { white-space: nowrap; }
.venta-fila-wrap { display: flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--line-2); }
.venta-fila-wrap:last-child { border-bottom: none; }
.venta-fila-wrap .venta-fila { flex: 1; border-bottom: none; }
.btn-repetir { min-height: 40px; padding: 4px 10px; font-size: 14px; white-space: nowrap; }
/* Ventas de la caja: cada una se abre ahí mismo (qué llevó, repetir, corregir, borrar). */
.ventas-titulo { margin: 14px 0 0; padding-top: 12px; border-top: 1px solid var(--line-2); font-weight: 700; color: var(--ink-700); }
.ventas-titulo small { font-weight: 500; color: var(--ink-500); }
.venta { border-bottom: 1px solid var(--line-2); }
.venta:last-child { border-bottom: none; }
.venta > summary { list-style: none; cursor: pointer; min-height: 48px; border-bottom: none; }
.venta > summary::-webkit-details-marker { display: none; }
.venta > summary .bi-chevron-right { display: inline-block; transition: transform .15s; color: var(--ink-400); }
.venta[open] > summary .bi-chevron-right { transform: rotate(90deg); }
.venta[open] { background: var(--bg); border-radius: 8px; padding: 0 8px 10px; margin: 0 -8px; }
.venta-lineas { max-height: none; }
.venta-lineas b { white-space: nowrap; }
.venta-botones { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.venta-botones .btn { min-height: 44px; font-size: 15px; }
.venta-botones form { margin-left: auto; }
.cart-card.corrigiendo { border: 2px solid var(--amber-600, #c98a12); }
.cart-card.corrigiendo .cart-header { background: var(--amber-50, #fbf2dd); }
#clear-cart-button { white-space: nowrap; }
@media (min-width: 768px) { .ventas-lista { max-height: 45vh; overflow-y: auto; } }
.aviso-carga { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 16px; margin-bottom: 14px; border-radius: 12px; background: var(--amber-50, #fdf6e7); border: 1px solid var(--amber-200, #f3d9a4); font-size: 16px; font-weight: 600; color: var(--ink-900); }
.aviso-carga .btn { min-height: 44px; }
/* Caja compacta para pantallas chicas: nada de aire de más. */
.pos-panel { padding: 6px; margin-bottom: 6px; }
.pos-modo { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin-bottom: 6px; background: var(--bg-2); padding: 3px; border-radius: 10px; }
.pos-modo button { border: 0; background: transparent; min-height: 40px; border-radius: 8px; font-weight: 700; font-size: 15px; color: var(--ink-600); }
.pos-modo button.on { background: var(--v-600); color: #fff; }
.pos-modo .bi-star-fill { color: inherit; }
.caja-head { margin-bottom: 6px; padding: 4px 4px 4px 12px; }
.pos-tabs .seg-tabs { margin-bottom: 6px; }
.sin-acceso { max-width: 520px; margin: 24px auto; padding: 24px; text-align: center; }
.sin-acceso h1 { font-size: 24px; font-weight: 800; }
.sin-acceso p { color: var(--ink-600); font-size: 17px; }
.venta-cerrada { width: 100%; margin: 0 0 8px; color: var(--ink-600); }
.por-cobrar summary b { white-space: nowrap; }
.hoy-lista { list-style: none; margin: 8px 0 0; padding: 0; width: 100%; max-height: 260px; overflow-y: auto; }
.hoy-lista li { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-top: 1px solid var(--line-2); font-size: 16px; color: var(--ink-700); }
.hoy-lista b { color: var(--ink-900); }
.caja-acciones { display: inline-flex; gap: 4px; align-items: center; }
.sonido-btn { min-width: 44px; min-height: 44px; border: 0; border-radius: var(--r-pill); background: rgba(255, 255, 255, .14); color: #fff; font-size: 20px; }
.sonido-btn:hover { background: rgba(255, 255, 255, .24); }
.borrar-venta-form { display: inline; margin-left: auto; }

/* Lo cargado: los tres atajos ocupan el ancho, parejos y centrados (en 375px "Última semana" se partía). */
.lo-cargado-chips { display: grid; grid-template-columns: repeat(3, 1fr); }
.lo-cargado-chips .chip-btn { justify-content: center; text-align: center; padding: 8px 6px; line-height: 1.2; }

.por-cobrar > .dato-nota { padding: 0 16px; margin: 0 0 4px; }

/* ==========================================================================
   Caja · "mostrador + ticket" (referencias: Square, Shopify POS).
   Estante claro con fichas sin borde; la venta en un ticket oscuro con el
   total grande, como la pantalla de una terminal. Todo bajo .caja: no toca
   el resto del sistema.
   ========================================================================== */
.caja {
    --c-tile: #fff; --c-ink: #16132a; --c-ink-2: #4b4766; --c-mute: #7f7a9c;
    --c-hair: #e6e3f0; --c-track: #e9e7f2; --c-acc: #5847c4; --c-acc-soft: #efedfb;
    --t-bg: #17142c; --t-bg-2: #221e40; --t-ink: #f4f2ff; --t-mute: #a9a4c6;
    --t-hair: rgba(255, 255, 255, .09); --t-btn: rgba(255, 255, 255, .09);
    --c-live: #2fbf71; --c-warn: #e3a72f;
    --sombra-ficha: 0 1px 2px rgba(22, 19, 42, .06);
}
.caja .lbl, .caja #cart-titulo, .caja .ticket-total span, .caja .vendido-total span, .caja .ventas-titulo {
    font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
}

/* Estado: una línea, punto verde "en vivo", sin tarjeta. */
.caja .caja-head { flex-wrap: wrap; justify-content: flex-start; gap: 4px 14px; background: transparent; border: 0; padding: 0; margin-bottom: 10px; }
.caja .caja-head h1 { margin: 0; font-size: 26px; font-weight: 800; color: var(--ink-900); }
.caja .caja-acciones { margin-left: auto; }
.page:has(.caja) { max-width: none; }
@media (min-width: 992px) { .page:has(.caja) { padding-bottom: 16px; } }
.caja > .negocio-page:not(:has(.aviso)) { margin: 0; } /* sin avisos no empuja la cabecera */
.caja .caja-estado:not(.caja-vieja) { font-size: 14px; font-weight: 500; color: var(--ink-600); }
.caja .caja-vieja { font-size: 14px; line-height: 1.25; }
.caja .status-indicator { width: 8px; height: 8px; background: var(--c-live); }
.caja .caja-acciones .btn { min-height: 44px; padding: 6px 16px; border: 1px solid var(--c-hair); border-radius: var(--r-pill); background: var(--c-tile); color: var(--c-ink-2); font-weight: 600; }
.caja .caja-acciones .btn:hover { border-color: var(--c-ink-2); color: var(--c-ink); }

/* Estante: sin caja alrededor, fichas blancas que flotan sobre el fondo. */
.caja .pos-panel { background: transparent; border: 0; box-shadow: none; padding: 0; }
.caja .pos-modo { gap: 4px; padding: 4px; margin-bottom: 10px; border-radius: 14px; background: var(--c-track); }
.caja .pos-modo button { min-height: 44px; border-radius: 10px; color: var(--c-ink-2); }
.caja .pos-modo button.on { background: var(--c-tile); color: var(--c-ink); box-shadow: 0 1px 3px rgba(22, 19, 42, .14); }
.caja .pos-modo button.on .bi-star-fill { color: var(--c-warn); }
.caja .search-input-wrapper { margin-bottom: 10px; }
.caja .search-input { min-height: 48px; padding-left: 44px; border: 1px solid transparent; border-radius: 14px; background: var(--c-tile); box-shadow: var(--sombra-ficha); font-size: 16px; color: var(--c-ink); }
.caja .search-input:focus { border-color: var(--c-acc); box-shadow: 0 0 0 4px rgba(88, 71, 196, .15); }
.caja .search-icon { left: 16px; color: var(--c-mute); }
.caja .pos-grid { gap: 8px; padding: 2px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.caja .pos-grid .product-card { min-height: 72px; padding: 11px 13px; gap: 6px; border: 0; border-radius: 16px; background: var(--c-tile); box-shadow: var(--sombra-ficha); transition: box-shadow .15s, transform .08s; }
.caja .pos-grid .product-card:hover { transform: none; box-shadow: 0 0 0 1px var(--c-hair), 0 6px 18px rgba(40, 32, 90, .08); }
.caja .pos-grid .product-card:active { transform: scale(.97); }
.caja .pos-grid .product-card:focus-visible { outline: 3px solid var(--c-acc); outline-offset: 2px; }
.caja .pos-grid .product-card-title { font-size: 17px; font-weight: 600; overflow-wrap: anywhere; line-height: 1.25; color: var(--c-ink); }
.caja .pos-grid .product-card-price { font-size: 17px; font-weight: 600; color: var(--c-ink-2); font-variant-numeric: tabular-nums; }
.caja .pos-grid .product-card.en-venta { background: var(--c-acc-soft); box-shadow: inset 0 0 0 2px var(--c-acc); }
.caja .pos-grid .product-card.en-venta .product-card-price { color: var(--c-acc); }
.caja .product-card.en-venta::after { top: 8px; right: 8px; padding: 1px 9px; background: var(--c-ink); font-size: 13px; }

/* Ticket: la venta en curso, oscura y con el total grande. */
.caja .cart-card { position: relative; overflow: hidden; border: 0; border-radius: 16px; color: var(--t-ink); background: linear-gradient(180deg, var(--t-bg-2), var(--t-bg) 160px); box-shadow: 0 8px 20px rgba(23, 20, 44, .14); max-height: none; }
.caja .cart-card::before { content: ""; position: absolute; inset: 0 0 auto; height: 1px; background: linear-gradient(90deg, transparent, rgba(179, 168, 255, .8), transparent); }
.caja .cart-header { padding: 10px 14px; border-bottom: 1px solid var(--t-hair); }
.caja #cart-titulo { color: var(--t-mute); }
.caja #clear-cart-button { min-height: 44px; padding: 6px 14px; border: 0; border-radius: var(--r-pill); background: var(--t-btn); color: var(--t-ink); font-size: 14px; }
.caja #clear-cart-button:hover { background: rgba(214, 69, 90, .3); }
.caja .cart-items-scroll { padding: 2px 14px; min-height: 0; max-height: max(120px, calc(100vh - 400px)); overflow-y: auto; }
.caja .cart-item { margin: 0; padding: 8px 0; border-radius: 0; background: transparent; border-bottom: 1px solid var(--t-hair); flex-wrap: wrap; }
.caja .cart-item:last-child { border-bottom: 0; }
.caja .cart-card .cart-item-name { font-size: 16px; color: var(--t-ink); }
.caja .cart-card .cart-item-price { font-size: 13px; color: var(--t-mute); }
.caja .cart-card .quantity-control { gap: 4px; }
.caja .cart-card .quantity-control .btn { width: 44px; height: 44px; min-width: 44px; padding: 0; border: 0; border-radius: 12px; background: var(--t-btn); color: var(--t-ink); font-size: 20px; line-height: 1; }
.caja .cart-card .quantity-control .btn:hover { background: rgba(255, 255, 255, .18); }
.caja .cart-card .quantity-control .form-control { width: 42px; padding: 0; border: 0; background: transparent; box-shadow: none; color: var(--t-ink); font-size: 17px; font-weight: 700; text-align: center; -moz-appearance: textfield; }
.caja .cart-card .quantity-control .form-control::-webkit-inner-spin-button { -webkit-appearance: none; }
.caja .cart-card .cart-item-subtotal { min-width: 76px; font-size: 16px; font-weight: 700; color: var(--t-ink); font-variant-numeric: tabular-nums; }
.caja .cart-card .remove-from-cart { width: 44px; height: 44px; min-width: 44px; padding: 0; border: 0; border-radius: 12px; background: transparent; color: var(--t-mute); font-size: 18px; }
.caja .cart-card .remove-from-cart:hover { background: rgba(214, 69, 90, .25); color: #ffb3bd; }
.caja .cart-empty { padding: 40px 20px; color: var(--t-mute); }
.caja .cart-empty i { opacity: .45; }
.caja .cart-footer { padding: 10px 14px; border-top: 1px solid var(--t-hair); background: transparent; }
.caja .ticket-total { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 8px; }
.caja .ticket-total span { color: var(--t-mute); }
.caja .ticket-total b { font-size: 34px; font-weight: 800; line-height: 1; letter-spacing: -.02em; color: #fff; }
.caja #process-sale-button { min-height: 52px; border: 0; border-radius: 16px; background: var(--c-acc); color: #fff; font-size: 18px; font-weight: 700; box-shadow: 0 10px 28px rgba(88, 71, 196, .45); }
.caja #process-sale-button:hover { background: #6a5bd6; }
.caja #process-sale-button:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
/* Corrigiendo: el ticket se enmarca en ámbar. */
.caja .cart-card.corrigiendo { box-shadow: 0 0 0 3px var(--c-warn), 0 8px 20px rgba(23, 20, 44, .14); }
.caja .cart-card.corrigiendo .cart-header { background: rgba(227, 167, 47, .14); }
.caja .cart-card.corrigiendo #cart-titulo { color: var(--c-warn); }

/* Lo vendido: tarjeta clara, el número primero y las formas de pago como chips. */
.caja .summary-card { margin-top: 10px !important; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: var(--sh-sm); }
.caja .summary-card .card-body { padding: 8px 14px; }
.caja .vendido-total { gap: 8px; line-height: 1.1; }
.caja .vendido-total span { color: var(--c-mute); }
.caja .vendido-total b { font-size: 22px; font-weight: 800; letter-spacing: -.02em; color: var(--c-ink); }
.caja .vendido-metodos { display: flex; flex-wrap: nowrap; gap: 6px; margin-top: 6px; overflow-x: auto; }
.caja .vendido-metodos li { flex: none; gap: 6px; padding: 2px 10px; border-radius: var(--r-pill); background: var(--c-track); color: var(--c-ink-2); font-size: 14px; }
.caja .vendido-metodos li .num { font-weight: 700; color: var(--c-ink); }
.caja .ventas-titulo { display: flex; justify-content: space-between; align-items: center; min-height: 36px; margin: 4px 0 0; padding-top: 0; cursor: pointer; list-style: none; color: var(--c-mute); border-top: 1px solid var(--c-hair); }
.caja .ventas-titulo::-webkit-details-marker { display: none; }
.caja .ventas-det[open] > .ventas-titulo i { transform: rotate(180deg); }
.caja .ventas-det .ventas-lista { max-height: 220px; overflow-y: auto; }
.caja .ventas-titulo small { font-size: 13px; letter-spacing: 0; text-transform: none; }
.caja .venta-fila { color: var(--c-ink-2); font-variant-numeric: tabular-nums; }
.caja .venta-fila b { color: var(--c-ink); }
.caja .venta[open] { background: #f6f5fb; }

/* Ventanas (cobrar, cerrar): mismas esquinas y sin líneas de más. */
.caja .modal-content { border: 0; border-radius: 22px; box-shadow: 0 24px 60px rgba(23, 20, 44, .3); }
.caja .modal-header, .caja .modal-footer { border: 0; }
.caja .modal-title { font-weight: 800; color: var(--c-ink); }
.caja .cobro-metodos .btn { min-height: 84px; border-radius: 16px; }
.caja .modal-footer .btn-lg { border-radius: 14px; }

@media (max-width: 767px) {
    .caja .pos-barra:not([hidden]) { left: 10px; right: 10px; bottom: 84px; padding: 10px 10px 10px 18px; border: 0; border-radius: 18px; background: var(--t-bg); color: var(--t-mute); box-shadow: 0 12px 30px rgba(23, 20, 44, .35); }
    .caja .pos-barra b { color: #fff; }
    .caja .pos-barra .btn { border: 0; border-radius: 14px; background: var(--c-acc); box-shadow: 0 6px 18px rgba(106, 90, 205, .45); }
    .caja .ticket-total b { font-size: 34px; }
}
@media (max-width: 520px) {
    .caja .pos-grid { gap: 6px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .caja .pos-grid .product-card { min-height: 64px; padding: 8px 9px; border-radius: 12px; }
    .caja .pos-grid .product-card-title, .caja .pos-grid .product-card-price { font-size: 14px; }
}
@media (max-width: 520px) { .caja .caja-vieja { order: 3; flex-basis: 100%; } }
@media (max-width: 400px) { .caja .pos-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* Celu: el chip ×N abajo a la derecha, sin pisar el nombre. */
@media (max-width: 991px) {
    .caja .product-card.en-venta::after { top: auto; bottom: 6px; right: 8px; }
    .caja .product-card.en-venta .product-card-title { padding-right: 0; }
}
@media (prefers-reduced-motion: reduce) {
    .caja .status-indicator { animation: none; }
    .caja .pos-grid .product-card { transition: none; }
}

/* Inicio: tarjetas de guía (agregar al celu, para aprovechar más). Se cierran con "Ahora no". */
.guia { border-color: var(--v-200, #d6cef1); background: linear-gradient(180deg, var(--v-50, #f3f1fb), #fff 70%); }
.guia-cab { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 6px; }
.guia-cab h2 { margin: 0; display: flex; align-items: center; gap: 8px; }
.guia-cab .btn { flex-shrink: 0; min-height: 40px; color: var(--ink-600); }
.guia-txt, .guia-como { margin: 0; font-size: 16px; color: var(--ink-700); }
.guia-como { margin-top: 10px; padding: 10px 14px; border-radius: var(--r-md); background: #fff; border: 1px dashed var(--v-200, #d6cef1); }
.guia-btn { width: 100%; min-height: 52px; margin-top: 12px; font-size: 17px; font-weight: 700; }
.guia-pasos { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; }
.guia-pasos li { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 0; border-top: 1px solid var(--line-2); font-size: 16px; color: var(--ink-900); }
.guia-pasos li:first-child { border-top: 0; }
.guia-pasos small { display: block; margin-top: 2px; font-size: 14px; font-weight: 700; color: var(--v-700); }
.guia-pasos .btn { flex-shrink: 0; min-height: 44px; min-width: 110px; font-weight: 700; }
@media (max-width: 480px) {
    .guia-pasos li { flex-direction: column; align-items: stretch; gap: 8px; }
}

/* ---------- Menú: barra lateral en la compu; barra de abajo + "Todo el sistema" en el celu ---------- */
.app { display: grid; grid-template-columns: 232px minmax(0, 1fr); align-items: start; }
.app > .page { width: 100%; }
.sidebar {
    position: sticky; top: 0; height: 100vh; overflow: hidden; display: flex; flex-direction: column;
    background: var(--surface); border-right: 1px solid var(--line); padding: 16px 12px;
}
.sidebar nav { flex: 1; min-height: 0; overflow-y: auto; }
.sidebar-marca { flex-shrink: 0; display: flex; align-items: center; gap: 10px; margin-bottom: 16px; color: var(--ink-900); font-size: 16px; font-weight: 800; }
.sidebar .sidebar-marca:hover { background: none; }
.sidebar-logo { width: 40px; height: 40px; flex-shrink: 0; border-radius: 11px; background: var(--v-600); display: grid; place-items: center; }
.sidebar-logo img { width: 30px; height: auto; }
.cuenta { flex-shrink: 0; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line-2); display: grid; gap: 10px; }
.cuenta-nombre { display: flex; align-items: center; gap: 10px; padding: 0 10px; color: var(--ink-900); font-weight: 600; white-space: nowrap; overflow: hidden; }
.cuenta-nombre i { font-size: 20px; color: var(--ink-500); }
.cuenta-botones { display: flex; gap: 8px; }
.cuenta form { flex: 1; margin: 0; }
.cuenta .sonido-btn, .cuenta .salir { min-height: 44px; border: 0; border-radius: 12px; background: var(--bg-2); color: var(--ink-700); }
.cuenta .sonido-btn { width: 44px; flex-shrink: 0; font-size: 19px; }
.cuenta .salir { width: 100%; font-size: 15px; font-weight: 600; }
.cuenta .sonido-btn:hover, .cuenta .salir:hover { background: var(--v-50); color: var(--v-800); }
.menu-celu .cuenta { margin-top: 18px; }
.sidebar-grupo + .sidebar-grupo { margin-top: 16px; }
.sidebar h2 { margin: 0 12px 6px; font-size: 12px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-500); }
.sidebar ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.sidebar a {
    display: flex; align-items: center; gap: 12px; min-height: 42px; padding: 0 12px; border-radius: 10px;
    text-decoration: none; color: var(--ink-700); font-size: 15px; font-weight: 500;
}
.sidebar a i { font-size: 18px; color: var(--ink-500); }
.sidebar a:hover { background: var(--bg-2); color: var(--ink-900); }
.sidebar a.active { background: var(--v-50); color: var(--v-800); font-weight: 700; }
.sidebar a.active i { color: var(--v-600); }
.sidebar a:focus-visible { outline: 2px solid var(--v-500); outline-offset: -2px; }
.mobile-nav button.mobile-nav-item { border: 0; background: none; font: inherit; font-size: 15px; font-weight: 600; }

.menu-celu {
    margin: auto 0 0; width: 100%; max-width: 100%; max-height: 88vh; border: 0;
    border-radius: 22px 22px 0 0; padding: 12px 16px calc(24px + env(safe-area-inset-bottom)); box-shadow: 0 -12px 32px rgba(0, 0, 0, .18);
}
.menu-celu::backdrop { background: rgba(23, 20, 44, .45); }
.menu-celu-cabeza { display: flex; justify-content: space-between; align-items: center; }
.menu-celu-cabeza h2 { margin: 0; font-size: 18px; font-weight: 800; color: var(--ink-900); }
.menu-celu-cabeza button { width: 44px; height: 44px; border: 0; border-radius: 12px; background: var(--bg-2); color: var(--ink-700); font-size: 18px; }
.menu-celu-grupo { margin-top: 12px; }
.menu-celu-grupo h3 { margin: 0 4px 6px; font-size: 12px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-500); }
.menu-celu-grupo div { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.menu-celu-grupo a {
    min-height: 44px; display: flex; align-items: center; padding: 0 12px; border-radius: 12px;
    background: var(--bg-2); color: var(--ink-900); text-decoration: none; font-size: 15px; font-weight: 500;
}
.menu-celu-grupo a.active { background: var(--v-50); color: var(--v-800); font-weight: 700; }

@media (max-width: 991px) {
    .app { display: block; }
    .sidebar { display: none; }
}

/* Notebooks: la barra lateral se achica sola a una franja de íconos y se despliega encima del
   contenido al pasar el mouse o con el teclado. Celu y tablet usan la barra de abajo. */
/* Ventanas bajas: menú más compacto */
@media (max-height: 900px) {
    .sidebar a { min-height: 38px; }
    .sidebar-grupo + .sidebar-grupo { margin-top: 10px; }
    .sidebar-marca { margin-bottom: 10px; }
}
@media (min-width: 992px) and (max-width: 1365px) {
    .app { grid-template-columns: 68px minmax(0, 1fr); }
    .sidebar { width: 68px; padding: 14px 10px; z-index: 30; transition: width .15s ease, box-shadow .15s ease; }
    .sidebar a { justify-content: center; gap: 0; padding: 0; }
    .sidebar a span, .sidebar h2 {
        position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
    }
    .sidebar-grupo + .sidebar-grupo { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line-2); }
    .cuenta-nombre { justify-content: center; padding: 0; }
    .cuenta-nombre span, .cuenta .salir span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
    .cuenta-botones { flex-direction: column; }
    .sidebar:hover .cuenta-nombre, .sidebar:focus-within .cuenta-nombre { justify-content: flex-start; padding: 0 10px; }
    .sidebar:hover .cuenta-nombre span, .sidebar:focus-within .cuenta-nombre span,
    .sidebar:hover .cuenta .salir span, .sidebar:focus-within .cuenta .salir span { position: static; width: auto; height: auto; overflow: visible; clip: auto; }
    .sidebar:hover .cuenta-botones, .sidebar:focus-within .cuenta-botones { flex-direction: row; }
    .sidebar:hover, .sidebar:focus-within { width: 240px; box-shadow: 0 12px 32px rgba(40, 32, 90, .22); }
    .sidebar:hover a, .sidebar:focus-within a { justify-content: flex-start; gap: 12px; padding: 0 12px; }
    .sidebar:hover a span, .sidebar:focus-within a span,
    .sidebar:hover h2, .sidebar:focus-within h2 { position: static; width: auto; height: auto; overflow: visible; clip: auto; }
    .sidebar:hover .sidebar-grupo + .sidebar-grupo, .sidebar:focus-within .sidebar-grupo + .sidebar-grupo { border-top-color: transparent; padding-top: 0; margin-top: 16px; }
}
@media (prefers-reduced-motion: reduce) { .sidebar { transition: none; } }

/* ---------- Inicio en una sola pantalla (notebook de 1366×768 incluida) ---------- */
.inicio { display: grid; gap: 14px; }
.inicio-cab { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px 20px; }
.inicio-cab h1 { margin: 0; font-size: 26px; font-weight: 800; color: var(--ink-900); }
.inicio-cab p { margin: 2px 0 0; font-size: 15px; color: var(--ink-600); }
.inicio-cargar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.inicio-falta { display: inline-flex; align-items: center; gap: 6px; font-size: 15px; font-weight: 700; color: #8a5a00; }
.inicio-cargar-btn { min-height: 50px; padding: 0 20px; display: inline-flex; align-items: center; gap: 10px; font-size: 16px; font-weight: 700; border-radius: 14px; }
.guia-linea { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 10px 14px; border: 1px solid var(--v-200); border-radius: 14px; }
.guia-linea[hidden] { display: none; }
.guia-linea-txt { flex: 1; min-width: 240px; font-size: 15px; color: var(--ink-900); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.guia-linea-txt small { margin-left: 6px; font-weight: 700; color: var(--v-700); }
.guia-linea .btn { min-height: 44px; }
/* En el celu, si están las dos guías, solo la de instalar */
#instalar:not([hidden]) ~ #aprovechar { display: none; }
@media (max-width: 991px) { .guia-linea-txt { white-space: normal; } }
.inicio-numeros { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.numero { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 12px 12px 12px 14px; box-shadow: var(--sh-xs); display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.numero-l { font-size: 14px; font-weight: 600; color: var(--ink-600); }
.numero-v { font-size: 26px; font-weight: 800; color: var(--ink-900); white-space: nowrap; line-height: 1.2; }
.numero-v small { font-size: 14px; font-weight: 600; color: var(--ink-600); }
.numero-falta { font-size: 20px; color: var(--ink-500); }
.numero .estado { margin-top: 4px; font-size: 12px; padding: 3px 8px; gap: 5px; white-space: nowrap; max-width: 100%; }
.inicio-columnas { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; align-items: start; }
.inicio .tarjeta { padding: 14px 16px; margin: 0; }
.inicio .tarjeta h2 { margin: 0 0 8px; font-size: 16px; }
.inicio .tarjeta h3 { margin: 10px 0 4px; font-size: 14px; font-weight: 700; color: var(--ink-700); }
.inicio .grafico-cab { margin-bottom: 4px; }
.inicio .grafico-cab h2 { margin: 0; }
.inicio .leyenda { margin: 0; font-size: 13px; gap: 12px; }
.inicio .grafico { height: 120px; }
.inicio .ranking li:nth-child(n+4) { display: none; }
.inicio .ranking li { padding: 2px 0; font-size: 14px; gap: 2px 10px; }
.inicio .ranking .barra { height: 5px; }
.inicio .donde-cuerpo { gap: 14px; }
.inicio .torta { width: 96px; height: 96px; }
.inicio .desglose { margin: 0; }
.inicio .desglose li { padding: 6px 0; font-size: 14px; }
.inicio-deben { margin: 0; font-size: 22px; font-weight: 800; color: var(--red-600); }
.inicio-deben small { font-size: 13px; font-weight: 600; color: var(--ink-600); }
.inicio-deudores { list-style: none; margin: 6px 0 0; padding: 0; }
.inicio-deudores li { display: flex; justify-content: space-between; gap: 10px; padding: 5px 0; border-top: 1px solid var(--line-2); font-size: 14px; color: var(--ink-700); }
.inicio-deudores li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inicio-deudores b { white-space: nowrap; color: var(--ink-900); }
.inicio-pie { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px 20px; font-size: 14px; color: var(--ink-600); }
.inicio-pie p { margin: 0; padding: 8px 0; }
.inicio-plegado summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; padding: 8px 0; font-weight: 700; color: var(--v-700); }
.inicio-plegado[open] { flex-basis: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 4px 16px 12px; }
.inicio-plegado ul { list-style: none; margin: 0; padding: 0; }
.inicio-plegado li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line-2); color: var(--ink-900); }
.inicio-plegado li small { display: block; color: var(--ink-500); font-size: 13px; }
