/* ═══════════════════════════════════════════════════════════════════
   PATTERNS — styles for the listing/edit includes
   (application/modules/admin/views/includes/)

   These used to live in a <style> block inside each include. Includes
   render once per listing row, so a 50-row listing shipped 50 copies of
   the same CSS — about 400 lines per row for the observation widgets.
   Moving them here sends them once, cached.

   Rule for anything added here: every selector hangs off the include's
   own root class. A <style> inside an include only ever applied on the
   pages where that include rendered; this file applies on every page,
   so a bare `.btn-success` or `table` here would restyle the whole app.
   ═══════════════════════════════════════════════════════════════════ */


/* ── includes/vencimiento.php ───────────────────────────────────────── */

.venc-include-wrap {
	display: inline-flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 8px;
}

.venc-include-wrap .venc-include-title {
	margin-right: 2px;
	font-size: var(--fs-sm);
	color: var(--ink-mute);
}

.venc-include-wrap .venc-date-label {
	font-size: var(--fs-lg);
	font-weight: 700;
	color: var(--ink);
	line-height: 1;
	font-variant-numeric: tabular-nums;
}

.venc-include-wrap .venc-date-label.venc-empty {
	font-size: var(--fs-md);
	font-weight: 400;
	color: var(--ink-faint);
	font-style: italic;
}

.venc-include-wrap .venc-badge {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	padding: 3px 10px;
	border: 1px solid transparent;
	border-radius: var(--r-pill);
	font-size: var(--fs-sm);
	font-weight: 700;
	white-space: nowrap;
}

.venc-include-wrap .venc-badge i { font-size: var(--fs-xs); }

.venc-include-wrap .venc-badge-ok      { background: var(--ok-soft);     color: var(--ok);     border-color: var(--ok-border); }
.venc-include-wrap .venc-badge-warning,
.venc-include-wrap .venc-badge-today   { background: var(--warn-soft);   color: var(--warn);   border-color: var(--warn-border); }
.venc-include-wrap .venc-badge-expired { background: var(--danger-soft); color: var(--danger); border-color: var(--danger-border); }
.venc-include-wrap .venc-badge-empty   { background: var(--bg-sunken);   color: var(--ink-mute); }

/* Expired and due-today are the ones that need acting on */
.venc-include-wrap .venc-badge-expired i,
.venc-include-wrap .venc-badge-today i { animation: ui-badge-pop var(--dur-3) var(--ease-spring) 1; }


/* ── includes/color_swatch.php ──────────────────────────────────────── */
/* Was scoped to a random per-row ID; a root class does the same job. */

.cs-swatch {
	display: inline-flex;
	align-items: center;
	gap: 7px;
}

.cs-swatch .cs-circle {
	width: 22px;
	height: 22px;
	border-radius: 50%;
	border: 1px solid rgba(0,0,0,.12);
	box-shadow: inset 0 0 0 2px rgba(255,255,255,.35);
	flex-shrink: 0;
}

.cs-swatch .cs-hex {
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-size: var(--fs-sm);
	color: var(--ink-mute);
	letter-spacing: .03em;
}

.cs-swatch .cs-empty { color: var(--ink-faint); font-size: var(--fs-md); }


/* ── includes/link_woo.php ──────────────────────────────────────────── */
/* WooCommerce order number. Inline, so it follows the table alignment. */

.woo-order {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	padding: 3px 10px;
	border: 1px solid var(--line);
	border-radius: var(--r-pill);
	background: var(--bg-sunken);
	color: var(--ink-soft);
	font-size: var(--fs-sm);
	font-weight: 700;
	font-variant-numeric: tabular-nums;
	line-height: 1.4;
	white-space: nowrap;
}

.woo-order--link {
	border-color: var(--brand-100);
	background: var(--brand-50);
	color: var(--brand-600);
	text-decoration: none;
	transition: background-color var(--dur-1) var(--ease-out),
		border-color var(--dur-1) var(--ease-out),
		color var(--dur-1) var(--ease-out);
}

.woo-order--link:hover,
.woo-order--link:focus-visible {
	border-color: var(--brand-solid);
	background: var(--brand-solid);
	color: #fff;
	text-decoration: none;
}

.woo-order--link i { font-size: var(--fs-xs); opacity: .75; }
.woo-order--link:hover i,
.woo-order--link:focus-visible i { opacity: 1; }

.woo-order-vacio { color: var(--ink-mute); }

/* Comfortable tap target on phones and tablets */
@media (pointer: coarse) {
	.woo-order--link { min-height: 32px; padding-inline: 12px; }
}


/* ── includes/include_stock_deposito.php ────────────────────────────── */
/* Was scoped to #stock-depositos-<id_producto>. The id stays in the
   markup; the styles hang off `.sd-list` now. */

.sd-list {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	padding: 4px 0;
}

.sd-list .sd-card {
	display: flex;
	align-items: center;
	gap: 8px;
	min-width: 130px;
	padding: 7px 12px;
	border: 1px solid var(--brand-100);
	border-radius: var(--r-md);
	background: var(--brand-50);
	color: var(--brand-700);
	font-size: var(--fs-md);
	font-weight: 600;
	transition: border-color var(--dur-1) var(--ease-out),
	            box-shadow var(--dur-1) var(--ease-out);
}

.sd-list .sd-card:hover {
	border-color: var(--brand-200);
	box-shadow: var(--sh-1);
}

/* Fewer than 3 units */
.sd-list .sd-card.sd-warning {
	background: var(--warn-soft);
	border-color: var(--warn-border);
	color: var(--warn);
}

.sd-list .sd-icon { font-size: var(--icon-sm); opacity: .8; }

.sd-list .sd-name {
	flex: 1;
	font-weight: 500;
	color: inherit;
}

.sd-list .sd-qty {
	font-size: var(--fs-lg);
	font-weight: 700;
	font-variant-numeric: tabular-nums;
}

.sd-list .sd-empty {
	padding: 6px 0;
	font-size: var(--fs-sm);
	color: var(--ink-mute);
	font-style: italic;
}


/* ── includes/include_total_lista.php ───────────────────────────────── */
/* Price per lista in a listing cell: name · price, the column's lista first.
   inline-grid so the cell's text-align (--table-align) places the block while
   names and prices line up in two columns. */

.tl-list {
	display: inline-grid;
	grid-template-columns: auto auto;
	column-gap: 12px;
	row-gap: 2px;
	padding: 2px 0;
	text-align: left;
	vertical-align: middle;
}
.tl-list .tl-row { display: contents; }

.tl-list .tl-name,
.tl-list .tl-price {
	padding: 2px 0;
	font-size: var(--fs-sm);
	line-height: 1.3;
	white-space: nowrap;
}
.tl-list .tl-name  { color: var(--ink-mute); font-weight: 500; }
.tl-list .tl-price {
	text-align: right;
	color: var(--ink-soft);
	font-weight: 600;
	font-variant-numeric: tabular-nums;
}

/* The column's lista: a soft pill across both cells */
.tl-list .is-main .tl-name,
.tl-list .is-main .tl-price {
	padding-block: 4px;
	background: var(--brand-50);
	color: var(--brand-700);
}
.tl-list .is-main .tl-name  { padding-left: 8px; border-radius: var(--r-sm) 0 0 var(--r-sm); font-weight: 700; }
.tl-list .is-main .tl-price { padding-right: 8px; border-radius: 0 var(--r-sm) var(--r-sm) 0; font-size: var(--fs-md); font-weight: 800; }
.tl-list .is-main + .tl-row .tl-name,
.tl-list .is-main + .tl-row .tl-price { padding-top: 4px; }

/* A price row loaded at 0 */
.tl-list .is-zero .tl-price { color: var(--warn); }

.tl-empty { font-size: var(--fs-sm); color: var(--ink-mute); font-style: italic; }


/* ── includes/impactar_stock_oc.php ─────────────────────────────────── */
/* Was scoped to a random per-row ID; the root already had this class. */

.oc-impact-wrapper { margin: 12px 0; }

.oc-impact-wrapper .oc-impact-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 6px 12px;
	border: none;
	border-radius: var(--r-sm);
	background: var(--brand-600);
	color: #fff;
	font-family: var(--font-sans);
	font-size: var(--fs-sm);
	font-weight: 600;
	cursor: pointer;
	box-shadow: var(--sh-1);
	transition: background-color var(--dur-1) var(--ease-out),
	            transform var(--dur-1) var(--ease-out),
	            box-shadow var(--dur-1) var(--ease-out);
}

.oc-impact-wrapper .oc-impact-btn:hover {
	background: var(--brand-700);
	transform: translateY(-1px);
	box-shadow: var(--sh-2);
}

.oc-impact-wrapper .oc-impact-btn:active { transform: scale(.97); }

.oc-impact-wrapper .oc-impact-btn i { margin-right: 0; }

.oc-impact-wrapper .oc-impact-done-badge {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 7px 12px;
	border: 1px solid var(--brand-100);
	border-radius: var(--r-pill);
	background: var(--brand-50);
	color: var(--brand-700);
	font-size: var(--fs-md);
	font-weight: 600;
}

.oc-impact-wrapper .oc-impact-done-badge i { margin-right: 0; color: var(--ok); }


/* ── includes/include_total_factura.php ─────────────────────────────── */
/* A card per row with a solid teal total bar — the same shape people know
   from the previous design, which makes the products column stand out as
   its own block while scanning a sale list. Refined: flat fill instead of
   the old gradient, tokens, tighter spacing, tabular figures. (A lighter
   version without the bar was tried and made the column hard to find.) */

/* Room like the previous design had: the column is sized by this card,
   so a floor here widens the whole Productos column and item names stop
   breaking into two or three lines. In em, so it grows with the
   "Texto grande" switch too (≈294px normal, ≈336px large). No max-width:
   the old 330px cap was what squeezed it. */
.factura-items-container {
	min-width: 21em;
	padding: 8px;
	background: var(--surface);
	/* Edge drawn as a shadow, not a frame: a hairline ring at 6% plus a
	   soft drop reads as a card lifted off the row, without the hard
	   outline the --line-strong border gave it. */
	border: 0;
	border-radius: var(--r-md);
	box-shadow: 0 0 0 1px rgba(19,41,61,.06),
	            0 1px 2px rgba(19,41,61,.06),
	            0 4px 12px -4px rgba(19,41,61,.10);
}

.factura-items-container .factura-items-list { margin: 0 0 2px; }

.factura-items-container .factura-item {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 16px;
	padding: 7px 8px;
	border-bottom: 1px solid var(--line);
}

.factura-items-container .factura-item:last-of-type { border-bottom: none; }

.factura-items-container .factura-item-name {
	flex: 1;
	min-width: 0;
	color: var(--ink-soft);
	font-size: var(--fs-sm);
	font-weight: 600;
	line-height: 1.45;
}

.factura-items-container .factura-item-price {
	color: var(--ink);
	font-size: var(--fs-sm);
	font-weight: 700;
	white-space: nowrap;
	font-variant-numeric: tabular-nums;
}

.factura-items-container .factura-descuento {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 10px;
	padding: 4px 6px;
}

.factura-items-container .factura-descuento-label,
.factura-items-container .factura-descuento-amount {
	color: var(--warn);
	font-size: var(--fs-sm);
	font-weight: 700;
	white-space: nowrap;
}

.factura-items-container .factura-descuento-label {
	font-size: var(--fs-xs);
	letter-spacing: .04em;
	text-transform: uppercase;
}

.factura-items-container .factura-descuento-amount { font-variant-numeric: tabular-nums; }

.factura-items-container .factura-total {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 10px;
	margin-top: 6px;
	padding: 9px 11px;
	border: 0;
	border-radius: var(--r-sm);
	background: var(--brand-600);
	box-shadow: none;
}

.factura-items-container .factura-total-label {
	color: rgba(255,255,255,.8);
	font-size: var(--fs-xs);
	font-weight: 700;
	letter-spacing: .06em;
	text-transform: uppercase;
}

.factura-items-container .factura-total-amount {
	color: #fff;
	font-size: var(--fs-base);
	font-weight: 700;
	font-variant-numeric: tabular-nums;
}


/* ── includes/include_observacion_lista.php ─────────────────────────────── */
/* Moved verbatim from the include, except: the generic .btn-* rules
   are now scoped under .history-states-container (they used to restyle those buttons
   across the whole page wherever this include rendered), and the
   diagonal gradients are flat fills. */

.history-states-container {
	background: #f8fafb;
	border-radius: 6px;
	padding: 12px;
	font-size: var(--fs-sm);
	max-width: 280px;
	border: 1px solid #e1e8ed;
}

.history-header {
	display: flex;
	align-items: center;
	margin-bottom: 10px;
	padding-bottom: 8px;
	border-bottom: 1px solid #d1dce5;
}

.history-header i {
	font-size: var(--icon-sm);
	color: #408892;
	margin-right: 6px;
}

.history-header-title {
	font-weight: 600;
	color: #2d6068;
	font-size: var(--fs-xs);
	text-transform: uppercase;
	letter-spacing: 0.3px;
}

.history-status-badge {
	display: inline-flex;
	align-items: center;
	padding: 8px 10px;
	border-radius: 5px;
	font-size: var(--fs-xs);
	font-weight: 600;
	margin-bottom: 10px;
	gap: 5px;
	width: 100%;
	justify-content: center;
}

.history-status-badge.active {
	background: #d4edda;
	color: #155724;
}

.history-status-badge.expired {
	background: #f8d7da;
	color: #721c24;
}

.history-status-badge i {
	font-size: var(--fs-xs);
}

.history-time-plain {
	font-size: var(--fs-xs);
	color: #6c757d;
	margin-bottom: 8px;
	line-height: 1.4;
}

.history-time-plain.expired {
	color: #721c24;
	font-weight: 600;
}

.history-current-state {
	background: white;
	border: 1px solid #e1e8ed;
	border-radius: 4px;
	padding: 10px;
	margin-bottom: 10px;
	text-align: left;
}

.history-current-state-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 6px;
}

.history-current-state-label {
	font-size: var(--fs-xs);
	font-weight: 600;
	color: #6c757d;
	text-transform: uppercase;
	letter-spacing: 0.3px;
	text-align: left;
}

.history-current-state-date {
	color: #408892;
	font-weight: 600;
	font-size: var(--fs-xs);
	display: block;
	margin-bottom: 4px;
	text-align: left;
}

.history-current-state-status {
	color: #2d6068;
	font-size: var(--fs-xs);
	font-weight: 500;
	text-align: left;
}

.history-list-label {
	font-size: var(--fs-xs);
	font-weight: 600;
	color: #6c757d;
	text-transform: uppercase;
	margin-bottom: 6px;
	letter-spacing: 0.3px;
	display: block;
	text-align: left;
}

.history-list {
	max-height: 100px;
	overflow-y: auto;
	margin: 8px 0;
	padding: 8px;
	background: white;
	border-radius: 4px;
	border: 1px solid #e1e8ed;
	display: flex;
	flex-direction: column-reverse;
	text-align: left;
}

.history-list::-webkit-scrollbar {
	width: 4px;
}

.history-list::-webkit-scrollbar-track {
	background: #f1f3f5;
	border-radius: 2px;
}

.history-list::-webkit-scrollbar-thumb {
	background: rgba(64, 136, 146, 0.5);
	border-radius: 2px;
}

.history-list::-webkit-scrollbar-thumb:hover {
	background: rgba(64, 136, 146, 0.7);
}

.history-item {
	padding: 4px 0;
	border-bottom: 1px solid #f1f3f5;
	font-size: var(--fs-xs);
	color: #495057;
	line-height: 1.3;
	text-align: left;
}

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

.history-item-date {
	color: #408892;
	font-weight: 600;
	display: block;
	margin-bottom: 2px;
	text-align: left;
}

.history-reset-btn {
	background: #dc3545;
	color: white;
	border: none;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: var(--fs-xs);
	transition: all 0.2s ease;
	padding: 0;
	line-height: 1;
	box-shadow: 0 2px 4px rgba(220, 53, 69, 0.3);
	position: relative;
}

.history-reset-btn:hover {
	background: #c82333;
	transform: scale(1.15) rotate(90deg);
	box-shadow: 0 3px 8px rgba(220, 53, 69, 0.4);
}

.history-reset-btn i {
	font-size: var(--fs-xs);
}

.history-reset-btn::after {
	content: '';
	position: absolute;
	top: -4px;
	right: -4px;
	width: 28px;
	height: 28px;
	border: 2px dashed #dc3545;
	border-radius: 50%;
	opacity: 0;
	transition: opacity 0.2s ease;
}

.history-reset-btn:hover::after {
	opacity: 0.5;
	animation: pulse-ring 1s ease-out infinite;
}

@keyframes pulse-ring {
	0% {
		transform: scale(1);
		opacity: 0.5;
	}
	100% {
		transform: scale(1.2);
		opacity: 0;
	}
}

.history-item-barrido {
	background: #fff3cd;
	padding: 4px 6px;
	border-radius: 3px;
	border-left: 2px solid #ffc107;
	margin: 3px 0;
	font-weight: 600;
	color: #856404;
	font-size: var(--fs-xs);
}

.history-actions {
	display: flex;
	flex-direction: column;
	gap: 6px;
	margin: 10px 0;
}

.history-actions .btn {
	width: 100%;
	padding: 8px 10px;
	font-size: var(--fs-xs);
	border-radius: 4px;
	transition: all 0.2s ease;
	border: none;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 5px;
	font-weight: 500;
	text-decoration: none;
	white-space: nowrap;
}

.history-actions .btn i {
	font-size: var(--fs-xs);
}

.history-actions .btn:hover {
	transform: translateY(-1px);
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.history-states-container .btn-purple{
	background: var(--brand-fill);
	color: white;
}

.history-states-container .btn-success{
	background: var(--brand-fill);
	color: white;
}

.history-states-container .btn-danger{
	background: linear-gradient(#dc3545, #dc3545);
	color: white;
}

.history-states-container .btn-blue{
	background: var(--brand-fill);
	color: white;
}

.history-select-wrapper {
	margin-top: 10px;
}

.history-select-label {
	font-size: var(--fs-xs);
	font-weight: 600;
	color: #495057;
	margin-bottom: 5px;
	display: flex;
	align-items: center;
	gap: 4px;
}

.history-select-label i {
	font-size: var(--fs-xs);
	color: #408892;
}

.history-select-wrapper select {
	width: 100%;
	padding: 8px 10px;
	border: 1px solid #d1dce5;
	border-radius: 4px;
	font-size: var(--fs-xs);
	color: #495057;
	background: white;
	cursor: pointer;
	transition: all 0.2s ease;
	appearance: none;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23408892' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 8px center;
	padding-right: 28px;
}

.history-select-wrapper select:hover {
	border-color: #408892;
}

.history-select-wrapper select:focus {
	outline: none;
	border-color: #408892;
	box-shadow: 0 0 0 2px rgba(64, 136, 146, 0.1);
}

.history-extra-actions {
	margin-top: 10px;
	padding-top: 10px;
	border-top: 1px dashed #d1dce5;
}

.history-extra-actions .btn {
	width: 100%;
	padding: 8px 10px;
	font-size: var(--fs-xs);
	border-radius: 4px;
	transition: all 0.2s ease;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 5px;
	font-weight: 500;
	text-decoration: none;
}

.history-extra-actions .btn i {
	font-size: var(--fs-xs);
}

.history-collapse-toggle {
	cursor: pointer;
	user-select: none;
	transition: color 0.2s ease;
}

.history-collapse-toggle:hover {
	color: #408892;
}

.history-list.collapsed {
	max-height: 0;
	padding: 0;
	margin: 0;
	border: none;
	overflow: hidden;
}

@media (max-width: 768px) {
	.history-states-container {
		max-width: 100%;
	}
}


/* ── includes/include_observacion_caja.php ──────────────────────────────── */
/* Moved verbatim from the include, except: the generic .btn-* rules
   are now scoped under .caja-container (they used to restyle those buttons
   across the whole page wherever this include rendered), and the
   diagonal gradients are flat fills. */

.caja-container {
	background: #f8fafb;
	border-radius: 6px;
	padding: 12px;
	font-size: var(--fs-sm);
	max-width: 500px;
	border: 1px solid #e1e8ed;
	margin:0 auto
}

.caja-header {
	display: flex;
	align-items: center;
	margin-bottom: 10px;
	padding-bottom: 8px;
	border-bottom: 1px solid #d1dce5;
}

.caja-header i {
	font-size: var(--icon-sm);
	color: #408892;
	margin-right: 6px;
}

.caja-header-title {
	font-weight: 600;
	color: #2d6068;
	font-size: var(--fs-xs);
	text-transform: uppercase;
	letter-spacing: 0.3px;
}

.caja-actions {
	display: flex;
	flex-direction: column;
	gap: 6px;
	margin-bottom: 10px;
}

.caja-actions .btn {
	width: 100%;
	padding: 8px 10px;
	font-size: var(--fs-xs);
	border-radius: 4px;
	transition: all 0.2s ease;
	border: none;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 5px;
	font-weight: 500;
	text-decoration: none;
	white-space: nowrap;
}

.caja-actions .btn i {
	font-size: var(--fs-xs);
}

.caja-actions .btn:hover {
	transform: translateY(-1px);
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.caja-container .btn-purple{
	background: var(--brand-fill);
	color: white;
}

.caja-container .btn-success{
	background: var(--brand-fill);
	color: white;
}

.caja-container .btn-blue{
	background: var(--brand-fill);
	color: white;
}

.caja-table-wrapper {
	border-radius: 4px;
	padding: 8px;
	margin-bottom: 10px;
	max-height: 300px;
	overflow-y: auto;
}

.caja-table-wrapper::-webkit-scrollbar {
	width: 6px;
}

.caja-table-wrapper::-webkit-scrollbar-track {
	background: #f1f3f5;
	border-radius: 3px;
}

.caja-table-wrapper::-webkit-scrollbar-thumb {
	background: rgba(64, 136, 146, 0.5);
	border-radius: 3px;
}

.caja-table-wrapper::-webkit-scrollbar-thumb:hover {
	background: rgba(64, 136, 146, 0.7);
}

.caja-table {
	width: 100%;
	border-collapse: collapse;
	font-size: var(--fs-xs);
	margin: 0 0;
}

.caja-table thead {
	position: sticky;
	top: 0;
	background: #f8fafb;
	z-index: 1;
}

.caja-table th {
	padding: 8px 6px;
	text-align: var(--table-align);
	font-weight: 600;
	color: #2d6068;
	border-bottom: 2px solid #408892;
	font-size: var(--fs-xs);
	text-transform: uppercase;
	letter-spacing: 0.3px;
}

.caja-table td {
	padding: 6px;
	border-bottom: 1px solid #f1f3f5;
	color: #495057;
}

.caja-table tr:hover {
	background: #f8f9fa;
}

.caja-table tr:last-child td {
	border-bottom: none;
}

.caja-table .time-col {
	color: #408892;
	font-weight: 600;
	white-space: nowrap;
}

.caja-table .monto-col {
	font-weight: 600;
	color: #2d6068;
	white-space: nowrap;
}

/* En mobile, la vista tabla del listado pone word-break: break-word al valor de cada
   fila (estilos.css, .general_result_rows #table td > *). Heredado acá, el ancho mínimo
   de cada columna pasaba a ser una letra y los títulos salían en vertical. Dentro del
   historial: títulos, hora, movimiento y monto en una línea; la observación corta solo
   entre palabras (o una palabra muy larga), y si no entra, la tabla scrollea de costado. */
.caja-container {
	word-break: normal;
	overflow-wrap: break-word;
	min-width: 0;
}
.caja-table-wrapper {
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}
.caja-table th,
.caja-table td:nth-child(2) {
	white-space: nowrap;
}
.caja-table td:nth-child(4) {
	min-width: 140px;
}

/* Vista tabla en mobile: cada fila es una tarjeta con la etiqueta a la izquierda (136px), y al
   historial le quedaban ~150px. En su celda la etiqueta va arriba y el historial usa todo el
   ancho de la tarjeta. Los selectores repiten los de estilos.css (con #table) para ganarles. */
@media (max-width: 768px) {
	.general_result_rows #table tbody tr td[data-label]:not(.md):not(.xg):has(> .caja-container) {
		flex-direction: column;
		gap: 6px;
	}
	.general_result_rows #table tbody tr td[data-label]:not(.md):not(.xg):has(> .caja-container)::before {
		min-width: 0;
		max-width: none;
	}
	.general_result_rows #table tbody tr td[data-label]:not(.md):not(.xg) > .caja-container {
		word-break: normal;
		overflow-wrap: break-word;
		width: 100%;
		max-width: none;
		box-sizing: border-box;
	}
}


.caja-reset-section {
	margin: 2px 0;
	padding: 2px;
	border-radius: 4px;
	text-align: center;
}

.caja-reset-btn {
	background: linear-gradient(#dc3545, #dc3545);
	color: white;
	border: none;
	padding: 8px 16px;
	border-radius: 4px;
	cursor: pointer;
	font-size: var(--fs-xs);
	font-weight: 600;
	transition: all 0.2s ease;
	display: inline-flex;
	align-items: center;
	gap: 5px;
	text-decoration: none;
}

.caja-reset-btn:hover {
	background: linear-gradient(#c82333, #c82333);
	transform: translateY(-1px);
	box-shadow: 0 2px 6px rgba(220, 53, 69, 0.3);
	color: white;
	text-decoration: none;
}

.caja-reset-btn i {
	font-size: var(--fs-xs);
}

.caja-select-wrapper {
	margin: 10px 0;
}

.caja-select-label {
	font-size: var(--fs-xs);
	font-weight: 600;
	color: #495057;
	margin-bottom: 5px;
	display: flex;
	align-items: center;
	gap: 4px;
}

.caja-select-label i {
	font-size: var(--fs-xs);
	color: #408892;
}

.caja-select-wrapper select {
	width: 100%;
	padding: 8px 10px;
	border: 1px solid #d1dce5;
	border-radius: 4px;
	font-size: var(--fs-xs);
	color: #495057;
	background: white;
	cursor: pointer;
	transition: all 0.2s ease;
	appearance: none;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23408892' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 8px center;
	padding-right: 28px;
}

.caja-select-wrapper select:hover {
	border-color: #408892;
}

.caja-select-wrapper select:focus {
	outline: none;
	border-color: #408892;
	box-shadow: 0 0 0 2px rgba(64, 136, 146, 0.1);
}

.caja-print-section {
	display: flex;
	gap: 6px;
	margin-top: 10px;
	padding-top: 10px;
	border-top: 1px dashed #d1dce5;
}

.caja-print-btn {
	flex: 1;
	padding: 8px 10px;
	font-size: var(--fs-xs);
	border-radius: 4px;
	transition: all 0.2s ease;
	border: none;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 5px;
	font-weight: 600;
	text-decoration: none;
	background: var(--brand-fill);
	color: white;
}

.caja-print-btn:hover {
	transform: translateY(-1px);
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
	color: white;
	text-decoration: none;
}

.caja-print-btn img {
	width: 14px;
	height: 14px;
}

/* ---- Resumen de observaciones repetidas ---- */

.caja-repetidos {
	margin-top: 8px;
	padding-top: 8px;
	border-top: 1px dashed #d1dce5;
}

.caja-repetidos[hidden] {
	display: none;
}

.caja-repetidos-head {
	display: flex;
	align-items: center;
	gap: 5px;
	margin-bottom: 6px;
	font-size: var(--fs-xs);
	font-weight: 600;
	color: #2d6068;
	text-transform: uppercase;
	letter-spacing: 0.3px;
}

.caja-repetidos-head i {
	font-size: var(--fs-xs);
	color: #408892;
}

.caja-repetidos-count {
	margin-left: auto;
	background: rgba(64, 136, 146, 0.15);
	color: #2d6068;
	border-radius: 10px;
	padding: 1px 7px;
	font-size: var(--fs-xs);
	font-weight: 600;
	letter-spacing: 0;
}

.caja-repetidos-body {
	max-height: 120px;
	overflow-y: auto;
}

.caja-repetidos-body::-webkit-scrollbar {
	width: 6px;
}

.caja-repetidos-body::-webkit-scrollbar-track {
	background: #f1f3f5;
	border-radius: 3px;
}

.caja-repetidos-body::-webkit-scrollbar-thumb {
	background: rgba(64, 136, 146, 0.5);
	border-radius: 3px;
}

.caja-rep-item {
	display: flex;
	align-items: center;
	gap: 8px;
	width: 100%;
	padding: 5px 6px;
	margin: 0 0 2px 0;
	background: none;
	border: none;
	border-left: 3px solid transparent;
	border-radius: 3px;
	font-family: inherit;
	font-size: var(--fs-xs);
	color: #495057;
	text-align: left;
	cursor: pointer;
	transition: background 0.15s ease;
}

.caja-rep-item:hover {
	background: rgba(64, 136, 146, 0.08);
}

.caja-rep-item.is-active {
	background: rgba(64, 136, 146, 0.12);
	border-left-color: #408892;
}

.caja-rep-main {
	flex: 1;
	min-width: 0;
}

.caja-rep-label {
	display: block;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	font-weight: 500;
	color: #343a40;
}

.caja-rep-mov {
	display: inline-block;
	margin-top: 2px;
	padding: 1px 5px;
	border-radius: 3px;
	background: rgba(64, 136, 146, 0.12);
	color: #2d6068;
	font-size: var(--fs-xs);
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.3px;
}

.caja-rep-count {
	flex: none;
	background: #e9edf0;
	color: #495057;
	border-radius: 10px;
	padding: 1px 6px;
	font-size: var(--fs-xs);
	font-weight: 600;
	white-space: nowrap;
}

.caja-rep-monto {
	flex: none;
	font-weight: 600;
	color: #2d6068;
	white-space: nowrap;
}

.caja-repetidos-total {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-top: 6px;
	padding-top: 6px;
	border-top: 1px dashed #d1dce5;
	font-size: var(--fs-xs);
	color: #495057;
}

.caja-repetidos-total[hidden] {
	display: none;
}

.caja-repetidos-total .caja-rep-monto {
	font-size: var(--fs-sm);
}

.caja-table tbody tr.caja-row-match > td {
	background: rgba(64, 136, 146, 0.15);
}

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


/* ── reportes/reporte_ventas_result.php ──────────────────────────── */
/* Moved from the view. Layout rules are this report's own; the shared
   look (KPIs, tables, empty state) is unified by the "Reportes: piel
   comun" layer at the end of this file. */

.rv-kpi-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
	gap: 12px;
	margin-bottom: 12px;
}
.rv-kpi {
	background: #fff;
	border: 1px solid rgba(8,22,35,0.10);
	border-left: 4px solid #408892;
	border-radius: 7px;
	padding: 12px 16px;
	box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}
.rv-kpi.rv-kpi-money { border-left-color: #1d6f3f; }
.rv-kpi.rv-kpi-disc  { border-left-color: #f0ad4e; }
.rv-kpi.rv-kpi-net   { border-left-color: #2d6068; }
.rv-kpi__label {
	font-size: var(--fs-xs);
	color: #888;
	text-transform: uppercase;
	letter-spacing: 0.6px;
	margin-bottom: 4px;
}
.rv-kpi__value {
	font-size: var(--fs-xl);
	font-weight: 700;
	color: #2d6068;
	line-height: 1.1;
}
.rv-kpi.rv-kpi-money .rv-kpi__value { color: #155b32; }
.rv-kpi.rv-kpi-disc  .rv-kpi__value { color: #c98027; }
.rv-kpi.rv-kpi-net   .rv-kpi__value { color: #2d6068; }
.rv-kpi__sub { font-size: var(--fs-xs); color: #999; margin-top: 2px; }
.rv-kpi__split { display: flex; gap: 14px; margin-top: 4px; }
.rv-kpi__split > div { flex: 1; }
.rv-kpi__split .rv-kpi__minival { font-size: var(--fs-base); font-weight: 700; color: #2d6068; }
.rv-kpi__split .rv-kpi__minilabel { font-size: var(--fs-xs); color: #888; text-transform: uppercase; }

.rv-bars {
	background: #fff;
	border: 1px solid rgba(8,22,35,0.10);
	border-radius: 7px;
	padding: 10px 14px;
	margin-bottom: 12px;
}
.rv-bars__title {
	font-size: var(--fs-xs);
	color: #888;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	margin-bottom: 8px;
}
.rv-bars__row {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 4px;
	font-size: var(--fs-xs);
}
.rv-bars__date { width: 78px; color: #555; font-variant-numeric: tabular-nums; }
.rv-bars__bar  { flex: 1; height: 14px; background: #f0f3f4; border-radius: 3px; overflow: hidden; position: relative; }
.rv-bars__fill {
	height: 100%;
	background: linear-gradient(#408892, #408892);
	border-radius: 3px;
	min-width: 1px;
}
.rv-bars__val { width: 110px; text-align: right; color: #2d6068; font-weight: 600; font-variant-numeric: tabular-nums; }
.rv-bars__cnt { width: 60px; text-align: right; color: #999; font-size: var(--fs-xs); }

.rv-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-bottom: 10px;
}
.rv-chip {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	background: rgba(64,136,146,0.10);
	color: #2d6068;
	padding: 3px 10px;
	border-radius: 12px;
	font-size: var(--fs-sm);
}
.rv-chip strong { font-weight: 600; }
.rv-chip a { color: #2d6068; text-decoration: none; font-weight: 700; opacity: 0.6; }
.rv-chip a:hover { opacity: 1; }

.rv-table-wrap {
	background: #fff;
	border: 1px solid rgba(8,22,35,0.10);
	border-radius: 7px;
	overflow: auto;
	max-height: 70vh;
}
.rv-table {
	width: 100%;
	border-collapse: collapse;
	font-size: var(--fs-md);
}
.rv-table thead th {
	background: linear-gradient(rgba(64,136,146,0.20), rgba(64,136,146,0.20));
	color: #fff;
	font-weight: 600;
	padding: 9px 10px;
	text-align: var(--table-align);
	border-bottom: 1px solid rgba(45,96,104,0.20);
	position: sticky;
	top: 0;
	z-index: 2;
	white-space: nowrap;
}
.rv-table thead th a.rv-sort { color: #fff; text-decoration: none; }
.rv-table thead th a.rv-sort:hover { text-decoration: underline; }
.rv-table tbody td {
	padding: 8px 10px;
	border-bottom: 1px solid #f0f0f0;
	vertical-align: middle;
}
.rv-table tbody tr:hover { background: rgba(64,136,146,0.04); }
.rv-table tbody tr.rv-row-cancel { text-decoration: line-through; opacity: 0.65; }
.rv-cae    { font-family: Menlo, Monaco, Consolas, monospace; font-size: var(--fs-sm); color: #555; }
.rv-titulo { font-weight: 600; color: #2d6068; }
.rv-titulo a { color: inherit; text-decoration: none; }
.rv-titulo a:hover { text-decoration: underline; }
.rv-num    { text-align: var(--table-align); white-space: nowrap; font-variant-numeric: tabular-nums; }
.rv-amount-pos { color: #155b32; font-weight: 600; }
.rv-amount-neg { color: #b8443f; font-weight: 600; }

.rv-badge {
	display: inline-block;
	padding: 2px 8px;
	border-radius: 10px;
	font-size: var(--fs-xs);
	font-weight: 600;
	white-space: nowrap;
}
.rv-badge-ok   { background: rgba(92,184,92,0.18);  color: #2d7a36; }
.rv-badge-warn { background: rgba(240,173,78,0.20); color: #b87614; }
.rv-badge-info { background: rgba(64,136,146,0.18); color: #2d6068; }
.rv-badge-out  { background: rgba(217,83,79,0.18);  color: #b8443f; }
.rv-badge-pend { background: rgba(150,150,150,0.18); color: #555; }

.rv-action-btn {
	background: #2d6068;
	color: #fff;
	padding: 4px 10px;
	border-radius: 4px;
	font-size: var(--fs-xs);
	font-weight: 600;
	text-decoration: none;
	white-space: nowrap;
}
.rv-action-btn:hover { background: #224b52; color: #fff; }
.rv-action-btn i { margin-right: 3px; }

.rv-empty {
	padding: 30px 20px;
	text-align: center;
	color: #999;
	font-size: var(--fs-md);
}
.rv-summary-row td {
	background: #fafbfb;
	font-weight: 700;
	color: #2d6068;
	border-top: 2px solid rgba(45,96,104,0.20);
}


/* ── reportes/reporte_stock_result.php ───────────────────────────── */
/* Moved from the view. Layout rules are this report's own; the shared
   look (KPIs, tables, empty state) is unified by the "Reportes: piel
   comun" layer at the end of this file. */

.rs-kpi-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
	gap: 12px;
	margin-bottom: 16px;
}
.rs-kpi {
	background: #fff;
	border: 1px solid rgba(8,22,35,0.10);
	border-left: 4px solid #408892;
	border-radius: 7px;
	padding: 12px 16px;
	box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}
.rs-kpi.rs-kpi-warn { border-left-color: #f0ad4e; }
.rs-kpi.rs-kpi-out  { border-left-color: #d9534f; }
.rs-kpi__label {
	font-size: var(--fs-xs);
	color: #888;
	text-transform: uppercase;
	letter-spacing: 0.6px;
	margin-bottom: 4px;
}
.rs-kpi__value {
	font-size: var(--fs-xl);
	font-weight: 700;
	color: #2d6068;
	line-height: 1.1;
}
.rs-kpi.rs-kpi-warn .rs-kpi__value { color: #c98027; }
.rs-kpi.rs-kpi-out  .rs-kpi__value { color: #b8443f; }
.rs-kpi__sub { font-size: var(--fs-xs); color: #999; margin-top: 2px; }

.rs-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-bottom: 10px;
}
.rs-chip {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	background: rgba(64,136,146,0.10);
	color: #2d6068;
	padding: 3px 10px;
	border-radius: 12px;
	font-size: var(--fs-sm);
}
.rs-chip strong { font-weight: 600; }
.rs-chip a { color: #2d6068; text-decoration: none; font-weight: 700; opacity: 0.6; }
.rs-chip a:hover { opacity: 1; }

.rs-table-wrap {
	background: #fff;
	border: 1px solid rgba(8,22,35,0.10);
	border-radius: 7px;
	overflow: auto;
	max-height: 70vh;
}
.rs-table {
	width: 100%;
	border-collapse: collapse;
	font-size: var(--fs-md);
}
.rs-table thead th {
	background: linear-gradient(rgba(64,136,146,0.20), rgba(64,136,146,0.20));
	color: #fff;
	font-weight: 600;
	padding: 9px 10px;
	text-align: var(--table-align);
	border-bottom: 1px solid rgba(45,96,104,0.20);
	position: sticky;
	top: 0;
	z-index: 2;
	white-space: nowrap;
}
.rs-table thead th a.rs-sort {
	color: #fff;
	text-decoration: none;
}
.rs-table thead th a.rs-sort:hover { text-decoration: underline; }
.rs-table tbody td {
	padding: 8px 10px;
	border-bottom: 1px solid #f0f0f0;
	vertical-align: middle;
}
.rs-table tbody tr:hover { background: rgba(64,136,146,0.04); }
.rs-codigo { font-family: Menlo, Monaco, Consolas, monospace; font-size: var(--fs-sm); color: #555; }
.rs-titulo { font-weight: 600; color: #2d6068; }
.rs-titulo a { color: inherit; text-decoration: none; }
.rs-titulo a:hover { text-decoration: underline; }
.rs-num { text-align: var(--table-align); white-space: nowrap; font-variant-numeric: tabular-nums; }
.rs-stock {
	display: inline-block;
	min-width: 56px;
	text-align: center;
	padding: 3px 8px;
	border-radius: 4px;
	font-weight: 700;
}
.rs-stock-ok   { background: rgba(64,136,146,0.12); color: #2d6068; }
.rs-stock-warn { background: rgba(240,173,78,0.18); color: #b87614; }
.rs-stock-out  { background: rgba(217,83,79,0.18);  color: #b8443f; }
.rs-deps {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
}
.rs-dep-pill {
	background: rgba(64,136,146,0.08);
	color: #2d6068;
	padding: 2px 7px;
	border-radius: 3px;
	font-size: var(--fs-xs);
}
.rs-dep-pill .rs-dep-q { font-weight: 700; margin-left: 3px; }
.rs-action-btn {
	background: #2d6068;
	color: #fff;
	padding: 4px 10px;
	border-radius: 4px;
	font-size: var(--fs-xs);
	font-weight: 600;
	text-decoration: none;
	white-space: nowrap;
}
.rs-action-btn:hover { background: #224b52; color: #fff; }
.rs-action-btn i { margin-right: 3px; }

.rs-empty {
	padding: 30px 20px;
	text-align: center;
	color: #999;
	font-size: var(--fs-md);
}
.rs-summary-row td {
	background: #fafbfb;
	font-weight: 700;
	color: #2d6068;
	border-top: 2px solid rgba(45,96,104,0.20);
}
/* Export link is rendered as a hidden payload below and moved next to the
   "Exportar Excel" checkbox by the filter view's AJAX done handler. */


/* ── reportes/reporte_completo_assets.php ────────────────────────── */
/* Moved from the view. Layout rules are this report's own; the shared
   look (KPIs, tables, empty state) is unified by the "Reportes: piel
   comun" layer at the end of this file. */

/* ============================================================
   tables/reporte_completo — prefijo rc-
   Varias reglas neutralizan selectores de elemento de estilos.css
   (table / thead / th / td), que estan pensados para el listado.
   ============================================================ */

.rc-report,
.rc-caja {
	margin: 0 0 18px 0;
	background: #fff;
	border: 1px solid rgba(8,22,35,0.12);
	border-radius: 7px;
	overflow: hidden;
	font-family: 'Lato', 'Roboto', sans-serif;
	color: #343a40;
}

.rc-head,
.rc-caja-head {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	padding: 11px 16px;
	background: var(--brand-fill);
	color: #fff;
	font-size: var(--fs-base);
	font-weight: 700;
	letter-spacing: 0.3px;
}

.rc-head i,
.rc-caja-head i { font-size: var(--icon-md); opacity: 0.85; }

.rc-head-sep {
	margin-left: auto;
	font-size: var(--fs-sm);
	font-weight: 600;
	opacity: 0.9;
	letter-spacing: 0.2px;
}

/* ---- KPI cards ---- */

.rc-kpi-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
	gap: 10px;
	padding: 14px 16px 4px 16px;
}

.rc-kpi {
	/* min-width:0 es obligatorio: por defecto un grid item vale min-content, asi
	   que una tabla o un monto largo estiran la celda y desbordan la pagina. */
	min-width: 0;
	background: #fff;
	border: 1px solid rgba(8,22,35,0.10);
	border-left: 4px solid #408892;
	border-radius: 5px;
	padding: 9px 11px;
	box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}

.rc-kpi__value { overflow-wrap: anywhere; }

.rc-kpi__label {
	font-size: var(--fs-xs);
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.6px;
	color: #888;
	margin-bottom: 3px;
}

.rc-kpi__value {
	font-size: var(--fs-xl);
	font-weight: 700;
	color: #2d6068;
	line-height: 1.25;
	font-variant-numeric: tabular-nums;
}

.rc-kpi__sub { margin-top: 3px; font-size: var(--fs-xs); color: #868e96; }

.rc-kpi-pos  { border-left-color: #1d6f3f; }
.rc-kpi-pos  .rc-kpi__value { color: #155b32; }
.rc-kpi-neg  { border-left-color: #b8443f; }
.rc-kpi-neg  .rc-kpi__value { color: #b8443f; }
.rc-kpi-disc { border-left-color: #f0ad4e; }
.rc-kpi-disc .rc-kpi__value { color: #c98027; }
.rc-kpi-net  { border-left-color: #2d6068; }
.rc-kpi-net  .rc-kpi__value { color: #2d6068; }

/* ---- Grilla de cards ---- */

.rc-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
	gap: 12px;
	padding: 12px 16px 16px 16px;
	align-items: start;
}

.rc-card {
	/* Idem .rc-kpi: sin min-width:0 la tabla ancha de movimientos estira la card,
	   estira la grilla y termina desbordando el ancho de la pantalla en movil. */
	min-width: 0;
	background: #fff;
	border: 1px solid rgba(8,22,35,0.10);
	border-radius: 5px;
	overflow: hidden;
	box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}

/* La tabla de movimientos es una card mas del grid, del mismo ancho que Facturas
   o Totales. Como queda angosta, sus columnas de texto parten palabras largas en
   vez de estirar la tabla y disparar el scroll horizontal del contenedor. */
.rc-mov-table td { overflow-wrap: anywhere; }
.rc-mov-table td.rc-time,
.rc-mov-table td.rc-num { overflow-wrap: normal; }

/* La observacion va como segunda linea debajo del movimiento en vez de ocupar
   una cuarta columna: con la card al ancho normal del grid, 4 columnas dejaban
   el monto fuera de vista. */
.rc-mov-obs {
	display: block;
	margin-top: 1px;
	color: #6b7780;
	font-size: var(--fs-xs);
	line-height: 1.35;
}

.rc-card-head {
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 7px 11px;
	background: var(--brand-fill);
	color: #fff;
	font-size: var(--fs-xs);
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.rc-card-head i { font-size: var(--fs-xs); opacity: 0.85; }
.rc-card-head .rc-card-head-extra { margin-left: auto; font-weight: 600; opacity: 0.9; }

.rc-card-body { padding: 8px 11px; }

/* ---- Tablas ---- */

.rc-table-wrap { min-width: 0; max-height: 60vh; overflow: auto; }
.rc-table-wrap::-webkit-scrollbar { width: 7px; height: 7px; }
.rc-table-wrap::-webkit-scrollbar-track { background: #f1f3f5; }
.rc-table-wrap::-webkit-scrollbar-thumb { background: rgba(64,136,146,0.5); border-radius: 3px; }

.rc-table {
	width: 100%;
	margin: 0;
	background: #fff;
	border: 0;
	border-radius: 0;
	border-collapse: collapse;
	box-shadow: none;
	color: #343a40;
	font-size: var(--fs-md);
	font-weight: 400;
	line-height: 1.5;
	text-align: var(--table-align);
}

.rc-table thead,
.rc-table thead tr { background: transparent; border-radius: 0; }

.rc-table thead th,
.rc-table thead tr th,
.rc-table thead tr th:nth-child(1),
.rc-table thead tr th:nth-last-child(-n + 1) {
	position: sticky;
	top: 0;
	z-index: 2;
	/* Color plano, no el gradiente: al pintarse por celda, cada th reiniciaba el
	   degradado y quedaba una costura visible entre columnas. El gradiente de
	   marca lo lleva .rc-card-head, que si ocupa el ancho completo. */
	background: #2d6068;
	color: #fff;
	border: 0;
	border-radius: 0;
	padding: 7px 10px;
	font-size: var(--fs-xs);
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.4px;
	text-align: var(--table-align);
	vertical-align: middle;
}

.rc-table td {
	border: 0;
	border-bottom: 1px solid #f0f2f4;
	padding: 6px 10px;
	text-align: var(--table-align);
	vertical-align: middle;
}

.rc-table tbody tr:last-child td { border-bottom: 0; }
.rc-table tbody tr:hover > td { background: rgba(64,136,146,0.045); }

.rc-table tfoot td {
	border: 0;
	border-top: 1px solid #e3e8ec;
	padding: 6px 10px;
	background: #fafbfc;
	font-weight: 700;
	color: #2d6068;
}

.rc-num,
.rc-table th.rc-num,
.rc-table td.rc-num {
	text-align: var(--table-align);
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

.rc-amount { font-variant-numeric: tabular-nums; white-space: nowrap; }
.rc-amount-pos { color: #155b32; }
.rc-amount-neg { color: #b8443f; }

.rc-strong td { font-weight: 700; color: #2d6068; }
.rc-empty { padding: 12px 11px; color: #868e96; font-size: var(--fs-sm); font-style: italic; }
.rc-time { color: #868e96; white-space: nowrap; }

/* ---- Badges ---- */

.rc-badge {
	display: inline-block;
	padding: 1px 7px;
	border-radius: 10px;
	background: rgba(255,255,255,0.22);
	color: #fff;
	font-size: var(--fs-xs);
	font-weight: 600;
	letter-spacing: 0.3px;
	text-transform: none;
}

.rc-badge-ok   { background: rgba(21,91,50,0.16);  color: #155b32; }
.rc-badge-warn { background: rgba(240,173,78,0.22); color: #8a5a00; }
.rc-badge-neg  { background: rgba(184,68,63,0.16);  color: #b8443f; }
.rc-badge-info { background: rgba(64,136,146,0.16); color: #2d6068; }

/* Sobre el header teal las variantes oscuras quedan ilegibles (texto teal sobre
   teal). Dentro del header todos los badges van claros. */
.rc-caja-head .rc-badge,
.rc-head .rc-badge { background: rgba(255,255,255,0.20); color: #fff; }
.rc-caja-head .rc-badge-warn,
.rc-head .rc-badge-warn { background: rgba(255,196,120,0.30); color: #ffe4bd; }

/* ---- Resumen de observaciones repetidas ---- */

.rc-repetidos {
	margin: 0;
	padding: 8px 11px;
	border-top: 1px dashed #d1dce5;
	background: #fbfcfd;
}

.rc-repetidos[hidden] { display: none; }

.rc-repetidos-head {
	display: flex;
	align-items: center;
	gap: 5px;
	margin-bottom: 6px;
	font-size: var(--fs-xs);
	font-weight: 600;
	color: #2d6068;
	text-transform: uppercase;
	letter-spacing: 0.3px;
}

.rc-repetidos-head i { font-size: var(--fs-xs); color: #408892; }

.rc-repetidos-count {
	margin-left: auto;
	background: rgba(64,136,146,0.15);
	color: #2d6068;
	border-radius: 10px;
	padding: 1px 7px;
	font-size: var(--fs-xs);
	font-weight: 600;
	letter-spacing: 0;
}

.rc-repetidos-body { max-height: 150px; overflow-y: auto; }

.rc-rep-item {
	display: flex;
	align-items: center;
	gap: 8px;
	width: 100%;
	padding: 5px 6px;
	margin: 0 0 2px 0;
	background: none;
	border: none;
	border-left: 3px solid transparent;
	border-radius: 3px;
	font-family: inherit;
	font-size: var(--fs-xs);
	color: #495057;
	text-align: left;
	cursor: pointer;
	transition: background 0.15s ease;
}

.rc-rep-item:hover { background: rgba(64,136,146,0.08); }
.rc-rep-item.is-active { background: rgba(64,136,146,0.12); border-left-color: #408892; }

.rc-rep-main { flex: 1; min-width: 0; }

.rc-rep-label {
	display: block;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	font-weight: 500;
	color: #343a40;
}

.rc-rep-mov {
	display: inline-block;
	margin-top: 2px;
	padding: 1px 5px;
	border-radius: 3px;
	background: rgba(64,136,146,0.12);
	color: #2d6068;
	font-size: var(--fs-xs);
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.3px;
}

.rc-rep-count {
	flex: none;
	background: #e9edf0;
	color: #495057;
	border-radius: 10px;
	padding: 1px 6px;
	font-size: var(--fs-xs);
	font-weight: 600;
	white-space: nowrap;
}

.rc-rep-monto {
	flex: none;
	font-weight: 600;
	color: #155b32;
	white-space: nowrap;
	font-variant-numeric: tabular-nums;
}

.rc-rep-monto.is-neg { color: #b8443f; }

.rc-repetidos-total {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-top: 6px;
	padding-top: 6px;
	border-top: 1px dashed #d1dce5;
	font-size: var(--fs-xs);
	font-weight: 600;
	color: #495057;
}

.rc-repetidos-total[hidden] { display: none; }
.rc-repetidos-total .rc-rep-monto { font-size: var(--fs-sm); }

.rc-table tbody tr.rc-row-match > td { background: rgba(64,136,146,0.15); }

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

@media (max-width: 640px) {
	.rc-kpi-grid { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); padding: 10px 10px 2px 10px; }
	.rc-grid { grid-template-columns: 1fr; padding: 10px; }
	.rc-head, .rc-caja-head { padding: 9px 11px; font-size: var(--fs-base); }
	.rc-head-sep { margin-left: 0; width: 100%; }
	.rc-table-wrap { max-height: none; }
}

/* ---- Impresion ---- */

@media print {
	.rc-report, .rc-caja { border: 1px solid #999; box-shadow: none; page-break-inside: auto; }
	.rc-card { break-inside: avoid; page-break-inside: avoid; box-shadow: none; }
	.rc-table-wrap { max-height: none; overflow: visible; }
	.rc-table thead th,
	.rc-table thead tr th { position: static; }
	.rc-repetidos { display: none; }
	.rc-head, .rc-caja-head, .rc-card-head, .rc-table thead th {
		-webkit-print-color-adjust: exact;
		print-color-adjust: exact;
	}
}



/* ═══════════════════════════════════════════════════════════════════
   REPORTES: PIEL COMÚN
   The three report views (ventas `rv-`, stock `rs-`, cierre de caja
   `rc-`) each shipped their own copy of the same KPI / table / badge kit.
   Their layout stays theirs (moved verbatim above); this layer only
   decides how those shared pieces *look*, once, with theme tokens, so
   the three reports read as one product. It comes last so it wins at
   equal specificity, and it avoids layout properties (grid columns,
   padding, max-height) so each report's responsive rules still apply.
   ═══════════════════════════════════════════════════════════════════ */

/* ── KPI cards ──────────────────────────────────────────────────────── */

.rv-kpi,
.rs-kpi,
.rc-kpi {
	background: var(--surface);
	border: 1px solid var(--line);
	border-left: 3px solid var(--brand-500);
	border-radius: var(--r-md);
	box-shadow: var(--sh-1);
	animation: ui-enter var(--dur-3) var(--ease-out) backwards;
}

.rv-kpi-grid > :nth-child(2), .rs-kpi-grid > :nth-child(2), .rc-kpi-grid > :nth-child(2) { animation-delay: 40ms; }
.rv-kpi-grid > :nth-child(3), .rs-kpi-grid > :nth-child(3), .rc-kpi-grid > :nth-child(3) { animation-delay: 80ms; }
.rv-kpi-grid > :nth-child(4), .rs-kpi-grid > :nth-child(4), .rc-kpi-grid > :nth-child(4) { animation-delay: 120ms; }
.rv-kpi-grid > :nth-child(n+5), .rs-kpi-grid > :nth-child(n+5), .rc-kpi-grid > :nth-child(n+5) { animation-delay: 160ms; }

.rv-kpi__label,
.rs-kpi__label,
.rc-kpi__label,
.rv-kpi__split .rv-kpi__minilabel {
	color: var(--ink-mute);
	font-weight: 700;
	letter-spacing: .06em;
}

.rv-kpi__value,
.rs-kpi__value,
.rc-kpi__value,
.rv-kpi__split .rv-kpi__minival {
	color: var(--ink);
	letter-spacing: -.01em;
	font-variant-numeric: tabular-nums;
}

.rv-kpi__sub,
.rs-kpi__sub,
.rc-kpi__sub { color: var(--ink-mute); }

/* Semantic accents — one palette across the three reports */
.rv-kpi.rv-kpi-money,
.rc-kpi.rc-kpi-pos  { border-left-color: var(--ok); }
.rv-kpi.rv-kpi-disc,
.rs-kpi.rs-kpi-warn { border-left-color: var(--warn); }
.rs-kpi.rs-kpi-out,
.rc-kpi.rc-kpi-neg  { border-left-color: var(--danger); }
.rv-kpi.rv-kpi-net  { border-left-color: var(--brand-600); }

.rc-kpi-pos .rc-kpi__value { color: var(--ok); }
.rc-kpi-neg .rc-kpi__value { color: var(--danger); }
.rv-kpi.rv-kpi-gain  { border-left-color: var(--ok); }
.rv-kpi.rv-kpi-gain .rv-kpi__value { color: var(--ok); }
.rv-kpi.rv-kpi-gain.is-neg { border-left-color: var(--danger); }
.rv-kpi.rv-kpi-gain.is-neg .rv-kpi__value { color: var(--danger); }
.rv-kpi__aviso { font-size: var(--fs-xs); color: var(--warn); margin-top: 2px; }
/* De dónde sale el margen: ganancia ÷ vendido sin IVA, y el costo */
.rv-kpi__formula { display: flex; flex-direction: column; gap: 1px; margin-top: 2px; font-size: var(--fs-xs); color: var(--ink-mute); font-variant-numeric: tabular-nums; cursor: help; }


/* ── Tables ─────────────────────────────────────────────────────────── */

.rv-table-wrap,
.rs-table-wrap {
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: var(--r-md);
	box-shadow: var(--sh-1);
}

/* Header. These were white text on a 20% teal wash, readable only while
   the global navy <thead> showed through underneath; with the lighter
   theme header it had become white on near-white. Same treatment as the
   listing tables now. (rc keeps its dark header: its tables sit inside
   dark-headed caja cards and are printed.) */
.rv-table thead th,
.rs-table thead th {
	background: var(--surface-alt);
	color: var(--ink-soft);
	border-bottom: 2px solid var(--line-strong);
	font-size: var(--fs-xs);
	font-weight: 700;
	letter-spacing: .06em;
	text-transform: uppercase;
	white-space: nowrap;
}

.rv-table thead th a.rv-sort,
.rs-table thead th a.rs-sort {
	color: var(--ink-soft);
	transition: color var(--dur-1) var(--ease-out);
}

.rv-table thead th a.rv-sort:hover,
.rs-table thead th a.rs-sort:hover {
	color: var(--brand-600);
	text-decoration: none;
}

.rv-table tbody td,
.rs-table tbody td { border-bottom: 1px solid var(--line); }

.rv-table tbody tr,
.rs-table tbody tr { transition: background-color var(--dur-1) var(--ease-out); }

.rv-table tbody tr:hover,
.rs-table tbody tr:hover,
.rc-table tbody tr:hover > td { background: var(--brand-50); }

.rc-table thead th,
.rc-table thead tr th { background: var(--brand-600); }

.rc-table tbody tr.rc-row-match > td { background: var(--brand-100); }

.rv-empty,
.rs-empty,
.rc-empty { color: var(--ink-mute); }


/* ── Status chips ───────────────────────────────────────────────────── */
/* Same five meanings everywhere, same colours. rc's chips inside its dark
   card heads keep their own white-on-dark treatment (more specific). */

.rv-badge,
.rs-stock {
	border: 1px solid transparent;
	border-radius: var(--r-pill);
	font-variant-numeric: tabular-nums;
}

.rv-badge-ok,
.rs-stock-ok,
.rc-badge-ok      { background: var(--ok-soft);     color: var(--ok);       border-color: var(--ok-border); }

.rv-badge-warn,
.rs-stock-warn,
.rc-badge-warn    { background: var(--warn-soft);   color: var(--warn);     border-color: var(--warn-border); }

.rv-badge-out,
.rs-stock-out,
.rc-badge-neg     { background: var(--danger-soft); color: var(--danger);   border-color: var(--danger-border); }

.rv-badge-info,
.rc-badge-info    { background: var(--brand-50);    color: var(--brand-700); border-color: var(--brand-100); }

.rv-badge-pend    { background: var(--bg-sunken);   color: var(--ink-soft); }

.rs-dep-pill {
	background: var(--brand-50);
	color: var(--brand-700);
	border-radius: var(--r-pill);
	padding: 2px 8px;
}


/* ── Sales bars (reporte de ventas) ─────────────────────────────────── */
/* The fill width comes inline from PHP; scaleX grows it from zero up to
   that width, row after row. */

.rv-bars__bar {
	background: var(--bg-sunken);
	border-radius: var(--r-pill);
}

.rv-bars__fill {
	background: var(--brand-fill);
	border-radius: var(--r-pill);
	transform-origin: left center;
	animation: ui-grow-x var(--dur-4) var(--ease-out) backwards;
}

.rv-bars__row:nth-child(2) .rv-bars__fill  { animation-delay: 30ms; }
.rv-bars__row:nth-child(3) .rv-bars__fill  { animation-delay: 60ms; }
.rv-bars__row:nth-child(4) .rv-bars__fill  { animation-delay: 90ms; }
.rv-bars__row:nth-child(5) .rv-bars__fill  { animation-delay: 120ms; }
.rv-bars__row:nth-child(6) .rv-bars__fill  { animation-delay: 150ms; }
.rv-bars__row:nth-child(7) .rv-bars__fill  { animation-delay: 180ms; }
.rv-bars__row:nth-child(n+8) .rv-bars__fill { animation-delay: 210ms; }


/* ═══════════════════════════════════════════════════════════════════
   VENTAS: ANULAR, DEVOLUCIÓN / CAMBIO, SALDO A FAVOR, COMPROBANTES
   ═══════════════════════════════════════════════════════════════════
   Arrived from php84dev with literal colours, two-stop gradients and 11px
   text in estilos.css. Same selectors, one step later in the cascade:
   theme tokens, solid colours, 12px minimum, contrast for the greys. The
   structure (sizes, layout) stays as estilos.css defines it. */

/* ── Modal anular / devolución (.cxv base, .anv anular, .dxv devolución) ─ */
.cxv { font-family: var(--font-sans); font-size: var(--fs-md); color: var(--ink); }
.cxv-intro, .anv-texto { font-size: var(--fs-md); color: var(--ink-soft); line-height: 1.5; }

.cxv-seccion { border-color: var(--line); border-radius: var(--r-md); }
.cxv-seccion-head { color: var(--ink); }
.cxv-master { font-size: var(--fs-sm); }

.cxv-cobros li { font-size: var(--fs-sm); color: var(--ink-soft); }
.cxv-cobros li b { color: var(--ink); font-variant-numeric: tabular-nums; }
.cxv-cobros-total { border-top-color: var(--line); }

.cxv-lista { border-color: var(--line); border-radius: var(--r-sm); }
.cxv-tabla { font-size: var(--fs-sm); }
.cxv-tabla thead th { background: var(--nav-900); color: #fff; font-weight: 600; }
.cxv-tabla tbody td { border-bottom-color: var(--line); }
.cxv-tabla tbody tr.cxv-sel { background: var(--brand-50); }
.cxv-num { font-variant-numeric: tabular-nums; }
.cxv-cod { color: var(--ink-mute); font-size: var(--fs-xs); }

.cxv input[type="checkbox"],
.cxv input[type="radio"] { accent-color: var(--brand-500); }

#cxv-resumen-traslado { color: var(--brand-700); }
#cxv-resumen-baja     { color: var(--danger); }
.cxv-nota { font-size: var(--fs-xs); color: var(--ink-mute); }
.cxv-saldo-titulo { font-size: var(--fs-sm); }

.cxv-monto-wrap label { font-size: var(--fs-xs); color: var(--ink-mute); }
.cxv-monto-wrap input,
.dxv-cant,
.dxv-cli input[type="text"] {
	border: 1px solid var(--field-border);
	border-radius: var(--r-sm);
	background: var(--surface);
	font-family: var(--font-sans);
	color: var(--ink);
}
.cxv-monto-wrap input:focus,
.dxv-cant:focus,
.dxv-cli input[type="text"]:focus { outline: none; border-color: var(--brand-500); box-shadow: var(--focus-ring); }
.cxv-monto-wrap input:disabled,
.dxv-cant:disabled { background: var(--bg-sunken); color: var(--ink-mute); }
#cxv-monto-hint { font-size: var(--fs-xs); color: var(--warn); }

.cxv-retiro, .cxv-nota-caja {
	background: var(--brand-50);
	border: 1px solid var(--brand-200);
	border-radius: var(--r-sm);
	color: var(--ink);
}
.cxv-warn { color: var(--danger); font-size: var(--fs-xs); }

/* Fuera de plazo (devolución) and the anular alert: solid soft tones */
.cxv-warn-plazo {
	background: var(--warn-soft);
	border: 1px solid var(--warn-border);
	border-left: 3px solid var(--warn);
	border-radius: var(--r-sm);
	color: var(--ink);
}
.anv-alerta {
	background: var(--danger-soft);
	border: 1px solid var(--danger-border);
	border-left: 4px solid var(--danger);
	border-radius: var(--r-sm);
	color: var(--ink);
	font-size: var(--fs-sm);
}

.dxv-ayuda { font-size: var(--fs-xs); color: var(--ink-mute); }

/* Customer for a consumidor-final voucher */
.dxv-cli {
	background: var(--brand-50);
	border: 1px solid var(--brand-200);
	border-left: 3px solid var(--brand-600);
	border-radius: var(--r-sm);
}
.dxv-cli-titulo, #dxv-cli-hint { color: var(--brand-700); font-size: var(--fs-sm); }
.dxv-cli-sug {
	border-color: var(--line);
	border-radius: var(--r-sm);
	box-shadow: var(--sh-3);
}
.dxv-cli-sug li { font-size: var(--fs-sm); color: var(--ink); }
.dxv-cli-sug li + li { border-top-color: var(--line); }
.dxv-cli-sug li:hover { background: var(--brand-50); }
.dxv-cli-sug li small { color: var(--ink-mute); font-size: var(--fs-xs); }
.dxv-cli-elegido { border-color: var(--line-strong); border-radius: var(--r-sm); color: var(--ink); font-size: var(--fs-sm); }
.dxv-cli-elegido a { color: var(--brand-600); font-size: var(--fs-xs); }
.dxv-cli-doc { font-size: var(--fs-xs); color: var(--ink-soft); }
.dxv-cli-doc small { color: var(--ink-mute); }

/* Credit-option buttons inside a Swal (cancelación con crédito) */
.swal-btn-credit {
	background: var(--brand-solid);
	border-radius: var(--r-sm);
	font-family: var(--font-sans);
	font-size: var(--fs-md);
	font-weight: 700;
}
.swal-btn-credit:hover { background: var(--brand-hover); }
.swal-btn-credit-secondary {
	background: transparent;
	border: 1px solid var(--line-strong);
	border-radius: var(--r-sm);
	color: var(--ink-soft);
	font-family: var(--font-sans);
	font-size: var(--fs-md);
	font-weight: 600;
}
.swal-btn-credit-secondary:hover { background: var(--bg-sunken); }


/* ── Saldo a favor en el listado de clientes (includes/saldo_favor.php) ── */
.sfl-saldo {
	padding: 2px 10px;
	border-radius: var(--r-pill);
	background: var(--brand-600);
	color: #fff;
	font-size: var(--fs-sm);
	font-weight: 700;
	font-variant-numeric: tabular-nums;
}
.sfl-saldo--cero { background: var(--bg-sunken); color: var(--ink-mute); }
.sfl-detalle summary { font-size: var(--fs-xs); font-weight: 600; color: var(--brand-600); }
.sfl-detalle li { font-size: var(--fs-xs); color: var(--ink-soft); border-top-color: var(--line); }
.sfl-detalle li a { color: var(--brand-600); }
.sfl-detalle li small { color: var(--ink-mute); font-size: var(--fs-xs); }
.sfl-importe { font-variant-numeric: tabular-nums; }
.sfl-pos { color: var(--brand-700); }
.sfl-neg { color: var(--danger); }
.sfl-estado { font-size: var(--fs-xs); color: var(--warn); }


/* ── Visor de comprobantes (includes/doc_modal.php) ─────────────────── */
/* Navy shell like the sidebar, white document in the middle. */
.doc-modal-overlay { background: rgba(11,27,43,.6); }
.doc-modal { background: var(--nav-900); border-radius: var(--r-lg); box-shadow: var(--sh-4); }
.doc-modal__header { background: var(--nav-800); border-bottom-color: var(--nav-line); padding: 12px 16px; }
.doc-modal__icon { color: var(--accent-mint); font-size: var(--icon-lg); }
.doc-modal__title { font-family: var(--font-sans); font-size: var(--fs-base); font-weight: 700; }

.doc-modal__open-tab {
	min-height: var(--hit);
	padding: 0 14px;
	background: rgba(255,255,255,.08);
	border: 1px solid var(--nav-line);
	border-radius: var(--r-sm);
	color: var(--nav-ink);
	font-family: var(--font-sans);
	font-size: var(--fs-sm);
	font-weight: 600;
}
.doc-modal__open-tab:hover { background: rgba(255,255,255,.16); color: #fff; }

.doc-modal__close-btn {
	width: var(--hit);
	height: var(--hit);
	border-radius: var(--r-sm);
	color: var(--nav-ink);
	font-size: var(--icon-lg);
}
.doc-modal__close-btn:hover { background: var(--danger); color: #fff; }
.doc-modal__close-btn:focus-visible,
.doc-modal__open-tab:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(126,232,162,.45); }

.doc-modal__loader { background: var(--nav-900); }
.doc-modal__spinner { border-color: rgba(255,255,255,.15); border-top-color: var(--accent-mint); }
.doc-modal__loader-text { color: var(--nav-ink-soft); font-family: var(--font-sans); font-size: var(--fs-md); }


/* ── Cuenta corriente del cliente (includes/include_cuenta_corriente_cliente.php) ─
   The client's name in the listing, and under it a chip with the account
   balance that unfolds a small statement. Was an inline <style> with 9–11px
   text, gradients and loose hex colours. The statement is a table inside a
   listing cell: the listing rules no longer reach it (they use child
   combinators), but estilos.css's bare `thead` / `thead tr th:nth-child()`
   still do, hence the `.cc-panel .cc-table` prefix on the header. */

.cc-nombre { display: block; }

.cc-cta { margin-top: 6px; text-align: left; }

.cc-cta > summary {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	min-height: 28px;
	padding: 2px 10px;
	border: 1px solid var(--line-strong);
	border-radius: var(--r-pill);
	background: var(--surface);
	color: var(--ink-soft);
	font-size: var(--fs-xs);
	font-weight: 600;
	white-space: nowrap;
	cursor: pointer;
	list-style: none;
	transition: border-color var(--dur-1) var(--ease-out), background-color var(--dur-1) var(--ease-out);
}
.cc-cta > summary::-webkit-details-marker { display: none; }
.cc-cta > summary::marker { content: ''; }
.cc-cta > summary:hover { border-color: var(--brand-300); background: var(--brand-50); }
.cc-cta > summary:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.cc-cta[open] > summary { border-color: var(--brand-300); background: var(--brand-50); }

.cc-cta > summary .fa {
	font-size: var(--icon-sm);
	color: var(--brand-500);
	transition: transform var(--dur-2) var(--ease-spring);
}
.cc-cta[open] > summary .fa { transform: rotate(90deg); }

.cc-cta-monto { font-size: var(--fs-sm); font-weight: 800; font-variant-numeric: tabular-nums; }
.cc-cta-monto.is-deuda { color: var(--danger); }
.cc-cta-monto.is-ok    { color: var(--ok); }

.cc-cta-count {
	padding: 0 7px;
	border-radius: var(--r-pill);
	background: var(--bg-sunken);
	color: var(--ink-mute);
	font-size: var(--fs-xs);
	font-weight: 700;
	font-variant-numeric: tabular-nums;
}

/* Statement card */
.cc-panel {
	margin-top: 8px;
	text-align: left;
	background: var(--surface);
	border: 1px solid var(--line-strong);
	border-radius: var(--r-md);
	box-shadow: var(--sh-1);
	overflow: hidden;
	animation: ui-dropdown-in var(--dur-2) var(--ease-out);
}

.cc-scroll { max-height: 260px; overflow-y: auto; overscroll-behavior: contain; }

.cc-table {
	width: 100%;
	margin: 0;
	border: 0;
	border-collapse: collapse;
	border-radius: 0;
	box-shadow: none;
	background: var(--surface);
	color: var(--ink);
	font-size: var(--fs-sm);
	font-weight: 500;
	line-height: 1.45;
	text-align: var(--table-align);
}

/* Navy header like the listing's, sticky inside its own scroll box. The
   prefix beats estilos.css's bare thead slab and its 7px corner radii. */
.cc-panel .cc-table thead { background: transparent; }

.cc-panel .cc-table thead th,
.cc-panel .cc-table thead tr th:nth-child(1),
.cc-panel .cc-table thead tr th:nth-last-child(-n + 1) {
	position: sticky;
	top: 0;
	z-index: 1;
	padding: 7px 10px;
	border: 0;
	border-radius: 0;
	background: var(--nav-900);
	color: #fff;
	font-size: var(--fs-xs);
	font-weight: 600;
	letter-spacing: 0;
	text-transform: none;
	text-align: var(--table-align);
	white-space: nowrap;
}

.cc-panel .cc-table td {
	padding: 7px 10px;
	border: 0;
	border-bottom: 1px solid var(--line);
	text-align: var(--table-align);
	vertical-align: middle;
}

.cc-panel .cc-table tbody tr:nth-child(even) > td { background: var(--row-alt); }
.cc-panel .cc-table tbody tr:hover > td { background: var(--brand-50); }

.cc-panel .cc-table .cc-num { text-align: var(--table-align); font-variant-numeric: tabular-nums; white-space: nowrap; }
.cc-fecha { white-space: nowrap; font-variant-numeric: tabular-nums; }

.cc-link { color: var(--brand-600); font-weight: 700; text-decoration: none; }
.cc-link:hover { color: var(--brand-700); text-decoration: underline; }

.cc-badge {
	display: inline-block;
	margin-left: 4px;
	padding: 0 7px;
	border-radius: var(--r-pill);
	background: var(--brand-50);
	color: var(--brand-700);
	font-size: var(--fs-xs);
	font-weight: 700;
	line-height: 1.6;
}
.cc-badge-pend { background: var(--warn-soft); color: var(--warn); }

/* Seña / descuento under a sale, and the "y N facturas más" line */
.cc-panel .cc-table .cc-otros > td {
	padding: 0 10px 6px;
	color: var(--warn);
	font-size: var(--fs-xs);
}
.cc-panel .cc-table .cc-mas > td { color: var(--ink-mute); font-size: var(--fs-xs); font-style: italic; }

/* Totals */
.cc-foot { border-top: 1px solid var(--line-strong); }

.cc-foot-row,
.cc-foot-saldo {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	padding: 7px 10px;
	font-size: var(--fs-xs);
	font-weight: 700;
	letter-spacing: .04em;
	text-transform: uppercase;
}

.cc-foot-row { color: var(--ink-soft); background: var(--surface-alt); }

.cc-foot-saldo { background: var(--brand-solid); color: #fff; }

.cc-foot-monto { font-size: var(--fs-md); font-weight: 800; letter-spacing: 0; font-variant-numeric: tabular-nums; }
.cc-foot-saldo .cc-foot-monto { font-size: var(--fs-base); color: #fff; }

@media (prefers-reduced-motion: reduce) {
	.cc-panel { animation: none; }
}


/* Data tables read centred (--table-align, tokens.css); the bodies of
   these tables had no alignment of their own and fell back to left. */
.caja-table td,
.rv-table td,
.rs-table td { text-align: var(--table-align); }
