:root {
    --bg: #f5f7fa;
    --panel: #ffffff;
    --panel-soft: #f9fafb;
    --text: #1f2933;
    --muted: #64748b;
    --line: #d9e0e8;
    --brand: #164e63;
    --brand-dark: #0f3442;
    --accent: #f5c542;
    --success: #16794c;
    --warning: #9a6700;
    --danger: #b42318;
    --info: #1d4ed8;
    --neutral: #475569;
    font-family: Arial, Helvetica, sans-serif;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-size: 15px;
}

a {
    color: inherit;
}

.admin-shell {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 308px;
    min-width: 308px;
    flex: 0 0 308px;
    background: var(--brand-dark);
    color: #ffffff;
    display: flex;
    flex-direction: column;
    padding: 24px 18px;
    max-height: 100vh;
    overflow-y: auto;
    position: sticky;
    top: 0;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 8px;
    background: var(--accent);
    color: #1f2933;
    display: grid;
    place-items: center;
    font-weight: 700;
}

.brand strong,
.brand small {
    display: block;
}

.brand small {
    color: #cbd5e1;
    margin-top: 3px;
}

.sidebar-nav {
    display: grid;
    gap: 8px;
    margin-top: 24px;
}

.nav-group {
    display: grid;
    gap: 0;
}

.nav-group summary {
    align-items: center;
    border-radius: 8px;
    color: #dbe8ef;
    cursor: pointer;
    display: flex;
    font-size: 14px;
    font-weight: 700;
    gap: 10px;
    list-style: none;
    padding: 9px 10px;
    position: relative;
    user-select: none;
}

.nav-group summary::-webkit-details-marker {
    display: none;
}

.nav-group summary::after {
    border-bottom: 2px solid currentColor;
    border-right: 2px solid currentColor;
    content: "";
    height: 7px;
    margin-left: auto;
    transform: rotate(45deg);
    transition: transform 0.15s ease;
    width: 7px;
}

.nav-group[open] summary::after {
    transform: rotate(225deg);
}

.nav-group summary:hover,
.nav-group[open] summary {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

.sidebar-nav a,
.nav-submenu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border-radius: 8px;
    text-decoration: none;
    color: #dbe8ef;
    font-size: 14px;
}

.nav-direct {
    font-weight: 700;
}

.nav-submenu {
    border-left: 1px solid rgba(255, 255, 255, 0.14);
    display: grid;
    gap: 3px;
    margin: 6px 0 6px 22px;
    padding-left: 10px;
}

.nav-submenu a {
    color: #cbd5e1;
    font-size: 13px;
    min-height: 34px;
    padding: 8px 10px;
}

.sidebar-nav a:hover,
.sidebar-nav a.active,
.nav-submenu a:hover,
.nav-submenu a.active {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
}

.nav-icon {
    width: 26px;
    height: 24px;
    flex: 0 0 26px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.14);
    display: grid;
    place-items: center;
    font-size: 10px;
    font-weight: 700;
}

.sidebar-note {
    margin-top: auto;
    padding: 14px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
}

.sidebar-note span {
    display: block;
    font-weight: 700;
    margin-bottom: 6px;
}

.sidebar-note p {
    margin: 0;
    color: #dbe8ef;
    font-size: 13px;
    line-height: 1.4;
}

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

.topbar {
    min-height: 94px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    padding: 24px 32px;
    background: #ffffff;
    border-bottom: 1px solid var(--line);
}

.topbar h1 {
    margin: 4px 0 0;
    font-size: 28px;
    line-height: 1.15;
}

.eyebrow {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0;
}

.topbar-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--muted);
}

.topbar-meta strong {
    padding: 7px 10px;
    background: #e6f4ef;
    color: var(--success);
    border-radius: 8px;
}

.content {
    padding: 28px 32px 40px;
}

.stats-grid,
.cards-grid,
.detail-grid {
    display: grid;
    gap: 16px;
}

.stats-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 20px;
}

.cards-grid,
.detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-bottom: 20px;
}

.stat-card,
.info-card,
.panel,
.module-hero,
.detail-header {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.stat-card,
.info-card {
    padding: 18px;
}

.stat-card strong {
    display: block;
    margin-top: 14px;
    font-size: 30px;
}

.stat-card p,
.info-card p,
.panel-header p,
.module-hero p,
.detail-header p,
.body-copy {
    color: var(--muted);
    margin: 6px 0 0;
    line-height: 1.5;
}

.info-card h3,
.panel h2,
.module-hero h2,
.detail-header h2 {
    margin: 0;
}

.module-hero,
.detail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 24px;
    margin-bottom: 20px;
}

.module-badge {
    display: inline-flex;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: #fff4cc;
    color: var(--warning);
    font-weight: 700;
    margin-bottom: 14px;
}

.panel {
    margin-bottom: 20px;
    overflow: hidden;
}

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

.panel-header.compact {
    display: block;
}

.button,
.table-action,
.back-link {
    color: var(--brand);
    font-weight: 700;
    text-decoration: none;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0 14px;
    border: 0;
    border-radius: 8px;
    background: var(--brand);
    color: #ffffff;
    cursor: pointer;
    font: inherit;
    white-space: nowrap;
}

.button-small {
    min-height: 34px;
    padding: 0 10px;
}

.count-badge {
    padding: 8px 10px;
    border-radius: 8px;
    background: var(--panel-soft);
    color: var(--neutral);
    font-weight: 700;
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: middle;
}

th {
    color: var(--muted);
    font-size: 13px;
    background: var(--panel-soft);
}

td small {
    display: block;
    color: var(--muted);
    margin-top: 4px;
}

.table-note {
    color: var(--muted);
    max-width: 260px;
    min-width: 180px;
}

tbody tr:hover {
    background: #fbfdff;
}

tfoot th {
    color: var(--text);
    background: #ffffff;
}

.status-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 18px 20px;
}

.status-filter-bar {
    border-bottom: 1px solid var(--line);
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 14px 20px;
}

.status-filter {
    align-items: center;
    background: var(--panel-soft);
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--neutral);
    display: inline-flex;
    gap: 8px;
    min-height: 36px;
    padding: 7px 10px;
    text-decoration: none;
}

.status-filter:hover,
.status-filter.active {
    border-color: var(--brand);
    color: var(--brand);
}

.status-filter.active {
    background: #e6f4ef;
}

.status-filter span,
.status-filter strong {
    display: inline-block;
    font-size: 13px;
    line-height: 1.2;
}

.quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    min-width: 260px;
}

.quick-actions form {
    margin: 0;
}

.quick-action-button {
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--brand);
    cursor: pointer;
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    min-height: 30px;
    padding: 5px 8px;
}

.quick-action-button:hover {
    background: var(--panel-soft);
    border-color: var(--brand);
}

.inline-actions,
.preinvoice-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.inline-actions form,
.preinvoice-actions form {
    margin: 0;
}

.preinvoice-actions {
    padding: 18px 20px;
}

.warning-list {
    display: grid;
    gap: 5px;
    min-width: 220px;
}

.warning-list span {
    background: #fff7df;
    border: 1px solid #efd27a;
    border-radius: 8px;
    color: var(--warning);
    display: inline-flex;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.25;
    padding: 5px 7px;
}

.validation-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    padding: 18px 20px;
}

.alegra-validation-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.validation-item {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px;
}

.validation-item strong,
.validation-item span {
    display: block;
}

.validation-item span {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.35;
    margin-top: 5px;
}

.validation-item.ok {
    background: #f0fdf4;
    border-color: #bbf7d0;
}

.validation-item.warning {
    background: #fff7df;
    border-color: #efd27a;
}

.validation-ok {
    color: var(--success);
    font-weight: 700;
    white-space: nowrap;
}

.prep-summary-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    padding: 18px 20px;
}

.prep-summary-item {
    border: 1px solid var(--line);
    border-left: 5px solid var(--neutral);
    border-radius: 8px;
    min-height: 86px;
    padding: 14px;
}

.prep-summary-item strong,
.prep-summary-item span {
    display: block;
}

.prep-summary-item span {
    color: var(--muted);
    font-weight: 700;
    margin-top: 10px;
}

.prep-summary-item.ok {
    background: #f0fdf4;
    border-left-color: var(--success);
}

.prep-summary-item.warning {
    background: #fff7df;
    border-left-color: var(--warning);
}

.prep-summary-item.pending {
    background: #f8fafc;
    border-left-color: var(--neutral);
}

.quote-flow {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    padding: 18px 20px;
}

.quote-flow span {
    align-items: center;
    background: var(--panel-soft);
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--neutral);
    display: flex;
    font-size: 13px;
    font-weight: 700;
    justify-content: center;
    min-height: 42px;
    padding: 8px;
    text-align: center;
}

.quote-flow span.active {
    background: #e6f4ef;
    border-color: #b7decf;
    color: var(--success);
}

.status-pill {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 4px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}


/* MercadoLibre sales tray: keep the operational status column compact. */
.ml-status-column {
    width: 190px;
    max-width: 190px;
}

.ml-status-cell {
    width: 190px;
    max-width: 190px;
}

.ml-status-pill-compact {
    max-width: 185px;
    white-space: normal;
    line-height: 1.15;
    text-align: center;
    justify-content: center;
}

.status-ok {
    background: #dcfce7;
    color: var(--success);
}

.status-info {
    background: #dbeafe;
    color: var(--info);
}

.status-warning {
    background: #fef3c7;
    color: var(--warning);
}

.status-attention {
    background: #ffedd5;
    color: #c2410c;
}

.status-error {
    background: #fee4e2;
    color: var(--danger);
}

.status-pending {
    background: #e2e8f0;
    color: var(--neutral);
}

.status-nueva,
.status-new {
    background: #e0f2fe;
    color: var(--info);
}

.status-pendiente_revision,
.status-needs_review {
    background: #fef3c7;
    color: var(--warning);
}

.status-faltan_datos,
.status-error_facturacion,
.status-missing_data,
.status-invoice_error {
    background: #fee4e2;
    color: var(--danger);
}

.status-lista_para_facturar,
.status-factura_creada,
.status-ready_to_invoice,
.status-invoiced {
    background: #dcfce7;
    color: var(--success);
}

.status-ignorada,
.status-ignored {
    background: #e2e8f0;
    color: var(--neutral);
}

.data-list {
    margin: 0;
    padding: 18px 20px;
}

.data-list div {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 12px;
    padding: 9px 0;
    border-bottom: 1px solid var(--line);
}

.data-list div:last-child {
    border-bottom: 0;
}

.data-list dt {
    color: var(--muted);
}

.data-list dd {
    margin: 0;
    font-weight: 700;
}

.body-copy {
    padding: 18px 20px;
}

.placeholder-hero .module-badge {
    background: #e0f2fe;
    color: var(--info);
}

.placeholder-list {
    margin: 0;
    padding: 18px 20px 18px 38px;
    color: var(--muted);
    line-height: 1.7;
}

.action-stack {
    display: grid;
    gap: 10px;
    padding: 18px 20px;
}

.action-stack button {
    min-height: 38px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel-soft);
    color: var(--muted);
    cursor: not-allowed;
}

.back-link {
    display: inline-block;
    margin-bottom: 10px;
}

.notice-success {
    background: #e6f4ef;
    border: 1px solid #b7decf;
    border-radius: 8px;
    color: var(--success);
    font-weight: 700;
    margin-bottom: 18px;
    padding: 12px 14px;
}

.notice-warning {
    background: #fff7df;
    border: 1px solid #efd27a;
    border-radius: 8px;
    color: var(--warning);
    font-weight: 700;
    margin-bottom: 18px;
    padding: 12px 14px;
}

.status-form {
    display: grid;
    gap: 10px;
    padding: 18px 20px;
}

.status-form label {
    color: var(--muted);
    font-weight: 700;
}

.status-form select,
.status-form input,
.status-form textarea {
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--text);
    font: inherit;
    padding: 10px 12px;
    width: 100%;
}

.status-form textarea {
    resize: vertical;
}

.status-form-grid {
    align-items: end;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.advanced-filters {
    grid-column: 1 / -1;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px;
}

.advanced-filters summary {
    color: var(--brand);
    cursor: pointer;
    font-weight: 700;
}

.advanced-filters .status-form-grid {
    margin-top: 12px;
}

.form-error {
    color: var(--danger);
    font-size: 13px;
    margin: 0;
}

.login-page {
    align-items: center;
    display: flex;
    justify-content: center;
    min-height: 100vh;
    padding: 24px;
}

.login-panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    max-width: 440px;
    padding: 28px;
    width: 100%;
}

.login-panel h1 {
    margin: 22px 0 6px;
}

.login-panel p {
    color: var(--muted);
    line-height: 1.5;
    margin: 0 0 16px;
}

.login-brand {
    border-bottom-color: var(--line);
    color: var(--text);
}

.login-brand small {
    color: var(--muted);
}

.login-form {
    padding: 0;
}

.checkbox-row {
    align-items: center;
    display: flex;
    gap: 8px;
}

.checkbox-row input {
    width: auto;
}

.timeline-list {
    display: grid;
    gap: 14px;
    padding: 18px 20px;
}

.timeline-list div {
    border-bottom: 1px solid var(--line);
    padding-bottom: 14px;
}

.timeline-list div:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.timeline-list strong,
.timeline-list small {
    display: block;
}

.timeline-list small {
    color: var(--muted);
    margin-top: 4px;
}

.timeline-list p {
    color: var(--muted);
    line-height: 1.45;
    margin: 8px 0 0;
}

.operation-shell {
    display: flex;
    min-height: 100vh;
}

.operation-sidebar {
    background: #123b3f;
    color: #ffffff;
    display: flex;
    flex-direction: column;
    padding: 24px 18px;
    width: 308px;
    min-width: 308px;
    flex: 0 0 308px;
    max-height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    position: sticky;
    top: 0;
}

.operation-nav {
    display: grid;
    gap: 10px;
    margin-top: 28px;
}

.operation-nav a {
    border-radius: 8px;
    color: #dcebea;
    font-weight: 700;
    min-height: 42px;
    padding: 12px;
    text-decoration: none;
    line-height: 1.35;
    white-space: normal;
}

.nav-section-label {
    color: #9fb9c3;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0;
    margin: 12px 2px 4px;
    text-transform: uppercase;
}

.operation-nav-group {
    display: grid;
    gap: 4px;
}

.nav-group-title {
    color: #cbd5e1;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0;
    margin: 12px 10px 2px;
    text-transform: uppercase;
}

.operation-nav-group summary {
    border-radius: 8px;
    color: #dcebea;
    cursor: pointer;
    font-weight: 700;
    list-style: none;
    padding: 12px;
}

.operation-nav-group summary::-webkit-details-marker {
    display: none;
}

.operation-nav-group[open] summary,
.operation-nav-group summary:hover {
    background: rgba(255, 255, 255, 0.13);
    color: #ffffff;
}

.operation-nav-group div {
    border-left: 1px solid rgba(255, 255, 255, 0.14);
    display: grid;
    gap: 3px;
    margin-left: 12px;
    padding-left: 10px;
}

.operation-nav-group div a {
    font-size: 13px;
    min-height: 34px;
    padding: 8px 10px;
    line-height: 1.35;
    white-space: normal;
}

.button-secondary {
    background: var(--panel-soft);
    border: 1px solid var(--line);
    color: var(--brand);
}



.problem-row {
    background: #fff8f7;
}

.problem-row td:first-child {
    border-left: 5px solid var(--danger);
}

.product-thumb {
    width: 48px;
    height: 48px;
    border-radius: 6px;
    object-fit: cover;
}

.search-results-grid {
    display: grid;
    gap: 14px;
}

.result-card {
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 8px;
    display: grid;
    gap: 12px;
    grid-template-columns: 56px 1fr auto;
    padding: 12px;
}

.result-thumb {
    align-items: center;
    background: var(--panel-soft);
    border-radius: 8px;
    color: var(--muted);
    display: flex;
    font-weight: 700;
    height: 48px;
    justify-content: center;
    overflow: hidden;
    width: 48px;
}

.result-thumb img {
    height: 100%;
    object-fit: cover;
    width: 100%;
}

.operation-nav a:hover,
.operation-nav a.active {
    background: rgba(255, 255, 255, 0.13);
    color: #ffffff;
}

.operation-mode {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    margin-top: auto;
    padding: 14px;
}

.operation-mode span {
    display: block;
    font-weight: 700;
    margin-bottom: 6px;
}

.operation-mode p {
    color: #dcebea;
    font-size: 13px;
    line-height: 1.4;
    margin: 0;
}

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

.operation-topbar {
    align-items: center;
    background: #ffffff;
    border-bottom: 1px solid var(--line);
    display: flex;
    gap: 18px;
    justify-content: space-between;
    min-height: 92px;
    padding: 24px 32px;
}

.operation-topbar h1 {
    font-size: 28px;
    line-height: 1.15;
    margin: 4px 0 0;
}

.operation-badge {
    background: #e6f4ef;
    border-radius: 8px;
    color: var(--success);
    font-weight: 700;
    padding: 8px 10px;
    white-space: nowrap;
}

.operation-content {
    padding: 28px 32px 40px;
}

.operation-hero {
    align-items: center;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 8px;
    display: flex;
    gap: 20px;
    justify-content: space-between;
    margin-bottom: 20px;
    padding: 24px;
}

.operation-hero h2 {
    margin: 0;
}

.operation-hero p {
    color: var(--muted);
    line-height: 1.5;
    margin: 6px 0 0;
}

.operation-board {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.operation-board-compact .operation-card {
    min-height: 140px;
}

.operation-card {
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--text);
    min-height: 164px;
    padding: 20px;
    text-decoration: none;
}

.operation-card:hover {
    border-color: var(--brand);
}

.operation-card span,
.operation-card small {
    display: block;
}

.operation-card span {
    font-weight: 700;
}

.operation-card strong {
    display: block;
    font-size: 38px;
    margin: 18px 0 8px;
}

.operation-card small {
    color: var(--muted);
    line-height: 1.45;
}

.operation-card.attention {
    border-left: 5px solid var(--warning);
}

.operation-card.ready {
    border-left: 5px solid var(--success);
}

@media (max-width: 980px) {
    .admin-shell {
        display: block;
    }

    .sidebar,
    .operation-sidebar {
        width: auto;
        min-width: 0;
        flex: 1 1 auto;
    }

    .operation-shell {
        display: block;
    }

    .stats-grid,
    .cards-grid,
    .detail-grid,
    .operation-board,
    .validation-grid,
    .prep-summary-grid,
    .quote-flow {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 680px) {
    .topbar,
    .operation-topbar,
    .operation-hero,
    .module-hero,
    .detail-header,
    .panel-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .content,
    .topbar,
    .operation-content,
    .operation-topbar {
        padding-left: 18px;
        padding-right: 18px;
    }

    .stats-grid,
    .cards-grid,
    .detail-grid,
    .operation-board,
    .validation-grid,
    .prep-summary-grid,
    .quote-flow {
        grid-template-columns: 1fr;
    }

    .data-list div {
        grid-template-columns: 1fr;
        gap: 4px;
    }
}

/* WAGE OPERATION TYPOGRAPHY SCALE START */

/*
 * Escala grande de lectura y aprovechamiento horizontal.
 * Solo modifica presentación visual del modo operativo.
 */

html body .operation-shell {
    grid-template-columns: 270px minmax(0, 1fr) !important;
    font-size: 17px !important;
    line-height: 1.55 !important;
}

html body .operation-sidebar {
    width: auto !important;
    min-width: 0 !important;
}

html body .operation-main {
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
}

html body .operation-content {
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    padding: 24px 28px 38px !important;
    font-size: 17px !important;
    line-height: 1.55 !important;
    box-sizing: border-box !important;
}

/*
 * Marca y menú lateral.
 */

html body .operation-sidebar .brand strong {
    font-size: 21px !important;
    line-height: 1.25 !important;
}

html body .operation-sidebar .brand small {
    font-size: 15px !important;
    line-height: 1.35 !important;
}

html body .operation-nav {
    font-size: 17px !important;
}

html body .operation-nav > a,
html body .operation-nav .nav-submenu > a,
html body .operation-nav .nav-submenu details a {
    min-height: 46px !important;
    padding-top: 11px !important;
    padding-bottom: 11px !important;
    font-size: 17px !important;
    line-height: 1.4 !important;
}

html body .operation-nav .nav-section-label {
    font-size: 14px !important;
    line-height: 1.4 !important;
}

html body .operation-nav .nav-group-title {
    font-size: 16px !important;
    line-height: 1.45 !important;
}

html body .operation-nav details > summary {
    min-height: 44px !important;
    display: flex !important;
    align-items: center !important;
    padding-top: 10px !important;
    padding-bottom: 10px !important;
    font-size: 16px !important;
    line-height: 1.4 !important;
}

html body .operation-mode span {
    font-size: 17px !important;
}

html body .operation-mode p {
    font-size: 15px !important;
    line-height: 1.5 !important;
}

/*
 * Barra superior.
 */

html body .operation-topbar {
    min-height: 78px !important;
}

html body .operation-topbar .eyebrow {
    font-size: 14px !important;
}

html body .operation-topbar h1 {
    font-size: 31px !important;
    line-height: 1.2 !important;
}

html body .operation-badge,
html body .quick-action-button {
    min-height: 40px !important;
    font-size: 15px !important;
}

/*
 * Listado de facturas.
 */

html body .income-invoices {
    width: 100% !important;
    max-width: none !important;
}

html body .income-summary {
    grid-template-columns: repeat(
        4,
        minmax(210px, 1fr)
    ) !important;
}

html body .income-summary-card {
    padding: 20px !important;
}

html body .income-field input,
html body .income-field select {
    min-height: 47px !important;
}

html body .income-button {
    min-height: 45px !important;
    padding-left: 17px !important;
    padding-right: 17px !important;
}

html body .income-table-head {
    padding: 18px 20px !important;
}

html body .income-table {
    min-width: 1180px !important;
}

html body .income-table th {
    padding: 16px 17px !important;
}

html body .income-table td {
    padding: 16px 17px !important;
}

html body .status-badge {
    padding: 7px 11px !important;
}

/*
 * Detalle de factura: usar todo el ancho disponible.
 */

html body .invoice-detail {
    width: 100% !important;
    max-width: none !important;
}

html body .invoice-detail-actions {
    width: 100% !important;
    max-width: none !important;
}

html body .invoice-action {
    min-height: 44px !important;
    padding: 9px 16px !important;
}

html body .invoice-readonly {
    padding: 8px 13px !important;
}

html body .invoice-paper {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
}

html body .invoice-paper-body {
    padding: 30px 34px !important;
}

html body .invoice-document-header {
    grid-template-columns:
        minmax(0, 1fr)
        230px !important;
    gap: 30px !important;
}

html body .invoice-company-mark {
    width: 68px !important;
    height: 68px !important;
    flex-basis: 68px !important;
}

html body .invoice-number-box {
    min-width: 210px !important;
    padding: 19px 22px !important;
}

html body .invoice-title-row {
    padding-top: 28px !important;
    padding-bottom: 18px !important;
}

html body .invoice-badge {
    padding: 8px 13px !important;
}

html body .invoice-info-grid {
    grid-template-columns:
        minmax(0, 1.15fr)
        minmax(0, .85fr) !important;
}

html body .invoice-info-row {
    grid-template-columns:
        175px
        minmax(0, 1fr) !important;
    min-height: 53px !important;
}

html body .invoice-info-label,
html body .invoice-info-value {
    padding: 14px 16px !important;
}

html body .invoice-section {
    margin-top: 31px !important;
}

html body .invoice-section-title {
    margin-bottom: 15px !important;
}

html body .invoice-items-table {
    min-width: 1050px !important;
}

html body .invoice-items-table th,
html body .invoice-payments-table th {
    padding: 15px 15px !important;
}

html body .invoice-items-table td,
html body .invoice-payments-table td {
    padding: 15px 15px !important;
}

html body .invoice-item-description {
    max-width: 520px !important;
}

html body .invoice-total-layout {
    grid-template-columns:
        minmax(0, 1.3fr)
        minmax(390px, 470px) !important;
    gap: 30px !important;
}

html body .invoice-note {
    padding: 17px !important;
}

html body .invoice-total-row {
    padding: 14px 17px !important;
}

html body .invoice-bottom-grid {
    grid-template-columns:
        repeat(2, minmax(0, 1fr)) !important;
    gap: 22px !important;
}

html body .invoice-card-header {
    padding: 16px 18px !important;
}

html body .invoice-card-body {
    padding: 19px !important;
}

html body .invoice-detail-list div {
    grid-template-columns:
        175px
        minmax(0, 1fr) !important;
    gap: 15px !important;
}

html body .invoice-cufe {
    padding: 13px !important;
}

html body .invoice-empty {
    padding: 23px !important;
}

/*
 * Adaptación para pantallas medianas.
 */

@media (max-width: 1250px) {
    html body .operation-shell {
        grid-template-columns:
            250px
            minmax(0, 1fr) !important;
    }

    html body .operation-content {
        padding-left: 20px !important;
        padding-right: 20px !important;
    }

    html body .invoice-info-grid,
    html body .invoice-bottom-grid,
    html body .invoice-total-layout {
        grid-template-columns: 1fr !important;
    }
}

/* WAGE OPERATION TYPOGRAPHY SCALE END */

/* WAGE OPERATION MENU HIERARCHY START */

html body .operation-nav .nav-group {
    display: grid;
    gap: 0;
    width: 100%;
}

html body .operation-nav .nav-group + .nav-group {
    margin-top: 4px;
}

html body .operation-nav .nav-group-title {
    margin:
        14px
        10px
        4px !important;
}

html body .operation-nav .nav-submenu {
    display: grid;
    gap: 3px;
    margin:
        5px
        0
        7px
        18px;
    padding-left: 12px;
    border-left:
        1px
        solid
        rgba(255, 255, 255, 0.18);
}

html body .operation-nav .nav-submenu > a,
html body .operation-nav .nav-branch > summary {
    width: 100%;
    box-sizing: border-box;
}

html body .operation-nav .nav-branch {
    display: grid;
    gap: 0;
    width: 100%;
    margin: 0;
}

html body .operation-nav .nav-branch > summary {
    position: relative;
    min-height: 46px !important;
    margin: 0;
    padding:
        11px
        30px
        11px
        10px !important;
    border-radius: 8px;
    color: #dcebea;
    cursor: pointer;
    font-size: 17px !important;
    font-weight: 750;
    line-height: 1.4 !important;
    list-style: none;
}

html body .operation-nav .nav-branch > summary::-webkit-details-marker {
    display: none;
}

html body .operation-nav .nav-branch > summary::after {
    content: "";
    position: absolute;
    top: 50%;
    right: 12px;
    width: 7px;
    height: 7px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform:
        translateY(-65%)
        rotate(45deg);
    transition:
        transform
        0.15s
        ease;
}

html body .operation-nav .nav-branch[open] > summary::after {
    transform:
        translateY(-35%)
        rotate(225deg);
}

html body .operation-nav .nav-branch > summary:hover,
html body .operation-nav .nav-branch[open] > summary {
    background:
        rgba(255, 255, 255, 0.11);
    color: #ffffff;
}

html body .operation-nav .nav-submenu-level-2 {
    margin:
        2px
        0
        8px
        14px;
    padding-left: 12px;
    border-left:
        1px
        solid
        rgba(255, 255, 255, 0.22);
}

html body .operation-nav .nav-submenu-level-2 > a {
    min-height: 44px !important;
    padding:
        10px
        10px !important;
    font-size: 16px !important;
    line-height: 1.4 !important;
}

html body .operation-nav .nav-submenu > a {
    margin: 0;
}

html body .operation-nav .nav-submenu > a.active {
    box-shadow:
        inset
        3px
        0
        0
        rgba(255, 255, 255, 0.72);
}

/* WAGE OPERATION MENU HIERARCHY END */

/* WAGE_FINANCIAL_TYPOGRAPHY_SCOPE_V2 */
html body .statement-page,
html body .statement-workspace,
html body .purchase-bills-page,
html body .expense-payments-page,
html body .income-invoices,
html body .invoice-detail,
html body .income-payments,
html body .payable-report,
html body .administrative-report,
html body .administrative-catalog,
html body .payment-review-page {
    font-size: 15px;
}

/* WAGE_PAYROLL_COMPACT_HELP_V63 */
.wage-help {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    margin-left: 4px;
    border: 1px solid currentColor;
    border-radius: 50%;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    cursor: help;
    vertical-align: middle;
    opacity: .72;
    outline: none;
}

.wage-help:hover,
.wage-help:focus {
    opacity: 1;
}

.wage-help-tooltip {
    position: absolute;
    z-index: 1000;
    left: 50%;
    bottom: calc(100% + 8px);
    width: max-content;
    max-width: min(320px, 80vw);
    padding: 8px 10px;
    border-radius: 7px;
    background: #20242a;
    color: #fff;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.4;
    text-align: left;
    white-space: normal;
    box-shadow: 0 4px 14px rgba(0,0,0,.22);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translate(-50%, 4px);
    transition:
        opacity .12s ease,
        transform .12s ease,
        visibility .12s ease;
}

.wage-help:hover .wage-help-tooltip,
.wage-help:focus .wage-help-tooltip,
.wage-help:focus-within .wage-help-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0);
}


/* WAGE_NAV_COLLAPSIBLE_STICKY_V1 */
html body .sidebar,
html body .operation-sidebar {
    align-self: flex-start;
    height: 100vh;
    max-height: 100vh;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
}

html body .operation-nav .nav-section {
    display: grid;
    gap: 0;
    width: 100%;
    margin: 0;
}

html body .operation-nav .nav-section > summary.nav-group-title {
    align-items: center;
    border-radius: 8px;
    color: #cbd5e1;
    cursor: pointer;
    display: flex !important;
    font-size: 16px !important;
    font-weight: 750;
    justify-content: space-between;
    line-height: 1.4 !important;
    list-style: none;
    margin: 5px 0 2px !important;
    min-height: 44px !important;
    padding: 10px 30px 10px 12px !important;
    position: relative;
    text-transform: uppercase;
    user-select: none;
}

html body .operation-nav .nav-section > summary.nav-group-title::-webkit-details-marker {
    display: none;
}

html body .operation-nav .nav-section > summary.nav-group-title::after {
    border-bottom: 2px solid currentColor;
    border-right: 2px solid currentColor;
    content: "";
    height: 7px;
    position: absolute;
    right: 13px;
    top: 50%;
    transform: translateY(-65%) rotate(45deg);
    transition: transform 0.15s ease;
    width: 7px;
}

html body .operation-nav .nav-section[open] > summary.nav-group-title::after {
    transform: translateY(-35%) rotate(225deg);
}

html body .operation-nav .nav-section > summary.nav-group-title:hover,
html body .operation-nav .nav-section[open] > summary.nav-group-title {
    background: rgba(255, 255, 255, 0.11);
    color: #ffffff;
}

html body .operation-nav .nav-section > .nav-submenu {
    margin-top: 3px;
}

@media (max-width: 980px) {
    html body .sidebar,
    html body .operation-sidebar {
        align-self: auto;
        height: auto;
        max-height: none;
        overflow: visible;
        position: relative;
        top: auto;
    }
}
/* WAGE_NAV_COLLAPSIBLE_STICKY_V1 END */

/* WAGE_PAYROLL_VISUAL_CLEANUP_V8F6 */

html body .payroll-panel {
    overflow: visible;
}

html body .payroll-panel .panel-header.compact {
    align-items: center;
    display: flex;
    justify-content: space-between;
    gap: 14px;
}

html body .payroll-heading-line {
    align-items: center;
    display: flex;
    gap: 6px;
    min-height: 26px;
}

html body .payroll-heading-line h2 {
    margin: 0;
}

html body .payroll-month-form {
    padding: 16px 20px 18px;
}

html body .payroll-input-grid {
    align-items: end;
    display: grid;
    gap: 14px;
    grid-template-columns:
        repeat(3, minmax(190px, 1fr));
}

html body .payroll-field {
    color: var(--text);
    display: grid;
    font-size: 15px;
    font-weight: 700;
    gap: 6px;
    line-height: 1.35;
    margin: 0;
    min-width: 0;
}

html body .payroll-field-title {
    align-items: center;
    display: flex;
    font-size: 15px;
    font-weight: 700;
    gap: 4px;
    min-height: 21px;
}

html body .payroll-field input,
html body .payroll-field select {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--text);
    font-family: inherit;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.35;
    min-height: 43px;
    padding: 9px 11px;
    width: 100%;
}

html body .payroll-field input[readonly] {
    background: var(--panel-soft);
    color: var(--text);
    cursor: default;
}

html body .payroll-form-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    grid-column: 1 / -1;
    margin-top: 2px;
}

html body .payroll-compact-warning {
    align-items: center;
    background: #fff7df;
    border: 1px solid #efd27a;
    border-radius: 8px;
    color: var(--warning);
    display: flex;
    font-size: 14px;
    font-weight: 700;
    gap: 6px;
    grid-column: 1 / -1;
    margin: 0;
    padding: 9px 11px;
}

html body .payroll-pending-state {
    align-items: center;
    color: var(--muted);
    display: flex;
    font-size: 15px;
    gap: 8px;
    min-height: 54px;
    padding: 14px 20px;
}

html body .payroll-pending-state::before {
    content: "○";
    font-size: 18px;
    line-height: 1;
}

html body .payroll-reference-grid {
    display: grid;
    gap: 10px;
    grid-template-columns:
        repeat(auto-fit, minmax(165px, 1fr));
}

html body .payroll-reference-grid .compact-action-card {
    padding: 12px 14px;
}

html body .payroll-reference-grid .table-note {
    font-size: 13px;
    line-height: 1.35;
    max-width: none;
    min-width: 0;
}

html body .payroll-reference-grid strong {
    display: block;
    font-size: 15px;
    margin-top: 4px;
}

html body .payroll-panel .wage-help {
    flex: 0 0 auto;
}

html body .payroll-panel .wage-help-tooltip {
    font-size: 13px;
    max-width: min(340px, 82vw);
}

html body .payroll-panel .status-pill {
    white-space: nowrap;
}

@media (max-width: 900px) {
    html body .payroll-input-grid {
        grid-template-columns:
            repeat(2, minmax(180px, 1fr));
    }
}

@media (max-width: 680px) {
    html body .payroll-panel .panel-header.compact {
        align-items: flex-start;
        flex-direction: row;
    }

    html body .payroll-input-grid {
        grid-template-columns: 1fr;
    }

    html body .payroll-month-form {
        padding-left: 14px;
        padding-right: 14px;
    }
}

/* WAGE_PAYROLL_UNIFIED_ACCOUNTING_VISUAL_V8F8 */

html body .payroll-evidence-details {
    border-top: 1px solid var(--line);
    margin-top: 2px;
    padding: 0 20px 14px;
}

html body .payroll-evidence-details > summary {
    color: var(--brand);
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    padding: 12px 0;
}

html body .payroll-accounting-summary {
    display: grid;
    gap: 10px;
    grid-template-columns:
        repeat(4, minmax(160px, 1fr));
    padding: 16px 20px;
}

html body .payroll-summary-reconciliation {
    color: var(--muted);
    font-size: 12px;
    font-weight: 500;
    line-height: 1.35;
    margin-top: 6px;
}

html body .payroll-unified-table-wrap {
    overflow-x: auto;
}

html body .payroll-unified-table {
    min-width: 1040px;
    width: 100%;
}

html body .payroll-unified-table th,
html body .payroll-unified-table td {
    vertical-align: middle;
}

html body .payroll-unified-table .money-cell {
    text-align: right;
    white-space: nowrap;
}

html body .payroll-inline-reconciliation {
    align-items: center;
    border-top: 1px solid var(--line);
    display: flex;
    flex-wrap: wrap;
    font-size: 14px;
    gap: 10px 14px;
    padding: 12px 20px;
}

html body .payroll-unified-actions {
    align-items: center;
    border-top: 1px solid var(--line);
    display: flex;
    gap: 8px;
    padding: 14px 20px 18px;
}

@media (max-width: 900px) {
    html body .payroll-accounting-summary {
        grid-template-columns:
            repeat(2, minmax(160px, 1fr));
    }
}

@media (max-width: 560px) {
    html body .payroll-accounting-summary {
        grid-template-columns: 1fr;
    }
}

/* WAGE_PAYROLL_STANDARD_ACCOUNTING_VISUAL_V8F9 */

html body .payroll-standard-section-row th {
    background: var(--surface-soft, #f8fafc);
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .04em;
    padding-bottom: 8px;
    padding-top: 12px;
    text-transform: uppercase;
}

html body .payroll-standard-zero-row {
    opacity: .78;
}

html body .payroll-standard-zero-row td {
    background: rgba(248, 250, 252, .45);
}

/* WAGE_PAYROLL_ACCOUNTING_TABLE_VISUAL_V8G2 */

/*
 * Alternancia explícita.
 *
 * No usamos :nth-child porque los encabezados
 * de sección también son filas de la tabla.
 */
html body
.payroll-unified-table
tbody
.payroll-standard-data-row.payroll-standard-row-odd
> td {
    background: #ffffff;
}

html body
.payroll-unified-table
tbody
.payroll-standard-data-row.payroll-standard-row-even
> td {
    background: var(--surface-soft, #f6f8fb);
}

/*
 * La fila completa responde al hover sin perder
 * el patrón blanco / tono suave.
 */
html body
.payroll-unified-table
tbody
.payroll-standard-data-row
> td {
    transition:
        background-color .12s ease,
        box-shadow .12s ease;
}

html body
.payroll-unified-table
tbody
.payroll-standard-data-row:hover
> td {
    background: #eef3f8;
}

/*
 * Las filas de valor cero mantienen la diferenciación
 * pero sin reducir tanto la legibilidad.
 */
html body
.payroll-unified-table
tbody
.payroll-standard-zero-row {
    opacity: 1;
}

html body
.payroll-unified-table
tbody
.payroll-standard-zero-row
> td {
    color: var(--muted);
}

/*
 * Icono de información dinámico.
 */
html body
.payroll-concept-note-trigger {
    display: inline-flex;
    margin-left: 7px;
    vertical-align: middle;
}

html body
.payroll-row-note-help {
    flex: 0 0 auto;
}

/*
 * Las notas originales siguen en el DOM.
 * Se ocultan únicamente cuando JS ya construyó
 * el tooltip dinámico.
 */
html body
.payroll-row-note-source {
    display: none !important;
}

html body
.payroll-row-note-tooltip {
    max-width: min(360px, 80vw);
    min-width: 260px;
    white-space: normal;
}

html body
.payroll-row-note-item {
    display: block;
    line-height: 1.45;
}

html body
.payroll-row-note-item
+ .payroll-row-note-item {
    border-top: 1px solid
        rgba(148, 163, 184, .28);
    margin-top: 7px;
    padding-top: 7px;
}

/*
 * Mantener la alternancia también cuando una celda
 * del navegador herede estilos de tabla anteriores.
 */
html body
.payroll-unified-table
tbody
.payroll-standard-data-row.payroll-standard-row-odd
> td:first-child,
html body
.payroll-unified-table
tbody
.payroll-standard-data-row.payroll-standard-row-even
> td:first-child {
    background-clip: padding-box;
}

@media (max-width: 720px) {
    html body
    .payroll-row-note-tooltip {
        min-width: 230px;
        max-width: 75vw;
    }
}
