:root {
    color-scheme: light;
    --fg-border: #cfd8e3;
    --fg-text: #142033;
    --fg-muted: #617086;
    --fg-blue: #1d74b7;
}

.solo-consultas-legend {
    position: fixed;
    top: 8px;
    left: 50%;
    z-index: 5000;
    transform: translateX(-50%);
    padding: 5px 14px;
    border: 2px solid #b91c1c;
    border-radius: 4px;
    background: #fff;
    color: #b91c1c;
    font-size: 15px;
    font-weight: 800;
    line-height: 1.1;
    box-shadow: 0 2px 8px rgb(0 0 0 / 18%);
}

body.solo-consultas-active [data-solo-consultas-disabled="true"] {
    cursor: not-allowed !important;
    opacity: .55 !important;
}

.app-shell.gestoria-mode .workspace-content .desktop-shortcut-toolbar {
    display: none !important;
}

.app-shell.gestoria-mode .workspace-content .toolbar.compact > :not(.app-btn-close),
.app-shell.gestoria-mode .workspace-content .desktop-list-actions > :not(.app-btn-close),
.app-shell.gestoria-mode .workspace-content .factura-actions > :not(.app-btn-close),
.app-shell.gestoria-mode .workspace-content .header-actions > :not(.app-btn-close) {
    display: none !important;
}

.app-shell.gestoria-mode .workspace-content .app-btn-new,
.app-shell.gestoria-mode .workspace-content .app-btn-save,
.app-shell.gestoria-mode .workspace-content .app-btn-list,
.app-shell.gestoria-mode .workspace-content .app-btn-destroy-filters,
.app-shell.gestoria-mode .workspace-content .client-grid-config-button,
.app-shell.gestoria-mode .workspace-content .delete,
.app-shell.gestoria-mode .workspace-content button[title*="Borrar"],
.app-shell.gestoria-mode .workspace-content button[aria-label*="Borrar"] {
    display: none !important;
}

.app-shell.gestoria-mode .workspace-content .toolbar.compact > .gestoria-allowed-list-button,
.app-shell.gestoria-mode .workspace-content .desktop-list-actions > .gestoria-allowed-list-button,
.app-shell.gestoria-mode .workspace-content .gestoria-allowed-list-button {
    display: inline-flex !important;
}

.app-shell.gestoria-mode .msgbox-actions .app-btn-save {
    display: inline-flex !important;
}

.workspace-header .global-header-actions {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex-wrap: nowrap;
}

.workspace-header .global-header-action {
    width: auto;
    min-width: 30px;
    min-height: 30px;
    display: inline-flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 0 2px;
    color: #334155;
    text-decoration: none !important;
    line-height: 1;
}

.workspace-header .global-header-action-text,
.workspace-header .logout-header-text {
    display: inline-flex;
    align-items: center;
    color: #334155;
    font-size: 0.82rem;
    font-weight: 400;
    line-height: 1;
    white-space: nowrap;
    text-decoration: none !important;
}

.workspace-header .global-header-action img,
.workspace-header .logout-classic-icon {
    flex: 0 0 auto;
}

.aux-button-host {
    position: relative;
    display: inline-flex;
    align-items: center;
    margin-right: 10px;
    flex: 0 0 auto;
}

.aux-btn {
    min-width: 88px;
    padding: 8px 12px;
    background: #f5c400;
    border-color: #d6a300;
    color: #09203a;
    font-weight: 900;
}

.aux-btn:hover,
.aux-btn:focus-visible {
    background: #ffd52a;
    border-color: #bd8d00;
    color: #09203a;
}

.aux-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    z-index: 2200;
    width: 260px;
    max-height: 360px;
    overflow: auto;
    padding: 6px;
    background: #ffffff;
    border: 1px solid #9fb6cf;
    box-shadow: 0 12px 28px rgba(15, 23, 42, .18);
}

.aux-menu-dismiss {
    position: fixed;
    inset: 0;
    z-index: 2190;
    background: transparent;
}

.aux-menu button {
    display: block;
    width: 100%;
    padding: 8px 10px;
    border: 0;
    background: transparent;
    color: #142033;
    text-align: left;
    font-weight: 700;
}

.aux-menu button:hover,
.aux-menu button:focus-visible {
    background: #e8f2fb;
}

.aux-dialog-backdrop {
    z-index: 140;
}

.aux-dialog {
    width: min(1180px, calc(100vw - 60px));
    max-height: calc(100vh - 80px);
}

.aux-dialog .app-dialog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.aux-dialog .app-dialog-header div {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.aux-dialog .app-dialog-header span {
    color: #516174;
    font-size: .88rem;
}

.aux-grid-wrap {
    max-height: calc(100vh - 190px);
    overflow: auto;
}

.aux-dialog-toolbar {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 8px 10px;
    border-bottom: 1px solid #cbd8e6;
    background: #eef5fc;
    flex: 0 0 auto;
}

.aux-filter-check {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 30px;
    color: #071733;
    font-weight: 800;
}

.aux-filter-check input {
    width: 16px;
    height: 16px;
}

.aux-grid {
    border-collapse: separate;
    border-spacing: 0;
}

.aux-grid th,
.aux-grid td {
    white-space: nowrap;
}

.aux-grid th {
    top: 0;
    z-index: 30;
    background: #eaf1f8;
    background-clip: padding-box;
    box-shadow: inset 0 1px 0 #cbd8e6, inset 0 -1px 0 #b9c9da;
}

.aux-grid input {
    width: 100%;
    min-width: 120px;
    height: 26px;
    border: 1px solid #a9bdd2;
    background: #fff;
    padding: 2px 6px;
}

.aux-color-editor {
    display: grid;
    grid-template-columns: 34px minmax(110px, 1fr);
    gap: 4px;
}

.aux-color-editor input[type="color"] {
    min-width: 34px;
    padding: 0;
}

.aux-row-actions {
    display: flex;
    gap: 6px;
    min-width: 150px;
}

.aux-row-actions .app-btn {
    min-width: 64px;
    padding: 6px 8px;
}

.article-row-actions {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.article-stat-button {
    border-color: #2563eb;
    color: #0b4f9c;
}

.article-catalog-button {
    color: #fff;
    font-weight: 900;
}

.article-catalog-button.is-cataloged {
    background: #22c55e;
    border-color: #16a34a;
}

.article-catalog-button.is-descataloged {
    background: #ef233c;
    border-color: #dc2626;
}

.article-catalog-button:hover,
.article-catalog-button:focus-visible {
    color: #fff;
    filter: brightness(.95);
}

.article-stat-button:hover,
.article-stat-button:focus-visible {
    background: #dbeafe;
}

.article-stat-button-has-sales {
    background: #ffd400 !important;
    border-color: #eab308 !important;
    color: #111827 !important;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .45);
}

.article-stat-button-has-sales:hover,
.article-stat-button-has-sales:focus-visible {
    background: #ffbf00 !important;
    border-color: #d97706 !important;
    color: #111827 !important;
}

.article-trace-button {
    border-color: #0f766e;
    color: #0f766e;
    font-weight: 900;
}

.article-trace-button:hover,
.article-trace-button:focus-visible {
    background: #ccfbf1;
    border-color: #0f766e;
    color: #0f766e;
}

.ventas-articulo-backdrop {
    z-index: 160;
    padding: 28px 34px;
}

.app-dialog.ventas-articulo-dialog {
    width: calc(100vw - 68px);
    max-width: none;
    max-height: calc(100vh - 56px);
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr);
    padding: 0;
    overflow: hidden;
}

.app-dialog.articulo-traza-dialog {
    grid-template-rows: auto auto auto minmax(0, 1fr);
}

.ventas-articulo-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 18px;
    border-bottom: 1px solid #cbd8e6;
    background: #f8fbff;
}

.ventas-articulo-header h3 {
    margin: 0;
    color: #06152f;
    font-size: 17px;
    font-weight: 500;
    line-height: 1.2;
}

.ventas-articulo-close {
    min-width: 84px;
    background: #dc2626 !important;
    border-color: #b91c1c !important;
    color: #ffffff !important;
    box-shadow: none;
}

.ventas-articulo-close:hover,
.ventas-articulo-close:focus-visible {
    background: #b91c1c !important;
    border-color: #991b1b !important;
    color: #ffffff !important;
}

.ventas-articulo-controls {
    display: flex;
    align-items: end;
    gap: 10px;
    padding: 10px 18px;
    border-bottom: 1px solid #d5e0eb;
    background: #eef5fb;
}

.ventas-articulo-controls label {
    display: grid;
    gap: 3px;
    min-width: 150px;
    color: #102036;
    font-size: 12px;
    font-weight: 400;
}

.ventas-articulo-controls select {
    min-height: 28px;
    border: 1px solid #9fb5ce;
    background: #fff;
    padding: 3px 7px;
    font: inherit;
}

.articulo-traza-tabs {
    display: flex;
    gap: 8px;
    padding: 10px 18px;
    border-bottom: 1px solid #d5e0eb;
    background: #eef5fb;
}

.articulo-traza-tabs button {
    min-height: 32px;
    padding: 6px 14px;
    border: 1px solid #9fb5ce;
    background: #ffffff;
    color: #102036;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}

.articulo-traza-tabs button.active {
    border-color: #008b83;
    background: #008b83;
    color: #ffffff;
}

.articulo-traza-tools {
    display: flex;
    align-items: end;
    gap: 10px;
    padding: 10px 18px;
    border-bottom: 1px solid #d5e0eb;
    background: #f8fbff;
}

.articulo-traza-tools label {
    display: grid;
    gap: 3px;
    min-width: min(420px, 50vw);
    color: #102036;
    font-size: 12px;
    font-weight: 400;
}

.articulo-traza-tools input {
    min-height: 28px;
    border: 1px solid #9fb5ce;
    background: #fff;
    padding: 3px 7px;
    font: inherit;
}

.ventas-articulo-body {
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 12px 10px 14px;
}

.articulo-traza-body {
    overflow-x: auto;
}

.articulo-traza-grid {
    width: 100%;
    min-width: 980px;
    table-layout: fixed;
    font-size: 12px;
}

.articulo-traza-grid th,
.articulo-traza-grid td {
    padding: 6px 7px;
    vertical-align: middle;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.articulo-traza-grid th {
    color: #06152f !important;
}

.articulo-traza-grid .right {
    text-align: right;
}

.articulo-traza-ventas-grid th:nth-child(1),
.articulo-traza-ventas-grid td:nth-child(1) { width: 12%; }
.articulo-traza-ventas-grid th:nth-child(2),
.articulo-traza-ventas-grid td:nth-child(2) { width: 9%; }
.articulo-traza-ventas-grid th:nth-child(3),
.articulo-traza-ventas-grid td:nth-child(3) { width: 30%; }
.articulo-traza-ventas-grid th:nth-child(4),
.articulo-traza-ventas-grid td:nth-child(4) { width: 11%; }
.articulo-traza-ventas-grid th:nth-child(5),
.articulo-traza-ventas-grid td:nth-child(5),
.articulo-traza-ventas-grid th:nth-child(6),
.articulo-traza-ventas-grid td:nth-child(6),
.articulo-traza-ventas-grid th:nth-child(7),
.articulo-traza-ventas-grid td:nth-child(7),
.articulo-traza-ventas-grid th:nth-child(8),
.articulo-traza-ventas-grid td:nth-child(8) { width: 9.5%; }

.articulo-traza-presupuestos-grid {
    min-width: 760px;
}

.articulo-traza-presupuestos-grid th:nth-child(1),
.articulo-traza-presupuestos-grid td:nth-child(1) { width: 16%; }
.articulo-traza-presupuestos-grid th:nth-child(2),
.articulo-traza-presupuestos-grid td:nth-child(2) { width: 12%; }
.articulo-traza-presupuestos-grid th:nth-child(3),
.articulo-traza-presupuestos-grid td:nth-child(3) { width: 48%; }
.articulo-traza-presupuestos-grid th:nth-child(4),
.articulo-traza-presupuestos-grid td:nth-child(4),
.articulo-traza-presupuestos-grid th:nth-child(5),
.articulo-traza-presupuestos-grid td:nth-child(5) { width: 12%; }

.ventas-articulo-summary {
    width: 100%;
    min-width: 0;
    table-layout: fixed;
    font-size: 11px;
    font-weight: 400;
}

.ventas-articulo-summary th,
.ventas-articulo-summary td {
    padding: 6px 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ventas-articulo-summary th {
    color: #06152f !important;
}

.ventas-link {
    width: 100%;
    border: 0;
    background: transparent;
    color: #075ca8;
    font: inherit;
    font-weight: 400;
    text-align: left;
    cursor: pointer;
}

.ventas-link.right {
    text-align: right;
}

.ventas-link:hover,
.ventas-link:focus-visible {
    text-decoration: underline;
}

.ventas-articulo-summary .strong {
    font-weight: 400;
}

.ventas-chart-panel {
    margin-top: 14px;
    border: 1px solid #b9cbe1;
    background: #ffffff;
}

.ventas-chart-panel header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border-bottom: 1px solid #d5e0eb;
    background: #f2f6fb;
}

.ventas-chart-panel header strong {
    color: #06152f;
    font-size: 15px;
    font-weight: 400;
}

.ventas-chart-panel header span {
    color: #0b5aa2;
    font-weight: 400;
}

.ventas-bar-chart {
    height: 280px;
    display: flex;
    align-items: end;
    gap: 8px;
    padding: 18px 16px 12px;
}

.ventas-bar-item {
    flex: 1 1 0;
    min-width: 28px;
    height: 100%;
    display: grid;
    grid-template-rows: 24px minmax(0, 1fr) 22px;
    align-items: end;
    gap: 5px;
    text-align: center;
}

.ventas-bar-item span {
    align-self: start;
    color: #334155;
    font-size: 11px;
    font-weight: 400;
    white-space: nowrap;
}

.ventas-bar-item i {
    display: block;
    width: 100%;
    min-height: 2px;
    background: linear-gradient(180deg, #38bdf8, #075ca8);
}

.ventas-bar-item:nth-child(2n) i {
    background: linear-gradient(180deg, #fbbf24, #d97706);
}

.ventas-bar-item:nth-child(3n) i {
    background: linear-gradient(180deg, #34d399, #059669);
}

.ventas-bar-item:nth-child(4n) i {
    background: linear-gradient(180deg, #a78bfa, #7c3aed);
}

.ventas-bar-item:nth-child(5n) i {
    background: linear-gradient(180deg, #fb7185, #e11d48);
}

.ventas-bar-item:nth-child(6n) i {
    background: linear-gradient(180deg, #22d3ee, #0891b2);
}

.ventas-bar-item b {
    align-self: end;
    color: #102036;
    font-size: 11px;
    font-weight: 400;
    white-space: nowrap;
}

.ventas-line-chart {
    width: 100%;
    height: 280px;
    padding: 16px;
    box-sizing: border-box;
    background: linear-gradient(#fff, #f8fbff);
}

.ventas-line-chart polyline {
    fill: none;
    stroke: #075ca8;
    stroke-width: 5;
    stroke-linejoin: round;
    stroke-linecap: round;
}

.ventas-line-chart circle {
    fill: #ffffff;
    stroke: #075ca8;
    stroke-width: 4;
}

.ventas-articulo-loading,
.ventas-articulo-empty {
    padding: 28px;
    color: #334155;
    font-weight: 400;
}

.aux-new-row {
    outline: 2px solid #7fb8e8;
}

.aux-loading {
    padding: 28px;
    font-weight: 800;
    color: #244b68;
}

.app-btn-help {
    min-width: 42px;
    width: 42px;
    background: #2459dc;
    border-color: #1d4ed8;
    color: #ffffff;
    font-size: 1rem;
    font-weight: 900;
}

.app-btn-help:hover,
.app-btn-help:focus-visible {
    background: #1d4ed8;
    border-color: #1e40af;
    color: #ffffff;
}

.factura-window {
    max-width: none;
    margin: 8px 0;
    height: calc(100vh - 70px);
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.desktop-card.factura-window {
    width: auto;
    max-width: none;
}

.factura-header {
    min-height: 66px;
    grid-template-columns: minmax(430px, 1fr) auto;
    align-items: center;
    padding: 10px 20px;
    column-gap: 18px;
}

.factura-header .title-with-icon img {
    width: 44px;
    height: 44px;
    object-fit: contain;
}

.factura-actions {
    display: flex;
    flex-wrap: nowrap;
    justify-content: flex-end;
    gap: 8px;
    min-width: 0;
    overflow-x: auto;
    padding-bottom: 2px;
}

.factura-type-inline {
    font: inherit;
    font-weight: inherit;
    letter-spacing: 0;
}

.factura-type-inline.normal {
    color: #005fb8;
}

.factura-type-inline.rectificativa {
    color: #d71920;
}

.factura-actions .app-btn {
    min-width: 80px;
    min-height: 30px;
    padding: 5px 12px;
    white-space: nowrap;
}

.factura-actions .app-btn-help {
    min-width: 42px;
    width: 42px;
    background: #2459dc;
    border-color: #1d4ed8;
    color: #ffffff;
    font-size: 1rem;
    font-weight: 900;
}

.factura-actions .app-btn-help:hover,
.factura-actions .app-btn-help:focus-visible {
    background: #1d4ed8;
}

.factura-actions .factura-btn-cobro,
.factura-actions .app-btn-acrobat {
    min-width: 112px;
}

.factura-btn-cobro,
.factura-btn-aeat {
    background: #0f766e;
    color: #fff;
}

.factura-btn-ticket,
.factura-btn-email {
    background: #2563eb;
    color: #fff;
}

.factura-btn-aviso {
    min-width: 168px;
    background: #facc15;
    border-color: #d6a90f;
    color: #111827;
}

.factura-btn-aviso:hover:not(:disabled),
.factura-btn-aviso:focus-visible:not(:disabled) {
    background: #f4b900;
}

.factura-btn-aviso.has-aviso {
    background: #dc2626;
    border-color: #b91c1c;
    color: #fff;
}

.factura-btn-aviso.has-aviso:hover:not(:disabled),
.factura-btn-aviso.has-aviso:focus-visible:not(:disabled) {
    background: #b91c1c;
}

.factura-tabs {
    display: none;
}

.factura-lock-message {
    margin: 12px 18px 0;
}

.factura-document-head {
    display: grid;
    grid-template-columns: 125px 130px minmax(300px, 1.5fr) 36px minmax(130px, 1fr) minmax(130px, 1fr) minmax(130px, 1fr) minmax(130px, 1fr) 178px;
    gap: 6px 10px;
    align-items: end;
    padding: 8px 14px;
    border-top: 1px solid #cfd8e3;
    border-bottom: 1px solid #cfd8e3;
    background: #f6f9fc;
    position: relative;
    z-index: 30;
    overflow: visible;
}

.factura-document-head label {
    display: grid;
    gap: 3px;
    min-width: 0;
    font-size: 12px;
}

.factura-document-head input,
.factura-document-head select {
    width: 100%;
    min-height: 24px;
    border: 1px solid #a9b8c9;
    background: #fff;
    padding: 2px 6px;
    font: inherit;
}

.factura-document-head input[readonly] {
    background: #edf2f7;
}

.factura-document-head .cliente-search {
    grid-column: span 2;
    position: relative;
}

.factura-document-head .head-wide {
    grid-column: span 2;
}

.combo-with-action {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 32px;
    gap: 4px;
}

.cliente-open {
    display: inline-grid;
    place-items: center;
    min-width: 32px;
    min-height: 24px;
    padding: 0;
}

.cliente-open img {
    width: 18px;
    height: 18px;
    object-fit: contain;
}

.cliente-results {
    position: absolute;
    z-index: 300;
    top: calc(100% + 3px);
    left: 0;
    right: 36px;
    max-height: 260px;
    overflow: auto;
    border: 1px solid #8fa7c0;
    background: #fff;
    box-shadow: 0 12px 28px rgba(15, 23, 42, .22);
}

.cliente-results button {
    width: 100%;
    display: grid;
    grid-template-columns: 98px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    padding: 6px 9px;
    border: 0;
    border-bottom: 1px solid #e1e8f0;
    background: #fff;
    color: #142033;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.cliente-results button:hover,
.cliente-results button:focus-visible,
.cliente-results button.selected {
    background: #dceeff;
}

.cliente-results button.selected {
    outline: 1px solid #2b73b9;
    outline-offset: -1px;
}

.cliente-results span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.article-lookup {
    position: relative;
    min-width: 0;
}

.article-lookup-input {
    width: 100%;
    font-weight: 600;
}

.article-lookup-results {
    position: absolute;
    z-index: 420;
    top: calc(100% + 2px);
    left: 0;
    width: min(520px, 70vw);
    max-height: 286px;
    overflow: auto;
    border: 1px solid #7f9bb8;
    background: #fff;
    box-shadow: 0 14px 30px rgba(15, 23, 42, .24);
}

.article-lookup.open-up .article-lookup-results {
    top: auto;
    bottom: calc(100% + 2px);
    box-shadow: 0 -14px 30px rgba(15, 23, 42, .20);
}

.article-lookup-results button {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(82px, 122px) minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    padding: 7px 9px;
    border: 0;
    border-bottom: 1px solid #e1e8f0;
    background: #fff;
    color: #102036;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.article-lookup-results button:hover,
.article-lookup-results button:focus-visible,
.article-lookup-results button.selected {
    background: #dceeff;
}

.article-lookup-results button.selected {
    outline: 1px solid #2b73b9;
    outline-offset: -1px;
}

.article-lookup-results strong,
.article-lookup-results span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.searchable-select.tarifa-lookup .article-lookup-results {
    width: min(520px, 62vw);
}

.factura-head-check {
    display: inline-flex !important;
    align-items: center;
    gap: 7px;
    min-height: 22px;
    padding-top: 0;
    white-space: nowrap;
}

.factura-head-check input {
    width: auto;
    min-height: 0;
}

.factura-check-strip {
    grid-column: 1 / span 4;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 24px;
    min-height: 28px;
    padding-top: 2px;
}

.presupuesto-document-head {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    grid-template-areas:
        "numero fecha validez validez cliente cliente cliente forma forma departamento departamento departamento"
        "factura factura albaran albaran descuento descuento irpf estado estado origen origen origen"
        "checks checks checks checks checks checks checks checks checks checks checks checks";
    gap: 10px 12px;
    padding: 12px 14px 10px;
    align-items: end;
}

.presupuesto-document-head.with-vehicle {
    grid-template-areas:
        "numero fecha validez validez cliente cliente cliente forma forma departamento departamento departamento"
        "factura factura albaran albaran descuento descuento irpf estado estado origen origen vehiculo"
        "checks checks checks checks checks checks checks checks checks checks checks checks";
}

.presupuesto-document-head label {
    min-width: 0;
}

.presupuesto-document-head input,
.presupuesto-document-head select {
    min-height: 25px;
}

.presupuesto-document-head .head-factura .combo-with-action,
.presupuesto-document-head .head-albaran .combo-with-action {
    grid-template-columns: minmax(0, 1fr) 30px;
}

.presupuesto-document-head .head-factura .presupuesto-related-action,
.presupuesto-document-head .head-albaran .presupuesto-related-action {
    grid-template-columns: minmax(0, 1fr) 30px 68px;
}

.presupuesto-generar-related-button {
    min-height: 25px;
    height: 25px;
    border: 1px solid #b78d00;
    border-radius: 3px;
    background: #ffd400;
    color: #061b3a;
    font-weight: 800;
    font-size: 11px;
    line-height: 1;
    padding: 0 8px;
    cursor: pointer;
}

.presupuesto-generar-related-button:hover:not(:disabled) {
    background: #ffe04a;
}

.presupuesto-generar-related-button:disabled {
    opacity: .55;
    cursor: default;
}

.presupuesto-document-head .head-descuento {
    max-width: none;
}

.presupuesto-document-head .head-irpf {
    max-width: none;
}

.presupuesto-document-head .head-numero { grid-area: numero; }
.presupuesto-document-head .head-fecha { grid-area: fecha; }
.presupuesto-document-head .head-validez { grid-area: validez; }
.presupuesto-document-head .presupuesto-cliente { grid-area: cliente; }
.presupuesto-document-head .head-forma { grid-area: forma; }
.presupuesto-document-head .head-departamento { grid-area: departamento; }
.presupuesto-document-head .head-estado { grid-area: estado; }
.presupuesto-document-head .head-origen { grid-area: origen; }
.presupuesto-document-head .head-vehiculo { grid-area: vehiculo; }
.presupuesto-document-head .head-factura { grid-area: factura; }
.presupuesto-document-head .head-albaran { grid-area: albaran; }
.presupuesto-document-head .head-descuento { grid-area: descuento; }
.presupuesto-document-head .head-irpf { grid-area: irpf; }

.presupuesto-cliente {
    position: relative;
}

.presupuesto-document-head .presupuesto-check-strip {
    grid-area: checks;
    grid-column: 1 / -1 !important;
    display: grid !important;
    grid-template-columns: max-content max-content max-content max-content max-content;
    align-items: center;
    justify-content: start;
    min-height: 26px;
    padding-top: 2px;
    gap: 0 30px;
    overflow: visible;
}

.presupuesto-document-head .presupuesto-check-strip .factura-head-check {
    display: inline-flex !important;
    grid-template-columns: none !important;
    align-items: center;
    gap: 6px;
    width: max-content !important;
    min-width: max-content !important;
    max-width: none;
    margin: 0;
    white-space: nowrap;
    overflow: visible;
}

.presupuesto-document-head .presupuesto-check-strip .factura-head-check input {
    flex: 0 0 auto;
    width: 14px;
    height: 14px;
    min-height: 14px;
    margin: 0;
}

.presupuesto-window {
    margin-top: 6px;
}

.presupuesto-window .factura-header {
    min-height: 58px;
    padding: 7px 18px;
}

.presupuesto-window .factura-header .title-with-icon img {
    width: 38px;
    height: 38px;
}

.presupuesto-window .factura-header h2 {
    margin: 0;
}

.presupuesto-window .factura-actions {
    gap: 7px;
}

.presupuesto-window .factura-actions .app-btn {
    min-height: 28px;
    padding: 4px 11px;
}

.presupuesto-window .presupuesto-document-head {
    gap: 6px 10px;
    padding: 8px 14px 7px;
}

.presupuesto-window .presupuesto-document-head label {
    gap: 2px;
    font-size: 11px;
}

.presupuesto-window .presupuesto-document-head input,
.presupuesto-window .presupuesto-document-head select {
    min-height: 23px;
    padding-top: 1px;
    padding-bottom: 1px;
}

.presupuesto-window .presupuesto-document-head .presupuesto-check-strip {
    min-height: 20px;
    padding-top: 0;
    gap: 0 28px;
}

.presupuesto-window .factura-lines-body {
    padding: 7px 14px 6px;
}

.presupuesto-window .factura-line-toolbar {
    margin-bottom: 6px;
}

.presupuesto-window .factura-line-toolbar .app-btn {
    min-height: 30px;
    padding-top: 5px;
    padding-bottom: 5px;
}

.presupuesto-window .factura-lineas-grid th,
.presupuesto-window .factura-lineas-grid td {
    padding: 6px 9px;
}

.presupuesto-window .factura-lineas-grid input,
.presupuesto-window .factura-lineas-grid select,
.presupuesto-window .factura-lineas-grid textarea {
    min-height: 28px;
}

.presupuesto-window .factura-lineas-grid textarea {
    min-height: 36px;
    line-height: 1.25;
}

.presupuesto-window .factura-footer {
    grid-template-columns: minmax(520px, 1fr) 385px minmax(600px, 700px);
    grid-template-areas: "notas iva totales";
    gap: 10px;
    align-items: start;
    padding: 6px 18px;
}

.presupuesto-window .factura-iva-wrap {
    grid-area: iva;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 3px;
    min-height: 126px;
    max-height: 126px;
    background: transparent;
}

.presupuesto-window .factura-iva-title {
    color: #334155;
    font-size: 12px;
    line-height: 1;
}

.presupuesto-window .factura-iva-grid th,
.presupuesto-window .factura-iva-grid td {
    padding: 4px 10px;
    line-height: 1.14;
}

.presupuesto-window .factura-iva-grid th {
    white-space: nowrap;
}

.presupuesto-window .factura-notas {
    grid-area: notas;
    grid-template-rows: auto 1fr;
    align-content: start;
    gap: 3px;
}

.presupuesto-window .factura-notas textarea {
    min-height: 104px;
    height: 104px;
    max-height: 104px;
}

.presupuesto-window .factura-totales {
    grid-area: totales;
    gap: 4px;
    min-height: 126px;
}

.presupuesto-window .factura-minor-totals {
    gap: 12px;
}

.presupuesto-window .factura-grand-totals {
    gap: 24px;
}

.presupuesto-window .factura-totales .total {
    min-height: 42px;
}

.presupuesto-window .factura-total-label span,
.presupuesto-window .factura-total-abonar span {
    font-size: 16px;
}

.presupuesto-window .factura-total-label input,
.presupuesto-window .factura-total-abonar input {
    font-size: 42px;
}

.factura-fiscal-picture {
    grid-column: 9;
    grid-row: 1 / span 3;
    align-self: stretch;
    min-height: 80px;
    border: 1px dashed #b7c8d9;
    background: rgba(255, 255, 255, .72);
    display: grid;
    place-items: center;
    color: #8a9aad;
    font-size: 12px;
    text-align: center;
    padding: 8px;
}

.factura-compact-window .factura-compact-head {
    grid-template-columns: repeat(12, minmax(0, 1fr)) 142px;
    grid-template-areas:
        "numero fecha cliente cliente cliente origen tarifa forma forma cuenta cuenta cuenta fiscal"
        "estado clase tarjeta tarjeta tarjeta epigrafe pago tipo tipo rectifica rectifica rectifica fiscal"
        "checks checks checks checks checks checks checks checks checks checks checks checks fiscal";
    gap: 6px 10px;
    padding: 8px 14px 7px;
    align-items: end;
}

.factura-compact-window .factura-compact-head.with-vehicle {
    grid-template-areas:
        "numero fecha cliente cliente cliente origen tarifa forma forma cuenta cuenta cuenta fiscal"
        "estado clase tarjeta tarjeta epigrafe pago vehiculo tipo tipo rectifica rectifica rectifica fiscal"
        "checks checks checks checks checks checks checks checks checks checks checks checks fiscal";
}

.factura-compact-window .factura-compact-head label {
    gap: 2px;
    font-size: 11px;
}

.factura-compact-window .factura-compact-head input,
.factura-compact-window .factura-compact-head select {
    min-height: 23px;
    padding-top: 1px;
    padding-bottom: 1px;
}

.factura-compact-head .head-numero { grid-area: numero; }
.factura-compact-head .head-fecha { grid-area: fecha; }
.factura-compact-head .factura-cliente { grid-area: cliente; position: relative; }
.factura-compact-head .head-origen { grid-area: origen; }
.factura-compact-head .head-tarifa { grid-area: tarifa; }
.factura-compact-head .head-forma { grid-area: forma; }
.factura-compact-head .head-cuenta { grid-area: cuenta; }
.factura-compact-head .head-estado-fiscal { grid-area: estado; }
.factura-compact-head .head-clase { grid-area: clase; }
.factura-compact-head .head-tarjeta { grid-area: tarjeta; }
.factura-compact-head .head-epigrafe { grid-area: epigrafe; }
.factura-compact-head .head-fecha-pago { grid-area: pago; }
.factura-compact-head .head-vehiculo { grid-area: vehiculo; }
.factura-compact-head .head-tipo { grid-area: tipo; }
.factura-compact-head .head-rectifica { grid-area: rectifica; }

.factura-estado-fiscal-info {
    display: grid;
    grid-template-rows: auto 1fr;
    gap: 2px;
    align-self: stretch;
}

.factura-estado-fiscal-info span {
    color: #17365d;
    font-weight: 700;
}

.factura-estado-fiscal-info strong {
    display: flex;
    align-items: center;
    min-height: 24px;
    padding: 2px 8px;
    border: 1px solid #90aac7;
    background: #fff8d8;
    color: #004b93;
    font-size: 12px;
    line-height: 1.1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.factura-compact-window .factura-compact-head .presupuesto-check-strip {
    grid-area: checks;
    grid-column: auto !important;
    display: grid !important;
    grid-template-columns: repeat(6, max-content);
    align-items: center;
    justify-content: start;
    min-height: 20px;
    padding-top: 0;
    gap: 0 26px;
}

.factura-compact-window .factura-compact-head .presupuesto-check-strip .factura-head-check {
    display: inline-flex !important;
    grid-template-columns: none !important;
    align-items: center;
    gap: 6px;
    width: max-content !important;
    min-width: max-content !important;
    font-size: 12px;
    white-space: nowrap;
}

.factura-compact-window .factura-compact-head .presupuesto-check-strip .factura-head-check input {
    flex: 0 0 auto;
    width: 14px;
    height: 14px;
    min-height: 14px;
    margin: 0;
}

.factura-compact-window .factura-fiscal-picture {
    grid-area: fiscal;
    grid-column: auto;
    grid-row: auto;
    min-height: 84px;
    padding: 6px;
    font-size: 11px;
}

.parte-trabajo-window .parte-document-head {
    flex: 0 0 auto;
    display: grid;
    grid-template-columns: 145px 145px 76px minmax(280px, 1.45fr) minmax(180px, .8fr) minmax(190px, .85fr) minmax(190px, .85fr) minmax(170px, .78fr) minmax(190px, .85fr) minmax(190px, .85fr);
    grid-template-areas:
        "numero fecha hora cliente cliente tipo empleado equipo estado origen"
        "contacto contacto movil movil fecha-fin hora-fin horas-est departamento departamento departamento"
        "factura factura albaran albaran presupuesto presupuesto checks checks checks checks";
    gap: 6px 10px;
    padding: 8px 14px 7px;
    align-items: end;
    border-bottom: 1px solid #cbd8e6;
    background: #f3f7fb;
}

.parte-trabajo-window .parte-document-head label {
    display: grid;
    gap: 2px;
    min-width: 0;
    font-size: 11px;
}

.parte-trabajo-window .parte-document-head input,
.parte-trabajo-window .parte-document-head select {
    width: 100%;
    min-height: 23px;
    border: 1px solid #9fb1c5;
    background: #fff;
    padding: 1px 6px;
    font: inherit;
}

.parte-document-head .head-numero { grid-area: numero; }
.parte-document-head .head-fecha { grid-area: fecha; }
.parte-document-head .head-hora { grid-area: hora; }
.parte-document-head .parte-cliente { grid-area: cliente; position: relative; }
.parte-document-head .head-tipo { grid-area: tipo; }
.parte-document-head .head-empleado { grid-area: empleado; }
.parte-document-head .head-equipo { grid-area: equipo; }
.parte-document-head .head-estado { grid-area: estado; }
.parte-document-head .head-origen { grid-area: origen; }
.parte-document-head .head-departamento { grid-area: departamento; }
.parte-document-head .head-contacto { grid-area: contacto; }
.parte-document-head .head-movil { grid-area: movil; }
.parte-document-head .head-fecha-fin { grid-area: fecha-fin; }
.parte-document-head .head-hora-fin { grid-area: hora-fin; }
.parte-document-head .head-horas-est { grid-area: horas-est; }
.parte-document-head .head-factura { grid-area: factura; }
.parte-document-head .head-albaran { grid-area: albaran; }
.parte-document-head .head-presupuesto { grid-area: presupuesto; }

.parte-trabajo-window .parte-check-strip {
    grid-area: checks;
    grid-column: auto !important;
    display: grid !important;
    grid-template-columns: repeat(4, max-content);
    justify-content: start;
    align-items: center;
    min-height: 20px;
    gap: 0 24px;
    padding-top: 0;
}

.parte-trabajo-window .parte-check-strip .factura-head-check {
    display: inline-flex !important;
    grid-template-columns: none !important;
    align-items: center;
    gap: 6px;
    width: max-content !important;
    min-width: max-content !important;
    font-size: 12px;
    white-space: nowrap;
}

.parte-trabajo-window .parte-check-strip .factura-head-check input {
    flex: 0 0 auto;
    width: 14px;
    height: 14px;
    min-height: 14px;
    margin: 0;
}

.parte-trabajo-window .parte-lines-body {
    padding: 8px 14px 6px;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}

.parte-trabajo-window .parte-lines-wrap {
    flex: 1 1 auto;
    min-height: 150px;
    max-height: calc(100vh - 435px);
    overflow: auto;
}

.parte-trabajo-window .parte-lines-grid {
    width: 100%;
    min-width: 1660px;
    table-layout: fixed;
}

.parte-trabajo-window .parte-lines-grid th,
.parte-trabajo-window .parte-lines-grid td {
    box-sizing: border-box;
    padding: 7px 10px;
    vertical-align: top;
}

.parte-trabajo-window .parte-line-col-actions { width: 68px; }
.parte-trabajo-window .parte-line-col-position { width: 88px; }
.parte-trabajo-window .parte-line-col-date { width: 120px; }
.parte-trabajo-window .parte-line-col-employee { width: 112px; }
.parte-trabajo-window .parte-line-col-article { width: 150px; }
.parte-trabajo-window .parte-line-col-description { width: 430px; }
.parte-trabajo-window .parte-line-col-quantity,
.parte-trabajo-window .parte-line-col-price,
.parte-trabajo-window .parte-line-col-discount,
.parte-trabajo-window .parte-line-col-vat-rate { width: 96px; }
.parte-trabajo-window .parte-line-col-base { width: 118px; }
.parte-trabajo-window .parte-line-col-vat,
.parte-trabajo-window .parte-line-col-total { width: 82px; }

.parte-trabajo-window .parte-lines-grid .document-line-actions,
.parte-trabajo-window .parte-lines-grid .document-line-position {
    padding-right: 4px;
    padding-left: 4px;
    overflow: hidden;
}

.parte-trabajo-window .parte-lines-grid .pedido-line-actions .row-icon-button {
    margin: 0;
}

.parte-trabajo-window .parte-lines-grid textarea {
    width: 100%;
    min-width: 0;
    min-height: 36px;
    line-height: 1.25;
}

.parte-trabajo-window .parte-lines-grid input,
.parte-trabajo-window .parte-lines-grid select,
.parte-trabajo-window .parte-lines-grid .article-lookup-input {
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    min-height: 30px;
}

.parte-trabajo-window .parte-lines-grid .document-line-position {
    white-space: nowrap;
}

.parte-trabajo-window .parte-lines-grid .document-line-position .tiny-input {
    width: calc(100% - 34px);
    min-width: 0;
}

.parte-trabajo-window .parte-articulo-cell {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 34px;
    gap: 4px;
}

.parte-trabajo-window .head-factura .combo-with-action,
.parte-trabajo-window .head-albaran .combo-with-action,
.parte-trabajo-window .head-presupuesto .combo-with-action {
    grid-template-columns: minmax(0, 1fr) 34px;
}

.parte-trabajo-window .head-factura .parte-related-action,
.parte-trabajo-window .head-albaran .parte-related-action,
.parte-trabajo-window .head-presupuesto .parte-related-action {
    grid-template-columns: minmax(0, 1fr) 58px;
}

.parte-trabajo-window .head-factura .mini-action,
.parte-trabajo-window .head-albaran .mini-action,
.parte-trabajo-window .head-presupuesto .mini-action {
    min-height: 23px;
    height: 23px;
}

.parte-emitir-button {
    min-height: 23px;
    height: 23px;
    border: 1px solid #b78d00;
    border-radius: 3px;
    background: #ffd400;
    color: #061b3a;
    font-weight: 800;
    font-size: 11px;
    line-height: 1;
    padding: 0 6px;
    cursor: pointer;
}

.parte-emitir-button:hover:not(:disabled) {
    background: #ffe04a;
}

.parte-emitir-button:disabled {
    opacity: .55;
    cursor: default;
}

.parte-general-window .factura-header {
    min-height: 58px;
    grid-template-columns: minmax(430px, auto) minmax(0, 1fr);
    grid-template-rows: auto;
    align-items: center;
    padding: 6px 20px;
    gap: 10px 18px;
}

.parte-general-window .factura-header > .title-with-icon {
    grid-column: 1;
    grid-row: 1;
    align-self: center;
    min-width: 430px;
    padding-bottom: 0;
}

.parte-general-window .factura-header > .title-with-icon h2 {
    white-space: nowrap;
    font-size: 1.28rem;
    line-height: 1.05;
}

.parte-general-window .factura-header > .title-with-icon img {
    width: 40px;
    height: 40px;
}

.parte-general-window .factura-header > .desktop-list-actions {
    grid-column: 2;
    grid-row: 1;
    align-self: center;
}

.parte-trabajo-window:not(.parte-general-window) .factura-header:has(> .aux-button-host) {
    grid-template-columns: auto minmax(0, 1fr);
}

.parte-trabajo-window:not(.parte-general-window) .factura-header:has(> .aux-button-host) > .title-with-icon {
    grid-column: 1 / -1;
    width: fit-content;
    max-width: 100%;
    align-self: center;
    padding-right: 18px;
}

.parte-trabajo-window .parte-ficha-title {
    display: inline-flex;
    align-items: baseline;
    gap: 14px;
    white-space: nowrap;
    line-height: 1;
}

.parte-trabajo-window .parte-ficha-number {
    color: #005eb8;
    font-size: 1.35em;
    font-weight: 900;
}

.parte-general-window .parte-document-head {
    grid-template-columns: 170px 140px 240px 280px 220px minmax(0, 1fr);
    grid-template-areas: "numero fecha tipo empleado estado empty";
    padding: 10px 20px 8px;
}

.parte-general-window .head-hora,
.parte-general-window .parte-cliente,
.parte-general-window .head-equipo,
.parte-general-window .head-origen,
.parte-general-window .head-departamento,
.parte-general-window .head-contacto,
.parte-general-window .head-movil,
.parte-general-window .head-fecha-fin,
.parte-general-window .head-hora-fin,
.parte-general-window .head-horas-est,
.parte-general-window .head-factura,
.parte-general-window .head-albaran,
.parte-general-window .head-presupuesto,
.parte-general-window .parte-check-strip {
    display: none !important;
}

.parte-general-window .parte-lines-body {
    padding-top: 6px;
}

.parte-work-tabs {
    flex: 0 0 auto;
    padding: 6px 14px 0;
    border-bottom: 1px solid #cbd8e6;
}

.parte-tab-text-panel {
    flex: 1 1 auto;
    min-height: 420px;
    padding: 12px 14px 16px;
    background: #f8fbff;
}

.parte-tab-text-panel label {
    display: grid;
    gap: 6px;
    height: 100%;
    color: #10213a;
    font-size: 12px;
    font-weight: 700;
}

.parte-tab-text-panel textarea {
    width: 100%;
    min-height: calc(100vh - 235px);
    border: 1px solid #9fb1c5;
    background: #fff;
    padding: 10px 12px;
    color: #001f49;
    font: 16px "Segoe UI", Arial, sans-serif;
    resize: vertical;
}

.parte-general-textos {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(0, .9fr);
    gap: 8px;
    padding: 6px 14px;
    border-bottom: 1px solid #cbd8e6;
    background: #f8fbff;
}

.parte-general-textos label {
    display: grid;
    gap: 3px;
    font-size: 12px;
}

.parte-general-textos textarea {
    width: 100%;
    min-height: 68px;
    border: 1px solid #9fb1c5;
    padding: 6px 8px;
    font-size: 18px;
    resize: vertical;
}

.parte-general-window .parte-lines-wrap {
    min-height: calc(100vh - 345px);
}

@media (max-width: 1200px) {
    .parte-trabajo-window .parte-lines-body {
        padding-right: 8px;
        padding-left: 8px;
    }

    .parte-trabajo-window .parte-lines-grid {
        min-width: 1510px;
    }

    .parte-trabajo-window .parte-line-col-actions { width: 64px; }
    .parte-trabajo-window .parte-line-col-position { width: 82px; }
    .parte-trabajo-window .parte-line-col-date { width: 114px; }
    .parte-trabajo-window .parte-line-col-employee { width: 102px; }
    .parte-trabajo-window .parte-line-col-article { width: 140px; }
    .parte-trabajo-window .parte-line-col-description { width: 370px; }

    .parte-trabajo-window .parte-lines-grid th,
    .parte-trabajo-window .parte-lines-grid td {
        padding-right: 6px;
        padding-left: 6px;
    }
}

.parte-general-window .parte-lines-grid th {
    background: #0f172a;
    color: #fff;
}

.parte-general-window .parte-bottom-strip {
    grid-template-columns: repeat(7, minmax(88px, 1fr)) minmax(160px, 210px);
    justify-content: start;
    align-items: end;
    gap: 10px;
    padding: 6px 20px;
    min-height: 58px;
}

.parte-general-window .parte-bottom-strip .parte-total-final {
    grid-template-columns: 1fr;
    align-self: stretch;
    display: grid;
    align-content: end;
}

.parte-general-window .parte-bottom-strip .parte-total-final span {
    text-align: left;
    font-size: 12px;
    line-height: 1;
}

.parte-general-window .parte-bottom-strip .parte-total-final input {
    min-height: 24px;
    border: 1px solid #9fb1c5;
    background: #eef3f8;
    color: #000;
    font-size: 13px;
}

.parte-bottom-strip {
    flex: 0 0 auto;
    display: grid;
    grid-template-columns: repeat(7, minmax(120px, 1fr)) minmax(230px, 290px);
    align-items: end;
    gap: 9px;
    padding: 9px 18px 10px;
    border-top: 2px solid #9fb8d3;
    background: linear-gradient(180deg, #f8fbff 0%, #eef5fc 100%);
    position: relative;
    z-index: 5;
}

.parte-bottom-strip label {
    display: grid;
    gap: 4px;
    min-width: 0;
    color: #06172d;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0;
}

.parte-bottom-strip input {
    width: 100%;
    min-height: 31px;
    border: 2px solid #9ab4d1;
    background: #ffffff;
    padding: 3px 9px;
    color: #001a33;
    font-size: 16px;
    font-weight: 900;
    text-align: right;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.85), 0 1px 2px rgba(15,23,42,.08);
}

.parte-bottom-strip .parte-total-final {
    grid-template-columns: 112px minmax(0, 1fr);
    align-items: center;
    gap: 8px;
}

.parte-bottom-strip .parte-total-final span {
    color: #005eb8;
    font-size: 13px;
    font-weight: 900;
    text-align: right;
}

.parte-bottom-strip .parte-total-final input {
    min-height: 34px;
    border: 0;
    background: transparent;
    color: #005eb8;
    font-size: 34px;
    font-weight: 900;
    line-height: 1;
}

.estructuras-filter-strip {
    flex-wrap: nowrap;
    gap: 12px;
}

.estructuras-filter-strip label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.estructuras-filter-strip label:first-child input {
    width: 280px;
    min-width: 280px;
}

.estructuras-filter-strip .estructuras-family-filter select {
    width: 360px;
    min-width: 360px;
}

.estructuras-list-grid .structure-photo-cell {
    width: 70px;
    text-align: center;
}

.estructuras-list-grid .structure-photo-cell img {
    width: 48px;
    height: 36px;
    object-fit: cover;
    border: 1px solid #b9c8d8;
    background: #fff;
}

.estructura-window .factura-header {
    min-height: 72px;
}

.estructura-head {
    display: grid;
    grid-template-columns: 150px minmax(260px, 320px) 145px 130px 240px minmax(360px, 1fr) 210px;
    grid-template-areas:
        "codigo familia fecha margen color observaciones foto"
        "descripcion descripcion descripcion descripcion descripcion observaciones foto";
    gap: 6px 10px;
    padding: 8px 14px;
    border-bottom: 1px solid #cbd8e6;
    background: #f3f7fb;
}

.estructura-head label,
.estructura-foto {
    display: grid;
    gap: 2px;
    min-width: 0;
    color: #10213a;
    font-size: 11px;
    font-weight: 700;
}

.estructura-head input,
.estructura-head select,
.estructura-head textarea {
    width: 100%;
    min-height: 23px;
    border: 1px solid #9fb1c5;
    background: #fff;
    padding: 2px 6px;
    font: inherit;
    font-weight: 400;
}

.estructura-head textarea {
    min-height: 70px;
    resize: vertical;
}

.estructura-descripcion textarea,
.estructura-observaciones textarea {
    min-height: 96px;
    font-size: 18px;
    line-height: 1.35;
}

.estructura-codigo { grid-area: codigo; }
.estructura-familia { grid-area: familia; }
.estructura-fecha { grid-area: fecha; }
.estructura-margen { grid-area: margen; }
.estructura-color { grid-area: color; }
.estructura-descripcion { grid-area: descripcion; }
.estructura-observaciones { grid-area: observaciones; }
.estructura-foto { grid-area: foto; }

.estructura-color .combo-with-action {
    grid-template-columns: minmax(0, 1fr) 36px;
}

.estructura-color-picker {
    min-width: 36px;
    padding: 0 !important;
}

.estructura-foto-box {
    display: grid;
    place-items: center;
    min-height: 108px;
    border: 1px solid #b7c7d8;
    background: #fff;
    color: #5b6880;
    font-weight: 900;
}

.estructura-foto-box img {
    width: 100%;
    height: 100%;
    max-height: 112px;
    object-fit: contain;
}

.estructura-foto-actions {
    display: grid;
    grid-template-columns: repeat(6, 30px);
    justify-content: center;
    gap: 4px;
}

.icon-photo-button {
    position: relative;
    width: 30px;
    height: 28px;
    display: inline-grid;
    place-items: center;
    border: 1px solid #7aa7c7;
    border-radius: 3px;
    background: #eef7ff;
    color: #064b7a;
    font-weight: 900;
    cursor: pointer;
}

.icon-photo-button:hover,
.icon-photo-button:focus-visible {
    background: #dcefff;
    outline: none;
}

.icon-photo-button svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.icon-photo-button.google {
    border-color: #0f766e;
    background: #e7fbf7;
    color: #047857;
}

.icon-photo-button.danger {
    border-color: #dc2626;
    background: #fff1f2;
    color: #dc2626;
    font-size: 20px;
    line-height: 1;
}

.icon-photo-button:disabled {
    opacity: .45;
    cursor: default;
}

.estructura-foto-actions .file-button {
    overflow: hidden;
}

.estructura-foto-actions .file-button input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.estructura-lines-body {
    padding-top: 6px;
}

.estructura-lines-wrap {
    min-height: calc(100vh - 365px);
}

.estructura-lines-grid {
    min-width: 1480px;
}

.estructura-lines-grid th:nth-child(1) { width: 52px; }
.estructura-lines-grid th:nth-child(2) { width: 80px; }
.estructura-lines-grid th:nth-child(3) { width: 220px; }
.estructura-lines-grid th:nth-child(4) { width: 520px; }
.estructura-lines-grid th:nth-child(5),
.estructura-lines-grid th:nth-child(6),
.estructura-lines-grid th:nth-child(7),
.estructura-lines-grid th:nth-child(8),
.estructura-lines-grid th:nth-child(9),
.estructura-lines-grid th:nth-child(10),
.estructura-lines-grid th:nth-child(11) { width: 118px; }

.estructura-bottom-strip {
    grid-template-columns: repeat(6, minmax(120px, 170px)) minmax(0, 1fr);
    min-height: 55px;
}

.orden-reparacion-window .orden-head {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    grid-template-areas:
        "numero fecha hora cliente cliente cliente vehiculo vehiculo tipo empleado equipo prioridad"
        "departamento departamento contacto contacto movil movil fecha-fin horas-est estado estado origen origen"
        "factura factura albaran albaran presupuesto presupuesto checks checks checks checks checks checks";
    gap: 6px 10px;
    padding: 8px 14px 7px;
}

.orden-reparacion-window .orden-head .head-numero { grid-area: numero; }
.orden-reparacion-window .orden-head .head-fecha { grid-area: fecha; }
.orden-reparacion-window .orden-head .head-hora { grid-area: hora; }
.orden-reparacion-window .orden-head .parte-cliente { grid-area: cliente; }
.orden-reparacion-window .orden-head .head-vehiculo { grid-area: vehiculo; }
.orden-reparacion-window .orden-head .head-tipo { grid-area: tipo; }
.orden-reparacion-window .orden-head .head-empleado { grid-area: empleado; }
.orden-reparacion-window .orden-head .head-equipo { grid-area: equipo; }
.orden-reparacion-window .orden-head .head-prioridad { grid-area: prioridad; }
.orden-reparacion-window .orden-head .head-estado { grid-area: estado; }
.orden-reparacion-window .orden-head .head-origen { grid-area: origen; }
.orden-reparacion-window .orden-head .head-departamento { grid-area: departamento; }
.orden-reparacion-window .orden-head .head-contacto { grid-area: contacto; }
.orden-reparacion-window .orden-head .head-movil { grid-area: movil; }
.orden-reparacion-window .orden-head .head-fecha-fin { grid-area: fecha-fin; }
.orden-reparacion-window .orden-head .head-horas-est { grid-area: horas-est; }
.orden-reparacion-window .orden-head .head-factura { grid-area: factura; }
.orden-reparacion-window .orden-head .head-albaran { grid-area: albaran; }
.orden-reparacion-window .orden-head .head-presupuesto { grid-area: presupuesto; }

.orden-reparacion-window .orden-head .combo-with-action {
    grid-template-columns: minmax(0, 1fr) 30px;
}

.orden-reparacion-window .orden-head .mini-action {
    min-height: 23px;
    height: 23px;
}

.orden-reparacion-window .orden-head .parte-check-strip {
    grid-area: checks;
    grid-column: auto !important;
    display: grid !important;
    grid-template-columns: repeat(4, max-content);
    justify-content: start;
    align-items: center;
    min-height: 23px;
    gap: 0 24px;
    padding-top: 0;
}

.orden-reparacion-window .orden-head .parte-check-strip .factura-head-check {
    display: inline-flex !important;
    grid-template-columns: none !important;
    align-items: center;
    gap: 6px;
    width: max-content !important;
    min-width: max-content !important;
    white-space: nowrap;
}

.orden-reparacion-window .parte-lines-wrap {
    min-height: 515px;
}

.orden-reparacion-window .orden-footer {
    grid-template-columns: minmax(520px, 1fr) 385px minmax(640px, 740px);
    grid-template-areas: "notas iva totales";
    gap: 8px;
    align-items: start;
    padding: 4px 18px 5px;
}

.orden-reparacion-window .orden-footer .factura-notas {
    grid-area: notas;
}

.orden-reparacion-window .orden-footer .factura-iva-wrap {
    grid-area: iva;
}

.orden-reparacion-window .orden-footer .factura-totales {
    grid-area: totales;
    min-height: 94px;
    gap: 3px;
}

.orden-reparacion-window .orden-footer .factura-notas textarea {
    min-height: 70px;
    height: 70px;
    max-height: 70px;
}

.orden-reparacion-window .orden-minor-totals {
    grid-template-columns: repeat(4, minmax(120px, 1fr));
    gap: 4px 10px;
}

.orden-reparacion-window .orden-footer .factura-iva-grid th,
.orden-reparacion-window .orden-footer .factura-iva-grid td {
    padding: 3px 9px;
    line-height: 1.1;
}

.orden-reparacion-window .orden-footer .factura-iva-title,
.orden-reparacion-window .orden-footer .factura-notas span,
.orden-reparacion-window .orden-footer .factura-totales span {
    font-size: 11px;
    line-height: 1;
}

.orden-reparacion-window .orden-footer .factura-totales .number {
    min-height: 22px;
    padding-top: 1px;
    padding-bottom: 1px;
}

.orden-reparacion-window .orden-grand-totals {
    grid-template-columns: minmax(300px, 1fr);
    justify-items: end;
    gap: 0;
}

.orden-reparacion-window .orden-grand-totals .factura-total-label {
    width: min(330px, 100%);
}

.orden-reparacion-window .orden-grand-totals .factura-total-label input {
    min-height: 38px;
    font-size: 34px;
}

.document-subtitle {
    display: block;
    margin-top: 2px;
    color: #405b78;
    font-size: 12px;
    font-weight: 600;
}

.diario-window .factura-header {
    min-height: 56px;
    padding: 7px 18px;
}

.diario-window .factura-header .title-with-icon img {
    width: 38px;
    height: 38px;
}

.diario-window .factura-header h2 {
    margin: 0;
}

.diario-head {
    flex: 0 0 auto;
    display: grid;
    grid-template-columns: 145px minmax(220px, 280px) minmax(260px, 360px) minmax(320px, 1fr) 170px;
    gap: 6px 10px;
    align-items: end;
    padding: 8px 14px 7px;
    border-top: 1px solid #cfd8e3;
    border-bottom: 1px solid #cbd8e6;
    background: #f3f7fb;
}

.diario-head label {
    display: grid;
    gap: 2px;
    min-width: 0;
    font-size: 11px;
}

.diario-head input,
.diario-head select,
.diario-head .article-lookup-input {
    width: 100%;
    min-height: 23px;
    border: 1px solid #9fb1c5;
    background: #fff;
    padding: 1px 6px;
    font: inherit;
}

.diario-head-summary {
    display: grid;
    align-content: center;
    min-height: 38px;
    padding: 3px 10px;
    border: 1px solid #b7c8da;
    background: #fff;
    color: #005eb8;
    font-size: 12px;
    font-weight: 800;
    text-align: right;
}

.diario-head-summary span {
    color: #087f45;
}

.diario-window .diario-lines-body {
    padding: 7px 14px 6px;
}

.diario-lines-wrap {
    min-height: 430px;
}

.diario-grid {
    width: 100%;
    min-width: 1580px;
    table-layout: fixed;
}

.diario-grid th,
.diario-grid td {
    box-sizing: border-box;
    padding: 6px 6px;
    vertical-align: top;
}

.diario-col-actions { width: 100px; }
.diario-col-parte { width: 150px; }
.diario-col-fecha { width: 120px; }
.diario-col-empleado { width: 110px; }
.diario-col-articulo { width: 180px; }
.diario-col-descripcion { width: 340px; }
.diario-col-cantidad { width: 82px; }
.diario-col-precio { width: 94px; }
.diario-col-dto { width: 84px; }
.diario-col-base { width: 105px; }
.diario-col-tipoiva { width: 90px; }
.diario-col-subtotal { width: 125px; }

.diario-grid td:first-child,
.diario-grid th:first-child {
    padding-left: 6px;
    padding-right: 6px;
}

.diario-grid input,
.diario-grid select,
.diario-grid textarea {
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    min-height: 28px;
    padding-left: 5px;
    padding-right: 5px;
}

.diario-grid input.number,
.diario-grid .number-cell {
    text-align: right;
}

.diario-grid .article-lookup,
.diario-grid .article-lookup-input {
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.diario-grid .article-lookup-results {
    min-width: min(420px, 42vw);
    width: max-content;
    max-width: 520px;
}

.diario-grid td {
    overflow: visible;
}

.diario-grid tbody tr:focus-within {
    position: relative;
    z-index: 430;
}

.diario-grid td:focus-within,
.diario-grid .article-lookup:focus-within {
    position: relative;
    z-index: 431;
}

.diario-grid .article-lookup-results {
    z-index: 432;
}

.diario-grid .number-cell {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.diario-window .diario-grid textarea {
    min-width: 0;
    min-height: 36px;
    line-height: 1.25;
}

.diario-grid col.diario-col-descripcion,
.diario-grid th[data-facil-ges-grid-column-key="descripcion"],
.diario-grid td[data-facil-ges-grid-column-key="descripcion"] {
    width: 340px !important;
}

.diario-grid col.diario-col-subtotal,
.diario-grid th[data-facil-ges-grid-column-key="subtotal"],
.diario-grid td[data-facil-ges-grid-column-key="subtotal"] {
    width: 125px !important;
}

.diario-grid col.diario-col-cantidad,
.diario-grid th[data-facil-ges-grid-column-key="cantidad"],
.diario-grid td[data-facil-ges-grid-column-key="cantidad"] {
    width: 78px !important;
}

.diario-grid col.diario-col-articulo,
.diario-grid th[data-facil-ges-grid-column-key="articulo"],
.diario-grid td[data-facil-ges-grid-column-key="articulo"] {
    width: 165px !important;
}

.diario-actions {
    display: flex;
    gap: 3px;
    align-items: center;
    justify-content: center;
    min-width: 0;
}

.diario-actions .row-icon-button {
    width: 26px;
    height: 28px;
    min-width: 26px;
}

.diario-bottom-strip.with-costs {
    grid-template-columns: repeat(6, minmax(120px, 1fr)) minmax(270px, 340px);
}

.diario-bottom-strip.without-costs {
    grid-template-columns: repeat(4, minmax(120px, 1fr)) minmax(270px, 340px);
}

.diario-bottom-strip .diario-total-final {
    grid-template-columns: 120px minmax(0, 1fr);
}

.parte-textos-modal {
    display: grid;
    grid-template-rows: auto 1fr 1fr;
    gap: 12px;
    width: min(980px, 92vw);
    max-height: 82vh;
    padding: 16px;
    border: 1px solid #9fb1c5;
    background: #f8fbff;
    box-shadow: 0 24px 80px rgba(15, 23, 42, .28);
}

.parte-textos-modal header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.parte-textos-modal h2 {
    margin: 0;
    color: #071733;
    font-size: 22px;
}

.parte-textos-modal label {
    display: grid;
    grid-template-rows: auto 1fr;
    gap: 5px;
    min-height: 150px;
    font-weight: 700;
}

.parte-textos-modal textarea {
    width: 100%;
    min-height: 140px;
    border: 1px solid #9fb1c5;
    background: #fff;
    padding: 8px;
    resize: vertical;
}

.factura-body {
    padding: 12px 18px;
}

.factura-lines-body {
    display: flex;
    flex: 1 1 auto;
    min-height: 0;
    flex-direction: column;
    padding: 8px 14px;
}

.factura-cabecera {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
}

.factura-form-grid {
    display: grid;
    grid-template-columns: 180px 170px minmax(360px, 1.35fr) minmax(230px, .9fr) minmax(230px, .9fr);
    gap: 9px 16px;
    align-items: end;
}

.factura-form-grid label,
.factura-notas,
.factura-totales label {
    display: grid;
    gap: 4px;
    font-size: 13px;
}

.factura-form-grid .span-2 {
    grid-column: span 2;
}

.factura-form-grid input,
.factura-form-grid select,
.factura-lineas-grid input,
.factura-lineas-grid select,
.factura-lineas-grid textarea,
.factura-notas textarea,
.factura-totales input {
    min-height: 24px;
    border: 1px solid #a9b8c9;
    background: #fff;
    padding: 3px 6px;
    font: inherit;
}

.factura-form-grid input[readonly],
.factura-lineas-grid input[readonly],
.factura-lineas-grid textarea[readonly],
.factura-notas textarea[readonly],
.factura-totales input {
    background: #edf2f7;
}

.factura-checks {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 26px;
    padding-top: 10px;
    padding-bottom: 10px;
}

.factura-checks label,
.factura-check-field {
    display: flex;
    align-items: center;
    gap: 8px;
}

.factura-line-toolbar {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 10px;
}

.factura-lineas-wrap {
    flex: 1 1 auto;
    max-height: none;
    min-height: 0;
    overflow: auto;
}

.factura-lineas-grid {
    min-width: 1360px;
}

.factura-lineas-grid td {
    vertical-align: top;
}

.factura-lineas-grid.without-lotes {
    min-width: 1340px;
}

.factura-lineas-grid.with-lotes {
    min-width: 1460px;
}

.factura-lineas-grid textarea {
    min-width: 520px;
    min-height: 38px;
    height: auto;
    line-height: 1.35;
    overflow: hidden;
    resize: none;
}

.factura-lineas-grid.without-lotes textarea {
    min-width: 650px;
}

.factura-lineas-grid .employee-code {
    width: 88px;
    min-width: 88px;
}

.factura-lineas-grid .tiny-input {
    width: 58px;
}

.factura-lineas-grid .number {
    width: 88px;
    text-align: right;
}

.factura-lineas-grid tbody tr.document-line-row {
    cursor: grab;
}

.factura-lineas-grid tbody tr.document-line-row:active {
    cursor: grabbing;
}

.factura-lineas-grid .document-line-actions {
    width: 76px;
    min-width: 76px;
    white-space: nowrap;
}

.factura-lineas-grid .document-line-actions-head {
    width: 76px;
    min-width: 76px;
}

.factura-lineas-grid .line-drag-handle {
    border-color: #7c98b8;
    color: #17324d;
    cursor: grab;
    margin-right: 4px;
    touch-action: none;
    user-select: none;
}

.factura-lineas-grid .document-line-position {
    min-width: 96px;
    white-space: nowrap;
}

.factura-lineas-grid .document-line-position .tiny-input {
    width: 48px;
    vertical-align: middle;
}

.factura-lineas-grid .line-drag-handle::before {
    content: "\2261";
    font-size: 18px;
    font-weight: 800;
    line-height: 1;
}

.factura-lineas-grid .line-drag-handle svg {
    display: none;
}

.factura-lineas-grid .line-drag-handle:active {
    cursor: grabbing;
}

.factura-lineas-grid tbody tr.document-line-dragging td {
    opacity: .55;
}

.factura-lineas-grid tbody tr.document-line-drop-target td {
    background: #fff2b8;
    outline: 2px dashed #0b74c9;
    outline-offset: -2px;
}

.factura-footer {
    display: grid;
    grid-template-columns: 365px minmax(720px, 1fr) minmax(650px, 720px);
    gap: 14px;
    align-items: stretch;
    flex: 0 0 auto;
    padding: 7px 18px 8px;
    margin-top: 0;
    border-top: 1px solid #cfd8e3;
    background: #fafafa;
}

.factura-iva-wrap {
    min-height: 104px;
    max-height: 126px;
    overflow: auto;
}

.factura-iva-grid th,
.factura-iva-grid td {
    padding: 3px 8px;
    line-height: 1.12;
}

.factura-notas textarea {
    width: 100%;
    min-height: 86px;
    height: 86px;
    max-height: 86px;
    resize: none;
}

.factura-totales {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    gap: 8px;
    padding: 0;
    align-content: start;
}

.factura-totales label {
    grid-template-columns: 1fr;
    align-items: stretch;
    gap: 3px;
    font-size: 12px;
    min-width: 0;
}

.factura-totales .number {
    text-align: right;
    min-height: 24px;
    padding: 2px 6px;
    min-width: 0;
}

.factura-totales .total {
    min-height: 54px;
    border: 0;
    background: transparent;
    font-weight: 900;
}

.factura-minor-totals,
.factura-grand-totals {
    display: grid;
    gap: 10px;
    min-width: 0;
}

.factura-minor-totals {
    grid-template-columns: repeat(3, minmax(135px, 1fr));
    gap: 18px;
}

.factura-grand-totals {
    grid-template-columns: repeat(2, minmax(250px, 1fr));
    gap: 30px;
    align-items: end;
}

.factura-total-label {
    font-weight: 900;
}

.factura-total-label span {
    display: block;
    color: #005fb8;
    font-size: 17px;
    font-weight: 900;
    white-space: nowrap;
}

.factura-total-label input {
    font-size: 54px;
    font-weight: 900;
    line-height: 1;
}

.factura-total-abonar {
    grid-column: auto;
}

.factura-total-abonar span {
    color: #07823f;
    font-size: 17px;
}

.factura-total-abonar input {
    font-size: 54px;
}

.factura-total-blue {
    color: #005fb8;
}

.factura-total-green {
    color: #07823f;
}

.factura-total-green.negative {
    color: #d71920;
}

.factura-total-abonar:has(.negative) span {
    color: #d71920;
}

@media (max-width: 1100px) {
    .factura-form-grid {
        grid-template-columns: repeat(2, minmax(170px, 1fr));
    }

    .factura-document-head {
        grid-template-columns: repeat(3, minmax(160px, 1fr));
    }

    .factura-footer {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 680px) {
    .factura-window {
        margin: 10px;
    }

    .factura-form-grid {
        grid-template-columns: 1fr;
    }

    .factura-document-head {
        grid-template-columns: 1fr;
    }

    .factura-form-grid .span-2 {
        grid-column: auto;
    }
}

.parte-header {
    display: grid;
    grid-template-columns: 150px 145px 70px minmax(220px, 1fr) minmax(190px, 260px) minmax(160px, 220px);
    gap: 12px 16px;
    padding: 16px 18px;
    border-bottom: 1px solid #c9d6e4;
    background: #f5f8fc;
}

.parte-header label,
.form-grid label {
    display: flex;
    flex-direction: column;
    gap: 5px;
    font-size: 14px;
}

.parte-header input,
.parte-header select,
.form-grid input,
.form-grid select,
.form-grid textarea,
.parte-lines input,
.parte-lines select,
.parte-lines textarea {
    border: 1px solid #a9b9cb;
    min-height: 28px;
    padding: 4px 6px;
    background: #fff;
}

.form-grid {
    display: grid;
    gap: 14px 22px;
    padding: 24px;
}

.form-grid.two-col {
    grid-template-columns: minmax(220px, 1fr) minmax(220px, 1fr);
}

.form-grid.four-col {
    grid-template-columns: repeat(4, minmax(160px, 1fr));
}

.form-grid .span-2 {
    grid-column: span 2;
}

.form-grid .span-4 {
    grid-column: span 4;
}

.form-grid textarea {
    min-height: 110px;
}

.inline-action {
    display: grid !important;
    grid-template-columns: 1fr auto;
    align-items: end;
}

.inline-action .mini-action {
    align-self: end;
}

.mini-action {
    min-width: 34px;
    min-height: 28px;
    border: 1px solid #8da1b6;
    background: #e9f2fb;
    font-weight: 700;
}

.tabs-strip {
    display: flex;
    gap: 4px;
    padding: 8px 18px 0;
    background: #e5e5e5;
    border-top: 1px solid #c9d6e4;
}

.tabs-strip button {
    padding: 9px 14px;
    border: 1px solid #9fb2c7;
    background: #e8eef6;
    font-weight: 700;
}

.tabs-strip .active {
    background: #0f8074;
    color: #fff;
}

.parte-texts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    padding: 12px 18px;
}

.parte-texts textarea {
    min-height: 96px;
    border: 1px solid #a9b9cb;
    padding: 8px;
    font-size: 15px;
}

.parte-panel,
.pedido-proveedor-panel {
    height: calc(100vh - 118px);
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.parte-lines-wrap,
.pedido-lines-wrap {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    overflow: auto;
}

.parte-header,
.parte-texts,
.tabs-strip,
.parte-totals,
.pedido-title-row,
.pedido-header,
.pedido-lines-bar {
    flex: 0 0 auto;
}

.parte-lines th {
    white-space: nowrap;
}

.parte-lines td {
    vertical-align: top;
}

.parte-lines .lookup-cell {
    display: grid;
    grid-template-columns: minmax(95px, 1fr) 34px;
    gap: 4px;
}

.parte-lines .line-description,
.parte-lines .wrap-cell {
    min-width: 320px;
    white-space: pre-wrap;
}

.parte-lines .line-description {
    min-height: 58px;
    resize: vertical;
}

.parte-totals {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    gap: 12px;
    padding: 12px 18px;
    background: #f8fafc;
    border-top: 1px solid #c9d6e4;
}

.parte-totals label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 110px;
    font-weight: 700;
}

.parte-totals input {
    text-align: right;
}

.article-search-modal {
    width: min(920px, 92vw);
    max-height: 80vh;
    overflow: auto;
    background: #f8fafc;
    border: 1px solid #adc0d4;
    box-shadow: 0 24px 80px rgba(15, 23, 42, .32);
    padding: 18px;
}

.days-line {
    display: flex;
    gap: 14px;
    align-items: center;
    flex-wrap: wrap;
}

.days-line label {
    flex-direction: row;
    align-items: center;
}

.desktop-card.recibo-gym-window {
    max-width: none;
    height: calc(100vh - 96px);
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    margin: 0;
}

.recibo-gym-header {
    min-height: 58px;
    padding: 8px 20px;
}

.recibo-gym-header .title-with-icon img {
    width: 34px;
    height: 34px;
}

.recibo-gym-header h2 {
    font-size: 1.28rem;
}

.recibo-gym-actions {
    flex-wrap: nowrap;
    gap: 8px;
}

.recibo-gym-actions .app-btn {
    min-width: 86px;
    min-height: 30px;
    padding: 0 14px;
    white-space: nowrap;
}

.recibo-gym-actions .app-btn-help {
    min-width: 40px;
    padding: 0 10px;
}

.recibo-gym-body {
    flex: 1 1 auto;
    min-height: 0;
    padding: 8px 18px 10px;
    background: #f4f7fb;
    overflow: hidden;
}

.recibo-gym-body-with-photo {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 190px;
    gap: 16px;
    align-items: start;
}

.recibo-gym-form {
    min-width: 0;
    border: 1px solid #c6d6e8;
    background: #f7fbff;
    padding: 8px 14px;
}

.recibo-client-photo {
    align-self: start;
    margin-top: 8px;
}

.recibo-client-photo .activity-photo-box {
    min-height: 184px;
}

.recibo-client-photo .activity-photo-box img {
    max-height: 142px;
}

.recibo-section {
    margin-bottom: 7px;
    padding: 9px 18px 11px;
}

.recibo-section legend {
    font-size: 1.12rem;
    line-height: 1.1;
}

.recibo-gym-window .win-tabs {
    flex: 0 0 auto;
    padding-top: 2px;
}

.recibo-gym-window .win-tabs button {
    min-height: 28px;
    padding: 0 11px;
}

.recibo-gym-form .recibo-section {
    position: relative;
    margin: 0;
    padding: 8px 0;
    border: 0;
    border-bottom: 1px solid #c9d7e6;
    background: transparent;
}

.recibo-gym-form .recibo-section:last-child {
    border-bottom: 0;
}

.recibo-gym-form .recibo-section legend {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.recibo-top-grid {
    display: grid;
    grid-template-columns: minmax(270px, .72fr) minmax(320px, .78fr) minmax(430px, 1fr);
    gap: 12px 28px;
    align-items: center;
}

.recibo-client-grid {
    display: grid;
    gap: 8px;
}

.recibo-client-grid .recibo-client-row {
    display: grid;
    grid-template-columns: 138px minmax(0, 1fr);
    align-items: center;
    gap: 8px;
}

.recibo-payment-grid {
    display: grid;
    grid-template-columns: minmax(360px, .58fr) minmax(260px, .36fr) 112px 112px;
    gap: 16px 22px;
    align-items: center;
}

.recibo-payment-grid .recibo-payment-row,
.recibo-payment-grid .date-check-label {
    display: grid;
    grid-template-columns: 138px minmax(0, 1fr);
    align-items: center;
    gap: 8px;
}

.recibo-top-grid label:not(.recibo-check),
.recibo-client-grid label:not(.recibo-check),
.recibo-payment-grid label:not(.recibo-check) {
    min-width: 0;
}

.recibo-top-grid input,
.recibo-top-grid select,
.recibo-client-grid input,
.recibo-client-grid select,
.recibo-payment-grid input,
.recibo-payment-grid select {
    width: 100%;
    min-height: 24px;
    border: 1px solid #aeb7c2;
    background: #ffffff;
    padding: 2px 6px;
    color: #0f172a;
    font: inherit;
}

.recibo-top-grid input[readonly],
.recibo-client-grid input[readonly],
.recibo-payment-grid input[readonly] {
    background: #eef2f7;
}

.recibo-top-grid .combo-with-action,
.recibo-client-grid .combo-with-action {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 30px;
    gap: 4px;
    align-items: center;
    min-width: 0;
}

.recibo-top-grid .combo-with-action .mini-action,
.recibo-client-grid .combo-with-action .mini-action {
    width: 30px;
    min-width: 30px;
    height: 26px;
    min-height: 26px;
    padding: 0;
}

.recibo-top-grid .combo-with-action .mini-action img,
.recibo-client-grid .combo-with-action .mini-action img {
    width: 18px;
    height: 18px;
    object-fit: contain;
    vertical-align: middle;
}

.recibo-payment-grid .recibo-check {
    margin-left: 0;
    justify-self: start;
}

.recibo-gym-body .recibo-section:nth-of-type(1) .recibo-grid {
    grid-template-columns: minmax(280px, .7fr) minmax(320px, .8fr) minmax(340px, 1fr);
}

.recibo-gym-body .recibo-section:nth-of-type(2) .recibo-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
}

.recibo-gym-body .recibo-section:nth-of-type(2) .recibo-client-row {
    grid-template-columns: 138px minmax(0, 1fr);
}

.recibo-gym-body .recibo-section:nth-of-type(2) .recibo-payment-row {
    width: min(560px, 100%);
    grid-template-columns: 138px minmax(0, 1fr);
}

.recibo-grid,
.recibo-importes-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(320px, 1fr));
    gap: 8px 24px;
    align-items: center;
}

.recibo-grid label:not(.recibo-check),
.recibo-text-fields label,
.recibo-number-fields label {
    display: grid;
    grid-template-columns: 138px minmax(0, 1fr);
    align-items: center;
    gap: 8px;
}

.recibo-grid input,
.recibo-grid select,
.recibo-importes-grid input,
.recibo-importes-grid select {
    width: 100%;
    min-height: 24px;
    border: 1px solid #aeb7c2;
    background: #ffffff;
    padding: 2px 6px;
    color: #0f172a;
    font: inherit;
}

.recibo-grid input[readonly],
.recibo-importes-grid input[readonly] {
    background: #eef2f7;
}

.recibo-grid label > span,
.recibo-text-fields label > span,
.recibo-number-fields label > span {
    white-space: nowrap;
}

.recibo-number-short input {
    max-width: 180px;
    justify-self: start;
}

.recibo-grid .combo-with-action {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 30px;
    gap: 4px;
    align-items: center;
    min-width: 0;
}

.recibo-grid .combo-with-action .mini-action {
    width: 30px;
    min-width: 30px;
    height: 26px;
    min-height: 26px;
    padding: 0;
}

.recibo-grid .combo-with-action .mini-action img {
    width: 18px;
    height: 18px;
    object-fit: contain;
    vertical-align: middle;
}

.recibo-check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 24px;
    margin-left: 146px;
}

.recibo-check input {
    width: 16px;
    height: 16px;
}

.recibo-total input {
    min-height: 28px;
    font-weight: 800;
    text-align: right;
}

.recibo-importes-grid {
    grid-template-columns: minmax(520px, 1fr) 360px;
    align-items: start;
}

.recibo-gym-form .recibo-importes-grid {
    grid-template-columns: minmax(520px, 1fr) 350px;
    gap: 36px;
    align-items: start;
}

.recibo-gym-form .recibo-text-fields label {
    grid-template-columns: 164px minmax(0, 1fr);
}

.recibo-gym-form .recibo-number-fields label {
    grid-template-columns: 164px 175px;
    justify-content: end;
}

.recibo-text-fields,
.recibo-number-fields {
    display: grid;
    gap: 7px;
    min-width: 0;
}

.recibo-text-fields label {
    grid-template-columns: 164px minmax(300px, 1fr);
}

.recibo-number-fields label {
    grid-template-columns: 164px 175px;
    justify-content: end;
}

.recibo-number-fields input {
    text-align: right;
}

.access-calendar-window {
    min-height: calc(100vh - 124px);
}

.calendar-nav-button {
    min-width: 34px;
    min-height: 28px;
    padding: 0 8px;
}

.access-calendar-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(160px, 1fr));
    gap: 10px;
    padding: 12px 20px;
    border-bottom: 1px solid #c8d6e4;
    background: #eef5fb;
}

.access-calendar-summary div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 36px;
    padding: 7px 12px;
    border: 1px solid #c3d1df;
    background: #ffffff;
}

.access-calendar-summary span {
    color: #405b78;
}

.access-calendar-summary strong {
    color: #071733;
    font-size: 20px;
}

.access-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(120px, 1fr));
    gap: 1px;
    padding: 12px 20px 16px;
    border-bottom: 1px solid #c8d6e4;
    background: #c8d6e4;
}

.access-calendar-weekday {
    min-height: 30px;
    display: grid;
    place-items: center;
    background: #0f172a;
    color: #ffffff;
    font-weight: 800;
}

.access-calendar-cell {
    min-height: 92px;
    display: grid;
    align-content: start;
    gap: 4px;
    padding: 8px;
    border: 0;
    background: #ffffff;
    color: #0f172a;
    text-align: left;
    font: inherit;
    cursor: pointer;
}

.access-calendar-cell:hover,
.access-calendar-cell:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: -2px;
    background: #dbeafe;
}

.access-calendar-cell.empty {
    background: #eef2f7;
    cursor: default;
}

.access-calendar-cell.today {
    box-shadow: inset 0 0 0 2px #f59e0b;
}

.access-calendar-cell.selected {
    background: #bfdbfe;
    box-shadow: inset 0 0 0 2px #1d4ed8;
}

.access-calendar-cell.has-access {
    background: #ecfdf5;
}

.access-calendar-cell.has-denied {
    background: #fee2e2;
}

.calendar-day-number {
    font-weight: 900;
    font-size: 18px;
}

.calendar-total {
    font-weight: 800;
}

.calendar-ok {
    color: #047857;
    font-size: 12px;
}

.calendar-ko {
    color: #b91c1c;
    font-size: 12px;
}

.access-calendar-detail {
    padding: 14px 20px 20px;
}

.access-calendar-detail h3 {
    margin: 0 0 10px;
    color: #071733;
}

.access-stats-window {
    min-height: calc(100vh - 124px);
}

.access-stats-header {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: end;
    gap: 18px;
    min-height: 85px;
    padding: 14px 20px 8px;
    border-bottom: 1px solid #c8d6e4;
    background: #f5f8fc;
}

.access-stats-header h2 {
    margin: 0 0 28px;
    font-size: 24px;
}

.access-stats-options {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
}

.access-stats-options label {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.access-stats-options select,
.access-stats-options input {
    min-height: 28px;
    border: 1px solid #9fb1c5;
    background: #ffffff;
    padding: 3px 7px;
}

.access-stats-options select:first-of-type {
    width: 280px;
}

.access-stats-options input[type="number"] {
    width: 82px;
}

.access-stats-filter {
    padding: 8px 20px;
    border-bottom: 1px solid #d4e0ec;
    background: #eef5fb;
    color: #405b78;
    font-weight: 700;
}

.access-stats-split {
    display: grid;
    grid-template-rows: minmax(260px, 42vh) minmax(260px, 1fr);
    min-height: calc(100vh - 230px);
}

.access-stats-grid-wrap {
    border-bottom: 1px solid #c8d6e4;
    background: #ffffff;
}

.access-stats-grid {
    width: max-content;
    min-width: 100%;
}

.access-stats-grid th,
.access-stats-grid td {
    white-space: nowrap;
    cursor: pointer;
}

.access-stats-grid tbody tr:hover {
    background: #dbeafe;
}

.access-stats-grid .selected,
.access-stats-grid .selected td {
    background: #bfdbfe;
}

.access-stats-grid .selected-column {
    background: #1d4ed8;
    color: #ffffff;
}

.access-stats-grid .total-row td,
.access-stats-grid .total-cell {
    font-weight: 800;
}

.access-stats-grid .saturday-cell {
    background: #fef9c3;
}

.access-stats-grid .sunday-cell {
    background: #fee2e2;
}

.access-stats-chart {
    min-height: 0;
    padding: 12px 20px 18px;
    background: #f8fafc;
}

.access-stats-chart h3 {
    margin: 0 0 8px;
    color: #071733;
    font-size: 16px;
}

.access-chart-empty {
    min-height: 220px;
    display: grid;
    place-items: center;
    border: 1px dashed #b7c8da;
    background: #ffffff;
    color: #405b78;
    font-weight: 700;
}

.user-stats-window {
    min-height: calc(100vh - 104px);
    background: #f3f8fe;
}

.user-stats-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 14px 20px;
    border-bottom: 1px solid #c8d6e4;
    background: #f6f9fd;
}

.user-stats-header h1 {
    margin: 0;
    font-size: 34px;
}

.user-stats-config,
.user-stats-filter {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px 14px;
    padding: 10px 20px;
    border-bottom: 1px solid #d4e0ec;
    background: #edf5fc;
}

.user-stats-config {
    background: #f8fbff;
    padding-bottom: 8px;
}

.user-stats-config label,
.user-stats-filter label {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
}

.user-stats-config span,
.user-stats-filter span {
    color: #06172d;
    font-weight: 700;
    white-space: nowrap;
}

.user-stats-config select,
.user-stats-config input,
.user-stats-filter select,
.user-stats-filter input {
    min-height: 28px;
    border: 1px solid #9fb1c5;
    background: #ffffff;
    padding: 3px 7px;
}

.user-stats-config select {
    width: 280px;
}

.user-stats-name input {
    width: 360px;
}

.user-stats-filter label:first-child select,
.user-stats-filter label:nth-child(2) select {
    width: 260px;
}

.user-stats-filter label:nth-child(5) select,
.user-stats-filter label:nth-child(7) select {
    width: 210px;
}

.user-stats-filter label:nth-child(3) select {
    width: 86px;
}

.user-stats-status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 20px;
    border-bottom: 1px solid #cfddea;
    color: #334e6c;
    background: #eef6ff;
}

.user-stats-split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 420px;
    min-height: calc(100vh - 275px);
}

.user-stats-grid-wrap {
    min-height: 380px;
    border-right: 1px solid #c8d6e4;
    background: #ffffff;
}

.user-stats-grid {
    width: max-content;
    min-width: 100%;
}

.user-stats-grid th,
.user-stats-grid td {
    white-space: nowrap;
    cursor: pointer;
}

.user-stats-grid .number-cell {
    text-align: right;
}

.user-stats-grid tbody tr:hover td {
    background: #dbeafe;
}

.user-stats-grid .selected td {
    background: #bfdbfe;
}

.user-stats-grid .selected-column {
    background: #1d4ed8 !important;
    color: #ffffff;
}

.user-stats-grid .total-row td,
.user-stats-grid .total-cell {
    font-weight: 800;
    background: #f1f6fb;
}

.user-stats-chart {
    min-width: 0;
    padding: 14px 18px;
    background: #f8fafc;
}

.user-stats-chart-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.user-stats-chart h2 {
    margin: 0;
    color: #071733;
    font-size: 17px;
}

.user-stats-chart-expand {
    min-width: 82px;
    padding: 7px 12px;
}

.user-stats-chart .pie-chart {
    margin: 18px auto 14px;
}

.stats-chart-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 2500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px;
    background: rgba(15, 23, 42, 0.42);
}

.stats-chart-modal {
    width: min(1320px, 96vw);
    max-height: 92vh;
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr);
    overflow: hidden;
    border: 1px solid #b7c8da;
    border-radius: 8px !important;
    background: #f8fafc;
    box-shadow: 0 20px 60px rgba(15, 23, 42, 0.28);
}

.stats-chart-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 18px;
    border-bottom: 1px solid #cbd5e1;
    background: #edf5fc;
}

.stats-chart-modal-header h2 {
    margin: 0;
    color: #071733;
    font-size: 20px;
}

.stats-chart-modal-header span {
    display: block;
    margin-top: 3px;
    color: #475569;
    font-weight: 700;
}

.stats-chart-modal-toolbar {
    display: flex;
    align-items: end;
    gap: 14px;
    padding: 12px 18px;
    border-bottom: 1px solid #d7e2ee;
    background: #ffffff;
}

.stats-chart-modal-toolbar label {
    display: grid;
    gap: 4px;
    color: #071733;
    font-weight: 800;
}

.stats-chart-modal-toolbar select {
    min-width: 180px;
    height: 32px;
    border: 1px solid #9eb4cc;
    background: #ffffff;
}

.stats-chart-modal-body {
    min-height: 0;
    overflow: auto;
    padding: 16px 18px 22px;
    background: #f8fafc;
}

.stats-svg-expanded {
    width: 100%;
    height: min(58vh, 560px);
    min-height: 420px;
}

.stats-axis-labels-expanded {
    width: 100%;
    margin-top: -16px;
    font-size: 0.95rem;
}

.stats-chart-modal-pie {
    width: min(520px, 72vh);
}

.stats-chart-modal-legend {
    max-width: 1120px;
    margin-left: auto;
    margin-right: auto;
}

@media (max-width: 1100px) {
    .recibo-gym-body-with-photo {
        grid-template-columns: 1fr;
    }

    .recibo-client-photo {
        justify-self: start;
    }

    .recibo-grid,
    .recibo-importes-grid {
        grid-template-columns: 1fr;
    }

    .access-calendar-summary {
        grid-template-columns: repeat(2, minmax(140px, 1fr));
    }

    .access-calendar-grid {
        grid-template-columns: repeat(7, minmax(82px, 1fr));
    }

    .access-calendar-cell {
        min-height: 78px;
        padding: 6px;
        font-size: 12px;
    }

    .access-stats-header {
        grid-template-columns: 1fr;
    }

    .access-stats-options {
        justify-content: flex-start;
    }

    .user-stats-header,
    .user-stats-status {
        align-items: flex-start;
        flex-direction: column;
    }

    .user-stats-split {
        grid-template-columns: 1fr;
    }

    .user-stats-chart {
        border-top: 1px solid #c8d6e4;
    }

    .recibo-check {
        margin-left: 0;
    }

    .recibo-gym-actions {
        flex-wrap: wrap;
        justify-content: flex-start;
    }
}

.templates-window,
.templates-select-window,
.merged-document-window {
    min-height: calc(100vh - 150px);
}

.templates-window-fullscreen {
    position: fixed;
    inset: 0;
    z-index: 900;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    width: 100vw;
    height: 100vh;
    margin: 0;
    border: 0;
    background: #edf4fb;
}

.templates-main-header {
    min-height: 48px;
    padding-top: 6px;
    padding-bottom: 6px;
    gap: 12px;
    overflow: hidden;
}

.templates-main-header .title-with-icon {
    flex: 0 1 auto;
    min-width: 260px;
}

.templates-main-header .desktop-list-actions {
    flex: 1 1 auto;
    min-width: 0;
    justify-content: flex-end;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 2px;
}

.templates-main-header .desktop-list-actions .app-btn {
    min-width: 80px;
    padding-left: 12px;
    padding-right: 12px;
    white-space: nowrap;
}

.templates-main-header .desktop-list-actions .app-btn-help {
    min-width: 42px;
}

.templates-main-header .desktop-list-actions .app-btn-preview {
    min-width: 112px;
    background: #7c3aed;
    border-color: #6d28d9;
    color: #fff;
}

.templates-main-header .desktop-list-actions .app-btn-preview:hover,
.templates-main-header .desktop-list-actions .app-btn-preview:focus-visible {
    background: #6d28d9;
    color: #fff;
}

.templates-editor-shell {
    min-height: 0;
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr);
    overflow: hidden;
}

.templates-form {
    display: grid;
    grid-template-columns: minmax(280px, .45fr) minmax(560px, 1fr);
    gap: 12px 22px;
    padding: 8px 18px;
    border-top: 1px solid #b7c4d4;
    border-bottom: 1px solid #b7c4d4;
    background: #f6f9fd;
}

.templates-form label:not(.desktop-check) {
    grid-template-columns: 145px minmax(220px, 1fr);
    align-items: center;
}

.templates-table-lookup {
    position: relative;
    min-width: 0;
}

.templates-table-lookup input {
    width: 100%;
}

.templates-table-dismiss {
    position: fixed;
    inset: 0;
    z-index: 929;
    background: transparent;
}

.templates-table-options {
    position: absolute;
    z-index: 930;
    top: calc(100% + 2px);
    left: 0;
    right: 0;
    max-height: min(430px, calc(100vh - 238px));
    overflow: auto;
    border: 1px solid #8090a4;
    background: #fff;
    box-shadow: 0 14px 30px rgba(15, 23, 42, .18);
}

.templates-table-options button {
    display: block;
    width: 100%;
    min-height: 28px;
    border: 0;
    border-bottom: 1px solid #e1e7f0;
    padding: 4px 8px;
    background: #fff;
    color: #071733;
    text-align: left;
    font: 400 0.92rem "Segoe UI", Arial, sans-serif;
    cursor: pointer;
}

.templates-table-options button:hover,
.templates-table-options button:focus-visible,
.templates-table-options button.selected {
    background: #2367d1;
    color: #fff;
}

.templates-tools {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    padding: 5px 18px;
    border-bottom: 1px solid #b7c4d4;
    background: #eef5fc;
    overflow-x: auto;
}

.templates-tools label:not(.template-file-button) {
    display: inline-grid;
    grid-template-columns: auto minmax(58px, 126px);
    align-items: center;
    gap: 5px;
    white-space: nowrap;
    color: #142033;
    font-size: 0.78rem;
}

.templates-tools select,
.templates-tools input {
    min-height: 24px;
    border: 1px solid #9fb0c4;
    padding: 3px 6px;
    background: #fff;
    color: #142033;
    font: inherit;
}

.templates-tools button {
    min-width: 32px;
    min-height: 25px;
    border: 1px solid #9fb0c4;
    border-radius: 3px;
    background: linear-gradient(#fff, #dce5ef);
    color: #142033;
    font: 700 0.82rem "Segoe UI", Arial, sans-serif;
    cursor: pointer;
}

.templates-tools button:hover,
.templates-tools button:focus-visible {
    border-color: #1d74b7;
    background: #dceeff;
}

.templates-tools-separator {
    width: 1px;
    height: 24px;
    margin: 0 4px;
    background: #b7c4d4;
}

.template-file-button {
    position: relative;
    display: inline-grid;
    place-items: center;
    min-width: 78px;
    min-height: 27px;
    overflow: hidden;
    cursor: pointer;
}

.template-file-button input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.templates-workspace {
    min-height: 0;
    display: grid;
    grid-template-columns: 250px minmax(0, 1fr);
}

.templates-fields {
    min-height: 0;
    padding: 9px 10px;
    border-right: 1px solid #c7d2df;
    background: #f8fafc;
    overflow: hidden;
}

.templates-fields h3 {
    margin: 0 0 3px;
    font-size: 0.95rem;
}

.templates-fields p {
    margin: 0 0 10px;
    color: #52627a;
    font-size: 0.78rem;
}

.templates-fields-list {
    display: grid;
    gap: 4px;
    max-height: none;
    min-height: 0;
    overflow: auto;
}

.templates-fields-list button {
    min-height: 25px;
    padding: 3px 7px;
    border: 1px solid transparent;
    border-radius: 3px;
    background: transparent;
    color: #142033;
    text-align: left;
    font: inherit;
    cursor: pointer;
}

.templates-fields-list button:hover,
.templates-fields-list button:focus-visible {
    border-color: #9fc3e6;
    background: #dceeff;
}

.templates-paper {
    min-height: 0;
    display: grid;
    grid-template-rows: 24px minmax(0, 1fr);
    overflow: hidden;
    background: #dfe6ef;
}

.templates-ruler {
    width: var(--tpl-page-width, 210mm);
    max-width: calc(100% - 54px);
    justify-self: center;
    display: grid;
    grid-template-columns: repeat(var(--tpl-ruler-columns, 22), 10mm);
    align-items: end;
    min-height: 24px;
    overflow: hidden;
    padding-top: 3px;
    border-left: 1px solid #8090a4;
    border-right: 1px solid #8090a4;
    background:
        repeating-linear-gradient(to right, transparent 0 calc(1mm - 1px), rgba(143, 160, 183, .45) calc(1mm - 1px) 1mm),
        repeating-linear-gradient(to right, #708399 0 1px, transparent 1px 10mm),
        #eef2f7;
    color: #4b5d74;
    font-size: 0.58rem;
}

.templates-ruler span {
    padding-left: 2px;
    white-space: nowrap;
}

.templates-paper-scroll {
    min-height: 0;
    padding: 12px 26px 34px;
    overflow: auto;
}

.templates-paper-canvas {
    display: grid;
    grid-template-columns: 26px max-content;
    align-items: start;
    justify-content: center;
    gap: 8px;
    width: max-content;
    min-width: 100%;
}

.templates-vertical-ruler {
    width: 26px;
    height: var(--tpl-page-height, 297mm);
    display: grid;
    grid-template-rows: repeat(var(--tpl-ruler-rows, 30), 10mm);
    justify-items: end;
    overflow: hidden;
    padding-right: 3px;
    border-top: 1px solid #8090a4;
    border-bottom: 1px solid #8090a4;
    background:
        repeating-linear-gradient(to bottom, transparent 0 calc(1mm - 1px), rgba(143, 160, 183, .45) calc(1mm - 1px) 1mm),
        repeating-linear-gradient(to bottom, #708399 0 1px, transparent 1px 10mm),
        #eef2f7;
    color: #4b5d74;
    font-size: 0.58rem;
    line-height: 1;
}

.templates-vertical-ruler span {
    padding-top: 2px;
    white-space: nowrap;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
}

.templates-document-editor {
    width: var(--tpl-page-width, 210mm);
    min-height: var(--tpl-page-height, 297mm);
    margin: 0 auto;
    padding: var(--tpl-margin-top, 20mm) var(--tpl-margin-right, 20mm) var(--tpl-margin-bottom, 20mm) var(--tpl-margin-left, 20mm);
    border: 1px solid #9aaabc;
    outline: none;
    background: #ffffff;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.14);
    color: #142033;
    font-family: var(--tpl-font-family, "Segoe UI"), Arial, sans-serif;
    font-size: var(--tpl-font-size, 11pt);
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.templates-document-editor:empty::before {
    content: "Diseñe aquí la plantilla del documento";
    color: #9aa8ba;
}

.templates-document-editor img {
    max-width: 100%;
    height: auto;
}

.templates-open-backdrop {
    position: fixed;
    inset: 0;
    z-index: 2147482500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    background: rgba(15, 23, 42, .42);
}

.templates-open-dialog {
    width: min(900px, calc(100vw - 40px));
    max-height: min(760px, calc(100vh - 40px));
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    overflow: hidden;
    border: 1px solid #98a9bd;
    border-radius: 4px;
    background: #f8fbff;
    box-shadow: 0 22px 54px rgba(15, 23, 42, .36);
}

.templates-open-dialog header,
.templates-open-dialog footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 10px 14px;
    border-bottom: 1px solid #c4d0df;
    background: #eef5fc;
}

.templates-open-dialog footer {
    justify-content: flex-end;
    border-top: 1px solid #c4d0df;
    border-bottom: 0;
}

.templates-open-dialog header div {
    display: grid;
    gap: 2px;
}

.templates-open-dialog header strong {
    font-size: 1.05rem;
}

.templates-open-dialog header span {
    color: #52627a;
    font-size: .86rem;
}

.templates-open-dialog .app-message-body {
    min-height: 0;
    overflow: hidden;
    padding: 14px;
}

.templates-open-close {
    min-width: 38px;
}

.templates-open-dialog {
    width: min(900px, calc(100vw - 40px));
}

.templates-open-search {
    width: 100%;
    min-height: 32px;
    margin-bottom: 10px;
    border: 1px solid #9fb0c4;
    padding: 5px 8px;
    font: inherit;
}

.templates-open-grid {
    border: 1px solid #b9c7d8;
    background: #fff;
}

.templates-open-grid-header,
.templates-open-grid-body button {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) minmax(210px, .55fr);
    align-items: center;
}

.templates-open-grid-header {
    min-height: 34px;
    border-bottom: 1px solid #c6d3e2;
    background: #e8f0f8;
    color: #071733;
    font-weight: 700;
}

.templates-open-grid-header span,
.templates-open-grid-body button span {
    min-width: 0;
    padding: 7px 10px;
    border-right: 1px solid #d4deea;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.templates-open-grid-header span:last-child,
.templates-open-grid-body button span:last-child {
    border-right: 0;
}

.templates-open-grid-body {
    max-height: min(520px, calc(100vh - 230px));
    overflow: auto;
}

.templates-open-empty {
    min-height: 58px;
    display: grid;
    place-items: center;
    color: #52627a;
    font-size: .95rem;
}

.templates-open-grid-body button {
    width: 100%;
    min-height: 34px;
    border: 0;
    border-bottom: 1px solid #e1e7f0;
    background: #fff;
    color: #142033;
    text-align: left;
    cursor: pointer;
    font: inherit;
}

.templates-open-grid-body button:hover,
.templates-open-grid-body button:focus-visible {
    background: #dceeff;
}

.templates-open-grid-body button.selected {
    background: #2367d1;
    color: #fff;
}

.templates-preview-backdrop {
    position: fixed !important;
    inset: 0 !important;
    z-index: 2147483000 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 18px !important;
    background: rgba(15, 23, 42, .48) !important;
}

.templates-preview-dialog {
    position: relative;
    z-index: 2147483001;
    width: min(1120px, calc(100vw - 36px));
    height: min(880px, calc(100vh - 36px));
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    overflow: hidden;
    border: 1px solid #98a9bd;
    border-radius: 4px;
    background: #f8fbff;
    box-shadow: 0 22px 54px rgba(15, 23, 42, .36);
}

.templates-preview-dialog header,
.templates-preview-dialog footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 10px 14px;
    border-bottom: 1px solid #c4d0df;
    background: #eef5fc;
}

.templates-preview-dialog footer {
    justify-content: flex-end;
    border-top: 1px solid #c4d0df;
    border-bottom: 0;
}

.templates-preview-dialog header div {
    display: grid;
    gap: 2px;
}

.templates-preview-dialog header strong {
    font-size: 1.05rem;
}

.templates-preview-dialog header span {
    color: #52627a;
    font-size: .86rem;
}

.templates-preview-dialog main {
    min-height: 0;
    overflow: auto;
    padding: 18px 28px 34px;
    background: #dfe6ef;
}

.templates-preview-close {
    min-width: 38px;
}

.templates-preview-paper {
    width: var(--tpl-page-width, 210mm);
    min-height: var(--tpl-page-height, 297mm);
    margin: 0 auto;
    border: 1px solid #9aaabc;
    background: #fff;
    box-shadow: 0 8px 20px rgba(15, 23, 42, .18);
    color: #142033;
    overflow-wrap: anywhere;
}

.templates-preview-paper img {
    max-width: 100%;
    height: auto;
}

.templates-grid th:first-child,
.templates-grid td:first-child {
    min-width: 210px;
}

.templates-reference {
    gap: 20px;
}

.merged-document-info {
    padding: 10px 22px;
    border-top: 1px solid #b7c4d4;
    border-bottom: 1px solid #b7c4d4;
    background: #eef2f7;
    color: #334155;
    font-weight: 700;
}

.merged-document-subtitle {
    margin: 2px 0 0;
    color: #334155;
    font-size: 0.9rem;
    font-weight: 600;
}

.merged-document-format {
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 48px;
    padding: 9px 18px;
    border-top: 1px solid #b7c4d4;
    border-bottom: 1px solid #b7c4d4;
    background: #eef2f7;
}

.merged-document-format button {
    min-width: 36px;
    height: 28px;
    padding: 0 9px;
    border: 1px solid #9fb0c4;
    border-radius: 3px;
    background: linear-gradient(#ffffff, #dce4ef);
    color: #142033;
    font: 700 0.85rem "Segoe UI", Arial, sans-serif;
    cursor: pointer;
}

.merged-document-format button:hover,
.merged-document-format button:focus-visible {
    border-color: #1d74b7;
    background: #dceeff;
}

.format-separator {
    width: 14px;
}

.merged-document-paper {
    width: min(794px, calc(100% - 48px));
    min-height: 900px;
    margin: 24px auto;
    padding: 42px;
    border: 1px solid #9aaabc;
    background: #ffffff;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.14);
    color: #142033;
    font-size: 15px;
    line-height: 1.45;
}

.merged-document-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
}

.merged-document-editor {
    width: 100%;
    min-height: 820px;
    border: 0;
    outline: none;
    resize: vertical;
    background: #ffffff;
    color: #142033;
    font-family: "Segoe UI", Arial, sans-serif;
    font-size: 15px;
    line-height: 1.45;
}

.merged-document-html-editor {
    width: 100%;
    min-height: 820px;
    background: #fff;
}

.merged-document-html-editor input[type="checkbox"] {
    accent-color: #087f6f;
    cursor: pointer;
}

.merged-document-html-editor input[type="radio"] {
    accent-color: #087f6f;
    cursor: pointer;
}

.merged-document-html-editor input[type="text"] {
    box-sizing: border-box;
    min-width: 0;
    border: 0;
    border-bottom: 1px solid #64748b;
    border-radius: 0;
    background: transparent;
    color: inherit;
    font: inherit;
}

.merged-document-print {
    display: none;
    white-space: normal;
}

.save-document-dialog {
    width: min(420px, calc(100vw - 34px));
}

.save-document-name {
    display: grid;
    gap: 8px;
    color: #142033;
    font-weight: 700;
}

.save-document-name input {
    width: 100%;
    min-height: 30px;
    border: 1px solid #9fb0c4;
    padding: 4px 8px;
    font: inherit;
}

@media print {
    .sidebar,
    .top-row,
    .no-print,
    .desktop-card-header {
        display: none !important;
    }

    body {
        background: #ffffff !important;
    }

    .content,
    .main-content {
        padding: 0 !important;
        margin: 0 !important;
    }

    .merged-document-window {
        border: 0 !important;
        box-shadow: none !important;
    }

    .merged-document-paper {
        width: auto;
        min-height: 0;
        margin: 0;
        padding: 0;
        border: 0;
        box-shadow: none;
    }

    .merged-document-editor {
        display: none !important;
    }

    .merged-document-print {
        display: block !important;
    }
}

.filter-strip.vehiculos-filter-strip {
    display: grid;
    grid-template-columns: 330px 190px 210px 190px minmax(360px, 1fr);
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
}

.filter-strip.vehiculos-filter-strip label {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 7px;
    min-width: 0;
}

.filter-strip.vehiculos-filter-strip input,
.filter-strip.vehiculos-filter-strip select {
    width: 100%;
    min-width: 0;
}

.filter-strip.vehiculos-filter-strip label:first-child input {
    min-width: 0;
}

@media (max-width: 980px) {
    .templates-layout,
    .templates-workspace {
        grid-template-columns: 1fr;
    }

    .templates-list-panel,
    .templates-fields {
        border-right: 0;
        border-bottom: 1px solid #b7c4d4;
    }

    .templates-fields-list {
        max-height: 220px;
    }
}

.client-header-actions {
    display: flex;
    flex-wrap: nowrap;
    justify-content: flex-end;
    gap: 8px;
    max-width: none;
    min-width: 0;
}

.client-header-actions .app-btn {
    min-width: 0;
    min-height: 31px;
    padding: 0 14px;
    white-space: nowrap;
}

.client-header-actions .win-btn.help {
    flex: 0 0 42px;
}

.client-header-actions .client-btn-actividad {
    padding: 0 16px;
}

.client-btn-plantillas,
.client-btn-actividad {
    background: #0f8074;
    border-color: #0b6d63;
    color: #ffffff;
}

.client-btn-seguimiento {
    background: #14b8a6;
    border-color: #0f9f90;
    color: #ffffff;
}

.client-btn-print {
    background: #9333ea;
    border-color: #7e22ce;
    color: #ffffff;
}

.client-btn-ventas {
    background: #2563eb;
    border-color: #1d4ed8;
    color: #ffffff;
}

.client-btn-beneficios {
    background: #7c3aed;
    border-color: #6d28d9;
    color: #ffffff;
}

.client-btn-actividad.has-activity {
    background: #facc15;
    border-color: #eab308;
    color: #0f172a;
}

.client-btn-doc-inline {
    min-width: 190px;
    background: #b91c1c;
    border-color: #991b1b;
    color: #ffffff;
}

.client-btn-doc-inline.client-btn-lopd {
    background: #087f6f;
    border-color: #06695d;
}

.client-sepa-actions {
    grid-column: 1 / -1;
    display: flex;
    justify-content: flex-start;
    margin-left: 155px;
}

.client-btn-sepa {
    min-width: 220px;
    background: #087f6f;
    border-color: #06695d;
    color: #ffffff;
}

.activity-grid {
    padding: 18px;
}

.desktop-card.activity-client-window {
    max-width: none;
    height: calc(100vh - 84px);
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.activity-client-header {
    min-height: 60px;
    padding: 8px 20px;
    flex: 0 0 auto;
}

.activity-client-actions {
    flex-wrap: nowrap;
    justify-content: flex-end;
    gap: 10px;
}

.activity-client-actions .app-btn {
    min-width: 92px;
    min-height: 31px;
    padding: 0 14px;
    white-space: nowrap;
}

.activity-client-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    padding: 10px 18px 12px;
    background: #f4f7fb;
}

.activity-data-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 190px;
    gap: 12px;
    align-items: start;
}

.activity-form-stack {
    display: grid;
    gap: 7px;
    min-width: 0;
}

.activity-group {
    min-width: 0;
    margin: 0;
    padding: 8px 16px;
    border: 1px solid #c7d2df;
    background: #f8fafc;
}

.activity-group legend {
    display: none;
}

.activity-two-columns {
    display: grid;
    grid-template-columns: repeat(2, minmax(280px, 1fr));
    gap: 7px 22px;
    align-items: center;
}

.activity-two-columns label:not(.desktop-check),
.activity-turn-form label:not(.desktop-check),
.activity-total {
    display: grid;
    grid-template-columns: 142px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
}

.activity-two-columns input,
.activity-two-columns select,
.activity-two-columns textarea,
.activity-turn-form input,
.activity-turn-form select,
.activity-turn-form textarea,
.date-check input[type="date"] {
    width: 100%;
    min-height: 23px;
    border: 1px solid #aeb7c2;
    background: #ffffff;
    padding: 1px 6px;
    color: #0f172a;
    font: inherit;
}

.activity-two-columns input[readonly],
.activity-turn-form input[readonly] {
    background: #eef2f7;
}

.activity-two-columns .wide-row,
.activity-turn-form .wide-row {
    grid-column: 1 / -1;
}

.activity-two-columns textarea,
.activity-turn-form textarea {
    min-height: 38px;
    resize: vertical;
}

.activity-check-line {
    display: flex;
    align-items: center;
    gap: 22px;
    min-height: 24px;
}

.expired-badge {
    display: inline-flex;
    align-items: center;
    min-height: 25px;
    padding: 0 10px;
    border: 1px solid #dc2626;
    border-radius: 3px;
    background: #fee2e2;
    color: #991b1b;
    font-weight: 800;
}

.activity-amount-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 150px;
    gap: 14px;
    align-items: start;
}

.activity-amount-layout .activity-two-columns {
    min-width: 0;
}

.activity-amount-layout .activity-two-columns label:not(.desktop-check) {
    grid-template-columns: 172px minmax(0, 1fr);
}

.activity-amount-layout .activity-two-columns label > span {
    white-space: nowrap;
}

.tariff-side {
    display: flex;
    min-width: 0;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.tariff-image {
    width: 146px;
    height: 104px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border: 1px solid #c7d2df;
    background: #ffffff;
}

.tariff-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.activity-total {
    width: 146px;
    grid-template-columns: 52px minmax(0, 1fr);
    font-weight: 800;
}

.activity-total input {
    min-height: 27px;
    font-size: 1.05rem;
    font-weight: 800;
    text-align: right;
}

.date-check {
    display: grid;
    grid-template-columns: 18px minmax(0, 152px);
    align-items: center;
    gap: 6px;
}

.date-check input[type="checkbox"] {
    width: 15px;
    height: 15px;
}

.activity-photo-panel {
    display: grid;
    width: 178px;
    gap: 6px;
    justify-items: center;
}

.activity-photo-title {
    text-align: center;
    font-weight: 700;
}

.activity-photo-box {
    width: 172px;
    min-height: 170px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 8px;
    border: 1px solid #aeb7c2;
    background: #ffffff;
    color: #475569;
    text-align: center;
}

.activity-photo-box img {
    max-width: 146px;
    max-height: 132px;
    object-fit: contain;
}

.activity-photo-box span {
    max-width: 170px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.84rem;
}

.activity-turns-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    padding-bottom: 10px;
}

.activity-turns-toolbar label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.activity-turns-toolbar input {
    width: 310px;
    min-height: 27px;
    border: 1px solid #aeb7c2;
    background: #ffffff;
}

.activity-turns-grid-wrap {
    max-height: calc(100vh - 300px);
}

.activity-receipts-grid-wrap {
    max-height: calc(100vh - 300px);
}

.activity-receipts-grid th,
.activity-receipts-grid td {
    height: 40px;
}

.activity-receipts-grid .money {
    text-align: right;
}

.desktop-grid tbody tr.activity-receipt-unpaid:not(.selected) {
    background: #e22228;
    color: #ffffff;
}

.desktop-grid tbody tr.activity-receipt-unpaid:not(.selected):hover {
    background: #c91d23;
    color: #ffffff;
}

.activity-receipt-actions {
    min-width: 150px;
}

.activity-receipt-charge-button {
    min-width: 82px;
    min-height: 28px;
    padding: 0 10px;
    border-color: #d6a300;
    background: #ffd84d;
    color: #0f172a;
}

.activity-receipt-charge-button:disabled {
    border-color: #d6dbe3;
    background: #eef2f7;
    color: #64748b;
    opacity: .8;
}

.activity-receipt-charge-dialog {
    width: min(620px, calc(100vw - 36px));
    border: 1px solid #9aa7b8;
    background: #f4f7fb;
    box-shadow: 0 18px 45px rgba(15, 23, 42, .24);
}

.activity-receipt-charge-dialog .activity-turn-dialog-header {
    min-height: 66px;
}

.activity-receipt-charge-dialog h2 {
    margin: 0;
}

.activity-receipt-charge-dialog p {
    margin: 4px 0 0;
    color: #334155;
}

.activity-receipt-charge-form {
    display: grid;
    gap: 12px;
    padding: 18px;
    border-top: 1px solid #c7d2df;
    border-bottom: 1px solid #c7d2df;
}

.activity-receipt-charge-form label {
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
}

.activity-receipt-charge-form input,
.activity-receipt-charge-form select {
    width: 100%;
    min-height: 31px;
    border: 1px solid #aeb7c2;
    background: #ffffff;
    padding: 2px 7px;
    font: inherit;
}

.activity-receipt-charge-form input[readonly] {
    background: #eef2f7;
    font-weight: 700;
    text-align: right;
}

.activity-receipt-charge-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 12px 18px;
}

.activity-receipt-charge-footer .app-btn {
    min-width: 100px;
    min-height: 31px;
}

.activity-turn-dialog {
    width: min(900px, calc(100vw - 36px));
    border: 1px solid #9aa7b8;
    background: #f4f7fb;
    box-shadow: 0 18px 45px rgba(15, 23, 42, .24);
}

.activity-turn-dialog-header {
    min-height: 70px;
}

.activity-turn-dialog-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 190px;
    gap: 24px;
    padding: 24px 28px;
}

.activity-turn-form {
    display: grid;
    grid-template-columns: 1fr;
    gap: 13px;
}

.activity-turn-form label:not(.desktop-check) {
    grid-template-columns: 135px minmax(0, 1fr);
}

.turn-active {
    margin-left: 145px;
}

.turn-photo {
    width: 170px;
    min-height: 190px;
}

.turno-free {
    background: #ecfdf5 !important;
}

.turno-full {
    background: #fee2e2 !important;
}

@media (max-width: 1100px) {
    .activity-data-layout,
    .activity-amount-layout,
    .activity-turn-dialog-body {
        grid-template-columns: 1fr;
    }

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

    .activity-client-actions {
        flex-wrap: wrap;
        justify-content: flex-start;
    }

    .activity-photo-box {
        width: 190px;
    }
}

.client-tools-window {
    min-height: calc(100vh - 150px);
}

.client-follow-window {
    height: calc(100vh - 92px);
    min-height: 720px;
    display: flex;
    flex-direction: column;
}

.client-follow-window .desktop-list-header {
    flex: 0 0 auto;
}

.client-follow-name {
    margin-left: 18px;
    color: #0f3f71;
    font-weight: 700;
}

.client-follow-selector label {
    display: flex;
    align-items: center;
    gap: 10px;
    width: min(760px, 100%);
}

.client-follow-selector .list-client-lookup {
    flex: 1 1 auto;
    min-width: 320px;
}

.client-follow-selector .list-client-lookup input {
    width: 100%;
}

.client-follow-results {
    max-height: 360px;
    z-index: 1000;
}

.client-follow-dashboard {
    flex: 1 1 auto;
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-auto-rows: minmax(0, auto);
    gap: 10px;
    padding: 10px;
    background: #edf5fc;
}

.client-follow-card {
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    border: 1px solid #b7cbe0;
    background: #ffffff;
}

.client-follow-card-header {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 10px;
    border-bottom: 1px solid #cbd9e7;
    background: #f4f9fd;
}

.client-follow-card-header h3 {
    margin: 0;
    color: #082855;
    font-size: 1.05rem;
}

.client-follow-card-header span {
    display: block;
    margin-top: 2px;
    color: #475569;
    font-size: 0.8rem;
}

.client-follow-card-header .app-btn {
    min-width: 118px;
    white-space: nowrap;
}

.client-follow-concepts-card {
    min-height: 280px;
}

.client-follow-concepts-grid {
    width: 100%;
    min-width: 760px;
}

.client-follow-concepts-grid th:first-child,
.client-follow-concepts-grid td:first-child {
    width: 58px;
    text-align: center;
}

.client-follow-concepts-grid th:nth-child(3),
.client-follow-concepts-grid td:nth-child(3) {
    width: 120px;
}

.client-follow-concepts-grid th:nth-child(4),
.client-follow-concepts-grid td:nth-child(4) {
    width: 240px;
}

.client-follow-concepts-grid th:last-child,
.client-follow-concepts-grid td:last-child {
    width: 110px;
    text-align: center;
}

.client-follow-icon-button {
    width: 34px;
    height: 28px;
    border: 1px solid #8aa9cc;
    border-radius: 4px;
    background: #e9f3ff;
    color: #082855;
    font-weight: 900;
    line-height: 1;
}

.client-follow-icon-button:hover {
    background: #cfe6ff;
}

.client-follow-open-button {
    border-width: 1px;
    color: #0f172a !important;
    font-weight: 400 !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.45);
}

.client-follow-open-button.facturas {
    background: #9ef0bd;
    border-color: #4fb879;
}

.client-follow-open-button.facturas:hover:not(:disabled) {
    background: #7ee8a8;
}

.client-follow-open-button.albaranes {
    background: #a9dcff;
    border-color: #5aa8d8;
}

.client-follow-open-button.albaranes:hover:not(:disabled) {
    background: #8dccf8;
}

.client-follow-open-button.recibos {
    background: #fff19a;
    border-color: #d6bd32;
}

.client-follow-open-button.recibos:hover:not(:disabled) {
    background: #ffe871;
}

.client-follow-open-button.presupuestos {
    background: #ffc7dd;
    border-color: #db7fa4;
}

.client-follow-open-button.presupuestos:hover:not(:disabled) {
    background: #ffabc9;
}

.client-follow-open-button.partes {
    background: #d7c7ff;
    border-color: #9674e8;
}

.client-follow-open-button.partes:hover:not(:disabled) {
    background: #c3adff;
}

.client-follow-grid-wrap {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
}

.desktop-grid.client-follow-grid {
    width: 100%;
    min-width: 780px;
    font-size: 0.78rem;
}

.client-follow-grid th,
.client-follow-grid td {
    padding: 5px 6px;
}

.client-follow-grid th:first-child,
.client-follow-grid td:first-child {
    width: 54px;
    font-weight: 700;
}

.client-follow-grid tfoot td {
    border-top: 2px solid #9eb6cf;
    background: #edf4fb;
    font-weight: 800;
}

.client-follow-grid .total-cell {
    min-width: 78px;
    font-weight: 800;
}

@media (max-width: 1200px) {
    .client-follow-dashboard {
        grid-template-columns: 1fr;
    }

    .client-follow-selector label {
        align-items: stretch;
        flex-direction: column;
    }

    .client-follow-selector .list-client-lookup {
        min-width: 0;
    }
}

.horizontal-grid {
    overflow: auto;
}

.horizontal-grid table {
    min-width: 1200px;
}

.number-cell {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.stats-summary-band {
    display: flex;
    gap: 18px;
    padding: 14px 18px;
    border-top: 1px solid #cbd5e1;
    border-bottom: 1px solid #cbd5e1;
    background: #f8fafc;
}

.stats-summary-band div {
    min-width: 180px;
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
}

.stats-summary-band span {
    display: block;
    color: #475569;
    font-size: 0.82rem;
}

.stats-summary-band strong {
    display: block;
    margin-top: 4px;
    color: #0f172a;
    font-size: 1.25rem;
}

.article-stats-window {
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr);
    background: #f8fafc;
}

.article-stats-header {
    min-height: 126px;
    padding: 14px 18px;
    border-bottom: 1px solid #cbd5e1;
    background: #f8fafc;
}

.article-stats-header h2 {
    margin: 0 0 22px;
    font-size: 1.35rem;
    font-weight: 900;
}

.article-stats-options {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px 14px;
}

.article-stats-options label:not(.desktop-radio) {
    display: flex;
    align-items: center;
    gap: 6px;
}

.article-stats-options select {
    min-width: 135px;
    height: 30px;
    border: 1px solid #9fb0c4;
    background: #fff;
}

.desktop-radio {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #142033;
}

.desktop-radio.disabled {
    color: #64748b;
}

.article-stats-selection {
    min-height: 32px;
    display: flex;
    align-items: center;
    padding: 0 16px;
    border-bottom: 1px solid #cbd5e1;
    background: #ffffff;
    font-weight: 800;
}

.article-stats-split {
    min-height: 0;
    display: grid;
    grid-template-rows: minmax(230px, 42vh) minmax(260px, 1fr);
}

.article-stats-grid-wrap {
    min-height: 0;
    overflow: auto;
    border-bottom: 1px solid #cbd5e1;
}

.article-stats-grid {
    min-width: 1180px;
}

.article-stats-grid th {
    background: #e6edf5;
    color: #0f172a;
    cursor: pointer;
    font-weight: 700;
}

.article-stats-grid th:first-child,
.article-stats-grid td:first-child {
    min-width: 110px;
    font-weight: 600;
}

.article-stats-grid th.selected-column {
    background: #1d74b7;
}

.article-stats-grid .total-cell,
.article-stats-grid .total-row td {
    font-weight: 400;
}

.article-stats-grid .number-cell {
    font-weight: 400;
}

.article-stats-grid .total-row {
    background: #f1f5f9;
}

.article-stats-chart {
    min-height: 0;
    display: grid;
    place-items: center;
    padding: 18px;
    background: #ffffff;
}

.stats-svg {
    width: min(100%, 1120px);
    height: min(100%, 390px);
    min-height: 280px;
}

.stats-svg text {
    fill: #334155;
    font: 12px "Segoe UI", Arial, sans-serif;
}

.stats-axis-labels {
    width: min(100%, 1060px);
    display: flex;
    justify-content: space-between;
    gap: 4px;
    margin-top: -22px;
    padding: 0 18px 0 56px;
    color: #334155;
    font-size: 0.82rem;
    font-weight: 600;
}

.axis {
    stroke: #94a3b8;
    stroke-width: 2;
}

.grid-line {
    stroke: #e2e8f0;
    stroke-width: 1;
}

.bar-shape {
    fill: #2563eb;
}

.line-shape {
    fill: none;
    stroke: #2563eb;
    stroke-width: 4;
}

.line-dot {
    fill: #ffffff;
    stroke: #2563eb;
    stroke-width: 3;
}

.area-shape {
    fill: rgba(37, 99, 235, 0.18);
    stroke: none;
}

.pie-chart {
    width: min(330px, 70vw);
    aspect-ratio: 1;
    border-radius: 50%;
    border: 1px solid #cbd5e1;
}

.chart-legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px 14px;
    max-width: 900px;
    margin-top: 16px;
}

.chart-legend span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #334155;
    font-size: 0.86rem;
}

.chart-legend i {
    width: 12px;
    height: 12px;
    display: inline-block;
}

.client-print-paper h1 {
    margin: 0 0 8px;
    color: #1e3a8a;
    font-size: 24px;
}

.client-print-paper h2 {
    margin: 0 0 18px;
    font-size: 16px;
}

.client-print-paper h3 {
    margin: 18px 0 6px;
    font-size: 14px;
}

.print-two-columns {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 190px;
    gap: 18px;
    border: 1px solid #cbd5e1;
    padding: 10px;
}

.print-two-columns p {
    margin: 0 0 5px;
}

.print-photo {
    display: grid;
    place-items: center;
    min-height: 150px;
    border-left: 1px solid #cbd5e1;
    color: #64748b;
}

.print-photo img {
    max-width: 160px;
    max-height: 160px;
    object-fit: contain;
}

.print-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 8px;
}

.print-table th,
.print-table td,
.print-box {
    border: 1px solid #cbd5e1;
    padding: 5px 7px;
    text-align: left;
    vertical-align: top;
}

.print-table th {
    width: 23%;
    background: #f8fafc;
}

.print-box {
    min-height: 70px;
    white-space: pre-wrap;
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
    margin: 0;
    font-family: "Segoe UI", Arial, sans-serif;
    color: var(--fg-text);
    background: #eef2f6;
}

a {
    color: var(--fg-blue);
}

.form-control {
    min-height: 42px;
    border-color: #b9c7d6;
    border-radius: 4px;
}

.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus,
button:focus-visible,
a:focus-visible {
    outline: 2px solid #79b7e8;
    outline-offset: 2px;
    box-shadow: none;
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: #b32121;
    padding: 1rem;
    color: white;
}

.blazor-error-boundary::after {
    content: "Se ha producido un error.";
}

.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 20px;
    background: #eef2f6;
}

.login-shell {
    width: min(920px, 100%);
    min-height: 540px;
    display: grid;
    grid-template-columns: 500px minmax(0, 420px);
    background: #ffffff;
    border: 1px solid var(--fg-border);
    border-radius: 8px !important;
    overflow: hidden;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.18);
}

.login-hero {
    min-height: 540px;
    background: #08264c;
}

.login-hero img {
    width: 100%;
    height: 100%;
    min-height: 540px;
    display: block;
    object-fit: fill;
}

.login-access-panel {
    min-height: 540px;
    display: flex;
    flex-direction: column;
    padding: 46px 64px 16px 40px;
}

.login-identity {
    margin-bottom: 22px;
}

.login-identity h1 {
    margin: 0;
    color: #0f172a;
    font-size: 1.7rem;
    line-height: 1.15;
    font-weight: 800;
}

.login-identity p {
    margin: 10px 0 0;
    color: var(--fg-muted);
    font-size: 0.88rem;
}

.login-form {
    display: grid;
    gap: 8px;
}

.login-form label {
    display: grid;
    gap: 6px;
    color: #334155;
    font-size: 0.88rem;
    font-weight: 700;
}

.login-form .form-control {
    width: 100%;
    min-height: 28px;
    height: 28px;
    padding: 2px 10px;
    font-size: 1rem;
}

.btn-login {
    min-height: 38px;
    border: 0;
    border-radius: 4px;
    background: #059669;
    color: #ffffff;
    font-weight: 700;
}

.btn-secondary-login,
.btn-cancel-login {
    min-height: 38px;
    border: 1px solid #aab6c4;
    border-radius: 4px;
    background: #64748b;
    color: #ffffff;
    font-weight: 700;
}

.btn-secondary-login {
    justify-self: end;
    width: 74px;
    margin-top: -8px;
}

.login-password-wrap {
    position: relative;
    display: block;
}

.login-password-wrap .form-control {
    padding-right: 42px;
}

.login-password-eye {
    position: absolute;
    top: 1px;
    right: 1px;
    width: 38px;
    height: calc(100% - 2px);
    display: grid;
    place-items: center;
    border: 0;
    border-left: 1px solid #b9c7d6;
    border-radius: 0 3px 3px 0;
    background: #eef2f7;
    color: #1f3d57;
    cursor: pointer;
}

.login-password-eye:hover,
.login-password-eye:focus-visible {
    background: #dbe8f5;
}

.login-password-eye svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.login-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 24px;
}

.login-recover-link {
    justify-self: center;
    margin-top: 6px;
    border: 0;
    background: transparent;
    color: #005fb8;
    font-size: .88rem;
    font-weight: 700;
    text-decoration: underline;
    cursor: pointer;
}

.login-recover-link:disabled {
    color: #94a3b8;
    cursor: default;
}

.remember-row,
.agreement-row {
    display: flex !important;
    grid-template-columns: none !important;
    align-items: center;
    gap: 8px !important;
    color: #334155;
    font-weight: 400 !important;
}

.remember-row {
    margin-top: -6px;
}

.remember-row input,
.agreement-row input {
    width: 16px;
    height: 16px;
}

.agreement-row a {
    color: #0000ee;
    font-weight: 400;
    text-decoration: none;
}

.agreement-row a:hover,
.agreement-row a:focus-visible {
    text-decoration: underline;
}

.login-version {
    margin-top: auto;
    color: #475569;
    font-size: 0.78rem;
    text-align: center;
}

.login-alert,
.login-info {
    margin-bottom: 12px;
    padding: 9px 11px;
    border-radius: 4px;
    font-size: 0.88rem;
}

.login-alert {
    border: 1px solid #fecaca;
    background: #fff1f2;
    color: #991b1b;
}

.login-info {
    border: 1px solid #bfdbfe;
    background: #eff6ff;
    color: #1e3a8a;
}

.login-recovery-backdrop {
    z-index: 1700;
}

.login-recovery-dialog {
    width: min(440px, calc(100vw - 32px));
}

.login-recovery-body {
    display: grid;
    gap: 14px;
    padding: 18px;
}

.login-recovery-body label,
.password-recovery-form label {
    display: grid;
    gap: 6px;
    color: #334155;
    font-weight: 800;
}

.login-recovery-body p {
    margin: 0;
    color: #475569;
    font-size: .9rem;
}

.password-recovery-card {
    width: min(460px, 100%);
    padding: 34px 40px;
    border: 1px solid var(--fg-border);
    border-radius: 8px !important;
    background: #ffffff;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.18);
}

.password-recovery-card h1 {
    margin: 0;
    color: #0f172a;
    font-size: 1.55rem;
}

.password-recovery-card p {
    margin: 8px 0 20px;
    color: #617086;
}

.password-recovery-form {
    display: grid;
    gap: 14px;
}

.password-recovery-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-top: 8px;
}

.help-tutor-page {
    min-height: 100vh;
    padding: 28px;
    background: #f1f5f9;
}

.help-tutor-panel {
    max-width: 1180px;
    min-height: 520px;
    margin: 0 auto;
    padding: 34px 42px;
    background: #ffffff;
    box-shadow: 0 8px 28px rgba(15, 23, 42, 0.12);
}

.help-tutor-panel.editing {
    max-width: none;
    min-height: calc(100vh - 56px);
    padding: 18px 22px;
}

.help-tutor-devbar {
    display: flex;
    justify-content: flex-end;
    min-height: 33px;
    margin: -12px 0 12px;
}

.help-tutor-toolbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid #cbd5e1;
}

.developer-help-button {
    min-width: 132px;
}

.help-tutor-kicker {
    margin: 0 0 8px;
    color: #0b559b;
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
}

.help-tutor-panel h1 {
    margin: 0;
    color: #0f172a;
    font-size: 28px;
}

.help-tutor-content {
    margin-top: 22px;
    color: #334155;
    font-size: 16px;
    line-height: 1.6;
}

.help-tutor-content.preview {
    min-height: 220px;
    margin-top: 10px;
    padding: 18px 22px;
    border: 1px solid #cbd5e1;
    background: #fff;
}

.help-tutor-editor-grid {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) minmax(360px, 1.3fr);
    gap: 14px 18px;
    margin-top: 16px;
}

.help-tutor-editor-grid label {
    display: grid;
    gap: 6px;
    color: #07162d;
    font-weight: 800;
}

.help-tutor-editor-grid input,
.help-tutor-editor-grid textarea {
    width: 100%;
    border: 1px solid #9fb1c5;
    background: #fff;
    color: #07162d;
    padding: 8px 10px;
    font: inherit;
    font-weight: 500;
}

.help-tutor-video-editor {
    min-height: 62px;
    resize: vertical;
}

.help-tutor-html-editor {
    grid-column: 1 / -1;
}

.help-tutor-html-editor textarea {
    min-height: 270px;
    font-family: Consolas, "Courier New", monospace;
    resize: vertical;
}

.help-tutor-preview-title {
    margin-top: 16px;
    color: #0f172a;
    font-weight: 900;
}

.help-tutor-status {
    margin: 14px 0 0;
    color: #0f766e;
    font-weight: 800;
}

.help-tutor-content h1,
.help-tutor-content h2,
.help-tutor-content h3 {
    color: #0f172a;
}

.help-tutor-content a {
    color: #2563eb;
    font-weight: 600;
    text-decoration: none;
}

.help-tutor-content a:hover {
    text-decoration: underline;
}

.help-tutor-video {
    margin-top: 28px;
}

.help-tutor-video iframe {
    width: 100%;
    max-width: 760px;
    aspect-ratio: 16 / 9;
    height: auto;
    border: 0;
}

.help-tutor-loading {
    color: #64748b;
    font-size: 0.95rem;
}

.submenu .nav-link.child {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    flex-wrap: nowrap !important;
    gap: 12px;
    white-space: nowrap;
}

.submenu .nav-link.child img {
    width: 18px;
    height: 18px;
    display: block;
    flex: 0 0 18px;
    object-fit: contain;
}

.submenu .nav-link.child span {
    display: inline-block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dashboard-grid {
    min-height: calc(100vh - 92px);
    padding: 8px 10px 10px;
    background: #eaf0f6;
    background-position: center center;
    background-repeat: no-repeat;
    background-size: cover;
}

.dashboard-with-background {
    background-attachment: local;
}

.dashboard-main {
    position: relative;
    display: grid;
    grid-template-rows: 32px minmax(0, 1fr) auto;
    align-content: stretch;
    gap: 0;
    overflow: hidden;
}

.dashboard-main::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(rgba(231, 242, 250, .08), rgba(231, 242, 250, .08));
    pointer-events: none;
}

.dashboard-brand-logo {
    justify-self: end;
    width: clamp(173px, 16vw, 280px);
    max-height: 150px;
    height: auto;
    object-fit: contain;
    pointer-events: none;
}

.welcome-panel {
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 10px 22px;
}

.welcome-panel h2,
.module-placeholder h2 {
    margin: 0 0 3px;
    font-size: 1.34rem;
}

.welcome-panel p,
.module-placeholder p {
    margin: 0;
    color: var(--fg-muted);
}

.welcome-panel small {
    display: block;
    margin-top: 5px;
    color: #50637c;
    font-size: .86rem;
}

.module-kicker {
    color: #1d5f94;
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
}

.internal-management-panel {
    min-height: 420px;
}

.internal-management-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(240px, 360px));
    gap: 14px;
    padding: 20px;
}

.internal-management-groups {
    display: grid;
    gap: 22px;
    padding: 18px 20px 24px;
}

.internal-management-group {
    border: 1px solid #b8cbe3;
    border-radius: 6px;
    background: #ffffff;
}

.internal-management-group h2 {
    margin: 0;
    padding: 12px 16px;
    border-bottom: 1px solid #d8e4f1;
    background: #edf5ff;
    color: #07356d;
    font-size: 1.05rem;
    font-weight: 800;
}

.internal-management-group .internal-management-actions {
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    padding: 14px;
}

.internal-management-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 86px;
    padding: 14px 16px;
    color: #0f172a;
    text-decoration: none;
    background: #f8fbff;
    border: 1px solid #b8cbe3;
    border-radius: 6px;
}

.internal-management-card strong {
    font-size: 1rem;
}

.internal-management-card span,
.internal-module-note p {
    color: #475569;
}

.internal-management-card:hover,
.internal-management-card:focus-visible {
    border-color: #2f78b7;
    background: #eef6ff;
}

.internal-module-note {
    margin: 20px;
    padding: 16px;
    background: #f8fbff;
    border: 1px solid #b8cbe3;
    border-radius: 6px;
}

.internal-access-denied {
    border-left: 4px solid #dc2626;
}

.desktop-shortcut-toolbar {
    position: relative;
    z-index: 1;
    grid-row: 1;
    grid-column: 1;
    align-self: start;
    justify-self: start;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    width: auto;
    max-width: calc(100% - 18px);
    min-height: 34px;
    padding: 3px 8px;
    overflow: hidden;
    background: rgba(255, 255, 255, .94);
    border: 1px solid var(--fg-border);
    border-radius: 4px;
}

.desktop-shortcut {
    flex: 0 0 31px;
    width: 31px;
    height: 31px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    border-radius: 2px;
    text-decoration: none;
}

.desktop-shortcut.has-separator {
    margin-left: 8px;
    position: relative;
}

.desktop-shortcut.has-separator::before {
    content: "";
    position: absolute;
    left: -7px;
    top: 4px;
    bottom: 4px;
    width: 1px;
    background: #b9c4d2;
}

.desktop-shortcut:hover,
.desktop-shortcut:focus-visible {
    background: #dfefff;
    border-color: #83add7;
    outline: none;
}

.desktop-shortcut img {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.dashboard-gym-access {
    position: relative;
    z-index: 1;
    grid-row: 2;
    grid-column: 1;
    align-self: start;
    justify-self: start;
    display: grid;
    gap: 16px;
    width: 210px;
    margin: 30px 0 0 18px;
}

.dashboard-gym-access-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 190px;
    min-height: 142px;
    min-width: 0;
    border-radius: 8px !important;
    text-decoration: none;
    transition: transform .12s ease, filter .12s ease;
}

.dashboard-gym-access-link:hover,
.dashboard-gym-access-link:focus-visible {
    transform: translateY(-1px);
    filter: drop-shadow(0 5px 10px rgba(15, 23, 42, .20));
    outline: none;
}

.dashboard-gym-access-link img {
    display: block;
    width: 176px;
    height: 138px;
    object-fit: contain;
}

.dashboard-gym-access-mostrador img {
    width: 150px;
}

.dashboard-gym-access-entrenamientos img {
    width: 150px;
}

.quick-actions {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.quick-actions a,
.status-board article,
.module-placeholder {
    background: #ffffff;
    border: 1px solid var(--fg-border);
    border-radius: 8px !important;
}

.quick-actions a {
    min-height: 72px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    color: #142033;
    text-decoration: none;
    font-weight: 700;
}

.quick-actions img {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.dashboard-bottom-panel {
    position: absolute;
    right: 26px;
    bottom: 18px;
    z-index: 2;
    display: inline-grid;
    align-items: center;
    justify-items: center;
    width: auto;
    min-height: 0;
    margin: 0;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    pointer-events: none;
}

.status-board {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 8px;
    min-width: 0;
}

.status-board article {
    min-height: 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 3px 10px;
    background: rgba(255, 255, 255, .93);
    white-space: nowrap;
}

.status-board span,
.status-board small {
    color: var(--fg-muted);
    overflow: hidden;
    text-overflow: ellipsis;
}

.status-board strong {
    flex: 0 0 auto;
    font-size: 1.12rem;
    line-height: 1.1;
}

.module-placeholder {
    padding: 22px;
}

.module-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 18px;
}

.app-btn {
    min-height: 31px;
    padding: 0 18px;
    border: 1px solid transparent;
    border-radius: 4px;
    color: #fff;
    font-family: inherit;
    font-size: 0.86rem;
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
}

.app-btn:hover,
.app-btn:focus-visible {
    filter: brightness(0.94);
}

.app-btn:disabled {
    opacity: 0.55;
    cursor: default;
    filter: none;
}

.app-btn-new {
    border-color: #4b9fd4;
    background: #66bde9;
    color: #05243b;
}

.app-btn-search {
    border-color: #e09a00;
    background: linear-gradient(180deg, #ffe66d 0%, #ffb11f 100%);
    color: #8a1717;
}

.app-btn.app-btn-yellow {
    border-color: #c39a00;
    background: linear-gradient(180deg, #ffe86a 0%, #facc15 100%);
    color: #301400;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.55);
}

.app-btn.app-btn-yellow:hover:not(:disabled) {
    background: linear-gradient(180deg, #fff08f 0%, #eab308 100%);
    color: #111827;
}

.app-btn-close {
    border-color: #b91c1c;
    background: #e51f27;
}

.app-btn-delete {
    border-color: #991b1b;
    background: #dc2626;
    color: #fff;
}

.app-btn-save,
.app-btn-stat {
    border-color: #159947;
    background: #22c55e;
}

.app-btn.app-btn-green {
    border-color: #159947;
    background: #22c55e;
    color: #fff;
}

.app-btn-list {
    border-color: #c65f00;
    background: #f28c28;
}

.app-btn-info {
    border-color: #1d4ed8;
    background: #2563eb;
    color: #fff;
}

.app-btn-documents {
    border-color: #9f1239;
    background: #c9121d;
    color: #fff;
}

.app-btn-acrobat {
    border-color: #8d1115;
    background: #c4121a;
}

.grid-excel-export-button {
    width: 31px;
    min-width: 31px;
    height: 31px;
    padding: 0;
    border: 1px solid #107c41;
    border-radius: 4px;
    background: #107c41;
    color: #fff;
    font-family: Arial, sans-serif;
    font-size: 17px;
    font-weight: 900;
    line-height: 1;
    cursor: pointer;
}

.grid-excel-export-button:hover,
.grid-excel-export-button:focus-visible {
    background: #0b6332;
    outline: 2px solid rgba(16, 124, 65, 0.24);
    outline-offset: 1px;
}

.grid-excel-export-button:disabled {
    opacity: .58;
    cursor: wait;
}

.msgbox-backdrop {
    position: fixed;
    inset: 0;
    z-index: 2147483200 !important;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(15, 23, 42, 0.22);
}

.msgbox {
    width: min(420px, 100%);
    border: 1px solid #8fa0b4;
    border-radius: 4px;
    background: #f8fafc;
    color: #0f172a;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.24);
    font-family: "Segoe UI", Arial, sans-serif;
}

.msgbox-header {
    min-height: 48px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid #d4dce7;
    background: #edf3f9;
}

.msgbox-header h2 {
    margin: 0;
    font-size: 1rem;
    font-weight: 800;
}

.msgbox-icon {
    width: 26px;
    height: 26px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #2f78bd;
    color: #fff;
    font-size: 0.92rem;
    font-weight: 900;
}

.msgbox-success .msgbox-icon {
    background: #22a957;
}

.msgbox-warning .msgbox-icon {
    background: #f59e0b;
}

.msgbox-error .msgbox-icon {
    background: #e51f27;
}

.msgbox-body {
    min-height: 74px;
    padding: 18px 18px 12px;
    font-size: 0.95rem;
    line-height: 1.45;
    white-space: pre-wrap;
}

.msgbox-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 12px 16px 16px;
}

@media (max-width: 900px) {
    .login-shell {
        grid-template-columns: 1fr;
        width: min(420px, 100%);
    }

    .login-hero {
        min-height: 220px;
        max-height: 240px;
    }

    .login-hero img {
        min-height: 220px;
        max-height: 240px;
    }

    .login-access-panel {
        min-height: auto;
        padding: 28px 30px 18px;
    }

    .dashboard-grid {
        min-height: calc(100vh - 88px);
    }

    .desktop-shortcut-toolbar {
        max-width: calc(100% - 12px);
    }

    .dashboard-bottom-panel {
        right: 16px;
        bottom: 12px;
        min-height: 0;
        margin: 0;
        padding: 0;
    }

    .dashboard-brand-logo {
        width: 187px;
        max-height: 126px;
    }

    .quick-actions,
    .dashboard-bottom-panel .status-board {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .client-header-actions {
        flex-wrap: wrap;
    }
}

@media (max-width: 560px) {
    .login-page {
        padding: 14px;
    }

    .welcome-panel,
    .module-placeholder {
        padding: 16px;
    }

    .login-access-panel {
        padding: 22px 22px 16px;
    }

    .welcome-panel {
        align-items: flex-start;
    }

    .welcome-panel img {
        width: 48px;
        height: 48px;
    }

    .dashboard-bottom-panel {
        right: 10px;
        bottom: 10px;
        min-height: 0;
        margin: 0;
        padding: 0;
    }

    .quick-actions {
        grid-template-columns: 1fr;
    }

    .dashboard-bottom-panel .status-board {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-brand-logo {
        width: 140px;
        max-height: 104px;
    }
}

.config-window {
    min-height: calc(100vh - 124px);
    margin: -20px -24px -28px;
    background: #f4f7fb;
    border-top: 1px solid #87909b;
    color: #000;
    font-family: "Segoe UI", Arial, sans-serif;
}

.config-titlebar {
    min-height: 86px;
    display: grid;
    grid-template-columns: minmax(320px, 1fr) auto minmax(190px, 1fr);
    align-items: start;
    gap: 14px;
    padding: 18px 10px 12px 22px;
    background: #f7f9fc;
}

.config-titlebar h2 {
    margin: 0;
    font-size: 1.45rem;
    font-weight: 800;
}

.config-main-actions {
    display: flex;
    gap: 14px;
    justify-content: center;
}

.config-close-actions {
    display: flex;
    gap: 6px;
    justify-content: flex-end;
}

.win-btn {
    min-height: 31px;
    padding: 0 22px;
    border: 0;
    border-radius: 5px;
    color: #fff;
    font-size: 0.78rem;
    font-weight: 800;
}

.win-btn.save {
    background: #22c55e;
}

.win-btn.teal {
    background: #0f766e;
}

.win-btn.close {
    background: #e51f27;
}

.win-btn.help {
    width: 33px;
    padding: 0;
    border-radius: 0;
    background: #2459dc;
    font-size: 1rem;
}

.win-btn.app-btn {
    border-width: 1px;
}

.config-message {
    margin: -5px 20px 8px;
    padding: 8px 12px;
    border: 1px solid #b8d7b8;
    background: #eefbea;
    color: #22662c;
    font-weight: 700;
}

.win-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    padding: 4px 4px 0;
    background: #e6e6e6;
    border-top: 1px solid #d2d2d2;
    border-bottom: 1px solid #aeb4bd;
}

.win-tabs button {
    min-height: 34px;
    padding: 0 12px;
    border: 1px solid #aeb7c2;
    border-bottom-color: #8f98a3;
    border-radius: 5px 5px 0 0;
    background: linear-gradient(#f6f8fb, #dfe6ee);
    color: #001228;
    font-size: 0.84rem;
}

.win-tabs button.active {
    border-color: #0d7776;
    background: #0d7776;
    color: #fff;
    font-weight: 800;
}

.config-body {
    min-height: 545px;
    padding: 28px 30px;
    background: #f4f7fb;
    border-left: 1px solid #cbd2da;
    border-right: 1px solid #9fa7b0;
}

.config-form {
    display: grid;
    align-content: start;
    gap: 10px 24px;
}

.config-form.single-column {
    max-width: 760px;
}

.config-form.two-column {
    max-width: 900px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.config-form.textareas {
    max-width: 980px;
    grid-template-columns: minmax(0, 980px);
}

.config-form.image-column {
    max-width: 780px;
}

.win-field {
    min-height: 25px;
    display: grid;
    grid-template-columns: 180px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    font-size: 0.86rem;
}

.win-field span,
.win-image-field > span {
    white-space: nowrap;
}

.win-field input,
.win-field select,
.win-field textarea {
    min-height: 25px;
    border: 1px solid #b7b7b7;
    background: #fff;
    color: #000;
    font: inherit;
    border-radius: 0;
}

.win-field textarea {
    width: 100%;
    min-height: 170px;
    resize: vertical;
}

.win-field.area {
    align-items: start;
    grid-template-columns: 1fr;
    gap: 7px;
}

.win-check {
    min-height: 28px;
    display: grid;
    grid-template-columns: 180px 16px minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    font-size: 0.86rem;
}

.win-check input {
    width: 14px;
    height: 14px;
}

.win-check strong {
    font-weight: 400;
}

.win-image-field {
    display: grid;
    grid-template-columns: 180px 360px;
    align-items: start;
    gap: 12px;
    font-size: 0.86rem;
}

.image-placeholder {
    height: 160px;
    display: grid;
    align-content: center;
    justify-items: center;
    gap: 10px;
    border: 1px solid #b7b7b7;
    background: #fff;
    padding: 10px;
}

.image-placeholder img {
    max-width: 100%;
    max-height: 105px;
    object-fit: contain;
}

.image-placeholder input[type="file"] {
    width: 100%;
    font-size: 0.82rem;
}

.fiscal-api h3 {
    margin: 0 0 8px 180px;
    color: #0f514c;
    font-size: 1.05rem;
}

@media (max-width: 960px) {
    .config-window {
        margin: -16px;
    }

    .config-titlebar {
        grid-template-columns: 1fr;
    }

    .config-main-actions,
    .config-close-actions {
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .config-form.two-column,
    .config-form.textareas {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 620px) {
    .config-body {
        padding: 18px 12px;
    }

    .win-field,
    .win-check,
    .win-image-field {
        grid-template-columns: 1fr;
    }

    .fiscal-api h3 {
        margin-left: 0;
    }

    .win-field input,
    .win-field select {
        width: 100% !important;
    }
}

.desktop-list-window,
.desktop-card {
    height: calc(100vh - 104px);
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #b7c1ce;
    background: #f5f5f5;
    color: #111827;
}

.desktop-list-header,
.desktop-card-header {
    flex: 0 0 auto;
    min-height: 75px;
    display: grid;
    grid-template-columns: minmax(240px, 1fr) auto;
    gap: 12px 20px;
    align-items: center;
    padding: 16px 20px;
    background: #f5f8fc;
    border-bottom: 1px solid #d2d8e1;
}

.desktop-list-header h2,
.desktop-card-header h2 {
    margin: 0;
    font-size: 1.45rem;
    font-weight: 700;
}

.title-with-icon {
    display: flex;
    align-items: center;
    gap: 18px;
}

.title-with-icon img {
    width: 42px;
    height: 42px;
    object-fit: contain;
}

.panel-title-row .title-with-icon p {
    display: none;
}

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

.desktop-card-header:has(> .aux-button-host) {
    min-height: 96px;
    grid-template-columns: minmax(190px, 240px) minmax(0, 1fr);
    grid-template-rows: auto auto;
    align-items: end;
    gap: 4px 12px;
    padding: 8px 20px 10px;
}

.desktop-card-header:has(> .aux-button-host) > .title-with-icon {
    grid-column: 1;
    grid-row: 1;
    align-self: end;
    gap: 12px;
    padding-bottom: 6px;
    border-bottom: 1px solid #0b1528;
}

.desktop-card-header:has(> .aux-button-host) > .title-with-icon img {
    width: 44px;
    height: 44px;
}

.desktop-card-header:has(> .aux-button-host) > .title-with-icon h2 {
    font-size: 1.4rem;
    font-weight: 900;
    text-transform: none;
}

.desktop-card-header:has(> .aux-button-host) > .aux-button-host {
    grid-column: 1;
    grid-row: 2;
    align-self: start;
    margin: 0;
}

.desktop-card-header:has(> .aux-button-host) > .desktop-list-actions,
.desktop-card-header:has(> .aux-button-host) > .toolbar {
    grid-column: 2;
    grid-row: 2;
    align-self: start;
    justify-content: flex-end;
    flex-wrap: nowrap;
    gap: 7px;
    overflow-x: auto;
    min-width: 0;
    padding-bottom: 2px;
}

.desktop-card-header:has(> .aux-button-host) > .desktop-list-actions .app-btn,
.desktop-card-header:has(> .aux-button-host) > .toolbar .app-btn {
    min-height: 30px;
    padding: 5px 12px;
    white-space: nowrap;
}

.desktop-card-header:has(> .aux-button-host) > .desktop-list-actions .app-btn-help,
.desktop-card-header:has(> .aux-button-host) > .toolbar .app-btn-help {
    min-width: 42px;
    width: 42px;
    padding-inline: 0;
}

.panel-title-row:has(> .aux-button-host) {
    display: grid;
    grid-template-columns: minmax(190px, 240px) minmax(0, 1fr);
    grid-template-rows: auto auto;
    align-items: end;
    gap: 4px 12px;
    min-height: 96px;
    padding: 8px 20px 10px;
}

.panel-title-row:has(> .aux-button-host) > .title-with-icon,
.panel-title-row:has(> .aux-button-host) > .oferta-title-left {
    grid-column: 1;
    grid-row: 1;
    align-self: end;
    padding-bottom: 6px;
    border-bottom: 1px solid #0b1528;
}

.panel-title-row:has(> .aux-button-host) > .aux-button-host {
    grid-column: 1;
    grid-row: 2;
    align-self: start;
    margin: 0;
}

.panel-title-row:has(> .aux-button-host) > .toolbar,
.panel-title-row:has(> .aux-button-host) > .desktop-list-actions {
    grid-column: 2;
    grid-row: 2;
    justify-content: flex-end;
    flex-wrap: nowrap;
    min-width: 0;
    overflow-x: auto;
    padding-bottom: 2px;
}

.screen-actions-with-terminal {
    display: grid;
    grid-template-columns: minmax(0, 1fr) max-content;
    align-items: start;
    gap: 8px 12px;
    width: 100%;
}

.screen-command-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px 9px;
    min-width: 0;
}

.screen-terminal-actions {
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    gap: 8px;
    white-space: nowrap;
}

.screen-terminal-actions .app-btn-help {
    min-width: 38px;
    width: 38px;
    padding-inline: 0;
}

.desktop-list-actions button:not(.app-btn) {
    min-width: 90px;
    min-height: 30px;
    border: 1px solid #9aa7b8;
    border-radius: 3px;
    background: #eef2f7;
    color: #111827;
    font-weight: 700;
}

.desktop-list-actions button:not(.app-btn):hover {
    background: #dbe8f5;
}

.desktop-list-actions button:disabled {
    opacity: 0.55;
}

.desktop-search {
    display: flex;
    align-items: center;
    gap: 10px;
    grid-column: 1 / -1;
}

.desktop-search input {
    width: min(360px, 100%);
    min-height: 24px;
    border: 1px solid #aeb7c2;
    background: #fff;
}

.avisos-clientes-search {
    gap: 10px 16px;
    flex-wrap: nowrap;
}

.avisos-clientes-search > label:first-child {
    margin: 0;
    white-space: nowrap;
}

.avisos-clientes-search > input {
    width: 360px;
    max-width: 360px;
}

.avisos-en-vigor-check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 28px;
    margin: 0 0 0 12px;
    white-space: nowrap;
}

.avisos-en-vigor-check input[type="checkbox"] {
    flex: 0 0 auto;
    width: 20px;
    height: 20px;
    margin: 0;
}

.avisos-en-vigor-check span {
    white-space: nowrap;
}

.client-list-actions {
    justify-content: flex-end;
    gap: 8px;
}

.client-list-actions .app-btn {
    min-height: 31px;
    padding: 0 14px;
    white-space: nowrap;
}

.client-grid-config-button {
    border-color: #475569;
    background: #64748b;
}

.client-search select {
    min-height: 26px;
    border: 1px solid #aeb7c2;
    background: #fff;
}

.app-dialog-backdrop {
    position: fixed;
    inset: 0;
    z-index: 900;
    display: grid;
    place-items: center;
    padding: 22px;
    background: rgba(15, 23, 42, .38);
}

.app-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1500;
    display: grid;
    place-items: center;
    padding: 22px;
    background: rgba(15, 23, 42, .38);
}

.app-modal {
    width: min(920px, 100%);
    max-height: calc(100vh - 44px);
    overflow: auto;
    border: 1px solid #9fb0c4;
    border-radius: 4px;
    background: #f8fafc;
    box-shadow: 0 24px 70px rgba(15, 23, 42, .28);
}

.app-modal > header {
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 10px 14px;
    border-bottom: 1px solid #cbd5e1;
    background: #edf3f9;
}

.app-modal > header h3 {
    margin: 0;
    color: #07162d;
    font-size: 1.05rem;
    font-weight: 900;
}

.app-modal > footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 12px 16px;
    border-top: 1px solid #cbd5e1;
    background: #f8fafc;
}

.modal-close {
    min-width: 32px;
    height: 28px;
    border: 1px solid #be123c;
    border-radius: 4px;
    background: #e11d2e;
    color: #fff;
    font-weight: 900;
    cursor: pointer;
}

.app-dialog {
    width: min(720px, 100%);
    border: 1px solid #9fb0c4;
    border-radius: 4px;
    background: #f8fafc;
    box-shadow: 0 24px 70px rgba(15, 23, 42, .28);
}

.app-dialog-header {
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 10px 14px;
    border-bottom: 1px solid #cbd5e1;
    background: #edf3f9;
}

.app-dialog-header h3 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 800;
}

.dialog-close-button {
    width: 31px;
    height: 28px;
    border: 1px solid #b91c1c;
    border-radius: 3px;
    background: #e51f27;
    color: #fff;
    font-weight: 800;
}

.factura-aviso-dialog {
    width: min(760px, calc(100vw - 42px));
}

.factura-aviso-body {
    display: grid;
    gap: 14px;
    padding: 18px 22px;
}

.factura-aviso-body label {
    display: grid;
    gap: 7px;
    color: #14213d;
    font-weight: 800;
}

.factura-aviso-body textarea {
    min-height: 240px;
    width: 100%;
    border: 1px solid #9fb1c5;
    background: #fff;
    color: #07162d;
    padding: 10px;
    font: inherit;
    font-weight: 500;
    resize: vertical;
}

.factura-aviso-body input {
    width: 100%;
    border: 1px solid #9fb1c5;
    background: #fff;
    color: #14213d;
    padding: 8px 10px;
    font: inherit;
    font-weight: 600;
}

.factura-aviso-active {
    display: inline-flex !important;
    align-items: center;
    gap: 8px !important;
}

.factura-aviso-active input {
    width: 18px;
    height: 18px;
}

.client-filter-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 18px;
    padding: 18px;
}

.client-warning-filter {
    margin-left: 8px;
    color: #0f315e;
    font-weight: 400;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex: 0 0 190px;
    min-width: 190px;
    width: 190px;
    line-height: 1;
}

.client-warning-filter.payments {
    flex-basis: 195px;
    min-width: 195px;
    width: 195px;
}

.client-search .client-warning-filter input {
    width: 18px;
    min-height: 18px;
    flex: 0 0 auto;
}

.client-search .client-warning-filter span {
    display: inline-block;
    white-space: nowrap;
    font-weight: 400;
}

.client-filter-grid label {
    display: grid;
    grid-template-columns: 95px minmax(0, 1fr);
    align-items: center;
    gap: 8px;
}

.client-filter-grid input {
    min-height: 28px;
    border: 1px solid #aeb7c2;
    background: #fff;
}

.desktop-filter-dialog {
    position: relative;
    width: min(880px, calc(100vw - 32px));
    min-height: 340px;
    padding: 20px 34px 24px;
    border: 1px solid #9ca3af;
    border-radius: 8px !important;
    background: #fff;
}

.desktop-filter-dialog h3 {
    margin: 2px 0 26px;
    color: #0f172a;
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: 0;
}

.desktop-filter-window-close {
    position: absolute;
    top: 8px;
    right: 10px;
    width: 22px;
    height: 22px;
    border: 0;
    background: transparent;
    color: #111827;
    font-size: 20px;
    line-height: 20px;
}

.desktop-filter-help {
    display: none;
}

.desktop-filter-grid {
    display: grid;
    grid-template-columns: minmax(220px, 280px) minmax(190px, 230px) 150px 150px;
    gap: 16px 18px;
    align-items: center;
}

.desktop-filter-heading {
    color: #0f172a;
    font-size: .78rem;
    font-weight: 800;
}

.desktop-filter-grid select,
.desktop-filter-grid input {
    width: 100%;
    height: 28px;
    min-height: 28px;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    background: #fff;
    font-size: .82rem;
    padding: 2px 7px;
}

.desktop-filter-grid input:disabled,
.desktop-filter-grid select:disabled {
    background: #f1f1f1;
    color: #64748b;
}

.desktop-filter-actions {
    display: flex;
    justify-content: flex-end;
    gap: 16px;
    margin-top: 38px;
}

.desktop-filter-apply,
.desktop-filter-cancel {
    min-width: 110px;
    height: 34px;
    border: 0;
    color: #fff;
    font-weight: 700;
}

.desktop-filter-apply {
    background: #6366f1;
}

.desktop-filter-cancel {
    background: #e51f27;
}

.client-pager {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 8px 10px;
    border-top: 1px solid #cbd5e1;
    background: #f8fafc;
    color: #0f172a;
    font-size: .86rem;
}

.client-pager span {
    margin-left: 18px;
}

.client-pager-controls {
    display: flex;
    align-items: center;
    gap: 7px;
}

.client-pager-controls .app-btn {
    min-height: 26px;
    padding: 4px 10px;
    border: 1px solid transparent;
    color: #fff;
}

.client-pager-controls .app-btn:nth-of-type(1) {
    background: #2563eb;
    border-color: #1d4ed8;
}

.client-pager-controls .app-btn:nth-of-type(2) {
    background: #0891b2;
    border-color: #0e7490;
}

.client-pager-controls .app-btn:nth-of-type(3) {
    background: #16a34a;
    border-color: #15803d;
}

.client-pager-controls .app-btn:nth-of-type(4) {
    background: #f97316;
    border-color: #ea580c;
}

.client-pager-controls .app-btn:disabled {
    opacity: 1;
}

.client-pager-controls .app-btn:nth-of-type(1):disabled {
    background: #dbeafe;
    border-color: #93c5fd;
    color: #1d4ed8;
}

.client-pager-controls .app-btn:nth-of-type(2):disabled {
    background: #cffafe;
    border-color: #67e8f9;
    color: #0e7490;
}

.client-pager-controls .app-btn:nth-of-type(3):disabled {
    background: #dcfce7;
    border-color: #86efac;
    color: #15803d;
}

.client-pager-controls .app-btn:nth-of-type(4):disabled {
    background: #ffedd5;
    border-color: #fdba74;
    color: #c2410c;
}

.client-pager-controls select:disabled {
    opacity: .55;
}

.client-pager-controls select {
    height: 26px;
    border: 1px solid #9fb0c4;
    background: #fff;
}

.app-busy-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: grid;
    place-items: center;
    background: rgba(15, 23, 42, .35);
}

.app-busy-dialog {
    width: min(360px, calc(100vw - 32px));
    padding: 24px 26px;
    border: 1px solid #9fb0c4;
    border-radius: 4px;
    background: #fff;
    box-shadow: 0 24px 70px rgba(15, 23, 42, .28);
    text-align: center;
}

.app-busy-spinner {
    width: 38px;
    height: 38px;
    margin: 0 auto 14px;
    border: 4px solid #dbeafe;
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: app-busy-spin .8s linear infinite;
}

.app-busy-dialog h3 {
    margin: 0 0 8px;
    color: #0f172a;
    font-size: 1.05rem;
    font-weight: 800;
}

.app-busy-dialog p {
    min-height: 22px;
    margin: 0 0 14px;
    color: #475569;
}

.app-busy-bar {
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: #e2e8f0;
}

.app-busy-bar span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: #2563eb;
    transition: width .18s ease;
}

.app-loading-backdrop {
    z-index: 1300;
    pointer-events: none;
    background: rgba(15, 23, 42, .22);
}

.app-loading-dialog {
    padding-top: 22px;
    padding-bottom: 22px;
    pointer-events: none;
}

.app-busy-bar-indeterminate {
    position: relative;
}

.app-busy-bar-indeterminate span {
    width: 45%;
    animation: app-busy-progress 1.1s ease-in-out infinite;
}

.fiscal-follow-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1100;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, .35);
}

.fiscal-follow-dialog {
    width: min(1020px, calc(100vw - 56px));
    height: min(700px, calc(100vh - 56px));
    display: flex;
    flex-direction: column;
    background: #f5f8fc;
    border: 1px solid #9fb1c7;
    box-shadow: 0 24px 70px rgba(15, 23, 42, .32);
}

.fiscal-follow-dialog header {
    padding: 18px 24px 14px;
}

.fiscal-follow-dialog h2 {
    margin: 0;
    color: #0f172a;
    font-size: 22px;
    font-weight: 800;
}

.fiscal-follow-dialog p {
    margin: 8px 0 0;
    color: #475569;
}

.fiscal-follow-dialog textarea {
    flex: 1;
    margin: 8px 24px 18px;
    padding: 12px;
    resize: none;
    overflow: auto;
    white-space: pre;
    color: #000;
    background: #fff;
    border: 1px solid #cbd5e1;
    font-family: Consolas, "Courier New", monospace;
    font-size: 13px;
    line-height: 1.35;
}

.fiscal-follow-dialog footer {
    display: flex;
    justify-content: flex-end;
    gap: 14px;
    padding: 0 24px 24px;
}

.fiscal-follow-backdrop.top-layer {
    z-index: 1120;
}

.facturar-confirm-dialog {
    width: min(520px, calc(100vw - 32px));
    background: #f8fbff;
    border: 1px solid #b7c9dc;
    box-shadow: 0 24px 70px rgba(15, 23, 42, .32);
}

.facturar-confirm-dialog header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    border-bottom: 1px solid #cbd5e1;
}

.facturar-confirm-dialog h2 {
    margin: 0;
    color: #0f172a;
    font-size: 18px;
    font-weight: 800;
}

.facturar-confirm-icon {
    width: 26px;
    height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: #fff;
    background: #f59e0b;
    font-weight: 900;
}

.facturar-confirm-body {
    display: grid;
    gap: 18px;
    padding: 18px;
    color: #0f172a;
    font-size: 15px;
    line-height: 1.45;
}

.facturar-confirm-body p {
    margin: 0;
}

.facturar-confirm-body label {
    display: grid;
    gap: 6px;
    font-weight: 700;
}

.facturar-confirm-body select {
    height: 32px;
    padding: 4px 8px;
    color: #000;
    background: #fff;
    border: 1px solid #9fb4cc;
    font: inherit;
    font-weight: 400;
}

.facturar-confirm-body .facturar-aeat-option {
    display: flex;
    align-items: center;
    gap: 9px;
    font-weight: 600;
}

.facturar-aeat-option input {
    width: 16px;
    height: 16px;
    margin: 0;
}

.facturar-confirm-dialog footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 0 18px 18px;
}

.factura-vencimientos-panel {
    width: min(1500px, calc(100vw - 26px));
    height: min(760px, calc(100vh - 28px));
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border: 1px solid #555;
    box-shadow: 0 22px 60px rgba(15, 23, 42, .28);
}

.factura-vencimientos-panel header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 10px 14px;
}

.factura-vencimientos-panel h2 {
    margin: 0;
    color: #0037a8;
    font-size: 18px;
    font-weight: 800;
}

.factura-vencimientos-panel .app-btn {
    min-width: 82px;
    min-height: 32px;
}

.vencimientos-grid-wrap {
    margin: 6px 14px 14px;
    overflow: auto;
    flex: 1 1 auto;
    min-height: 0;
}

.factura-vencimientos-grid {
    min-width: 1360px !important;
    table-layout: fixed;
}

.factura-vencimientos-panel .desktop-grid.factura-vencimientos-grid thead tr th {
    background: #dbe8f6 !important;
    color: #06172d !important;
    font-weight: 900 !important;
    font-size: 14px !important;
    line-height: 1.2;
    padding: 14px 10px !important;
    vertical-align: middle;
    white-space: normal;
    border-color: #bfd0e3 !important;
    text-shadow: none !important;
}

.factura-vencimientos-panel .desktop-grid.factura-vencimientos-grid thead th:nth-child(1) {
    width: 36px;
}

.factura-vencimientos-panel .desktop-grid.factura-vencimientos-grid thead th:nth-child(2) {
    width: 90px;
}

.factura-vencimientos-panel .desktop-grid.factura-vencimientos-grid thead th:nth-child(3) {
    width: 130px;
}

.factura-vencimientos-panel .desktop-grid.factura-vencimientos-grid thead th:nth-child(4) {
    width: 130px;
}

.factura-vencimientos-panel .desktop-grid.factura-vencimientos-grid thead th:nth-child(5) {
    width: 190px;
}

.factura-vencimientos-panel .desktop-grid.factura-vencimientos-grid thead th:nth-child(6) {
    width: 280px;
}

.factura-vencimientos-panel .desktop-grid.factura-vencimientos-grid thead th:nth-child(7) {
    width: 110px;
}

.factura-vencimientos-panel .desktop-grid.factura-vencimientos-grid thead th:nth-child(8),
.factura-vencimientos-panel .desktop-grid.factura-vencimientos-grid thead th:nth-child(9) {
    width: 100px;
    text-align: center;
}

.factura-vencimientos-panel .desktop-grid.factura-vencimientos-grid thead th:nth-child(10) {
    width: 185px;
}

.factura-vencimientos-panel .desktop-grid.factura-vencimientos-grid tbody td {
    color: #06172d;
    font-size: 14px;
    line-height: 1.25;
    padding: 10px;
    vertical-align: middle;
    white-space: normal;
}

.factura-vencimientos-grid tbody tr.unpaid:not(.selected) td {
    background: #ffe4e8;
}

.factura-vencimientos-grid tbody tr.selected td {
    background: #0b86d9;
    color: #ffffff;
}

.factura-vencimientos-grid .selector-cell,
.factura-vencimientos-grid .check-cell {
    width: 34px;
    text-align: center;
}

.factura-vencimiento-editor {
    width: min(520px, calc(100vw - 36px));
    background: #f7f7f7;
    border: 1px solid #9aa8ba;
    border-radius: 6px;
    box-shadow: 0 22px 60px rgba(15, 23, 42, .3);
}

.factura-vencimiento-editor .vencimiento-editor-titlebar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 34px;
    padding: 0 8px;
    border-bottom: 1px solid #d7d7d7;
    background: #f3f3f3;
}

.factura-vencimiento-editor h2 {
    margin: 0;
    font-size: 13px;
    font-weight: 400;
    color: #111827;
}

.vencimiento-editor-close {
    width: 26px;
    height: 26px;
    border: 0;
    background: transparent;
    color: #111827;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
}

.vencimiento-editor-close:hover {
    background: #e81123;
    color: #ffffff;
}

.vencimiento-editor-body {
    display: grid;
    grid-template-columns: 145px 110px 1fr 34px;
    gap: 12px 28px;
    padding: 14px 18px 8px;
    align-items: end;
}

.vencimiento-editor-body label:not(.desktop-check) {
    display: grid;
    gap: 6px;
    font-size: 12px;
    color: #111827;
}

.vencimiento-editor-body .wide {
    grid-column: 1 / -1;
}

.vencimiento-editor-body input,
.vencimiento-editor-body textarea {
    width: 100%;
    min-height: 24px;
    border: 1px solid #aebbd0;
    padding: 2px 6px;
    background: #ffffff;
    font-size: 13px;
}

.vencimiento-editor-body textarea {
    min-height: 58px;
    resize: none;
}

.vencimiento-editor-help {
    grid-column: 4;
    grid-row: 1;
    width: 32px;
    min-width: 32px;
    height: 32px;
    min-height: 32px;
    padding: 0;
    justify-self: end;
    align-self: start;
}

.vencimiento-editor-checks {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 42px;
    padding-top: 2px;
}

.vencimiento-editor-body .desktop-check {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 6px;
    min-height: 22px;
    margin: 0;
    padding: 0;
    font-weight: 400;
    font-size: 13px;
}

.vencimiento-editor-body .desktop-check input[type="checkbox"] {
    width: 16px;
    min-width: 16px;
    height: 16px;
    min-height: 16px;
    margin: 0;
    padding: 0;
}

.factura-vencimiento-editor footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 8px 22px 14px;
}

.vencimiento-editor-action {
    min-width: 86px;
    height: 28px;
    border: 1px solid #c9cdd3;
    border-radius: 4px;
    background: #ffffff;
    color: #111827;
    font-size: 12px;
    cursor: pointer;
}

.vencimiento-editor-action.primary {
    border-color: #0d6efd;
}

.vencimiento-editor-action.print {
    border-color: #a56a00;
    background: #ffc107;
    color: #172033;
    font-weight: 700;
}

.vencimiento-editor-action:hover {
    background: #eef5ff;
}

.vencimiento-editor-action.print:hover {
    background: #ffca2c;
}

@keyframes app-busy-spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes app-busy-progress {
    0% {
        transform: translateX(-120%);
    }

    100% {
        transform: translateX(240%);
    }
}

.vehiculos-filter-strip {
    display: grid;
    grid-template-columns: 330px 170px 190px 170px minmax(320px, 1fr);
    align-items: end;
    gap: 12px;
    padding: 10px 20px;
}

.vehiculos-filter-strip label {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 7px;
    min-width: 0;
}

.vehiculos-filter-strip input,
.vehiculos-filter-strip select {
    width: 100%;
    min-width: 0;
}

.vehiculos-filter-strip label:first-child input {
    min-width: 0;
}

.vehiculos-grid th,
.vehiculos-grid td {
    white-space: nowrap;
}

.vehiculos-grid .w-actions,
.vehiculos-grid .grid-row-actions {
    width: 112px;
    min-width: 112px;
}

.vehiculo-window {
    min-height: calc(100vh - 74px);
    overflow: visible;
}

.vehiculo-desktop-window {
    position: relative;
    margin: 0;
    border: 0;
    background: #f5f8fc;
    color: #0f172a;
}

.workspace-content:has(.vehiculo-desktop-window) {
    padding: 14px 4px 0;
    overflow-y: auto;
    overflow-x: hidden;
}

.vehiculo-desktop-header {
    position: relative;
    display: grid;
    grid-template-columns: minmax(360px, 1fr) auto;
    align-items: center;
    gap: 18px;
    min-height: 92px;
    padding: 24px 18px 14px;
    background: #f5f8fc;
}

.vehiculo-desktop-header h2 {
    margin: 0;
    color: #020617;
    font-size: 28px;
    font-weight: 900;
    letter-spacing: 0;
    white-space: nowrap;
}

.vehiculo-title-card {
    display: grid;
    grid-template-columns: 42px max-content;
    align-items: center;
    gap: 10px;
    min-width: 0;
    min-height: 54px;
    padding: 0 10px 0 0;
    border: 0;
    background: transparent;
}

.vehiculo-title-card img {
    width: 38px;
    height: 38px;
    object-fit: contain;
}

.vehiculo-desktop-actions {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-end;
    gap: 9px;
    min-width: 0;
}

.vehiculo-desktop-actions .app-btn,
.vehiculo-close-button,
.vehiculo-help-button {
    min-width: 80px;
    height: 32px;
    border-radius: 4px;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 900;
    white-space: nowrap;
}

.vehiculo-desktop-actions .aux-btn {
    min-width: 107px;
    background: #f6c400;
    color: #fff;
}

.vehiculo-desktop-actions .app-btn:nth-child(5) {
    min-width: 116px;
}

.vehiculo-close-button {
    min-width: 90px;
}

.vehiculo-help-button {
    min-width: 38px;
    padding-inline: 0;
}

.vehiculo-btn-teal {
    background: #0f766e;
    color: #fff;
}

.vehiculo-btn-pc-dgt {
    min-width: 190px !important;
    background: #c7ede8;
    color: #0d3d37;
}

.vehiculo-pc-dgt-backdrop {
    position: fixed;
    inset: 0;
    z-index: 2400;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(15, 23, 42, .34);
}

.vehiculo-pc-dgt-panel {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    gap: 10px;
    width: min(760px, calc(100vw - 48px));
    max-height: calc(100vh - 48px);
    min-height: min(720px, calc(100vh - 48px));
    margin: 0;
    padding: 12px;
    border: 1px solid #c9d3e1;
    background: #f6fbff;
    box-shadow: 0 18px 46px rgba(15, 23, 42, .32);
    overflow: hidden;
}

.vehiculo-pc-dgt-panel header,
.vehiculo-pc-dgt-panel footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.vehiculo-pc-dgt-panel header strong {
    color: #061a3a;
    font-size: 15px;
}

.vehiculo-pc-dgt-panel footer {
    justify-content: flex-end;
}

.vehiculo-pc-dgt-body {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) minmax(0, 1fr);
    gap: 10px;
    min-height: 0;
    overflow: hidden;
}

.vehiculo-pc-dgt-picture {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
    min-height: 0;
}

.vehiculo-pc-dgt-preview {
    display: grid;
    place-items: center;
    position: relative;
    min-height: 0;
    border: 1px solid #c6ccd6;
    background: #fff;
    overflow: hidden;
}

.vehiculo-pc-dgt-preview span {
    color: #516070;
    font-size: 18px;
    font-weight: 700;
}

.vehiculo-pc-dgt-preview img {
    width: 100%;
    height: 100%;
    max-height: 100%;
    object-fit: contain;
}

.vehiculo-pc-dgt-actions {
    display: grid;
    grid-template-columns: repeat(3, 34px);
    gap: 6px;
    align-content: start;
    position: absolute;
    right: 8px;
    bottom: 8px;
    padding: 5px;
    border-radius: 4px;
    background: rgba(255, 255, 255, .86);
    box-shadow: 0 1px 4px rgba(15, 23, 42, .16);
}

.vehiculo-pc-dgt-actions .app-btn {
    display: inline-grid;
    place-items: center;
    min-width: 34px;
    width: 34px;
    height: 34px;
    padding: 4px;
}

.vehiculo-pc-dgt-actions svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.vehiculo-form {
    display: grid;
    grid-template-columns: minmax(680px, 1fr) minmax(440px, .68fr) 340px;
    grid-template-rows: 206px auto minmax(260px, auto);
    grid-template-areas:
        "identificacion propietario foto"
        "tecnicos tecnicos foto"
        "relacionados relacionados relacionados";
    gap: 14px 20px;
    min-height: 0;
    padding: 0 18px 28px;
}

.vehiculo-group {
    min-width: 0;
    margin: 0;
    padding: 18px 18px 12px;
    border: 1px solid #d6dbe3;
    background: transparent;
}

.vehiculo-group legend {
    padding: 0 5px;
    color: #17213a;
    font-size: 12px;
    font-weight: 800;
}

.vehiculo-group label {
    display: grid;
    min-width: 0;
    gap: 2px;
    color: #17213a;
    font-size: 12px;
    font-weight: 700;
}

.vehiculo-group input,
.vehiculo-group select,
.vehiculo-group textarea {
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    height: 24px;
    border: 1px solid #c6ccd6;
    background: #fff;
    padding: 2px 4px;
    color: #020617;
    font: 12px "Segoe UI", Arial, sans-serif;
}

.vehiculo-group textarea {
    resize: none;
}

.vehiculo-identificacion {
    grid-area: identificacion;
    display: grid;
    grid-template-columns: minmax(210px, 240px) minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: 48px 48px 48px;
    gap: 4px 18px;
    align-content: start;
    padding-top: 16px;
    padding-right: 18px;
    padding-bottom: 12px;
}

.vehiculo-identificacion legend {
    grid-column: 2;
    grid-row: 1;
    align-self: center;
    float: none;
    width: auto;
    margin: 0;
    padding: 0 5px;
}

.vehiculo-identificacion label {
    align-self: start;
}

.vehiculo-identificacion label > span {
    line-height: 16px;
    margin-bottom: 2px;
}

.vehiculo-identificacion label:nth-of-type(2) {
    grid-column: 3;
    grid-row: 1;
}

.vehiculo-identificacion label:nth-of-type(3) {
    grid-column: 2;
    grid-row: 2;
}

.vehiculo-identificacion label:nth-of-type(4) {
    grid-column: 3;
    grid-row: 2;
}

.vehiculo-identificacion label:nth-of-type(5) {
    grid-column: 2;
    grid-row: 3;
}

.vehiculo-identificacion label:nth-of-type(6) {
    grid-column: 3;
    grid-row: 3;
}

.vehiculo-tecnicos {
    grid-area: tecnicos;
    display: grid;
    grid-template-columns: repeat(3, minmax(150px, 1fr));
    grid-template-rows: 42px 42px;
    gap: 9px 22px;
    align-content: start;
}

.vehiculo-dgt-catalog {
    display: grid;
    grid-template-columns: repeat(4, minmax(130px, 1fr));
    gap: 9px 14px;
    align-content: start;
    padding: 12px 16px 14px;
}

.vehiculo-dgt-version-select {
    grid-column: span 2;
}

.vehiculo-tech-switch {
    grid-area: tecnicos;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    min-width: 0;
    border: 1px solid #d6dbe3;
    background: transparent;
}

.vehiculo-tech-tabs {
    padding: 6px 10px;
    border-bottom: 1px solid #d6dbe3;
    background: #f5f8fc;
}

.vehiculo-tech-data-grid {
    display: grid;
    grid-template-columns: minmax(0, .62fr) minmax(0, .38fr);
    gap: 14px 20px;
    min-width: 0;
    padding: 10px 8px 8px;
}

.vehiculo-tech-switch .vehiculo-tecnicos,
.vehiculo-tech-switch .vehiculo-codigos {
    grid-area: auto;
    border: 0;
    padding: 10px 14px;
}

.vehiculo-propietario {
    grid-area: propietario;
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 10px;
    padding: 16px 18px 10px;
}

.vehiculo-codigos {
    grid-area: codigos;
    padding-top: 17px;
}

.vehiculo-codigos textarea {
    height: 98px;
}

.vehiculo-photo-panel {
    grid-area: foto;
    display: grid;
    grid-template-rows: 247px auto;
    gap: 8px;
    min-width: 0;
    padding: 12px;
    border: 1px solid #d6dbe3;
    background: #f7fbff;
}

.vehiculo-photo-frame {
    display: grid;
    place-items: center;
    min-height: 247px;
    border: 1px solid #c6ccd6;
    background: #fff;
    overflow: hidden;
}

.vehiculo-photo-frame img {
    width: 100%;
    height: 100%;
    max-height: none;
    object-fit: contain;
}

.vehiculo-photo-empty {
    display: grid;
    place-items: center;
    align-content: center;
    gap: 12px;
    width: 100%;
    height: 100%;
    min-height: 190px;
    color: #64748b;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    text-align: center;
}

.vehiculo-photo-empty img {
    width: 72px;
    height: 72px;
    opacity: .72;
}

.vehiculo-photo-actions {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
    padding-bottom: 8px;
    border-bottom: 2px solid #ef4444;
}

.vehiculo-photo-actions .app-btn {
    display: inline-grid;
    place-items: center;
    min-width: 0;
    height: 32px;
    padding: 4px;
    text-align: center;
}

.vehiculo-photo-actions .app-btn svg {
    width: 21px;
    height: 21px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex: 0 0 auto;
}

.vehiculo-btn-google {
    background: #0f766e;
    color: #fff;
}

.vehiculo-file-button {
    position: relative;
    overflow: hidden;
}

.vehiculo-related-panel {
    grid-area: relacionados;
    display: grid;
    grid-template-rows: auto minmax(220px, 1fr);
    min-width: 0;
    min-height: 280px;
    border: 1px solid #d6dbe3;
    background: #fff;
}

.vehiculo-tabs {
    display: flex;
    gap: 8px;
    align-items: center;
    padding: 9px 10px 6px;
    border-bottom: 1px solid #d6dbe3;
    background: #f5f8fc;
}

.vehiculo-tabs button {
    min-width: 118px;
    height: 31px;
    border: 1px solid transparent;
    border-radius: 4px;
    background: #c7ede8;
    color: #12313c;
    font: 800 12px "Segoe UI", Arial, sans-serif;
}

.vehiculo-tabs button:first-child {
    background: #bfe7df;
}

.vehiculo-tabs button:nth-child(2) {
    background: #cde7f7;
}

.vehiculo-tabs button:nth-child(3) {
    background: #d7e6ff;
}

.vehiculo-tabs button:nth-child(4) {
    background: #d9f0d0;
}

.vehiculo-tabs button:nth-child(5) {
    background: #e7ddf7;
}

.vehiculo-tabs button.active {
    border-color: #7097b8;
    filter: saturate(1.18);
    box-shadow: inset 0 -3px 0 rgba(15, 23, 42, .18);
}

.vehiculo-tabs .vehiculo-related-new {
    margin-left: auto;
    min-width: 130px;
    background: #bfe3f8;
    color: #07324f;
}

.vehiculo-tabs .vehiculo-related-new:disabled {
    opacity: .55;
    cursor: not-allowed;
}

.vehiculo-related-grid {
    min-height: 0;
    overflow: auto;
    background: #fff;
}

.vehiculo-related-grid table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.vehiculo-related-grid th,
.vehiculo-related-grid td {
    border: 1px solid #d6dbe3;
    padding: 7px 8px;
    text-align: left;
}

.vehiculo-related-grid th {
    background: #eaf1f7;
    font-weight: 900;
}

.vehiculo-related-grid tbody tr {
    cursor: pointer;
}

.vehiculo-related-grid tbody tr:hover {
    background: #dbeafe;
}

.vehiculo-related-empty {
    padding: 18px;
    color: #64748b;
    font-weight: 700;
}

.vehiculo-floating-related {
    position: absolute;
    left: 28px;
    right: 28px;
    top: 170px;
    bottom: 26px;
    z-index: 15;
    display: grid;
    grid-template-rows: 52px minmax(0, 1fr);
    border: 1px solid #8aa4bf;
    background: #fff;
    box-shadow: 0 18px 40px rgba(15, 23, 42, .24);
}

.vehiculo-floating-related > header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 10px 12px 10px 18px;
    background: #f1f5f9;
    border-bottom: 1px solid #d6dbe3;
}

.vehiculo-floating-related > header strong {
    font-size: 18px;
    color: #0f172a;
}

.vehiculo-floating-related > header div {
    display: flex;
    gap: 8px;
}

.vehiculo-floating-grid {
    min-height: 0;
    overflow: auto;
}

.vehiculo-floating-grid table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.vehiculo-floating-grid th,
.vehiculo-floating-grid td {
    border: 1px solid #d6dbe3;
    padding: 8px 10px;
    text-align: left;
}

.vehiculo-floating-grid th {
    background: #0f172a;
    color: #fff;
    font-weight: 900;
}

.vehiculo-floating-grid tbody tr {
    cursor: pointer;
}

.vehiculo-floating-grid tbody tr:hover {
    background: #dbeafe;
}

.vehiculo-seguimiento-window {
    min-height: calc(100vh - 74px);
    display: grid;
    place-items: start center;
    padding: 54px 20px;
    background: #eef6fb;
}

.vehiculo-seguimiento-card {
    width: min(620px, 100%);
    display: grid;
    gap: 18px;
    padding: 22px;
    border: 1px solid #b8cadb;
    background: #f8fbff;
}

.vehiculo-seguimiento-card header {
    display: flex;
    align-items: center;
    gap: 16px;
}

.vehiculo-seguimiento-card header img {
    width: 42px;
    height: 42px;
    object-fit: contain;
}

.vehiculo-seguimiento-card h1 {
    margin: 0;
    font-size: 28px;
    color: #020617;
}

.vehiculo-seguimiento-card p {
    margin: 3px 0 0;
    color: #334155;
}

.vehiculo-seguimiento-card label {
    display: grid;
    gap: 6px;
    font-weight: 800;
}

.vehiculo-seguimiento-card input {
    width: 240px;
    height: 34px;
    border: 1px solid #9eb6cf;
    padding: 4px 8px;
    text-transform: uppercase;
    font-size: 18px;
    font-weight: 900;
}

.vehiculo-seguimiento-card footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.vehiculo-observaciones {
    grid-area: observaciones;
    padding: 16px 12px 12px;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
}

.vehiculo-observaciones textarea {
    height: 100%;
    min-height: 344px;
    border-color: #d6dbe3;
}

.vehiculo-matricula span {
    font-size: 16px;
    font-weight: 900;
}

.vehiculo-matricula input {
    height: 62px;
    border: 0;
    background: transparent;
    padding: 0;
    color: #1238f6;
    font-size: 42px;
    font-weight: 900;
    letter-spacing: 0;
    text-transform: uppercase;
}

.vehiculo-matricula {
    grid-column: 1;
    grid-row: 1 / span 3;
    align-content: center;
    padding-right: 14px;
    border-right: 1px solid #dce5ef;
}

.vehiculo-bastidor {
    grid-column: auto;
}

.vehiculo-propietario label > span:first-child {
    font-size: 16px;
    font-weight: 900;
}

.vehiculo-propietario .combo-with-action {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 78px 112px;
    grid-template-rows: 28px auto;
    gap: 8px;
    align-items: center;
}

.vehiculo-propietario .combo-with-action > input {
    grid-row: 1;
    grid-column: 1;
    height: 28px;
    min-width: 0;
}

.vehiculo-client-button {
    width: 78px;
    min-width: 78px;
    height: 28px;
    border: 0;
    border-radius: 4px;
    background: #bfe3f8;
    color: #113044;
    font-size: 11px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.vehiculo-client-button:first-of-type {
    grid-row: 1;
    grid-column: 2;
}

.vehiculo-client-button.seguimiento {
    grid-row: 1;
    grid-column: 3;
}

.vehiculo-client-button img {
    width: 16px;
    height: 16px;
    object-fit: contain;
}

.vehiculo-client-button.seguimiento {
    width: 112px;
    min-width: 112px;
    background: #c9ece3;
    color: #0d3d37;
}

.vehiculo-client-alert {
    grid-row: 2;
    grid-column: 1 / -1;
    justify-self: end;
    min-width: 198px;
    height: 28px;
    border: 0;
    border-radius: 4px;
    background: #e51b2a;
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
}

.vehiculo-client-alert:hover,
.vehiculo-client-alert:focus-visible {
    background: #c8101f;
}

.vehiculo-owner-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 7px 20px;
    margin: 0;
    padding: 0 2px 0 0;
    font-size: 12px;
    overflow: hidden;
}

.vehiculo-owner-details div {
    display: grid;
    grid-template-columns: 70px minmax(0, 1fr);
    gap: 8px;
    align-items: start;
    min-width: 0;
}

.vehiculo-owner-details div:first-child,
.vehiculo-owner-details div:nth-child(5) {
    grid-column: 1 / -1;
}

.vehiculo-owner-details dt {
    margin: 0;
    color: #b91c1c;
    font-weight: 700;
    line-height: 16px;
}

.vehiculo-owner-details dd {
    min-width: 0;
    margin: 0;
    overflow: hidden;
    color: #0f172a;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 16px;
}

.vehiculo-observaciones-text {
    width: 100%;
    min-height: 100%;
    height: 100%;
    border: 0;
    padding: 12px;
    resize: none;
    font: 13px "Segoe UI", Arial, sans-serif;
}

.vehiculo-date-box {
    display: grid;
    grid-template-columns: 16px minmax(0, 1fr);
    align-items: center;
    gap: 3px;
}

.vehiculo-date-box input[type="checkbox"] {
    width: 14px;
    height: 14px;
    padding: 0;
}

.vehiculo-date-box input[type="date"] {
    height: 24px;
}

.vehiculo-photo-modal {
    width: min(980px, 94vw);
}

.dgt-catalog-page {
    display: grid;
    gap: 16px;
    padding: 18px;
}

.dgt-catalog-status {
    display: grid;
    grid-template-columns: repeat(4, minmax(160px, 1fr));
    gap: 12px;
}

.dgt-catalog-status article {
    display: grid;
    gap: 5px;
    min-height: 66px;
    padding: 12px;
    border: 1px solid #cbd5e1;
    background: #f8fbff;
}

.dgt-catalog-status span {
    color: #475569;
    font-size: 12px;
    font-weight: 700;
}

.dgt-catalog-status strong {
    min-width: 0;
    overflow: hidden;
    color: #0f172a;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dgt-catalog-message,
.dgt-catalog-progress {
    padding: 12px 14px;
    border: 1px solid #bfdbfe;
    background: #eff6ff;
    color: #0f172a;
}

.dgt-catalog-progress {
    display: flex;
    gap: 18px;
    align-items: center;
    flex-wrap: wrap;
}

@media (max-width: 1200px) {
    .vehiculos-filter-strip,
    .vehiculo-form,
    .vehiculo-identificacion,
    .vehiculo-tecnicos,
    .vehiculo-dgt-catalog {
        grid-template-columns: 1fr 1fr;
        grid-template-areas: none;
    }

    .vehiculo-group {
        grid-area: auto;
    }

    .vehiculo-desktop-header {
        grid-template-columns: 1fr;
    }

    .vehiculo-desktop-actions {
        flex-wrap: wrap;
        padding-top: 0;
    }
}

.client-print-listing {
    display: none;
}

@media print {
    @page {
        size: A4 landscape;
        margin: 8mm;
    }

    body:has(.client-print-listing) * {
        visibility: hidden !important;
    }

    body:has(.client-print-listing) .client-print-listing,
    body:has(.client-print-listing) .client-print-listing * {
        visibility: visible !important;
    }

    body:has(.client-print-listing) .client-print-listing {
        display: block;
        position: static !important;
        inset: auto !important;
        width: 100% !important;
        max-width: none !important;
        min-height: auto !important;
        margin: 0 !important;
        padding: 0 !important;
        transform: none !important;
        color: #000;
        background: #fff;
        font-family: "Segoe UI", Arial, sans-serif;
        overflow: visible !important;
        z-index: 99999;
    }

    .client-print-listing h1 {
        margin: 0 0 4mm;
        font-size: 15pt;
        font-weight: 800;
    }

    .client-print-listing p {
        margin: 0 0 4mm;
        font-size: 8.5pt;
    }

    .client-print-listing table {
        width: 100%;
        border-collapse: collapse;
        table-layout: auto;
        font-size: 8.5pt;
        line-height: 1.2;
        page-break-inside: auto;
    }

    .client-print-listing th {
        padding: 3px 4px;
        border: 1px solid #cbd5e1;
        color: #fff;
        background: #0f172a;
        font-weight: 800;
        text-align: left;
    }

    .client-print-listing td {
        padding: 3px 4px;
        border: 1px solid #cbd5e1;
        vertical-align: top;
        overflow-wrap: anywhere;
    }

    .client-print-listing tr {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .client-print-listing th:nth-child(1),
    .client-print-listing td:nth-child(1) {
        width: 8%;
    }

    .client-print-listing th:nth-child(2),
    .client-print-listing td:nth-child(2) {
        width: 9%;
    }

    .client-print-listing th:nth-child(3),
    .client-print-listing td:nth-child(3) {
        width: 23%;
    }

    .client-print-listing th:nth-child(4),
    .client-print-listing td:nth-child(4),
    .client-print-listing th:nth-child(5),
    .client-print-listing td:nth-child(5) {
        width: 9%;
    }

    .client-print-listing th:nth-child(6),
    .client-print-listing td:nth-child(6) {
        width: 18%;
    }

    .client-print-listing th:nth-child(7),
    .client-print-listing td:nth-child(7),
    .client-print-listing th:nth-child(8),
    .client-print-listing td:nth-child(8) {
        width: 10%;
    }

    .client-print-listing th:nth-child(9),
    .client-print-listing td:nth-child(9) {
        width: 5%;
    }

    .recibos-print-listing {
        inset: auto !important;
        width: 100% !important;
        max-width: none !important;
    }

    .recibos-print-listing h1 {
        margin: 0 0 2mm;
        font-size: 14pt;
        text-align: left;
    }

    .recibos-print-listing p {
        margin: 0 0 3mm;
        font-size: 9pt;
        font-weight: 700;
    }

    .recibos-print-listing table {
        width: 100% !important;
        table-layout: fixed;
        font-size: 8pt;
        line-height: 1.12;
    }

    .recibos-print-listing th,
    .recibos-print-listing td {
        padding: 2.5px 3px;
        overflow-wrap: normal;
        word-break: normal;
        white-space: normal;
    }

    .recibos-print-listing th:nth-child(1),
    .recibos-print-listing td:nth-child(1) {
        width: 8%;
    }

    .recibos-print-listing th:nth-child(2),
    .recibos-print-listing td:nth-child(2) {
        width: 22%;
    }

    .recibos-print-listing th:nth-child(3),
    .recibos-print-listing td:nth-child(3) {
        width: 11%;
    }

    .recibos-print-listing th:nth-child(4),
    .recibos-print-listing td:nth-child(4) {
        width: 11%;
    }

    .recibos-print-listing th:nth-child(5),
    .recibos-print-listing td:nth-child(5) {
        width: 11%;
    }

    .recibos-print-listing th:nth-child(6),
    .recibos-print-listing td:nth-child(6),
    .recibos-print-listing th:nth-child(7),
    .recibos-print-listing td:nth-child(7) {
        width: 11%;
    }

    .recibos-print-listing th:nth-child(8),
    .recibos-print-listing td:nth-child(8) {
        width: 8%;
        text-align: right;
    }

    .recibos-print-listing th:nth-child(9),
    .recibos-print-listing td:nth-child(9) {
        width: 7%;
        text-align: center;
    }
}

.client-grid-columns {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px 18px;
    padding: 18px;
    max-height: min(560px, 70vh);
    overflow: auto;
}

.factura-colors-dialog {
    width: min(980px, calc(100vw - 48px));
}

.factura-colors-dialog .app-dialog-header p {
    margin: 4px 0 0;
    color: #475569;
}

.factura-colors-body {
    max-height: min(560px, 70vh);
    overflow: auto;
    padding: 14px 18px;
}

.factura-colors-grid th,
.factura-colors-grid td {
    white-space: nowrap;
}

.color-reference-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.color-reference-cell input[type="color"] {
    width: 38px;
    min-width: 38px;
    height: 28px;
    padding: 0;
}

.color-reference-cell input:not([type="color"]) {
    width: 140px;
}

.app-dialog-actions {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px 18px 16px;
    border-top: 1px solid #d7e0ea;
}

.grid-config-dialog {
    width: min(860px, calc(100vw - 48px));
    max-height: calc(100vh - 70px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.grid-config-actions {
    display: flex;
    gap: 10px;
    padding: 12px 18px 8px;
    border-bottom: 1px solid #d7e0ea;
}

.grid-config-columns {
    display: grid;
    grid-template-columns: repeat(3, minmax(170px, 1fr));
    gap: 12px 24px;
    padding: 18px;
    overflow: auto;
}

.grid-config-columns label {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 24px;
    white-space: nowrap;
}

.grid-config-columns input[type="checkbox"] {
    width: 16px;
    height: 16px;
}

.desktop-grid-config-dialog {
    position: relative;
    width: calc(100vw - 6px);
    height: calc(100vh - 6px);
    max-width: none;
    max-height: none;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 12px 16px;
    border: 1px solid #8fa4bf;
    border-radius: 4px;
    background: #f5f8fc;
    box-shadow: 0 24px 70px rgba(15, 23, 42, .28);
    color: #000;
    font-family: "Microsoft Sans Serif", "Segoe UI", Arial, sans-serif;
    font-size: 12px;
}

body:has(.desktop-grid-config-dialog) .app-btn-help,
body:has(.desktop-grid-config-dialog) .context-help-button {
    visibility: hidden !important;
}

body:has(.desktop-grid-config-dialog) .desktop-grid-config-dialog .app-btn-help {
    visibility: visible !important;
}

.desktop-grid-config-dialog h3 {
    margin: 0;
    color: #000;
    font-size: 18px;
    font-weight: 800;
    letter-spacing: 0;
    line-height: 1.1;
}

.desktop-grid-config-top {
    display: grid;
    grid-template-columns: minmax(320px, 1fr) auto;
    align-items: center;
    gap: 16px;
    min-height: 42px;
    margin: 0 0 10px;
}

.desktop-grid-config-font {
    display: grid;
    grid-template-columns: minmax(430px, 1fr) 240px minmax(0, 2.4fr);
    align-items: center;
    gap: 16px;
    flex: 0 0 auto;
    min-height: 60px;
    margin: 0 0 16px;
    padding: 8px 16px;
    border: 1px solid #b6c7dc;
    background: #f8fbff;
}

.desktop-grid-config-font label {
    display: grid;
    grid-template-columns: 68px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
}

.desktop-grid-config-font select,
.desktop-grid-config-font input,
.desktop-grid-config-row input[type="number"] {
    height: 29px;
    border: 1px solid #b8b8b8;
    border-radius: 0;
    background: #fff;
    color: #000;
    font: inherit;
}

.desktop-grid-config-columns {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px 26px;
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    overflow: auto;
    padding: 12px 14px 10px;
    border: 1px solid #8ea9ca;
    background: #fff;
}

.desktop-grid-config-heading,
.desktop-grid-config-row {
    display: grid;
    grid-template-columns: 26px minmax(120px, 1fr) 56px 72px;
    align-items: center;
    gap: 8px;
}

.desktop-grid-config-heading span:first-child {
    grid-column: 1 / 3;
}

.desktop-grid-config-heading {
    margin-bottom: 5px;
    font-weight: 800;
    text-align: left;
}

.desktop-grid-config-heading span:nth-child(2),
.desktop-grid-config-heading span:nth-child(3) {
    text-align: center;
}

.desktop-grid-config-row {
    min-height: 24px;
    cursor: default;
}

.desktop-grid-config-row > span:not(.desktop-grid-config-drag-handle) {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.desktop-grid-config-row:hover {
    background: #eef6ff;
}

.desktop-grid-config-row.dragging {
    opacity: .55;
    outline: 2px dashed #2563eb;
    background: #eaf4ff;
}

.desktop-grid-config-row-placeholder {
    min-height: 24px;
    border: 1px dashed #2563eb;
    border-radius: 5px;
    background: #eff6ff;
}

.desktop-grid-config-row.drag-target {
    outline: 1px dashed transparent;
}

.desktop-grid-config-drag-handle {
    display: inline-grid;
    place-items: center;
    width: 24px;
    height: 22px;
    border-radius: 5px;
    color: #64748b;
    font-size: 14px;
    font-weight: 800;
    cursor: grab;
    touch-action: none;
    user-select: none;
}

.desktop-grid-config-drag-handle:hover {
    background: #dbeafe;
    color: #1d4ed8;
}

.desktop-grid-config-drag-handle:active {
    cursor: grabbing;
}

.desktop-grid-config-row input[type="checkbox"] {
    justify-self: center;
    width: 17px;
    height: 17px;
    margin: 0;
    cursor: pointer;
}

.desktop-grid-config-row input[type="number"] {
    width: 66px;
    height: 22px;
    padding: 2px 5px;
    cursor: text;
}

.desktop-grid-config-actions {
    display: flex;
    justify-content: flex-end;
    flex-wrap: nowrap;
    gap: 9px;
    align-items: center;
    margin: 0;
}

.desktop-grid-config-actions .app-btn {
    width: 140px;
    min-height: 32px;
    border-radius: 7px;
    white-space: nowrap;
    line-height: 1.1;
    box-shadow: 0 2px 5px rgba(15, 23, 42, .12);
    transition: transform .12s ease, box-shadow .12s ease, filter .12s ease;
}

.desktop-grid-config-actions .app-btn:first-child,
.desktop-grid-config-actions .app-btn:nth-child(2) {
    width: 138px;
}

.desktop-grid-config-actions .app-btn:nth-child(4) {
    width: 140px;
}

.desktop-grid-config-actions .desktop-grid-config-help {
    width: 48px;
    min-width: 48px;
}

.desktop-grid-config-actions .app-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 9px rgba(15, 23, 42, .16);
    filter: brightness(1.03);
}

@media (max-width: 1320px) {
    .desktop-grid-config-top {
        grid-template-columns: 1fr;
    }

    .desktop-grid-config-actions {
        grid-column: 1 / -1;
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .desktop-grid-config-font {
        grid-template-columns: 1fr 1fr;
    }

    .desktop-grid-config-columns {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        overflow: auto;
    }
}

.desktop-message {
    margin: 12px 20px;
    padding: 9px 12px;
    border: 1px solid #b9d6b9;
    background: #effbea;
    color: #225f28;
    font-weight: 700;
}

.gym-check-window {
    min-height: calc(100vh - 92px);
    padding: 10px 18px 12px;
    background: #eef6fd;
}

.gym-check-header {
    display: grid;
    grid-template-columns: minmax(320px, 1fr) auto;
    gap: 14px;
    align-items: center;
    min-height: 70px;
    padding: 8px 18px;
    border: 1px solid #bdd0e4;
    background: #fff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.gym-check-header .title-with-icon img {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.gym-check-header h2 {
    margin: 0;
    color: #07162d;
    font-size: 24px;
    font-weight: 900;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gym-check-header p {
    margin: 2px 0 0;
    color: #123c7a;
    font-weight: 700;
}

.gym-check-actions {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    justify-content: flex-end;
    align-items: center;
}

.gym-check-actions .app-btn {
    min-width: 0;
    height: 30px;
    padding: 5px 16px;
    white-space: nowrap;
}

.gym-check-search {
    display: grid;
    grid-template-columns: 110px minmax(380px, 1fr) 54px 200px 96px minmax(240px, .55fr) 146px;
    gap: 10px;
    align-items: end;
    margin-top: -1px;
    padding: 5px 14px;
    border: 1px solid #bdd0e4;
    background: #f8fbff;
}

.gym-check-search label,
.gym-check-article-header label {
    display: grid;
    gap: 4px;
    color: #07162d;
    font-weight: 800;
}

.gym-check-search select,
.gym-check-search input,
.gym-check-article-header select {
    height: 28px;
    border: 1px solid #9fb4cc;
    background: #fff;
    padding: 4px 9px;
    color: #07162d;
    font-weight: 700;
}

.gym-check-search > label:first-child {
    display: grid;
    grid-column: 1 / 3;
    grid-template-columns: 110px minmax(0, 1fr);
    align-items: center;
}

.gym-check-search > label:first-child span,
.gym-check-mobile-readonly span,
.gym-check-qr-search label span {
    align-self: center;
}

.gym-check-mobile-readonly {
    display: grid;
    grid-column: 3 / 5;
    grid-template-columns: 54px minmax(0, 1fr);
    align-items: center;
}

.gym-check-qr-search {
    display: grid;
    grid-column: 5 / 8;
    grid-template-columns: 96px minmax(0, 1fr) 146px;
    gap: 10px;
    align-items: end;
}

.gym-check-qr-search label {
    display: grid;
    grid-column: 1 / 3;
    grid-template-columns: 96px minmax(0, 1fr);
    align-items: center;
}

.gym-check-qr-search .app-btn {
    min-width: 146px;
    height: 28px;
    padding-top: 4px;
    padding-bottom: 4px;
    line-height: 1.1;
    white-space: nowrap;
}

.gym-check-client-search {
    position: relative;
}

.gym-check-client-options {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 2px);
    z-index: 10004;
    max-height: 280px;
    overflow-y: auto;
    border: 1px solid #7f94ad;
    background: #fff;
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.24);
}

.gym-check-client-options button {
    display: block;
    width: 100%;
    min-height: 29px;
    border: 0;
    border-bottom: 1px solid #e2e8f0;
    background: #fff;
    color: #071733;
    padding: 4px 10px;
    text-align: left;
    font: inherit;
    font-weight: 400;
    cursor: pointer;
}

.gym-check-client-options button:hover,
.gym-check-client-options button:focus {
    background: #2563d6;
    color: #fff;
    outline: none;
}

.gym-check-client {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 102px;
    gap: 12px;
    align-items: stretch;
    margin-top: 6px;
    padding: 8px 14px;
    border: 1px solid #bdd0e4;
    background: #dcecf9;
}

.gym-check-status-strip {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 44px;
    margin-top: 6px;
    padding: 0 12px;
    background: #fff1f2;
}

.gym-check-data-card {
    display: grid;
    grid-template-columns: minmax(310px, .65fr) minmax(420px, 1.35fr) minmax(310px, .95fr);
    gap: 6px;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}

.gym-check-data-card div {
    min-width: 0;
    min-height: 30px;
    padding: 4px 8px;
    border: 1px solid #b8c8da;
    background: #fff;
    display: flex;
    align-items: center;
    gap: 8px;
}

.gym-check-data-card div.wide {
    grid-column: span 1;
}

.gym-check-data-card div:nth-child(2) {
    grid-column: 2;
}

.gym-check-data-card div:nth-child(3) {
    grid-column: 3;
}

.gym-check-data-card div:nth-child(6) {
    grid-column: 3;
}

.gym-check-data-card div:nth-child(8) {
    grid-column: 2 / 4;
}

.gym-check-data-card span {
    flex: 0 0 auto;
    margin-bottom: 0;
    color: #52667e;
    font-size: 12px;
    font-weight: 800;
}

.gym-check-data-card strong {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    color: #07162d;
    font-size: 15px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gym-check-data-card div.state {
    background: #fff7ed;
}

.gym-check-data-card strong.ok {
    color: #047857;
}

.gym-check-data-card strong.warn {
    color: #dc2626;
}

.gym-check-photo {
    display: grid;
    place-items: center;
    width: 102px;
    height: 102px;
    margin-top: 0;
    border: 1px solid #b8c8da;
    background: #fff;
    color: #e11d2e;
    font-size: 13px;
    font-weight: 800;
}

.gym-check-photo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.gym-check-state-warning {
    display: flex;
    align-items: center;
    margin: 0;
    padding: 6px 0;
    border-left: 0;
    background: transparent;
    color: #dc2626;
    font-size: 23px;
    font-weight: 900;
}

.gym-check-alerts {
    margin: 6px 0 0;
    border: 1px solid #d7b94f;
    background: #fff8b4;
    padding: 8px;
}

.gym-check-alert-title {
    margin-bottom: 6px;
    color: #78350f;
    font-weight: 900;
}

.gym-check-alerts .blocking-alert td {
    background: #fee2e2;
    color: #7f1d1d;
    font-weight: 800;
}

.gym-check-grids {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-top: 14px;
    padding: 0;
}

.gym-check-grids article {
    min-height: 206px;
    border: 1px solid #b8c8da;
    background: #fff;
    padding: 12px;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

.gym-check-grids h3 {
    margin: 0 0 10px;
    color: #07162d;
    font-size: 16px;
    font-weight: 900;
}

.gym-check-tabs {
    margin-top: 0;
}

.gym-check-tab-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    border-bottom: 2px solid #078783;
    background: #e6f1fa;
}

.gym-check-tab-buttons button {
    min-width: 136px;
    min-height: 36px;
    border: 1px solid #a8bdd3;
    border-bottom: 0;
    background: #eef3f8;
    color: #07162d;
    padding: 6px 12px;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}

.gym-check-tab-buttons button.active {
    border-color: #078783;
    background: #078783;
    color: #fff;
}

.gym-check-tab-panel {
    min-height: calc(100vh - 250px);
    border: 1px solid #b8c8da;
    border-top: 0;
    background: #fff;
    padding: 12px;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

.gym-check-tab-panel h3 {
    margin: 0 0 10px;
    color: #07162d;
    font-size: 17px;
    font-weight: 900;
}

.gym-check-article-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.gym-check-article-header h3 {
    margin: 0;
}

.gym-check-article-header label {
    grid-template-columns: auto 150px;
    align-items: center;
}

.gym-check-grid-wrap {
    max-height: calc(100vh - 320px);
    overflow: auto;
}

.gym-check-grid-wrap.summary {
    max-height: calc(100vh - 320px);
}

.gym-check-summary-grid th,
.gym-check-summary-grid td {
    text-align: right;
}

.gym-check-summary-grid th:first-child,
.gym-check-summary-grid td:first-child {
    text-align: center;
}

.gym-check-summary-grid .value-cell {
    background: #dcfce7;
    color: #166534;
    font-weight: 800;
}

.gym-check-summary-grid .total-cell {
    font-weight: 900;
}

.gym-check-access-summary-head {
    display: flex;
    align-items: center;
    gap: 28px;
    margin: 0 0 10px;
}

.gym-check-access-summary-head h3 {
    margin: 0;
}

.gym-check-access-summary-head span {
    color: #6b7280;
    font-size: 18px;
    font-weight: 500;
}

.gym-check-access-summary-grid .access-click-cell {
    cursor: pointer;
}

.gym-check-access-summary-grid .access-click-cell:hover {
    background: #bbf7d0;
    outline: 2px solid #0f8f89;
    outline-offset: -2px;
}

.gym-access-calendar-dialog {
    width: min(760px, calc(100vw - 40px));
}

.gym-access-calendar-title {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 10px;
    padding: 10px 14px;
    border: 1px solid #c3d3e4;
    background: #eef6fd;
    color: #07162d;
}

.gym-access-calendar-title strong,
.gym-access-calendar-title span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gym-access-calendar-title span {
    font-weight: 900;
    text-transform: capitalize;
}

.gym-access-calendar-week,
.gym-access-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
}

.gym-access-calendar-week span {
    padding: 8px;
    border: 1px solid #ccd8e6;
    background: #e8eef6;
    color: #07162d;
    text-align: center;
    font-weight: 900;
}

.gym-access-calendar-grid div {
    display: grid;
    align-content: space-between;
    min-height: 72px;
    padding: 7px;
    border: 1px solid #d3deea;
    background: #fff;
}

.gym-access-calendar-grid div.empty {
    background: #f4f7fb;
}

.gym-access-calendar-grid div.has-access {
    border-color: #86efac;
    background: #dcfce7;
}

.gym-access-calendar-grid .day-number {
    color: #475569;
    font-size: 24px;
    font-weight: 900;
    line-height: 1;
}

.gym-access-calendar-grid div.sunday .day-number {
    color: #dc2626;
}

.gym-access-calendar-grid strong {
    justify-self: end;
    color: #047857;
    font-size: 13px;
    font-weight: 900;
}

.gym-check-empty {
    margin: 18px 0 0;
    padding: 28px;
    border: 1px dashed #9fb4cc;
    background: #fff;
    color: #475569;
    text-align: center;
    font-size: 16px;
    font-weight: 800;
}

@media (max-width: 1200px) {
    .gym-check-header,
    .gym-check-search,
    .gym-check-client,
    .gym-check-grids {
        grid-template-columns: 1fr;
    }

    .gym-check-actions {
        justify-content: flex-start;
    }

    .gym-check-data-card {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .gym-check-data-card div.wide {
        grid-column: span 1;
    }

    .gym-check-photo {
        width: 160px;
        height: 130px;
    }

    .gym-check-qr-search {
        grid-template-columns: 1fr;
    }

    .gym-check-tab-buttons button {
        flex: 1 1 190px;
    }
}

.baja-cliente-dialog {
    width: min(520px, calc(100vw - 32px));
}

.baja-cliente-body {
    display: grid;
    gap: 12px;
    padding: 16px;
}

.baja-cliente-body label:not(.check-inline) {
    display: grid;
    gap: 5px;
    color: #07162d;
    font-weight: 800;
}

.baja-cliente-body input[type="date"],
.baja-cliente-body select {
    height: 34px;
    border: 1px solid #9fb4cc;
    background: #fff;
    padding: 4px 8px;
    color: #07162d;
    font-weight: 700;
}

.baja-recibos-check {
    align-items: center;
    margin-top: 4px;
    color: #07162d;
    font-weight: 800;
}

/* Login Gestionatu */
.login-page {
    position: relative;
    min-height: 100vh;
    display: block;
    padding: 0;
    overflow: hidden;
    background: #eaf3fb url("images/fondo-login-gestionatu-ok.png") center center / cover no-repeat;
}

.login-shell {
    position: relative;
    width: 100%;
    min-height: 100vh;
    display: block;
    border: 0;
    border-radius: 0;
    overflow: visible;
    background: transparent;
    box-shadow: none;
}

.login-hero {
    display: none;
}

.login-access-panel {
    position: absolute;
    left: clamp(960px, 61vw, 1180px);
    top: clamp(430px, 45vh, 470px);
    width: 560px;
    min-height: auto;
    padding: 20px 28px 18px;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(203, 213, 225, 0.9);
    box-shadow: 0 18px 42px rgba(15, 42, 82, 0.12);
}

.login-identity {
    margin-bottom: 10px;
}

.login-identity h1 {
    font-size: 1.28rem;
    line-height: 1.15;
    color: #07162d;
}

.login-identity p {
    margin-top: 5px;
    color: #52637a;
    font-size: 0.76rem;
}

.login-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px 16px;
    align-items: start;
}

.login-form label {
    gap: 3px;
    color: #24364d;
    font-size: 0.76rem;
}

.login-form > label:nth-child(1) {
    grid-column: 1;
    grid-row: 1;
}

.login-form > label:nth-child(2) {
    grid-column: 1;
    grid-row: 2;
}

.login-form > label:nth-child(3) {
    grid-column: 2;
    grid-row: 1;
}

.login-form > label:nth-child(4) {
    grid-column: 2;
    grid-row: 2;
}

.login-form > label:nth-child(5) {
    grid-column: 1 / -1;
    grid-row: 3;
}

.login-form > label:nth-child(6) {
    grid-column: 1;
    grid-row: 4;
}

.login-form > label:nth-child(7),
.login-form > label:nth-child(8),
.login-form > .login-actions,
.login-form > .login-recover-link {
    grid-column: 1 / -1;
}

.login-form .form-control {
    min-height: 21px;
    height: 21px;
    padding: 1px 8px;
    border: 1px solid #aebed0;
    border-radius: 2px;
    font-size: 0.82rem;
}

.login-password-eye {
    width: 31px;
}

.login-password-eye svg {
    width: 15px;
    height: 15px;
}

.remember-row,
.agreement-row {
    gap: 5px !important;
    font-size: 0.75rem;
}

.remember-row {
    margin-top: -5px;
}

.remember-row input,
.agreement-row input {
    width: 13px;
    height: 13px;
}

.agreement-row a {
    line-height: 1.08;
}

.login-actions {
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-top: 12px;
}

.btn-login,
.btn-secondary-login,
.btn-cancel-login {
    min-height: 28px;
    border-radius: 3px;
    font-size: 0.82rem;
}

.login-recover-link {
    margin-top: 4px;
    font-size: 0.78rem;
}

.login-version {
    margin-top: 10px;
    color: #64748b;
    font-size: 0.7rem;
}

.login-alert,
.login-info {
    margin-bottom: 10px;
    padding: 7px 9px;
    font-size: 0.78rem;
}

@media (max-width: 900px), (max-height: 760px) {
    .login-page {
        min-height: 100dvh;
        overflow: auto;
        background-position: 42% center;
    }

    .login-access-panel {
        position: relative;
        left: auto;
        top: auto;
        width: min(520px, calc(100vw - 32px));
        margin: min(42vh, 360px) 22px 28px auto;
    }
}

@media (min-width: 901px) and (max-width: 1450px) {
    .login-access-panel {
        left: auto;
        right: clamp(30px, 3.2vw, 58px);
        top: clamp(415px, 44vh, 460px);
    }
}

.desktop-grid-wrap {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    background: #fff;
}

.desktop-grid {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    font-size: 0.9rem;
}

.desktop-grid th,
.desktop-grid td {
    padding: 9px 10px;
    border: 1px solid #d3d9e2;
    text-align: left;
}

.desktop-grid th {
    position: sticky;
    top: 0;
    z-index: 5;
    background: #eef3f8;
    font-weight: 700;
}

.desktop-grid tbody tr {
    cursor: pointer;
}

.desktop-grid tbody tr:hover {
    background: #dbeafe;
    color: #0f172a;
}

.desktop-grid tbody tr.selected,
.desktop-grid tbody tr.inactive-row.selected {
    background: #bfdbfe;
    color: #0f172a;
    box-shadow: inset 4px 0 0 #1d4ed8;
}

.desktop-grid tbody tr.selected td,
.desktop-grid tbody tr.inactive-row.selected td {
    color: #0f172a;
    font-weight: 600;
}

.grid-sort-button {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    border: 0;
    padding: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    font-weight: 800;
    text-align: left;
}

.grid-sort-button:hover {
    color: #0f6fae;
}

.grid-sort-indicator {
    color: #1d4ed8;
    font-size: .75rem;
}

.grid-actions-column {
    width: 86px;
    text-align: center;
}

.desktop-grid td.grid-row-actions {
    width: 86px;
    padding: 4px 6px;
    white-space: nowrap;
    text-align: center;
}

.client-grid .client-row-actions-column,
.client-grid td.client-row-actions {
    width: 146px;
    min-width: 146px;
}

.grid-action-buttons {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    white-space: nowrap;
}

.top-clientes-filter select {
    min-height: 26px;
    border: 1px solid #aeb7c2;
    background: #fff;
}

.top-clientes-filter .disabled-label {
    color: #8a94a3;
}

.top-clientes-grid .rank-column {
    width: 78px;
    text-align: center;
}

.top-clientes-grid .amount-column {
    width: 190px;
    text-align: right;
}

.empty-grid-cell {
    height: 80px;
    color: var(--fg-muted);
    text-align: center !important;
}

.row-icon-button {
    width: 28px;
    height: 28px;
    display: inline-grid;
    place-items: center;
    margin: 0 2px;
    border: 1px solid #aeb7c2;
    border-radius: 3px;
    background: #fff;
    color: #1f3d57;
    cursor: pointer;
}

.row-icon-button:hover,
.row-icon-button:focus-visible {
    background: #e8f3ff;
}

.row-icon-button.delete {
    border-color: #d34b4b;
    color: #b91c1c;
}

.row-icon-button.delete:hover,
.row-icon-button.delete:focus-visible {
    background: #ffe5e5;
}

.row-icon-button svg {
    width: 15px;
    height: 15px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.row-icon-button:disabled {
    cursor: not-allowed;
    opacity: .4;
    background: #eef2f7;
}

.row-icon-button.delete:disabled:hover,
.row-icon-button.delete:disabled:focus-visible {
    background: #eef2f7;
}

.mostrador-window {
    height: calc(100vh - 84px);
    min-height: calc(100vh - 124px);
}

.mostrador-window-preview {
    height: calc(100vh - 76px);
    min-height: calc(100vh - 76px);
    margin: 0;
    border: 1px solid #b7c1ce;
}

.mostrador-header {
    grid-template-columns: 345px minmax(0, 1fr);
    align-items: start;
    padding: 12px 22px 8px;
}

.mostrador-header p {
    margin: 4px 0 0;
    color: #1d4ed8;
    font-size: 0.96rem;
    font-weight: 700;
}

.mostrador-actions {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 146px;
    justify-content: stretch;
    align-content: start;
    align-items: start;
    gap: 8px 10px;
    max-width: 100%;
    overflow: visible;
}

.mostrador-command-actions {
    display: grid !important;
    grid-template-columns: 118px 112px 96px 160px 172px minmax(240px, 310px);
    grid-template-areas:
        "new refresh list generate dates collect-generated"
        "cash expense client check collect stats";
    grid-auto-rows: 30px;
    justify-content: end;
    align-items: stretch;
    gap: 8px 8px;
    min-width: 0;
}

.mostrador-actions .app-btn {
    width: 100%;
    min-width: 0;
    min-height: 30px;
    padding: 0 8px;
    overflow: visible;
    text-overflow: clip;
    white-space: nowrap;
    font-size: 0.74rem;
}

.mostrador-command-actions .mostrador-action-new {
    grid-area: new;
}

.mostrador-command-actions .mostrador-action-refresh {
    grid-area: refresh;
}

.mostrador-command-actions .mostrador-action-list {
    grid-area: list;
}

.mostrador-command-actions .mostrador-action-generate {
    grid-area: generate;
}

.mostrador-command-actions .mostrador-action-dates {
    grid-area: dates;
}

.mostrador-command-actions .mostrador-action-cash {
    grid-area: cash;
}

.mostrador-command-actions .mostrador-action-expense {
    grid-area: expense;
}

.mostrador-command-actions .mostrador-action-client {
    grid-area: client;
}

.mostrador-command-actions .mostrador-action-check {
    grid-area: check;
}

.mostrador-command-actions .mostrador-action-collect {
    grid-area: collect;
}

.mostrador-command-actions .mostrador-action-collect-generated {
    grid-area: collect-generated;
    font-size: 0.76rem;
}

.mostrador-command-actions .mostrador-action-stats {
    grid-area: stats;
}

.mostrador-actions .screen-terminal-actions {
    display: grid;
    grid-template-columns: 104px 38px;
    grid-auto-rows: 30px;
    align-items: stretch;
    gap: 8px;
}

.mostrador-actions .app-btn-close {
    width: 104px;
}

.mostrador-actions .mostrador-help {
    min-width: 38px;
    width: 38px;
    padding: 0;
}

.mostrador-actions .mostrador-action-turnos {
    grid-column: 1 / 3;
    width: 150px;
    font-size: 0.76rem;
}

.desktop-list-header.mostrador-header {
    grid-template-columns: 345px minmax(0, 1fr) !important;
}

.desktop-list-header .mostrador-actions {
    justify-self: end !important;
    width: 100% !important;
}

.mostrador-search {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 9px;
    padding-top: 6px;
    font-size: 0.88rem;
}

.mostrador-search input:not([type="checkbox"]),
.mostrador-search select {
    min-height: 29px;
    border: 1px solid #aeb7c2;
    background: #fff;
}

.mostrador-search input:not([type="checkbox"]) {
    width: 340px;
}

.mostrador-search .search-clear-field {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.mostrador-search .search-clear-field input {
    padding-right: 31px;
}

.mostrador-search .search-clear-field button {
    position: absolute;
    right: 5px;
    width: 21px;
    height: 21px;
    border: 0;
    border-radius: 50%;
    background: #d7e2ee;
    color: #16324f;
    font-size: 13px;
    font-weight: 900;
    line-height: 1;
    display: grid;
    place-items: center;
}

.mostrador-search .search-clear-field button:hover:not(:disabled) {
    background: #0f6fae;
    color: #fff;
}

.mostrador-search .search-clear-field button:disabled {
    opacity: .42;
    cursor: default;
}

.mostrador-search .qr-input {
    width: 180px !important;
}

.mostrador-search .date-input {
    width: 150px !important;
}

.mostrador-search .qr-icon {
    width: 26px;
    height: 26px;
    display: inline-grid;
    place-items: center;
    color: #0f172a;
    font-size: 1.35rem;
    line-height: 1;
}

.vencidas-check {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.mostrador-summary {
    color: #1d4ed8;
    white-space: nowrap;
}

.mostrador-grid-config {
    display: inline-flex;
    align-items: center;
    min-width: 118px;
}

.mostrador-grid-config .app-btn,
.mostrador-grid-config button {
    min-height: 30px;
    min-width: 118px;
    padding: 0 10px;
    white-space: nowrap;
    font-size: 0.74rem;
}

.mostrador-grid {
    min-width: 1630px;
    table-layout: auto;
    font-size: 0.94rem;
}

.mostrador-grid th {
    background: #111827;
    color: #fff;
}

.mostrador-grid th,
.mostrador-grid td {
    padding: 6px 10px;
}

.mostrador-grid .mostrador-actions-heading,
.mostrador-grid .mostrador-actions-cell {
    width: 1%;
    white-space: nowrap;
    text-align: center;
}

.mostrador-grid col.mostrador-col-acciones {
    width: 276px;
}

.mostrador-grid col.mostrador-col-cliente {
    width: 110px;
}

.mostrador-grid col.mostrador-col-nombre {
    width: 220px;
}

.mostrador-grid col.mostrador-col-pendientes {
    width: 120px;
}

.mostrador-grid col.mostrador-col-tarifa {
    width: 130px;
}

.mostrador-grid col.mostrador-col-importe {
    width: 120px;
}

.mostrador-grid col.mostrador-col-fecha {
    width: 150px;
}

.mostrador-grid col.mostrador-col-fecha-alta {
    width: 130px;
}

.mostrador-grid col.mostrador-col-activo {
    width: 80px;
}

.mostrador-grid .mostrador-actions-cell {
    padding: 4px;
}

.mostrador-row-actions {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.mostrador-row-actions .row-icon-button {
    flex: 0 0 30px;
    width: 30px;
    min-width: 30px;
    height: 28px;
}

.mostrador-grid .mostrador-cliente-cell {
    white-space: nowrap;
}

.mostrador-grid .center {
    text-align: center;
}

.mostrador-grid .money {
    text-align: right;
}

.mostrador-grid .pending-cell {
    color: #1d4ed8;
    font-weight: 700;
}

.mostrador-grid tbody tr.expired-row:not(.selected) {
    background: #dc2626 !important;
    color: #fff;
}

.mostrador-grid tbody tr.inactive-row:not(.selected) {
    background: #6b7280 !important;
    color: #fff;
}

.mostrador-grid tbody tr.selected,
.mostrador-grid tbody tr.expired-row.selected,
.mostrador-grid tbody tr.inactive-row.selected {
    background: #1d4ed8 !important;
    color: #fff;
    box-shadow: inset 4px 0 0 #facc15;
}

.mostrador-grid tbody tr.selected td,
.mostrador-grid tbody tr.expired-row.selected td,
.mostrador-grid tbody tr.inactive-row.selected td {
    color: #fff;
    font-weight: 700;
}

.mostrador-cobrar-btn {
    flex: 0 0 auto;
    width: auto;
    min-width: 64px;
    box-sizing: border-box;
    padding: 0 9px;
    min-height: 27px;
    border: 1px solid #94a3b8;
    border-radius: 2px;
    background: #e2e8f0;
    color: #0f172a;
    font: 700 0.86rem "Segoe UI", Arial, sans-serif;
    cursor: pointer;
}

.mostrador-cobrar-btn.due {
    border-color: #ca8a04;
    background: #facc15;
}

.mostrador-emitir-recibo-btn {
    flex: 0 0 auto;
    width: auto;
    min-width: 0;
    box-sizing: border-box;
    padding: 0 10px;
    min-height: 27px;
    border: 1px solid #15803d;
    border-radius: 2px;
    background: #4ade80;
    color: #052e16;
    font: 700 0.82rem "Segoe UI", Arial, sans-serif;
    cursor: pointer;
    white-space: nowrap;
}

.mostrador-emitir-recibo-btn:hover {
    background: #22c55e;
}

.mostrador-activar-btn {
    flex: 0 0 auto;
    width: auto;
    min-width: 64px;
    box-sizing: border-box;
    padding: 0 9px;
    min-height: 27px;
    border: 1px solid #047857;
    border-radius: 2px;
    background: #22c55e;
    color: #ffffff;
    font: 700 0.86rem "Segoe UI", Arial, sans-serif;
    cursor: pointer;
}

.mostrador-btn-green {
    border-color: #047857;
    background: #059669;
}

.mostrador-btn-green-strong {
    border-color: #065f46;
    background: #16a34a;
    color: #fff;
    box-shadow: inset 0 -2px 0 rgba(0,0,0,.16);
}

.mostrador-btn-teal {
    border-color: #0f766e;
    background: #0d9488;
}

.mostrador-btn-teal-dark {
    border-color: #115e59;
    background: #0f766e;
}

.mostrador-btn-gray {
    border-color: #475569;
    background: #4b5563;
}

.mostrador-btn-purple {
    border-color: #6d28d9;
    background: #7c3aed;
}

.mostrador-btn-red-dark {
    border-color: #991b1b;
    background: #b91c1c;
}

.mostrador-btn-blue {
    border-color: #0369a1;
    background: #0284c7;
}

.mostrador-btn-yellow {
    border-color: #eab308;
    background: #facc15;
    color: #7f1d1d;
}

.mostrador-help {
    border-color: #1d4ed8;
    background: #2563eb;
}

.mostrador-recibos-dialog {
    width: min(920px, calc(100vw - 40px));
}

.mostrador-cobro-generados-dialog {
    width: min(1280px, calc(100vw - 36px));
    max-height: calc(100vh - 80px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    font-weight: 400;
}

.mostrador-cobro-generados-dialog h3,
.mostrador-cobro-generados-dialog th,
.mostrador-cobro-generados-dialog td,
.mostrador-cobro-generados-dialog button,
.mostrador-cobro-generados-dialog input {
    font-weight: 400;
}

.mostrador-cobro-generados-dialog .app-dialog-header p {
    margin: 3px 0 0;
    color: #405b78;
    font-size: 13px;
}

.mostrador-cobro-generados-search {
    display: grid;
    grid-template-columns: minmax(210px, .45fr) minmax(460px, 1fr) 110px;
    gap: 12px;
    align-items: end;
    padding: 14px 16px;
    border-bottom: 1px solid #cbd8e6;
    background: #f5f8fb;
}

.mostrador-cobro-generados-search label {
    display: grid;
    gap: 5px;
    color: #06172d;
    font-weight: 400;
}

.mostrador-cobro-generados-search input,
.mostrador-cobro-generados-search select {
    width: 100%;
    min-height: 31px;
    border: 1px solid #aeb7c2;
    background: #fff;
    padding: 3px 7px;
    font: inherit;
}

.mostrador-cobro-cliente-search {
    position: relative;
}

.mostrador-cobro-cliente-options {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 2px);
    z-index: 10004;
    max-height: 310px;
    overflow-y: auto;
    border: 1px solid #7f94ad;
    background: #fff;
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.24);
}

.mostrador-cobro-cliente-options button {
    display: block;
    width: 100%;
    min-height: 29px;
    border: 0;
    border-bottom: 1px solid #e2e8f0;
    background: #fff;
    color: #071733;
    padding: 4px 10px;
    text-align: left;
    font: inherit;
    font-weight: 400;
    cursor: pointer;
}

.mostrador-cobro-cliente-options button:hover,
.mostrador-cobro-cliente-options button:focus {
    background: #2563d6;
    color: #fff;
    outline: none;
}

.mostrador-cobro-generados-grid-wrap {
    flex: 1 1 auto;
    min-height: 360px;
    background: #fff;
}

.mostrador-cobro-generados-grid {
    min-width: 1040px;
}

.mostrador-cobro-generados-grid tbody tr {
    cursor: pointer;
}

.mostrador-cobro-generados-grid tbody tr.receipt-overdue:not(.selected) {
    background: #dc2626;
    color: #fff;
}

.mostrador-cobro-generados-grid tbody tr.receipt-future:not(.selected),
.mostrador-cobro-generados-grid tbody tr.receipt-warning:not(.selected) {
    background: #facc15;
    color: #1f2937;
}

.mostrador-cobro-generados-grid tbody tr.receipt-overdue:not(.selected) td {
    color: #fff;
}

.mostrador-cobro-generados-grid .money {
    text-align: right;
}

.mostrador-cobro-generados-summary {
    margin-right: auto;
    color: #004b91;
    font-weight: 400;
}

.mostrador-recibo-cobrar-btn {
    min-width: 104px;
    min-height: 28px;
    border: 1px solid #b68b00;
    border-radius: 4px;
    background: #ffd21f;
    color: #111827;
    font-weight: 400;
    cursor: pointer;
}

.mostrador-recibo-cobrar-btn:hover:not(:disabled) {
    background: #ffc107;
}

.mostrador-recibo-cobrar-btn:disabled {
    opacity: .45;
    cursor: default;
}

.mostrador-cobro-recibo-dialog {
    width: min(620px, calc(100vw - 44px));
    font-weight: 400;
}

.mostrador-cobro-recibo-dialog .app-dialog-title,
.mostrador-cobro-recibo-dialog h3,
.mostrador-cobro-recibo-dialog strong,
.mostrador-cobro-recibo-dialog button {
    font-weight: 400;
}

.mostrador-cobro-recibo-form {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 18px;
}

.mostrador-cobro-recibo-form label {
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    font-weight: 400;
}

.mostrador-cobro-recibo-form input,
.mostrador-cobro-recibo-form select {
    min-height: 30px;
    border: 1px solid #aeb7c2;
    background: #fff;
    padding: 3px 8px;
    font: inherit;
}

.mostrador-cobro-recibo-form input[readonly] {
    background: #eef2f7;
    text-align: right;
    font-weight: 400;
}

.mostrador-recibos-masivos-dialog {
    width: min(1040px, calc(100vw - 40px));
    max-height: calc(100vh - 120px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.recibos-parametros {
    display: grid;
    gap: 14px;
    padding: 16px 18px;
}

.recibos-parametros p {
    margin: 0;
    color: #0f2e4d;
}

.recibos-parametros fieldset {
    display: flex;
    align-items: center;
    gap: 22px;
    border: 1px solid #c4d3e2;
    border-radius: 6px;
    padding: 18px 14px;
}

.recibos-parametros legend {
    width: auto;
    float: none;
    padding: 0 6px;
    margin: 0;
    color: #06172d;
    font-size: 14px;
    font-weight: 900;
}

.recibos-parametros label,
.recibos-preview-toolbar label {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: #06172d;
    font-weight: 700;
}

.recibos-fecha-natural {
    margin-left: auto;
}

.mostrador-recibos-preview-panel {
    flex: 1 1 auto;
    height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #f5f8fc;
}

.recibos-preview-toolbar {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    padding: 14px 12px;
    border-bottom: 1px solid #cbd8e6;
    background: #f5f8fb;
}

.recibos-preview-toolbar select,
.recibos-preview-toolbar input,
.recibos-parametros input[type="date"] {
    min-height: 29px;
    border: 1px solid #aeb7c2;
    background: #fff;
}

.recibos-preview-search input {
    width: 280px;
}

.recibos-preview-grid-wrap {
    flex: 1 1 auto;
    min-height: 0;
    height: 100%;
    background: #fff;
}

.recibos-preview-grid {
    min-width: 1280px;
}

.recibos-preview-grid tbody tr.selected-emitir:not(.selected) {
    background: #b8f7d0;
}

.recibos-preview-grid tbody tr.selected-emitir:hover {
    background: #95efba;
}

.recibos-preview-footer {
    flex: 0 0 auto;
    display: grid;
    grid-template-columns: max-content max-content 1fr max-content max-content;
    align-items: center;
    gap: 18px;
    padding: 10px 12px;
    border-top: 1px solid #cbd8e6;
    background: #f8fafc;
}

.recibos-preview-footer strong {
    color: #004b91;
    font-size: 15px;
}

.mostrador-small-dialog {
    width: min(520px, calc(100vw - 40px));
}

.mostrador-caja,
.mostrador-gasto-form {
    display: grid;
    gap: 12px;
    padding: 18px;
}

.mostrador-caja label,
.mostrador-gasto-form label {
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
}

.mostrador-caja p {
    display: flex;
    justify-content: space-between;
    margin: 0;
    padding: 7px 10px;
    border: 1px solid #d1d7e0;
    background: #fff;
}

.mostrador-gasto-form input {
    min-height: 30px;
    border: 1px solid #aeb7c2;
    padding: 4px 8px;
}

@media (max-width: 1200px) {
    .mostrador-header {
        grid-template-columns: 1fr;
    }

    .mostrador-actions {
        justify-content: stretch;
        grid-template-columns: minmax(0, 1fr);
    }

    .mostrador-command-actions {
        grid-template-columns: repeat(3, minmax(130px, 1fr));
        grid-template-areas:
            "new refresh list"
            "generate dates stats"
            "cash expense client"
            "check collect collect";
        justify-content: stretch;
    }

    .mostrador-actions .screen-terminal-actions {
        justify-self: end;
    }

    .mostrador-search {
        flex-wrap: wrap;
    }
}

.desktop-card {
    max-width: 780px;
}

.desktop-card.merged-document-window {
    width: min(1180px, calc(100% - 24px));
    max-width: 1180px;
    margin-right: auto;
    margin-left: auto;
}

.desktop-card.role-card {
    max-width: 820px;
}

.desktop-form {
    display: grid;
    gap: 22px;
    padding: 30px 40px;
}

.desktop-form.user-form {
    gap: 14px;
    padding: 24px 40px;
}

.desktop-form label:not(.desktop-check) {
    display: grid;
    grid-template-columns: 140px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
}

.desktop-form input,
.desktop-form select {
    min-height: 25px;
    border: 1px solid #aeb7c2;
    background: #fff;
}

.desktop-form input[readonly] {
    background: #eef2f7;
}

.desktop-form .wide {
    max-width: 360px;
}

.permissions-box {
    max-width: 640px;
    margin-top: 8px;
    padding: 22px 28px 28px;
    border: 1px solid #b9c2ce;
}

.permissions-box legend {
    padding: 0 8px;
    font-weight: 700;
}

.permissions-box > div {
    display: grid;
    grid-template-columns: repeat(2, minmax(220px, 1fr));
    gap: 15px 32px;
}

.desktop-check {
    display: flex;
    align-items: center;
    gap: 9px;
}

.user-form {
    position: relative;
    max-width: 620px;
}

.password-input-wrap {
    width: 390px;
    max-width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 31px;
    align-items: stretch;
}

.password-input-wrap input {
    width: 100%;
    min-width: 0;
    border-right: 0;
}

.password-eye-button {
    width: 31px;
    min-width: 31px;
    min-height: 25px;
    display: grid;
    place-items: center;
    border: 1px solid #aeb7c2;
    border-radius: 0 3px 3px 0;
    background: #eef2f7;
    color: #1f3d57;
    cursor: pointer;
}

.password-eye-button:hover {
    background: #dbe8f5;
}

.password-eye-button svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.agenda-user-dialog {
    width: min(480px, calc(100vw - 32px));
}

.agenda-user-dialog-body {
    display: grid;
    gap: 14px;
    padding: 20px 22px;
}

.agenda-user-dialog-body label {
    display: grid;
    grid-template-columns: 130px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
}

.agenda-user-dialog-body input,
.agenda-user-dialog-body .password-input-wrap {
    width: 100%;
}

.agenda-user-dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 12px 16px;
    border-top: 1px solid #cbd5e1;
    background: #f8fafc;
}

.agenda-user-dialog-body .agenda-user-blocked-check input {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: #dc2626;
}

.desktop-grid tbody tr.agenda-user-blocked-row,
.desktop-grid tbody tr.agenda-user-blocked-row:hover,
.desktop-grid tbody tr.agenda-user-blocked-row.selected {
    background: #fecaca;
    color: #7f1d1d;
}

.desktop-grid tbody tr.agenda-user-blocked-row.selected {
    box-shadow: inset 4px 0 0 #dc2626;
}

.desktop-grid tbody tr.agenda-user-blocked-row.selected td {
    color: #7f1d1d;
}

@media (max-width: 560px) {
    .agenda-user-dialog-body label {
        grid-template-columns: 1fr;
        gap: 5px;
    }
}

.desktop-card.client-card {
    max-width: none;
    min-height: calc(100vh - 124px);
}

.client-card-header {
    display: grid;
    grid-template-columns: minmax(220px, auto) 1fr;
    align-items: end;
    gap: 18px;
    min-height: 118px;
    padding: 14px 28px 16px 30px;
}

.client-title-zone {
    display: grid;
    gap: 8px;
    align-content: start;
    justify-items: start;
}

.client-title-zone .title-with-icon {
    padding-bottom: 8px;
    border-bottom: 1px solid #0f172a;
}

.client-title-zone .title-with-icon img {
    width: 44px;
    height: 44px;
}

.client-title-zone .title-with-icon h2 {
    font-size: 1.45rem;
}

.client-title-zone .aux-button-host {
    justify-self: start;
}

.client-search select {
    min-height: 25px;
    border: 1px solid #aeb7c2;
    background: #fff;
}

.client-grid th:nth-child(3),
.client-grid td:nth-child(3) {
    min-width: 260px;
}

.client-grid {
    table-layout: fixed;
}

.client-grid th,
.client-grid td {
    box-sizing: border-box;
    overflow: hidden;
    overflow-wrap: anywhere;
    word-break: break-word;
    white-space: normal;
}

.client-grid .grid-sort-button {
    min-width: 0;
    max-width: 100%;
    white-space: normal;
}

.client-grid .grid-sort-button span:first-child {
    min-width: 0;
    overflow: hidden;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.client-grid .client-row-actions-column,
.client-grid td.client-row-actions {
    overflow: visible;
    white-space: nowrap;
}

.desktop-grid tbody tr.inactive-row:not(.selected) {
    background: #ffe4e6;
}

.client-tabs {
    padding-left: 8px;
    border-top: 1px solid #c5d0dc;
    background: #e5e5e5;
}

.client-form-body {
    min-height: 560px;
    padding: 22px 28px 26px;
    background: #f4f7fb;
}

.client-general-layout {
    display: grid;
    grid-template-columns: minmax(760px, 1fr) 240px;
    gap: 44px;
    align-items: start;
}

.desktop-form.client-form-grid {
    max-width: 1020px;
    grid-template-columns: repeat(2, minmax(280px, 1fr));
    gap: 15px 28px;
    padding: 0;
}

.client-form-grid label:not(.desktop-check) {
    grid-template-columns: 155px minmax(0, 1fr);
}

.client-form-grid .wide-row {
    grid-column: 1 / -1;
}

.client-form-grid .wide-row input,
.client-form-grid .wide-row textarea {
    width: min(760px, 100%);
}

.geo-input-wrap {
    width: min(760px, 100%);
    display: grid;
    grid-template-columns: minmax(0, 1fr) 31px;
    align-items: stretch;
}

.geo-input-wrap input {
    width: 100% !important;
    min-width: 0;
    border-right: 0;
}

.geo-map-button {
    width: 31px;
    min-width: 31px;
    min-height: 25px;
    display: grid;
    place-items: center;
    border: 1px solid #aeb7c2;
    border-radius: 0 3px 3px 0;
    background: #eef2f7;
    color: #c2410c;
    cursor: pointer;
}

.geo-map-button:hover,
.geo-map-button:focus-visible {
    background: #fff4e6;
}

.geo-map-button svg {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.contact-input-wrap {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 31px;
    align-items: stretch;
}

.contact-input-wrap.email {
    width: min(760px, 100%);
}

.contact-input-wrap input,
.contact-input-wrap textarea {
    width: 100% !important;
    min-width: 0;
    border-right: 0;
}

.contact-input-wrap textarea {
    resize: vertical;
}

.contact-action-button {
    width: 31px;
    min-width: 31px;
    min-height: 25px;
    display: grid;
    place-items: center;
    border: 1px solid #aeb7c2;
    border-radius: 0 3px 3px 0;
    background: #eef2f7;
    color: #1d74b7;
    cursor: pointer;
}

.contact-action-button.email {
    min-height: 100%;
    color: #0f766e;
}

.contact-action-button:hover,
.contact-action-button:focus-visible {
    background: #e8f3ff;
}

.contact-action-button.email:hover,
.contact-action-button.email:focus-visible {
    background: #e6fffb;
}

.contact-action-button svg {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.client-form-grid textarea,
.client-observations {
    border: 1px solid #aeb7c2;
    background: #fff;
    font: inherit;
}

.client-checks {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 22px;
    margin-left: 155px;
}

.client-photo-panel {
    display: grid;
    gap: 10px;
    justify-items: stretch;
    align-content: start;
}

.client-photo-placeholder {
    height: 250px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 10px;
    border: 1px solid #aeb7c2;
    background: #fff;
    color: #64748b;
    text-align: center;
    font-size: 0.86rem;
}

.client-photo-placeholder img {
    width: 72px;
    height: 72px;
    object-fit: contain;
}

.client-photo-placeholder img.client-photo-preview {
    width: 100%;
    height: 205px;
    object-fit: contain;
}

.employees-grid .grid-actions-column,
.employees-grid td.grid-row-actions {
    width: 82px;
    min-width: 82px;
    max-width: 82px;
    text-align: center;
}

.employees-grid .employee-photo-cell {
    width: 78px;
    text-align: center;
}

.employees-grid {
    min-width: 1615px;
    table-layout: fixed;
}

.employees-grid col.employee-col-actions { width: 82px; }
.employees-grid col.employee-col-foto { width: 78px; }
.employees-grid col.employee-col-code { width: 90px; }
.employees-grid col.employee-col-nif { width: 110px; }
.employees-grid col.employee-col-nombre { width: 230px; }
.employees-grid col.employee-col-category { width: 150px; }
.employees-grid col.employee-col-ciudad { width: 150px; }
.employees-grid col.employee-col-mobile,
.employees-grid col.employee-col-phone { width: 115px; }
.employees-grid col.employee-col-email { width: 220px; }
.employees-grid col.employee-col-commission { width: 90px; }
.employees-grid col.employee-col-start-date,
.employees-grid col.employee-col-end-date { width: 105px; }
.employees-grid col.employee-col-activo { width: 75px; }

.employees-grid th,
.employees-grid td {
    height: 48px;
    padding: 5px 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: middle;
}

.employees-grid th {
    height: 38px;
}

.employees-grid .grid-sort-button {
    width: 100%;
    justify-content: flex-start;
    white-space: nowrap;
}

.employees-grid .employee-photo-cell img {
    width: 40px;
    height: 40px;
}

.employee-photo-cell img,
.tariff-photo-cell img {
    width: 58px;
    height: 58px;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

.employee-card {
    width: calc(100vw - 56px);
    max-width: 1840px;
    margin: 18px auto;
}

.employee-form-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 260px;
    gap: 28px;
    padding: 24px 28px 30px;
    align-items: start;
}

.employee-form-main {
    display: grid;
    grid-template-columns: repeat(3, minmax(300px, 1fr));
    gap: 18px;
    align-items: stretch;
}

.employee-fieldset {
    border: 1px solid #c6d1df;
    padding: 22px 26px 24px;
    margin: 0;
    background: #f8fbff;
    min-width: 0;
    min-height: 296px;
}

.employee-fieldset legend {
    padding: 0 8px;
    font-weight: 700;
    color: #10213d;
    margin-bottom: 8px;
}

.desktop-form.employee-form-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
}

.desktop-form.employee-form-grid label:not(.desktop-check) {
    display: grid;
    grid-template-columns: 126px minmax(0, 1fr);
    gap: 16px;
    align-items: center;
}

.desktop-form.employee-form-grid .wide-row {
    grid-column: 1 / -1;
}

.desktop-form.employee-form-grid input,
.desktop-form.employee-form-grid select {
    width: 100%;
    min-height: 32px;
}

.employee-labor-grid .desktop-check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 32px;
}

.employee-photo-panel {
    display: grid;
    align-content: start;
    gap: 10px;
    width: 100%;
}

.employee-photo-box {
    width: 100%;
    aspect-ratio: 3 / 4;
    min-height: 0;
    border: 1px solid #aebccc;
    background: #fff;
    display: grid;
    place-items: center;
    overflow: hidden;
}

.employee-photo-box img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
}

.employee-photo-actions {
    display: grid;
    grid-template-columns: repeat(3, 30px);
    justify-content: center;
    gap: 6px;
}

.employee-photo-actions .file-button {
    overflow: hidden;
}

.employee-photo-actions .file-button input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.employee-file-button,
.tariff-file-button {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 142px;
    height: 32px;
    padding: 0 16px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
}

.tariff-file-button span {
    position: relative;
    z-index: 1;
    display: block;
    line-height: 1;
}

.tariffs-window {
    min-height: 720px;
}

.tariffs-header {
    grid-template-columns: auto 1fr;
}

.tariffs-actions {
    justify-content: flex-start;
}

.tariffs-filter-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px 14px;
    padding: 10px 12px;
    border-top: 1px solid #c8d4e2;
    border-bottom: 1px solid #c8d4e2;
    background: #f4f8fd;
}

.tariffs-search {
    display: grid;
    grid-template-columns: auto minmax(280px, 420px);
    align-items: center;
    gap: 8px;
    margin: 0;
}

.tariffs-search span {
    color: #0f172a;
    font-weight: 700;
}

.tariffs-search input {
    height: 28px;
    border: 1px solid #aebccc;
    padding: 3px 8px;
    background: #fff;
}

.app-btn-destroy-filters {
    min-width: 132px;
    min-height: 30px;
    background: #f97316;
    border: 1px solid #ea580c;
    color: #fff;
    font-weight: 700;
}

.app-btn-destroy-filters:hover,
.app-btn-destroy-filters:focus-visible {
    background: #ea580c;
}

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

.tariffs-direct-filter button {
    min-height: 30px;
    min-width: 110px;
    padding: 0 14px;
    border: 1px solid #9fb1c6;
    border-radius: 4px;
    background: #eef6ff;
    color: #001a3d;
    font-weight: 500;
    cursor: pointer;
}

.tariffs-direct-filter button.catalogo {
    background: #dff7e7;
    border-color: #9ddbb3;
    color: #14532d;
}

.tariffs-direct-filter button.descatalogadas {
    background: #fde2e2;
    border-color: #f3aaaa;
    color: #7f1d1d;
}

.tariffs-direct-filter button.todas {
    background: #dbeafe;
    border-color: #9fbeef;
    color: #12366e;
}

.tariffs-direct-filter button.active {
    box-shadow: inset 0 0 0 2px rgba(15, 23, 42, .18);
    filter: saturate(1.05);
}

.gym-activities-filter-tag {
    min-height: 28px;
    display: inline-flex;
    align-items: center;
    padding: 0 10px;
    border: 1px solid #95b8de;
    background: #dbeafe;
    color: #12366e;
    font-weight: 700;
}

.grid-filter-result-badge {
    margin-left: auto;
    min-height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 12px;
    border: 1px solid #89b4df;
    background: #e8f3ff;
    color: #12366e;
    font-weight: 700;
    white-space: nowrap;
}

.grid-filter-result-wrap {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.grid-filter-result-wrap .grid-filter-result-badge {
    margin-left: 0;
}

.grid-record-summary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.grid-templates-button {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px;
    border: 1px solid #9fb1c5;
    border-radius: 4px;
    background: #f8fbff;
    cursor: pointer;
}

.grid-templates-button.plain,
.grid-record-summary .grid-templates-button {
    background: transparent;
    border-color: transparent;
}

.grid-templates-button:hover,
.grid-templates-button:focus-visible {
    background: #e8f2ff;
    border-color: #60a5fa;
}

.grid-templates-button img {
    width: 22px;
    height: 22px;
    object-fit: contain;
}

.tariffs-grid {
    width: 100%;
    min-width: 0;
    table-layout: fixed;
}

.tariff-col-actions { width: 70px; }
.tariff-col-photo { width: 126px; }
.tariff-col-id { width: 160px; }
.tariff-col-name { width: 410px; }
.tariff-col-price { width: 72px; }
.tariff-col-week { width: 78px; }
.tariff-col-day { width: 68px; }
.tariff-col-time { width: 72px; }
.tariff-col-check { width: 42px; }
.tariff-col-desc { width: 56px; }
.tariff-col-color { width: 90px; }
.tariff-col-count { width: 70px; }

.tariffs-grid td {
    vertical-align: middle;
}

.tariffs-grid th,
.tariffs-grid td {
    text-align: left;
}

.tariffs-grid th:nth-child(1),
.tariffs-grid td:nth-child(1) {
    width: 70px;
    text-align: center;
}

.tariffs-grid th:nth-child(2),
.tariffs-grid td:nth-child(2) {
    width: 126px;
    text-align: center;
}

.tariffs-grid th:nth-child(3),
.tariffs-grid td:nth-child(3) {
    width: 160px;
}

.tariffs-grid th:nth-child(4),
.tariffs-grid td:nth-child(4) {
    width: 410px;
}

.tariffs-grid th:nth-child(5),
.tariffs-grid td:nth-child(5) {
    width: 58px;
}

.tariffs-grid th:nth-child(6),
.tariffs-grid td:nth-child(6) {
    width: 70px;
}

.tariffs-grid th:nth-child(8),
.tariffs-grid td:nth-child(8),
.tariffs-grid th:nth-child(9),
.tariffs-grid td:nth-child(9) {
    width: 58px;
}

.tariffs-grid th:nth-child(7),
.tariffs-grid td:nth-child(7) {
    width: 64px;
}

.tariffs-grid th:nth-child(n+10):nth-child(-n+16),
.tariffs-grid td:nth-child(n+10):nth-child(-n+16) {
    width: 32px;
    text-align: center;
}

.tariffs-grid th:nth-child(17),
.tariffs-grid td:nth-child(17) {
    width: 48px;
    text-align: center;
}

.tariffs-grid th:nth-child(18),
.tariffs-grid td:nth-child(18) {
    width: 74px;
}

.tariffs-grid th:nth-child(19),
.tariffs-grid td:nth-child(19),
.tariffs-grid th:nth-child(20),
.tariffs-grid td:nth-child(20),
.tariffs-grid th:nth-child(21),
.tariffs-grid td:nth-child(21) {
    width: 60px;
}

.tariff-row-actions {
    text-align: center;
}

.tariff-action-buttons {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.tariff-row-actions .row-icon-button {
    margin: 0;
}

.row-icon-button.clients {
    border-color: #7aa7cf;
    color: #0f4c81;
}

.row-icon-button.clients img {
    width: 18px;
    height: 18px;
    object-fit: contain;
    display: block;
}

.row-icon-button.clients:hover,
.row-icon-button.clients:focus-visible {
    background: #e8f3ff;
}

.tariffs-grid th:nth-child(8),
.tariffs-grid td:nth-child(8) {
    text-align: center;
}

.tariffs-grid input:not([type="checkbox"]):not([type="color"]) {
    width: 100%;
    height: 26px;
    border: 1px solid #aebccc;
    padding: 2px 4px;
    background: #fff;
    text-overflow: ellipsis;
}

.tariffs-grid input[readonly] {
    background: #edf2f7;
}

.tariffs-grid input[type="checkbox"] {
    width: 16px;
    height: 16px;
}

.tariffs-grid input[type="color"] {
    width: 42px;
    height: 28px;
    padding: 1px;
    border: 1px solid #aebccc;
}

.tariff-photo-cell {
    width: 126px;
    text-align: center;
}

.tariff-photo-tools {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
    align-items: center;
    gap: 4px;
}

.tariff-photo-thumb {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border: 1px solid #b8c7d8;
    background: #fff;
}

.tariff-photo-thumb img {
    max-width: 42px;
    max-height: 42px;
    object-fit: contain;
}

.tariff-photo-buttons {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    min-width: 0;
}

.tariff-photo-buttons .icon-photo-button {
    width: 24px;
    height: 24px;
    min-width: 24px;
}

.tariff-photo-buttons .icon-photo-button svg {
    width: 15px;
    height: 15px;
}

.tariff-photo-buttons .icon-photo-button span {
    font-weight: 900;
    font-size: 13px;
    line-height: 1;
}

.tariff-name-cell {
    min-width: 0;
}

.tariff-new-row {
    background: #f8fbff;
}

@media (max-width: 900px) {
    .employee-form-body {
        grid-template-columns: 1fr;
    }

    .employee-form-main {
        grid-template-columns: 1fr;
    }

    .desktop-form.employee-form-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .desktop-form.employee-form-grid label:not(.desktop-check) {
        grid-template-columns: 110px minmax(0, 1fr);
    }

    .employee-photo-panel {
        max-width: 260px;
    }
}

@media (min-width: 901px) and (max-width: 1320px) {
    .employee-form-body {
        grid-template-columns: minmax(0, 1fr) 240px;
    }

    .employee-form-main {
        grid-template-columns: repeat(2, minmax(300px, 1fr));
    }
}

.desktop-card.employee-card-panorama {
    width: auto !important;
    max-width: none !important;
    margin: 12px 18px !important;
    overflow: hidden;
    box-sizing: border-box;
    max-height: calc(100vh - 104px);
    display: flex;
    flex-direction: column;
}

.employee-form-body.employee-form-body-panorama {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 230px !important;
    gap: 20px !important;
    padding: 18px 26px 20px !important;
    align-items: start;
    min-width: 0;
    min-height: 0;
    overflow: auto;
}

.employee-form-main.employee-form-main-panorama {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 10px !important;
    align-items: stretch !important;
    min-width: 0;
}

.employee-card-panorama .employee-fieldset {
    min-height: 0;
    padding: 12px 22px 14px;
}

.employee-card-panorama .employee-fieldset legend {
    font-size: 1.18rem;
    margin-bottom: 2px;
}

.employee-card-panorama .desktop-form.employee-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 28px;
    align-items: center;
}

.employee-card-panorama .desktop-form.employee-form-grid label:not(.desktop-check) {
    display: grid;
    grid-template-columns: 118px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    min-width: 0;
}

.employee-card-panorama .desktop-form.employee-form-grid input,
.employee-card-panorama .desktop-form.employee-form-grid select {
    min-height: 31px;
    font-size: 1rem;
}

.employee-card-panorama .contact-input-wrap {
    min-width: 0;
}

.employee-card-panorama .desktop-check {
    justify-content: flex-start;
}

.employee-card-panorama .desktop-card-header {
    min-width: 0;
    padding: 14px 20px;
}

.employee-card-panorama .desktop-list-actions {
    flex-wrap: nowrap;
    min-width: max-content;
}

.employee-tabs {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    padding: 10px 26px 0;
    border-top: 1px solid #c7d5e4;
    background: #eaf4fc;
}

.employee-tabs button {
    min-width: 170px;
    min-height: 36px;
    padding: 7px 16px;
    border: 1px solid #9fb4cf;
    border-bottom: 0;
    background: #edf4fb;
    color: #07162d;
    font-weight: 800;
}

.employee-tabs button:nth-child(2) {
    min-width: 285px;
}

.employee-tabs button.active {
    background: #008b86;
    border-color: #008b86;
    color: #fff;
}

.employee-form-body-panorama.employee-schedule-tab-body {
    grid-template-columns: minmax(0, 1fr) 230px !important;
}

.employee-form-body-panorama.employee-schedule-tab-body .employee-form-main-panorama {
    gap: 14px !important;
}

.employee-documents-button.has-documents,
.activity-documents-button.has-documents {
    background: #ffd21f;
    border-color: #c99a00;
    color: #5a2800;
}

.employee-documents-button.has-documents:hover,
.employee-documents-button.has-documents:focus-visible,
.activity-documents-button.has-documents:hover,
.activity-documents-button.has-documents:focus-visible {
    background: #ffc400;
    border-color: #a97900;
    color: #3f1b00;
}

.employee-card-panorama .employee-photo-panel {
    width: 174px;
    min-width: 0;
}

.employee-card-panorama .employee-photo-box {
    min-height: 0;
    width: 100%;
}

.employee-card-panorama .employee-schedule-fieldset {
    padding-bottom: 12px;
}

.employee-card-panorama .employee-schedule-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 28px;
}

.employee-card-panorama .employee-schedule-grid label:not(.desktop-check) {
    grid-template-columns: 105px minmax(0, 1fr);
}

.employee-card-panorama .employee-schedule-grid input {
    min-height: 34px;
}

.employee-card-panorama .employee-holiday-check {
    grid-column: 1 / -1;
    justify-content: flex-start;
    min-height: 28px;
}

.employee-presence-modal {
    width: min(660px, calc(100vw - 32px));
    overflow: hidden;
}

.employee-presence-modal header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.employee-presence-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 150px;
    gap: 16px;
}

.employee-presence-form label {
    display: grid;
    gap: 6px;
    font-weight: 700;
    color: #10213d;
}

.employee-presence-form select,
.employee-presence-form input {
    min-height: 34px;
    border: 1px solid #9fb4d0;
    padding: 4px 8px;
}

.employee-presence-modal > main {
    padding: 18px 20px 16px;
}

.employee-presence-modal > footer {
    padding: 14px 20px;
}

.employee-presence-employee {
    grid-column: 1 / -1;
    border: 1px solid #c4d2e3;
    background: #f8fbff;
    padding: 10px 12px;
}

.employee-presence-employee span {
    display: block;
    font-weight: 700;
    color: #4b5f7d;
    margin-bottom: 4px;
}

@media (max-width: 1320px) {
    .employee-form-main.employee-form-main-panorama {
        grid-template-columns: 1fr !important;
    }

    .employee-card-panorama .desktop-form.employee-form-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    .desktop-card.employee-card-panorama {
        margin: 10px !important;
    }

    .employee-form-body.employee-form-body-panorama {
        grid-template-columns: 1fr !important;
        padding: 16px !important;
    }

    .employee-form-main.employee-form-main-panorama {
        grid-template-columns: 1fr !important;
    }

    .employee-card-panorama .employee-photo-panel {
        width: 230px;
        max-width: 100%;
    }
}

.client-file-button {
    position: relative;
    display: grid;
    place-items: center;
    text-align: center;
    overflow: hidden;
}

.client-hidden-file {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.access-card-print-page {
    min-height: calc(100vh - 40px);
    display: grid;
    place-items: start center;
    gap: 16px;
    padding: 22px;
    background: #eef3f8;
}

.access-card-toolbar {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.access-card-ticket {
    width: 53.33mm;
    height: 86.15mm;
    position: relative;
    box-sizing: border-box;
    overflow: hidden;
    background: #ffffff;
    border: 0.25mm solid #000000;
    color: #000000;
    font-family: Arial, sans-serif;
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.18);
}

.access-card-head {
    height: 13.5mm;
    display: grid;
    grid-template-columns: 15.5mm 1fr;
    align-items: center;
    border-bottom: 0.2mm solid #5a5a5a;
}

.access-card-logo {
    width: 12.5mm;
    height: 9.5mm;
    display: grid;
    place-items: center;
    margin-left: 2.5mm;
}

.access-card-logo img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.access-card-logo strong {
    font-size: 5.2pt;
}

.access-card-head h1 {
    margin: 0;
    padding-right: 3mm;
    color: navy;
    font-size: 5.2pt;
    font-weight: 700;
    line-height: 1.15;
}

.access-card-row {
    display: grid;
    grid-template-columns: 13.5mm 1fr;
    align-items: center;
    gap: 1mm;
    margin: 3.7mm 3.5mm 0;
}

.access-card-row span {
    font-size: 3.7pt;
}

.access-card-row strong {
    height: 7.5mm;
    display: flex;
    align-items: center;
    min-width: 0;
    padding: 0 1mm;
    overflow: hidden;
    border: 0.25mm solid #6e6e6e;
    font-size: 4.6pt;
    font-weight: 700;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.access-card-row:nth-of-type(2) strong {
    font-size: 3.8pt;
}

.access-card-qr {
    width: 24mm;
    height: 24mm;
    margin: 5.3mm auto 0;
    border: 0.2mm solid #000000;
}

.access-card-qr svg {
    display: block;
    width: 100%;
    height: 100%;
}

.access-card-legal {
    position: absolute;
    left: 5mm;
    right: 5mm;
    bottom: 2mm;
    margin: 0;
    font-size: 2.6pt;
    line-height: 1.18;
}

@media print {
    @page {
        size: 53.33mm 86.15mm;
        margin: 0;
    }

    body {
        background: #ffffff !important;
    }

    .no-print,
    .sidebar,
    .top-row {
        display: none !important;
    }

    .access-card-print-page {
        min-height: auto;
        display: block;
        padding: 0;
        background: #ffffff;
    }

    .access-card-ticket {
        box-shadow: none;
        page-break-inside: avoid;
    }
}

.photo-capture-dialog {
    width: min(980px, 100%);
    border: 1px solid #8fa0b4;
    border-radius: 4px;
    background: #f8fafc;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.28);
}

.photo-capture-header {
    min-height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 16px;
    border-bottom: 1px solid #d4dce7;
    background: #edf3f9;
}

.photo-capture-header h2 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 800;
}

.photo-capture-body {
    display: grid;
    grid-template-columns: minmax(280px, 360px) minmax(360px, 1fr);
    gap: 16px;
    padding: 16px;
}

.photo-camera-panel,
.photo-crop-panel {
    display: grid;
    align-content: start;
    gap: 10px;
}

.photo-camera-panel video {
    width: 100%;
    aspect-ratio: 4 / 3;
    border: 1px solid #aeb7c2;
    background: #111827;
}

.photo-crop-panel canvas {
    width: 100%;
    height: auto;
    border: 1px solid #aeb7c2;
    background: #fff;
    touch-action: none;
}

.photo-crop-hint {
    color: #475569;
    font-size: 0.86rem;
}

.documents-window {
    min-height: calc(100vh - 124px);
    border: 1px solid #b7c1ce;
    background: #f1f5f9;
}

.documents-header {
    min-height: 112px;
    display: grid;
    grid-template-columns: minmax(280px, 1fr) auto;
    gap: 14px;
    align-items: center;
    padding: 14px 22px;
    border-bottom: 1px solid #e2e8f0;
    background: #fff;
}

.documents-header h2 {
    margin: 0;
    font-size: 1.55rem;
    font-weight: 800;
}

.documents-header span {
    color: #64748b;
}

.documents-open-link {
    display: grid;
    place-items: center;
    min-width: 128px;
    text-decoration: none;
}

.documents-open-link[aria-disabled="True"],
.documents-open-link[aria-disabled="true"] {
    opacity: 0.55;
    pointer-events: none;
}

.documents-content {
    display: grid;
    grid-template-columns: minmax(560px, 1fr) minmax(360px, 46%);
    gap: 18px;
    padding: 20px;
}

.documents-list-panel,
.documents-preview-panel {
    min-height: 600px;
    background: #fff;
}

.documents-list-panel h3,
.documents-preview-panel h3 {
    height: 42px;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    padding: 0 12px;
    color: #1e293b;
    font-size: 0.98rem;
    font-weight: 800;
}

.documents-preview-title span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.documents-email-button {
    flex: 0 0 auto;
    min-width: 104px;
}

.documents-grid-wrap {
    max-height: calc(100vh - 255px);
}

.documents-grid {
    table-layout: fixed;
    width: 100%;
}

.documents-grid th:nth-child(1),
.documents-grid td:nth-child(1) {
    width: 64px;
}

.documents-grid th:nth-child(2),
.documents-grid td:nth-child(2) {
    width: 58px;
    text-align: center;
}

.documents-grid th:nth-child(3),
.documents-grid td:nth-child(3) {
    width: 98px;
}

.documents-grid th:nth-child(4),
.documents-grid td:nth-child(4) {
    width: 170px;
}

.documents-grid th:nth-child(5),
.documents-grid td:nth-child(5) {
    width: auto;
}

.documents-grid td {
    vertical-align: top;
}

.documents-grid input,
.documents-grid textarea {
    width: 100%;
    min-height: 25px;
    border: 1px solid #aeb7c2;
    background: #fff;
    font: inherit;
}

.documents-grid textarea {
    resize: vertical;
}

.documents-notes-cell textarea {
    min-height: 58px;
}

.documents-order {
    max-width: 68px;
}

.documents-date {
    min-width: 130px;
}

.documents-preview-panel {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
}

.documents-preview-panel iframe,
.documents-preview-panel img,
.documents-empty-preview {
    width: 100%;
    height: 100%;
    min-height: 540px;
    border: 0;
    border-top: 1px solid #e2e8f0;
    background: #fff;
}

.documents-preview-panel img {
    object-fit: contain;
    padding: 14px;
}

.documents-empty-preview {
    display: grid;
    place-items: center;
    color: #64748b;
}

.client-observations {
    width: min(980px, 100%);
    min-height: 360px;
    padding: 12px;
    font-size: 1.05rem;
}

.client-history-grid-wrap {
    min-height: 360px;
    background: #f8fbff;
}

.client-history-grid {
    min-width: 760px;
}

.client-history-grid th,
.client-history-grid td {
    height: 36px;
    vertical-align: middle;
}

.client-history-grid tbody tr:not(:has(.empty-grid-cell)) {
    cursor: pointer;
}

.client-history-grid tbody tr:not(:has(.empty-grid-cell)):hover {
    background: #d7eaff;
}

.client-vehicles-panel {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.client-vehicles-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
}

.client-vehicles-grid {
    min-width: 1180px;
}

.desktop-grid td.client-vehicle-actions {
    width: 148px;
    min-width: 148px;
}

.client-vehicle-actions .row-icon-button img {
    width: 18px;
    height: 18px;
    object-fit: contain;
}

.row-icon-button.order,
.row-icon-button.invoice {
    color: #0f4d87;
}

.row-icon-button:disabled {
    opacity: .45;
    cursor: not-allowed;
}

.desktop-grid tbody tr.client-history-unpaid:not(.selected) {
    background: #f9d8dc;
}

.desktop-grid tbody tr.client-history-unpaid:not(.selected):hover {
    background: #f3bdc5;
}

.empty-grid-cell {
    text-align: center;
    color: #53657f;
    padding: 22px 10px;
}

.block-user {
    margin-left: 150px;
}

.gym-activities-header,
.gym-turns-header {
    min-height: 112px;
    grid-template-columns: minmax(260px, 1fr) auto;
}

.gym-activities-actions,
.gym-turns-actions {
    justify-content: flex-end;
}

.gym-activities-search,
.gym-turns-search {
    grid-column: 1 / -1;
}

.gym-turns-tabs {
    grid-column: 1 / -1;
    margin-top: 2px;
}

.gym-activities-grid th,
.activity-turns-list-grid th,
.turns-master-grid th {
    white-space: nowrap;
}

.gym-activities-grid td,
.activity-turns-list-grid td,
.turns-master-grid td {
    vertical-align: middle;
}

.turns-master-grid {
    table-layout: fixed;
    width: auto;
    min-width: 0;
}

.turns-master-grid th,
.turns-master-grid td {
    padding: 5px 5px;
    overflow: hidden;
}

.turns-master-grid .turn-col-photo {
    width: 38px;
}

.turns-master-grid .turn-col-clients {
    width: 36px;
}

.turns-master-grid .turn-col-id {
    width: 112px;
}

.turns-master-grid .turn-col-activity {
    width: 116px;
}

.turns-master-grid .turn-col-teacher {
    width: 122px;
}

.turns-master-grid .turn-col-time {
    width: 58px;
}

.turns-master-grid .turn-col-number {
    width: 48px;
}

.turns-master-grid .turn-col-count {
    width: 44px;
}

.turns-master-grid .turn-col-check {
    width: 38px;
}

.turns-master-grid th:nth-child(2),
.turns-master-grid td:nth-child(2),
.turns-master-grid th:nth-child(n+8),
.turns-master-grid td:nth-child(n+8) {
    text-align: center;
}

.turns-master-grid input,
.turns-master-grid select {
    width: 100%;
    min-width: 0;
    min-height: 27px;
    border: 1px solid #9fb1c5;
    background: #eef3f9;
    font: inherit;
    box-sizing: border-box;
    padding: 2px 4px;
}

.turns-master-grid td:nth-child(8) input {
    padding-right: 2px;
}

.turns-master-grid td:nth-child(6) input,
.turns-master-grid td:nth-child(7) input {
    text-align: center;
}

.turns-master-grid td:nth-child(8) input {
    text-align: right;
}

.turns-master-grid input[type="checkbox"] {
    width: 18px;
    min-height: 18px;
}

.turn-photo-cell {
    width: 38px;
    height: 78px;
    text-align: center;
}

.turn-photo-cell img {
    max-width: 42px;
    max-height: 48px;
    object-fit: contain;
}

.turn-clients-cell {
    text-align: center;
}

.turn-clients-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    min-height: 28px;
    border: 1px solid #b8c5d6;
    border-radius: 6px;
    background: #edf2f8;
    color: #526177;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}

.turn-clients-button img {
    width: 18px;
    height: 18px;
    object-fit: contain;
    filter: grayscale(1) opacity(.62);
}

.turn-clients-button.has-active-clients {
    border-color: #d97706;
    background: #fef3c7;
    color: #92400e;
    box-shadow: 0 0 0 2px rgba(245, 158, 11, .22), 0 0 10px rgba(245, 158, 11, .62);
}

.turn-clients-button.has-active-clients img {
    filter: saturate(1.35) brightness(1.12) drop-shadow(0 0 4px rgba(245, 158, 11, .85));
}

.turn-filter-chip {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 0 10px;
    border: 1px solid #8db9dc;
    border-radius: 6px;
    background: #e0f2fe;
    color: #075985;
    font-weight: 800;
}

.turn-filter-clear {
    width: 28px;
    min-height: 26px;
    border: 1px solid #8db9dc;
    border-radius: 6px;
    background: #f8fbff;
    color: #075985;
    font-weight: 900;
    cursor: pointer;
}

.turn-status-filter {
    display: inline-flex;
    align-items: center;
    gap: 0;
    min-height: 28px;
    border: 1px solid #9fb1c5;
    background: #f8fbff;
}

.turn-status-filter button {
    min-width: 72px;
    min-height: 26px;
    border: 0;
    border-right: 1px solid #c6d2e0;
    background: transparent;
    color: #24344d;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}

.turn-status-filter button:last-child {
    border-right: 0;
}

.turn-status-filter button.active {
    background: #07867d;
    color: #fff;
}

.monitor-month-dialog {
    width: 420px;
    max-width: calc(100vw - 32px);
}

.monitor-month-body {
    display: grid;
    gap: 12px;
    padding: 16px;
}

.monitor-month-body label {
    display: grid;
    gap: 6px;
    color: #24344d;
    font-weight: 800;
}

.monitor-month-body select,
.monitor-month-body input {
    min-height: 34px;
    border: 1px solid #8aa6c2;
    border-radius: 4px;
    padding: 6px 8px;
    background: #f8fbff;
    color: #102033;
    font: inherit;
}

.monitor-month-body p {
    margin: 0;
    color: #32435b;
}

.monitor-roster-backdrop {
    padding: 12px;
}

.monitor-roster-dialog {
    width: calc(100vw - 24px);
    height: calc(100vh - 24px);
    max-width: none;
    max-height: none;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.monitor-roster-dialog .app-dialog-header p {
    margin: 2px 0 0;
    color: #3b516b;
    font-weight: 800;
}

.monitor-roster-tools {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border-bottom: 1px solid #c6d2e0;
    background: #eef5fb;
}

.monitor-roster-tools label {
    display: grid;
    gap: 4px;
    color: #24344d;
    font-weight: 800;
}

.monitor-roster-tools input {
    width: 320px;
    min-height: 32px;
    border: 1px solid #8aa6c2;
    border-radius: 4px;
    padding: 5px 8px;
    background: #fff;
    color: #102033;
    font: inherit;
}

.monitor-roster-grid-wrap {
    flex: 1;
    overflow: auto;
    background: #fff;
}

.monitor-roster-edit-grid {
    width: 100%;
    min-width: 1180px;
    border-collapse: collapse;
    table-layout: fixed;
    font-size: 11px;
}

.monitor-roster-edit-grid th,
.monitor-roster-edit-grid td {
    border: 1px solid #9ca9ba;
    padding: 0;
    height: 24px;
    overflow: hidden;
}

.monitor-roster-edit-grid th {
    background: #dbeafe;
    color: #111827;
    font-weight: 900;
    text-align: center;
}

.monitor-roster-edit-grid td:first-child {
    padding: 2px 4px;
    font-weight: 700;
}

.monitor-roster-edit-grid td:nth-child(2) {
    padding: 2px 4px;
    font-weight: 700;
}

.monitor-roster-edit-grid tbody tr:nth-child(odd) td {
    background: #fff;
}

.monitor-roster-edit-grid tbody tr:nth-child(even) td {
    background: #f3f6fa;
}

.monitor-roster-edit-grid .monitor-roster-code {
    width: 78px;
}

.monitor-roster-edit-grid .monitor-roster-name {
    width: 300px;
    text-align: left;
}

.monitor-roster-edit-grid .monitor-roster-follow {
    width: 34px;
}

.monitor-roster-edit-grid .monitor-roster-day {
    width: 28px;
}

.monitor-roster-edit-grid th.monitor-day-friday,
.monitor-roster-edit-grid td.monitor-day-friday {
    background: #dcfce7;
    color: #14532d;
}

.monitor-roster-edit-grid th.monitor-day-saturday,
.monitor-roster-edit-grid td.monitor-day-saturday {
    background: #fef9c3;
    color: #78350f;
}

.monitor-roster-edit-grid th.monitor-day-sunday,
.monitor-roster-edit-grid td.monitor-day-sunday {
    background: #fee2e2;
    color: #7f1d1d;
}

.monitor-roster-edit-grid tbody tr:nth-child(even) td.monitor-day-friday {
    background: #c7f2d8;
}

.monitor-roster-edit-grid tbody tr:nth-child(even) td.monitor-day-saturday {
    background: #fdf0a8;
}

.monitor-roster-edit-grid tbody tr:nth-child(even) td.monitor-day-sunday {
    background: #ffd1d1;
}

.monitor-follow-cell {
    text-align: center;
}

.monitor-follow-button {
    display: inline-grid;
    place-items: center;
    width: 28px;
    height: 22px;
    border: 1px solid #93b6d3;
    border-radius: 4px;
    background: #eef7ff;
    cursor: pointer;
}

.monitor-follow-button img {
    max-width: 19px;
    max-height: 19px;
    object-fit: contain;
}

.monitor-attendance-cell {
    position: relative;
    display: grid;
    place-items: center;
    width: 100%;
    height: 24px;
    border: 0;
    background: transparent;
    color: #111827;
    cursor: pointer;
}

.monitor-attendance-cell .monitor-roster-cell-day {
    color: #6b7280;
    font-size: 9px;
    font-weight: 800;
    line-height: 1;
    opacity: .7;
}

.monitor-attendance-cell .monitor-roster-cell-mark {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: #dc2626;
    font-size: 17px;
    font-weight: 900;
    line-height: 1;
    text-shadow: 0 0 0 #dc2626;
}

.monitor-attendance-cell.marked .monitor-roster-cell-day {
    transform: translateY(-6px);
    opacity: .55;
}

.expired-turn-row {
    background: #fee2e2;
}

.desktop-grid tbody tr.free-turn-row,
.desktop-grid tbody tr.free-turn-row:hover,
.desktop-grid tbody tr.free-turn-row.selected {
    background: #dcfce7;
    color: #0f172a;
}

.desktop-grid tbody tr.full-turn-row,
.desktop-grid tbody tr.full-turn-row:hover,
.desktop-grid tbody tr.full-turn-row.selected {
    background: #dcfce7;
    color: #0f172a;
}

.desktop-grid tbody tr.discontinued-turn-row,
.desktop-grid tbody tr.discontinued-turn-row:hover,
.desktop-grid tbody tr.discontinued-turn-row.selected {
    background: #e5e7eb;
    color: #374151;
}

.desktop-grid tbody tr.free-turn-row td,
.desktop-grid tbody tr.full-turn-row td,
.desktop-grid tbody tr.discontinued-turn-row td,
.desktop-grid tbody tr.free-turn-row.selected td,
.desktop-grid tbody tr.full-turn-row.selected td,
.desktop-grid tbody tr.discontinued-turn-row.selected td {
    color: inherit;
}

.desktop-grid tbody tr.free-turn-row input,
.desktop-grid tbody tr.free-turn-row select,
.desktop-grid tbody tr.full-turn-row input,
.desktop-grid tbody tr.full-turn-row select,
.desktop-grid tbody tr.discontinued-turn-row input,
.desktop-grid tbody tr.discontinued-turn-row select {
    background: rgba(255, 255, 255, .68);
    border-color: rgba(100, 116, 139, .55);
    color: #0f172a;
}

.desktop-grid tbody tr.free-turn-row input[type="checkbox"],
.desktop-grid tbody tr.full-turn-row input[type="checkbox"],
.desktop-grid tbody tr.discontinued-turn-row input[type="checkbox"] {
    accent-color: #2563eb;
}

.desktop-grid tbody tr.free-turn-row select option,
.desktop-grid tbody tr.full-turn-row select option,
.desktop-grid tbody tr.discontinued-turn-row select option {
    color: #0f172a;
}

.gym-activities-grid .pending-cell {
    color: #1d4ed8;
    font-weight: 700;
}

.gym-activities-grid .money,
.activity-turns-list-grid .money {
    text-align: right;
}

.gym-activities-grid .selected-row,
.activity-turns-list-grid .selected-row,
.turns-master-grid .selected-row {
    outline: 2px solid #2563eb;
    outline-offset: -2px;
}

.aux-window {
    min-height: calc(100vh - 132px);
}

.aux-header {
    min-height: 116px;
    grid-template-columns: minmax(260px, 1fr) auto;
}

.aux-header.tall {
    min-height: 156px;
}

.aux-header .desktop-list-actions {
    justify-content: flex-end;
}

.aux-header .desktop-search {
    grid-column: 1 / -1;
}

.aux-search-two {
    display: grid;
    grid-template-columns: repeat(10, auto);
    gap: 8px 10px;
    align-items: center;
}

.aux-search-two input,
.aux-search-two select,
.desktop-search input,
.desktop-search select {
    min-height: 28px;
}

.aux-grid th {
    white-space: nowrap;
}

.aux-grid td {
    vertical-align: middle;
}

.aux-grid .grid-input {
    width: 100%;
    min-height: 28px;
    border: 1px solid #9fb1c5;
    background: #eef3f9;
    font: inherit;
}

.aux-grid .grid-input.short {
    max-width: 110px;
}

.aux-grid .grid-input.date {
    min-width: 136px;
}

.aux-grid .grid-input.number,
.aux-grid .money {
    text-align: right;
}

.aux-grid textarea.grid-input {
    min-width: 320px;
    min-height: 44px;
    resize: vertical;
}

.aux-grid .center {
    text-align: center;
}

.aux-grid .selected-row {
    outline: 2px solid #2563eb;
    outline-offset: -2px;
}

.access-denied-row {
    background: #fee2e2;
}

.cobrar-mini {
    min-width: 68px;
    min-height: 28px;
    padding: 3px 8px;
    color: #111827;
    background: #c6b800;
    border-color: #8b8000;
}

.aux-dialog-backdrop {
    padding: 14px !important;
}

.app-dialog.aux-dialog {
    width: min(1500px, calc(100vw - 28px)) !important;
    height: calc(100vh - 28px);
    max-height: calc(100vh - 28px) !important;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.app-dialog.aux-dialog .app-dialog-header {
    flex: 0 0 auto;
}

.app-dialog.aux-dialog .aux-grid-wrap {
    flex: 1 1 auto;
    max-height: none !important;
    min-height: 0;
    overflow: auto;
    padding: 10px;
}

.app-dialog.aux-dialog .aux-grid {
    width: 100%;
    min-width: 980px;
}

.app-dialog.aux-dialog .aux-grid input {
    min-width: 150px;
    height: 30px;
}

.app-dialog.aux-dialog .aux-row-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.app-dialog.aux-dialog .aux-row-actions .app-btn {
    min-width: 74px;
}

.app-dialog.aux-dialog .aux-delete-btn {
    border-color: #b91c1c;
    background: #e51f27;
    color: #fff;
}

.app-dialog.aux-dialog .aux-stat-btn {
    min-width: 38px;
    width: 38px;
    padding: 4px;
    border-color: #0f766e;
    background: #e0f2fe;
}

.app-dialog.aux-dialog .aux-stat-btn img {
    display: block;
    width: 24px;
    height: 24px;
    margin: 0 auto;
    object-fit: contain;
}

.aux-stats-dialog {
    width: calc(100vw - 18px);
    height: calc(100vh - 18px);
    max-width: none;
    max-height: none;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.aux-stats-body {
    min-height: 0;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px;
}

.aux-stats-toolbar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
}

.aux-stats-toolbar label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 800;
}

.aux-stats-toolbar select {
    height: 31px;
    border: 1px solid var(--fg-border);
}

.aux-stats-content {
    min-height: 0;
    flex: 1 1 auto;
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(430px, 1fr);
    gap: 12px;
}

.aux-stats-table-wrap {
    min-height: 0;
    max-height: 235px;
    overflow: auto;
}

.aux-stats-table {
    width: 100%;
    min-width: 1180px;
}

.aux-stats-table th {
    cursor: pointer;
    user-select: none;
}

.aux-stats-table tbody tr {
    cursor: pointer;
}

.aux-stats-table .total-row td {
    background: #e0f2fe;
    font-weight: 900;
}

.aux-stats-table .selected-row td,
.aux-stats-table .selected-column {
    background: #bfdbfe !important;
}

.aux-stats-chart {
    min-height: 0;
    padding: 12px;
    border: 1px solid var(--fg-border);
    background: #fff;
    overflow: auto;
}

.aux-stats-chart h3 {
    margin: 0 0 10px;
    color: #003b79;
}

.aux-bar-chart {
    height: min(520px, calc(100vh - 430px));
    min-height: 360px;
    display: flex;
    align-items: end;
    gap: 9px;
    padding: 12px 4px 30px;
    border-bottom: 1px solid #94a3b8;
}

.aux-bar-chart > div {
    min-width: 34px;
    flex: 1 1 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: end;
    align-items: center;
    gap: 5px;
    font-size: .75rem;
}

.aux-bar-chart i {
    display: block;
    width: 70%;
    min-height: 4px;
    border-radius: 4px 4px 0 0;
}

.aux-bar-chart span {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    white-space: nowrap;
}

.aux-bar-chart b {
    font-size: .7rem;
    color: #0f172a;
}

.aux-stats-empty {
    padding: 24px;
    color: #475569;
}

.app-dialog.aux-dialog-formas-pago .aux-grid {
    width: max-content;
    min-width: 100%;
    table-layout: fixed;
}

.app-dialog.aux-dialog-formas-pago .aux-grid th,
.app-dialog.aux-dialog-formas-pago .aux-grid td {
    padding: 6px 10px;
}

.app-dialog.aux-dialog-formas-pago .aux-grid input {
    min-width: 0;
}

.app-dialog.aux-dialog-formas-pago .aux-grid td:nth-child(2) input {
    min-width: 500px;
}

.app-dialog.aux-dialog-formas-pago .aux-row-actions {
    min-width: 180px;
    justify-content: flex-start;
}

.app-dialog.aux-dialog-formas-pago .aux-new-row .aux-row-actions {
    align-items: center;
}

.app-dialog.aux-dialog-formas-pago .aux-new-row .aux-row-actions .app-btn {
    min-width: 86px;
}

.workouts-window {
    min-height: calc(100vh - 132px);
    background: linear-gradient(135deg, #fff7ed 0%, #eef9ff 44%, #f5f3ff 100%);
}

.workouts-main-header,
.workouts-header {
    min-height: 104px;
    grid-template-columns: minmax(330px, 390px) minmax(0, 1fr) max-content;
    gap: 12px;
    align-items: center;
}

.workouts-main-header {
    min-height: 90px;
    padding: 12px 20px;
    background: rgba(248, 251, 255, .78);
}

.workouts-actions {
    justify-content: flex-end;
}

.workouts-search {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    gap: 8px 10px;
    align-items: center;
}

.workouts-search input {
    min-width: min(360px, 100%);
}

.workouts-search select {
    min-height: 28px;
    min-width: 190px;
    max-width: 320px;
}

.workouts-dashboard {
    display: grid;
    grid-template-columns: repeat(3, 220px);
    grid-auto-rows: 220px;
    justify-content: center;
    align-content: center;
    gap: 76px 64px;
    flex: 1 1 auto;
    min-height: 0;
    padding: 58px 24px 80px;
    background: radial-gradient(circle at 20% 12%, rgba(255, 255, 255, .76), transparent 30%),
        radial-gradient(circle at 80% 80%, rgba(255, 255, 255, .60), transparent 34%),
        rgba(255, 255, 255, .24);
}

.workout-tile {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 220px;
    height: 220px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    text-decoration: none;
    cursor: pointer;
    transition: transform .14s ease, filter .14s ease;
}

.workout-tile:hover,
.workout-tile:focus-visible {
    transform: translateY(-3px) scale(1.02);
    filter: drop-shadow(0 8px 14px rgba(15, 23, 42, .22));
    outline: none;
}

.workout-tile img {
    width: 200px;
    height: 200px;
    object-fit: contain;
}

.workouts-aux {
    display: grid;
    grid-template-columns: repeat(6, minmax(118px, 1fr));
    gap: 8px;
    padding: 0;
    max-width: none;
    align-items: center;
}

.workouts-aux .app-btn {
    width: 100%;
    min-width: 0;
    min-height: 31px;
    padding: 5px 8px;
    justify-content: center;
    text-align: center;
    text-decoration: none;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.15;
    white-space: normal;
}

.workout-aux-button {
    border-color: transparent;
    border-radius: 4px;
    box-shadow: none;
}

.workouts-main-header .app-btn {
    font-weight: 500;
}

.workouts-close-actions {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    min-width: 124px;
}

.workouts-close-actions .app-btn-close {
    width: 76px;
    min-width: 76px;
    min-height: 31px;
    padding: 5px 10px;
}

.workouts-close-actions .app-btn-help {
    width: 38px;
    min-width: 38px;
    min-height: 31px;
    padding: 5px 0;
}

.workout-screen-title {
    gap: 12px;
}

.workout-screen-title img {
    width: 58px;
    height: 58px;
    object-fit: contain;
}

.app-modal .workout-screen-title img {
    width: 48px;
    height: 48px;
}

@media (max-width: 1320px) {
    .workouts-main-header,
    .workouts-header {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .workouts-aux {
        grid-template-columns: repeat(3, minmax(145px, 1fr));
    }

    .workouts-close-actions {
        justify-content: flex-end;
    }
}

@media (max-width: 980px) {
    .workouts-dashboard {
        grid-template-columns: repeat(2, 200px);
        grid-auto-rows: 200px;
        gap: 34px;
    }

    .workout-tile,
    .workout-tile img {
        width: 190px;
        height: 190px;
    }
}

.workout-aux-button.aux-blue {
    background: #38bdf8;
    color: #062033;
}

.workout-aux-button.aux-green {
    background: #22c55e;
    color: #052e16;
}

.workout-aux-button.aux-orange {
    background: #f97316;
    color: #fff7ed;
}

.workout-aux-button.aux-purple {
    background: #7c3aed;
    color: #fff;
}

.workout-aux-button.aux-teal {
    background: #0d9488;
    color: #ecfeff;
}

.workout-aux-button.aux-red {
    background: #ef2335;
    color: #fff;
}

.workouts-grid th {
    white-space: nowrap;
}

.workouts-grid td {
    vertical-align: top;
}

.workouts-grid .wrap-cell {
    max-width: 360px;
    white-space: normal;
}

.workouts-grid .workout-thumb-cell {
    width: 86px;
    min-width: 86px;
    text-align: center;
    vertical-align: middle;
}

.workout-grid-thumb {
    display: block;
    width: 64px;
    height: 48px;
    margin: 0 auto;
    object-fit: contain;
    border: 1px solid #b6c7da;
    border-radius: 4px;
    background: #fff;
}

.workout-grid-no-thumb {
    display: inline-grid;
    place-items: center;
    width: 64px;
    height: 48px;
    color: #64748b;
    font-size: 11px;
    border: 1px dashed #b6c7da;
    border-radius: 4px;
    background: #f8fafc;
}

.workouts-ficha {
    width: min(1320px, calc(100vw - 28px));
    max-height: calc(100vh - 40px);
    overflow: auto;
}

.workouts-ficha header,
.workouts-ficha footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px;
    border-bottom: 1px solid #cbd5e1;
}

.workouts-ficha footer {
    justify-content: flex-end;
    border-top: 1px solid #cbd5e1;
    border-bottom: 0;
}

.workout-ficha-body {
    display: block;
}

.workout-ficha-body.with-picture {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 230px;
    align-items: start;
    gap: 18px;
    padding-right: 18px;
}

.workout-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(280px, 1fr));
    gap: 12px 28px;
    padding: 18px;
}

.workout-ficha-body.with-picture .workout-form-grid {
    padding-right: 0;
}

.workout-ficha-body.deportista-body .workout-form-grid {
    grid-template-columns: 150px minmax(420px, 1fr) 130px 160px;
    gap: 12px 10px;
    padding: 18px;
    padding-right: 0;
}

.workout-ficha-body.deportista-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 170px;
    align-items: start;
    gap: 18px;
    padding-right: 18px;
}

.workout-form-grid label {
    display: grid;
    grid-template-columns: 150px minmax(180px, 1fr);
    gap: 10px;
    align-items: start;
}

.workout-ficha-body.deportista-body .workout-form-grid label {
    display: grid;
    gap: 10px;
    align-items: start;
}

.workout-ficha-body.deportista-body .deportista-code {
    grid-column: 1 / 3;
    grid-template-columns: 150px minmax(0, 1fr);
}

.workout-ficha-body.deportista-body .deportista-date {
    grid-column: 3 / 5;
    grid-template-columns: 130px 160px;
}

.workout-ficha-body.deportista-body .wide {
    grid-column: 1 / -1;
    grid-template-columns: 150px minmax(0, 1fr);
}

.workout-ficha-body.deportista-body .grid-input,
.workout-ficha-body.deportista-body textarea {
    width: 100%;
}

.workout-ficha-body.deportista-body textarea.grid-input {
    min-height: 72px;
}

.workout-ficha-body.deportista-body .workout-search-combo {
    width: 100%;
}

.workout-deportista-photo-panel {
    display: grid;
    gap: 8px;
    margin-top: 18px;
}

.workout-deportista-photo-title {
    color: #001a3d;
    font-weight: 700;
    text-align: center;
}

.workout-deportista-photo-frame {
    display: grid;
    place-items: center;
    width: 170px;
    height: 170px;
    border: 1px solid #b6c7da;
    border-radius: 4px;
    background: #fff;
    overflow: hidden;
    color: #64748b;
    font-size: 12px;
}

.workout-deportista-photo-frame.missing::after {
    content: "Sin foto";
}

.workout-deportista-photo-frame img {
    max-width: 150px;
    max-height: 145px;
    object-fit: contain;
}

.workout-deportista-photo-frame span {
    margin-top: -22px;
}

.workout-client-file-button {
    width: 170px;
    justify-content: center;
    background: #0d9488;
    color: #ecfeff;
}

.workout-search-combo {
    position: relative;
    min-width: 0;
}

.workout-search-combo-options {
    position: absolute;
    z-index: 40;
    top: calc(100% + 2px);
    left: 0;
    right: 0;
    max-height: 320px;
    overflow: auto;
    border: 1px solid #8ea9c5;
    background: #fff;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.18);
}

.workout-search-combo-options button {
    display: block;
    width: 100%;
    padding: 7px 9px;
    border: 0;
    border-bottom: 1px solid #e2e8f0;
    background: #fff;
    color: #001a3d;
    text-align: left;
    font: inherit;
    cursor: pointer;
}

.workout-search-combo-options button:hover,
.workout-search-combo-options button:focus {
    background: #2563eb;
    color: #fff;
}

.workout-form-grid label.wide {
    grid-column: 1 / -1;
}

.workout-form-grid textarea {
    min-height: 72px;
    resize: vertical;
}

.workout-picture-panel {
    display: grid;
    gap: 10px;
    margin-top: 18px;
}

.workout-picture-frame {
    display: grid;
    place-items: center;
    width: 230px;
    height: 190px;
    border: 1px solid #b6c7da;
    border-radius: 4px;
    background: #fff;
    overflow: hidden;
}

.workout-picture-frame img {
    max-width: 210px;
    max-height: 170px;
    object-fit: contain;
}

.workout-picture-actions {
    justify-content: center;
    margin-top: 0;
}

.rutina-lines {
    padding: 0 18px 18px;
}

.rutina-lines-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.routine-photo {
    width: 96px;
    text-align: center;
}

.routine-photo img {
    width: 84px;
    height: 62px;
    object-fit: contain;
}

.visual-workouts {
    flex: 1 1 auto;
    min-height: 0;
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 16px;
    padding: 18px;
    overflow: hidden;
}

.visual-groups {
    display: grid;
    grid-auto-rows: max-content;
    align-content: start;
    gap: 8px;
    min-height: 0;
    overflow-y: auto;
    padding-right: 4px;
}

.visual-group {
    display: grid;
    gap: 8px;
    padding: 8px 10px;
    border: 1px solid #b6c7da;
    border-radius: 4px;
    background: #f8fbff;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.visual-group.active,
.visual-group:hover {
    background: #dbeafe;
    border-color: #2563eb;
}

.visual-group img {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.visual-group-main {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 32px;
    padding: 0;
    border: 0;
    background: transparent;
    font: inherit;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
}

.visual-exercises {
    display: grid;
    grid-template-columns: repeat(auto-fill, 188px);
    grid-auto-rows: 300px;
    align-content: start;
    justify-content: start;
    gap: 12px;
    min-height: 0;
    overflow: auto;
    padding-right: 4px;
    padding-bottom: 10px;
}

.visual-exercise-card {
    display: grid;
    grid-template-rows: 130px 22px 46px auto;
    gap: 6px;
    width: 188px;
    height: 300px;
    min-height: 300px;
    padding: 10px;
    border: 1px solid #b6c7da;
    border-radius: 4px;
    background: #fff;
    overflow: hidden;
}

.visual-exercise-card img {
    width: 100%;
    height: 130px;
    object-fit: contain;
}

.visual-exercise-card span {
    color: #334155;
    overflow: hidden;
    line-height: 1.35;
}

.visual-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    align-items: center;
    margin-top: 4px;
}

.visual-mini-button {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 24px;
    padding: 4px 7px;
    border: 1px solid #94a3b8;
    border-radius: 3px;
    color: #071733;
    background: #eaf2fb;
    font-size: 11px;
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
    text-decoration: none;
    overflow: hidden;
}

.visual-mini-button.google {
    background: #fbbf24;
    border-color: #d97706;
    color: #7c2d12;
}

.visual-mini-button.file {
    background: #5db7df;
    border-color: #2580ad;
}

.visual-mini-button.paste {
    background: #16a34a;
    border-color: #15803d;
    color: #fff;
}

.visual-mini-button.delete {
    background: #ef2335;
    border-color: #b91c1c;
    color: #fff;
}

.visual-mini-button:hover,
.visual-mini-button:focus-visible {
    filter: brightness(0.94);
}

.desktop-panel {
    height: calc(100vh - 104px);
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    margin: 0;
    border: 1px solid #b7c8da;
    background: #f8fbff;
}

.panel-title-row {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 86px;
    padding: 14px 20px;
    border-bottom: 1px solid #c8d6e4;
}

.articulos-list-panel .panel-title-row,
.articulos-list-panel .filter-strip {
    position: relative;
    z-index: 40;
    background: #f8fbff;
    background-clip: padding-box;
}

.articulos-list-panel .panel-title-row {
    box-shadow: 0 1px 0 #c8d6e4;
}

.articulos-list-panel .filter-strip {
    box-shadow: 0 1px 0 #d4e0ec;
}

.articulos-list-panel .table-wrap {
    position: relative;
    z-index: 1;
    padding-top: 0;
    background: #f8fbff;
}

.toolbar.compact {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
}

.toolbar.compact .app-btn {
    min-width: 84px;
    min-height: 32px;
    padding: 6px 14px;
    white-space: nowrap;
}

.app-btn-purple {
    background: #7c3aed;
    border-color: #6d28d9;
    color: #fff;
}

.app-btn-orange {
    background: #f58220;
    border-color: #c86a17;
    color: #fff;
}

.filter-strip,
.summary-line,
.line-toolbar {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    padding: 10px 20px;
    border-bottom: 1px solid #d4e0ec;
}

.filter-strip label,
.line-toolbar {
    font-size: 14px;
}

.filter-strip input,
.filter-strip select,
.form-grid input,
.form-grid select,
.form-grid textarea,
.data-grid input {
    min-height: 28px;
    border: 1px solid #9fb1c5;
    background: #fff;
    padding: 3px 7px;
}

.filter-strip input {
    min-width: 280px;
}

.filter-strip .filter-client select {
    min-width: 320px;
}

.facturas-filter-strip {
    flex-wrap: nowrap;
    gap: 8px;
    overflow-x: auto;
}

.facturas-filter-strip .grid-filter-result-badge {
    margin-left: auto;
}

.facturas-filter-strip .facturas-aviso-filter {
    min-height: 30px;
    padding: 2px 7px;
    border: 1px solid #c7d7ea;
    background: #f8fbff;
    color: #072047;
    font-weight: 800;
    cursor: pointer;
    white-space: nowrap;
}

.facturas-filter-strip .facturas-aviso-filter input {
    min-width: 0;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.facturas-filter-strip label {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}

.facturas-filter-strip select {
    min-width: 150px;
}

.facturas-filter-strip label:first-child input {
    min-width: 240px;
    width: 240px;
}

.facturas-filter-strip label:nth-child(3) select {
    min-width: 210px;
    width: 250px;
}

.facturas-filter-strip label:nth-child(4) select {
    min-width: 210px;
    width: 290px;
}

.facturas-filter-strip .facturas-locate-filter input {
    min-width: 130px;
    width: 150px;
}

.filter-strip .list-client-filter {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-width: 560px;
}

.list-client-lookup {
    position: relative;
    flex: 1 1 auto;
    min-width: 360px;
}

.filter-strip .list-client-lookup input {
    width: 100%;
    min-width: 0;
}

.list-client-results {
    left: 0;
    right: 0;
    top: calc(100% + 2px);
    max-height: 360px;
    overflow: auto;
    z-index: 80;
}

.list-client-results button {
    grid-template-columns: 120px minmax(0, 1fr);
}

.check-inline {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.table-wrap {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    padding: 10px 14px 0;
    box-sizing: border-box;
}

.data-grid {
    width: 100%;
    min-width: 960px;
    border-collapse: collapse;
    background: #fff;
}

.desktop-panel > .factura-line-toolbar {
    margin-bottom: 0;
    padding: 8px 22px 10px;
    border-bottom: 1px solid #d4e0ec;
}

.data-grid th,
.data-grid td {
    border: 1px solid #cbd8e6;
    padding: 8px 10px;
    vertical-align: middle;
}

.data-grid th {
    position: sticky;
    top: 0;
    z-index: 5;
    background: #eaf1f8;
    color: #071733;
    font-weight: 800;
    text-align: left;
    cursor: pointer;
}

.albaranes-facturar-dialog {
    width: min(980px, calc(100vw - 36px));
    max-height: calc(100vh - 48px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.albaranes-facturar-dialog .app-dialog-header span {
    display: block;
    margin-top: 3px;
    color: #50627a;
    font-size: .88rem;
}

.facturar-albaranes-filters {
    display: grid;
    grid-template-columns: minmax(280px, 1fr) 150px 150px auto;
    gap: 12px;
    align-items: end;
    padding: 14px;
    border-bottom: 1px solid #d4e0ec;
}

.facturar-albaranes-filters label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: .78rem;
    color: #071733;
}

.facturar-albaranes-filters input,
.facturar-albaranes-filters select {
    min-height: 26px;
    border: 1px solid #aebfd2;
    background: #fff;
}

.facturar-albaranes-summary {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 10px 14px;
    border-bottom: 1px solid #d4e0ec;
}

.facturar-albaranes-summary span {
    color: #0057b8;
    font-weight: 800;
}

.facturar-albaranes-summary .toolbar {
    margin-left: auto;
}

.facturar-albaranes-grid {
    max-height: min(440px, calc(100vh - 270px));
    padding: 12px 14px 14px;
}

.facturar-selected-row {
    background: #eef8ff;
}

.stats-workspace {
    background: #f4f8fc;
}

.stats-title-row {
    min-height: 78px;
}

.stats-filter select {
    min-width: 170px;
}

.stats-filter input[type="date"] {
    min-width: 142px;
}

.stats-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    padding: 14px 18px 18px;
}

.stats-kpi-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(150px, 1fr));
    gap: 10px;
    margin-bottom: 12px;
}

.stats-kpi-grid article {
    border: 1px solid #c5d5e6;
    background: #fff;
    padding: 10px 12px;
    min-height: 78px;
}

.stats-kpi-grid span {
    display: block;
    color: #50647e;
    font-size: 13px;
}

.stats-kpi-grid strong {
    display: block;
    color: #005cb8;
    font-size: 24px;
    line-height: 1.2;
    text-align: right;
}

.stats-kpi-grid small {
    color: #6b7d93;
}

.stats-kpi-grid article.positive strong {
    color: #00843d;
}

.stats-kpi-grid article.negative strong {
    color: #d21f2b;
}

.stats-kpi-grid.mini {
    grid-template-columns: minmax(160px, 240px);
}

.stats-layout {
    display: grid;
    grid-template-columns: 1.35fr 1fr;
    gap: 12px;
    align-items: start;
}

.stats-split {
    flex: 1 1 auto;
    min-height: 0;
    display: grid;
    grid-template-columns: 1.4fr .85fr;
    gap: 12px;
    padding: 12px 18px 18px;
    overflow: auto;
}

.stats-card {
    min-width: 0;
    border: 1px solid #c5d5e6;
    background: #fff;
    padding: 10px;
}

.stats-card.wide {
    grid-column: 1 / -1;
}

.stats-card h2 {
    margin: 0 0 8px;
    color: #071733;
    font-size: 16px;
}

.stats-card .muted,
.stats-filter .muted {
    color: #51647d;
}

.stats-table-wrap {
    max-height: 330px;
    overflow: auto;
}

.stats-table {
    min-width: 520px;
}

.stats-table th,
.stats-table td {
    padding: 6px 8px;
}

.stats-table th {
    font-weight: 600;
}

.stats-table .right {
    text-align: right;
}

.bar-chart {
    height: 260px;
    display: flex;
    align-items: end;
    gap: 12px;
    padding: 16px 8px 26px;
    border: 1px solid #d5e1ed;
    background: linear-gradient(#fff, #f7fbff);
    overflow-x: auto;
}

.bar-chart > div {
    position: relative;
    flex: 0 0 44px;
    height: 100%;
    display: flex;
    align-items: end;
    justify-content: center;
    gap: 3px;
}

.bar-chart span {
    position: absolute;
    left: 50%;
    bottom: -22px;
    width: 90px;
    transform: translateX(-50%);
    color: #40556d;
    font-size: 11px;
    text-align: center;
}

.bar-chart i {
    display: block;
    width: 10px;
    min-height: 3px;
    border-radius: 2px 2px 0 0;
}

.bar-chart .income {
    background: #2563eb;
}

.bar-chart .expense {
    background: #dc2626;
}

.bar-chart .result {
    background: #16a34a;
}

.direct-chart > div {
    flex-basis: 34px;
}

.stats-user-filter {
    align-items: end;
}

.stats-user-filter label {
    display: grid;
    gap: 3px;
}

.stats-user-filter input,
.stats-user-filter select {
    min-width: 150px;
}

@media (max-width: 1300px) {
    .stats-kpi-grid {
        grid-template-columns: repeat(3, minmax(150px, 1fr));
    }

    .stats-layout,
    .stats-split {
        grid-template-columns: 1fr;
    }
}

.data-grid tbody tr:hover {
    background: #dbeafe;
    color: #061735;
}

.provider-grid th {
    font-weight: 400;
}

.proveedor-window .data-grid th,
.provider-grid th {
    font-weight: 400;
}

.data-grid .right {
    text-align: right;
}

.detalles-presupuestos-filters input {
    min-width: 260px;
}

.detalles-presupuestos-grid {
    min-width: 1480px;
}

.detalles-presupuestos-grid th:nth-child(1),
.detalles-presupuestos-grid td:nth-child(1) {
    width: 150px;
}

.detalles-presupuestos-grid th:nth-child(2),
.detalles-presupuestos-grid td:nth-child(2) {
    width: 100px;
}

.detalles-presupuestos-grid th:nth-child(3),
.detalles-presupuestos-grid td:nth-child(3) {
    width: 95px;
}

.detalles-presupuestos-grid th:nth-child(4),
.detalles-presupuestos-grid td:nth-child(4) {
    width: 260px;
}

.detalles-presupuestos-grid th:nth-child(5),
.detalles-presupuestos-grid td:nth-child(5) {
    width: 135px;
}

.detalles-presupuestos-grid th:nth-child(6),
.detalles-presupuestos-grid td:nth-child(6) {
    min-width: 520px;
}

.detalles-presupuestos-grid th:nth-child(7),
.detalles-presupuestos-grid td:nth-child(7),
.detalles-presupuestos-grid th:nth-child(8),
.detalles-presupuestos-grid td:nth-child(8) {
    width: 95px;
}

.print-only {
    display: none;
}

@media print {
    .detalles-presupuestos-panel {
        display: none !important;
    }

    .detalles-presupuestos-print {
        display: block;
        color: #000;
        background: #fff;
        font-family: Arial, sans-serif;
        font-size: 10px;
    }

    .detalles-presupuestos-print h1 {
        margin: 0 0 6px;
        font-size: 18px;
    }

    .detalles-presupuestos-print p {
        margin: 0 0 8px;
    }

    .detalles-presupuestos-print table {
        width: 100%;
        border-collapse: collapse;
    }

    .detalles-presupuestos-print th,
    .detalles-presupuestos-print td {
        border: 1px solid #333;
        padding: 4px 5px;
        vertical-align: top;
    }

    .detalles-presupuestos-print th {
        background: #e9edf2;
        text-align: left;
    }
}

.data-grid .w-actions {
    width: 96px;
}

.provider-table-wrap {
    padding-top: 0;
}

.row-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.row-actions button {
    min-width: 28px;
    min-height: 28px;
    border: 1px solid #8fa5bd;
    border-radius: 3px;
    background: #eef5fc;
    font-weight: 800;
}

.row-actions button.danger {
    border-color: #dc2626;
    color: #dc2626;
}

.row-danger {
    background: #fee2e2;
}

.row-warning {
    background: #fff4c2;
}

.epigrafes-grid th,
.epigrafes-grid td {
    white-space: nowrap;
}

.epigrafes-grid td:nth-child(3) {
    min-width: 280px;
}

.epigrafe-form-window {
    width: min(900px, calc(100vw - 70px));
    min-height: 650px;
    margin: 24px auto;
    border: 1px solid #c8d2df;
    background: #ededed;
    box-shadow: 0 18px 45px rgba(15, 23, 42, .16);
}

.epigrafe-form-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    min-height: 96px;
    padding: 24px 30px;
    border-bottom: 1px solid #d7dce3;
    background: #f7f8fa;
}

.epigrafe-form-title {
    gap: 14px;
}

.epigrafe-form-title img {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.epigrafe-form-title h1 {
    margin: 0;
    font-size: 24px;
    line-height: 1.1;
    letter-spacing: 0;
}

.epigrafe-form-actions {
    margin-left: auto;
    flex-wrap: nowrap;
}

.epigrafe-form-body {
    padding: 24px 30px 32px;
}

.epigrafe-main-grid {
    display: grid;
    grid-template-columns: 120px 500px 1fr;
    grid-template-areas:
        "code-label code-input ."
        "desc-label desc-input default-check";
    align-items: center;
    column-gap: 10px;
    row-gap: 16px;
    margin-bottom: 24px;
}

.epigrafe-main-grid > label:first-child {
    grid-area: code-label;
}

.epigrafe-code-input {
    grid-area: code-input;
    width: 120px;
}

.epigrafe-main-grid > label[for="epigrafe-descripcion"] {
    grid-area: desc-label;
}

.epigrafe-description-input {
    grid-area: desc-input;
    width: 500px;
}

.epigrafe-default-check {
    grid-area: default-check;
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 30px;
    white-space: nowrap;
}

.epigrafe-default-check input {
    width: 14px;
    height: 14px;
}

.epigrafe-series-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(330px, 1fr));
    gap: 18px 40px;
}

.epigrafe-series-grid fieldset {
    border: 1px solid #d2d2d2;
    margin: 0;
    min-height: 84px;
    padding: 18px 22px 16px;
    background: transparent;
}

.epigrafe-series-grid legend {
    padding: 0 8px;
    font-weight: 500;
    color: #001b3d;
}

.epigrafe-series-grid label {
    display: grid;
    grid-template-columns: 90px 90px;
    align-items: center;
    gap: 18px;
    margin-bottom: 10px;
}

.epigrafe-series-grid input,
.epigrafe-main-grid input {
    min-height: 22px;
    border: 1px solid #aebdd0;
    padding: 2px 5px;
    background: #fff;
}

@media (max-width: 980px) {
    .epigrafe-form-window {
        width: calc(100vw - 28px);
        margin: 14px;
    }

    .epigrafe-form-header,
    .epigrafe-main-grid,
    .epigrafe-series-grid {
        grid-template-columns: 1fr;
    }

    .epigrafe-description-field {
        grid-column: auto;
    }
}

.pager {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    padding: 9px 20px;
    border-top: 1px solid #d4e0ec;
}

.pager span {
    margin-right: auto;
}

.pager span + span {
    margin-right: 12px;
}

.pager button {
    min-height: 28px;
    padding: 4px 11px;
    border: 1px solid transparent;
    border-radius: 3px;
    color: #fff;
    font-weight: 700;
}

.pager button:nth-of-type(1) {
    background: #2563eb;
    border-color: #1d4ed8;
}

.pager button:nth-of-type(2) {
    background: #0891b2;
    border-color: #0e7490;
}

.pager button:nth-of-type(3) {
    background: #16a34a;
    border-color: #15803d;
}

.pager button:nth-of-type(4) {
    background: #f97316;
    border-color: #ea580c;
}

.pager button:disabled {
    opacity: 1;
}

.pager button:nth-of-type(1):disabled {
    background: #dbeafe;
    border-color: #93c5fd;
    color: #1d4ed8;
}

.pager button:nth-of-type(2):disabled {
    background: #cffafe;
    border-color: #67e8f9;
    color: #0e7490;
}

.pager button:nth-of-type(3):disabled {
    background: #dcfce7;
    border-color: #86efac;
    color: #15803d;
}

.pager button:nth-of-type(4):disabled {
    background: #ffedd5;
    border-color: #fdba74;
    color: #c2410c;
}

.grid-bit-check {
    width: 16px;
    height: 16px;
    accent-color: #2563eb;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(220px, 1fr));
    gap: 14px 28px;
    padding: 20px 26px;
}

.form-grid label {
    display: grid;
    grid-template-columns: 150px minmax(160px, 1fr);
    align-items: center;
    gap: 10px;
}

.form-grid textarea {
    min-height: 72px;
}

.form-grid .span-2 {
    grid-column: span 2;
}

.article-form {
    grid-template-columns: repeat(2, minmax(220px, 1fr)) 220px;
}

.article-form .photo-card {
    grid-column: 3;
    grid-row: 1 / span 8;
}

.photo-card {
    display: grid;
    gap: 8px;
    align-content: start;
    justify-items: center;
    border: 1px solid #b7c8da;
    padding: 10px;
    background: #fff;
}

.photo-card img,
.no-photo {
    width: 180px;
    height: 180px;
    object-fit: contain;
    display: grid;
    place-items: center;
    background: #f8fafc;
    color: #64748b;
}

.article-service-panel {
    background: #eeeeee;
    container-type: inline-size;
}

.article-service-header {
    flex: 0 0 auto;
    display: grid;
    grid-template-columns: minmax(300px, max-content) minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    min-height: 58px;
    padding: 8px 18px;
    background: #f1f1f1;
    border-bottom: 1px solid #c7c7c7;
}

.article-title-inline {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.article-title-inline h1 {
    margin: 0;
    font-size: 26px;
    font-weight: 900;
    color: #020a18;
    white-space: nowrap;
}

.article-title-inline img {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.article-service-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
    min-width: 0;
}

.article-service-actions .app-btn,
.article-service-actions .aux-button {
    min-height: 30px;
    min-width: 76px;
    padding: 5px 10px;
    white-space: nowrap;
}

.article-service-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    gap: 7px;
    background: #eeeeee;
}

.article-fieldset {
    margin: 0;
    border: 1px solid #686868;
    padding: 10px 20px;
    background: #eeeeee;
}

.article-service-body > .article-fieldset,
.article-service-body > .article-middle-row {
    flex: 0 0 auto;
}

.article-fieldset label {
    display: grid;
    grid-template-columns: 118px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    margin: 0;
    font-size: 12px;
    color: #000;
}

.article-fieldset input,
.article-fieldset select,
.article-fieldset textarea {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    min-height: 22px;
    border: 1px solid #9a9a9a;
    background: #fff;
    padding: 2px 4px;
    font-size: 12px;
    color: #000;
}

.article-fieldset textarea {
    resize: vertical;
}

.article-main-data {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 260px;
    align-items: start;
    gap: 16px;
    min-height: 0;
    overflow: visible;
}

.article-main-fields {
    display: grid;
    grid-template-columns: minmax(260px, 420px) minmax(260px, 1fr) auto minmax(260px, 420px);
    align-content: start;
    gap: 8px 20px;
    min-width: 0;
}

.article-main-fields label:first-child {
    grid-column: 1;
}

.article-description-field {
    grid-column: 1 / -1;
    grid-template-columns: 170px minmax(0, 1fr) !important;
}

.article-description-field textarea {
    min-height: 220px;
    max-height: 220px;
    overflow-y: auto;
}

.article-main-fields label:nth-child(3) {
    grid-column: 2;
}

.article-checkbox-field {
    grid-column: 3;
    grid-template-columns: auto auto !important;
    justify-content: start;
}

.article-main-fields label:nth-child(5) {
    grid-column: 4;
}

.article-checkbox-field input {
    min-height: auto;
}

.article-photo-box {
    display: grid;
    justify-items: center;
    align-content: start;
    gap: 5px;
    min-width: 0;
}

.article-photo-frame {
    width: min(100%, 230px);
    width: min(100%, clamp(180px, 24cqw, 230px));
    aspect-ratio: 1;
    height: auto;
    display: grid;
    place-items: center;
    overflow: hidden;
    border: 1px solid #777;
    background: #f7f7f7;
    color: #667085;
    font-weight: 800;
}

.article-photo-frame img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.article-photo-actions {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 4px;
    width: 100%;
}

.article-photo-actions .app-btn {
    min-width: 68px;
    min-height: 21px;
    padding: 2px 7px;
    font-size: 0.8rem;
}

.article-hidden-file {
    display: none;
}

.article-middle-row {
    display: grid;
    grid-template-columns: minmax(470px, .82fr) minmax(480px, .78fr) minmax(460px, .8fr);
    gap: 22px;
    margin-top: 24px;
}

.article-middle-row-no-stock {
    grid-template-columns: minmax(470px, .9fr) minmax(560px, 1.1fr);
}

.article-price-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(190px, 1fr));
    gap: 7px 10px;
    max-width: 680px;
}

.article-price-grid label {
    grid-template-columns: minmax(82px, .8fr) minmax(92px, 118px);
    gap: 6px;
    min-width: 0;
}

.article-stock-data {
    display: grid;
    grid-template-columns: repeat(2, minmax(210px, 1fr));
    align-content: start;
    gap: 7px;
}

.article-stock-data label {
    grid-template-columns: minmax(128px, 1fr) minmax(88px, 118px);
    justify-content: start;
}

.article-stock-actions {
    grid-column: 1 / -1;
    display: flex;
    justify-content: flex-end;
    min-height: 24px;
}

.article-stock-audit-btn {
    min-width: 106px;
    min-height: 22px;
    padding: 2px 8px;
    border-color: #d99a00;
    background: #ffd400;
    color: #1b1b1b;
    font-size: 0.78rem;
    font-weight: 800;
}

.article-stock-audit-btn:hover:not(:disabled) {
    background: #ffea00;
}

.article-check-line {
    grid-template-columns: auto auto !important;
    justify-content: start;
}

.article-check-line input,
.article-extra-checks input {
    min-height: auto;
}

.article-extra-data {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-content: start;
    gap: 11px;
    min-height: 200px;
}

.article-extra-checks {
    display: grid;
    grid-template-columns: max-content max-content minmax(150px, 260px);
    align-items: center;
    gap: 22px;
}

.article-extra-checks label {
    display: inline-grid;
    grid-template-columns: auto auto;
    align-items: center;
    gap: 6px;
}

.article-extra-checks label:last-child {
    grid-template-columns: auto 72px;
}

.article-extra-data > label {
    grid-template-columns: 118px minmax(0, 1fr);
}

.article-extra-observations {
    grid-template-columns: 170px minmax(0, 1fr) !important;
}

.article-extra-observations textarea {
    height: 114px;
}

.article-text-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.article-text-label .article-text-expand {
    width: 72px;
    min-width: 72px;
    height: 27px;
    min-height: 27px;
    padding: 0 9px;
    border: 1px solid #0369a1 !important;
    border-radius: 4px;
    background: #0284c7 !important;
    color: #ffffff !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
    font-size: 12px;
    font-weight: 700;
    line-height: 25px;
}

.article-text-label .article-text-expand:hover:not(:disabled) {
    border-color: #075985 !important;
    background: #0369a1 !important;
}

.article-observations-backdrop {
    z-index: 180;
    padding: 40px;
}

.app-dialog.article-observations-dialog {
    width: min(1080px, calc(100vw - 80px));
    height: min(720px, calc(100vh - 80px));
    max-width: none;
    max-height: none;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    padding: 0;
    overflow: hidden;
}

.article-observations-dialog-body {
    min-height: 0;
    padding: 14px 16px;
    background: #f8fafc;
}

.article-observations-expanded-textarea {
    width: 100%;
    height: 100%;
    min-height: 0;
    box-sizing: border-box;
    resize: none;
    padding: 12px;
    border: 1px solid #64748b;
    background: #ffffff;
    color: #111827;
    font-family: "Segoe UI", Arial, sans-serif;
    font-size: 24px;
    line-height: 1.45;
}

.article-observations-expanded-textarea:focus {
    border-color: #0284c7;
    outline: 2px solid rgba(2, 132, 199, 0.2);
}

.article-provider-field {
    position: relative;
}

.article-provider-field .article-provider-lookup,
.article-provider-field .article-lookup-input {
    width: 100%;
}

.article-provider-lookup .article-lookup-results {
    width: min(940px, 62vw);
    max-height: 300px;
}

.article-price-data,
.article-stock-data,
.article-extra-data,
.article-observations-data {
    position: relative;
    border-color: #686868;
    padding-top: 14px;
}

.article-price-data::before,
.article-stock-data::before,
.article-extra-data::before {
    position: absolute;
    top: -23px;
    left: 16px;
    color: #000;
    background: #eeeeee;
    padding: 0 4px;
    font-size: 14px;
    line-height: 18px;
}

.article-price-data::before {
    content: "PRECIOS DE TARIFAS";
}

.article-stock-data::before {
    content: "GESTIÓN ALMACÉN";
}

.article-extra-data::before {
    content: "OTROS DATOS DE INTERÉS";
}

.article-observations-data {
    padding: 10px 8px 12px 12px;
}

@container (max-width: 1120px) {
    .article-service-header {
        grid-template-columns: 1fr;
    }

    .article-service-actions {
        justify-content: flex-start;
    }
}

@container (max-width: 980px) {
    .article-middle-row {
        grid-template-columns: minmax(0, 1.35fr) minmax(280px, .65fr);
        gap: 10px;
    }

    .article-stock-data {
        grid-template-columns: 1fr;
    }

    .article-fieldset {
        padding-left: 12px;
        padding-right: 12px;
    }
}

@container (max-width: 860px) {
    .article-main-data,
    .article-middle-row,
    .article-extra-data {
        grid-template-columns: 1fr;
    }

    .article-main-fields {
        grid-template-columns: 1fr;
    }

    .article-checkbox-field,
    .article-extra-data > label,
    .article-extra-data > label:nth-of-type(2),
    .article-extra-data > label:nth-of-type(4),
    .article-extra-observations {
        grid-column: 1 !important;
    }

    .article-photo-box {
        justify-items: start;
    }

    .article-extra-data > label:nth-of-type(1),
    .article-extra-data > label:nth-of-type(2),
    .article-extra-data > label:nth-of-type(3),
    .article-extra-data > label:nth-of-type(4),
    .article-extra-observations {
        grid-row: auto;
    }
}

@container (max-width: 720px) {
    .article-service-header {
        grid-template-columns: 1fr;
        padding: 8px 10px;
    }

    .article-title-inline h1 {
        white-space: normal;
        font-size: 23px;
    }

    .article-fieldset {
        padding: 10px;
    }

    .article-fieldset label,
    .article-price-grid label,
    .article-stock-data label,
    .article-extra-data > label,
    .article-extra-observations {
        grid-template-columns: 1fr !important;
        gap: 3px;
    }

    .article-price-grid {
        grid-template-columns: 1fr;
        max-width: none;
    }

    .article-photo-frame {
        width: min(100%, 220px);
    }
}

.checks-line {
    grid-column: span 2;
    display: flex;
    flex-wrap: wrap;
    gap: 22px;
}

.checks-line label {
    display: inline-flex;
    grid-template-columns: none;
    gap: 7px;
}

.wait-overlay {
    position: fixed;
    inset: 0;
    display: grid;
    place-items: center;
    background: rgba(15, 23, 42, 0.45);
    z-index: 5000;
}

.wait-box {
    display: grid;
    justify-items: center;
    gap: 10px;
    min-width: 300px;
    padding: 24px 28px;
    border-radius: 4px;
    background: #fff;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.25);
}

.spinner {
    width: 34px;
    height: 34px;
    border: 4px solid #dbeafe;
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.wait-bar {
    width: 100%;
    height: 7px;
    overflow: hidden;
    border-radius: 999px;
    background: #e2e8f0;
}

.wait-bar i {
    display: block;
    width: 38%;
    height: 100%;
    background: #2563eb;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.visual-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 12px;
    padding: 20px;
}

.visual-tile {
    display: grid;
    grid-template-rows: 120px auto auto;
    gap: 7px;
    align-items: center;
    min-height: 194px;
    border: 1px solid #b7c8da;
    background: #fff;
    padding: 10px;
    text-align: left;
}

.visual-tile img {
    width: 100%;
    height: 120px;
    object-fit: contain;
}

.tpv-panel-config {
    min-height: calc(100vh - 92px);
    display: flex;
    flex-direction: column;
}

.tpv-panel-config-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 14px 18px 4px;
}

.tpv-panel-config-title h1 {
    margin: 0;
    font-size: 18px;
    line-height: 1.2;
}

.tpv-panel-config-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 18px;
    border-bottom: 1px solid #aebdcb;
}

.tpv-panel-config-toolbar label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    font-weight: 700;
}

.tpv-panel-config-toolbar select {
    width: 420px;
    height: 28px;
    border: 1px solid #9fb3c8;
    background: #fff;
}

.tpv-panel-config-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 430px;
    gap: 4px;
    flex: 1;
    min-height: 0;
    padding: 0 4px 4px;
}

.tpv-panel-articles,
.tpv-panel-families {
    border: 1px solid #7d7d7d;
    background: #fff;
    min-height: 0;
    overflow: auto;
    padding: 8px 12px 12px;
}

.tpv-panel-section-title {
    margin: -8px -12px 8px;
    padding: 4px 8px;
    background: #f1f3f6;
    border-bottom: 1px solid #bfc8d1;
    font-weight: 800;
}

.tpv-visual-items {
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
    gap: 8px;
    padding-top: 18px;
}

.tpv-family-items {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-content: flex-start;
    gap: 8px;
    padding-top: 18px;
}

.tpv-visual-card,
.tpv-family-card {
    position: relative;
    width: 116px;
    min-height: 136px;
    border: 1px solid #8e8e8e;
    background: #fff;
    cursor: grab;
}

.tpv-visual-card.frequent {
    border-color: #16a34a;
    box-shadow: inset 0 0 0 2px #16a34a;
}

.tpv-visual-card.discontinued,
.tpv-family-card.discontinued {
    border-color: #dc2626;
    box-shadow: inset 0 0 0 2px #dc2626;
}

.tpv-family-card {
    width: 100%;
    padding: 0;
    min-height: 134px;
    text-align: center;
}

.tpv-family-card.active {
    outline: 3px solid #0f766e;
    outline-offset: 1px;
}

.tpv-card-body {
    display: grid;
    grid-template-rows: 90px auto auto;
    width: 100%;
    min-height: 136px;
    border: 0;
    background: transparent;
    padding: 0 6px 6px;
    text-align: center;
    cursor: pointer;
}

.tpv-card-image {
    display: grid;
    place-items: center;
    width: 100%;
    height: 90px;
    background: #fff;
    overflow: hidden;
}

.tpv-card-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.tpv-card-image span {
    color: #5b6b80;
    font-size: 12px;
    font-weight: 800;
}

.tpv-card-body strong,
.tpv-family-card strong {
    align-self: center;
    min-height: 34px;
    color: #000;
    font-size: 12px;
    line-height: 1.15;
    overflow-wrap: anywhere;
}

.tpv-card-body span {
    color: #405b78;
    font-size: 11px;
}

.tpv-card-menu-btn {
    position: absolute;
    top: 3px;
    right: 3px;
    z-index: 2;
    width: 22px;
    height: 22px;
    border: 1px solid #7d8da1;
    background: rgba(255,255,255,.92);
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
}

.tpv-context-menu {
    position: fixed;
    z-index: 5000;
    width: min(320px, calc(100vw - 16px));
    min-width: 0;
    max-width: calc(100vw - 16px);
    max-height: calc(100vh - 16px);
    overflow: auto;
    padding: 6px 0;
    border: 1px solid #7f7f7f;
    background: #f7f7f7;
    box-shadow: 0 8px 22px rgba(0,0,0,.28);
}

.tpv-context-menu button {
    display: block;
    width: 100%;
    border: 0;
    background: transparent;
    padding: 7px 14px;
    text-align: left;
    font-size: 13px;
    white-space: normal;
    overflow-wrap: anywhere;
}

.tpv-context-menu button:hover {
    background: #dbeafe;
}

.tpv-family-dialog {
    width: min(520px, calc(100vw - 44px));
}

.tpv-family-dialog .app-dialog-header span {
    color: #405b78;
    font-size: 13px;
}

.tpv-family-dialog-body {
    display: grid;
    gap: 14px;
    padding: 18px;
}

.tpv-family-dialog-body label {
    display: grid;
    gap: 5px;
    color: #061735;
    font-size: 13px;
    font-weight: 700;
}

.tpv-family-dialog-body input {
    height: 30px;
    border: 1px solid #9fb0c4;
    padding: 4px 7px;
    font: inherit;
    font-weight: 400;
}

.ingresos-panel .title-with-icon p {
    margin: 4px 0 0;
    color: #405b78;
    font-size: 13px;
}

.ingresos-panel .table-wrap {
    padding-top: 0;
}

.ingresos-grid th {
    top: 0;
    z-index: 8;
    background: #eaf1f8;
    box-shadow: 0 -12px 0 #f4f8fc, inset 0 1px 0 #cbd8e6, inset 0 -1px 0 #cbd8e6;
    white-space: nowrap;
}

.ingresos-grid th:first-child,
.ingresos-grid td:first-child {
    position: sticky;
    left: 0;
    z-index: 2;
    background: inherit;
    box-shadow: 1px 0 0 #c6d3e1;
}

.ingresos-grid th:first-child {
    z-index: 9;
    background: #e9f0f6;
}

.ingresos-grid .w-actions {
    width: 74px;
    min-width: 74px;
}

.ingresos-grid .grid-row-actions {
    min-width: 74px;
}

.ingresos-grid .grid-action-buttons {
    justify-content: center;
}

.sanitarias-list-grid .w-actions,
.sanitarias-list-grid .grid-row-actions {
    width: 142px;
    min-width: 142px;
}

.sanitaria-row-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.sanitaria-ficha-link {
    appearance: none;
    border: 0;
    padding: 2px 3px;
    background: transparent;
    color: #064f9e;
    font: inherit;
    font-weight: 700;
    text-decoration: underline;
    cursor: pointer;
}

.sanitaria-ficha-link:hover,
.sanitaria-ficha-link:focus-visible {
    color: #00366f;
}

.pagos-rec-list .pagos-rec-actions-column,
.pagos-rec-list .pagos-rec-row-actions {
    width: 112px;
    min-width: 112px;
}

.ingresos-grid tbody tr:hover td {
    color: #061735;
}

.ingresos-grid td {
    max-width: 260px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.partes-trabajo-list-grid tbody tr[style*="--parte-state-color"] td {
    background: var(--parte-state-color);
    color: var(--parte-state-text-color, #0f172a);
    font-weight: 600;
    text-shadow: none;
}

.partes-trabajo-list-grid tbody tr[style*="--parte-state-color"] td a,
.partes-trabajo-list-grid tbody tr[style*="--parte-state-color"] td button:not(.row-icon-button) {
    color: var(--parte-state-text-color, #0f172a);
}

.partes-trabajo-list-grid tbody tr[style*="--parte-state-color"]:hover td {
    background: color-mix(in srgb, var(--parte-state-color) 82%, #dbeafe);
}

.partes-trabajo-list-grid tbody tr[style*="--parte-state-color"] .row-icon-button {
    color: #0f172a;
    text-shadow: none;
}

.partes-trabajo-list-window .panel-title-row {
    gap: 10px;
    padding-left: 16px;
    padding-right: 18px;
    position: relative;
    z-index: 80;
    overflow: visible;
}

.partes-trabajo-list-window .panel-title-row .title-with-icon {
    flex: 0 1 auto;
    min-width: 0;
    gap: 12px;
}

.partes-trabajo-list-window .panel-title-row .title-with-icon h1 {
    margin: 0;
    line-height: 1.08;
}

.partes-generales-list-window .panel-title-row .title-with-icon h1 {
    font-size: 2rem;
    white-space: nowrap;
}

.partes-trabajo-list-window .toolbar.compact {
    flex: 1 1 auto;
    flex-wrap: nowrap;
    gap: 8px;
    min-width: 0;
    overflow-x: auto;
    padding-bottom: 2px;
}

.partes-trabajo-list-window .toolbar.compact:has(.aux-menu) {
    overflow: visible;
}

.partes-trabajo-list-window .toolbar.compact .aux-button-host {
    overflow: visible;
}

.partes-trabajo-list-window .toolbar.compact .app-btn {
    min-width: auto;
    padding-left: 12px;
    padding-right: 12px;
}

.partes-trabajo-list-window .toolbar.compact .client-grid-config-button {
    min-width: 152px;
}

.partes-trabajo-list-window .filter-strip {
    flex-wrap: nowrap;
    gap: 10px;
    padding: 8px 12px;
    overflow: visible;
    align-items: center;
    position: relative;
    z-index: 600;
}

.partes-trabajo-list-window .filter-strip label {
    display: inline-flex;
    flex: 0 1 auto;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.partes-trabajo-list-window .filter-strip input,
.partes-trabajo-list-window .filter-strip select {
    min-width: 0;
    height: 29px;
}

.partes-trabajo-list-window .filter-strip > label > input {
    width: 190px;
    min-width: 120px;
}

.partes-trabajo-list-window .filter-strip > label > select {
    width: 132px;
}

.partes-trabajo-list-window .filter-strip > label:has(> select[value]) {
    flex: 0 0 auto;
}

.partes-trabajo-list-window .filter-strip label:nth-last-of-type(2) select {
    width: 76px;
}

.partes-trabajo-list-window .filter-strip label:nth-last-of-type(1) select {
    width: 138px;
}

.partes-trabajo-list-window .filter-strip .list-client-filter {
    flex: 1 1 260px;
    min-width: 190px;
    max-width: 360px;
}

.partes-trabajo-list-window .filter-strip .list-client-lookup {
    width: 100%;
    min-width: 0;
}

.partes-trabajo-list-window .list-client-filter .list-client-lookup input {
    width: 100%;
    min-width: 0;
}

.partes-trabajo-list-window .list-client-results {
    min-width: 420px;
    max-width: min(560px, 80vw);
    z-index: 500;
}

.partes-list-summary-row {
    display: flex;
    align-items: center;
    gap: 16px;
    min-height: 38px;
    padding: 7px 14px;
    border-bottom: 1px solid #d4e0ec;
    background: #f7fbff;
}

.partes-filter-summary {
    flex: 0 0 auto;
    white-space: nowrap;
}

.partes-record-summary {
    flex: 0 0 auto;
    margin-left: auto;
    white-space: nowrap;
}

.partes-trabajo-list-grid {
    table-layout: fixed;
    min-width: 2240px;
}

.partes-trabajo-list-grid .parts-col-actions {
    width: 74px;
}

.partes-trabajo-list-grid .parts-col-number {
    width: 92px;
}

.partes-trabajo-list-grid .parts-col-date {
    width: 88px;
}

.partes-trabajo-list-grid .parts-col-hour {
    width: 70px;
}

.partes-trabajo-list-grid .parts-col-client {
    width: 112px;
}

.partes-trabajo-list-grid .parts-col-client-name {
    width: 250px;
}

.partes-trabajo-list-grid .parts-col-employee {
    width: 92px;
}

.partes-trabajo-list-grid .parts-col-employee-name {
    width: 190px;
}

.partes-trabajo-list-grid .parts-col-state {
    width: 72px;
}

.partes-trabajo-list-grid .parts-col-state-description {
    width: 150px;
}

.partes-trabajo-list-grid .parts-col-origin {
    width: 86px;
}

.partes-trabajo-list-grid .parts-col-origin-description {
    width: 170px;
}

.partes-trabajo-list-grid .parts-col-department {
    width: 92px;
}

.partes-trabajo-list-grid .parts-col-department-description {
    width: 170px;
}

.partes-trabajo-list-grid .parts-col-flag {
    width: 74px;
}

.partes-trabajo-list-grid .parts-col-number-small {
    width: 74px;
}

.partes-trabajo-list-grid .parts-col-money {
    width: 92px;
}

.partes-trabajo-list-grid .parts-col-wide-text {
    width: 240px;
}

.facturas-list-window {
    min-width: 0;
}

.facturas-list-window .panel-title-row {
    gap: 10px;
}

.facturas-list-window .filter-strip {
    padding: 8px 16px;
}

.facturas-list-window .table-wrap {
    padding-left: 6px;
    padding-right: 6px;
    overflow-x: hidden;
}

.facturas-list-window .ingresos-grid {
    min-width: 0;
    table-layout: fixed;
    font-size: 12px;
}

.facturas-list-window .ingresos-grid th,
.facturas-list-window .ingresos-grid td {
    padding: 6px 7px;
}

.facturas-list-window .ingresos-grid td {
    max-width: none;
}

.facturas-list-window .ingresos-grid .w-actions,
.facturas-list-window .ingresos-grid .grid-row-actions {
    width: 158px;
    min-width: 158px;
    max-width: 158px;
}

.facturas-list-window .ingresos-grid .grid-action-buttons {
    justify-content: center;
    gap: 7px;
}

.presupuestos-list-grid {
    table-layout: fixed;
    min-width: 1690px;
}

.ingresos-panel:has(.presupuestos-list-grid) .panel-title-row,
.ingresos-panel:has(.presupuestos-list-grid) .filter-strip,
.ingresos-panel:has(.presupuestos-list-grid) .factura-line-toolbar,
.ingresos-panel:has(.presupuestos-list-grid) .table-wrap,
.ingresos-panel:has(.presupuestos-list-grid) .pager {
    padding-left: 18px;
    padding-right: 18px;
}

.presupuestos-list-grid .presupuesto-actions-col { width: 156px; }
.presupuestos-list-grid .presupuesto-numero-col { width: 126px; }
.presupuestos-list-grid .presupuesto-fecha-col,
.presupuestos-list-grid .presupuesto-validez-col { width: 82px; }
.presupuestos-list-grid .presupuesto-cliente-col { width: 80px; }
.presupuestos-list-grid .presupuesto-nombre-col { width: 300px; }
.presupuestos-list-grid .presupuesto-forma-col { width: 120px; }
.presupuestos-list-grid .presupuesto-estado-col { width: 78px; }
.presupuestos-list-grid .presupuesto-fact-col { width: 62px; }
.presupuestos-list-grid .presupuesto-factura-col,
.presupuestos-list-grid .presupuesto-albaran-col { width: 190px; }
.presupuestos-list-grid .presupuesto-money-col { width: 72px; }
.presupuestos-list-grid .presupuesto-origen-col { width: 76px; }
.presupuestos-list-grid .presupuesto-vehiculo-col { width: 130px; }

.presupuestos-list-grid .w-actions,
.presupuestos-list-grid .grid-row-actions {
    width: 156px;
    min-width: 156px;
    max-width: 156px;
    padding: 4px 8px;
    overflow: visible;
    text-overflow: clip;
    white-space: nowrap;
}

.presupuestos-list-grid .grid-action-buttons {
    width: 100%;
    justify-content: center;
    gap: 4px;
}

.presupuesto-cd-row-button {
    font-weight: 400;
    letter-spacing: 0;
}

.factura-note-button {
    border-color: #0f766e;
    color: #0f766e;
    font-weight: 900;
}

.factura-note-button:hover,
.factura-note-button:focus-visible {
    background: #ccfbf1;
    border-color: #0f766e;
    color: #0f766e;
}

.factura-note-button.has-note {
    background: #ffd400 !important;
    border-color: #eab308 !important;
    color: #111827 !important;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .45);
}

.factura-note-button.has-note:hover,
.factura-note-button.has-note:focus-visible {
    background: #ffbf00 !important;
    border-color: #d97706 !important;
    color: #111827 !important;
}

.factura-vencimientos-button {
    border-color: #d97706;
    color: #92400e;
    font-weight: 900;
}

.factura-vencimientos-button.has-vencimientos {
    background: #ffd400 !important;
    border-color: #f59e0b !important;
    color: #111827 !important;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .45);
}

.factura-vencimientos-button.overdue {
    background: #dc2626 !important;
    border-color: #991b1b !important;
    color: #fff !important;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .28);
}

.factura-vencimientos-button.has-vencimientos:hover,
.factura-vencimientos-button.has-vencimientos:focus-visible {
    background: #ffbf00 !important;
    border-color: #d97706 !important;
    color: #111827 !important;
}

.factura-vencimientos-button.overdue:hover,
.factura-vencimientos-button.overdue:focus-visible {
    background: #b91c1c !important;
    border-color: #7f1d1d !important;
    color: #fff !important;
}

.ingresos-grid tbody tr.receipt-overdue > td {
    background: #e60000 !important;
    color: #fff !important;
}

.ingresos-grid tbody tr.receipt-overdue:hover > td {
    background: #c90000 !important;
    color: #fff !important;
}

.tabs-strip {
    display: flex;
    align-items: center;
    gap: 3px;
    padding: 7px 20px 0;
    border-bottom: 1px solid #b8c7d8;
    background: #e5e5e5;
}

.tabs-strip .tab {
    min-height: 34px;
    padding: 6px 16px;
    border: 1px solid #9fb1c5;
    border-bottom-color: #b8c7d8;
    border-radius: 4px 4px 0 0;
    background: linear-gradient(#f7fbff, #dfe8f2);
    font-weight: 700;
}

.tabs-strip .tab.active {
    background: #087f7f;
    border-color: #087f7f;
    color: #fff;
}

.generic-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(280px, 1fr));
    gap: 13px 28px;
    padding: 20px 26px;
}

.generic-form-grid label {
    display: grid;
    grid-template-columns: 190px minmax(180px, 1fr);
    align-items: center;
    gap: 10px;
}

.generic-form-grid input,
.generic-form-grid select,
.generic-form-grid textarea {
    min-height: 29px;
    border: 1px solid #9fb1c5;
    background: #fff;
    padding: 3px 7px;
}

.generic-form-grid textarea {
    min-height: 76px;
    resize: vertical;
}

.generic-form-grid .span-2 {
    grid-column: span 2;
}

.recibo-web-form {
    display: grid;
    gap: 10px;
    padding: 12px 16px 18px;
}

.recibo-web-section {
    border: 1px solid #bfd0e2;
    background: #f8fbff;
    padding: 12px 14px 14px;
    margin: 0;
}

.recibo-web-section legend {
    padding: 0 8px;
    font-weight: 800;
    color: #001f46;
}

.recibo-web-section:has(.recibo-web-activity) {
    display: none;
}

.recibo-web-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(150px, 1fr));
    gap: 10px 12px;
    align-items: end;
}

.recibo-web-general {
    grid-template-columns: 140px 150px 150px 95px 150px 95px minmax(260px, 1fr);
}

.recibo-web-client {
    grid-template-columns: minmax(260px, 1fr) minmax(320px, 1.4fr) 150px;
}

.recibo-web-bank {
    grid-template-columns: repeat(4, minmax(180px, 1fr));
}

.recibo-web-activity {
    grid-template-columns: 160px minmax(280px, 1fr) 180px;
}

.recibo-web-form label {
    display: grid;
    gap: 4px;
    min-width: 0;
    font-size: 12px;
    font-weight: 700;
    color: #001f46;
}

.recibo-web-form input,
.recibo-web-form select,
.recibo-web-form textarea {
    width: 100%;
    min-width: 0;
    height: 28px;
    border: 1px solid #a9bad0;
    background: white;
    color: #001126;
    font: 13px Arial, sans-serif;
    padding: 3px 6px;
    box-sizing: border-box;
}

.recibo-web-form textarea {
    min-height: 62px;
    resize: vertical;
}

.recibo-web-form input[readonly] {
    background: #edf3fa;
}

.recibo-concept {
    grid-column: 1 / -1;
}

.recibo-money input {
    text-align: right;
    font-weight: 800;
}

.recibo-check-field {
    grid-template-columns: 1fr auto;
    align-items: center;
    justify-content: start;
}

.recibo-check-field input {
    width: 18px;
    height: 18px;
    padding: 0;
}

.recibo-field-with-action > div {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 32px;
    gap: 5px;
}

.recibo-field-with-action .mini-action {
    width: 32px;
    height: 28px;
    border: 1px solid #86a9c8;
    background: #eaf4ff;
    display: grid;
    place-items: center;
    cursor: pointer;
}

.recibo-field-with-action .mini-action:disabled {
    opacity: .5;
    cursor: default;
}

.recibo-field-with-action .mini-action img {
    width: 19px;
    height: 19px;
    object-fit: contain;
}

@media (max-width: 1200px) {
    .recibo-web-general,
    .recibo-web-client,
    .recibo-web-bank,
    .recibo-web-activity,
    .recibo-web-grid {
        grid-template-columns: repeat(2, minmax(180px, 1fr));
    }
}

.caja-form-grid {
    grid-template-columns: repeat(2, minmax(360px, 1fr));
}

.caja-form-grid .caja-check-field {
    grid-template-columns: 190px auto minmax(0, 1fr);
    justify-content: start;
}

.caja-form-grid .caja-check-field input {
    width: 28px;
    min-height: 28px;
    padding: 0;
}

.caja-diaria-panel {
    min-height: calc(100vh - 96px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.caja-diaria-panel .panel-title-row {
    flex: 0 0 auto;
    min-height: 58px;
    padding: 10px 18px;
    align-items: center;
    gap: 12px;
}

.caja-diaria-panel .title-with-icon {
    gap: 12px;
}

.caja-diaria-panel .title-with-icon img {
    width: 42px;
    height: 42px;
}

.caja-diaria-panel .title-with-icon h1 {
    font-size: 24px;
    line-height: 1.1;
    margin: 0;
}

.caja-diaria-panel .title-with-icon p {
    display: none;
}

.caja-diaria-panel .toolbar.compact {
    gap: 8px;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: nowrap;
}

.caja-diaria-panel .toolbar.compact .app-btn {
    min-height: 30px;
    padding: 5px 14px;
    white-space: nowrap;
}

.caja-tabs-strip {
    order: 3;
    padding: 0 18px;
    background: #f4f7fb;
    border-top: 1px solid #c8d6e4;
    overflow-x: auto;
    white-space: nowrap;
}

.caja-tabs-strip .tab {
    min-height: 36px;
    padding: 6px 16px;
}

.caja-diaria-body {
    flex: 0 0 auto;
    padding: 10px 18px 8px;
    background: #f4f4f4;
    border-bottom: 1px solid #c8d6e4;
}

.caja-diaria-top {
    display: grid;
    grid-template-columns: minmax(560px, 1fr) minmax(560px, .98fr);
    gap: 12px;
    align-items: stretch;
}

.caja-diaria-section {
    margin: 0;
    padding: 8px 16px 10px;
    border: 1px solid #d6d6d6;
    background: #f7f7f7;
}

.caja-diaria-section legend {
    padding: 0 7px;
    color: #001126;
    font-size: 13px;
    font-weight: 700;
}

.caja-diaria-session-grid,
.caja-diaria-amount-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 28px;
}

.caja-diaria-section label {
    display: grid;
    grid-template-columns: 130px minmax(150px, 1fr);
    align-items: center;
    gap: 8px;
    min-width: 0;
    color: #001126;
    font-size: 12px;
}

.caja-diaria-section input,
.caja-diaria-section select,
.caja-diaria-section textarea {
    width: 100%;
    min-width: 0;
    min-height: 24px;
    border: 1px solid #b8c5d2;
    background: #fff;
    padding: 2px 6px;
    font: 12px Arial, sans-serif;
    box-sizing: border-box;
}

.caja-diaria-section input[type="checkbox"] {
    width: 18px;
    min-height: 18px;
    justify-self: start;
    padding: 0;
}

.caja-diaria-amounts input {
    text-align: right;
}

.caja-diaria-notes {
    margin-top: 8px;
    padding: 6px 8px;
}

.caja-diaria-notes label {
    display: block;
}

.caja-diaria-notes label > span {
    display: none;
}

.caja-diaria-notes textarea {
    min-height: 42px;
    resize: vertical;
}

.caja-tabs-content {
    order: 4;
    flex: 1 1 auto;
    min-height: 0;
    padding: 0 18px 10px;
    background: #f4f4f4;
    overflow: hidden;
}

.caja-tabs-content > div {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.caja-tabs-content .summary-line {
    margin: 8px 0;
    font-size: 13px;
}

.caja-related-summary {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 18px;
    color: #004f9f;
}

.caja-recibos-filter {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
    min-height: 36px;
}

.caja-recibos-filter label {
    display: flex;
    flex: 1 1 620px;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    min-width: 280px;
    color: #001126;
    font-size: 13px;
}

.caja-recibos-filter label > span {
    flex: 0 0 auto;
    white-space: nowrap;
}

.caja-recibos-filter input {
    flex: 1 1 auto;
    height: 28px;
    border: 1px solid #a8bbcf;
    padding: 3px 8px;
    font-size: 14px;
    min-width: 240px;
}

.caja-recibos-filter .app-btn {
    height: 28px;
    min-width: 86px;
    padding: 0 12px;
}

.caja-recibos-inline-summary {
    margin-left: auto;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 16px;
    color: #004f9f;
    font-size: 13px;
    white-space: nowrap;
}

.caja-tabs-content .table-wrap {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    background: #fff;
    border: 1px solid #c8d6e4;
}

.caja-tabs-content .data-grid th {
    background: #e7eff7;
    color: #001126;
    font-weight: 700;
    border-color: #c5d5e5;
}

.caja-tabs-content .data-grid td {
    color: #001126;
    border-color: #cbd8e6;
}

.caja-tabs-content .data-grid th,
.caja-tabs-content .data-grid td {
    padding: 6px 10px;
    font-size: 13px;
}

.caja-tabs-content .data-grid tbody tr {
    cursor: default;
}

.caja-movement-toolbar {
    display: flex;
    gap: 8px;
    padding: 10px 0;
}

.remesa-gym-panel {
    min-height: calc(100vh - 96px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.remesa-gym-panel .panel-title-row {
    flex: 0 0 auto;
    min-height: 56px;
    padding: 8px 20px;
    gap: 14px;
}

.remesa-gym-panel .title-with-icon {
    gap: 12px;
}

.remesa-gym-panel .title-with-icon img {
    width: 42px;
    height: 42px;
}

.remesa-gym-panel .title-with-icon h1 {
    margin: 0;
    font-size: 30px;
    line-height: 1.05;
}

.remesa-gym-panel .title-with-icon p {
    display: none;
}

.remesa-gym-panel .toolbar.compact {
    flex-wrap: nowrap;
    gap: 9px;
    overflow-x: auto;
    padding-bottom: 2px;
}

.remesa-gym-panel .toolbar.compact .app-btn {
    min-width: 92px;
    min-height: 30px;
    padding: 5px 14px;
    font-size: 12px;
}

.remesa-gym-panel .tabs-strip {
    flex: 0 0 auto;
    padding: 0 20px;
    min-height: 36px;
    background: #f4f4f4;
    border-bottom: 1px solid #c8d6e4;
}

.remesa-gym-panel .tabs-strip .tab {
    min-height: 34px;
    padding: 6px 18px;
}

.remesa-gym-body {
    flex: 0 0 auto;
    padding: 8px 26px 7px;
    background: #f4f7fb;
    border-bottom: 1px solid #c8d6e4;
}

.remesa-gym-fields {
    display: grid;
    grid-template-columns: minmax(360px, 390px) minmax(340px, 390px) minmax(230px, 1fr) minmax(330px, 340px);
    grid-template-areas:
        "number account account remesa-date"
        "send-date charge-date receipts amount"
        "type file file lower-date"
        "summary . . upper-date";
    gap: 7px 16px;
    align-items: center;
}

.remesa-gym-fields label {
    display: grid;
    grid-template-columns: 128px minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    color: #001126;
    font-size: 12px;
}

.remesa-gym-fields label > span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.remesa-gym-fields input,
.remesa-gym-fields select {
    width: 100%;
    min-width: 0;
    height: 26px;
    border: 1px solid #a9b9ca;
    background: #fff;
    padding: 2px 7px;
    font: 12px Arial, sans-serif;
    box-sizing: border-box;
}

.remesa-number {
    grid-area: number;
}

.remesa-account {
    grid-area: account;
}

.remesa-date {
    grid-area: remesa-date;
}

.remesa-send-date {
    grid-area: send-date;
}

.remesa-charge-date {
    grid-area: charge-date;
}

.remesa-receipts {
    grid-area: receipts;
    grid-template-columns: 64px minmax(0, 1fr) !important;
}

.remesa-amount {
    grid-area: amount;
}

.remesa-type {
    grid-area: type;
}

.remesa-file {
    grid-area: file;
}

.remesa-lower-date {
    grid-area: lower-date;
}

.remesa-upper-date {
    grid-area: upper-date;
}

.remesa-gym-fields .money {
    text-align: right;
}

.remesa-gym-summary {
    grid-area: summary;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #004f9f;
    font-size: 13px;
    white-space: nowrap;
}

.remesa-account-info {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 16px;
    margin: 8px 0 0;
    padding: 8px 0 0;
    border-top: 1px solid #c8d6e4;
}

.remesa-account-info div {
    min-width: 0;
}

.remesa-account-info dt {
    margin-bottom: 3px;
    color: #36536f;
    font-size: 11px;
    font-weight: 700;
}

.remesa-account-info dd {
    min-height: 18px;
    margin: 0;
    overflow: hidden;
    color: #001126;
    font: 12px Arial, sans-serif;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.remesa-gym-action-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: nowrap;
    padding-top: 8px;
    overflow-x: auto;
}

.remesa-gym-action-row .app-btn {
    min-height: 30px;
    padding: 5px 18px;
    white-space: nowrap;
}

.remesa-file-preview-dialog {
    width: min(1120px, calc(100vw - 48px));
    height: min(760px, calc(100vh - 48px));
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    overflow: hidden;
}

.remesa-file-preview-dialog .app-dialog-header {
    border-bottom: 1px solid #c8d6e4;
}

.remesa-file-preview-dialog .app-dialog-header h3 {
    margin: 0 0 3px;
    font-size: 18px;
}

.remesa-file-preview-dialog .app-dialog-header span {
    color: #45627e;
    font-size: 12px;
}

.remesa-file-preview-content {
    min-width: 0;
    min-height: 0;
    margin: 0;
    padding: 14px;
    overflow: auto;
    border: 0;
    background: #f8fafc;
    color: #102a43;
    font: 12px/1.45 Consolas, "Courier New", monospace;
    white-space: pre;
}

.remesa-file-preview-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 10px 14px;
    border-top: 1px solid #c8d6e4;
    background: #fff;
}

.remesa-gym-panel > .table-wrap,
.remesa-gym-panel > div > .table-wrap {
    flex: 1 1 auto;
    min-height: 0;
    padding: 4px 20px 0;
    background: #fff;
}

.remesa-gym-panel .summary-line {
    padding: 6px 22px;
    font-size: 12px;
}

.remesa-gym-panel .data-grid th,
.remesa-gym-panel .data-grid td {
    padding: 4px 6px;
    font-size: 10px;
    line-height: 1.15;
}

.remesa-gym-panel .data-grid th {
    background: #dfeaf5 !important;
    color: #001126 !important;
    font-weight: 700;
    border-color: #b9cde0;
}

.remesa-gym-panel .data-grid input[type="checkbox"] {
    min-height: 14px;
    width: 14px;
    height: 14px;
    padding: 0;
}

@media (max-width: 1300px) {
    .caja-diaria-top {
        grid-template-columns: 1fr;
    }

    .remesa-gym-fields {
        grid-template-columns: repeat(2, minmax(300px, 1fr));
        grid-template-areas:
            "number account"
            "send-date charge-date"
            "type file"
            "remesa-date amount"
            "lower-date upper-date"
            "receipts summary";
    }

    .remesa-account-info {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.tpv-screen {
    min-height: calc(100vh - 150px);
}

.tpv-body {
    display: grid;
    grid-template-columns: 210px minmax(520px, 1fr) 360px;
    min-height: 650px;
}

.tpv-families {
    display: flex;
    flex-direction: column;
    gap: 7px;
    padding: 14px;
    border-right: 1px solid #c8d6e4;
    background: #eef6fc;
}

.tpv-families button {
    min-height: 38px;
    border: 1px solid #9fb1c5;
    border-radius: 4px;
    background: #fff;
    text-align: left;
    font-weight: 800;
}

.tpv-families button.active,
.tpv-families button:hover {
    background: #0f8a8a;
    border-color: #0a6f6f;
    color: #fff;
}

.tpv-products {
    min-width: 0;
}

.tpv-search {
    padding: 10px 14px;
}

.tpv-product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
    padding: 14px;
    max-height: 620px;
    overflow: auto;
}

.tpv-product {
    display: grid;
    grid-template-rows: 96px auto auto;
    gap: 6px;
    min-height: 170px;
    border: 1px solid #b7c8da;
    border-radius: 4px;
    background: #fff;
    padding: 9px;
    text-align: left;
}

.tpv-product:hover {
    border-color: #0f8a8a;
    box-shadow: 0 0 0 2px rgba(15, 138, 138, 0.16);
}

.sanitarias-filter-strip {
    grid-template-columns: minmax(280px, 420px) 210px;
}

.sanitarias-list-grid td {
    max-width: 320px;
}

.sanitaria-special-row {
    background: #fff7d6;
}

.sanitaria-window {
    height: calc(100vh - 84px);
}

.sanitaria-head {
    display: grid;
    grid-template-columns: 130px minmax(360px, 1fr) 170px 180px 150px;
    gap: 8px 12px;
    align-items: end;
    padding: 10px 16px;
    border-top: 1px solid #cfd8e3;
    border-bottom: 1px solid #cfd8e3;
    background: #f6f9fc;
}

.sanitaria-head label {
    display: grid;
    gap: 3px;
    min-width: 0;
    font-size: 12px;
}

.sanitaria-head input,
.sanitaria-head select {
    width: 100%;
    min-height: 26px;
    border: 1px solid #a9b8c9;
    background: #fff;
    padding: 2px 6px;
}

.sanitaria-paciente {
    min-width: 0;
}

.sanitaria-check {
    align-self: center;
    display: inline-flex !important;
    align-items: center;
    gap: 7px;
    padding-top: 16px;
    font-weight: 700;
}

.sanitaria-check input {
    width: 16px;
    height: 16px;
    min-height: 16px;
}

.sanitaria-foto {
    grid-row: span 2;
    display: grid;
    justify-items: center;
    gap: 4px;
    align-self: start;
    border: 1px solid #b7c8da;
    background: #fff;
    padding: 6px;
    min-height: 122px;
}

.sanitaria-foto img,
.sanitaria-foto .no-photo {
    width: 116px;
    height: 96px;
    object-fit: contain;
    display: grid;
    place-items: center;
    color: #64748b;
    background: #f8fafc;
    font-weight: 800;
}

.sanitaria-foto span {
    max-width: 130px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 11px;
    color: #50637c;
}

.sanitaria-text-grid {
    flex: 1 1 auto;
    min-height: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: minmax(190px, 1fr);
    gap: 14px 18px;
    padding: 16px;
    overflow: auto;
    background: #f4f7fb;
}

.sanitaria-text-grid label {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 5px;
    min-height: 0;
    font-weight: 800;
}

.sanitaria-text-grid textarea {
    width: 100%;
    min-height: 0;
    resize: none;
    border: 1px solid #a9b8c9;
    background: #fff;
    padding: 8px;
    font: inherit;
    font-weight: 400;
}

.tratamientos-filter-strip {
    grid-template-columns: minmax(240px, 320px) repeat(4, minmax(170px, 1fr));
}

.tratamientos-list-grid td {
    max-width: 300px;
}

.tratamiento-window {
    height: calc(100vh - 84px);
}

.tratamiento-head {
    display: grid;
    grid-template-columns: 120px minmax(360px, 1.35fr) 150px 150px 125px minmax(180px, 1fr);
    gap: 8px 12px;
    align-items: end;
    padding: 10px 16px;
    border-top: 1px solid #cfd8e3;
    border-bottom: 1px solid #cfd8e3;
    background: #f6f9fc;
}

.tratamiento-head label {
    display: grid;
    gap: 3px;
    min-width: 0;
    font-size: 12px;
}

.tratamiento-head input,
.tratamiento-head select,
.tratamiento-sesiones-grid input,
.tratamiento-sesiones-grid select {
    width: 100%;
    min-height: 26px;
    border: 1px solid #a9b8c9;
    background: #fff;
    padding: 2px 6px;
}

.trat-paciente {
    grid-column: span 2;
}

.tratamiento-check {
    display: inline-flex !important;
    align-items: center;
    gap: 7px;
    padding-top: 16px;
    font-weight: 700;
}

.tratamiento-check input {
    width: 16px;
    height: 16px;
    min-height: 16px;
}

.tratamiento-foto {
    grid-column: 6;
    grid-row: 1 / span 2;
    display: grid;
    justify-items: center;
    gap: 4px;
    align-self: start;
    border: 1px solid #b7c8da;
    background: #fff;
    padding: 6px;
    min-height: 112px;
}

.tratamiento-foto img,
.tratamiento-foto .no-photo {
    width: 120px;
    height: 88px;
    object-fit: contain;
    display: grid;
    place-items: center;
    color: #64748b;
    background: #f8fafc;
    font-weight: 800;
}

.tratamiento-foto span {
    max-width: 130px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 11px;
    color: #50637c;
}

.tratamiento-tabs {
    display: flex;
    gap: 4px;
    padding: 8px 16px 0;
    background: #eef4fb;
    border-bottom: 1px solid #cbd8e6;
}

.tratamiento-tabs button {
    min-height: 31px;
    padding: 5px 18px;
    border: 1px solid #9fb1c5;
    border-bottom: none;
    background: #dfe8f2;
    font-weight: 800;
}

.tratamiento-tabs button.active {
    background: #087f7f;
    border-color: #087f7f;
    color: #fff;
}

.tratamiento-descripcion,
.tratamiento-sesiones {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #f4f7fb;
}

.tratamiento-descripcion label {
    flex: 1 1 auto;
    min-height: 0;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 5px;
    padding: 14px 16px;
    font-weight: 800;
}

.tratamiento-descripcion textarea,
.tratamiento-sesiones-grid textarea {
    width: 100%;
    min-height: 52px;
    resize: none;
    overflow: hidden;
    border: 1px solid #a9b8c9;
    background: #fff;
    padding: 8px;
    font: inherit;
}

.tratamiento-sesiones-wrap {
    flex: 1 1 auto;
    min-height: 0;
}

.tratamiento-sesiones-grid {
    min-width: 100%;
}

.tratamiento-sesiones-grid th:nth-child(1),
.tratamiento-sesiones-grid td:nth-child(1),
.tratamiento-sesiones-grid th:nth-child(2),
.tratamiento-sesiones-grid td:nth-child(2) {
    width: 54px;
}

.tratamiento-sesiones-grid th:nth-child(3),
.tratamiento-sesiones-grid td:nth-child(3) {
    width: 150px;
}

.tratamiento-sesiones-grid th:nth-child(4),
.tratamiento-sesiones-grid td:nth-child(4) {
    width: 280px;
}

.row-icon-button.doc {
    width: 38px;
    height: 28px;
    border: 1px solid #7aa7cf;
    background: #fff;
    color: #0f4c81;
    font-size: 11px;
    font-weight: 900;
}

.row-icon-button.doc.has-documents {
    background: #facc15;
    border-color: #ca8a04;
    color: #111827;
}

.parte-cd-button {
    min-width: 132px !important;
    width: auto;
    padding-inline: 12px !important;
    white-space: nowrap;
}

.parte-cd-button.has-documents {
    background: #facc15 !important;
    border-color: #ca8a04 !important;
    color: #111827 !important;
}

.parte-cd-row-button {
    font-weight: 400;
    letter-spacing: 0;
}

.partes-trabajo-list-grid .grid-row-actions,
.partes-trabajo-list-grid .w-actions {
    min-width: 128px;
    width: 128px;
}

.tpv-product img,
.tpv-no-image {
    width: 100%;
    height: 96px;
    object-fit: contain;
    display: grid;
    place-items: center;
    background: #f3f8fc;
    color: #55708d;
}

.tpv-product strong {
    font-size: 13px;
    line-height: 1.2;
}

.tpv-product small {
    color: #526b86;
}

.tpv-ticket {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
    border-left: 1px solid #c8d6e4;
    background: #f8fbff;
}

.tpv-ticket h2 {
    margin: 0;
}

.tpv-ticket label {
    display: grid;
    gap: 5px;
    font-weight: 700;
}

.tpv-ticket input,
.tpv-ticket select {
    min-height: 30px;
    border: 1px solid #9fb1c5;
    padding: 3px 7px;
}

.tpv-lines {
    display: grid;
    gap: 6px;
    overflow: auto;
    max-height: 380px;
}

.tpv-line {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 54px 82px 30px;
    align-items: center;
    gap: 6px;
    padding: 7px;
    border: 1px solid #d4e0ec;
    background: #fff;
}

.tpv-line span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tpv-line button.danger {
    border: 1px solid #dc2626;
    color: #dc2626;
}

.tpv-total {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    border: 1px solid #9fb1c5;
    background: #eaf1f8;
}

.tpv-total strong {
    font-size: 24px;
}

.tpv-cobrar {
    min-height: 44px;
}

.tpv-touch-screen {
    height: calc(100vh - 92px);
    min-height: 720px;
    background: #f4f7fb;
    overflow: hidden;
    touch-action: manipulation;
}

.tpv-touch-toolbar {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 14px 16px;
    background: #f6f9fc;
    border-bottom: 1px solid #cbd8e6;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    touch-action: pan-x;
    -webkit-overflow-scrolling: touch;
}

.tpv-toolbar-spacer {
    flex: 1 1 auto;
    min-width: 18px;
}

.tpv-big,
.tpv-help {
    border: 0;
    border-radius: 6px;
    color: #fff;
    font-weight: 900;
    box-shadow: 0 2px 0 rgba(15,23,42,.18), inset 0 -1px 0 rgba(0,0,0,.16);
    transition: transform .08s ease, filter .08s ease;
}

.tpv-big:hover,
.tpv-help:hover,
.tpv-add-line:hover {
    filter: brightness(1.05);
    transform: translateY(-1px);
}

.tpv-big {
    min-width: 122px;
    min-height: 58px;
    padding: 0 14px;
}

.tpv-big:disabled,
.tpv-touch-card:disabled,
.row-icon-button:disabled {
    cursor: not-allowed;
    filter: grayscale(.45);
    opacity: .55;
    transform: none;
}

.tpv-help {
    min-width: 58px;
    min-height: 58px;
    background: #2f61df;
    font-size: 20px;
}

.tpv-viewport-switcher {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    flex: 0 0 auto;
    padding: 3px;
    border: 1px solid #bfd0e4;
    border-radius: 6px;
    background: #fff;
}

.tpv-viewport-switcher button {
    min-height: 26px;
    padding: 0 7px;
    border: 0;
    border-radius: 4px;
    background: #e9f1fa;
    color: #17324f;
    font-size: 11px;
    font-weight: 900;
}

.tpv-viewport-switcher button.active {
    background: #0e7890;
    color: #fff;
}

.tpv-teal { background: #149b8d; }
.tpv-blue-teal { background: #167c95; }
.tpv-blue { background: #2d61e8; }
.tpv-purple { background: #7c3fe5; }
.tpv-red-soft { background: #ef4444; }
.tpv-orange-dark { background: #dd7b00; }
.tpv-indigo { background: #5144df; }
.tpv-cyan { background: #1598b0; }
.tpv-green { background: #18a34a; }
.tpv-amber { background: #d69000; }
.tpv-green-dark { background: #0c9870; }
.tpv-red-dark { background: #bd171d; }
.tpv-red { background: #e3262c; }

.tpv-touch-layout {
    height: calc(100% - 87px);
    display: grid;
    grid-template-columns: minmax(720px, 760px) minmax(420px, 1fr) 260px;
    gap: 12px;
    padding: 0 16px 16px;
    min-width: 0;
}

.tpv-sale-panel,
.tpv-products-panel,
.tpv-families-panel {
    min-height: 0;
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #c8d6e4;
}

.tpv-readonly-notice {
    margin: 0 16px 10px;
    padding: 8px 12px;
    border: 1px solid #b91c1c;
    background: #fee2e2;
    color: #7f1d1d;
    font-size: 13px;
    font-weight: 900;
}

.tpv-sale-panel {
    padding: 12px 16px 16px;
}

.tpv-sale-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 150px;
    gap: 10px;
    border-bottom: 1px solid #d8e2ef;
    padding-bottom: 6px;
}

.tpv-sale-head h1 {
    margin: 0 0 10px;
    font-size: 24px;
}

.tpv-head-grid {
    display: grid;
    grid-template-columns: 150px minmax(190px, 1fr) 140px;
    gap: 6px 12px;
    align-items: end;
}

.tpv-head-grid label,
.tpv-entry-row label,
.tpv-cobro-dialog label {
    display: grid;
    gap: 3px;
    min-width: 0;
    font-size: 12px;
    color: #001f4b;
}

.tpv-col-2 {
    grid-column: span 2;
}

.tpv-col-3 {
    grid-column: span 3;
}

.tpv-head-grid input,
.tpv-head-grid select,
.tpv-head-grid .article-lookup-input,
.tpv-entry-row input,
.tpv-entry-row select,
.tpv-cobro-dialog input,
.tpv-cobro-dialog select {
    height: 24px;
    border: 1px solid #8b98aa;
    background: #fff;
    padding: 2px 4px;
    font: inherit;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.tpv-client-lookup .article-lookup-results {
    width: min(520px, 54vw);
}

.tpv-table-selector {
    width: 100%;
    display: grid;
    gap: 5px;
    margin-top: 6px;
    color: #001f4b;
    font-size: 12px;
    font-weight: 800;
}

.tpv-table-selector > div {
    display: grid;
    grid-template-columns: 70px 1fr;
    gap: 6px;
}

.tpv-table-selector button {
    min-height: 28px;
    border: 0;
    background: #07867d;
    color: #fff;
    font: inherit;
    font-weight: 900;
    cursor: pointer;
}

.tpv-table-selector input {
    width: 100%;
    min-width: 0;
    height: 28px;
    border: 1px solid #8b98aa;
    background: #fff;
    padding: 2px 4px;
    font: inherit;
    box-sizing: border-box;
}

.tpv-client-area,
.tpv-cash-status {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    padding: 4px 8px 10px;
    background: #eef7fb;
    color: #008a23;
    font-weight: 800;
    font-size: 12px;
}

.tpv-cash-icon,
.tpv-client-image-frame,
.tpv-client-photo {
    width: 126px;
    height: 138px;
    flex: 0 0 138px;
    display: grid;
    place-items: center;
    border: 1px solid #9fb1c5;
    background: linear-gradient(#d9f4ff, #ffffff);
    color: #075985;
    font-size: 26px;
    font-weight: 900;
    overflow: hidden;
    line-height: 0;
}

.tpv-tables-backdrop {
    align-items: center;
    justify-content: center;
    padding: 18px;
}

.tpv-tables-panel {
    width: 780px;
    height: 560px;
    max-width: calc(100vw - 36px);
    max-height: calc(100vh - 36px);
    display: grid;
    grid-template-rows: 46px minmax(0, 1fr);
    padding: 10px;
    border: 1px solid #4b5563;
    background: #fff;
    box-shadow: 0 16px 38px rgba(15, 23, 42, .28);
}

.tpv-tables-header {
    display: grid;
    grid-template-columns: 190px 1fr 90px;
    gap: 10px;
    align-items: center;
}

.tpv-tables-header h3 {
    margin: 0;
    color: #0f172a;
    font-size: 20px;
    font-weight: 900;
}

.tpv-tables-header label {
    display: grid;
    grid-template-columns: 54px 1fr;
    gap: 8px;
    align-items: center;
    color: #001f4b;
    font-size: 12px;
}

.tpv-tables-header select {
    height: 24px;
    border: 1px solid #8b98aa;
    background: #fff;
    font: inherit;
}

.tpv-tables-header button {
    height: 36px;
    border: 0;
    background: #dc2626;
    color: #fff;
    font: inherit;
    font-weight: 900;
    cursor: pointer;
}

.tpv-tables-canvas {
    position: relative;
    overflow: auto;
    border: 1px solid #555;
    background-color: #fff;
    background-repeat: no-repeat;
    background-size: 100% 100%;
}

.tpv-table-item {
    position: absolute;
    width: 112px;
    height: 120px;
    display: grid;
    grid-template-rows: 84px 34px;
    place-items: stretch;
    padding: 1px;
    border: 1px solid #1f2937;
    background: #fff;
    color: #000;
    cursor: pointer;
}

.tpv-table-item.occupied {
    border: 4px solid #dc2626;
    color: #dc2626;
}

.tpv-table-item img {
    width: 100%;
    height: 84px;
    object-fit: contain;
}

.tpv-table-item strong {
    display: grid;
    place-items: center;
    min-width: 0;
    overflow: hidden;
    font-size: 13px;
    font-weight: 900;
    text-align: center;
}

.tpv-table-shape {
    width: 58px;
    height: 44px;
    align-self: center;
    justify-self: center;
    border: 2px solid #111827;
    background: #a9947d;
}

.tpv-tables-empty {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: #475569;
    font-weight: 800;
}

.gesbar-salons-config {
    min-height: calc(100vh - 86px);
    display: grid;
    grid-template-rows: 82px minmax(0, 1fr);
    background: #f5f8fc;
}

.gesbar-salons-header {
    display: grid;
    grid-template-columns: minmax(760px, 1fr) 390px 112px;
    gap: 14px;
    align-items: end;
    padding: 14px 22px 5px;
    background: #f5f8fc;
}

.gesbar-salons-header h1 {
    margin: 0 0 4px;
    color: #051730;
    font-size: 24px;
    font-weight: 900;
}

.gesbar-salons-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
}

.gesbar-salons-toolbar label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #001f4b;
    font-size: 13px;
}

.gesbar-salons-toolbar select {
    width: 330px;
    height: 28px;
    border: 1px solid #8b98aa;
    background: #fff;
}

.gesbar-file-action {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    cursor: pointer;
}

.gesbar-file-action input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.gesbar-salons-right-title {
    align-self: end;
    color: #051730;
    font-size: 20px;
    font-weight: 900;
}

.gesbar-salons-layout {
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(600px, 2fr) minmax(360px, 1fr);
    gap: 18px;
    padding: 16px 18px 20px;
    background: #e2e8f0;
}

.gesbar-plan-wrap,
.gesbar-table-catalog {
    min-height: 0;
    display: grid;
    background: #f5f8fc;
}

.gesbar-plan-wrap {
    grid-template-rows: 32px minmax(0, 1fr);
    padding: 0 6px 0 2px;
}

.gesbar-plan-wrap h2 {
    margin: 0;
    color: #051730;
    font-size: 17px;
    font-weight: 900;
}

.gesbar-plan-canvas {
    position: relative;
    min-height: 560px;
    overflow: auto;
    border: 1px solid #555;
    background-color: #fff;
    background-repeat: no-repeat;
    background-size: 100% 100%;
}

.gesbar-plan-table {
    position: absolute;
    width: 96px;
    height: 112px;
    display: grid;
    grid-template-rows: 88px 20px;
    background: transparent;
    color: #051730;
    cursor: move;
}

.gesbar-plan-table img {
    width: 88px;
    height: 88px;
    justify-self: center;
    border: 1px solid #333;
    background: #fff;
    object-fit: contain;
}

.gesbar-plan-table > span {
    width: 70px;
    height: 48px;
    align-self: center;
    justify-self: center;
    border: 2px solid #111827;
    background: #a9947d;
}

.gesbar-plan-table strong {
    overflow: hidden;
    font-size: 12px;
    font-weight: 900;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gesbar-plan-empty,
.gesbar-catalog-empty {
    display: grid;
    place-items: center;
    min-height: 120px;
    color: #53657f;
    font-weight: 800;
}

.gesbar-table-catalog {
    grid-template-rows: 34px minmax(0, 1fr);
    gap: 8px;
    padding: 10px;
}

.gesbar-catalog-scroll {
    min-height: 0;
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
    gap: 16px;
    overflow: auto;
    padding: 22px 18px 18px;
    border: 1px solid #555;
    background: #fff;
}

.gesbar-catalog-card {
    width: 132px;
    height: 158px;
    display: grid;
    grid-template-rows: 98px 42px;
    gap: 6px;
    padding: 10px 6px 6px;
    border: 1px solid #555;
    background: #fff;
    cursor: grab;
}

.gesbar-catalog-card img {
    width: 110px;
    height: 88px;
    justify-self: center;
    object-fit: contain;
}

.gesbar-catalog-card strong {
    display: grid;
    place-items: center;
    overflow: hidden;
    color: #051730;
    font-size: 12px;
    font-weight: 900;
    text-align: center;
}

.gesbar-salon-dialog {
    width: min(900px, calc(100vw - 32px));
    max-height: calc(100vh - 32px);
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr);
}

.gesbar-salon-dialog-actions {
    display: flex;
    gap: 10px;
    padding: 10px 14px;
    background: #f5f8fc;
}

.gesbar-salon-grid-wrap {
    min-height: 0;
    overflow: auto;
    background: #fff;
}

.gesbar-salon-grid {
    min-width: 720px;
}

.gesbar-salon-grid th:nth-child(1),
.gesbar-salon-grid td:nth-child(1),
.gesbar-salon-grid th:nth-child(2),
.gesbar-salon-grid td:nth-child(2) {
    width: 38px;
    text-align: center;
}

.gesbar-salon-grid th:nth-child(3),
.gesbar-salon-grid td:nth-child(3) {
    width: 110px;
}

.gesbar-salon-grid th:nth-child(4),
.gesbar-salon-grid td:nth-child(4) {
    width: 360px;
}

.gesbar-salon-grid th:nth-child(5),
.gesbar-salon-grid td:nth-child(5) {
    width: 96px;
    text-align: center;
}

.gesbar-salon-grid input:not([type="checkbox"]) {
    width: 100%;
    min-height: 28px;
    border: 1px solid #8b98aa;
    background: #fff;
    padding: 2px 4px;
    font: inherit;
}

.reservations-panel {
    min-height: calc(100vh - 86px);
    display: grid;
    grid-template-rows: auto auto auto minmax(0, 1fr);
    background: #f5f8fc;
}

.reservations-header {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) auto;
    gap: 16px;
    align-items: center;
    padding: 16px 20px 10px;
    border-bottom: 1px solid #c8d6e4;
}

.reservations-header h1 {
    margin: 0;
    color: #051730;
    font-size: 25px;
    font-weight: 900;
}

.reservations-header span {
    color: #406282;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.reservations-actions,
.reservations-filters {
    display: flex;
    align-items: end;
    gap: 10px;
}

.reservations-filters {
    padding: 10px 20px;
    border-bottom: 1px solid #d5e0ec;
    background: #eaf2f9;
}

.reservations-filters label {
    display: grid;
    gap: 4px;
    color: #001f4b;
    font-size: 12px;
    font-weight: 900;
}

.reservations-filters select,
.reservations-filters input {
    height: 30px;
    border: 1px solid #8b98aa;
    background: #fff;
    padding: 3px 6px;
    font: inherit;
}

.reservations-filters label:first-child select {
    width: 340px;
}

.reservations-search-filter {
    margin-left: 18px;
}

.reservations-search-filter input {
    width: 320px;
}

.reservations-tables-panel {
    padding: 10px 20px;
    border-bottom: 1px solid #d5e0ec;
    background: #fff;
}

.reservations-tables-title {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 8px;
    color: #051730;
}

.reservations-tables-title strong {
    font-size: 16px;
    font-weight: 900;
}

.reservations-tables-title span {
    color: #475569;
    font-size: 12px;
    font-weight: 800;
}

.reservations-tables-list {
    min-height: 112px;
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
    gap: 8px;
    overflow: auto;
}

.reservation-table-card {
    width: 104px;
    height: 106px;
    display: grid;
    grid-template-rows: 50px 20px 18px;
    place-items: center;
    padding: 6px;
    border: 1px solid #111827;
    background: #fff;
    color: #051730;
    cursor: pointer;
}

.reservation-table-card.available {
    border-color: #15803d;
    background: #f0fdf4;
}

.reservation-table-card.occupied {
    border-color: #dc2626;
    background: #fef2f2;
    color: #991b1b;
}

.reservation-table-card img {
    max-width: 82px;
    max-height: 48px;
    object-fit: contain;
}

.reservation-table-card strong {
    max-width: 100%;
    overflow: hidden;
    font-size: 12px;
    font-weight: 900;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.reservation-table-card span {
    font-size: 10px;
    font-weight: 900;
}

.reservations-empty {
    display: grid;
    place-items: center;
    min-height: 90px;
    color: #53657f;
    font-weight: 800;
}

.reservations-grid-section {
    min-height: 0;
    overflow: auto;
    padding: 10px 20px 20px;
}

.reservations-grid {
    width: 100%;
    min-width: 1460px;
    table-layout: fixed;
}

.reservations-grid th:nth-child(1),
.reservations-grid td:nth-child(1) {
    width: 150px;
    text-align: center;
}

.reservations-grid th:nth-child(2),
.reservations-grid td:nth-child(2) {
    width: 82px;
}

.reservations-grid th:nth-child(3),
.reservations-grid td:nth-child(3) {
    width: 330px;
}

.reservations-grid th:nth-child(4),
.reservations-grid td:nth-child(4) {
    width: 150px;
}

.reservations-grid th:nth-child(5),
.reservations-grid td:nth-child(5) {
    width: 96px;
}

.reservations-grid th:nth-child(6),
.reservations-grid td:nth-child(6) {
    width: 140px;
}

.reservations-grid th:nth-child(7),
.reservations-grid td:nth-child(7) {
    width: 520px;
}

.reservations-grid input,
.reservations-grid select,
.reservations-grid textarea {
    width: 100%;
    min-width: 0;
    border: 1px solid #8b98aa;
    background: #fff;
    padding: 3px 5px;
    font: inherit;
    box-sizing: border-box;
}

.reservations-grid input,
.reservations-grid select {
    height: 28px;
}

.reservations-grid textarea {
    min-height: 38px;
    resize: vertical;
}

.reservation-row-actions {
    white-space: nowrap;
}

.reservation-row-button {
    min-width: 62px;
    height: 28px;
    margin: 0 2px;
    border: 1px solid #9aa8b8;
    border-radius: 6px;
    color: #111827;
    font: inherit;
    font-weight: 400;
    cursor: pointer;
}

.reservation-row-button.delete {
    background: #ffb3b8;
    border-color: #ef6f7a;
}

.reservation-row-button.save {
    background: #8fe1a5;
    border-color: #49b96a;
}

.reservation-row-button:hover,
.reservation-row-button:focus-visible {
    filter: brightness(.97);
}

.reservation-row-button:disabled {
    cursor: not-allowed;
    opacity: .55;
}

@media (max-width: 700px) {
    .reservations-panel {
        min-height: 100dvh;
        display: block;
        overflow-y: auto;
        background: #f5f8fc;
    }

    .reservations-header {
        display: grid;
        grid-template-columns: 1fr;
        gap: 8px;
        padding: 10px 8px;
    }

    .reservations-header h1 {
        font-size: 24px;
        line-height: 1.05;
    }

    .reservations-actions {
        justify-content: stretch;
        gap: 6px;
    }

    .reservations-actions .app-btn {
        flex: 1 1 0;
        min-width: 0;
        min-height: 36px;
        padding: 6px 8px;
        font-size: 12px;
    }

    .reservations-filters {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        padding: 8px;
    }

    .reservations-filters label:first-child,
    .reservations-search-filter {
        grid-column: 1 / -1;
        margin-left: 0;
    }

    .reservations-filters label:first-child select,
    .reservations-search-filter input,
    .reservations-filters select,
    .reservations-filters input {
        width: 100%;
        min-width: 0;
        height: 34px;
    }

    .reservations-tables-panel {
        padding: 8px;
    }

    .reservations-tables-title {
        align-items: flex-start;
        justify-content: space-between;
        gap: 8px;
    }

    .reservations-tables-title span {
        text-align: right;
    }

    .reservations-tables-list {
        min-height: 0;
        max-height: 140px;
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        padding-bottom: 4px;
    }

    .reservation-table-card {
        flex: 0 0 96px;
        width: 96px;
        height: 96px;
        grid-template-rows: 42px 20px 17px;
    }

    .reservation-table-card img {
        max-width: 76px;
        max-height: 40px;
    }

    .reservations-grid-section {
        padding: 8px;
        overflow: visible;
    }

    .reservations-grid {
        min-width: 0;
        border-spacing: 0 8px;
        border-collapse: separate;
    }

    .reservations-grid thead {
        display: none;
    }

    .reservations-grid tbody,
    .reservations-grid tr,
    .reservations-grid td {
        display: block;
        width: 100% !important;
    }

    .reservations-grid tr {
        padding: 8px;
        border: 1px solid #bfd0e2;
        border-radius: 8px;
        background: #fff;
        box-shadow: 0 1px 4px rgba(15, 23, 42, .08);
    }

    .reservations-grid td {
        border: 0;
        padding: 5px 0;
        text-align: left;
    }

    .reservations-grid td::before {
        content: attr(data-label);
        display: block;
        margin-bottom: 3px;
        color: #001f4b;
        font-size: 11px;
        font-weight: 900;
    }

    .reservations-grid td.reservation-row-actions::before {
        display: none;
    }

    .reservation-row-actions {
        display: grid !important;
        grid-template-columns: 1fr 1fr;
        gap: 7px;
        padding-top: 0 !important;
        white-space: normal;
    }

    .reservation-row-button {
        width: 100%;
        min-width: 0;
        height: 36px;
        margin: 0;
        font-size: 13px;
    }

    .reservations-grid input,
    .reservations-grid select {
        height: 36px;
        font-size: 15px;
    }

    .reservations-grid textarea {
        min-height: 72px;
        font-size: 15px;
    }
}

.tpv-client-image-frame img,
.tpv-client-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    display: block;
    max-width: 100%;
    max-height: 100%;
}

.tpv-client-image-frame-tpv img {
    object-fit: contain;
    object-position: center;
    padding: 4px;
    box-sizing: border-box;
}

.tpv-client-image-frame.missing::after,
.tpv-client-photo.missing::after {
    content: "TPV";
    font-size: 26px;
    font-weight: 900;
}

.tpv-client-image-frame span,
.tpv-client-photo span {
    font-size: 26px;
}

.tpv-client-ref-button,
.tpv-ref-button {
    width: 100%;
    min-height: 34px;
    flex: 0 0 auto;
    border: 0;
    background: #0e7890;
    color: #fff;
    font-weight: 900;
    align-self: start;
}

.tpv-entry-row {
    display: grid;
    grid-template-columns: 72px 118px minmax(240px, 1fr) 48px 56px 52px 66px;
    gap: 8px 10px;
    padding: 8px 0 6px;
    align-items: end;
}

.tpv-entry-row label span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 11px;
}

.tpv-add-line {
    min-height: 24px;
    align-self: end;
    border: 0;
    border-radius: 5px;
    background: #16a34a;
    color: #fff;
    font-size: 12px;
    font-weight: 900;
}

.tpv-entry-desc {
    min-width: 0;
}

.tpv-ticket-table-wrap {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    overscroll-behavior: contain;
    touch-action: pan-x pan-y;
    -webkit-overflow-scrolling: touch;
    border: 1px solid #d2deeb;
    background: #fff;
    cursor: grab;
}

.tpv-ticket-table-wrap.drag-scrolling {
    cursor: grabbing;
}

.tpv-ticket-grid {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.tpv-ticket-grid th {
    position: sticky;
    top: 0;
    z-index: 1;
    height: 34px;
    background: #101827;
    color: #fff;
    text-align: left;
    padding: 4px 6px;
    border-right: 1px solid #b9c8d8;
}

.tpv-ticket-grid td {
    height: 32px;
    padding: 3px 6px;
    border: 1px solid #d7e1ec;
}

.tpv-ticket-grid td:nth-child(4),
.tpv-ticket-grid td:nth-child(5),
.tpv-ticket-grid td:nth-child(6),
.tpv-ticket-grid td:nth-child(7),
.tpv-ticket-grid td:nth-child(8) {
    text-align: right;
}

.tpv-sale-bottom {
    display: grid;
    gap: 0;
    padding-top: 8px;
}

.tpv-total-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.tpv-total-cards div {
    min-height: 58px;
    display: grid;
    place-items: center;
    background: #f0f4f9;
    color: #071225;
    font-weight: 900;
}

.tpv-total-cards span,
.tpv-total-cards strong {
    display: block;
}

.tpv-final-total {
    background: #101827 !important;
    color: #fff !important;
    font-size: 18px;
}

.tpv-products-panel header,
.tpv-families-panel header {
    padding: 10px 12px 6px;
    color: #001327;
    font-size: 18px;
    font-weight: 900;
}

.tpv-touch-card-grid,
.tpv-family-card-grid {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    overscroll-behavior: contain;
    touch-action: pan-y;
    -webkit-overflow-scrolling: touch;
    padding: 14px 20px;
    align-content: start;
    cursor: grab;
}

.tpv-touch-card-grid.drag-scrolling,
.tpv-family-card-grid.drag-scrolling,
.tpv-touch-toolbar.drag-scrolling {
    cursor: grabbing;
}

.tpv-touch-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(116px, 1fr));
    gap: 8px;
}

.tpv-family-card-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.tpv-touch-card,
.tpv-family-card {
    display: grid;
    grid-template-rows: 88px minmax(38px, auto);
    gap: 4px;
    width: 100%;
    min-height: 134px;
    border: 1px solid #8d98a8;
    background: #fff;
    padding: 0 6px 6px;
    color: #000;
    text-align: center;
    font-weight: 900;
    -webkit-user-select: none;
    user-select: none;
}

.tpv-touch-card img,
.tpv-family-card img {
    -webkit-user-drag: none;
    user-select: none;
}

.tpv-touch-card.frequent {
    border-color: #16a34a;
    box-shadow: inset 0 0 0 2px #16a34a;
}

.tpv-family-card {
    grid-template-rows: 88px minmax(38px, auto);
    min-height: 142px;
}

.tpv-family-card.active {
    outline: 3px solid #087f7f;
}

.tpv-touch-screen .tpv-touch-card,
.tpv-touch-screen .tpv-family-card,
.tpv-touch-screen .tpv-touch-card.frequent,
.tpv-touch-screen .tpv-family-card.active {
    border: 1px solid #000;
    box-shadow: none;
    outline: 0;
}

.tpv-touch-card img,
.tpv-family-card img,
.tpv-card-empty {
    width: 100%;
    height: 88px;
    object-fit: contain;
    background: #fff;
}

.tpv-touch-card strong,
.tpv-family-card strong {
    display: block;
    align-self: center;
    font-size: 10px;
    font-weight: 400;
    line-height: 1;
}

.tpv-cobro-dialog {
    width: 520px;
    max-width: calc(100vw - 48px);
    padding: 0;
    overflow: hidden;
    border: 1px solid #9fb1c5;
    border-radius: 4px;
    background: #f8fbff;
}

.tpv-cobro-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 18px 14px;
    border-bottom: 1px solid #cbd8e6;
    background: #eef6fc;
}

.tpv-cobro-icon {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #0c9870;
    color: #fff;
    font-size: 24px;
    font-weight: 900;
}

.tpv-cobro-header h3 {
    margin: 0;
    color: #071225;
    font-size: 28px;
    line-height: 1.05;
}

.tpv-cobro-header p {
    margin: 4px 0 0;
    color: #48617d;
    font-weight: 800;
}

.tpv-cobro-dialog .dialog-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 16px;
    padding: 18px;
}

.tpv-cobro-dialog label {
    font-size: 13px;
    font-weight: 900;
}

.tpv-cobro-dialog input,
.tpv-cobro-dialog select {
    height: 34px;
    font-size: 16px;
}

.tpv-cobro-total {
    grid-row: span 2;
}

.tpv-cobro-total input {
    height: 82px;
    background: #101827;
    color: #fff;
    border-color: #101827;
    text-align: right;
    font-size: 38px;
    font-weight: 900;
    padding-right: 14px;
}

.tpv-cobro-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 0 18px 18px;
}

.tpv-cobro-actions .app-btn {
    min-width: 132px;
    min-height: 36px;
}

.tpv-cambio-backdrop {
    background: rgba(12, 17, 27, .34);
}

.tpv-cambio-panel {
    width: min(1020px, calc(100vw - 32px));
    max-width: calc(100vw - 32px);
    padding: 10px 16px 20px;
    border: 1px solid #5b6270;
    border-radius: 6px;
    background: #fff;
    color: #000;
    box-shadow: 0 18px 46px rgba(0, 0, 0, .28);
    font-family: Arial, "Segoe UI", sans-serif;
}

.tpv-cambio-main {
    display: grid;
    grid-template-columns: minmax(390px, 1fr) minmax(430px, .95fr);
    gap: 22px;
    align-items: start;
}

.tpv-cambio-left {
    min-width: 0;
}

.tpv-cambio-panel.split-mode {
    width: min(850px, calc(100vw - 32px));
}

.tpv-cambio-close {
    display: block;
    width: 105px;
    height: 34px;
    margin-left: auto;
    border: 0;
    border-radius: 6px;
    background: #e21f2f;
    color: #fff;
    font-weight: 700;
    cursor: pointer;
}

.tpv-cambio-title-row {
    display: grid;
    grid-template-columns: 156px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    margin: 18px 2px 12px 0;
}

.tpv-cambio-title-row span,
.tpv-cambio-form label {
    text-align: right;
    font-size: 16px;
    font-weight: 700;
}

.tpv-cambio-title-row strong {
    min-width: 0;
    font-size: 18px;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.tpv-cambio-form {
    display: grid;
    grid-template-columns: 156px minmax(0, 1fr);
    align-items: center;
    gap: 10px 12px;
}

.tpv-cambio-form input,
.tpv-cambio-form select {
    width: 100%;
    height: 31px;
    min-width: 0;
    border: 1px solid #9da5b1;
    border-radius: 0;
    background: #fff;
    color: #000;
    font-size: 16px;
    line-height: 1.2;
}

.tpv-payment-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
}

.tpv-payment-row button {
    min-height: 31px;
    border: 1px solid #087f6f;
    border-radius: 4px;
    padding: 4px 12px;
    background: #087f6f;
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
    cursor: pointer;
}

.tpv-cash-selector {
    min-width: 0;
    padding: 14px;
    border: 1px solid #aeb9c7;
    background: #f4f7fa;
}

.tpv-cash-selector > header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.tpv-cash-selector > header strong {
    font-size: 17px;
}

.tpv-cash-selector > header button {
    border: 1px solid #9ba9ba;
    padding: 5px 10px;
    background: #fff;
    color: #26364a;
    font-weight: 700;
    cursor: pointer;
}

.tpv-banknotes {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
}

.tpv-banknotes .banknote {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    aspect-ratio: 2.15 / 1;
    overflow: hidden;
    border: 2px solid rgba(20, 30, 45, .38);
    border-radius: 5px;
    padding: 8px 12px;
    color: #172033;
    box-shadow: inset 0 0 0 3px rgba(255, 255, 255, .45), 0 2px 5px rgba(15, 23, 42, .16);
    cursor: pointer;
}

.tpv-banknotes .banknote::before {
    content: "€";
    position: absolute;
    inset: 8px auto auto 50%;
    color: rgba(255, 255, 255, .52);
    font-size: 42px;
    font-weight: 900;
    transform: translateX(-50%);
}

.tpv-banknotes .banknote span,
.tpv-banknotes .banknote small {
    position: relative;
    z-index: 1;
    font-weight: 900;
}

.tpv-banknotes .banknote span { font-size: 23px; }
.tpv-banknotes .banknote small { font-size: 10px; letter-spacing: 0; }
.tpv-banknotes .banknote-5 { background: #c5c7c7; }
.tpv-banknotes .banknote-10 { background: #e89a93; }
.tpv-banknotes .banknote-20 { background: #82b9dc; }
.tpv-banknotes .banknote-50 { background: #e9b16c; }
.tpv-banknotes .banknote-100 { background: #8fc6a6; }
.tpv-banknotes .banknote-200 { background: #e4d179; }
.tpv-banknotes .banknote-500 { background: #b79acb; }

.tpv-coins {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 11px;
    margin-top: 15px;
}

.tpv-coins .coin {
    display: grid;
    place-items: center;
    width: 64px;
    max-width: 100%;
    aspect-ratio: 1;
    justify-self: center;
    border: 3px solid #a87633;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 28%, #fff4b0 0, #dcb457 42%, #9b681e 100%);
    color: #3c2b13;
    box-shadow: inset 0 0 0 3px rgba(255, 255, 255, .35), 0 2px 5px rgba(15, 23, 42, .2);
    font-size: 14px;
    font-weight: 900;
    cursor: pointer;
}

.tpv-coins .coin-0-01,
.tpv-coins .coin-0-02,
.tpv-coins .coin-0-05 {
    border-color: #9a5633;
    background: radial-gradient(circle at 35% 28%, #ffd1a8 0, #c8764d 48%, #794025 100%);
}

.tpv-coins .coin-1,
.tpv-coins .coin-2 {
    border-color: #b4b9bd;
    background: radial-gradient(circle, #e7bd5b 0 52%, #cbd0d4 54% 72%, #8b9298 100%);
}

.tpv-banknotes button:hover,
.tpv-coins button:hover {
    filter: brightness(1.06);
    transform: translateY(-1px);
}

.tpv-banknotes button:active,
.tpv-coins button:active {
    transform: translateY(1px);
}

.tpv-cambio-form input {
    padding: 2px 3px;
    text-align: right;
    font-weight: 700;
}

.tpv-cambio-form select {
    padding: 2px 4px;
    font-size: 13px;
}

.tpv-cambio-actions {
    display: grid;
    gap: 8px;
    margin-top: 18px;
}

@media (max-width: 850px), (max-height: 760px) {
    .tpv-cambio-panel:not(.split-mode) {
        max-height: calc(100vh - 20px);
        overflow: auto;
    }

    .tpv-cambio-main {
        grid-template-columns: 1fr;
    }

    .tpv-banknotes {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .tpv-coins {
        grid-template-columns: repeat(8, minmax(0, 1fr));
    }

    .tpv-coins .coin {
        width: 52px;
    }
}

.tpv-cambio-action {
    width: 100%;
    min-height: 47px;
    border: 0;
    border-radius: 6px;
    color: #fff;
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
}

.tpv-cambio-panel .tpv-cambio-action {
    border-radius: 8px !important;
    overflow: hidden;
}

.tpv-cambio-action.cobrar {
    background: #0ca06f;
}

.tpv-cambio-action.pedido {
    background: #f4c21d;
    color: #071225;
}

.tpv-cambio-action.ticket {
    background: #108b7c;
}

.tpv-cambio-action.proforma {
    background: #e88000;
}

.tpv-cambio-action.epigrafes {
    background: #8138ea;
}

.tpv-cambio-action.split {
    background: #8138ea;
}

.tpv-cambio-action.factura {
    background: #2f64e3;
}

.tpv-cambio-action.aparcar {
    background: #6c7c91;
}

.tpv-split-body {
    display: grid;
    grid-template-rows: auto auto auto minmax(0, 1fr) auto;
    gap: 10px;
    max-height: min(74vh, 650px);
}

.tpv-split-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.tpv-split-summary span {
    display: grid;
    place-items: center;
    min-height: 48px;
    border: 1px solid #9da5b1;
    background: #f3f7fb;
    font-size: 13px;
    font-weight: 800;
}

.tpv-split-summary b {
    display: block;
    font-size: 18px;
}

.tpv-split-accounts {
    display: flex;
    gap: 8px;
    overflow-x: auto;
}

.tpv-split-accounts button {
    flex: 0 0 116px;
    min-height: 58px;
    border: 1px solid #9da5b1;
    border-radius: 6px;
    background: #fff;
    color: #071225;
    font-weight: 800;
    cursor: pointer;
}

.tpv-split-accounts button.active {
    border-color: #2f64e3;
    box-shadow: inset 0 0 0 2px #2f64e3;
}

.tpv-split-accounts button.add {
    flex-basis: 48px;
    background: #16a34a;
    color: #fff;
    font-size: 24px;
}

.tpv-split-accounts span,
.tpv-split-accounts b,
.tpv-split-accounts small {
    display: block;
}

.tpv-split-accounts small {
    color: #16a34a;
    font-size: 11px;
}

.tpv-split-pay {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, .8fr) minmax(0, .8fr);
    gap: 8px;
}

.tpv-split-pay label {
    display: grid;
    gap: 4px;
    font-size: 13px;
    font-weight: 800;
}

.tpv-split-pay select,
.tpv-split-pay input {
    width: 100%;
    min-height: 34px;
    border: 1px solid #9da5b1;
    background: #fff;
    color: #071225;
    font-size: 14px;
    font-weight: 800;
    padding: 2px 6px;
}

.tpv-split-pay input {
    text-align: right;
}

.tpv-split-grid {
    min-height: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.tpv-split-grid section {
    min-height: 0;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    border: 1px solid #c9d3df;
    background: #fff;
}

.tpv-split-grid h3 {
    margin: 0;
    padding: 8px 10px;
    border-bottom: 1px solid #c9d3df;
    background: #edf3fa;
    font-size: 14px;
    font-weight: 800;
}

.tpv-split-list {
    min-height: 0;
    overflow-y: auto;
    padding: 6px;
}

.tpv-split-list article {
    min-height: 52px;
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    align-items: center;
    gap: 7px;
    border-bottom: 1px solid #edf2f7;
}

.tpv-split-list button {
    width: 32px;
    height: 32px;
    border: 1px solid #8aa0ba;
    border-radius: 5px;
    background: #f1f6fb;
    color: #06162b;
    font-size: 19px;
    font-weight: 900;
    cursor: pointer;
}

.tpv-split-list button:disabled {
    opacity: .45;
    cursor: default;
}

.tpv-split-list b,
.tpv-split-list small {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tpv-split-list b {
    font-size: 14px;
}

.tpv-split-list small {
    margin-top: 2px;
    color: #4b5f77;
    font-size: 12px;
    font-weight: 700;
}

.tpv-split-list p {
    margin: 24px 0;
    text-align: center;
    color: #5d6d80;
    font-weight: 800;
}

.tpv-split-actions {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

.tpv-split-actions button {
    min-height: 46px;
    border: 0;
    border-radius: 7px;
    color: #fff;
    font-size: 14px;
    font-weight: 900;
    cursor: pointer;
}

.tpv-split-actions .ticket {
    background: #2f64e3;
}

.tpv-split-actions .charge {
    background: #16a34a;
}

.tpv-split-actions .finish {
    background: #0ca06f;
}

.tpv-split-actions .cancel {
    background: #6c7c91;
}

.tpv-split-actions button:disabled {
    opacity: .55;
    cursor: default;
}

.tpv-session-backdrop {
    background: rgba(12, 17, 27, .18);
}

.tpv-session-panel {
    width: min(1280px, calc(100vw - 40px));
    height: min(760px, calc(100vh - 80px));
    display: grid;
    grid-template-rows: 56px minmax(0, 1fr);
    border: 1px solid #5b6270;
    background: #fff;
    box-shadow: 0 18px 46px rgba(0, 0, 0, .24);
}

.tpv-session-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 9px 14px;
    background: #f8fafc;
}

.tpv-session-header h3 {
    margin: 0;
    color: #0f172a;
    font-size: 22px;
    font-weight: 800;
}

.tpv-session-close {
    width: 105px;
    height: 34px;
    border: 0;
    background: #dc2626;
    color: #fff;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
}

.tpv-session-grid-wrap {
    min-height: 0;
    overflow: auto;
    padding: 0 12px 12px;
    background: #fff;
}

.tpv-session-grid {
    min-width: 1060px;
    width: 100%;
    border-collapse: collapse;
    color: #000;
    font-size: 14px;
}

.tpv-session-grid th:nth-child(1),
.tpv-session-grid td:nth-child(1) {
    min-width: 130px;
}

.tpv-session-grid th:nth-child(2),
.tpv-session-grid td:nth-child(2) {
    min-width: 90px;
}

.tpv-session-grid th:nth-child(3),
.tpv-session-grid td:nth-child(3) {
    min-width: 320px;
}

.tpv-session-grid th:nth-child(4),
.tpv-session-grid td:nth-child(4) {
    min-width: 150px;
}

.tpv-session-grid th:nth-child(5),
.tpv-session-grid td:nth-child(5) {
    min-width: 120px;
}

.tpv-session-grid th:nth-child(6),
.tpv-session-grid td:nth-child(6) {
    min-width: 120px;
}

.tpv-session-grid th {
    position: sticky;
    top: 0;
    z-index: 1;
    height: 34px;
    padding: 6px 8px;
    border-right: 1px solid #374151;
    background: #0f172a;
    color: #fff;
    text-align: left;
    font-weight: 800;
}

.tpv-session-grid td {
    height: 34px;
    padding: 6px 8px;
    border-right: 1px solid #d7e0eb;
    border-bottom: 1px solid #d7e0eb;
    background: #fff;
}

.tpv-session-grid tr {
    cursor: pointer;
}

.tpv-session-grid tbody tr:hover td {
    background: #dceeff;
}

.tpv-session-grid tr.pending td {
    background: #dc2626;
    color: #fff;
}

.tpv-session-grid tr.pending:hover td {
    background: #991b1b;
}

.tpv-session-grid .right {
    text-align: right;
}

.tpv-session-empty {
    height: 90px !important;
    color: #526171;
    text-align: center;
}

.tpv-references-dialog {
    width: 760px;
    max-width: calc(100vw - 64px);
    max-height: calc(100vh - 64px);
    display: grid;
    grid-template-rows: auto minmax(360px, 1fr) auto;
    gap: 14px;
    padding: 24px 26px 18px;
    border: 1px solid #444;
    background: #fff;
    box-shadow: 0 18px 48px rgba(15, 23, 42, .28);
}

.tpv-references-dialog h3 {
    margin: 0;
    color: #071225;
    font-size: 18px;
    font-weight: 900;
}

.tpv-references-dialog textarea {
    width: 100%;
    min-height: 0;
    resize: none;
    border: 1px solid #c7d2de;
    padding: 10px;
    background: #fff;
    font: inherit;
}

.tpv-references-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.tpv-references-actions .app-btn {
    min-width: 142px;
    min-height: 36px;
}

.tpv-sim {
    max-width: none;
    margin: 0 auto;
    min-height: 0;
    outline: 2px solid #6daed6;
    outline-offset: -2px;
}

.tpv-sim-1378 {
    width: 1378px;
    height: 768px;
}

.tpv-sim-1024 {
    width: 1024px;
    height: 768px;
}

.tpv-sim-1200 {
    width: 1200px;
    height: 1050px;
}

.tpv-sim .tpv-touch-toolbar {
    gap: 6px;
    padding: 8px 10px;
}

.tpv-sim .tpv-big {
    min-width: 104px;
    min-height: 46px;
    padding: 0 10px;
    font-size: 13px;
}

.tpv-sim .tpv-help {
    min-width: 46px;
    min-height: 46px;
}

.tpv-sim .tpv-touch-layout {
    height: calc(100% - 63px);
    gap: 8px;
    padding: 0 8px 8px;
}

.tpv-sim .tpv-sale-panel {
    padding: 8px 10px 10px;
}

.tpv-sim .tpv-sale-head {
    grid-template-columns: minmax(0, 1fr) 136px;
    gap: 8px;
}

.tpv-sim .tpv-head-grid {
    grid-template-columns: 128px minmax(160px, 1fr) 128px;
    gap: 5px 8px;
}

.tpv-sim .tpv-client-image-frame,
.tpv-sim .tpv-client-photo {
    width: 112px;
    height: 126px;
    flex-basis: 126px;
}

.tpv-sim .tpv-client-ref-button {
    min-height: 32px;
    font-size: 12px;
}

.tpv-sim .tpv-entry-row {
    grid-template-columns: 62px 104px minmax(190px, 1fr) 44px 52px 48px 58px;
    gap: 6px;
    padding: 6px 0 5px;
}

.tpv-sim .tpv-ticket-grid th {
    height: 30px;
}

.tpv-sim .tpv-ticket-grid td {
    height: 28px;
}

.tpv-sim .tpv-total-cards div {
    min-height: 48px;
}

.tpv-sim .tpv-products-panel header,
.tpv-sim .tpv-families-panel header {
    padding: 8px 10px 5px;
    font-size: 16px;
}

.tpv-sim .tpv-touch-card-grid,
.tpv-sim .tpv-family-card-grid {
    padding: 10px 12px;
    gap: 7px;
}

.tpv-sim .tpv-family-card-grid {
    grid-template-columns: 1fr;
}

.tpv-sim .tpv-touch-card {
    grid-template-rows: 78px minmax(34px, auto);
    min-height: 120px;
}

.tpv-sim .tpv-family-card {
    grid-template-rows: 76px minmax(32px, auto);
    min-height: 116px;
}

.tpv-sim .tpv-touch-card img,
.tpv-sim .tpv-family-card img,
.tpv-sim .tpv-card-empty {
    height: 78px;
}

.tpv-sim .tpv-touch-card strong,
.tpv-sim .tpv-family-card strong {
    font-size: 9px;
}

.tpv-sim-1378 .tpv-touch-layout {
    grid-template-columns: 640px minmax(430px, 1fr) 178px;
}

.tpv-sim-1378 .tpv-touch-card-grid {
    grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
}

.tpv-sim-1200 .tpv-touch-layout {
    grid-template-columns: 585px minmax(350px, 1fr) 170px;
}

.tpv-sim-1200 .tpv-touch-card-grid {
    grid-template-columns: repeat(auto-fill, minmax(98px, 1fr));
}

.tpv-sim-1024 .tpv-touch-toolbar {
    gap: 5px;
    padding: 6px 7px;
}

.tpv-sim-1024 .tpv-viewport-switcher {
    order: 99;
}

.tpv-sim-1024 .tpv-big {
    min-width: 86px;
    min-height: 40px;
    padding: 0 7px;
    font-size: 11px;
}

.tpv-sim-1024 .tpv-help {
    min-width: 40px;
    min-height: 40px;
}

.tpv-sim-1024 .tpv-touch-layout {
    height: calc(100% - 53px);
    grid-template-columns: 500px minmax(270px, 1fr) 134px;
    gap: 6px;
    padding: 0 6px 6px;
}

.tpv-sim-1024 .tpv-sale-panel {
    padding: 7px 8px 8px;
}

.tpv-sim-1024 .tpv-sale-head {
    grid-template-columns: minmax(0, 1fr) 106px;
    gap: 6px;
    padding-bottom: 5px;
}

.tpv-sim-1024 .tpv-head-grid {
    grid-template-columns: 104px minmax(136px, 1fr) 98px;
    gap: 4px 6px;
}

.tpv-sim-1024 .tpv-head-grid label,
.tpv-sim-1024 .tpv-entry-row label {
    font-size: 11px;
}

.tpv-sim-1024 .tpv-head-grid input,
.tpv-sim-1024 .tpv-head-grid select,
.tpv-sim-1024 .tpv-entry-row input,
.tpv-sim-1024 .tpv-entry-row select {
    height: 22px;
}

.tpv-sim-1024 .tpv-client-area {
    gap: 6px;
    padding: 3px 5px 7px;
}

.tpv-sim-1024 .tpv-client-image-frame,
.tpv-sim-1024 .tpv-client-photo {
    width: 92px;
    height: 104px;
    flex-basis: 104px;
}

.tpv-sim-1024 .tpv-client-ref-button {
    min-height: 28px;
    font-size: 10px;
    line-height: 1.1;
}

.tpv-sim-1024 .tpv-entry-row {
    grid-template-columns: 54px 86px minmax(158px, 1fr) 38px 44px 42px 50px;
    gap: 5px;
}

.tpv-sim-1024 .tpv-ticket-grid {
    font-size: 11px;
}

.tpv-sim-1024 .tpv-ticket-grid th {
    height: 27px;
    padding: 3px 4px;
}

.tpv-sim-1024 .tpv-ticket-grid td {
    height: 25px;
    padding: 2px 4px;
}

.tpv-sim-1024 .tpv-total-cards {
    gap: 5px;
}

.tpv-sim-1024 .tpv-total-cards div {
    min-height: 42px;
}

.tpv-sim-1024 .tpv-products-panel header,
.tpv-sim-1024 .tpv-families-panel header {
    padding: 7px 8px 4px;
    font-size: 14px;
}

.tpv-sim-1024 .tpv-touch-card-grid,
.tpv-sim-1024 .tpv-family-card-grid {
    padding: 8px;
    gap: 6px;
}

.tpv-sim-1024 .tpv-touch-card-grid {
    grid-template-columns: repeat(auto-fill, minmax(82px, 1fr));
}

.tpv-sim-1024 .tpv-touch-card {
    grid-template-rows: 62px minmax(30px, auto);
    min-height: 100px;
    padding: 0 4px 4px;
}

.tpv-sim-1024 .tpv-family-card {
    grid-template-rows: 58px minmax(30px, auto);
    min-height: 96px;
    padding: 0 4px 4px;
}

.tpv-sim-1024 .tpv-touch-card img,
.tpv-sim-1024 .tpv-family-card img,
.tpv-sim-1024 .tpv-card-empty {
    height: 62px;
}

.tpv-sim-1024 .tpv-family-card img {
    height: 58px;
}

.tpv-sim-1024 .tpv-touch-card strong,
.tpv-sim-1024 .tpv-family-card strong {
    font-size: 8px;
}

.pedido-proveedor-panel {
    min-height: calc(100vh - 150px);
    background: #eef4fb;
}

.pedido-title-row {
    min-height: 62px;
    grid-template-columns: minmax(360px, 1fr) auto;
    align-items: center;
    gap: 18px;
    padding: 10px 20px;
}

.pedido-title-row .title-with-icon img {
    width: 42px;
    height: 42px;
}

.pedido-title-row .title-with-icon {
    min-width: 0;
    display: inline-flex;
    align-items: center;
    gap: 14px;
}

.pedido-title-row h1 {
    margin: 0;
    font-size: 34px;
    font-weight: 500;
    line-height: 1.1;
    white-space: nowrap;
}

.pedido-title-row .toolbar.compact {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: nowrap;
    gap: 10px;
    min-width: 0;
}

.pedido-header {
    display: grid;
    grid-template-columns: repeat(24, minmax(0, 1fr));
    grid-template-rows: repeat(3, 36px) 64px;
    gap: 7px 14px;
    padding: 8px 22px 7px;
    border-bottom: 1px solid #c8d6e4;
}

.pedido-header .pedido-field {
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.pedido-header .pedido-field > span:first-child {
    width: 112px;
    white-space: nowrap;
}

.pedido-header input,
.pedido-header select,
.pedido-header textarea {
    min-height: 28px;
    border: 1px solid #9fb1c5;
    background: #fff;
    padding: 3px 7px;
}

.pedido-header label {
    font-size: 14px;
    line-height: 28px;
}

.pedido-header .pedido-field-numero {
    grid-column: 1 / 6;
    grid-row: 1;
}

.pedido-header .pedido-field-fecha {
    grid-column: 6 / 9;
    grid-row: 1;
}

.pedido-header .pedido-field-factura {
    grid-column: 9 / 13;
    grid-row: 1;
}

.pedido-header .pedido-field-proveedor {
    grid-column: 1 / 13;
    grid-row: 2;
}

.pedido-provider-control {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 34px;
    align-items: center;
    gap: 5px;
    min-width: 0;
}

.pedido-header .pedido-provider-control select {
    width: 100%;
    min-width: 0;
}

.pedido-provider-control .pedido-provider-lookup,
.pedido-provider-control .pedido-provider-lookup input {
    width: 100%;
    min-width: 0;
}

.pedido-provider-button {
    width: 34px;
    height: 28px;
    border-color: #168b72;
    color: #08745f;
    font-size: 12px;
    font-weight: 800;
}

.pedido-provider-button:hover,
.pedido-provider-button:focus-visible {
    background: #e1f7f0;
}

.pedido-header .pedido-field-descuento {
    grid-column: 1 / 4;
    grid-row: 3;
}

.pedido-header .pedido-field-total-desc {
    grid-column: 4 / 8;
    grid-row: 3;
}

.pedido-header .pedido-field-importe {
    grid-column: 8 / 12;
    grid-row: 3;
}

.pedido-header .pedido-field-descuento input,
.pedido-header .pedido-field-total-desc input,
.pedido-header .pedido-field-importe input {
    text-align: right;
}

.pedido-header .pedido-field-estado {
    grid-column: 13 / 19;
    grid-row: 3;
}

.pedido-header .pedido-field-fecha-recepcion {
    grid-column: 19 / 23;
    grid-row: 3;
}

.pedido-header .pedido-check {
    grid-column: 23 / 25;
    grid-row: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 0;
    min-height: 28px;
    padding: 0 7px;
    border: 1px solid #9fb1c5;
    background: #fff;
    line-height: 26px;
}

.pedido-header .pedido-check input {
    width: auto;
    min-height: auto;
    padding: 0;
}

.pedido-header .pedido-field-observaciones {
    grid-column: 1 / -1;
    grid-row: 4;
    grid-template-columns: 112px minmax(0, 1fr);
    align-items: start;
}

.pedido-header .pedido-field-observaciones textarea {
    min-height: 58px;
    resize: none;
}

.pedido-lines-bar {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 8px 20px;
    background: #eef4fb;
}

.pedido-save-status {
    margin-left: auto;
    font-weight: 700;
}

.pedido-save-status.is-ok {
    color: #08783f;
}

.pedido-save-status.is-error {
    color: #b4232f;
}

.pedido-lines-wrap {
    overflow: auto;
    border-top: 1px solid #c8d6e4;
    background: #fff;
}

.pedido-lines-grid {
    width: 100%;
    min-width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    background: #fff;
}

.pedido-lines-grid th,
.pedido-lines-grid td {
    border: 1px solid #cbd8e6;
    padding: 5px 7px;
}

.pedido-lines-grid th {
    height: 34px;
    background: #0f172a;
    color: #fff;
    font-weight: 800;
    text-align: left;
}

.pedido-lines-grid th.num {
    text-align: right;
}

.pedido-lines-grid input,
.pedido-lines-grid select {
    width: 100%;
    min-height: 29px;
    border: 1px solid #9fb1c5;
    background: #fff;
    padding: 3px 7px;
}

.pedido-lines-grid .right {
    text-align: right;
}

.pedido-lines-grid .pos {
    width: 58px;
}

.pedido-lines-grid .articulo {
    width: 170px;
}

.pedido-lines-grid .descripcion {
    width: auto;
}

.pedido-lines-grid .num {
    width: 90px;
}

.pedido-lines-grid .lote {
    width: 120px;
}

.pedido-lines-grid .accion {
    width: 84px;
}

.pedido-line-actions {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    white-space: nowrap;
}

.pedido-article-button {
    border-color: #315b8a;
    color: #123f70;
    font-weight: 400;
    font-size: 15px;
}

.pedido-article-button:hover,
.pedido-article-button:focus-visible {
    background: #e5effa;
    color: #082f5b;
}

@media (max-width: 1250px) {
    .pedido-title-row {
        grid-template-columns: 1fr;
    }

    .pedido-title-row .toolbar.compact {
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .pedido-header {
        grid-template-columns: 110px minmax(190px, 1fr) 125px minmax(190px, 1fr);
        grid-template-rows: none;
    }

    .pedido-header .pedido-field,
    .pedido-header .pedido-check {
        grid-column: auto;
        grid-row: auto;
    }

    .pedido-header .pedido-field {
        display: contents;
    }

    .pedido-header .pedido-field-observaciones {
        display: grid;
        grid-column: 1 / -1;
        grid-template-columns: 110px minmax(0, 1fr);
    }

    .pedido-header .pedido-check {
        grid-column: 2;
        justify-content: flex-start;
        border: 0;
        background: transparent;
    }
}

.recepcion-box {
    display: grid;
    gap: 18px;
    width: 520px;
    padding: 24px 28px;
    border: 1px solid #7d91aa;
    background: #fff;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.25);
}

.recepcion-box h2 {
    margin: 0;
    font-size: 25px;
}

.recepcion-box label:not(.check-inline) {
    display: grid;
    gap: 7px;
}

.recepcion-box input {
    min-height: 32px;
    border: 1px solid #9fb1c5;
    padding: 4px 8px;
}

.recepcion-box .modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.tile-icon {
    display: grid;
    place-items: center;
    height: 120px;
    font-size: 36px;
    color: #94a3b8;
}

.dynamic-list-panel .title-with-icon p,
.dynamic-form-meta {
    color: #405b78;
    font-size: 13px;
}

.dynamic-list-panel .table-wrap {
    background: #fff;
}

.dynamic-grid td {
    max-width: 280px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dynamic-ficha-window {
    max-width: none;
    height: calc(100vh - 112px);
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.dynamic-form-meta {
    display: flex;
    gap: 18px;
    padding: 8px 26px;
    border-bottom: 1px solid #d4e0ec;
    background: #f6f9fc;
}

.dynamic-form-grid {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    align-content: start;
}

.dynamic-form-grid label {
    min-width: 0;
}

.dynamic-form-grid input[readonly],
.dynamic-form-grid textarea[readonly] {
    background: #edf2f7;
}

.dynamic-check {
    display: grid;
    grid-template-columns: 190px auto !important;
    justify-content: start;
}

.dynamic-check input {
    width: 18px;
    height: 18px;
    min-height: 18px;
}

.dynamic-ficha-pagos-recurrentes .dynamic-form-grid {
    grid-template-columns: repeat(2, minmax(360px, 1fr));
    gap: 12px 28px;
    padding-bottom: 40px;
}

.dynamic-ficha-pagos-recurrentes .dynamic-column-importe-pago-recurrente {
    grid-column: 2;
    order: 60;
    align-self: start;
}

.dynamic-ficha-pagos-recurrentes .dynamic-column-importe-pago-recurrente input {
    max-width: 160px;
}

.dynamic-ficha-pagos-recurrentes .dynamic-column-observaciones {
    grid-column: 1 / -1;
    order: 70;
    grid-template-columns: 190px minmax(0, 1fr);
    align-items: start;
}

.dynamic-ficha-pagos-recurrentes .dynamic-column-observaciones textarea {
    min-height: 300px;
    resize: vertical;
}

.tpv-preferences-panel {
    min-height: calc(100vh - 86px);
    background: #eef4fb;
}

.tpv-preferences-panel .sheet-title {
    align-items: center;
}

.tpv-preferences-panel .tpv-preferences-title-icon {
    width: 90px;
    height: 90px;
    object-fit: contain;
}

.tpv-preferences-body {
    display: grid;
    grid-template-columns: minmax(440px, 720px) minmax(360px, 1fr);
    gap: 16px;
    padding: 18px 24px 24px;
}

.tpv-preferences-card {
    margin: 0;
    padding: 18px 20px;
    border: 1px solid #b9c8d9;
    background: #f8fbff;
}

.tpv-preferences-wide {
    grid-column: 1 / -1;
}

.tpv-preferences-form {
    display: grid;
    gap: 12px;
}

.tpv-preferences-form label:not(.tpv-preferences-check),
.tpv-preferences-message {
    display: grid;
    grid-template-columns: 190px minmax(220px, 1fr);
    align-items: center;
    gap: 14px;
    font-size: 14px;
    font-weight: 700;
}

.tpv-preferences-form input,
.tpv-preferences-form select,
.tpv-preferences-message textarea {
    width: 100%;
    min-height: 32px;
    border: 1px solid #9fb1c5;
    background: #fff;
    padding: 4px 8px;
    font: inherit;
    font-weight: 400;
}

.tpv-preferences-form .tpv-preferences-lookup {
    width: 100%;
}

.tpv-preferences-form .tpv-preferences-lookup input {
    width: 100%;
}

.tpv-preferences-checks {
    display: flex;
    flex-wrap: wrap;
    gap: 22px;
    margin-bottom: 14px;
}

.tpv-preferences-check {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 30px;
    font-size: 14px;
    font-weight: 700;
}

.tpv-preferences-check input {
    width: 16px;
    height: 16px;
}

.tpv-preferences-message {
    grid-template-columns: 190px 1fr;
    align-items: start;
}

.tpv-preferences-message textarea {
    min-height: 90px;
    resize: vertical;
}

@media (max-width: 760px) {
    .desktop-list-header,
    .desktop-card-header {
        grid-template-columns: 1fr;
    }

    .desktop-form label:not(.desktop-check) {
        grid-template-columns: 1fr;
    }

    .permissions-box > div {
        grid-template-columns: 1fr;
    }

    .password-input-wrap {
        width: 100%;
    }

    .block-user {
        margin-left: 0;
    }

    .client-general-layout,
    .desktop-form.client-form-grid,
    .photo-capture-body,
    .documents-header,
    .documents-content {
        grid-template-columns: 1fr;
    }

    .client-form-grid label:not(.desktop-check) {
        grid-template-columns: 1fr;
    }

    .client-checks {
        margin-left: 0;
    }

    .client-sepa-actions {
        margin-left: 0;
    }

    .workouts-main-header,
    .workouts-header,
    .visual-workouts,
    .workout-form-grid,
    .workout-form-grid label,
    .form-grid,
    .form-grid label,
    .article-form {
        grid-template-columns: 1fr;
    }

    .article-form .photo-card,
    .form-grid .span-2 {
        grid-column: auto;
        grid-row: auto;
    }

    .tpv-preferences-body,
    .tpv-preferences-form label:not(.tpv-preferences-check),
    .tpv-preferences-message {
        grid-template-columns: 1fr;
    }
}

/* Configuracion de paneles visuales: el panel de familias debe verse en dos columnas. */
.tpv-panel-config .tpv-panel-config-layout {
    grid-template-columns: minmax(0, 1fr) 296px;
}

.tpv-panel-config .tpv-family-items {
    display: grid !important;
    grid-template-columns: repeat(2, 116px) !important;
    gap: 8px;
    align-items: start;
    align-content: start;
    justify-content: start;
}

.tpv-panel-config .tpv-family-items .tpv-family-card {
    width: 116px !important;
    min-width: 0;
    min-height: 136px;
}

.tpv-panel-config .tpv-family-items .tpv-panel-family-card {
    display: block;
    width: 116px !important;
    max-width: 116px;
    min-width: 0 !important;
    overflow: hidden;
}

.tpv-panel-config .tpv-family-items .tpv-card-body {
    grid-template-rows: 90px minmax(38px, auto);
    min-height: 136px;
    padding: 0 6px 6px;
    max-width: 116px;
    overflow: hidden;
}

.tpv-panel-config .tpv-family-items .tpv-card-image,
.tpv-panel-config .tpv-family-items .tpv-card-image img {
    height: 90px;
}

.tpv-panel-config .tpv-family-items .tpv-card-image img {
    object-fit: contain;
}

.tpv-panel-config .tpv-family-items .tpv-card-body strong {
    font-size: 12px;
    line-height: 1.1;
}

.quick-articles-backdrop {
    padding: 14px;
    z-index: 1800;
}

.quick-articles-dialog {
    width: calc(100vw - 28px);
    height: calc(100vh - 28px);
    max-height: calc(100vh - 28px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 0;
}

.quick-articles-toolbar {
    display: flex;
    align-items: end;
    gap: 10px;
    padding: 10px 12px;
    border-bottom: 1px solid #b7c6d7;
    background: #eef6fc;
}

.quick-articles-toolbar label {
    display: grid;
    gap: 3px;
    min-width: 320px;
    color: #001b35;
    font-size: 12px;
    font-weight: 800;
}

.quick-articles-toolbar select {
    height: 30px;
    border: 1px solid #94a8c2;
    background: #fff;
    font-size: 13px;
}

.quick-articles-grid-wrap {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    padding: 0 10px 10px;
    background: #fff;
}

.quick-articles-grid {
    min-width: 1480px;
    table-layout: fixed;
    border-collapse: separate;
    border-spacing: 0;
}

.quick-articles-grid th {
    top: 0;
    z-index: 30;
    background: #eef3f8;
    background-clip: padding-box;
    white-space: nowrap;
}

.quick-articles-grid th:nth-child(1),
.quick-articles-grid td:nth-child(1) {
    width: 130px;
}

.quick-articles-grid th:nth-child(2),
.quick-articles-grid td:nth-child(2) {
    width: 360px;
}

.quick-articles-grid th:nth-child(3),
.quick-articles-grid td:nth-child(3),
.quick-articles-grid th:nth-child(4),
.quick-articles-grid td:nth-child(4),
.quick-articles-grid th:nth-child(5),
.quick-articles-grid td:nth-child(5),
.quick-articles-grid th:nth-child(6),
.quick-articles-grid td:nth-child(6) {
    width: 96px;
}

.quick-articles-grid th:nth-child(7),
.quick-articles-grid td:nth-child(7),
.quick-articles-grid th:nth-child(8),
.quick-articles-grid td:nth-child(8) {
    width: 180px;
}

.quick-articles-grid input[type="text"],
.quick-articles-grid input:not([type]),
.quick-articles-grid select {
    width: 100%;
}

.quick-articles-grid .quick-price-input {
    width: 82px;
    max-width: calc(100% - 10px);
    box-sizing: border-box;
    text-align: right;
}

.quick-check-cell {
    text-align: center;
}

.quick-check-cell input {
    width: 18px;
    height: 18px;
}

.quick-photo-cell {
    width: 78px;
    min-width: 78px;
    height: 58px;
    padding: 3px !important;
    text-align: center;
    cursor: context-menu;
}

.quick-photo-cell img,
.quick-photo-cell span {
    display: inline-grid;
    place-items: center;
    width: 68px;
    height: 50px;
    object-fit: contain;
    border: 1px solid #8e9db0;
    background: #fff;
    color: #5b6b80;
    font-size: 11px;
    font-weight: 800;
}

.departamentos-panel {
    min-height: calc(100vh - 112px);
    background: #f8fbff;
}

.departamentos-header {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 18px;
    padding: 16px 18px 12px;
    border-bottom: 1px solid #b9cadb;
    background: #eef6fc;
}

.departamentos-header h1 {
    margin: 0;
    color: #001b35;
    font-size: 24px;
    font-weight: 700;
}

.departamentos-header span {
    display: block;
    margin-top: 4px;
    color: #406282;
    font-size: 12px;
    text-transform: uppercase;
}

.departamentos-actions {
    align-items: center;
}

.departamentos-grid-wrap {
    width: min(760px, calc(100vw - 56px));
    margin: 18px;
    overflow: auto;
}

.departamentos-grid-title {
    padding: 10px 14px;
    border: 1px solid #d3d9e2;
    border-bottom: 0;
    background: #fff;
    color: #001b35;
    font-weight: 700;
}

.departamentos-grid {
    min-width: 640px;
    table-layout: fixed;
}

.departamentos-grid th {
    background: #e7edf3;
    color: #001b35;
    border-color: #c7d3e1;
    font-weight: 700;
}

.departamentos-grid td {
    border-color: #cfd8e3;
    background: #fff;
}

.departamentos-grid th:nth-child(1),
.departamentos-grid td:nth-child(1) {
    width: 260px;
}

.departamentos-grid th:nth-child(2),
.departamentos-grid td:nth-child(2) {
    width: 300px;
}

.departamentos-grid th:nth-child(3),
.departamentos-grid td:nth-child(3) {
    width: 96px;
}

.departamentos-grid input,
.departamentos-grid select {
    width: 100%;
    height: 28px;
    border: 1px solid #8b97a7;
    background: #fff;
    font-size: 13px;
}

.departamentos-grid input:disabled {
    background: #f3f4f6;
    color: #4b5563;
}

.departamentos-row-actions {
    text-align: center !important;
}

.departamentos-row-actions .app-btn {
    min-width: 0;
    width: 30px;
    height: 28px;
    padding: 0;
}

.departamentos-delete-icon {
    line-height: 1;
    font-size: 16px;
}

@media (max-width: 1200px) {
    .tpv-panel-config .tpv-panel-config-layout {
        grid-template-columns: minmax(0, 1fr) 296px;
    }
}

/* Ficha oferta */
.oferta-ficha {
    margin: 14px 20px;
}

.oferta-ficha .panel-title-row {
    min-height: 70px;
    align-items: center;
    border-bottom: 1px solid #c5d3e1;
}

.oferta-title-row,
.oferta-title-left,
.oferta-ficha .title-with-icon,
.oferta-ficha .toolbar {
    display: flex;
    align-items: center;
}

.oferta-title-row {
    justify-content: space-between;
    gap: 16px;
    padding-left: 24px;
    padding-right: 20px;
}

.oferta-title-left {
    gap: 0;
    min-width: 0;
}

.oferta-ficha .title-with-icon {
    gap: 12px;
}

.oferta-ficha .title-with-icon img {
    width: 36px;
    height: 36px;
    object-fit: contain;
}

.oferta-ficha .title-with-icon h1 {
    margin: 0;
    font-size: 36px;
    line-height: 1;
}

.oferta-ficha .toolbar {
    gap: 10px;
    flex-wrap: nowrap;
}

.oferta-form {
    padding: 20px 26px 26px;
    display: grid;
    gap: 14px;
}

.oferta-fields {
    display: grid;
    gap: 14px 18px;
    align-items: end;
}

.oferta-main-fields {
    grid-template-columns: 140px minmax(280px, 1fr) minmax(360px, 1.3fr) 150px;
}

.oferta-time-fields {
    grid-template-columns: repeat(4, minmax(160px, 1fr));
}

.oferta-ficha .field {
    display: grid;
    grid-template-columns: 1fr;
    gap: 5px;
    margin: 0;
    font-size: 13px;
    color: #061d3a;
}

.oferta-ficha .field input,
.oferta-ficha .field textarea {
    width: 100%;
    min-width: 0;
    height: 28px;
    border: 1px solid #9db4ce;
    background: #fff;
    padding: 3px 7px;
    font: inherit;
}

.oferta-ficha .field input[readonly] {
    background: #eef4fa;
}

.oferta-ficha .field textarea {
    min-height: 74px;
    height: 74px;
    resize: vertical;
}

.oferta-articulo-field {
    position: relative;
}

.oferta-article-lookup {
    position: relative;
    min-width: 0;
}

.oferta-article-results {
    position: absolute;
    z-index: 520;
    top: calc(100% + 2px);
    left: 0;
    right: 0;
    min-width: min(620px, 70vw);
    max-height: 296px;
    overflow: auto;
    border: 1px solid #7f9bb8;
    background: #fff;
    box-shadow: 0 14px 30px rgba(15, 23, 42, .24);
}

.oferta-article-results button {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(90px, 130px) minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    padding: 7px 10px;
    border: 0;
    border-bottom: 1px solid #e1e8f0;
    background: #fff;
    color: #102036;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.oferta-article-results button:hover,
.oferta-article-results button:focus-visible,
.oferta-article-results button.selected {
    background: #dceeff;
}

.oferta-article-results button.selected {
    outline: 1px solid #2b73b9;
    outline-offset: -1px;
}

.oferta-article-results strong,
.oferta-article-results span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.oferta-days-box {
    display: grid;
    grid-template-columns: 72px 1fr;
    gap: 12px;
    align-items: center;
    padding: 8px 14px;
    border: 1px solid #c5d3e1;
    background: #f7fbff;
}

.oferta-section-label {
    font-weight: 700;
    color: #061d3a;
}

.oferta-days {
    display: grid;
    grid-template-columns: repeat(7, minmax(90px, 1fr));
    gap: 10px;
    align-items: center;
}

.oferta-days .day-check {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    margin: 0;
    white-space: nowrap;
    min-height: 28px;
}

.oferta-days input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0;
}

.oferta-observaciones {
    margin-top: 2px;
}

@media (max-width: 1200px) {
    .oferta-main-fields {
        grid-template-columns: 120px 1fr 1fr 130px;
    }

    .oferta-days {
        grid-template-columns: repeat(4, minmax(100px, 1fr));
    }
}

.pagos-rec-list .table-wrap {
    min-height: 0;
}

.pagos-rec-grid-summary {
    position: relative;
    z-index: 2;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    min-height: 34px;
    padding: 4px 14px;
    border-bottom: 1px solid #d4e0ec;
    background: #f8fbff;
}

.pagos-rec-list .table-wrap {
    margin-top: 0;
    padding-top: 0;
    padding-bottom: 10px;
    background: #fff;
}

.pagos-rec-list .data-grid thead th {
    z-index: 30;
    background: #eaf1f8;
}

.pagos-rec-list .data-grid tbody tr.inactive-row td {
    background: #fde2e2;
}

.pagos-rec-list .data-grid tbody tr.inactive-row:hover td {
    background: #fbd0d0;
}

.pagos-rec-list .data-grid tbody tr.selected-billing-row td,
.pagos-rec-list .data-grid tbody tr.selected-billing-row:hover td {
    background: #d8f7df;
}

.pagos-rec-select-column,
.pagos-rec-select-cell {
    width: 82px;
    text-align: center;
}

.pagos-rec-select-cell input[type="checkbox"] {
    width: 16px;
    min-width: 16px;
    height: 16px;
    margin: 0;
}

.pagos-rec-filters {
    display: grid;
    grid-template-columns: minmax(520px, .95fr) 220px minmax(560px, 1.05fr) 190px;
    grid-template-areas:
        "buscar estado cliente cliente"
        "tipo tipo vencimientos avisos";
    gap: 10px 16px;
    align-items: center;
    padding: 14px 20px;
}

.pagos-rec-filters label {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    min-width: 0;
    line-height: 1.15;
}

.pagos-rec-filters input,
.pagos-rec-filters select {
    width: 100%;
    min-width: 0;
    height: 30px;
    box-sizing: border-box;
}

.pagos-rec-search-filter {
    grid-area: buscar;
}

.pagos-rec-search-filter input {
    min-width: 430px;
}

.pagos-rec-status-filter {
    grid-area: estado;
}

.pagos-rec-status-filter select {
    min-width: 170px;
}

.pagos-rec-client-filter {
    grid-area: cliente;
}

.pagos-rec-client-filter select {
    min-width: 520px;
}

.pagos-rec-type-filter {
    grid-area: tipo;
    grid-template-columns: 102px minmax(0, 1fr) !important;
}

.pagos-rec-type-filter select {
    min-width: 510px;
}

.pagos-rec-month-filter {
    grid-area: vencimientos;
    grid-template-columns: max-content 190px !important;
    white-space: nowrap;
}

.pagos-rec-month-filter input {
    width: 190px;
    min-width: 190px;
}

.pagos-rec-aviso-filter {
    grid-area: avisos;
    display: inline-flex !important;
    justify-content: flex-start;
    gap: 6px;
    min-width: 0;
    white-space: nowrap;
    color: #dc2626;
    font-weight: 400;
}

.pagos-rec-sort-button {
    min-height: 18px;
}

.pagos-rec-sort-button .grid-sort-indicator {
    min-width: 12px;
    text-align: right;
}

.filter-strip .pagos-rec-aviso-filter input {
    min-width: 0;
    width: 16px;
    height: 16px;
    padding: 0;
    margin: 0;
}

@media (max-width: 1180px) {
    .pagos-rec-filters {
        grid-template-columns: 1fr 1fr;
        grid-template-areas:
            "buscar buscar"
            "estado cliente"
            "tipo tipo"
            "vencimientos avisos";
    }

    .pagos-rec-search-filter input,
    .pagos-rec-type-filter select,
    .pagos-rec-client-filter select {
        min-width: 0;
    }
}

.pagos-rec-types-btn {
    min-width: 168px;
    background: #0ea5e9;
    border-color: #0284c7;
    color: #ffffff;
}

.pagos-rec-bill-btn {
    min-width: 190px;
    background: #16a34a;
    border-color: #15803d;
    color: #ffffff;
}

.pagos-rec-bill-btn:hover:not(:disabled),
.pagos-rec-bill-btn:focus-visible:not(:disabled) {
    background: #15803d;
    border-color: #166534;
}

.pagos-rec-bulk-facturar-dialog {
    width: min(700px, calc(100vw - 42px));
}

.pagos-rec-bulk-info {
    margin: 0;
    padding: 16px 22px 0;
    color: #1f2f46;
    font-size: 13px;
    line-height: 1.35;
    font-weight: 700;
}

.pagos-rec-types-backdrop {
    z-index: 1900;
    padding: 16px;
}

.pagos-rec-types-dialog {
    width: min(1500px, calc(100vw - 32px));
    height: min(780px, calc(100vh - 32px));
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.pagos-rec-types-toolbar {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 10px 12px;
    border-bottom: 1px solid #d4e0ec;
    background: #f8fbff;
}

.pagos-rec-types-grid-wrap {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    padding: 0 12px 12px;
    background: #f8fbff;
}

.pagos-rec-types-grid {
    width: 100%;
    min-width: 1280px;
    table-layout: fixed;
}

.pagos-rec-types-grid thead th {
    top: 0 !important;
    z-index: 60 !important;
    background: #eaf1f8 !important;
    background-clip: padding-box;
    box-shadow: inset 0 1px 0 #cbd8e6, inset 0 -2px 0 #b7c8da;
    white-space: nowrap;
}

.pagos-rec-types-grid th:nth-child(1),
.pagos-rec-types-grid td:nth-child(1) {
    width: 120px;
}

.pagos-rec-types-grid th:nth-child(3),
.pagos-rec-types-grid td:nth-child(3) {
    width: 145px;
}

.pagos-rec-types-grid th:nth-child(4),
.pagos-rec-types-grid td:nth-child(4),
.pagos-rec-types-grid th:nth-child(5),
.pagos-rec-types-grid td:nth-child(5),
.pagos-rec-types-grid th:nth-child(6),
.pagos-rec-types-grid td:nth-child(6) {
    width: 82px;
}

.pagos-rec-types-grid .tipo-pago-descripcion-col {
    width: auto;
}

.pagos-rec-types-grid input {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.pagos-rec-types-grid .tipo-pago-descripcion-col input {
    width: 100%;
    min-width: 0;
}

.pagos-rec-types-grid input[type="checkbox"] {
    width: 26px;
    min-width: 26px;
    height: 26px;
    display: block;
    margin: 0 auto;
}

.pagos-rec-types-grid th:last-child,
.pagos-rec-types-grid td:last-child {
    width: 170px;
}

.pagos-rec-types-grid input[readonly] {
    background: #eef3f8;
    color: #334155;
}

.pago-recurrente-window {
    margin: 10px 24px;
    border: 1px solid #9fb4c9;
    background: #f2f6fa;
    height: calc(100vh - 96px);
    min-height: 620px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.pago-rec-titlebar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 26px;
    background: #f7f9fb;
    border-bottom: 1px solid #c8d4df;
    flex: 0 0 auto;
}

.pago-rec-titlebar h1 {
    margin: 0;
    font-size: 28px;
}

.pago-rec-titlebar .toolbar.compact {
    flex-wrap: nowrap;
    gap: 9px;
    align-items: center;
}

.pago-rec-titlebar .toolbar.compact .app-btn {
    min-width: 0;
    padding-left: 13px;
    padding-right: 13px;
}

.pago-rec-titlebar .toolbar.compact .app-btn-help {
    width: 42px;
    min-width: 42px;
    padding-left: 0;
    padding-right: 0;
}

.pago-rec-facturar-dialog {
    width: min(560px, calc(100vw - 42px));
}

.pago-rec-facturar-body {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 14px;
    padding: 18px 22px;
}

.pago-rec-facturar-body label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-weight: 700;
}

.pago-rec-facturar-body input,
.pago-rec-facturar-body select {
    height: 30px;
    border: 1px solid #9fb4c9;
    background: #fff;
    padding: 3px 7px;
    box-sizing: border-box;
}

.pago-rec-body {
    padding: 16px 26px 18px;
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.pago-rec-header-grid {
    display: grid;
    grid-template-columns: 150px minmax(360px, 1.2fr) 300px minmax(260px, .9fr);
    gap: 12px 24px;
    align-items: end;
}

.pago-rec-header-grid label {
    display: flex;
    flex-direction: column;
    gap: 5px;
    font-weight: 700;
    font-size: 12px;
}

.pago-rec-header-grid input,
.pago-rec-header-grid select {
    height: 26px;
    border: 1px solid #9fb4c9;
    background: #fff;
    padding: 2px 6px;
    box-sizing: border-box;
}

.pago-rec-client {
    grid-column: span 2;
}

.cliente-field-wrap {
    display: grid;
    grid-template-columns: minmax(300px, 1fr) 32px;
    gap: 6px;
}

.date-with-check span {
    display: flex;
    align-items: center;
    gap: 8px;
}

.date-with-check input[type="date"] {
    flex: 1;
}

.date-with-check input[type="checkbox"],
.inline-check input {
    width: 14px;
    height: 14px;
}

.inline-check {
    flex-direction: row !important;
    align-items: center;
    gap: 8px;
    padding-top: 18px;
}

.pago-rec-tabs {
    display: flex;
    margin-top: 18px;
    border-bottom: 1px solid #71808f;
    flex: 0 0 auto;
}

.pago-rec-tabs button {
    min-width: 180px;
    height: 36px;
    border: 1px solid #71808f;
    border-bottom: 0;
    background: #e7edf4;
    font-weight: 700;
}

.pago-rec-tabs button.active {
    background: #0f887f;
    color: #fff;
}

.pago-rec-tab-content {
    border: 1px solid #71808f;
    border-top: 0;
    background: #fff;
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.pago-rec-grid-actions {
    height: 42px;
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 6px 10px;
    background: #f5f5f5;
    border-bottom: 1px solid #cbd6e0;
    flex: 0 0 auto;
}

.pago-rec-grid-wrap {
    overflow: auto;
    flex: 1 1 auto;
    min-height: 0;
}

.pago-rec-conceptos {
    table-layout: fixed;
    width: 100%;
}

.pago-rec-conceptos th:nth-child(1),
.pago-rec-conceptos td:nth-child(1) {
    width: 86px;
}

.pago-rec-conceptos th:nth-child(2),
.pago-rec-conceptos td:nth-child(2) {
    width: 78px;
}

.pago-rec-conceptos th:nth-child(3),
.pago-rec-conceptos td:nth-child(3) {
    width: 160px;
}

.pago-rec-conceptos th:nth-child(4),
.pago-rec-conceptos td:nth-child(4) {
    width: auto;
}

.pago-rec-conceptos th:nth-child(5),
.pago-rec-conceptos td:nth-child(5),
.pago-rec-conceptos th:nth-child(6),
.pago-rec-conceptos td:nth-child(6),
.pago-rec-conceptos th:nth-child(7),
.pago-rec-conceptos td:nth-child(7),
.pago-rec-conceptos th:nth-child(8),
.pago-rec-conceptos td:nth-child(8) {
    width: 108px;
}

.pago-rec-conceptos th:nth-child(9),
.pago-rec-conceptos td:nth-child(9) {
    width: 92px;
}

.pago-rec-conceptos input,
.pago-rec-conceptos textarea,
.pago-rec-gestiones input,
.pago-rec-gestiones textarea {
    width: 100%;
    height: 28px;
    border: 1px solid #9fb4c9;
    padding: 2px 6px;
    box-sizing: border-box;
}

.pago-rec-conceptos textarea,
.pago-rec-gestiones textarea {
    min-height: 42px;
    height: auto;
    resize: vertical;
    line-height: 18px;
    overflow-y: auto;
}

.pago-rec-gestiones {
    table-layout: fixed;
    width: 100%;
}

.pago-rec-gestiones th:nth-child(1),
.pago-rec-gestiones td:nth-child(1) {
    width: 56px;
}

.pago-rec-gestiones th:nth-child(2),
.pago-rec-gestiones td:nth-child(2) {
    width: 92px;
}

.pago-rec-gestiones th:nth-child(3),
.pago-rec-gestiones td:nth-child(3) {
    width: 132px;
}

.pago-rec-gestiones th:nth-child(4),
.pago-rec-gestiones td:nth-child(4) {
    width: 112px;
}

.pago-rec-gestiones th:nth-child(5),
.pago-rec-gestiones td:nth-child(5) {
    width: auto;
}

.pago-rec-tab-content .clickable-row {
    cursor: pointer;
}

.pago-rec-tab-content .clickable-row:hover {
    background: #eef6ff;
}

.pago-rec-observaciones {
    width: 100%;
    flex: 1 1 auto;
    min-height: 0;
    border: 0;
    padding: 12px;
    box-sizing: border-box;
    resize: none;
}

.readonly {
    background: #eef3f8 !important;
}

.icon-btn {
    height: 24px;
    min-width: 28px;
    border: 1px solid #9fb4c9;
    background: #eef3f8;
    font-weight: 700;
}

.icon-btn.danger {
    color: #e31d2a;
    border-color: #e31d2a;
    background: #fff;
}

/* Totales finales en facturas, albaranes y presupuestos. La raya es un elemento
   propio para que no dependa del borde del input y no la pisen otros estilos. */
.factura-grand-totals .factura-total-label input.total {
    border-top: 0 !important;
    padding-top: 0;
    margin-top: 0;
}

.factura-total-line {
    display: block;
    width: 100%;
    height: 3px;
    margin: 6px 0 4px;
    background: #0067c5;
}

.factura-total-abonar .factura-total-line {
    background: #07823f;
}

/* Ficha factura: version compacta para priorizar espacio de lineas. */
.factura-space-window {
    margin: 0;
    height: calc(100vh - 72px);
}

.factura-space-window .factura-header {
    min-height: 58px;
    grid-template-columns: 280px minmax(0, 1fr);
    padding: 6px 18px;
    column-gap: 12px;
}

.factura-space-window .factura-header .title-with-icon {
    min-width: 0;
}

.factura-space-window .factura-header .title-with-icon img {
    width: 38px;
    height: 38px;
}

.factura-space-window .factura-header h2 {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 8px;
    margin: 0;
    font-size: 23px;
    line-height: 1.05;
}

.factura-space-window .factura-type-inline {
    display: block;
    width: 100%;
    font-size: 21px;
    line-height: 1;
}

.factura-space-window .factura-actions {
    gap: 6px;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 0;
}

.factura-space-window .factura-actions:has(.aux-button-host) {
    overflow: visible;
    flex-wrap: wrap;
}

.factura-space-window .factura-actions .aux-button-host {
    flex: 0 0 auto;
}

.factura-space-window .factura-actions .app-btn {
    min-width: 68px;
    min-height: 30px;
    height: 30px;
    padding: 4px 9px;
    font-size: 12px;
}

.factura-space-window .factura-actions .aux-btn {
    min-width: 96px;
    background: #f6c400;
    color: #fff;
}

.factura-space-window .factura-actions .factura-btn-cobro,
.factura-space-window .factura-actions .app-btn-acrobat {
    min-width: 108px;
}

.factura-space-window .factura-actions .app-btn-help {
    flex: 0 0 38px;
    min-width: 38px;
    width: 38px;
}

.documento-space-window .factura-actions {
    flex-wrap: nowrap;
    align-items: center;
    overflow-x: auto;
    overflow-y: hidden;
}

.documento-space-window .factura-actions .app-btn-help {
    flex: 0 0 38px;
    min-width: 38px;
    width: 38px;
}

.factura-space-window .factura-compact-head,
.factura-space-window .factura-compact-head.with-vehicle {
    grid-template-columns: repeat(12, minmax(0, 1fr)) 124px 130px;
    grid-template-areas:
        "numero fecha cliente cliente cliente origen tarifa tarifa forma forma cuenta cuenta qr fiscalinfo"
        "estado estado clase clase tarjeta epigrafe epigrafe pago vehiculo vehiculo rectifica rectifica qr fiscalinfo"
        "checks checks checks checks checks checks checks checks checks checks checks checks qr fiscalinfo";
    gap: 6px 10px;
    padding: 6px 14px 5px;
    width: 100%;
    box-sizing: border-box;
}

.factura-space-window .factura-compact-head.without-vehicle {
    grid-template-areas:
        "numero fecha cliente cliente cliente origen tarifa tarifa forma forma cuenta cuenta qr fiscalinfo"
        "estado estado clase clase tarjeta epigrafe epigrafe pago rectifica rectifica rectifica rectifica qr fiscalinfo"
        "checks checks checks checks checks checks checks checks checks checks checks checks qr fiscalinfo";
}

.factura-space-window .factura-compact-head label {
    gap: 1px;
    font-size: 10.5px;
}

.factura-space-window .factura-compact-head input,
.factura-space-window .factura-compact-head select {
    box-sizing: border-box;
    max-width: 100%;
    min-height: 24px;
    height: 24px;
    padding: 1px 5px;
}

.factura-space-window .combo-with-action {
    box-sizing: border-box;
    max-width: 100%;
    grid-template-columns: minmax(0, 1fr) 30px;
    gap: 4px;
}

.factura-space-window .cliente-open {
    min-width: 30px;
    min-height: 22px;
}

.factura-space-window .factura-vehiculo {
    position: relative;
}

.factura-space-window .factura-vehiculo > span:first-child {
    color: #06172d;
    font-size: 13px;
    font-weight: 900;
}

.factura-space-window .factura-vehiculo input {
    font-size: 13px;
    font-weight: 900;
}

.factura-space-window .vehiculo-open img {
    width: 19px;
    height: 19px;
}

.factura-space-window .vehiculo-results {
    right: 34px;
}

.factura-space-window .vehiculo-results button {
    grid-template-columns: 118px minmax(0, 1fr);
}

.factura-space-window .head-rectifica .combo-with-action {
    grid-template-columns: minmax(0, 1fr) 30px;
}

.factura-space-window .factura-rectifica-open img {
    width: 18px;
    height: 18px;
}

.factura-space-window .factura-compact-head .presupuesto-check-strip {
    grid-template-columns: repeat(4, max-content) 112px repeat(2, max-content);
    min-height: 18px;
    gap: 0 20px;
}

.factura-space-window .factura-head-irpf {
    display: grid !important;
    grid-template-columns: max-content 58px;
    align-items: center;
    gap: 5px;
    width: 112px;
    font-size: 11.5px;
    white-space: nowrap;
}

.factura-space-window .factura-head-irpf input {
    width: 58px;
    min-height: 22px;
    height: 22px;
    padding: 1px 5px;
}

.factura-space-window .factura-compact-head .presupuesto-check-strip .factura-head-check {
    gap: 5px;
    font-size: 11.5px;
}

.factura-space-window .factura-compact-head .presupuesto-check-strip .factura-head-check input {
    width: 13px;
    height: 13px;
    min-height: 13px;
}

.factura-space-window .factura-fiscal-side {
    grid-area: qr;
    align-self: stretch;
    height: 100%;
    min-height: 78px;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 4px;
    min-width: 0;
}

.factura-space-window .factura-fiscal-picture {
    min-height: 46px;
    display: grid;
    place-items: center;
    border: 1px dashed #b7c8d9;
    background: rgba(255, 255, 255, .72);
    color: #8a9aad;
    font-size: 11px;
    line-height: 1.15;
    text-align: center;
    padding: 6px;
}

.factura-space-window .factura-fiscal-picture img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.factura-space-window .factura-lines-body {
    padding: 6px 14px 4px;
}

.factura-space-window .factura-line-toolbar {
    gap: 14px;
    min-height: 30px;
    margin-bottom: 5px;
}

.factura-space-window .factura-line-toolbar .app-btn {
    min-height: 29px;
    height: 29px;
    padding: 4px 14px;
}

.factura-space-window .factura-lineas-wrap {
    min-height: 330px;
}

.factura-space-window .factura-lineas-grid th {
    padding: 7px 9px;
    line-height: 1.05;
}

.factura-space-window .factura-lineas-grid td {
    padding: 5px 9px;
}

.factura-space-window .factura-lineas-grid input,
.factura-space-window .factura-lineas-grid select,
.factura-space-window .factura-lineas-grid textarea {
    min-height: 30px;
    padding: 3px 7px;
}

.factura-space-window .factura-lineas-grid textarea {
    min-height: 42px;
    line-height: 1.25;
}

.factura-space-window .factura-lineas-grid.without-lotes textarea {
    min-width: 610px;
}

.factura-space-window .factura-footer {
    grid-template-columns: minmax(420px, 1fr) 385px minmax(560px, 700px);
    grid-template-areas: "notas iva totales";
    gap: 10px;
    align-items: start;
    padding: 5px 18px 6px;
    min-height: 122px;
    max-height: 122px;
}

.factura-space-window .factura-notas {
    grid-area: notas;
    gap: 3px;
}

.factura-space-window .factura-notas textarea {
    min-height: 82px;
    height: 82px;
    max-height: 82px;
}

.factura-space-window .factura-iva-wrap {
    grid-area: iva;
    min-height: 104px;
    max-height: 110px;
    background: transparent;
}

.factura-space-window .factura-iva-title {
    display: block;
    margin-bottom: 3px;
    font-size: 11px;
    color: #334155;
}

.factura-space-window .factura-iva-grid th,
.factura-space-window .factura-iva-grid td {
    padding: 4px 9px;
}

.factura-space-window .factura-totales {
    grid-area: totales;
    gap: 4px;
    min-height: 110px;
}

.factura-space-window .factura-minor-totals {
    grid-template-columns: repeat(3, minmax(96px, 1fr));
    gap: 12px;
}

.factura-space-window .factura-minor-totals.with-irpf {
    grid-template-columns: repeat(5, minmax(82px, 1fr));
}

.factura-space-window .factura-minor-totals label {
    gap: 2px;
    font-size: 11px;
}

.factura-space-window .factura-minor-totals input {
    min-height: 23px;
}

.factura-space-window .factura-grand-totals {
    grid-template-columns: repeat(2, minmax(240px, 1fr));
    gap: 24px;
    align-items: end;
}

.factura-space-window .factura-total-label {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    grid-template-areas:
        "label amount"
        "line line";
    align-items: end;
    gap: 0 14px;
}

.factura-space-window .factura-total-label span,
.factura-space-window .factura-total-abonar span {
    grid-area: label;
    font-size: 16px;
    line-height: 1;
}

.factura-space-window .factura-total-label input,
.factura-space-window .factura-total-abonar input {
    grid-area: amount;
    justify-self: end;
    min-height: 36px;
    height: 36px;
    padding: 0;
    font-size: 38px;
    line-height: 1;
    text-align: right;
}

.factura-space-window .factura-total-line {
    grid-area: line;
    height: 3px;
    margin: 5px 0 0;
}

.factura-space-window .negative-number,
.factura-space-window input.negative-number,
.factura-space-window .number-cell.negative-number,
.factura-space-window .factura-total-label.negative-number span,
.factura-space-window .factura-total-label.negative-number input {
    color: #d71920 !important;
}

.factura-space-window .factura-total-label.negative-number .factura-total-line {
    background: #d71920;
}

/* Albaranes y presupuestos: misma filosofía compacta de factura para ganar líneas visibles. */
.documento-space-window .factura-header {
    min-height: 56px;
    grid-template-columns: 250px minmax(0, 1fr);
    padding: 6px 18px;
}

.documento-space-window .factura-header .title-with-icon {
    min-width: 0;
    padding-bottom: 3px;
}

.documento-space-window .factura-header .title-with-icon img {
    width: 36px;
    height: 36px;
}

.documento-space-window .factura-header h2 {
    font-size: 23px;
    line-height: 1.02;
}

.documento-space-window .factura-actions {
    gap: 6px;
    align-items: center;
}

.documento-space-window .factura-actions .aux-button-host {
    flex: 0 0 auto;
}

.documento-space-window .factura-actions .aux-btn,
.documento-space-window .factura-actions .app-btn {
    min-height: 30px;
    height: 30px;
    padding: 4px 12px;
}

.documento-space-window .documento-compact-head {
    gap: 5px 10px;
    padding: 6px 14px 5px;
    width: 100%;
    box-sizing: border-box;
}

.documento-space-window .documento-compact-head label {
    gap: 1px;
    font-size: 10.5px;
}

.documento-space-window .documento-compact-head input,
.documento-space-window .documento-compact-head select {
    box-sizing: border-box;
    max-width: 100%;
    min-height: 23px;
    height: 23px;
    padding: 1px 5px;
}

.documento-space-window .documento-compact-head .combo-with-action {
    box-sizing: border-box;
    max-width: 100%;
    grid-template-columns: minmax(0, 1fr) 30px;
}

.documento-space-window .documento-compact-head .mini-action {
    min-width: 30px;
    min-height: 23px;
}

.albaran-space-window .documento-compact-head {
    grid-template-columns: repeat(14, minmax(0, 1fr));
    grid-template-areas:
        "numero fecha validez cliente cliente cliente cliente cliente forma forma departamento departamento vehiculo vehiculo"
        "factura factura descuento descuento descuento irpf irpf estado estado estado origen origen origen origen"
        "checks checks checks checks checks checks checks checks checks checks checks checks checks checks";
}

.albaran-space-window .documento-compact-head.without-vehicle {
    grid-template-areas:
        "numero fecha validez cliente cliente cliente cliente cliente forma forma departamento departamento departamento departamento"
        "factura factura descuento descuento descuento irpf irpf estado estado estado origen origen origen origen"
        "checks checks checks checks checks checks checks checks checks checks checks checks checks checks";
}

.presupuesto-space-window .documento-compact-head {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    grid-template-areas:
        "numero fecha validez cliente cliente cliente cliente forma forma departamento departamento departamento"
        "factura factura albaran albaran albaran descuento irpf estado estado origen vehiculo vehiculo"
        "checks checks checks checks checks checks checks checks checks checks checks checks";
}

.presupuesto-space-window .documento-compact-head.without-vehicle {
    grid-template-areas:
        "numero fecha validez cliente cliente cliente cliente forma forma departamento departamento departamento"
        "factura factura albaran albaran albaran descuento irpf estado estado origen origen origen"
        "checks checks checks checks checks checks checks checks checks checks checks checks";
}

.presupuesto-space-window .documento-compact-head .head-departamento,
.presupuesto-space-window .documento-compact-head .head-origen {
    max-width: 100%;
}

.documento-space-window .documento-compact-head .presupuesto-check-strip {
    min-height: 18px;
    gap: 0 22px;
}

.documento-space-window .documento-compact-head .presupuesto-check-strip .factura-head-check {
    gap: 5px;
    font-size: 11.5px;
}

.documento-space-window .factura-lines-body {
    padding: 5px 14px 4px;
}

.documento-space-window .factura-line-toolbar {
    min-height: 29px;
    margin-bottom: 5px;
}

.documento-space-window .factura-line-toolbar .app-btn {
    min-height: 29px;
    height: 29px;
    padding: 4px 14px;
}

.documento-space-window .factura-lineas-wrap {
    min-height: 360px;
}

.documento-space-window .factura-lineas-grid th {
    padding: 7px 9px;
    line-height: 1.05;
}

.documento-space-window .factura-lineas-grid td {
    padding: 5px 9px;
}

.documento-space-window .factura-lineas-grid input,
.documento-space-window .factura-lineas-grid select,
.documento-space-window .factura-lineas-grid textarea {
    min-height: 30px;
    padding: 3px 7px;
}

.documento-space-window .factura-lineas-grid textarea {
    min-height: 42px;
    line-height: 1.25;
}

.documento-space-window .factura-footer {
    grid-template-columns: minmax(420px, 1fr) 385px minmax(560px, 700px);
    grid-template-areas: "notas iva totales";
    gap: 10px;
    align-items: start;
    padding: 5px 18px 6px;
    min-height: 122px;
    max-height: 122px;
}

.documento-space-window .factura-notas {
    grid-area: notas;
    gap: 3px;
}

.documento-space-window .factura-notas textarea {
    min-height: 82px;
    height: 82px;
    max-height: 82px;
}

.documento-space-window .factura-iva-wrap {
    grid-area: iva;
    min-height: 104px;
    max-height: 110px;
    background: transparent;
}

.documento-space-window .factura-iva-title {
    display: block;
    margin-bottom: 3px;
    font-size: 11px;
}

.documento-space-window .factura-totales {
    grid-area: totales;
    min-height: 110px;
    gap: 4px;
}

.documento-space-window .factura-minor-totals {
    grid-template-columns: repeat(4, minmax(96px, 1fr));
    gap: 12px;
}

.documento-space-window .factura-grand-totals {
    grid-template-columns: repeat(2, minmax(240px, 1fr));
    gap: 24px;
    align-items: end;
}

.documento-space-window .factura-total-label {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    grid-template-areas:
        "label amount"
        "line line";
    align-items: end;
    gap: 0 14px;
}

.documento-space-window .factura-total-label span,
.documento-space-window .factura-total-abonar span {
    grid-area: label;
    font-size: 16px;
    line-height: 1;
}

.documento-space-window .factura-total-label input,
.documento-space-window .factura-total-abonar input {
    grid-area: amount;
    justify-self: end;
    min-height: 36px;
    height: 36px;
    padding: 0;
    font-size: 38px;
    line-height: 1;
    text-align: right;
}

.documento-space-window .factura-total-line {
    grid-area: line;
    height: 3px;
    margin: 5px 0 0;
}

.orden-space-window .factura-header {
    grid-template-columns: 300px minmax(0, 1fr);
}

.orden-space-window .factura-header .title-with-icon img {
    width: 38px;
    height: 38px;
}

.orden-space-window .orden-head {
    grid-template-columns: repeat(14, minmax(0, 1fr));
    grid-template-areas:
        "numero fecha hora cliente cliente cliente cliente vehiculo vehiculo tipo tipo empleado equipo prioridad"
        "departamento departamento contacto contacto movil movil fecha-fin horas-est estado estado origen origen origen origen"
        "factura factura albaran albaran presupuesto presupuesto presupuesto checks checks checks checks checks checks checks";
    gap: 5px 10px;
    padding: 6px 14px 5px;
    width: 100%;
    box-sizing: border-box;
}

.orden-space-window .orden-head input,
.orden-space-window .orden-head select,
.orden-space-window .orden-head textarea,
.orden-space-window .orden-head .combo-with-action {
    box-sizing: border-box;
    max-width: 100%;
}

.orden-space-window .orden-head .combo-with-action {
    grid-template-columns: minmax(0, 1fr) 30px;
}

.orden-space-window .orden-head .mini-action {
    min-width: 30px;
    min-height: 23px;
    height: 23px;
}

.orden-space-window .orden-head .parte-check-strip {
    grid-area: checks;
    grid-column: auto !important;
    display: grid !important;
    grid-template-columns: repeat(4, max-content);
    justify-content: start;
    align-items: center;
    min-height: 18px;
    gap: 0 20px;
    padding-top: 0;
}

.orden-space-window .orden-head .parte-check-strip .factura-head-check {
    display: inline-flex !important;
    grid-template-columns: none !important;
    width: max-content !important;
    min-width: max-content !important;
    gap: 5px;
    font-size: 11.5px;
    white-space: nowrap;
}

.orden-space-window .parte-lines-body {
    position: relative;
    padding: 5px 14px 4px;
    overflow: hidden;
}

.orden-space-window .orden-lines-watermark {
    position: absolute;
    left: 50%;
    top: 52%;
    z-index: 0;
    width: max-content;
    max-width: 88%;
    color: rgba(0, 91, 181, 0.08);
    font-size: clamp(54px, 8vw, 118px);
    font-weight: 900;
    letter-spacing: 0;
    line-height: 1;
    pointer-events: none;
    text-align: center;
    text-transform: uppercase;
    transform: translate(-50%, -50%) rotate(-24deg);
    white-space: nowrap;
    user-select: none;
}

.orden-space-window .parte-lines-wrap {
    position: relative;
    z-index: 1;
    min-height: 360px;
}

.orden-space-window .factura-line-toolbar {
    position: relative;
    z-index: 2;
}

.orden-space-window .parte-lines-grid th {
    padding: 7px 9px;
    line-height: 1.05;
}

.orden-space-window .parte-lines-grid td {
    padding: 5px 9px;
}

.orden-space-window .parte-lines-grid input,
.orden-space-window .parte-lines-grid select,
.orden-space-window .parte-lines-grid textarea {
    min-height: 30px;
    padding: 3px 7px;
}

.orden-space-window .parte-lines-grid textarea {
    min-height: 42px;
    line-height: 1.25;
}

.orden-space-window .orden-footer {
    grid-template-columns: minmax(420px, 1fr) 385px minmax(560px, 700px);
    grid-template-areas: "notas iva totales";
    gap: 10px;
    align-items: start;
    padding: 5px 18px 6px;
    min-height: 122px;
    max-height: 122px;
}

.orden-space-window .orden-footer .factura-notas textarea {
    min-height: 82px;
    height: 82px;
    max-height: 82px;
}

.orden-space-window .orden-footer .factura-iva-wrap {
    min-height: 104px;
    max-height: 110px;
}

.orden-space-window .orden-minor-totals {
    grid-template-columns: repeat(4, minmax(96px, 1fr));
    gap: 4px 10px;
}

.orden-space-window .orden-grand-totals {
    grid-template-columns: minmax(260px, 1fr);
    justify-items: end;
    gap: 0;
}

.orden-space-window .orden-grand-totals .factura-total-label {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    grid-template-areas:
        "label amount"
        "line line";
    width: min(420px, 100%);
    align-items: end;
    gap: 0 14px;
}

.orden-space-window .orden-grand-totals .factura-total-label input {
    grid-area: amount;
    justify-self: end;
    min-height: 36px;
    height: 36px;
    padding: 0;
    font-size: 38px;
    line-height: 1;
    text-align: right;
}

.orden-space-window .orden-footer {
    grid-template-columns: minmax(430px, 1fr) minmax(340px, 385px) minmax(420px, 520px);
    gap: 10px;
}

.orden-space-window .orden-footer .factura-totales {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    min-height: 0;
    gap: 6px;
    overflow: visible;
}

.orden-space-window .orden-minor-totals {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 3px 8px;
    padding: 0;
}

.orden-space-window .orden-minor-totals label:nth-child(n+4) {
    display: none !important;
}

.orden-space-window .orden-minor-totals label {
    gap: 1px;
    min-width: 0;
}

.orden-space-window .orden-minor-totals span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 10px;
}

.orden-space-window .orden-minor-totals input {
    min-height: 19px;
    height: 19px;
    padding: 1px 6px;
}

.orden-space-window .orden-grand-totals {
    display: block !important;
    margin-top: 4px;
    flex: 0 0 auto;
}

.orden-space-window .orden-grand-totals .factura-total-label {
    display: grid !important;
    width: 100%;
    grid-template-columns: minmax(120px, auto) minmax(150px, 1fr);
    gap: 0 12px;
    padding-top: 2px;
    border-bottom: 3px solid #008342;
}

.orden-space-window .orden-grand-totals .factura-total-label span {
    align-self: center;
    color: #008342;
    font-size: 12px;
}

.orden-space-window .orden-grand-totals .factura-total-label input {
    width: 100%;
    min-height: 30px;
    height: 30px;
    font-size: 28px;
}

.orden-space-window .factura-header {
    grid-template-columns: 280px minmax(260px, 1fr) auto;
    gap: 18px;
    align-items: center;
}

.orden-space-window .orden-vehicle-title {
    justify-self: start;
    align-self: center;
    min-width: 260px;
    max-width: 560px;
    padding: 5px 10px 6px;
    border-left: 4px solid #0f8278;
    background: #ffffff;
    box-shadow: inset 0 0 0 1px #d0dbe7;
}

.orden-space-window .orden-vehicle-title span {
    display: block;
    color: #007c51;
    font-size: 10px;
    font-weight: 800;
    line-height: 1;
    text-transform: uppercase;
}

.orden-space-window .orden-vehicle-title strong {
    display: block;
    margin-top: 3px;
    overflow: hidden;
    color: #001d4a;
    font-size: 16px;
    font-weight: 900;
    line-height: 1.05;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.orden-space-window .orden-head {
    grid-template-columns: repeat(24, minmax(0, 1fr));
    grid-template-areas:
        "numero numero fecha fecha hora hora cliente cliente cliente cliente cliente cliente cliente vehiculo vehiculo vehiculo vehiculo tipo tipo tipo tipo empleado empleado empleado"
        "departamento departamento departamento departamento contacto contacto contacto contacto movil movil movil movil fecha-fin fecha-fin horas-est horas-est estado estado estado estado origen origen origen origen"
        "factura factura factura albaran albaran albaran presupuesto presupuesto presupuesto presupuesto presupuesto equipo equipo equipo equipo prioridad prioridad prioridad prioridad checks checks checks checks checks";
    gap: 5px 10px;
}

.orden-space-window .orden-head .head-tipo,
.orden-space-window .orden-head .head-equipo,
.orden-space-window .orden-head .head-prioridad,
.orden-space-window .orden-head .head-estado,
.orden-space-window .orden-head .head-origen {
    min-width: 0;
}

.orden-space-window .orden-head .head-tipo select,
.orden-space-window .orden-head .head-equipo select,
.orden-space-window .orden-head .head-prioridad select,
.orden-space-window .orden-head .head-estado select,
.orden-space-window .orden-head .head-origen select {
    font-size: 12px;
}

@media (max-width: 1280px) {
    .pago-rec-titlebar {
        align-items: flex-start;
    }

    .pago-rec-header-grid {
        grid-template-columns: repeat(3, minmax(180px, 1fr));
    }
}

.caja-movement-toolbar {
    display: flex;
    gap: 8px;
    align-items: center;
    padding: 8px 10px;
    border-bottom: 1px solid #cbd8e6;
    background: #f5f8fc;
}

.caja-movement-grid th:first-child,
.caja-movement-grid td:first-child {
    width: 42px;
    text-align: center;
}

.caja-movement-grid input {
    width: 100%;
    min-height: 27px;
    border: 1px solid #a9bdd6;
    background: #fff;
    font: inherit;
}

.caja-movement-grid .movement-concept {
    min-width: 420px;
}

.caja-movement-grid .movement-money {
    width: 150px;
    text-align: right;
}

.caja-movement-grid .movement-money input {
    text-align: right;
}

.caja-movement-grid .movement-date {
    width: 170px;
}

.caja-movement-grid .movement-session {
    display: none;
}

.proveedor-window {
    min-height: calc(100vh - 96px);
}

.proveedor-titlebar {
    align-items: center;
}

.proveedor-titlebar.one-line {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    min-height: 74px;
    padding: 10px 18px;
}

.proveedor-titlebar.one-line .title-with-icon {
    flex: 0 0 auto;
}

.proveedor-titlebar.one-line .toolbar {
    flex: 1 1 auto;
    justify-content: flex-end;
    flex-wrap: nowrap;
    overflow: visible;
}

.proveedor-tabs {
    display: flex;
    gap: 3px;
    padding: 6px 10px 0;
    border-top: 1px solid #cad7e6;
    border-bottom: 1px solid #a9bdd6;
    background: #e6e6e6;
}

.proveedor-tabs button {
    min-width: 128px;
    min-height: 32px;
    padding: 6px 14px;
    border: 1px solid #9fb4cf;
    border-bottom: 0;
    background: #eef4fb;
    color: #001d4a;
    font-weight: 700;
}

.proveedor-tabs button.active {
    background: #0d8278;
    color: #fff;
}

.proveedor-section {
    margin: 10px 16px;
    padding: 14px 16px 18px;
    border: 1px solid #c2d0e2;
    background: #f7fbff;
}

.proveedor-datos-unica {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    margin-top: 8px;
    margin-bottom: 10px;
    padding: 10px 14px;
}

.proveedor-data-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(380px, .75fr);
    gap: 9px 12px;
    align-items: start;
}

.proveedor-card {
    border: 1px solid #c7d4e5;
    background: #fbfdff;
    padding: 8px 12px 10px;
}

.proveedor-card h2 {
    margin: 0 0 7px;
    padding-bottom: 5px;
    border-bottom: 1px solid #d8e2ee;
    color: #001d4a;
    font-size: 16px;
    font-weight: 400;
}

.proveedor-section .proveedor-card h2 {
    margin: 0 0 7px;
    color: #001d4a;
    font-size: 16px;
    font-weight: 400;
}

.proveedor-card-identidad,
.proveedor-card-contacto,
.proveedor-card-observaciones {
    grid-column: 1 / -1;
}

.proveedor-section h2 {
    margin: 0 0 12px;
    color: #001d4a;
    font-size: 24px;
    font-weight: 400;
}

.proveedor-grid {
    display: grid;
    gap: 8px 14px;
    align-items: end;
}

.proveedor-grid-identidad {
    grid-template-columns: repeat(12, minmax(0, 1fr));
}

.proveedor-grid-identidad .prov-id,
.proveedor-grid-identidad .prov-nif,
.proveedor-grid-identidad .prov-fecha {
    grid-column: span 2;
}

.proveedor-grid-identidad .prov-comercial,
.proveedor-grid-identidad .prov-fiscal,
.proveedor-grid-identidad .prov-contacto {
    grid-column: span 4;
}

.proveedor-grid-contacto {
    grid-template-columns: repeat(12, minmax(0, 1fr));
}

.proveedor-grid-contacto .prov-direccion {
    grid-column: span 7;
}

.proveedor-grid-contacto .prov-cp {
    grid-column: span 2;
}

.proveedor-grid-contacto .prov-ciudad {
    grid-column: span 3;
}

.proveedor-grid-contacto .prov-provincia,
.proveedor-grid-contacto .prov-pais,
.proveedor-grid-contacto .prov-telefono,
.proveedor-grid-contacto .prov-movil,
.proveedor-grid-contacto .prov-fax {
    grid-column: span 2;
}

.proveedor-grid-contacto .prov-email,
.proveedor-grid-contacto .prov-web {
    grid-column: span 4;
}

.proveedor-grid-banco {
    grid-template-columns: repeat(8, minmax(0, 1fr));
}

.proveedor-grid-banco .prov-banco,
.proveedor-grid-banco .prov-forma {
    grid-column: span 4;
}

.proveedor-grid-banco .prov-cuenta,
.proveedor-grid-banco .prov-contable {
    grid-column: span 3;
}

.proveedor-grid-banco .prov-bic,
.proveedor-grid-banco .prov-dia {
    grid-column: span 1;
}

.proveedor-grid-fiscal-datos {
    grid-template-columns: minmax(110px, 150px) minmax(120px, 150px) minmax(110px, 150px);
}

.proveedor-grid .span-2 {
    grid-column: span 2;
}

.proveedor-grid .span-3 {
    grid-column: span 3;
}

.proveedor-grid-all {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 8px 12px;
}

.proveedor-grid-all .prov-id,
.proveedor-grid-all .prov-nif,
.proveedor-grid-all .prov-fecha,
.proveedor-grid-all .prov-cp,
.proveedor-grid-all .prov-ciudad,
.proveedor-grid-all .prov-provincia,
.proveedor-grid-all .prov-pais,
.proveedor-grid-all .prov-telefono,
.proveedor-grid-all .prov-movil,
.proveedor-grid-all .prov-fax,
.proveedor-grid-all .prov-irpf,
.proveedor-grid-all .prov-dia,
.proveedor-grid-all .prov-irpf-check,
.proveedor-grid-all .prov-siniva,
.proveedor-grid-all .prov-bic {
    grid-column: span 2;
}

.proveedor-grid-all .prov-comercial,
.proveedor-grid-all .prov-fiscal,
.proveedor-grid-all .prov-contacto,
.proveedor-grid-all .prov-banco,
.proveedor-grid-all .prov-cuenta,
.proveedor-grid-all .prov-contable {
    grid-column: span 3;
}

.proveedor-grid-all .prov-direccion,
.proveedor-grid-all .prov-email,
.proveedor-grid-all .prov-web,
.proveedor-grid-all .prov-forma {
    grid-column: span 4;
}

.proveedor-grid-all .prov-observaciones {
    grid-column: 1 / -1;
}

.proveedor-grid-main {
    grid-template-columns: minmax(150px, 190px) minmax(150px, 190px) minmax(280px, 1fr) minmax(280px, 1fr);
}

.proveedor-grid-contact {
    grid-template-columns: minmax(130px, 180px) minmax(180px, 1fr) minmax(180px, 1fr) minmax(150px, 220px);
}

.proveedor-grid-bank {
    grid-template-columns: minmax(260px, 360px) minmax(420px, 1fr) minmax(150px, 220px);
}

.proveedor-grid-fiscal {
    grid-template-columns: 110px minmax(90px, 120px) 100px minmax(260px, 1fr) minmax(90px, 120px) minmax(180px, 260px);
}

.proveedor-grid label,
.proveedor-observaciones {
    color: #001d4a;
    font-size: 12px;
    font-weight: 400;
}

.proveedor-grid input,
.proveedor-grid select,
.proveedor-observaciones textarea {
    width: 100%;
    min-height: 27px;
    border: 1px solid #a9bdd6;
    background: #fff;
    font: inherit;
    font-weight: 400;
}

.proveedor-grid .proveedor-bank-lookup,
.proveedor-grid .proveedor-bank-lookup .article-lookup-input {
    width: 100%;
}

.proveedor-grid .proveedor-bank-lookup .article-lookup-results {
    width: min(560px, 42vw);
    max-height: 300px;
}

.proveedor-grid textarea,
.proveedor-observaciones textarea {
    min-height: 62px;
}

.proveedor-grid-all textarea {
    min-height: 115px;
}

.proveedor-grid .inline-action {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px;
}

.proveedor-grid .inline-action::before {
    content: attr(data-label);
}

.proveedor-grid .mini-action {
    align-self: end;
    min-height: 28px;
    padding: 0 10px;
    border: 1px solid #08766d;
    background: #0d8278;
    color: #fff;
    font-weight: 800;
}

.proveedor-grid .check-label {
    display: flex;
    gap: 7px;
    align-items: center;
    min-height: 28px;
    font-weight: 400;
}

.proveedor-grid .check-label input {
    width: auto;
    min-height: auto;
}

.proveedor-grid input.right {
    text-align: right;
}

.proveedor-field-action {
    position: relative;
    display: block;
}

.proveedor-field-action input {
    padding-right: 32px;
}

.proveedor-field-action .field-icon-button {
    position: absolute;
    top: 50%;
    right: 3px;
    width: 24px;
    height: 22px;
    min-width: 24px;
    min-height: 22px;
    padding: 0;
    transform: translateY(-50%);
    border: 1px solid transparent;
    border-radius: 3px;
    background: transparent;
    color: #0060ae;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.proveedor-field-action .field-icon-button:hover,
.proveedor-field-action .field-icon-button:focus-visible {
    border-color: #91b7dc;
    background: #e8f4ff;
}

.proveedor-field-action .field-icon-button svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.proveedor-field-action .field-icon-map {
    color: #d46a00;
}

.proveedor-field-action .field-icon-mobile {
    color: #0d8278;
}

.proveedor-field-action .field-icon-email {
    color: #0060ae;
}

.proveedor-observaciones textarea {
    width: 100%;
    min-height: 62px;
    height: 62px;
    resize: vertical;
}

.proveedor-observaciones {
    display: block;
}

.proveedor-related-section {
    margin-top: 8px;
    padding: 0;
}

.proveedor-related-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 10px;
    border-bottom: 1px solid #c2d0e2;
    background: #edf3f9;
    color: #001d4a;
}

.proveedor-related-wrap {
    min-height: calc(100vh - 260px);
    overflow: auto;
}

.proveedor-related-grid {
    width: 100%;
}

.proveedor-related-grid th,
.proveedor-related-grid td {
    white-space: nowrap;
}

.proveedor-related-grid th {
    font-weight: 400;
}

.proveedor-related-grid tbody tr {
    cursor: pointer;
}

.proveedor-related-grid tbody tr:hover {
    background: #e8f4ff;
}

@media (max-width: 1200px) {
    .proveedor-data-layout {
        grid-template-columns: 1fr;
    }

    .proveedor-grid-main,
    .proveedor-grid-contact,
    .proveedor-grid-bank,
    .proveedor-grid-fiscal {
        grid-template-columns: repeat(2, minmax(180px, 1fr));
    }

    .proveedor-grid-identidad,
    .proveedor-grid-contacto,
    .proveedor-grid-banco,
    .proveedor-grid-fiscal-datos {
        grid-template-columns: repeat(2, minmax(180px, 1fr));
    }

    .proveedor-grid-identidad > *,
    .proveedor-grid-contacto > *,
    .proveedor-grid-banco > * {
        grid-column: span 1 !important;
    }

    .proveedor-grid-all {
        grid-template-columns: repeat(2, minmax(180px, 1fr));
    }

    .proveedor-grid-all > * {
        grid-column: span 1 !important;
    }

    .proveedor-grid-all .prov-observaciones {
        grid-column: 1 / -1 !important;
    }

    .proveedor-titlebar.one-line {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .proveedor-titlebar.one-line .toolbar {
        justify-content: flex-start;
        flex-wrap: wrap;
    }
}

.factura-recibida-panel {
    min-height: calc(100vh - 92px);
    display: flex;
    flex-direction: column;
}

.factura-recibida-title-row {
    min-height: 78px;
    align-items: center;
}

.factura-recibida-title-row .title-with-icon h1 {
    margin: 0;
    font-size: 30px;
    line-height: 1;
}

.factura-recibida-main {
    flex: 1 1 auto;
    min-height: 0;
    padding: 10px 14px 14px;
    display: grid;
    grid-template-columns: minmax(720px, 1.15fr) minmax(520px, .85fr);
    gap: 10px;
    align-content: start;
}

.factura-recibida-card {
    border: 1px solid #bfd0e2;
    background: #f6f9fd;
    padding: 10px 12px;
}

.factura-recibida-card h2 {
    margin: 0 0 8px;
    padding-bottom: 5px;
    border-bottom: 1px solid #d2deec;
    color: #001d4a;
    font-size: 18px;
    line-height: 1.1;
}

.factura-recibida-grid {
    display: grid;
    gap: 7px 10px;
    align-items: end;
}

.factura-recibida-grid label,
.factura-recibida-totales label {
    display: grid;
    gap: 3px;
    color: #001d4a;
    font-size: 12px;
    font-weight: 400;
}

.factura-recibida-grid input,
.factura-recibida-grid select,
.factura-recibida-totales input,
.factura-recibida-iva-grid input {
    width: 100%;
    min-width: 0;
    height: 24px;
    border: 1px solid #9eb4d0;
    background: #fff;
    color: #001d4a;
    padding: 2px 6px;
    box-sizing: border-box;
}

.factura-recibida-grid input[readonly],
.factura-recibida-totales input[readonly],
.factura-recibida-iva-grid input[readonly] {
    background: #edf3f9;
}

.factura-recibida-grid .check-inline,
.factura-recibida-totales .check-inline {
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 24px;
    padding-top: 14px;
}

.factura-recibida-grid .check-inline input,
.factura-recibida-totales .check-inline input {
    width: 14px;
    height: 14px;
}

.factura-recibida-grid .span-2 {
    grid-column: span 2;
}

.factura-recibida-cabecera .header-grid {
    grid-template-columns: 140px minmax(180px, 1fr) 135px 135px;
}

.factura-recibida-pago .pago-grid {
    grid-template-columns: minmax(180px, 1fr) minmax(170px, 1fr) 130px minmax(160px, 1fr);
}

.inline-action-field {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 30px;
    gap: 6px;
    align-items: center;
}

.factura-recibida-importes,
.factura-recibida-observaciones {
    grid-column: 1 / -1;
}

.factura-recibida-iva-grid {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.factura-recibida-iva-grid th,
.factura-recibida-iva-grid td {
    border: 1px solid #c8d6e6;
    padding: 4px 6px;
    color: #001d4a;
    font-size: 12px;
    font-weight: 400;
}

.factura-recibida-iva-grid th {
    background: #e8f0f8;
}

.factura-recibida-iva-grid th:first-child,
.factura-recibida-iva-grid td:first-child {
    width: 40px;
    text-align: center;
}

.factura-recibida-totales {
    margin-top: 9px;
    display: grid;
    grid-template-columns: repeat(7, minmax(120px, 1fr));
    gap: 8px;
    align-items: end;
}

.factura-recibida-totales .featured {
    font-size: 13px;
}

.factura-recibida-totales .featured input {
    height: 32px;
    font-size: 21px;
    font-weight: 800;
    color: #0060ae;
    border-bottom: 3px solid #0060ae;
}

.factura-recibida-totales .featured.total input {
    color: #00813a;
    border-bottom-color: #00813a;
}

.factura-recibida-observaciones textarea {
    width: 100%;
    height: 74px;
    min-height: 74px;
    resize: vertical;
    border: 1px solid #9eb4d0;
    background: #fff;
    color: #001d4a;
    padding: 6px;
    box-sizing: border-box;
}

@media (max-width: 1300px) {
    .factura-recibida-main {
        grid-template-columns: 1fr;
    }

    .factura-recibida-cabecera .header-grid,
    .factura-recibida-pago .pago-grid {
        grid-template-columns: repeat(2, minmax(180px, 1fr));
    }

    .factura-recibida-totales {
        grid-template-columns: repeat(3, minmax(160px, 1fr));
    }
}

.vencimientos-filter {
    grid-template-columns: minmax(260px, 1fr) 170px minmax(280px, 1.2fr) minmax(250px, 1fr);
}

.vencimientos-filter label {
    min-width: 0;
}

.vencimientos-filter input,
.vencimientos-filter select {
    width: 100%;
}

.vencimientos-pago-grid {
    min-width: 1500px;
}

.vencimientos-pago-grid th,
.vencimientos-pago-grid td {
    white-space: nowrap;
}

.vencimientos-pago-grid td:last-child {
    min-width: 260px;
    white-space: normal;
}

.vencimientos-pago-grid tbody tr.unpaid-row:not(:hover) {
    background: #fff7e6;
}

.vencimientos-pago-grid tbody tr.paid-row:not(:hover) {
    background: #effaf2;
}

.vencimiento-pago-body {
    padding: 14px 18px;
    display: grid;
    gap: 12px;
    max-width: 1050px;
}

.vencimiento-pago-card {
    border: 1px solid #bfd0e2;
    background: #f6f9fd;
    padding: 12px 14px;
}

.vencimiento-pago-card h2 {
    margin: 0 0 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid #d2deec;
    color: #001d4a;
    font-size: 20px;
    line-height: 1.1;
}

.vencimiento-pago-grid {
    display: grid;
    grid-template-columns: 150px 120px minmax(420px, 1fr) 160px;
    gap: 10px 12px;
    align-items: end;
}

.vencimiento-pago-grid label {
    display: grid;
    gap: 3px;
    color: #001d4a;
    font-size: 12px;
    font-weight: 400;
}

.vencimiento-pago-grid .span-2 {
    grid-column: span 2;
}

.vencimiento-pago-grid input,
.vencimiento-pago-grid select,
.vencimiento-pago-card textarea {
    width: 100%;
    min-width: 0;
    border: 1px solid #9eb4d0;
    background: #fff;
    color: #001d4a;
    box-sizing: border-box;
}

.vencimiento-pago-grid input,
.vencimiento-pago-grid select {
    height: 26px;
    padding: 2px 6px;
}

.vencimiento-pago-grid input[readonly] {
    background: #edf3f9;
}

.vencimiento-pago-grid .check-inline {
    display: flex;
    align-items: center;
    gap: 7px;
    min-height: 26px;
    padding-top: 16px;
}

.vencimiento-pago-grid .check-inline input {
    width: 14px;
    height: 14px;
}

.vencimiento-pago-grid .total-field {
    color: #0060ae;
    font-weight: 800;
}

.vencimiento-pago-card textarea {
    min-height: 120px;
    padding: 6px;
    resize: vertical;
}

@media (max-width: 1200px) {
    .vencimiento-pago-grid {
        grid-template-columns: repeat(2, minmax(180px, 1fr));
    }

    .vencimientos-filter {
        grid-template-columns: repeat(2, minmax(220px, 1fr));
    }
}

.trimestres-filter {
    grid-template-columns: 120px minmax(260px, 420px) 1fr;
}

.toolbar .wide-action {
    min-width: 260px;
}

.trimestres-fiscales-grid th,
.trimestres-fiscales-grid td,
.trimestre-detalle-grid th,
.trimestre-detalle-grid td {
    white-space: nowrap;
}

.trimestres-fiscales-grid td:last-child {
    min-width: 240px;
    white-space: normal;
}

.trimestre-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
    align-items: center;
    padding: 10px 14px;
    border-bottom: 1px solid #c9d7e6;
    background: #f8fbff;
}

.trimestre-summary span {
    color: #001d4a;
}

.trimestre-detalle-wrap {
    min-height: 260px;
    height: calc(100vh - 340px);
}

.trimestre-observaciones {
    padding: 8px 14px 14px;
    border-top: 1px solid #c9d7e6;
}

.trimestre-observaciones label {
    display: block;
    margin-bottom: 4px;
}

.trimestre-observaciones textarea {
    width: 100%;
    min-height: 72px;
    resize: vertical;
}

.fiscal-summary {
    border-top: 1px solid #c9d7e6;
}

.trimestre-tab-content {
    padding: 10px 14px 14px;
}

.trimestre-fiscal-ficha .fiscal-tabs-modern {
    min-height: 34px;
    padding-bottom: 0;
    position: relative;
    z-index: 2;
    flex: 0 0 auto;
}

.trimestre-fiscal-ficha .trimestre-tab-content {
    position: relative;
    z-index: 1;
    margin-top: 0;
}

.fiscal-tabs-modern {
    display: flex;
    gap: 6px;
    align-items: center;
    padding: 8px 12px 0;
    border-top: 1px solid #c9d7e6;
    border-bottom: 1px solid #c9d7e6;
    background: #f4f8fc;
    overflow-x: auto;
}

.fiscal-tabs-modern .tab-button {
    border: 1px solid #b7c8da;
    background: #ffffff;
    color: #001d4a;
    padding: 7px 12px;
    border-radius: 8px 8px 0 0;
    font-weight: 600;
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04);
    white-space: nowrap;
}

.fiscal-tabs-modern .tab-button.active {
    background: #087b7a;
    border-color: #087b7a;
    color: #ffffff;
}

.fiscal-tabs-modern .tab-button:hover:not(.active) {
    background: #eaf3fb;
}

.fiscal-cards {
    display: grid;
    grid-template-columns: repeat(4, minmax(220px, 1fr));
    gap: 10px;
}

.fiscal-cards article {
    border: 1px solid #c9d7e6;
    padding: 10px;
    background: #f8fbff;
}

.fiscal-cards h3,
.fiscal-models h3 {
    margin: 0 0 8px;
    color: #001d4a;
    font-size: 16px;
}

.fiscal-cards label {
    display: grid;
    gap: 3px;
    margin-bottom: 7px;
}

.fiscal-cards input,
.fiscal-cards textarea {
    width: 100%;
    min-width: 0;
    border: 1px solid #9eb4d0;
    box-sizing: border-box;
}

.fiscal-cards textarea {
    min-height: 118px;
    resize: vertical;
}

.fiscal-grid-wrap {
    height: calc(100vh - 300px);
    min-height: 360px;
}

.negative-amount {
    color: #d71920;
}

.closed-row {
    background: #eef4fb;
}

.warning-row {
    background: #fff8e5;
}

.error-row {
    background: #ffecec;
}

.fiscal-result {
    color: #0060ae;
    font-size: 20px;
    font-weight: 800;
}

.fiscal-models article + article {
    margin-top: 12px;
}

.fiscal-print-models {
    max-height: calc(100vh - 235px);
    overflow-y: auto;
    padding: 4px 4px 14px;
    box-sizing: border-box;
}

.fiscal-models-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    border: 1px solid #c9d7e6;
    background: #f8fbff;
    padding: 10px 12px;
    margin-bottom: 10px;
}

.fiscal-models-head h3 {
    margin: 0 0 4px;
}

.fiscal-models-head p {
    margin: 0;
    color: #4d6075;
}

.fiscal-model-buttons {
    display: grid;
    grid-template-columns: repeat(4, minmax(210px, 1fr));
    gap: 8px;
}

.fiscal-model-buttons article {
    display: grid;
    grid-template-rows: auto 1fr auto;
    gap: 6px;
    min-height: 104px;
    border: 1px solid #c9d7e6;
    border-radius: 8px;
    background: #ffffff;
    padding: 10px 12px;
}

.fiscal-model-buttons article + article {
    margin-top: 0;
}

.fiscal-model-buttons h4 {
    margin: 0;
    color: #001d4a;
    font-size: 15px;
}

.fiscal-model-buttons p {
    margin: 0;
    color: #52677e;
    line-height: 1.2;
}

@media (max-width: 1500px) {
    .fiscal-cards {
        grid-template-columns: repeat(2, minmax(220px, 1fr));
    }
}

@media (max-width: 1400px) {
    .fiscal-model-buttons {
        grid-template-columns: repeat(3, minmax(220px, 1fr));
    }
}

@media (max-width: 1100px) {
    .fiscal-model-buttons {
        grid-template-columns: repeat(2, minmax(220px, 1fr));
    }
}

/* Rejillas: cabecera fija limpia, sin transparentar filas al hacer scroll. */
.table-wrap,
.desktop-grid-wrap {
    position: relative;
}

tr.dblclick-row,
tr.dblclick-row > td {
    cursor: pointer;
}

tr.dblclick-row:hover > td:first-child::after {
    content: "Doble click = Ver/Editar registro";
    position: fixed;
    left: 50%;
    bottom: 22px;
    z-index: 10000;
    transform: translateX(-50%);
    padding: 7px 12px;
    border: 1px solid #36506d;
    border-radius: 6px;
    background: #172234;
    color: #ffffff;
    box-shadow: 0 10px 24px rgba(15, 23, 42, .24);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.15;
    pointer-events: none;
    white-space: nowrap;
}

.grid-record-link {
    color: inherit;
    text-decoration: none;
    display: inline-block;
    min-width: 100%;
}

.grid-record-link:hover {
    color: #004f9f;
    text-decoration: underline;
}

.grid-open-link {
    display: inline-grid;
    place-items: center;
    height: 28px;
    padding: 0 8px;
    border: 1px solid #7aa7cf;
    border-radius: 3px;
    background: #ffffff;
    color: #0f4c81;
    font-size: 12px;
    font-weight: 800;
    text-decoration: none;
}

.grid-open-link:hover,
.grid-open-link:focus-visible {
    background: #e8f3ff;
    color: #0f4c81;
}

.dynamic-list-panel .table-wrap {
    padding-top: 0;
}

.table-wrap .data-grid,
.desktop-grid-wrap .desktop-grid {
    border-collapse: separate;
    border-spacing: 0;
}

.table-wrap .data-grid thead th,
.desktop-grid-wrap .desktop-grid thead th {
    position: sticky;
    top: 0 !important;
    z-index: 20;
    background: #eaf1f8;
    background-clip: padding-box;
    box-shadow: inset 0 1px 0 #cbd8e6, inset 0 -1px 0 #cbd8e6;
}

.desktop-grid-wrap .desktop-grid.mostrador-grid thead th {
    background: #dbeafe !important;
    color: #06172d !important;
    border-color: #9db8d4 !important;
    box-shadow: inset 0 1px 0 #f8fbff, inset 0 -2px 0 #83a7c8 !important;
}

.desktop-grid.mostrador-grid thead th .grid-sort-button {
    color: #06172d !important;
    font-weight: 800;
    text-shadow: none;
}

.desktop-grid.mostrador-grid thead th .grid-sort-button:hover {
    color: #004b91 !important;
}

.desktop-grid.mostrador-grid thead th .grid-sort-indicator {
    color: #005eb8 !important;
}

.parte-trabajo-window .parte-lines-grid thead th,
.parte-general-window .parte-lines-grid thead th {
    background: #eaf1f8 !important;
    color: #071733 !important;
    font-weight: 700;
    text-shadow: none;
    border-color: #cbd8e6;
}

.recibos-special-filter-dialog {
    width: min(920px, calc(100vw - 48px));
}

.recibos-special-filter-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 16px;
    padding: 16px 18px;
}

.recibos-special-filter-grid label {
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.recibos-special-filter-grid label.wide {
    grid-column: 1 / -1;
}

.recibos-special-checks {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    gap: 10px 22px;
    padding: 8px 10px;
    border: 1px solid #b9cce0;
    background: #eef6ff;
}

.recibos-special-checks label {
    display: inline-flex;
    grid-template-columns: none;
    align-items: center;
    width: auto;
    gap: 7px;
    font-weight: 800;
    color: #0b2f5b;
}

.recibos-special-filter-grid input,
.recibos-special-filter-grid select {
    width: 100%;
    min-height: 28px;
    border: 1px solid #aebfd2;
    background: #fff;
}

.recibos-special-checks input[type="checkbox"] {
    width: 16px;
    min-width: 16px;
    min-height: 16px;
}

.recibos-special-filter-grid .searchable-select {
    width: 100%;
}

.facturas-special-filter-dialog {
    width: min(920px, calc(100vw - 48px));
}

.facturas-special-filter-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 18px;
    padding: 18px 22px;
}

.facturas-special-filter-grid label {
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
}

.facturas-special-filter-grid .span-2 {
    grid-column: 1 / -1;
}

.facturas-special-filter-grid input,
.facturas-special-filter-grid select {
    width: 100%;
    min-height: 30px;
    border: 1px solid #aebfd2;
    background: #fff;
    padding: 3px 7px;
}

.recibos-special-filter-grid fieldset {
    grid-column: span 1;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 12px;
    margin: 0;
    padding: 12px;
    border: 1px solid #b9cce0;
    background: #f8fbff;
}

.recibos-special-filter-grid fieldset legend {
    padding: 0 6px;
    color: #0b2f5b;
    font-weight: 800;
}

.recibos-special-filter-grid fieldset label {
    grid-template-columns: 55px minmax(0, 1fr);
}

@media (max-width: 900px) {
    .recibos-special-filter-grid {
        grid-template-columns: 1fr;
    }

    .recibos-special-filter-grid fieldset {
        grid-column: 1;
    }
}

.context-help-button {
    position: absolute;
    top: 10px;
    right: 110px;
    z-index: 20;
    display: inline-grid;
    width: 34px;
    height: 34px;
    place-items: center;
    padding: 0;
    border: 1px solid rgba(37, 99, 235, .45);
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 5px 14px rgba(15, 23, 42, .18);
    cursor: pointer;
}

.context-help-button img {
    width: 22px;
    height: 22px;
    object-fit: contain;
}

.context-help-button:hover,
.context-help-button:focus-visible {
    transform: translateY(-1px);
    border-color: #2563eb;
}

.app-js-dialog-overlay {
    position: fixed;
    inset: 0;
    z-index: 6000;
    display: grid;
    place-items: center;
    padding: 1rem;
    background: rgba(15, 28, 39, .42);
}

.app-js-dialog {
    width: min(92vw, 560px);
    padding: 1rem;
    border: 1px solid #c8d6e1;
    border-radius: 6px;
    background: #fff;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .25);
}

.app-js-dialog h2 {
    margin: 0 0 .85rem;
    color: #082949;
    font-size: 1.15rem;
    font-weight: 900;
}

.app-js-dialog-fields {
    display: grid;
    gap: .75rem;
}

.app-js-dialog-fields label {
    display: grid;
    gap: .3rem;
    color: #17324d;
    font-size: .86rem;
    font-weight: 900;
}

.app-js-dialog-fields input,
.app-js-dialog-fields textarea {
    width: 100%;
    border: 1px solid #b8c8d6;
    border-radius: 4px;
    padding: .45rem .55rem;
    font: inherit;
}

.app-js-dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: .5rem;
    margin-top: 1rem;
}

.help-tutor-editor-surface img {
    max-width: 100%;
    height: auto;
}

.help-tutor-editor-surface .help-image-resize-box {
    position: relative;
    display: inline-block;
    min-width: 80px;
    min-height: 60px;
    max-width: 100%;
    overflow: hidden;
    resize: both;
    vertical-align: middle;
    border: 1px dashed transparent;
    background: #f8fafc;
}

.help-tutor-editor-surface .help-image-resize-box:hover,
.help-tutor-editor-surface .help-image-resize-box.is-resizing {
    border-color: #2563eb;
}

.help-tutor-editor-surface .help-image-resize-box::after {
    content: "";
    position: absolute;
    right: 2px;
    bottom: 2px;
    width: 12px;
    height: 12px;
    border-right: 3px solid #2563eb;
    border-bottom: 3px solid #2563eb;
    opacity: 0;
    pointer-events: none;
}

.help-tutor-editor-surface .help-image-resize-box:hover::after,
.help-tutor-editor-surface .help-image-resize-box.is-resizing::after {
    opacity: 1;
}

.help-tutor-editor-surface .help-image-resize-box img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
}

.desktop-list-window.templates-window-fullscreen {
    position: fixed;
    inset: 0;
    z-index: 900;
    width: 100vw;
    height: 100vh;
    max-height: 100vh;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    margin: 0;
    border: 0;
    overflow: hidden;
}

.templates-window-fullscreen .templates-editor-shell,
.templates-window-fullscreen .templates-workspace,
.templates-window-fullscreen .templates-paper,
.templates-window-fullscreen .templates-paper-scroll {
    min-height: 0;
    height: 100%;
}

.templates-window-fullscreen .templates-fields {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.templates-window-fullscreen .templates-fields-list {
    flex: 1 1 auto;
}

.templates-window-fullscreen .templates-paper-canvas {
    min-height: 100%;
}

.data-grid thead th.auto-sort-header,
.desktop-grid thead th.auto-sort-header {
    cursor: pointer;
    user-select: none;
}

.data-grid thead th.auto-sort-header:hover,
.desktop-grid thead th.auto-sort-header:hover {
    background: #d7e6f3;
}

.auto-sort-indicator,
.grid-sort-indicator {
    display: inline-block;
    margin-left: 4px;
    color: #1d4ed8;
    font-size: .85em;
    font-weight: 900;
    line-height: 1;
}

.auto-sort-active {
    color: #082f63;
}

.marketing-window {
    border: 1px solid #4b5563;
    background: #f4f8fc;
}

.marketing-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    padding: 22px 30px 12px;
}

.marketing-header h1 {
    margin: 0 0 4px;
    color: #001327;
    font-size: 24px;
    font-weight: 900;
}

.marketing-header strong {
    color: #174eea;
    font-size: 12px;
}

.marketing-close-actions {
    display: flex;
    gap: 8px;
}

.marketing-toolbar,
.marketing-filters {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 30px;
    flex-wrap: wrap;
}

.marketing-toolbar label,
.marketing-filters label {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #001327;
    font-size: 12px;
    font-weight: 800;
}

.marketing-toolbar input,
.marketing-filters input,
.marketing-filters select {
    height: 24px;
    border: 1px solid #a8b9cd;
    background: #fff;
    color: #071225;
    padding: 2px 6px;
    font: inherit;
    font-weight: 500;
}

.marketing-search input {
    width: 300px;
}

.marketing-filters select {
    min-width: 220px;
}

.marketing-filters label:nth-child(2) select {
    min-width: 180px;
}

.marketing-volume input {
    width: 100px;
}

.marketing-toolbar-spacer {
    flex: 1 1 auto;
}

.marketing-grid-wrap {
    margin: 20px 0 0;
    border-top: 1px solid #9fb3c7;
    background: #fff;
}

.marketing-grid {
    min-width: 1180px;
}

.marketing-grid th {
    background: #101827;
    color: #fff;
}

.marketing-grid th:nth-child(1) {
    width: 120px;
}

.marketing-grid th:nth-child(2) {
    width: 260px;
}

.marketing-grid th:nth-child(3) {
    width: 150px;
}

.marketing-grid th:nth-child(4) {
    width: 260px;
}

.marketing-grid th:nth-child(5) {
    width: 160px;
}

.marketing-grid th:nth-child(6) {
    width: 130px;
}

.marketing-grid th:nth-child(7),
.marketing-grid th:nth-child(8) {
    width: 80px;
}

.marketing-grid td.money {
    text-align: right;
}

.marketing-grid td.center {
    text-align: center;
}

.marketing-grid input[type="checkbox"] {
    width: 14px;
    height: 14px;
}

.a3conta-window {
    min-height: calc(100vh - 110px);
    border: 1px solid #4b5563;
    background: #fff;
}

.a3conta-menu-caption {
    padding: 4px 8px;
    color: #111827;
    font-size: 12px;
}

.a3conta-toolbar {
    display: grid;
    grid-template-columns: 180px minmax(260px, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 6px 8px;
    border-bottom: 1px solid #9fb3c7;
    background: #f4f8fc;
}

.a3conta-date-filters {
    display: grid;
    gap: 7px;
}

.a3conta-toolbar label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    color: #001327;
    font-size: 12px;
    font-weight: 500;
}

.a3conta-toolbar input,
.a3conta-toolbar select {
    height: 24px;
    border: 1px solid #9fb3c7;
    background: #d9ffd9;
    color: #071225;
    padding: 2px 5px;
    font-size: 12px;
}

.a3conta-date-filters input {
    width: 100px;
}

.a3conta-export-kind {
    align-items: flex-start !important;
    flex-direction: column;
    gap: 2px !important;
    font-size: 14px !important;
}

.a3conta-export-kind select {
    width: 330px;
    height: 26px;
    background: #fff;
    font-size: 16px;
}

.a3conta-actions {
    display: flex;
    align-items: stretch;
    justify-content: flex-end;
    gap: 4px;
}

.a3conta-logo-btn,
.a3conta-icon-btn {
    min-height: 50px;
    border: 1px solid #7b8794;
    background: linear-gradient(#fff7b8, #ffe56a);
    color: #111827;
    font-weight: 800;
    cursor: pointer;
}

.a3conta-logo-btn {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 5px;
    width: 156px;
    padding: 4px 7px;
    text-align: left;
}

.a3conta-logo-btn strong {
    color: #c40000;
    font-size: 32px;
    line-height: 1;
}

.a3conta-logo-btn span,
.a3conta-icon-btn span {
    font-size: 10px;
    line-height: 1.15;
}

.a3conta-view {
    background: linear-gradient(#e0fbff, #a9edf7);
}

.a3conta-icon-btn {
    width: 64px;
    padding: 4px;
    background: linear-gradient(#ffffff, #eef4fb);
}

.a3conta-exit {
    background: linear-gradient(#ffffff, #dff7d7);
}

.a3conta-logo-btn:disabled,
.a3conta-icon-btn:disabled {
    opacity: .55;
    cursor: default;
}

.a3conta-title-line {
    border-bottom: 1px solid #9fb3c7;
    color: #111827;
    font-size: 12px;
    line-height: 15px;
    text-align: center;
}

.a3conta-grid-wrap {
    height: calc(100vh - 210px);
    border: 0;
    overflow: auto;
}

.a3conta-grid {
    min-width: 1210px;
}

.a3conta-grid th {
    background: #e7edf3;
    color: #111827;
    border-color: #9aa6b2;
    padding: 2px 4px;
    font-size: 12px;
    font-weight: 500;
}

.a3conta-grid td {
    padding: 2px 4px;
    font-size: 12px;
}

.a3conta-grid th:nth-child(1) {
    width: 105px;
}

.a3conta-grid th:nth-child(2) {
    width: 82px;
}

.a3conta-grid th:nth-child(3) {
    width: 450px;
}

.a3conta-grid th:nth-child(4),
.a3conta-grid th:nth-child(6),
.a3conta-grid th:nth-child(7) {
    width: 105px;
}

.a3conta-grid th:nth-child(5),
.a3conta-grid th:nth-child(8) {
    width: 120px;
}

.a3conta-grid th:nth-child(9),
.a3conta-grid th:nth-child(10) {
    width: 80px;
}

.a3conta-grid .right {
    text-align: right;
}

.a3conta-grid .center {
    text-align: center;
}

.comandero-layout {
    min-height: 100dvh;
    background: #eef4f8;
}

.comandero-screen {
    height: 100dvh;
    display: grid;
    grid-template-rows: auto auto auto 382px minmax(0, 1fr) auto;
    color: #06162b;
    background: #eef4f8;
    overflow: hidden;
    position: relative;
    touch-action: manipulation;
}

body.comandero-fullscreen-compact {
    overflow: hidden;
    background: #111827;
}

body.comandero-fullscreen-compact .comandero-layout {
    display: flex;
    justify-content: center;
    align-items: stretch;
    min-height: 100vh;
    background: #111827;
}

body.comandero-fullscreen-compact .comandero-screen {
    width: min(100vw, 500px);
    max-width: 500px;
    height: 100vh;
    margin: 0 auto;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, .18), 0 22px 70px rgba(0, 0, 0, .42);
}

body.comandero-fullscreen-compact .comandero-top-actions button.fullscreen {
    width: 40px;
    min-width: 40px;
    min-height: 36px;
    font-size: 22px;
}

body.comandero-fullscreen-compact .comandero-familias button {
    min-height: 40px;
    padding-left: 11px;
    padding-right: 11px;
}

.comandero-screen.lineas-ampliadas {
    grid-template-rows: auto auto 0 0 minmax(0, 1fr) auto;
}

.comandero-top,
.comandero-summary,
.comandero-ticket-head,
.comandero-actions {
    padding-left: 8px;
    padding-right: 8px;
}

.comandero-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    padding-top: 2px;
    padding-bottom: 2px;
    background: #ffffff;
    border-bottom: 1px solid #c8d6e6;
}

.comandero-top strong {
    display: block;
    font-size: 15px;
    font-weight: 900;
    line-height: 1.05;
}

.comandero-top span {
    display: block;
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 9px;
    font-weight: 700;
    color: #2f5d31;
}

.comandero-top button,
.comandero-top a,
.comandero-ticket-head button {
    min-height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 6px;
    background: #e51b2a;
    color: #fff;
    font-weight: 900;
    padding: 0 9px;
    font-size: 12px;
    text-decoration: none;
    box-sizing: border-box;
}

.comandero-top-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.comandero-top-actions button.fullscreen {
    width: 32px;
    min-width: 32px;
    padding: 0;
    background: #6daee8;
    color: #06162b;
    font-size: 18px;
    line-height: 1;
}

.comandero-top-actions .reservations {
    background: #f6c557;
    color: #06162b;
}

.comandero-top-actions button.parked {
    background: #2455d6;
}

.comandero-summary {
    display: grid;
    grid-template-columns: 1fr 1fr 82px;
    gap: 4px;
    padding-top: 2px;
    padding-bottom: 2px;
    background: #e4eff8;
    border-bottom: 1px solid #c8d6e6;
}

.comandero-summary label {
    display: grid;
    gap: 1px;
    min-width: 0;
}

.comandero-summary span {
    font-size: 9px;
    font-weight: 900;
    line-height: 1;
}

.comandero-summary select,
.comandero-mesa-button {
    min-height: 24px;
    border: 1px solid #9ab0ca;
    background: #fff;
    color: #06162b;
    font-size: 11px;
    font-weight: 800;
    min-width: 0;
    width: 100%;
    padding: 0 3px;
}

.comandero-familias {
    display: flex;
    gap: 5px;
    padding: 4px 7px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    touch-action: pan-x;
    -webkit-overflow-scrolling: touch;
    background: #fff;
    border-bottom: 1px solid #c8d6e6;
    cursor: grab;
}

.comandero-screen.lineas-ampliadas .comandero-familias,
.comandero-screen.lineas-ampliadas .comandero-products {
    min-height: 0;
    height: 0;
    padding-top: 0;
    padding-bottom: 0;
    border-bottom: 0;
    overflow: hidden;
}

.comandero-familias button {
    flex: 0 0 auto;
    min-height: 30px;
    border: 1px solid rgba(15, 23, 42, .2);
    border-radius: 6px;
    background: #f5f9fd;
    color: #fff;
    font-weight: 900;
    padding: 0 9px;
    font-size: 12px;
}

.comandero-familias button.family-color-0 { background: #0f766e; }
.comandero-familias button.family-color-1 { background: #1d4ed8; }
.comandero-familias button.family-color-2 { background: #c2410c; }
.comandero-familias button.family-color-3 { background: #7c3aed; }
.comandero-familias button.family-color-4 { background: #0e7490; }
.comandero-familias button.family-color-5 { background: #be123c; }
.comandero-familias button.family-color-6 { background: #4d7c0f; }
.comandero-familias button.family-color-7 { background: #a16207; }

.comandero-familias button.active {
    border-color: #06162b;
    box-shadow: inset 0 0 0 2px #fff, 0 0 0 2px #06162b;
    color: #fff;
}

.comandero-products {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-content: start;
    gap: 6px;
    padding: 5px 7px;
    overflow-y: auto;
    overscroll-behavior: contain;
    touch-action: pan-y;
    -webkit-overflow-scrolling: touch;
    cursor: grab;
}

.comandero-familias.drag-scrolling,
.comandero-products.drag-scrolling,
.comandero-lines.drag-scrolling,
.comandero-parked-list.drag-scrolling,
.comandero-tables-grid.drag-scrolling {
    cursor: grabbing;
}

.comandero-product {
    min-height: 120px;
    border: 1px solid #111827;
    border-radius: 6px;
    background: #fff;
    color: #06162b;
    display: grid;
    grid-template-rows: 82px minmax(26px, auto);
    gap: 3px;
    padding: 4px;
    font-weight: 900;
    text-align: center;
    -webkit-user-select: none;
    user-select: none;
}

.comandero-product img {
    width: 100%;
    height: 82px;
    object-fit: contain;
    -webkit-user-drag: none;
    user-select: none;
}

.comandero-product span {
    min-width: 0;
    font-size: 11px;
    line-height: 1.08;
}

.comandero-ticket {
    min-height: 0;
    background: #fff;
    border-top: 1px solid #b6c6d8;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
}

.comandero-ticket-head {
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #d3dbe6;
}

.comandero-ticket-title {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    flex: 0 0 auto;
}

.comandero-ticket-head strong {
    font-size: 16px;
    font-weight: 900;
}

.comandero-ticket-head button.expand-lines {
    flex: 0 0 32px;
    width: 32px;
    min-height: 28px;
    padding: 0;
    border: 1px solid #0f3db8;
    background: #2455d6;
    color: #fff;
    font-size: 17px;
    line-height: 1;
    display: grid;
    place-items: center;
}

.comandero-ticket-head button.expand-lines span {
    display: block;
    line-height: 1;
}

.comandero-ticket-total {
    margin-left: auto;
    margin-right: 6px;
    display: flex;
    align-items: center;
    gap: 5px;
    min-width: 94px;
    justify-content: flex-end;
}

.comandero-ticket-total span {
    font-size: 11px;
    font-weight: 900;
}

.comandero-ticket-total b {
    min-width: 58px;
    height: 28px;
    display: grid;
    place-items: center end;
    padding: 0 6px;
    background: #0f172a;
    color: #fff;
    font-size: 15px;
}

.comandero-ticket-head button {
    min-height: 28px;
    background: #ef4444;
}

.comandero-lines {
    overflow-y: auto;
    overscroll-behavior: contain;
    touch-action: pan-y;
    -webkit-overflow-scrolling: touch;
    padding: 4px 7px 6px;
    cursor: grab;
}

.comandero-lines p {
    margin: 12px 0;
    text-align: center;
    font-weight: 800;
    color: #5d6d80;
}

.comandero-line {
    display: grid;
    grid-template-columns: 34px 34px 34px minmax(0, 1fr) 68px 34px;
    align-items: center;
    gap: 5px;
    min-height: 42px;
    border-bottom: 1px solid #e3eaf2;
}

.comandero-line button:not(.line-note) {
    width: 34px;
    height: 32px;
    border: 1px solid #8aa0ba;
    border-radius: 5px;
    background: #f1f6fb;
    font-size: 18px;
    font-weight: 900;
}

.comandero-line button.delete {
    border-color: #ef4444;
    color: #dc2626;
    background: #fff;
    font-size: 13px;
}

.comandero-line b {
    text-align: center;
    font-size: 17px;
}

.comandero-line .line-note {
    min-width: 0;
    border: 0;
    background: transparent;
    color: #06162b;
    text-align: left;
    padding: 0;
}

.comandero-line .line-note span,
.comandero-line .line-note small {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.comandero-line .line-note span {
    font-weight: 800;
}

.comandero-line .line-note small {
    margin-top: 1px;
    color: #b45309;
    font-size: 11px;
    font-weight: 900;
}

.comandero-line strong {
    text-align: right;
    font-size: 13px;
}

.comandero-actions {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    padding-top: 6px;
    padding-bottom: max(6px, env(safe-area-inset-bottom));
    background: #e4eff8;
    border-top: 1px solid #c8d6e6;
}

.comandero-actions button {
    min-height: 44px;
    border: 0;
    border-radius: 7px;
    color: #fff;
    font-weight: 900;
    font-size: 12px;
    padding: 0 6px;
    line-height: 1.15;
}

.comandero-actions .pedido {
    background: #f4c21d;
    color: #071225;
}

.comandero-actions .aparcar {
    background: #64748b;
}

.comandero-actions .cobrar {
    background: #16a34a;
}

.comandero-actions .finalizar {
    background: #0ca06f;
}

.comandero-actions button:disabled,
.comandero-ticket-head button:disabled {
    opacity: .55;
}

.comandero-busy {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: grid;
    place-items: center;
    background: rgba(15, 23, 42, .3);
    color: #fff;
    font-size: 20px;
    font-weight: 900;
}

.comandero-reservas-layer {
    position: absolute;
    inset: 0;
    z-index: 2050;
    overflow: hidden;
    background: #f5f8fc;
}

.comandero-reservas-layer .reservations-panel {
    height: 100%;
    min-height: 0;
}

.comandero-reservas-layer .reservations-header {
    padding-top: max(8px, env(safe-area-inset-top));
}

.comandero-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1900;
    display: grid;
    align-items: end;
    background: rgba(15, 23, 42, .34);
}

.comandero-parked-panel {
    position: absolute;
    top: 42px;
    right: 10px;
    z-index: 1900;
    width: min(410px, calc(100% - 20px));
    max-height: min(64dvh, 520px);
    min-height: 220px;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    background: #fff;
    border: 1px solid #9fb1c5;
    box-shadow: 0 16px 38px rgba(15, 23, 42, .22);
}

.comandero-parked-panel header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px;
    background: #e4eff8;
    border-bottom: 1px solid #c8d6e6;
}

.comandero-parked-panel header strong {
    font-size: 18px;
    font-weight: 900;
}

.comandero-parked-panel header button {
    min-height: 36px;
    border: 0;
    border-radius: 6px;
    background: #e51b2a;
    color: #fff;
    font-weight: 900;
    padding: 0 14px;
}

.comandero-parked-list {
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    touch-action: pan-y;
    -webkit-overflow-scrolling: touch;
    padding: 8px;
    cursor: grab;
}

.comandero-parked-list p {
    margin: 22px 0;
    text-align: center;
    font-weight: 800;
    color: #5d6d80;
}

.comandero-parked-list > button {
    width: 100%;
    min-height: 66px;
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr) 70px;
    align-items: center;
    gap: 8px;
    margin-bottom: 7px;
    border: 1px solid #9fb1c5;
    border-radius: 6px;
    background: #f8fbff;
    color: #06162b;
    text-align: left;
    padding: 8px;
}

.comandero-parked-list b,
.comandero-parked-list small {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.comandero-parked-list b {
    font-size: 13px;
    font-weight: 900;
}

.comandero-parked-list small {
    margin-top: 2px;
    color: #4b5f77;
    font-size: 11px;
    font-weight: 700;
}

.comandero-parked-list strong {
    text-align: right;
    font-size: 15px;
    font-weight: 900;
}

.comandero-tables-panel {
    width: min(430px, calc(100vw - 20px));
    max-height: min(82dvh, 680px);
    min-height: 320px;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    justify-self: center;
    align-self: center;
    background: #fff;
    border: 1px solid #9fb1c5;
    box-shadow: 0 16px 38px rgba(15, 23, 42, .25);
}

.comandero-tables-panel header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px;
    background: #e4eff8;
    border-bottom: 1px solid #c8d6e6;
}

.comandero-tables-panel header strong {
    font-size: 18px;
    font-weight: 900;
}

.comandero-tables-panel header button {
    min-height: 36px;
    border: 0;
    border-radius: 6px;
    background: #e51b2a;
    color: #fff;
    font-weight: 900;
    padding: 0 14px;
}

.comandero-tables-grid {
    min-height: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-content: start;
    gap: 8px;
    overflow-y: auto;
    overscroll-behavior: contain;
    touch-action: pan-y;
    -webkit-overflow-scrolling: touch;
    padding: 10px;
    cursor: grab;
}

.comandero-note-panel {
    width: min(410px, calc(100vw - 20px));
    justify-self: center;
    align-self: center;
    display: grid;
    grid-template-rows: auto auto;
    background: #fff;
    border: 1px solid #9fb1c5;
    box-shadow: 0 16px 38px rgba(15, 23, 42, .25);
}

.comandero-note-panel header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px;
    background: #e4eff8;
    border-bottom: 1px solid #c8d6e6;
}

.comandero-note-panel header strong {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 17px;
    font-weight: 900;
}

.comandero-note-panel header button {
    min-height: 36px;
    border: 0;
    border-radius: 6px;
    background: #e51b2a;
    color: #fff;
    font-weight: 900;
    padding: 0 14px;
}

.comandero-note-body {
    display: grid;
    gap: 10px;
    padding: 10px;
}

.comandero-note-body label {
    display: grid;
    gap: 4px;
    font-size: 12px;
    font-weight: 900;
}

.comandero-note-body input {
    min-height: 42px;
    border: 1px solid #8aa0ba;
    font-size: 18px;
    font-weight: 800;
    padding: 0 8px;
}

.comandero-note-presets {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
}

.comandero-note-presets button {
    min-height: 40px;
    border: 1px solid #9ab0ca;
    border-radius: 6px;
    background: #f5f9fd;
    color: #06162b;
    font-size: 12px;
    font-weight: 900;
}

.comandero-note-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.comandero-note-actions button {
    min-height: 44px;
    border: 0;
    border-radius: 7px;
    color: #fff;
    font-weight: 900;
}

.comandero-note-actions .clear {
    background: #64748b;
}

.comandero-note-actions .save {
    background: #0ca06f;
}

.comandero-charge-panel {
    width: min(430px, calc(100vw - 20px));
    justify-self: center;
    align-self: center;
    background: #fff;
    border: 1px solid #9fb1c5;
    box-shadow: 0 16px 38px rgba(15, 23, 42, .25);
}

.comandero-charge-panel header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px;
    background: #e4eff8;
    border-bottom: 1px solid #c8d6e6;
}

.comandero-charge-panel header strong {
    font-size: 20px;
    font-weight: 900;
}

.comandero-charge-panel header button {
    min-height: 36px;
    border: 0;
    border-radius: 6px;
    background: #e51b2a;
    color: #fff;
    font-weight: 900;
    padding: 0 14px;
}

.comandero-charge-body {
    display: grid;
    gap: 10px;
    padding: 12px;
}

.comandero-charge-body label {
    display: grid;
    gap: 4px;
    font-size: 13px;
    font-weight: 900;
}

.comandero-charge-body select,
.comandero-charge-body input {
    width: 100%;
    min-height: 38px;
    border: 1px solid #9ab0ca;
    background: #fff;
    color: #06162b;
    font-size: 18px;
    font-weight: 900;
    padding: 0 8px;
}

.comandero-charge-body input {
    text-align: right;
}

.comandero-charge-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 4px;
}

.comandero-charge-actions button {
    min-height: 48px;
    border: 0;
    border-radius: 7px;
    color: #fff;
    font-size: 14px;
    font-weight: 900;
}

.comandero-charge-actions .charge {
    background: #16a34a;
}

.comandero-charge-actions .split {
    background: #7c3aed;
}

.comandero-charge-actions .ticket {
    background: #2455d6;
}

.comandero-charge-actions .cancel {
    background: #64748b;
}

.comandero-split-body {
    display: grid;
    grid-template-rows: auto auto auto minmax(0, 1fr) auto;
    gap: 8px;
    max-height: min(78dvh, 690px);
    padding: 10px;
}

.comandero-split-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
}

.comandero-split-summary span {
    display: grid;
    gap: 2px;
    min-height: 42px;
    place-items: center;
    border: 1px solid #9ab0ca;
    background: #f5f9fd;
    font-size: 11px;
    font-weight: 900;
}

.comandero-split-summary b {
    font-size: 15px;
}

.comandero-split-accounts {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    touch-action: pan-x;
    -webkit-overflow-scrolling: touch;
}

.comandero-split-accounts button {
    flex: 0 0 92px;
    min-height: 52px;
    border: 1px solid #9ab0ca;
    border-radius: 6px;
    background: #fff;
    color: #06162b;
    font-weight: 900;
}

.comandero-split-accounts button.active {
    border-color: #2455d6;
    box-shadow: inset 0 0 0 2px #2455d6;
}

.comandero-split-accounts button.add {
    flex-basis: 42px;
    background: #16a34a;
    color: #fff;
    font-size: 22px;
}

.comandero-split-accounts span,
.comandero-split-accounts b,
.comandero-split-accounts small {
    display: block;
}

.comandero-split-accounts small {
    color: #16a34a;
    font-size: 10px;
}

.comandero-split-pay {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(0, .85fr) minmax(0, .85fr);
    gap: 6px;
}

.comandero-split-pay label {
    display: grid;
    gap: 3px;
    font-size: 11px;
    font-weight: 900;
}

.comandero-split-pay select,
.comandero-split-pay input {
    min-height: 30px;
    width: 100%;
    border: 1px solid #9ab0ca;
    background: #fff;
    color: #06162b;
    font-size: 13px;
    font-weight: 900;
    padding: 0 6px;
}

.comandero-split-pay input {
    text-align: right;
}

.comandero-split-grid {
    min-height: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.comandero-split-grid section {
    min-height: 0;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    border: 1px solid #c8d6e6;
    background: #fff;
}

.comandero-split-grid h3 {
    margin: 0;
    padding: 6px;
    background: #e4eff8;
    border-bottom: 1px solid #c8d6e6;
    font-size: 12px;
    font-weight: 900;
}

.comandero-split-list {
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    touch-action: pan-y;
    -webkit-overflow-scrolling: touch;
    padding: 5px;
}

.comandero-split-list article {
    min-height: 48px;
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr);
    align-items: center;
    gap: 5px;
    border-bottom: 1px solid #edf2f7;
}

.comandero-split-list button {
    width: 30px;
    height: 30px;
    border: 1px solid #8aa0ba;
    border-radius: 5px;
    background: #f1f6fb;
    color: #06162b;
    font-size: 18px;
    font-weight: 900;
}

.comandero-split-list button:disabled {
    opacity: .45;
}

.comandero-split-list b,
.comandero-split-list small {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.comandero-split-list b {
    font-size: 12px;
    font-weight: 900;
}

.comandero-split-list small {
    margin-top: 2px;
    color: #4b5f77;
    font-size: 10px;
    font-weight: 800;
}

.comandero-split-list p {
    margin: 18px 0;
    text-align: center;
    color: #5d6d80;
    font-weight: 800;
}

.comandero-split-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
}

.comandero-split-actions button {
    min-height: 44px;
    border: 0;
    border-radius: 7px;
    color: #fff;
    font-size: 13px;
    font-weight: 900;
}

.comandero-split-actions .ticket {
    background: #2455d6;
}

.comandero-split-actions .charge {
    background: #16a34a;
}

.comandero-split-actions .finish {
    background: #0ca06f;
}

.comandero-split-actions button:disabled {
    opacity: .55;
}

@media (max-width: 390px) {
    .comandero-actions {
        gap: 5px;
    }

    .comandero-actions button {
        font-size: 12px;
        padding: 0 4px;
    }

    .comandero-split-body {
        max-height: 86dvh;
        padding: 8px;
    }

    .comandero-split-grid {
        gap: 6px;
    }

    .comandero-split-pay {
        grid-template-columns: 1fr 82px 82px;
    }
}

.comandero-table-card {
    min-height: 106px;
    display: grid;
    grid-template-rows: 56px auto auto;
    gap: 2px;
    place-items: center;
    border: 1px solid #16a34a;
    background: #f0fdf4;
    color: #06162b;
    font-weight: 900;
    padding: 6px;
}

.comandero-table-card.occupied {
    border-color: #ef4444;
    background: #fff1f2;
    color: #b91c1c;
}

.comandero-table-card img,
.comandero-table-card span {
    width: 100%;
    height: 56px;
    object-fit: contain;
    -webkit-user-drag: none;
    user-select: none;
}

.comandero-table-card span {
    display: block;
}

.comandero-table-card b {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13px;
}

.comandero-table-card small {
    font-size: 11px;
}

@media (min-width: 520px) {
    .comandero-screen {
        width: 430px;
        margin: 0 auto;
        border-left: 1px solid #c8d6e6;
        border-right: 1px solid #c8d6e6;
    }

    .comandero-parked-panel {
        right: calc((100% - 430px) / 2 + 10px);
    }
}

@media (max-width: 390px) {
    .comandero-screen {
        grid-template-rows: auto auto auto 352px minmax(0, 1fr) auto;
    }

    .comandero-screen.lineas-ampliadas {
        grid-template-rows: auto auto 0 0 minmax(0, 1fr) auto;
    }

    .comandero-products {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 5px;
        padding-left: 5px;
        padding-right: 5px;
    }

    .comandero-product {
        min-height: 112px;
        grid-template-rows: 74px minmax(24px, auto);
        padding: 3px;
    }

    .comandero-product img {
        height: 74px;
    }

    .comandero-product span {
        font-size: 10px;
    }
}

.tratamientos-mobile-layout {
    height: 100dvh;
    min-height: 100dvh;
    overflow: hidden;
    background: #eaf1f8;
    touch-action: pan-y;
}

.treat-mobile-home {
    height: 100dvh;
    min-height: 100dvh;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    gap: 14px;
    width: min(430px, 100%);
    margin: 0 auto;
    padding: max(14px, env(safe-area-inset-top)) 14px max(14px, env(safe-area-inset-bottom));
    box-sizing: border-box;
    background-color: #dcefff;
    background-image: linear-gradient(180deg, rgba(248,251,255,.22), rgba(8,52,109,.18)), url("/images/tratamientos-principal.png");
    background-size: cover;
    background-position: center center;
    color: #071733;
    overflow: hidden;
    overscroll-behavior: contain;
}

.treat-mobile-header {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    min-height: 84px;
    padding: 10px 12px;
    border: 1px solid rgba(255, 255, 255, .7);
    border-radius: 14px;
    background: rgba(255, 255, 255, .78);
    box-shadow: 0 12px 30px rgba(15, 23, 42, .12);
    backdrop-filter: blur(10px);
    position: sticky;
    top: max(0px, env(safe-area-inset-top));
    z-index: 20;
}

.treat-mobile-logo {
    width: 66px;
    height: 66px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: #ffffff;
    box-shadow: inset 0 0 0 1px rgba(148, 163, 184, .35), 0 6px 18px rgba(15, 23, 42, .10);
    overflow: hidden;
}

.treat-mobile-logo img {
    width: 58px;
    height: 58px;
    object-fit: contain;
}

.treat-mobile-header h1 {
    margin: 0;
    font-size: 19px;
    line-height: 1.12;
    font-weight: 900;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    white-space: normal;
}

.treat-mobile-header p {
    margin: 4px 0 0;
    color: #2563eb;
    font-size: 13px;
    line-height: 1.2;
    font-weight: 800;
    overflow-wrap: anywhere;
}

.treat-mobile-actions {
    display: grid;
    align-content: center;
    justify-items: center;
    gap: 24px;
    padding: 0 2px;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    overscroll-behavior: contain;
}

.treat-mobile-icon-link {
    display: grid;
    justify-items: center;
    gap: 7px;
    width: min(178px, 46vw);
    min-height: 132px;
    border: 0;
    border-radius: 16px;
    background: rgba(255, 255, 255, .72);
    color: #07275b;
    padding: 12px 10px 10px;
    text-align: center;
    box-shadow: 0 16px 32px rgba(4, 28, 65, .18);
    backdrop-filter: blur(8px);
}

.treat-mobile-icon-link img {
    width: 100px;
    height: 100px;
    object-fit: contain;
    filter: drop-shadow(0 8px 12px rgba(4, 28, 65, .20));
}

.treat-mobile-icon-link span {
    font-size: 17px;
    line-height: 1.1;
    font-weight: 900;
    letter-spacing: 0;
    text-shadow: 0 1px 0 rgba(255, 255, 255, .8);
}

.treat-mobile-icon-link:active {
    transform: translateY(1px);
}

.treat-mobile-footer {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 48px;
    gap: 9px;
    position: sticky;
    bottom: max(0px, env(safe-area-inset-bottom));
    z-index: 20;
}

.treat-mobile-footer .app-btn {
    min-height: 44px;
    border-radius: 12px;
    font-size: 15px;
    box-shadow: 0 10px 22px rgba(15, 23, 42, .14);
}

.treat-mobile-list-panel,
.treat-mobile-ficha-panel {
    width: min(430px, 100vw);
    height: 100dvh;
    margin: 0 auto;
    border: 0;
    border-radius: 0;
    box-sizing: border-box;
}

.desktop-card.factura-window.treat-mobile-ficha-panel,
.desktop-panel.treat-mobile-list-panel {
    width: min(430px, 100vw);
    max-width: 430px;
    min-width: 0;
    margin: 0 auto;
    overscroll-behavior: contain;
}

.desktop-card.factura-window.treat-mobile-ficha-panel {
    height: 100dvh;
    max-height: 100dvh;
    overflow-y: auto;
    overflow-x: hidden;
}

.desktop-panel.treat-mobile-list-panel {
    height: 100dvh;
    max-height: 100dvh;
    display: grid;
    grid-template-rows: auto auto auto minmax(0, 1fr) auto;
    overflow: hidden;
}

.treat-mobile-list-panel .panel-title-row,
.treat-mobile-ficha-panel .factura-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    min-height: 0;
    padding: 12px 12px 10px;
    background: rgba(248, 251, 255, .98);
    border-bottom: 1px solid #c7d7e7;
    position: sticky;
    top: 0;
    z-index: 30;
}

.treat-mobile-list-panel .title-with-icon,
.treat-mobile-ficha-panel .title-with-icon {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.treat-mobile-list-panel .title-with-icon img,
.treat-mobile-ficha-panel .title-with-icon img {
    width: 38px;
    height: 38px;
}

.treat-mobile-list-panel h1,
.treat-mobile-ficha-panel h2 {
    margin: 0;
    font-size: 22px;
    line-height: 1.1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.treat-mobile-list-panel .title-with-icon p {
    display: none;
}

.treat-mobile-list-panel .toolbar.compact,
.treat-mobile-ficha-panel .factura-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    overflow: visible;
    padding: 0;
}

.treat-mobile-list-panel .toolbar.compact .app-btn,
.treat-mobile-ficha-panel .factura-actions .app-btn {
    min-width: 0;
    width: 100%;
    min-height: 42px;
    padding: 7px 9px;
    border-radius: 7px;
    font-size: 13px;
    justify-content: center;
    overflow: hidden;
    text-overflow: ellipsis;
}

.treat-mobile-list-panel .toolbar.compact .app-btn-close,
.treat-mobile-ficha-panel .factura-actions .app-btn-close {
    grid-column: auto;
}

.treat-mobile-list-panel .toolbar.compact .app-btn-help,
.treat-mobile-ficha-panel .factura-actions .app-btn-help {
    grid-column: auto;
    justify-self: stretch;
    width: 100%;
    min-width: 0;
}

.treat-mobile-list-panel .filter-strip {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 9px 12px;
    min-height: 0;
}

.treat-mobile-list-panel .filter-strip label,
.treat-mobile-ficha-panel label {
    min-width: 0;
}

.treat-mobile-list-panel .filter-strip input,
.treat-mobile-list-panel .filter-strip select {
    width: 100%;
    min-width: 0;
    min-height: 38px;
    font-size: 16px;
}

.treat-mobile-list-panel > .factura-line-toolbar {
    min-height: 34px;
    padding: 7px 12px;
    font-size: 13px;
    align-items: center;
}

.treat-mobile-list-panel .table-wrap {
    min-height: 0;
    padding: 0;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    overscroll-behavior: contain;
}

.treat-mobile-home .treat-mobile-actions.drag-scrolling,
.treat-mobile-list-panel .table-wrap.drag-scrolling,
.treat-mobile-ficha-panel.drag-scrolling,
.treat-mobile-ficha-panel .tratamiento-sesiones-wrap.drag-scrolling {
    cursor: grabbing;
    user-select: none;
}

.treat-mobile-list-panel .data-grid {
    min-width: 0;
    width: 100%;
    table-layout: fixed;
}

.treat-mobile-list-panel .data-grid th,
.treat-mobile-list-panel .data-grid td {
    padding: 8px 7px;
    font-size: 12px;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.treat-mobile-list-panel .grid-row-actions,
.treat-mobile-list-panel .w-actions {
    display: none;
}

.treat-mobile-list-panel.sanitarias-list-panel .data-grid th:nth-child(n+7),
.treat-mobile-list-panel.sanitarias-list-panel .data-grid td:nth-child(n+7),
.treat-mobile-list-panel.tratamientos-list-panel .data-grid th:nth-child(6),
.treat-mobile-list-panel.tratamientos-list-panel .data-grid td:nth-child(6),
.treat-mobile-list-panel.tratamientos-list-panel .data-grid th:nth-child(8),
.treat-mobile-list-panel.tratamientos-list-panel .data-grid td:nth-child(8),
.treat-mobile-list-panel.tratamientos-list-panel .data-grid th:nth-child(n+12),
.treat-mobile-list-panel.tratamientos-list-panel .data-grid td:nth-child(n+12) {
    display: none;
}

.treat-mobile-list-panel.sanitarias-list-panel .data-grid th:nth-child(2),
.treat-mobile-list-panel.sanitarias-list-panel .data-grid td:nth-child(2),
.treat-mobile-list-panel.tratamientos-list-panel .data-grid th:nth-child(2),
.treat-mobile-list-panel.tratamientos-list-panel .data-grid td:nth-child(2) {
    width: 58px;
}

.treat-mobile-list-panel.sanitarias-list-panel .data-grid th:nth-child(3),
.treat-mobile-list-panel.sanitarias-list-panel .data-grid td:nth-child(3),
.treat-mobile-list-panel.tratamientos-list-panel .data-grid th:nth-child(3),
.treat-mobile-list-panel.tratamientos-list-panel .data-grid td:nth-child(3) {
    width: 72px;
}

.treat-mobile-list-panel.tratamientos-list-panel .tratamientos-list-grid th:nth-child(1),
.treat-mobile-list-panel.tratamientos-list-panel .tratamientos-list-grid td:nth-child(1) {
    width: 43%;
}

.treat-mobile-list-panel.tratamientos-list-panel .tratamientos-list-grid th:nth-child(2),
.treat-mobile-list-panel.tratamientos-list-panel .tratamientos-list-grid td:nth-child(2) {
    width: 25%;
}

.treat-mobile-list-panel.tratamientos-list-panel .tratamientos-list-grid th:nth-child(3),
.treat-mobile-list-panel.tratamientos-list-panel .tratamientos-list-grid td:nth-child(3) {
    width: 32%;
}

.treat-mobile-list-panel.sanitarias-list-panel .sanitarias-list-grid th:nth-child(1),
.treat-mobile-list-panel.sanitarias-list-panel .sanitarias-list-grid td:nth-child(1) {
    width: 56px;
}

.treat-mobile-list-panel.sanitarias-list-panel .sanitarias-list-grid th:nth-child(2),
.treat-mobile-list-panel.sanitarias-list-panel .sanitarias-list-grid td:nth-child(2) {
    width: auto;
}

.treat-mobile-list-panel.sanitarias-list-panel .sanitarias-list-grid th:nth-child(3),
.treat-mobile-list-panel.sanitarias-list-panel .sanitarias-list-grid td:nth-child(3) {
    width: 86px;
}

.treat-mobile-list-panel.sanitarias-list-panel .sanitarias-list-grid th:nth-child(4),
.treat-mobile-list-panel.sanitarias-list-panel .sanitarias-list-grid td:nth-child(4) {
    width: 54px;
}

.treat-mobile-list-panel.tratamientos-list-panel .tratamientos-filter-strip {
    border-top: 1px solid #c7d7e7;
}

.treat-mobile-list-panel .pager {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    padding: 8px 12px max(10px, env(safe-area-inset-bottom));
    background: rgba(248, 251, 255, .98);
    border-top: 1px solid #c7d7e7;
}

.treat-mobile-list-panel .pager span {
    margin: 0;
    font-size: 12px;
}

.treat-mobile-list-panel .pager span:nth-child(1),
.treat-mobile-list-panel .pager span:nth-child(2) {
    grid-column: auto;
}

.treat-mobile-list-panel .pager select,
.treat-mobile-list-panel .pager button {
    width: 100%;
    min-width: 0;
    min-height: 38px;
    padding: 5px 6px;
    font-size: 12px;
}

.treat-mobile-list-panel .pager select {
    grid-column: 1 / -1;
}

.treat-mobile-ficha-panel {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    overscroll-behavior: contain;
}

.desktop-card.factura-window.treat-mobile-ficha-panel .factura-header {
    flex: 0 0 auto;
}

.treat-mobile-ficha-panel .sanitaria-head,
.treat-mobile-ficha-panel .tratamiento-head {
    display: grid;
    grid-template-columns: 1fr;
    gap: 9px;
    padding: 10px;
    overflow: visible;
}

.desktop-card.factura-window.treat-mobile-ficha-panel .sanitaria-head,
.desktop-card.factura-window.treat-mobile-ficha-panel .tratamiento-head {
    grid-template-columns: 1fr;
    align-items: stretch;
    padding: 10px 12px;
}

.treat-mobile-ficha-panel .sanitaria-head input,
.treat-mobile-ficha-panel .sanitaria-head select,
.treat-mobile-ficha-panel .tratamiento-head input,
.treat-mobile-ficha-panel .tratamiento-head select {
    min-height: 38px;
    font-size: 16px;
}

.treat-mobile-ficha-panel .combo-with-action {
    grid-template-columns: minmax(0, 1fr) 36px;
    align-items: stretch;
}

.treat-mobile-ficha-panel .treat-paciente-lookup {
    min-width: 0;
    width: 100%;
}

.treat-mobile-ficha-panel .treat-paciente-lookup .article-lookup-input,
.treat-mobile-ficha-panel .treat-empleado-lookup .article-lookup-input,
.treat-mobile-ficha-panel .treat-combo-lookup .article-lookup-input {
    min-height: 38px;
    font-size: 16px;
}

.treat-mobile-ficha-panel .treat-paciente-lookup .article-lookup-results,
.treat-mobile-ficha-panel .treat-empleado-lookup .article-lookup-results,
.treat-mobile-ficha-panel .treat-combo-lookup .article-lookup-results {
    left: 0;
    right: auto;
    width: min(100%, calc(100vw - 34px));
    max-height: 260px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
}

.treat-mobile-ficha-panel .treat-paciente-lookup .article-lookup-results button,
.treat-mobile-ficha-panel .treat-empleado-lookup .article-lookup-results button,
.treat-mobile-ficha-panel .treat-combo-lookup .article-lookup-results button {
    grid-template-columns: 62px minmax(0, 1fr);
    min-height: 42px;
    padding: 8px;
}

.treat-mobile-ficha-panel .treat-empleado-lookup,
.treat-mobile-ficha-panel .treat-combo-lookup {
    min-width: 0;
    width: 100%;
}

.treat-patient-info-host {
    position: relative;
    display: grid;
    min-width: 0;
}

.treat-patient-popover {
    position: absolute;
    right: 0;
    top: calc(100% + 7px);
    z-index: 45;
    display: grid;
    gap: 3px;
    width: min(260px, calc(100vw - 34px));
    padding: 9px 10px;
    border: 1px solid #9fc0df;
    border-radius: 8px;
    background: rgba(255, 255, 255, .98);
    color: #071733;
    box-shadow: 0 14px 28px rgba(15, 23, 42, .18);
    font-size: 12px;
    line-height: 1.25;
}

.treat-patient-popover b {
    font-size: 13px;
}

.treat-mobile-ficha-panel .cliente-open {
    min-height: 38px;
}

.treat-mobile-ficha-panel .desktop-check {
    padding-top: 0;
}

.treat-mobile-ficha-panel .sanitaria-foto,
.treat-mobile-ficha-panel .tratamiento-foto {
    grid-column: auto;
    grid-row: auto;
    justify-self: stretch;
}

.treat-mobile-ficha-panel .sanitaria-text-grid {
    grid-template-columns: 1fr;
    grid-auto-rows: minmax(180px, auto);
    padding: 10px;
    overflow: visible;
}

.desktop-card.factura-window.treat-mobile-ficha-panel .sanitaria-text-grid {
    flex: 0 0 auto;
    grid-template-columns: 1fr;
    grid-auto-rows: auto;
    gap: 10px;
    padding: 10px 12px 14px;
    overflow: visible;
}

.treat-mobile-ficha-panel .sanitaria-text-grid textarea,
.treat-mobile-ficha-panel .tratamiento-descripcion textarea,
.treat-mobile-ficha-panel .tratamiento-sesiones-grid textarea {
    min-height: 150px;
    resize: vertical;
    font-size: 16px;
}

.desktop-card.factura-window.treat-mobile-ficha-panel .sanitaria-text-grid textarea,
.desktop-card.factura-window.treat-mobile-ficha-panel .tratamiento-descripcion textarea {
    min-height: 150px;
    resize: vertical;
}

.treat-mobile-ficha-panel .tratamiento-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    padding: 10px 12px 8px;
    background: #eef5fb;
    border-top: 1px solid #c7d7e7;
    border-bottom: 1px solid #c7d7e7;
}

.treat-mobile-ficha-panel .tratamiento-tabs button {
    min-width: 0;
    min-height: 38px;
    padding: 8px 6px;
    border: 1px solid #b8cbe0;
    border-radius: 8px;
    background: #ffffff;
    color: #071733;
    box-shadow: 0 4px 10px rgba(15, 23, 42, .06);
}

.treat-mobile-ficha-panel .tratamiento-tabs button.active {
    border-color: #0f8b8d;
    background: #0f8b8d;
    color: #ffffff;
    box-shadow: 0 8px 16px rgba(15, 118, 110, .20);
}

.treat-mobile-ficha-panel .tratamiento-descripcion,
.treat-mobile-ficha-panel .tratamiento-sesiones {
    overflow: visible;
}

.desktop-card.factura-window.treat-mobile-ficha-panel .tratamiento-descripcion,
.desktop-card.factura-window.treat-mobile-ficha-panel .tratamiento-sesiones {
    flex: 0 0 auto;
    overflow: visible;
}

.treat-mobile-ficha-panel .tratamiento-sesiones > .factura-line-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    min-height: 0;
    padding: 10px 12px;
    border-bottom: 1px solid #d5e0eb;
    background: #f8fbff;
}

.treat-mobile-ficha-panel .tratamiento-sesiones > .factura-line-toolbar .app-btn {
    min-height: 34px;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 13px;
    justify-self: start;
}

.treat-mobile-ficha-panel .tratamiento-sesiones > .factura-line-toolbar span {
    justify-self: end;
    color: #334155;
    font-size: 13px;
    font-weight: 800;
    white-space: nowrap;
}

.treat-mobile-ficha-panel .tratamiento-descripcion label {
    padding: 10px;
}

.treat-mobile-ficha-panel .tratamiento-sesiones-wrap {
    overflow-x: auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x pan-y;
}

.treat-mobile-ficha-panel .tratamiento-sesiones-grid {
    min-width: 680px;
}

.treat-mobile-ficha-panel .tratamiento-sesiones-cards {
    display: grid;
    gap: 9px;
    padding: 10px 12px max(14px, env(safe-area-inset-bottom));
    background: #eef5fb;
    max-height: min(58dvh, 520px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
}

.treat-mobile-ficha-panel .tratamiento-sesion-card {
    display: grid;
    gap: 10px;
    padding: 12px;
    border: 1px solid #b8cbe0;
    border-radius: 10px;
    background: #ffffff;
    box-shadow: 0 10px 18px rgba(15, 23, 42, .08);
}

.treat-mobile-ficha-panel .sesion-card-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    min-height: 32px;
    padding-bottom: 2px;
    border-bottom: 1px solid #edf2f7;
    color: #07356d;
}

.treat-mobile-ficha-panel .sesion-card-head strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 16px;
}

.treat-mobile-ficha-panel .sesion-card-head span {
    display: flex;
    gap: 6px;
}

.treat-mobile-ficha-panel .sesion-card-head .row-icon-button {
    width: 32px;
    min-width: 32px;
    height: 28px;
    min-height: 28px;
    border-radius: 6px;
    font-size: 11px;
}

.treat-mobile-ficha-panel .sesion-card-head .row-icon-button.save {
    width: 58px;
    min-width: 58px;
    border-color: #16a34a;
    background: #22c55e;
    color: #ffffff;
    font-weight: 900;
}

.treat-mobile-ficha-panel .tratamiento-sesion-card label {
    display: grid;
    gap: 5px;
    color: #102036;
    font-size: 12px;
    font-weight: 800;
}

.treat-mobile-ficha-panel .tratamiento-sesion-card input,
.treat-mobile-ficha-panel .tratamiento-sesion-card textarea {
    width: 100%;
    min-width: 0;
    border: 1px solid #a9b8c9;
    border-radius: 6px;
    background: #ffffff;
}

.treat-mobile-ficha-panel .tratamiento-sesion-card textarea {
    min-height: 96px;
    overflow: hidden;
    resize: none;
}

@media (min-width: 520px) {
    .treat-mobile-home,
    .treat-mobile-list-panel,
    .treat-mobile-ficha-panel {
        border-left: 1px solid #c7d7e7;
        border-right: 1px solid #c7d7e7;
    }
}

.operario-mobile-layout {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.operario-mobile-home {
    background-color: #edf6ff;
    background-image: linear-gradient(180deg, rgba(6, 32, 73, .08), rgba(6, 32, 73, .44)), url("/FONDOS/operario%20movil.jpg?v=20260910");
    background-position: center center;
}

.operario-taller-home {
    background-color: #0a63b6;
    background-image: linear-gradient(180deg, rgba(3, 35, 78, .08), rgba(3, 35, 78, .56)), url("/FONDOS/operario-taller.png?v=20260915");
    background-position: center top;
    background-size: cover;
}

.operario-mobile-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-content: center;
    align-self: center;
    justify-items: center;
    gap: 12px;
    padding: 12px 0;
}

.operario-mobile-link {
    width: min(164px, 42vw);
    min-height: 0;
    aspect-ratio: 1 / 1;
    padding: 0;
    border: 0;
    border-radius: 18px;
    background: transparent;
    box-shadow: none;
    overflow: hidden;
}

.operario-mobile-link img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
}

.operario-mobile-link span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.operario-mobile-layout .work-surface {
    width: min(430px, 100vw);
    min-height: 100dvh;
    margin: 0 auto;
    padding: 12px 12px max(16px, env(safe-area-inset-bottom));
    border: 0;
    border-radius: 0;
    background: #f8fbff;
    color: #071733;
    box-shadow: none;
    box-sizing: border-box;
}

.operario-mobile-layout .toolbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: grid;
    gap: 10px;
    padding: max(10px, env(safe-area-inset-top)) 0 10px;
    background: rgba(248, 251, 255, .97);
    border-bottom: 1px solid #c7d7e7;
}

.operario-mobile-layout .toolbar h1 {
    margin: 0;
    font-size: 22px;
    line-height: 1.1;
}

.operario-mobile-layout .eyebrow {
    margin: 0 0 3px;
    color: #2563eb;
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.operario-mobile-layout .toolbar-actions,
.operario-mobile-layout .filters-row,
.operario-mobile-layout .signature-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    align-items: stretch;
}

.operario-mobile-layout .toolbar-actions:has(.mobile-home-button) {
    grid-template-columns: 46px repeat(2, minmax(0, 1fr));
}

.operario-mobile-layout .toolbar-actions .primary-button:last-child:nth-child(3),
.operario-mobile-layout .toolbar-actions .primary-button:last-child:nth-child(4) {
    grid-column: 1 / -1;
}

.operario-mobile-layout .albaranes-mobile-list .toolbar-actions {
    grid-template-columns: 46px minmax(0, 1fr) minmax(0, 1fr);
}

.operario-mobile-layout .presupuestos-mobile-list .toolbar-actions {
    grid-template-columns: 46px minmax(0, 1fr) minmax(0, 1fr);
}

.operario-mobile-layout .albaranes-mobile-list .toolbar-actions .primary-button:last-child:nth-child(3),
.operario-mobile-layout .presupuestos-mobile-list .toolbar-actions .primary-button:last-child:nth-child(3) {
    grid-column: auto;
}

.operario-mobile-layout .albaranes-mobile-list .mobile-list-home,
.operario-mobile-layout .presupuestos-mobile-list .mobile-list-home {
    border-color: #93c5fd;
    background: #dbeafe;
}

.operario-mobile-layout .albaranes-mobile-list .mobile-list-refresh,
.operario-mobile-layout .presupuestos-mobile-list .mobile-list-refresh {
    border-color: #fbbf24;
    background: #facc15;
    color: #102036;
}

.operario-mobile-layout .albaranes-mobile-list .mobile-list-new,
.operario-mobile-layout .presupuestos-mobile-list .mobile-list-new {
    border-color: #16a34a;
    background: #22c55e;
    color: #ffffff;
}

.operario-mobile-layout .cliente-mobile-ficha .toolbar h1 {
    font-weight: 500;
    line-height: 1.15;
}

.operario-mobile-layout .cliente-mobile-ficha .toolbar-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.operario-mobile-layout .cliente-mobile-ficha .mobile-client-back {
    border-color: #93c5fd;
    background: #dbeafe;
    color: #0f3f7a;
}

.operario-mobile-layout .cliente-mobile-ficha .mobile-client-save {
    border-color: #16a34a;
    background: #22c55e;
    color: #ffffff;
}

.operario-mobile-layout .cliente-mobile-ficha .detail-grid {
    grid-template-columns: 1fr;
    gap: 10px;
}

.operario-mobile-layout .cliente-mobile-ficha .detail-grid > div {
    display: grid;
    grid-template-columns: 1fr;
    gap: 5px;
    min-width: 0;
}

.operario-mobile-layout .cliente-mobile-ficha .detail-grid > div > span {
    color: #102036;
    font-size: 12px;
    font-weight: 500;
}

.operario-mobile-layout .cliente-mobile-ficha .detail-grid > div > strong {
    display: block;
    min-height: 34px;
    padding: 7px 9px;
    border: 1px solid #a9b8c9;
    border-radius: 6px;
    background: #ffffff;
    color: #071733;
    font-size: 15px;
    font-weight: 400;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.operario-mobile-layout .cliente-mobile-ficha .form-grid {
    grid-template-columns: 1fr;
    gap: 10px;
}

.operario-mobile-layout .cliente-mobile-ficha .form-grid label {
    display: grid;
    grid-template-columns: 1fr;
    gap: 5px;
    font-weight: 500;
}

.operario-mobile-layout .filters-row {
    margin: 10px 0;
}

.operario-mobile-layout .client-mobile-search {
    display: grid;
    gap: 7px;
    margin: 10px 0 12px;
    padding: 10px;
    border: 1px solid #c7d7e7;
    border-radius: 8px;
    background: #ffffff;
}

.operario-mobile-layout .client-mobile-search label {
    margin: 0;
    color: #07275b;
    font-size: 12px;
    font-weight: 600;
}

.operario-mobile-layout .client-mobile-search-box {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px;
    align-items: stretch;
}

.operario-mobile-layout .client-mobile-clear {
    width: 42px;
    min-width: 42px;
    padding: 0;
    font-size: 20px;
    line-height: 1;
}

.operario-mobile-layout .filters-row input {
    grid-column: 1 / -1;
}

.operario-mobile-layout .primary-button,
.operario-mobile-layout .secondary-button,
.operario-mobile-layout .icon-button,
.operario-mobile-layout .compact-button,
.operario-mobile-layout .plain-row-button {
    min-width: 0;
    min-height: 40px;
    padding: 7px 10px;
    border: 1px solid #b8cbe0;
    border-radius: 7px;
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    text-align: center;
    white-space: normal;
}

.operario-mobile-layout .primary-button {
    border-color: #0f8b8d;
    background: #0f8b8d;
    color: #ffffff;
}

.operario-mobile-layout .secondary-button,
.operario-mobile-layout .icon-button,
.operario-mobile-layout .compact-button,
.operario-mobile-layout .plain-row-button {
    background: #ffffff;
    color: #07275b;
}

.operario-mobile-layout .albaran-mobile-ficha .mobile-action-back {
    border-color: #93c5fd;
    background: #dbeafe;
    color: #0f3f7a;
}

.operario-mobile-layout .albaran-mobile-ficha .mobile-action-sign {
    border-color: #a5b4fc;
    background: #4f46e5;
    color: #ffffff;
}

.operario-mobile-layout .albaran-mobile-ficha .mobile-action-pdf {
    border-color: #7dd3fc;
    background: #0284c7;
    color: #ffffff;
}

.operario-mobile-layout .albaran-mobile-ficha .mobile-action-save {
    border-color: #16a34a;
    background: #22c55e;
    color: #ffffff;
}

.operario-mobile-layout .albaran-mobile-ficha .mobile-action-add {
    border-color: #fbbf24;
    background: #facc15;
    color: #102036;
}

.operario-mobile-layout .albaran-mobile-ficha .mobile-action-back:disabled,
.operario-mobile-layout .albaran-mobile-ficha .mobile-action-sign:disabled,
.operario-mobile-layout .albaran-mobile-ficha .mobile-action-pdf:disabled,
.operario-mobile-layout .albaran-mobile-ficha .mobile-action-save:disabled,
.operario-mobile-layout .albaran-mobile-ficha .mobile-action-add:disabled {
    opacity: .58;
}

.operario-mobile-layout .mobile-home-button {
    width: 46px;
    min-width: 46px;
    padding: 0;
    display: grid;
    place-items: center;
}

.operario-mobile-layout .mobile-home-button img {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.operario-mobile-layout .form-control {
    width: 100%;
    min-width: 0;
    min-height: 38px;
    padding: 8px 10px;
    border: 1px solid #a9b8c9;
    border-radius: 6px;
    background: #ffffff;
    color: #071733;
    font: inherit;
    font-size: 16px;
    box-sizing: border-box;
}

.operario-mobile-layout textarea.form-control,
.operario-mobile-layout .auto-textarea {
    min-height: 92px;
    resize: vertical;
}

.operario-mobile-layout .alert-box,
.operario-mobile-layout .success-box,
.operario-mobile-layout .empty-state,
.operario-mobile-layout .total-pill {
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
}

.operario-mobile-layout .alert-box {
    border: 1px solid #fecaca;
    background: #fff1f2;
    color: #991b1b;
}

.operario-mobile-layout .success-box {
    border: 1px solid #bbf7d0;
    background: #f0fdf4;
    color: #166534;
}

.operario-mobile-layout .empty-state,
.operario-mobile-layout .total-pill {
    border: 1px solid #c7d7e7;
    background: #ffffff;
    color: #334155;
}

.operario-mobile-layout .data-list,
.operario-mobile-layout .compact-data-list {
    display: grid;
    gap: 9px;
}

.operario-mobile-layout .delivery-row,
.operario-mobile-layout .generic-row,
.operario-mobile-layout .diary-row,
.operario-mobile-layout .child-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    width: 100%;
    padding: 11px 12px;
    border: 1px solid #c7d7e7;
    border-radius: 8px;
    background: #ffffff;
    color: #071733;
    text-align: left;
    box-shadow: 0 8px 18px rgba(15, 23, 42, .07);
}

.operario-mobile-layout .row-main,
.operario-mobile-layout .generic-row-main,
.operario-mobile-layout .delivery-note-main,
.operario-mobile-layout .diary-entry-main {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.operario-mobile-layout .row-main strong,
.operario-mobile-layout .generic-row-main strong,
.operario-mobile-layout .delivery-note-main strong {
    color: #07356d;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.operario-mobile-layout .row-main span,
.operario-mobile-layout .row-meta,
.operario-mobile-layout .delivery-note-summary,
.operario-mobile-layout .generic-row-main span,
.operario-mobile-layout .diary-entry-description,
.operario-mobile-layout .diary-entry-footer {
    min-width: 0;
    color: #475569;
    font-size: 12px;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.operario-mobile-layout .row-meta {
    display: grid;
    justify-items: end;
    align-content: center;
    max-width: 112px;
}

.operario-mobile-layout .form-grid,
.operario-mobile-layout .generic-form-grid,
.operario-mobile-layout .detail-grid,
.operario-mobile-layout .quick-entry,
.operario-mobile-layout .diary-filters {
    display: grid;
    grid-template-columns: 1fr;
    gap: 9px;
    margin: 10px 0;
}

.operario-mobile-layout label {
    display: grid;
    gap: 4px;
    min-width: 0;
    color: #102036;
    font-size: 12px;
    font-weight: 600;
}

.operario-mobile-layout .span-2 {
    grid-column: 1 / -1;
}

.operario-mobile-layout .line-editor,
.operario-mobile-layout .child-edit-panel,
.operario-mobile-layout .signature-panel,
.operario-mobile-layout .signed-pdf-panel {
    display: grid;
    gap: 10px;
    margin-top: 12px;
    padding: 10px;
    border: 1px solid #c7d7e7;
    border-radius: 8px;
    background: #eef5fb;
}

.operario-mobile-layout .line-header,
.operario-mobile-layout .totals-bar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
}

.operario-mobile-layout .line-row {
    display: grid;
    gap: 8px;
    padding: 10px;
    border: 1px solid #d5e0eb;
    border-radius: 8px;
    background: #ffffff;
}

.operario-mobile-layout .line-amounts,
.operario-mobile-layout .line-tax-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.operario-mobile-layout .line-readonly-amount {
    display: grid;
    align-content: center;
    min-height: 38px;
    padding: 8px 10px;
    border: 1px solid #d5e0eb;
    border-radius: 6px;
    background: #f8fafc;
    font-weight: 600;
}

.operario-mobile-layout .totals-bar {
    position: sticky;
    bottom: 0;
    z-index: 15;
    margin: 0 -12px;
    padding: 8px 12px max(8px, env(safe-area-inset-bottom));
    border-top: 1px solid #c7d7e7;
    background: rgba(248, 251, 255, .98);
}

.operario-mobile-layout .totals-values {
    display: flex;
    width: 100%;
    min-width: 0;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 12px;
    font-weight: 700;
    color: #07275b;
    white-space: nowrap;
}

.operario-mobile-layout .article-picker,
.operario-mobile-layout .lookup-field {
    position: relative;
    min-width: 0;
}

.operario-mobile-layout .article-input-shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 40px;
    gap: 6px;
}

.operario-mobile-layout .article-results,
.operario-mobile-layout .lookup-results {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 4px);
    z-index: 40;
    max-height: 260px;
    overflow-y: auto;
    border: 1px solid #9fc0df;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 14px 28px rgba(15, 23, 42, .18);
}

.operario-mobile-layout .article-result,
.operario-mobile-layout .lookup-result,
.operario-mobile-layout .lookup-create-result {
    display: grid;
    gap: 2px;
    width: 100%;
    padding: 9px 10px;
    border: 0;
    border-bottom: 1px solid #edf2f7;
    background: #ffffff;
    color: #071733;
    text-align: left;
}

.operario-mobile-layout .muted-result {
    color: #64748b;
}

.operario-mobile-layout .check-field {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border: 1px solid #a9b8c9;
    border-radius: 6px;
    background: #ffffff;
}

.operario-mobile-layout .check-field input {
    width: 20px;
    height: 20px;
}

.operario-mobile-layout .form-scroll-controls {
    position: fixed;
    right: max(10px, env(safe-area-inset-right));
    bottom: max(14px, env(safe-area-inset-bottom));
    z-index: 50;
    display: grid;
    gap: 8px;
}

.operario-mobile-layout .scroll-fab {
    width: 44px;
    height: 44px;
    border: 1px solid #b8cbe0;
    border-radius: 999px;
    background: #ffffff;
    color: #07356d;
    box-shadow: 0 10px 22px rgba(15, 23, 42, .18);
    font-size: 20px;
    font-weight: 700;
}

.operario-mobile-layout .signature-canvas {
    width: 100%;
    height: 180px;
    border: 1px solid #94a3b8;
    border-radius: 8px;
    background: #ffffff;
    touch-action: none;
}

.operario-mobile-layout .signed-pdf-frame {
    width: 100%;
    height: min(68dvh, 680px);
    border: 1px solid #c7d7e7;
    border-radius: 8px;
    background: #ffffff;
}

.operario-mobile-layout .trash-button {
    width: 40px;
    min-width: 40px;
    padding: 0;
    color: #991b1b;
}

.operario-mobile-layout .trash-icon::before {
    content: "X";
    font-weight: 700;
}

.operario-mobile-layout .albaran-mobile-ficha .line-editor {
    gap: 7px;
    margin-top: 8px;
    padding: 8px;
}

.operario-mobile-layout .albaran-mobile-ficha .form-grid {
    grid-template-columns: 1fr;
    gap: 10px;
}

.operario-mobile-layout .albaran-mobile-ficha .toolbar-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.operario-mobile-layout .albaran-mobile-ficha .toolbar-actions .primary-button:last-child:nth-child(4) {
    grid-column: auto;
}

.operario-mobile-layout .albaran-mobile-ficha .mobile-stacked-field {
    display: grid;
    grid-template-columns: 1fr;
    gap: 5px;
    align-items: stretch;
    width: 100%;
    font-size: 12px;
}

.operario-mobile-layout .albaran-mobile-ficha .mobile-stacked-field > .form-control,
.operario-mobile-layout .albaran-mobile-ficha .mobile-stacked-field > .article-picker {
    width: 100%;
    min-width: 0;
}

.operario-mobile-layout .albaran-mobile-ficha .line-header {
    min-height: 34px;
}

.operario-mobile-layout .albaran-mobile-ficha .line-header .secondary-button {
    min-height: 34px;
    padding: 5px 9px;
    font-size: 12px;
}

.operario-mobile-layout .albaran-mobile-ficha .line-row {
    gap: 6px;
    padding: 8px;
}

.operario-mobile-layout .albaran-mobile-ficha .line-field-label {
    font-size: 11px;
    line-height: 1.1;
    font-weight: 600;
}

.operario-mobile-layout .albaran-mobile-ficha .article-input-shell {
    grid-template-columns: minmax(0, 1fr) 36px;
    gap: 6px;
}

.operario-mobile-layout .albaran-mobile-ficha .article-delete-button {
    width: 36px;
    min-width: 36px;
    min-height: 34px;
}

.operario-mobile-layout .albaran-mobile-ficha .form-control {
    min-height: 34px;
    padding: 6px 9px;
    font-size: 15px;
}

.operario-mobile-layout .albaran-mobile-ficha .line-description {
    min-height: 52px;
    height: 52px;
    padding-top: 7px;
    padding-bottom: 7px;
    resize: vertical;
}

.operario-mobile-layout .albaran-mobile-ficha .line-amounts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
}

.operario-mobile-layout .albaran-mobile-ficha .line-tax-row {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr) minmax(0, 1fr);
    gap: 6px;
    align-items: stretch;
}

.operario-mobile-layout .albaran-mobile-ficha .line-readonly-amount {
    min-height: 34px;
    padding: 5px 7px;
    align-content: center;
}

.operario-mobile-layout .albaran-mobile-ficha .line-readonly-amount strong {
    font-size: 13px;
    line-height: 1.1;
}

.operario-mobile-layout .albaran-mobile-ficha .totals-bar {
    grid-template-columns: 1fr;
}

.operario-mobile-layout .albaran-mobile-ficha .line-row-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 7px;
}

.operario-mobile-layout .albaran-mobile-ficha .line-add-button {
    min-height: 32px;
    padding: 5px 8px;
    font-size: 12px;
}

.operario-mobile-layout .albaran-mobile-ficha .line-save-button {
    min-height: 32px;
    padding: 5px 8px;
    font-size: 12px;
}
.app-btn.app-btn-filter {
    background: linear-gradient(180deg, #f59e0b, #d97706);
    border-color: #b45309;
    color: #fff;
}

.internal-filter-strip {
    color: #334155;
    font-size: 12px;
}

.internal-licenses-grid .w-actions {
    width: 78px;
    min-width: 78px;
}

.internal-licenses-table-wrap {
    position: relative;
    padding-top: 12px;
    background: #fff;
}

.internal-licenses-table-wrap::before {
    content: "";
    position: sticky;
    top: 0;
    display: block;
    height: 12px;
    margin: -12px -14px 0;
    background: #fff;
    z-index: 25;
}

.internal-licenses-table-wrap .internal-licenses-grid thead th {
    top: 0 !important;
    z-index: 30;
    background: #eaf1f8 !important;
    background-clip: border-box;
    box-shadow: inset 0 1px 0 #cbd8e6, inset 0 -2px 0 #b5c8dc;
}

.blocked-license-row {
    background: #fff1f2;
}

.open-audit-row {
    background: #fff8db;
}

.muted-row {
    color: #64748b;
    background: #f8fafc;
}

.internal-license-card {
    min-height: calc(100vh - 116px);
}

.internal-license-layout {
    display: grid;
    gap: 10px;
    padding: 10px 14px 18px;
}

.internal-license-grid {
    display: grid;
    gap: 10px 14px;
    align-items: end;
}

.internal-license-grid.identity {
    grid-template-columns: minmax(160px, 220px) minmax(280px, 1fr) 140px 190px 120px;
}

.internal-license-grid.contact {
    grid-template-columns: minmax(320px, 1.6fr) 110px repeat(3, minmax(150px, 1fr));
}

.internal-license-grid.contact .wide {
    grid-column: span 2;
}

.internal-license-grid.contact .contact-person {
    grid-column: span 2;
}

.internal-license-grid.contact .contact-phone {
    grid-column: span 2;
}

.internal-license-grid.dgt {
    grid-template-columns: minmax(220px, 360px) minmax(220px, 360px);
}

.internal-license-grid.connection {
    grid-template-columns: minmax(280px, 420px) minmax(420px, 1fr);
}

.internal-license-grid.gestionatu-identity {
    grid-template-columns: minmax(150px, 210px) minmax(320px, 1.4fr) repeat(4, minmax(130px, 1fr));
}

.internal-license-grid.gestionatu-identity .wide {
    grid-column: span 2;
}

.internal-license-grid.gestionatu-contact {
    grid-template-columns: minmax(280px, 1.4fr) repeat(4, minmax(150px, 1fr));
}

.internal-license-grid.gestionatu-contact .wide {
    grid-column: span 2;
}

.internal-license-grid.gestionatu-contact .contact-person {
    grid-column: span 2;
}

.internal-license-grid.gestionatu-contact .contact-phone {
    grid-column: span 2;
}

.internal-license-grid.gestionatu-access {
    grid-template-columns: minmax(120px, 180px) minmax(170px, 240px) repeat(2, minmax(260px, 1fr));
}

.internal-license-grid.gestionatu-notes {
    grid-template-columns: repeat(2, minmax(280px, 1fr));
}

.internal-license-grid.gestionatu-notes textarea {
    min-height: 92px;
    resize: vertical;
}

.internal-license-grid.polmobile-log-form {
    grid-template-columns: minmax(180px, 260px) minmax(180px, 230px) 120px minmax(280px, 1fr);
}

.internal-license-grid.polmobile-log-form .wide {
    grid-column: span 1;
}

.internal-license-grid.polmobile-log-form .full {
    grid-column: 1 / -1;
}

.internal-license-grid.polmobile-log-form .polmobile-log-link span {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 76px;
    gap: 6px;
}

.internal-license-grid.polmobile-log-form .polmobile-log-link button {
    min-height: 25px;
    padding: 3px 10px;
}

.internal-license-grid.polmobile-log-form textarea {
    font-size: 15px;
    line-height: 1.45;
    min-height: 170px;
    resize: vertical;
}

.internal-license-grid.gestionatu-instant-form {
    grid-template-columns: minmax(180px, 240px) minmax(360px, 0.9fr) minmax(360px, 1.2fr) 150px;
}

.internal-license-grid.gestionatu-instant-form .instant-client {
    grid-column: span 1;
}

.internal-license-grid.gestionatu-instant-form .instant-activity {
    min-width: 360px;
}

.internal-license-grid.gestionatu-instant-form .full {
    grid-column: 1 / -1;
}

.internal-license-grid.gestionatu-instant-form textarea {
    font-size: 15px;
    line-height: 1.45;
    min-height: 190px;
    resize: vertical;
}

.instant-message-backdrop {
    position: fixed;
    inset: 0;
    z-index: 5000;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(15, 23, 42, 0.34);
}

.instant-message-dialog {
    width: min(620px, 100%);
    border: 1px solid #9fb7d3;
    border-radius: 4px;
    background: #f8fbff;
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.28);
    color: #001f3f;
}

.instant-message-dialog header {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    padding: 16px 18px 12px;
    border-bottom: 1px solid #c7d8ea;
    background: #edf5ff;
}

.instant-message-dialog header span {
    display: block;
    margin-bottom: 4px;
    color: #475569;
    font-size: 12px;
}

.instant-message-dialog h2 {
    margin: 0;
    font-size: 24px;
}

.instant-message-dialog header strong {
    align-self: start;
    border: 1px solid #b45309;
    border-radius: 4px;
    padding: 4px 8px;
    background: #ffd84d;
    color: #7c2d12;
}

.instant-message-dialog p {
    margin: 0;
    padding: 18px;
    white-space: pre-wrap;
    font-size: 16px;
    line-height: 1.45;
}

.instant-message-dialog footer {
    display: flex;
    justify-content: flex-end;
    padding: 12px 18px 16px;
}

.instant-message-dialog.important {
    border-color: #d97706;
    box-shadow: 0 18px 44px rgba(180, 83, 9, 0.28);
}

.internal-license-grid label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12px;
    color: #001f3f;
}

.internal-license-grid .check-label {
    flex-direction: row;
    align-items: center;
    gap: 8px;
    min-height: 24px;
}

.internal-license-grid input,
.internal-license-grid select,
.internal-license-grid textarea {
    width: 100%;
}

.internal-secret-wrap {
    position: relative;
    display: block;
}

.internal-secret-wrap input {
    padding-right: 36px;
}

.internal-secret-eye {
    position: absolute;
    top: 1px;
    right: 1px;
    width: 32px;
    height: calc(100% - 2px);
    display: grid;
    place-items: center;
    border: 0;
    border-left: 1px solid #b9c7d6;
    border-radius: 0 3px 3px 0;
    background: #eef2f7;
    color: #1f3d57;
    cursor: pointer;
}

.internal-secret-eye:hover,
.internal-secret-eye:focus-visible {
    background: #dbe8f5;
}

.internal-secret-eye svg {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

@media (max-width: 1200px) {
    .internal-license-grid.identity,
    .internal-license-grid.contact,
    .internal-license-grid.dgt,
    .internal-license-grid.connection,
    .internal-license-grid.gestionatu-identity,
    .internal-license-grid.gestionatu-contact,
    .internal-license-grid.gestionatu-access,
    .internal-license-grid.gestionatu-notes,
    .internal-license-grid.polmobile-log-form,
    .internal-license-grid.gestionatu-instant-form {
        grid-template-columns: repeat(2, minmax(180px, 1fr));
    }
}

@media (max-width: 760px) {
    .internal-license-grid.identity,
    .internal-license-grid.contact,
    .internal-license-grid.dgt,
    .internal-license-grid.connection,
    .internal-license-grid.gestionatu-identity,
    .internal-license-grid.gestionatu-contact,
    .internal-license-grid.gestionatu-access,
    .internal-license-grid.gestionatu-notes,
    .internal-license-grid.polmobile-log-form,
    .internal-license-grid.gestionatu-instant-form {
        grid-template-columns: 1fr;
    }

    .internal-license-grid.contact .wide,
    .internal-license-grid.gestionatu-identity .wide,
    .internal-license-grid.gestionatu-contact .wide,
    .internal-license-grid.gestionatu-contact .contact-person,
    .internal-license-grid.gestionatu-contact .contact-phone,
    .internal-license-grid.polmobile-log-form .full,
    .internal-license-grid.gestionatu-instant-form .wide,
    .internal-license-grid.gestionatu-instant-form .full {
        grid-column: auto;
    }
}

/* Normalizacion global de botones: colores suaves, texto legible y ubicacion estable. */
:root {
    --btn-pastel-new: #93d4f5;
    --btn-pastel-save: #91e7a8;
    --btn-pastel-help: #9dbaff;
    --btn-pastel-close: #ff5a60;
    --btn-pastel-search: #ffd06d;
    --btn-pastel-grid: #bbb3f0;
    --btn-pastel-list: #ffb87f;
    --btn-pastel-docs: #ff9eb8;
    --btn-pastel-info: #9dddf3;
    --btn-pastel-special: #cbd8e8;
    --btn-border-new: #4b9fd4;
    --btn-border-save: #42be62;
    --btn-border-help: #5f86e6;
    --btn-border-close: #c8141d;
    --btn-border-search: #e4a936;
    --btn-border-grid: #8b7fe0;
    --btn-border-list: #e9873d;
    --btn-border-docs: #de5d7d;
    --btn-border-info: #51b7d7;
    --btn-border-special: #8fa5bd;
}

.app-btn,
.desktop-list-actions button:not(.app-btn),
.toolbar.compact button:not(.app-btn) {
    border-radius: 8px !important;
    color: #111827 !important;
    font-weight: 400 !important;
    text-shadow: none !important;
    box-shadow: none !important;
    letter-spacing: 0 !important;
}

.app-btn:hover:not(:disabled),
.app-btn:focus-visible:not(:disabled),
.desktop-list-actions button:not(.app-btn):hover,
.toolbar.compact button:not(.app-btn):hover {
    filter: brightness(0.98) saturate(1.05);
    box-shadow: 0 0 0 2px rgba(17, 24, 39, 0.06) !important;
}

.app-btn-new {
    background: var(--btn-pastel-new) !important;
    border-color: var(--btn-border-new) !important;
}

.app-btn-save,
.app-btn-stat,
.app-btn.app-btn-green {
    background: var(--btn-pastel-save) !important;
    border-color: var(--btn-border-save) !important;
}

.app-btn-help {
    background: var(--btn-pastel-help) !important;
    border-color: var(--btn-border-help) !important;
}

.app-btn-close,
.app-btn-delete,
.app-btn-danger {
    background: var(--btn-pastel-close) !important;
    border-color: var(--btn-border-close) !important;
}

.app-btn-search,
.app-btn-filter,
.app-btn-destroy-filters,
.app-btn.app-btn-yellow {
    background: var(--btn-pastel-search) !important;
    border-color: var(--btn-border-search) !important;
}

.client-grid-config-button,
.app-btn-purple {
    background: var(--btn-pastel-grid) !important;
    border-color: var(--btn-border-grid) !important;
}

.app-btn-list,
.app-btn-orange,
.client-btn-print {
    background: var(--btn-pastel-list) !important;
    border-color: var(--btn-border-list) !important;
}

.app-btn-documents,
.app-btn-acrobat {
    background: var(--btn-pastel-docs) !important;
    border-color: var(--btn-border-docs) !important;
}

.app-btn-info,
.factura-btn-email,
.factura-btn-ticket,
.factura-btn-aeat,
.factura-btn-cobro,
.client-btn-plantillas,
.client-btn-seguimiento,
.client-btn-actividad,
.client-btn-ventas,
.client-btn-beneficios,
.factura-btn-aviso,
.mostrador-btn-teal,
.mostrador-btn-yellow {
    background: var(--btn-pastel-special) !important;
    border-color: var(--btn-border-special) !important;
    color: #111827 !important;
}

.app-btn:disabled {
    color: #4b5563 !important;
}

/* Productividad de trabajadores */
.productivity-window {
    height: calc(100vh - 92px);
    min-height: 560px;
    display: grid;
    grid-template-rows: auto auto minmax(250px, 1fr) auto;
    overflow: hidden;
}

.productivity-header .title-with-icon {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 320px;
}

.productivity-header .title-with-icon img {
    width: 44px;
    height: 44px;
    object-fit: contain;
}

.productivity-header .title-with-icon h1 {
    margin: 0;
}

.productivity-filters {
    display: flex;
    align-items: end;
    gap: 12px;
    padding: 10px 16px;
    border-bottom: 1px solid #bfd0e4;
    background: #f3f7fb;
}

.productivity-filters label {
    display: grid;
    gap: 4px;
    color: #10233f;
    font-size: 13px;
    font-weight: 700;
}

.productivity-filters input,
.productivity-filters select {
    height: 31px;
    min-width: 112px;
    padding: 3px 8px;
    border: 1px solid #9eb3cb;
    background: #fff;
    color: #111827;
}

.productivity-view-filter select {
    min-width: 190px;
}

.productivity-employee-filter input {
    width: 260px;
}

.productivity-filter-summary {
    margin-left: auto;
    display: grid;
    justify-items: end;
    gap: 2px;
    color: #475569;
    white-space: nowrap;
}

.productivity-filter-summary strong {
    color: #10233f;
}

.productivity-grid-wrap {
    min-height: 0;
    overflow: auto;
}

.productivity-grid {
    min-width: 1510px;
    table-layout: fixed;
}

.productivity-grid th,
.productivity-grid td {
    height: 36px;
    padding: 5px 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.productivity-grid th:first-child,
.productivity-grid td:first-child {
    position: sticky;
    left: 0;
    z-index: 2;
    width: 250px;
    min-width: 250px;
    text-align: left;
    background: #fff;
}

.productivity-grid thead th:first-child {
    z-index: 4;
    background: #dfe9f4;
}

.productivity-grid th:not(:first-child),
.productivity-grid td:not(:first-child) {
    width: 90px;
}

.productivity-grid th:not(:first-child) {
    cursor: pointer;
    text-align: center;
}

.productivity-grid .number-cell {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.productivity-grid tbody tr:not(.productivity-total-row) {
    cursor: pointer;
}

.productivity-grid tbody tr:hover td,
.productivity-grid tbody tr:hover td:first-child {
    background: #e8f2fc;
}

.productivity-grid .selected td,
.productivity-grid .selected td:first-child {
    background: #d5e8fa;
}

.productivity-grid .selected-column {
    background: #e3f2ec;
}

.productivity-grid thead .selected-column {
    background: #b9dfcf;
}

.productivity-grid .total-cell,
.productivity-total-row td,
.productivity-total-row td:first-child {
    font-weight: 700;
    background: #e7f1ed;
}

.productivity-empty {
    height: 120px !important;
    color: #64748b;
    text-align: center !important;
}

.productivity-chart-panel {
    min-height: 250px;
    padding: 10px 16px 14px;
    border-top: 1px solid #bfd0e4;
    background: #fff;
}

.productivity-chart-panel > header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 6px;
    color: #10233f;
}

.productivity-chart-panel > header span {
    color: #64748b;
}

.productivity-chart-scroll {
    overflow-x: auto;
    overflow-y: hidden;
}

.productivity-chart {
    display: block;
    width: 100%;
    height: 330px;
}

.productivity-chart .axis {
    stroke: #7b8da3;
    stroke-width: 1;
}

.productivity-chart .positive {
    fill: #0f8a70;
}

.productivity-chart .negative {
    fill: #dc2626;
}

.productivity-chart text {
    fill: #10233f;
    font-size: 11px;
    letter-spacing: 0;
    text-anchor: middle;
}

.productivity-chart .value-label {
    font-weight: 700;
}

/* Ficha de origen de facturacion */
.origen-ficha-header:has(> .aux-button-host) {
    grid-template-columns: minmax(370px, 430px) minmax(0, 1fr);
}

.origen-ficha-header > .title-with-icon {
    gap: 14px;
    min-width: 0;
}

.origen-ficha-header > .title-with-icon h1 {
    margin: 0;
    color: #071733;
    font-size: 2rem;
    line-height: 1;
    letter-spacing: 0;
    white-space: nowrap;
}

.origen-form-grid {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 14px 18px;
    padding: 20px 26px;
    align-items: end;
}

.origen-form-grid label {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-content: end;
    gap: 5px;
    min-width: 0;
    color: #17243a;
    font-size: 13px;
}

.origen-form-grid input,
.origen-form-grid select {
    width: 100%;
    min-width: 0;
    height: 31px;
}

.origen-form-grid .origin-code { grid-column: span 2; }
.origen-form-grid .origin-description { grid-column: span 4; }
.origen-form-grid .origin-client { grid-column: span 4; }
.origen-form-grid .origin-finished {
    grid-column: span 2;
    display: flex;
    align-items: center;
    align-self: end;
    gap: 8px;
    height: 31px;
    padding-left: 6px;
    white-space: nowrap;
}

.origen-form-grid .origin-finished input {
    width: 22px;
    height: 22px;
    min-height: 22px;
    margin: 0;
}

.origen-form-grid .origin-start,
.origen-form-grid .origin-end,
.origen-form-grid .origin-hours-estimated,
.origen-form-grid .origin-hours-worked,
.origen-form-grid .origin-hours-difference,
.origen-form-grid .origin-pvp-items,
.origen-form-grid .origin-pvp-hours,
.origen-form-grid .origin-profit {
    grid-column: span 2;
}

.origen-form-grid .origin-pvp-items {
    grid-column: 1 / span 2;
}

.origen-form-grid .origin-notes {
    grid-column: 1 / -1;
}

.origen-form-grid .origin-notes textarea {
    width: 100%;
    min-height: 82px;
    resize: vertical;
}

@media (max-width: 1100px) {
    .origen-ficha-header:has(> .aux-button-host) {
        grid-template-columns: minmax(300px, 340px) minmax(0, 1fr);
    }

    .origen-ficha-header > .title-with-icon h1 {
        font-size: 1.65rem;
    }

    .origen-form-grid {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }

    .origen-form-grid .origin-description,
    .origen-form-grid .origin-client {
        grid-column: span 3;
    }

    .origen-form-grid .origin-finished {
        grid-column: span 2;
    }
}

@media (max-width: 900px) {
    .productivity-window {
        height: auto;
        min-height: calc(100vh - 70px);
        grid-template-rows: auto auto minmax(360px, 1fr) auto;
    }

    .productivity-filters {
        flex-wrap: wrap;
    }

    .productivity-filter-summary {
        width: 100%;
        margin-left: 0;
        justify-items: start;
    }
}

.user-filter-catalog {
    width: min(850px, calc(100vw - 36px));
    max-height: min(720px, calc(100vh - 36px));
    overflow: auto;
}

.user-filter-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 14px;
    border-bottom: 1px solid #bdcadd;
}

.user-filter-header h3 { margin: 0; }
.user-filter-header > div,
.user-filter-actions { display: flex; align-items: center; gap: 8px; }
.user-filter-catalog .table-wrap { padding: 12px 14px; }
.user-filter-empty { padding: 8px 14px 18px; color: #52647a; }
.user-filter-editor { width: min(940px, calc(100vw - 36px)); }
.user-filter-name {
    display: grid;
    grid-template-columns: 150px minmax(240px, 1fr);
    align-items: center;
    gap: 10px;
    padding: 4px 26px 14px;
    font-weight: 700;
}
.user-filter-name input { height: 32px; border: 1px solid #9eb2cc; padding: 4px 8px; }

.factura-actions .factura-btn-emitir {
    background: #ffd400 !important;
    border-color: #d99c00 !important;
    color: #111827 !important;
}

.factura-actions .factura-btn-emitir:hover:not(:disabled),
.factura-actions .factura-btn-emitir:focus-visible:not(:disabled) {
    background: #ffbf00 !important;
}

.app-btn-help,
.row-icon-button,
.mini-action,
.internal-secret-eye,
.geo-map-button {
    border-radius: 6px !important;
}

.desktop-card-header .desktop-list-actions,
.desktop-card-header .factura-actions,
.client-card-header .client-header-actions,
.article-service-header .article-service-actions,
.proveedor-titlebar .toolbar,
.oferta-ficha .toolbar,
.pago-rec-titlebar .toolbar.compact,
.treat-mobile-ficha-panel .factura-actions {
    justify-content: flex-end !important;
    align-items: center !important;
    gap: 7px !important;
}

.desktop-card-header .desktop-list-actions > *,
.desktop-card-header .factura-actions > *,
.client-card-header .client-header-actions > *,
.article-service-header .article-service-actions > *,
.proveedor-titlebar .toolbar > *,
.oferta-ficha .toolbar > *,
.pago-rec-titlebar .toolbar.compact > *,
.treat-mobile-ficha-panel .factura-actions > * {
    order: 10;
}

.desktop-card-header .app-btn-new,
.desktop-card-header .desktop-list-actions > .app-btn-new,
.desktop-card-header .factura-actions > .app-btn-new,
.client-card-header .client-header-actions > .app-btn-new,
.article-service-header .article-service-actions > .app-btn-new,
.proveedor-titlebar .toolbar > .app-btn-new,
.oferta-ficha .toolbar > .app-btn-new,
.pago-rec-titlebar .toolbar.compact > .app-btn-new,
.treat-mobile-ficha-panel .factura-actions > .app-btn-new {
    order: 50;
}

.desktop-card-header .app-btn-save,
.desktop-card-header .desktop-list-actions > .app-btn-save,
.desktop-card-header .factura-actions > .app-btn-save,
.client-card-header .client-header-actions > .app-btn-save,
.article-service-header .article-service-actions > .app-btn-save,
.proveedor-titlebar .toolbar > .app-btn-save,
.oferta-ficha .toolbar > .app-btn-save,
.pago-rec-titlebar .toolbar.compact > .app-btn-save,
.treat-mobile-ficha-panel .factura-actions > .app-btn-save {
    order: 51;
}

.desktop-card-header .app-btn-help,
.desktop-card-header .desktop-list-actions > .app-btn-help,
.desktop-card-header .factura-actions > .app-btn-help,
.client-card-header .client-header-actions > .app-btn-help,
.article-service-header .article-service-actions > .app-btn-help,
.proveedor-titlebar .toolbar > .app-btn-help,
.oferta-ficha .toolbar > .app-btn-help,
.pago-rec-titlebar .toolbar.compact > .app-btn-help,
.treat-mobile-ficha-panel .factura-actions > .app-btn-help {
    order: 52;
}

.desktop-card-header .app-btn-close,
.desktop-card-header .desktop-list-actions > .app-btn-close,
.desktop-card-header .factura-actions > .app-btn-close,
.client-card-header .client-header-actions > .app-btn-close,
.article-service-header .article-service-actions > .app-btn-close,
.proveedor-titlebar .toolbar > .app-btn-close,
.oferta-ficha .toolbar > .app-btn-close,
.pago-rec-titlebar .toolbar.compact > .app-btn-close,
.treat-mobile-ficha-panel .factura-actions > .app-btn-close {
    order: 53;
}

.desktop-card-header .client-grid-config-button,
.desktop-card-header .desktop-list-actions > .client-grid-config-button,
.desktop-card-header .factura-actions > .client-grid-config-button,
.client-card-header .client-header-actions > .client-grid-config-button,
.article-service-header .article-service-actions > .client-grid-config-button,
.proveedor-titlebar .toolbar > .client-grid-config-button,
.oferta-ficha .toolbar > .client-grid-config-button,
.pago-rec-titlebar .toolbar.compact > .client-grid-config-button,
.treat-mobile-ficha-panel .factura-actions > .client-grid-config-button {
    order: 30;
    margin-left: 16px;
}

.desktop-card-header .app-btn-list,
.desktop-card-header .app-btn-orange,
.desktop-card-header .desktop-list-actions > .app-btn-list,
.desktop-card-header .desktop-list-actions > .app-btn-orange,
.desktop-card-header .factura-actions > .app-btn-list,
.desktop-card-header .factura-actions > .app-btn-orange,
.client-card-header .client-header-actions > .app-btn-list,
.client-card-header .client-header-actions > .app-btn-orange,
.article-service-header .article-service-actions > .app-btn-list,
.article-service-header .article-service-actions > .app-btn-orange,
.proveedor-titlebar .toolbar > .app-btn-list,
.proveedor-titlebar .toolbar > .app-btn-orange,
.oferta-ficha .toolbar > .app-btn-list,
.oferta-ficha .toolbar > .app-btn-orange,
.pago-rec-titlebar .toolbar.compact > .app-btn-list,
.pago-rec-titlebar .toolbar.compact > .app-btn-orange,
.treat-mobile-ficha-panel .factura-actions > .app-btn-list,
.treat-mobile-ficha-panel .factura-actions > .app-btn-orange {
    order: 31;
}

.desktop-card-header .client-btn-print,
.desktop-card-header .desktop-list-actions > .client-btn-print,
.desktop-card-header .factura-actions > .client-btn-print,
.client-card-header .client-header-actions > .client-btn-print,
.article-service-header .article-service-actions > .client-btn-print,
.proveedor-titlebar .toolbar > .client-btn-print,
.oferta-ficha .toolbar > .client-btn-print,
.pago-rec-titlebar .toolbar.compact > .client-btn-print,
.treat-mobile-ficha-panel .factura-actions > .client-btn-print {
    order: 32;
}

.desktop-card-header .app-btn-acrobat,
.desktop-card-header .desktop-list-actions > .app-btn-acrobat,
.desktop-card-header .factura-actions > .app-btn-acrobat,
.client-card-header .client-header-actions > .app-btn-acrobat,
.article-service-header .article-service-actions > .app-btn-acrobat,
.proveedor-titlebar .toolbar > .app-btn-acrobat,
.oferta-ficha .toolbar > .app-btn-acrobat,
.pago-rec-titlebar .toolbar.compact > .app-btn-acrobat,
.treat-mobile-ficha-panel .factura-actions > .app-btn-acrobat {
    order: 20;
    margin-left: 16px;
}

.desktop-card-header .desktop-list-actions > :not(.app-btn-new):not(.app-btn-save):not(.app-btn-help):not(.app-btn-close):not(.client-grid-config-button):not(.client-btn-print):not(.app-btn-acrobat):first-child,
.desktop-card-header .factura-actions > :not(.app-btn-new):not(.app-btn-save):not(.app-btn-help):not(.app-btn-close):not(.client-grid-config-button):not(.client-btn-print):not(.app-btn-acrobat):first-child,
.client-card-header .client-header-actions > :not(.app-btn-new):not(.app-btn-save):not(.app-btn-help):not(.app-btn-close):not(.client-grid-config-button):not(.client-btn-print):not(.app-btn-acrobat):first-child,
.article-service-header .article-service-actions > :not(.app-btn-new):not(.app-btn-save):not(.app-btn-help):not(.app-btn-close):not(.client-grid-config-button):not(.client-btn-print):not(.app-btn-acrobat):first-child {
    margin-left: 0;
}

.desktop-card-header .desktop-list-actions:has(.app-btn-new) > .app-btn-new,
.desktop-card-header .factura-actions:has(.app-btn-new) > .app-btn-new,
.client-card-header .client-header-actions:has(.app-btn-new) > .app-btn-new,
.article-service-header .article-service-actions:has(.app-btn-new) > .app-btn-new,
.proveedor-titlebar .toolbar:has(.app-btn-new) > .app-btn-new,
.oferta-ficha .toolbar:has(.app-btn-new) > .app-btn-new,
.pago-rec-titlebar .toolbar.compact:has(.app-btn-new) > .app-btn-new,
.treat-mobile-ficha-panel .factura-actions:has(.app-btn-new) > .app-btn-new {
    margin-left: 18px;
}

.desktop-card-header .desktop-list-actions:has(.app-btn-acrobat) > .app-btn-acrobat,
.desktop-card-header .factura-actions:has(.app-btn-acrobat) > .app-btn-acrobat,
.client-card-header .client-header-actions:has(.app-btn-acrobat) > .app-btn-acrobat,
.article-service-header .article-service-actions:has(.app-btn-acrobat) > .app-btn-acrobat,
.proveedor-titlebar .toolbar:has(.app-btn-acrobat) > .app-btn-acrobat,
.oferta-ficha .toolbar:has(.app-btn-acrobat) > .app-btn-acrobat,
.pago-rec-titlebar .toolbar.compact:has(.app-btn-acrobat) > .app-btn-acrobat,
.treat-mobile-ficha-panel .factura-actions:has(.app-btn-acrobat) > .app-btn-acrobat {
    margin-left: 18px;
}

.desktop-card-header .desktop-list-actions:has(.client-grid-config-button) > .client-grid-config-button,
.desktop-card-header .factura-actions:has(.client-grid-config-button) > .client-grid-config-button,
.client-card-header .client-header-actions:has(.client-grid-config-button) > .client-grid-config-button,
.article-service-header .article-service-actions:has(.client-grid-config-button) > .client-grid-config-button,
.proveedor-titlebar .toolbar:has(.client-grid-config-button) > .client-grid-config-button,
.oferta-ficha .toolbar:has(.client-grid-config-button) > .client-grid-config-button,
.pago-rec-titlebar .toolbar.compact:has(.client-grid-config-button) > .client-grid-config-button,
.treat-mobile-ficha-panel .factura-actions:has(.client-grid-config-button) > .client-grid-config-button {
    margin-left: 18px;
}

.cloud-backup-page {
    min-height: calc(100vh - 96px);
}

.cloud-backup-summary,
.cloud-backup-counters {
    display: grid;
    grid-template-columns: repeat(4, minmax(160px, 1fr));
    gap: 10px;
    margin: 12px 18px;
}

.cloud-backup-summary article,
.cloud-backup-counters article,
.cloud-backup-result {
    border: 1px solid #b9cce2;
    border-radius: 8px;
    background: #f7fbff;
    padding: 12px 14px;
}

.cloud-backup-summary span,
.cloud-backup-counters span,
.cloud-backup-result span {
    display: block;
    color: #36536f;
    font-size: 12px;
}

.cloud-backup-summary strong,
.cloud-backup-counters strong,
.cloud-backup-result strong {
    display: block;
    margin-top: 4px;
    color: #001f3f;
    font-size: 20px;
}

.cloud-backup-result {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
    margin: 12px 18px;
}

.cloud-backup-result strong {
    margin: 0;
    font-size: 16px;
}

.cloud-backup-list {
    margin: 12px 18px 24px;
    max-height: 460px;
    overflow: auto;
    border: 1px solid #c8d7e8;
}

.cloud-backup-list .data-grid {
    width: 100%;
}

.cloud-backup-log-wrap {
    margin: 12px 18px 24px;
    max-height: calc(100vh - 260px);
    overflow: auto;
    border: 1px solid #c8d7e8;
}

.cloud-backup-log-grid {
    min-width: 1280px;
}

.cloud-backup-config-dialog {
    width: min(920px, calc(100vw - 42px));
    max-width: none;
}

.cloud-backup-config-grid {
    grid-template-columns: repeat(3, minmax(180px, 1fr));
    gap: 14px 18px;
}

.cloud-backup-config-grid label {
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    gap: 5px;
    min-width: 0;
}

.cloud-backup-config-grid .dynamic-check {
    grid-template-columns: minmax(0, 1fr) auto !important;
    align-items: center;
    align-self: end;
    min-height: 53px;
}

.cloud-backup-config-grid input,
.cloud-backup-config-grid select {
    width: 100%;
    min-width: 0;
}

.cloud-backup-config-grid .dynamic-check input {
    width: 18px;
    min-width: 18px;
}

@media (max-width: 760px) {
    .cloud-backup-config-grid {
        grid-template-columns: repeat(2, minmax(180px, 1fr));
    }
}

@media (max-width: 520px) {
    .cloud-backup-config-dialog {
        width: min(100%, calc(100vw - 24px));
    }

    .cloud-backup-config-grid {
        grid-template-columns: minmax(0, 1fr);
        padding: 16px;
    }
}

/* Reservas embebidas en comandero: formato tactil en bloques. */
.comandero-reservas-layer {
    overflow: hidden;
}

.comandero-reservas-layer .reservations-panel {
    height: 100%;
    min-height: 0;
    display: grid;
    grid-template-rows: auto auto auto minmax(0, 1fr);
    overflow: hidden;
}

.comandero-reservas-layer .reservations-header {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    padding: 10px 8px 8px;
}

.comandero-reservas-layer .reservations-header h1 {
    font-size: 26px;
    line-height: 1.05;
}

.comandero-reservas-layer .reservations-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    justify-content: stretch;
    width: 100%;
}

.comandero-reservas-layer .reservations-actions .app-btn {
    width: 100%;
    min-width: 0;
    min-height: 36px;
    padding: 6px 5px;
    font-size: 12px;
    white-space: normal;
}

.comandero-reservas-layer .reservations-filters {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 8px;
    align-items: end;
    padding: 8px;
    overflow: hidden;
}

.comandero-reservas-layer .reservations-filters label {
    min-width: 0;
}

.comandero-reservas-layer .reservations-filters label:first-child,
.comandero-reservas-layer .reservations-search-filter {
    grid-column: 1 / -1;
    margin-left: 0;
}

.comandero-reservas-layer .reservations-filters input,
.comandero-reservas-layer .reservations-filters select {
    width: 100% !important;
    min-width: 0;
    box-sizing: border-box;
}

.comandero-reservas-layer .reservations-tables-panel {
    padding: 8px;
    overflow: hidden;
}

.comandero-reservas-layer .reservations-tables-title {
    gap: 10px;
}

.comandero-reservas-layer .reservations-tables-list {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    min-height: 0;
    max-height: 126px;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 8px;
    touch-action: pan-x;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
    cursor: grab;
}

.comandero-reservas-layer .reservations-tables-list.drag-scrolling {
    cursor: grabbing;
}

.comandero-reservas-layer .reservation-table-card {
    flex: 0 0 104px;
    width: 104px;
    height: 106px;
    scroll-snap-align: start;
}

.comandero-reservas-layer .reservation-table-card img {
    max-height: 42px;
}

.comandero-reservas-layer .reservations-grid-section {
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 8px;
    -webkit-overflow-scrolling: touch;
}

.comandero-reservas-layer .reservations-grid {
    width: 100% !important;
    min-width: 0 !important;
    table-layout: auto !important;
    border-collapse: separate !important;
    border-spacing: 0 9px !important;
}

.comandero-reservas-layer .reservations-grid thead {
    display: none !important;
}

.comandero-reservas-layer .reservations-grid tbody,
.comandero-reservas-layer .reservations-grid tr,
.comandero-reservas-layer .reservations-grid td {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box;
}

.comandero-reservas-layer .reservations-grid tr {
    padding: 8px;
    border: 1px solid #bfd0e2;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 1px 3px rgba(22, 43, 68, 0.08);
}

.comandero-reservas-layer .reservations-grid td {
    border: 0 !important;
    padding: 5px 0 !important;
    text-align: left !important;
    background: transparent !important;
}

.comandero-reservas-layer .reservations-grid td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 3px;
    color: #001f3f;
    font-size: 12px;
    font-weight: 700;
}

.comandero-reservas-layer .reservations-grid td.reservation-row-actions::before {
    display: none;
}

.comandero-reservas-layer .reservation-row-actions {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 8px;
    white-space: normal;
}

.comandero-reservas-layer .reservation-row-button {
    width: 100%;
    min-height: 38px;
}

.comandero-reservas-layer .reservations-grid input,
.comandero-reservas-layer .reservations-grid select {
    height: 38px;
    font-size: 15px;
}

.comandero-reservas-layer .reservations-grid textarea {
    min-height: 76px;
    font-size: 15px;
}
.user-reports-panel {
    min-height: calc(100vh - 94px);
}

.user-reports-grid th:first-child,
.user-reports-grid td:first-child {
    width: 150px;
}

.user-report-editor {
    width: min(1500px, calc(100vw - 34px));
    height: min(850px, calc(100vh - 30px));
    max-width: none;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.user-report-settings {
    display: grid;
    grid-template-columns: minmax(170px, 1.3fr) minmax(200px, 1.6fr) 82px 110px minmax(125px, 1fr) minmax(125px, 1fr) 110px 140px 80px;
    gap: 10px;
    padding: 12px 14px;
    border-bottom: 1px solid #bdcadd;
}

.user-report-settings label {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.user-report-settings label > span {
    font-size: 12px;
    font-weight: 700;
}

.user-report-settings input,
.user-report-settings select,
.user-report-column input {
    min-width: 0;
    height: 30px;
    border: 1px solid #9eb2cc;
    background: #fff;
    padding: 3px 7px;
}

.user-report-options {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 8px 14px;
    background: #eef3f9;
    border-bottom: 1px solid #bdcadd;
}

.user-report-options label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.user-report-columns {
    flex: 1;
    min-height: 0;
    overflow: auto;
    padding: 0 14px 12px;
}

.user-report-columns-heading,
.user-report-column {
    display: grid;
    grid-template-columns: 28px minmax(190px, 1.2fr) minmax(190px, 1.2fr) 70px 75px 90px 90px;
    gap: 8px;
    align-items: center;
}

.user-report-columns-heading {
    position: sticky;
    top: 0;
    z-index: 2;
    padding: 8px 7px;
    background: #dce6f2;
    border-bottom: 1px solid #aebfd3;
    font-size: 12px;
    font-weight: 700;
}

.user-report-column {
    min-height: 39px;
    padding: 4px 7px;
    border-bottom: 1px solid #d4deea;
    background: #fff;
}

.user-report-column:nth-child(odd) {
    background: #f7f9fc;
}

.user-report-column input[type="checkbox"] {
    width: 17px;
    height: 17px;
}

.user-report-column .desktop-grid-config-drag-handle {
    cursor: grab;
    color: #566f91;
    font-weight: 700;
}

@media (max-width: 1000px) {
    .user-report-settings {
        grid-template-columns: repeat(2, minmax(180px, 1fr));
    }
}

/* Ayuda común: icono sin contenedor coloreado. */
button.app-btn-help,
button.win-btn.help,
button.header-help-button,
button.desktop-filter-help,
button.tpv-help {
    width: 36px !important;
    min-width: 36px !important;
    height: 36px !important;
    min-height: 36px !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background-color: transparent !important;
    background-image: url('/icons/AYUDA_48.png') !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
    background-size: 32px 32px !important;
    box-shadow: none !important;
    color: transparent !important;
    font-size: 0 !important;
    cursor: pointer;
}

button.app-btn-help:hover,
button.app-btn-help:focus-visible,
button.win-btn.help:hover,
button.win-btn.help:focus-visible,
button.header-help-button:hover,
button.header-help-button:focus-visible,
button.desktop-filter-help:hover,
button.desktop-filter-help:focus-visible,
button.tpv-help:hover,
button.tpv-help:focus-visible {
    background-color: transparent !important;
    opacity: .82;
    outline: 2px solid #2f6eb5;
    outline-offset: 2px;
}

.user-report-dialog-tools {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Contraste común: los botones sólidos usan texto blanco; los fondos claros lo sobrescriben. */
.app-btn,
.app-btn:hover:not(:disabled),
.app-btn:focus-visible:not(:disabled) {
    color: #fff !important;
}

.app-btn-new,
.app-btn-save,
.app-btn-stat,
.app-btn.app-btn-green,
.app-btn-search,
.app-btn-filter,
.app-btn-destroy-filters,
.app-btn.app-btn-yellow,
.client-grid-config-button,
.app-btn-purple,
.app-btn-list,
.app-btn-orange,
.client-btn-print,
.app-btn-documents,
.app-btn-info,
.factura-btn-email,
.factura-btn-ticket,
.factura-btn-aeat,
.factura-btn-cobro,
.client-btn-plantillas,
.client-btn-seguimiento,
.client-btn-actividad,
.client-btn-ventas,
.client-btn-beneficios,
.factura-btn-aviso,
.mostrador-btn-teal,
.mostrador-btn-yellow,
.factura-actions .factura-btn-emitir,
.app-btn-new:hover:not(:disabled),
.app-btn-new:focus-visible:not(:disabled),
.app-btn-save:hover:not(:disabled),
.app-btn-save:focus-visible:not(:disabled),
.app-btn-stat:hover:not(:disabled),
.app-btn-stat:focus-visible:not(:disabled),
.app-btn-purple:hover:not(:disabled),
.app-btn-purple:focus-visible:not(:disabled) {
    color: #111827 !important;
}

.app-btn:disabled {
    color: #4b5563 !important;
}
