:root {
    --bg: #f4f6fa;
    --panel: #ffffff;
    --ink: #1b2d45;
    --muted: #50627a;
    --border: #dce3ed;
    --blue: #2459cf;
    --blue-soft: #edf3ff;
    --navy: #10263f;
    --green: #087454;
    --amber: #885608;
    --red: #b52c43;
    --success-bg: #e8f6ef;
    --warning-bg: #fff3d9;
    --danger-bg: #fff0f2;
    --focus: #1855cc;
    --text-body: 1rem;
    --text-small: 0.875rem;
    --space: 8px;
    --radius: 12px;
    --shadow: 0 2px 6px #20355505, 0 8px 24px #20355504;
    --sidebar-width: 248px;
    --motion-enter: 180ms;
    --surface-subtle: #f8fafd;
    --control-border: #7e8fa8;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scrollbar-gutter: stable;
}

body {
    margin: 0;
    color: var(--ink);
    background: var(--bg);
    font-family: Inter, "Segoe UI", Arial, sans-serif;
    font-size: var(--text-body);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--blue);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

button,
input,
select,
textarea {
    font: inherit;
}

button,
summary {
    cursor: pointer;
}

button:disabled,
input:disabled {
    cursor: not-allowed;
    opacity: 0.65;
}

[hidden] {
    display: none !important;
}

:focus-visible {
    outline: 3px solid var(--focus);
    outline-offset: 3px;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1,
h2,
h3 {
    text-wrap: balance;
    overflow-wrap: anywhere;
}

h1 {
    margin-bottom: 8px;
    font-size: clamp(27px, 2.3vw, 34px);
    font-weight: 720;
    letter-spacing: -1.1px;
    line-height: 1.2;
}

h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 680;
    letter-spacing: -0.35px;
}

h3 {
    margin-bottom: 6px;
    font-size: 16px;
    font-weight: 650;
}

small {
    font-size: var(--text-small);
}

.muted,
.help {
    color: var(--muted);
}

.icon {
    width: 20px;
    height: 20px;
    flex: 0 0 20px;
    fill: none;
    vertical-align: middle;
}

.skip-link {
    position: fixed;
    top: -100px;
    left: 16px;
    z-index: 2000;
    padding: 12px 16px;
    border-radius: 9px;
    color: white;
    background: var(--navy);
}

.skip-link:focus {
    top: 12px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

/* Navegación y espacio de trabajo compartido. */
.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 30;
    display: flex;
    width: var(--sidebar-width);
    padding: 30px 16px 18px;
    flex-direction: column;
    max-height: 100vh;
    max-height: 100dvh;
    overflow-y: auto;
    color: #d5e1f2;
    background: var(--navy);
    scrollbar-width: thin;
}

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

.sidebar .mobile-menu-toggle {
    display: none;
}

.brand {
    display: flex;
    min-width: 0;
    gap: 12px;
    flex: 1;
    align-items: center;
    padding: 0 8px;
    color: white;
    font-size: 20px;
    font-weight: 720;
    letter-spacing: -0.6px;
}

.brand:hover {
    text-decoration: none;
}

.brand small {
    display: block;
    margin-top: 3px;
    color: #aebfd5;
    font-size: var(--text-small);
    font-weight: 450;
    letter-spacing: 0;
    line-height: 1.35;
}

.brand-mark {
    display: grid;
    width: 40px;
    height: 44px;
    flex-shrink: 0;
    place-items: center;
    border: 1px solid #668aff70;
    border-radius: 13px;
    color: white;
    background: linear-gradient(145deg, #3e79ff, #2454cb);
    box-shadow: 0 6px 18px #00000020;
}

.brand-mark .icon {
    width: 25px;
    height: 25px;
}

.nav-caption {
    margin: 38px 12px 14px;
    color: #9fb3cc;
    font-size: var(--text-small);
    font-weight: 550;
    letter-spacing: 1.1px;
}

.nav-link {
    position: relative;
    display: flex;
    gap: 12px;
    align-items: center;
    min-height: 48px;
    margin-bottom: 7px;
    padding: 12px;
    border: 1px solid transparent;
    border-radius: 10px;
    color: #becce0;
    font-size: var(--text-small);
    font-weight: 550;
    transition:
        background 160ms,
        color 160ms;
}

.nav-link:hover {
    color: white;
    background: #ffffff0b;
    text-decoration: none;
}

.nav-link.active {
    border-color: #6b97ff35;
    color: white;
    background: linear-gradient(100deg, #2d62df, #2a55b7);
    box-shadow: 0 6px 16px #020c201a;
}

.nav-link.active::after {
    position: absolute;
    right: 11px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #b7d5ff;
    content: "";
}

.sidebar :focus-visible {
    outline-color: #9ac7ff;
}

.sidebar-bottom {
    display: flex;
    gap: 9px;
    align-items: center;
    margin-top: auto;
    padding: 18px 6px 0;
    border-top: 1px solid #ffffff16;
    font-size: var(--text-small);
}

.sidebar-bottom > div {
    min-width: 0;
    flex: 1;
}

.sidebar-bottom strong {
    display: block;
    overflow: hidden;
    color: #eef4fc;
    text-overflow: ellipsis;
}

.sidebar-bottom small {
    display: block;
    color: #a5b8d0;
}

.avatar {
    display: grid;
    width: 35px;
    height: 35px;
    flex-shrink: 0;
    place-items: center;
    border: 1px solid #8daee144;
    border-radius: 11px;
    color: #d9e8ff;
    background: #304a6c;
    font-weight: 650;
}

.logout {
    display: grid;
    width: 30px;
    height: 35px;
    padding: 0;
    place-items: center;
    border: 0;
    color: #c0cee1;
    background: transparent;
}

.workspace {
    min-height: 100vh;
    min-height: 100dvh;
    margin-left: var(--sidebar-width);
}

.topbar {
    display: flex;
    min-height: 76px;
    gap: 16px;
    align-items: center;
    padding: 14px 32px;
    border-bottom: 1px solid var(--border);
    background: var(--panel);
}

.breadcrumb {
    display: flex;
    min-width: 0;
    gap: 10px;
    align-items: center;
    color: var(--muted);
    font-size: var(--text-small);
    flex-wrap: wrap;
}

.breadcrumb a {
    color: var(--muted);
}

.breadcrumb [aria-current="page"] {
    color: var(--ink);
    font-weight: 550;
}

.global-search {
    display: flex;
    min-width: 180px;
    max-width: 360px;
    gap: 10px;
    flex: 1;
    align-items: center;
    margin-left: auto;
    padding: 10px 13px;
    border: 1px solid var(--control-border);
    border-radius: 10px;
    color: var(--muted);
    background: var(--surface-subtle);
}

.global-search:focus-within {
    border-color: var(--focus);
}

.global-search input {
    width: 100%;
    min-width: 0;
    padding: 0;
    border: 0;
    color: var(--ink);
    background: transparent;
    font-size: var(--text-small);
}

.today {
    color: var(--muted);
    font-size: var(--text-small);
    white-space: nowrap;
}

.mobile-logout {
    display: none;
}

.main {
    max-width: 1740px;
    margin: auto;
    padding: 32px;
    animation: workspace-enter var(--motion-enter) ease-out;
}

.page-heading {
    display: flex;
    gap: 20px;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
}

.page-heading p {
    margin: 0;
    color: var(--muted);
    font-size: var(--text-body);
}

.page-heading > div,
.heading-with-icon > div,
.section-heading > div,
.account-heading > div {
    min-width: 0;
    overflow-wrap: anywhere;
}

.eyebrow {
    display: block;
    margin-bottom: 10px;
    color: #526986;
    font-size: var(--text-small);
    font-weight: 650;
    letter-spacing: 1.1px;
}

.page-context {
    display: inline-flex;
    gap: 9px;
    align-items: center;
    padding: 10px 14px;
    border: 1px solid #d7e2f7;
    border-radius: 10px;
    color: #365986;
    background: #eaf1ff;
    font-size: var(--text-small);
}

.icon-button {
    display: inline-flex;
    min-width: 44px;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    padding: 7px;
    border: 1px solid var(--border);
    border-radius: 10px;
    color: #436182;
    background: white;
    transition:
        background 150ms,
        color 150ms;
}

.icon-button:hover {
    color: var(--blue);
    background: var(--blue-soft);
    text-decoration: none;
}

.button {
    display: inline-flex;
    min-height: 44px;
    gap: 8px;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
    border: 1px solid transparent;
    border-radius: 9px;
    font-size: var(--text-small);
    font-weight: 650;
    line-height: 1.4;
    transition:
        box-shadow 150ms,
        background 150ms;
}

.button:hover {
    text-decoration: none;
}

.button .icon {
    width: 18px;
    height: 18px;
    flex-basis: 18px;
}

.primary {
    color: white;
    background: var(--blue);
    box-shadow: 0 4px 10px #245be51c;
}

.primary:hover {
    background: #194dd1;
    box-shadow: 0 7px 16px #245be529;
}

.secondary {
    border-color: #d4dfed;
    color: #35577e;
    background: white;
}

.secondary:hover {
    background: #f6f9ff;
}

.danger {
    border-color: #f0c9d1;
    color: var(--red);
    background: var(--danger-bg);
}

.danger:hover {
    border-color: #d98797;
    background: #ffe3e9;
}

.button:active {
    box-shadow: none;
}

.small {
    min-height: 40px;
    padding: 8px 11px;
}

.full {
    width: 100%;
}

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

.panel {
    min-width: 0;
    margin-bottom: 22px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--panel);
    box-shadow: var(--shadow);
}

.panel-heading {
    display: flex;
    min-height: 78px;
    gap: 16px;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #e8edf5;
}

.panel-heading p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: var(--text-small);
}

.heading-with-icon {
    display: flex;
    gap: 12px;
    align-items: center;
}

.heading-icon,
.empty-symbol {
    display: grid;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    place-items: center;
    border-radius: 12px;
}

/* Indicadores, prioridades y programación financiera. */
.metric-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 24px;
}

.metric {
    position: relative;
    display: flex;
    min-width: 0;
    min-height: 150px;
    gap: 14px;
    align-items: flex-start;
    justify-content: space-between;
    padding: 23px;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 15px;
    color: var(--ink);
    background: white;
    box-shadow: var(--shadow);
    transition:
        border-color 160ms,
        transform 160ms,
        box-shadow 160ms;
}

.metric:hover {
    transform: translateY(-3px);
    border-color: #abc2f0;
    box-shadow: 0 10px 28px #2035550d;
    text-decoration: none;
}

.metric div > span {
    display: block;
    color: var(--muted);
    font-size: var(--text-small);
    font-weight: 550;
}

.metric strong {
    display: block;
    margin: 9px 0 6px;
    font-size: 35px;
    font-weight: 680;
    letter-spacing: -1px;
    line-height: 1.1;
}

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

.metric-icon {
    display: grid;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    place-items: center;
    border-radius: 12px;
}

.metric-arrow {
    position: absolute;
    right: 23px;
    bottom: 20px;
    color: #526986;
}

.metric-arrow .icon {
    width: 16px;
    height: 16px;
}

.blue,
.stage-40,
.payment-PLATAFORMA {
    color: #2154ae;
    background: #edf3ff;
}

.green,
.ready,
.stage-70,
.stage-80,
.payment-PAGADO {
    color: var(--green);
    background: var(--success-bg);
}

.amber,
.pending,
.stage-30,
.stage-50 {
    color: var(--amber);
    background: var(--warning-bg);
}

.violet,
.stage-20 {
    color: #65429c;
    background: #f2ecfc;
}

.neutral,
.stage-10,
.payment-BORRADOR {
    color: #4c627d;
    background: #edf1f7;
}

.stage-60 {
    color: #954415;
    background: #fff0e5;
}

.payment-ANULADO {
    color: var(--red);
    background: var(--danger-bg);
}

.tag {
    display: inline-flex;
    gap: 6px;
    align-items: center;
    padding: 5px 9px;
    border-radius: 7px;
    font-size: var(--text-small);
    font-weight: 600;
    line-height: 1.35;
}

.operations-deck {
    display: grid;
    grid-template-columns: minmax(0, 1.8fr) minmax(300px, 1fr);
    gap: 22px;
    align-items: stretch;
    margin-bottom: 26px;
}

.operations-deck > section {
    margin-bottom: 0;
}

.attention-center .alert-list {
    max-height: 254px;
    overflow-y: auto;
}

.alert-counter {
    padding: 5px 10px;
    border-radius: 8px;
    color: var(--amber);
    background: var(--warning-bg);
    font-size: var(--text-small);
    font-weight: 650;
    white-space: nowrap;
}

.alert-group {
    margin: 0;
    padding: 10px 24px;
    border-bottom: 1px solid #edf1f7;
    color: var(--muted);
    background: #f8fafd;
    font-size: var(--text-small);
    font-weight: 550;
}

.alert-item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 16px 23px;
    border-bottom: 1px solid #edf1f7;
    color: var(--ink);
    transition: background 150ms;
}

.alert-item:last-child {
    border-bottom: 0;
}

.alert-item:hover {
    background: #f5f8ff;
    text-decoration: none;
}

.alert-item strong {
    display: block;
    font-size: var(--text-small);
    font-weight: 600;
}

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

.alert-dot {
    display: grid;
    width: 24px;
    height: 24px;
    flex: 0 0 24px;
    place-items: center;
    border-radius: 8px;
    color: var(--amber);
    background: var(--warning-bg);
    font-weight: 700;
}

.priority-0 .alert-dot {
    color: var(--red);
    background: var(--danger-bg);
}

.priority-2 .alert-dot {
    color: #2154ae;
    background: var(--blue-soft);
}

.alert-arrow {
    margin: 1px 0 0 auto;
    color: #536b8b;
}

.platform-card {
    position: relative;
    min-width: 0;
    margin-bottom: 22px;
    padding: 26px;
    overflow: hidden;
    border: 1px solid #244a80;
    border-radius: var(--radius);
    color: white;
    background: linear-gradient(125deg, #17385f, #244f89);
    box-shadow: 0 8px 22px #16375f13;
}

.platform-card > :not(.spotlight-orbit) {
    position: relative;
    z-index: 1;
}

.platform-card .eyebrow {
    margin: 24px 0 7px;
    color: #c9dcf7;
    font-weight: 550;
    letter-spacing: 0.9px;
}

.platform-card h2 {
    font-size: 20px;
}

.platform-card p {
    margin: 10px 0 24px;
    color: #d0dff4;
    font-size: var(--text-small);
}

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

.spotlight-icon {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border: 1px solid #ffffff30;
    border-radius: 12px;
    background: #ffffff0e;
}

.platform-count {
    padding: 6px 10px;
    border: 1px solid #ffffff30;
    border-radius: 8px;
    color: #e8f2ff;
    background: #ffffff09;
    font-size: var(--text-small);
}

.platform-total {
    display: block;
    margin-top: 8px;
    font-size: clamp(23px, 2vw, 31px);
    font-weight: 650;
    letter-spacing: -0.6px;
    overflow-wrap: anywhere;
}

.platform-empty {
    font-size: 23px;
}

.platform-card a {
    display: flex;
    gap: 9px;
    align-items: center;
    padding-top: 17px;
    border-top: 1px solid #ffffff26;
    color: #edf5ff;
    font-size: var(--text-small);
    font-weight: 550;
}

.spotlight-link > .icon:last-child {
    margin-left: auto;
}

.spotlight-orbit {
    position: absolute;
    top: -75px;
    right: -100px;
    width: 320px;
    height: 320px;
    border: 1px solid #a8cfff20;
    border-radius: 50%;
    box-shadow:
        0 0 0 35px #a8cfff08,
        0 0 0 70px #a8cfff06;
}

/* Filtros y tablas operativas. */
.filters {
    display: flex;
    gap: 10px;
    align-items: flex-end;
    margin-bottom: 22px;
    flex-wrap: wrap;
}

.filters > div {
    min-width: 0;
    flex: 1 1 140px;
}

.filters .filter-search {
    flex: 1.5 1 200px;
}

.filters label {
    display: block;
    margin-bottom: 6px;
    color: var(--muted);
    font-size: var(--text-small);
    font-weight: 600;
}

.board-filters {
    padding: 18px 22px;
    border-bottom: 1px solid var(--border);
    background: var(--surface-subtle);
}

.board-filters .filters {
    margin: 0;
}

.table-scroll,
.calendar-scroll {
    width: 100%;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scrollbar-color: var(--control-border) var(--surface-subtle);
}

.scroll-hint {
    display: flex;
    gap: 8px;
    align-items: center;
    margin: 0;
    padding: 10px 20px;
    border-bottom: 1px solid var(--border);
    color: var(--muted);
    background: var(--surface-subtle);
    font-size: var(--text-small);
}

.table-scroll:focus-visible,
.calendar-scroll:focus-visible {
    outline-offset: -3px;
}

/* Los estados conservan palabras completas; la tabla puede desplazarse. */
.table-scroll .tag {
    max-width: none;
    white-space: nowrap;
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: var(--text-small);
    font-variant-numeric: tabular-nums;
}

th {
    padding: 14px 20px;
    border-bottom: 1px solid #e5ebf4;
    color: var(--muted);
    background: var(--surface-subtle);
    font-size: var(--text-small);
    font-weight: 600;
    white-space: nowrap;
}

td {
    padding: 16px 20px;
    border-bottom: 1px solid #e8edf5;
    vertical-align: middle;
}

tbody tr:last-child td {
    border-bottom: 0;
}

tbody tr:hover,
tbody tr:focus-within {
    background: var(--blue-soft);
}

td small {
    display: block;
    margin-top: 5px;
    color: var(--muted);
    line-height: 1.5;
}

.imports-table {
    min-width: 1100px;
}

.imports-table th:first-child {
    width: 25%;
}

.reference {
    display: inline-block;
    font-size: var(--text-small);
    font-weight: 600;
    white-space: nowrap;
}

.row-supplier {
    display: flex;
    gap: 9px;
    align-items: center;
    margin-top: 8px;
}

.supplier-initial {
    display: grid;
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    place-items: center;
    border: 1px solid #dee6f3;
    border-radius: 8px;
    color: #365d93;
    background: #f0f5fc;
    font-weight: 650;
}

.cell-title {
    display: block;
    max-width: 250px;
    font-weight: 650;
    line-height: 1.5;
}

.product-label {
    display: block;
    margin: 3px 0;
    color: #405b7d;
    font-size: var(--text-small);
}

.doc-count {
    display: inline-block;
    min-width: 38px;
    padding: 3px 8px;
    border-radius: 6px;
    font-weight: 650;
    text-align: center;
}

.doc-progress {
    display: block;
    width: 95px;
    height: 6px;
    margin-top: 9px;
    accent-color: var(--blue);
}

.delay-text {
    color: var(--red);
    font-weight: 550;
}

.row-actions {
    min-width: 100px;
}

.row-actions summary {
    list-style: none;
}

.row-actions summary::-webkit-details-marker,
.correction summary::-webkit-details-marker {
    display: none;
}

.row-actions[open] {
    min-width: 145px;
}

.row-actions .button {
    width: 100%;
    justify-content: flex-start;
}

.row-actions a {
    margin-top: 8px;
}

/* Recorrido de las importaciones. */
.journey-card {
    border-bottom: 1px solid #e5ebf4;
}

.journey-card:last-child {
    border-bottom: 0;
}

.journey-card > summary {
    display: flex;
    gap: 14px;
    align-items: center;
    padding: 20px 24px;
    list-style: none;
}

.journey-card > summary:hover {
    background: #f7faff;
}

.journey-symbol {
    display: grid;
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    place-items: center;
    border: 1px solid #dbe5f7;
    border-radius: 12px;
    color: var(--blue);
    background: #f1f6ff;
}

.journey-identity {
    min-width: 0;
    flex: 1;
}

.journey-identity strong {
    display: block;
    font-size: var(--text-small);
    font-weight: 650;
}

.journey-identity small {
    display: block;
    margin-top: 3px;
    color: var(--muted);
}

.journey-toggle {
    color: var(--muted);
    transition: transform 180ms;
}

.journey-card[open] .journey-toggle {
    transform: rotate(45deg);
}

.tracking-row {
    padding: 15px 24px 25px;
    overflow-x: auto;
}

.stepper {
    display: flex;
    min-width: 900px;
    margin: 0;
    padding: 4px 0;
    list-style: none;
}

.stepper li {
    position: relative;
    display: flex;
    min-width: 0;
    flex: 1;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.stepper li::before {
    position: absolute;
    top: 14px;
    right: 50%;
    width: 100%;
    height: 2px;
    background: #dde6f2;
    content: "";
}

.stepper li:first-child::before {
    display: none;
}

.stepper .done::before {
    background: #83c9b0;
}

.step-dot {
    position: relative;
    display: grid;
    width: 29px;
    height: 29px;
    place-items: center;
    border: 2px solid #d5dfed;
    border-radius: 50%;
    color: #576e8a;
    background: white;
}

.step-dot .icon {
    width: 16px;
    height: 16px;
}

.done .step-dot {
    border-color: #299b76;
    color: white;
    background: #299b76;
}

.current .step-dot {
    border-color: var(--blue);
    color: white;
    background: var(--blue);
    box-shadow: 0 0 0 5px #edf3ff;
}

.stepper small {
    margin-top: 10px;
    padding: 0 6px;
    color: var(--muted);
    font-size: var(--text-small);
}

.stepper .current small {
    color: #1f50c5;
    font-weight: 650;
}

.stepper .step-date {
    margin-top: 5px;
    font-weight: 400;
}

.journey-open {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: flex-end;
    padding: 0 24px 18px;
    font-size: var(--text-small);
}

/* Formulario de compra como mesa de trabajo. */
.import-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 330px;
    gap: 24px;
    align-items: start;
}

.creation-workbench {
    margin-bottom: 0;
}

.workbench-nav,
.detail-section-nav {
    display: flex;
    gap: 5px;
    align-items: center;
    padding: 10px 18px;
    border-bottom: 1px solid var(--border);
    border-radius: 16px 16px 0 0;
    background: #fbfcff;
    overflow-x: auto;
}

.workbench-nav a,
.detail-section-nav a {
    display: inline-flex;
    min-height: 42px;
    gap: 8px;
    align-items: center;
    padding: 10px 15px;
    border: 1px solid transparent;
    border-radius: 9px;
    color: var(--muted);
    font-size: var(--text-small);
    font-weight: 550;
    white-space: nowrap;
    transition:
        background 160ms,
        color 160ms;
}

.workbench-nav a:hover,
.detail-section-nav a:hover {
    color: var(--blue);
    background: #f0f5ff;
    text-decoration: none;
}

.workbench-nav a.active,
.detail-section-nav a.active {
    border-color: #dce6fa;
    color: #2457c9;
    background: #eaf1ff;
}

.workbench-section {
    padding: 26px 28px 14px;
    border-bottom: 1px solid #e6ecf4;
    scroll-margin-top: 24px;
}

.section-heading {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 24px;
}

.section-heading > .icon,
.section-heading > .icon-button,
.section-kicker {
    margin-left: auto;
    color: #536b8a;
}

.section-heading p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: var(--text-small);
}

.section-number {
    display: grid;
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    place-items: center;
    border: 1px solid #d9e4f7;
    border-radius: 12px;
    color: #2c5ca6;
    background: #f2f6fd;
    font-size: var(--text-small);
    font-weight: 650;
}

.section-kicker {
    font-size: var(--text-small);
    letter-spacing: 0.5px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 18px;
}

.identity-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.money-fields {
    grid-template-columns: 95px minmax(0, 1fr) minmax(0, 1fr) 90px;
    gap: 0 14px;
}

.span-all,
.form-grid > .message {
    grid-column: 1 / -1;
}

.field {
    min-width: 0;
    margin-bottom: 18px;
}

.field label {
    display: block;
    margin-bottom: 7px;
    color: #324b68;
    font-size: var(--text-small);
    font-weight: 600;
}

.required {
    color: var(--red);
}

.control {
    display: block;
    width: 100%;
    min-width: 0;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid var(--control-border);
    border-radius: 9px;
    color: var(--ink);
    background: var(--panel);
    font-size: var(--text-body);
    line-height: 1.5;
    transition:
        border-color 150ms,
        box-shadow 150ms;
}

.control::placeholder {
    color: #5b6e87;
    opacity: 1;
}

.control:focus {
    border-color: var(--focus);
    box-shadow: 0 0 0 3px var(--blue-soft);
}

.control[readonly] {
    border-style: dashed;
    background: var(--surface-subtle);
}

.control:disabled {
    background: #edf2f8;
}

input[type="checkbox"].control {
    width: 19px;
    min-height: 19px;
    margin-top: 14px;
    accent-color: var(--blue);
}

select[multiple].control {
    min-height: 120px;
}

.help {
    display: block;
    margin-top: 7px;
    font-size: var(--text-small);
}

.error-text,
.errorlist,
.inline-errors {
    color: var(--red);
    font-size: var(--text-small);
}

.error-text {
    display: block;
    margin-top: 6px;
}

.field-error .control {
    border-color: #ca5368;
    background: #fffcfd;
}

.supplier-block {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    margin-bottom: 22px;
    padding: 17px 18px 0;
    border: 1px solid #dbe5f4;
    border-radius: 12px;
    background: linear-gradient(100deg, #f5f8ff, #fafcff);
}

.supplier-block-icon {
    display: grid;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    margin-top: 24px;
    place-items: center;
    border: 1px solid #d8e3f8;
    border-radius: 10px;
    color: #3864a7;
    background: #eaf1ff;
}

.supplier-block-field {
    min-width: 0;
    flex: 1;
}

.create-supplier {
    margin: -5px 0 18px;
}

.advance-agreement {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    margin: 4px 0 22px;
    padding: 18px 18px 0;
    border: 1px solid #dfe8f3;
    border-radius: 12px;
    background: #f8fafd;
}

.agreement-icon {
    display: grid;
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    margin-top: 25px;
    place-items: center;
    border: 1px solid #dde6f3;
    border-radius: 10px;
    color: #50709b;
    background: white;
}

.advance-agreement > div {
    min-width: 0;
    flex: 1;
}

.advance-agreement input {
    max-width: 170px;
}

.observation-disclosure {
    margin: 20px 0 10px;
    border: 1px solid #e1e8f2;
    border-radius: 10px;
    background: #fbfcfe;
}

.observation-disclosure > summary {
    display: flex;
    gap: 9px;
    align-items: center;
    padding: 15px;
    color: #365576;
    font-size: var(--text-small);
    font-weight: 550;
    list-style: none;
    flex-wrap: wrap;
}

.observation-disclosure summary > span {
    margin-left: auto;
    color: var(--muted);
    font-weight: 400;
}

.observation-disclosure > div {
    padding: 0 15px;
}

.quote-upload-heading {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    margin: 26px 0 18px;
}

.quote-upload-heading p {
    margin: 3px 0 0;
    color: var(--muted);
    font-size: var(--text-small);
}

.workbench-footnote {
    display: flex;
    gap: 9px;
    align-items: center;
    padding: 17px 28px;
    color: var(--muted);
    background: #fcfdff;
    border-radius: 0 0 16px 16px;
    font-size: var(--text-small);
}

.purchase-sidebar {
    position: sticky;
    top: 24px;
    min-width: 0;
}

.quote-summary {
    overflow: hidden;
}

.summary-masthead {
    position: relative;
    padding: 25px 24px 28px;
    overflow: hidden;
    color: white;
    background: linear-gradient(135deg, #173c6e, #225ad0);
}

.summary-masthead > :not(.summary-decoration) {
    position: relative;
    z-index: 1;
}

.summary-masthead .eyebrow {
    margin-bottom: 9px;
    color: #d5e4ff;
    font-weight: 500;
    letter-spacing: 0.8px;
}

.summary-masthead h2 {
    font-size: 20px;
}

.summary-supplier {
    display: flex;
    gap: 9px;
    align-items: center;
    margin: 22px 0;
    color: #e0ebff;
    font-size: var(--text-small);
}

.summary-supplier strong {
    font-weight: 450;
    overflow-wrap: anywhere;
}

.summary-total > span {
    color: #d9e6ff;
    font-size: var(--text-small);
}

.summary-total strong {
    display: block;
    margin-top: 6px;
    font-size: 30px;
    font-weight: 650;
    letter-spacing: -0.8px;
    overflow-wrap: anywhere;
}

.summary-decoration {
    position: absolute;
    right: -26px;
    bottom: -13px;
    color: #ffffff0b;
    transform: rotate(-12deg);
}

.summary-decoration .icon {
    width: 150px;
    height: 150px;
}

.summary-content {
    padding: 6px 24px 17px;
}

.summary-line {
    display: flex;
    gap: 10px;
    align-items: baseline;
    justify-content: space-between;
    margin-top: 18px;
    color: var(--muted);
    font-size: var(--text-small);
    flex-wrap: wrap;
}

.summary-line strong {
    color: var(--ink);
    font-weight: 600;
}

.summary-advance {
    margin: 20px -8px 0;
    padding: 14px;
    border: 1px solid #daebe4;
    border-radius: 11px;
    color: #285b4a;
    background: #f0f9f4;
}

.summary-advance > div {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: space-between;
    font-size: var(--text-small);
}

.summary-advance > strong {
    display: block;
    margin-top: 8px;
    color: #15583f;
    font-size: 21px;
    font-weight: 650;
}

.purchase-checklist {
    padding: 17px 24px;
    border-top: 1px solid #e6ecf4;
    background: #fcfdff;
}

.purchase-checklist h3 {
    margin-bottom: 14px;
    color: #36516f;
    font-size: var(--text-small);
}

.purchase-checklist > div {
    display: flex;
    gap: 9px;
    align-items: center;
    margin-top: 12px;
    color: var(--muted);
    font-size: var(--text-small);
}

.purchase-checklist small {
    margin-left: auto;
    font-size: var(--text-small);
}

.visual-check {
    display: grid;
    width: 19px;
    height: 19px;
    flex-shrink: 0;
    place-items: center;
    border: 1px solid #c9d6e7;
    border-radius: 50%;
    color: transparent;
    background: #eff3f8;
}

.visual-check .icon {
    width: 12px;
    height: 12px;
}

.is-complete .visual-check {
    border-color: #188362;
    color: white;
    background: #188362;
}

.purchase-checklist .is-complete small {
    color: var(--green);
}

.purchase-actions {
    padding: 18px 24px 20px;
    border-top: 1px solid #e6ecf4;
}

.purchase-actions .button {
    min-height: 46px;
}

.purchase-actions .button + .button {
    margin-top: 10px;
}

.summary-note {
    display: flex;
    gap: 9px;
    align-items: flex-start;
    margin: 17px 7px 0;
    color: var(--muted);
    font-size: var(--text-small);
    line-height: 1.7;
}

/* Buscadores y archivos: se conservan sus controles y eventos. */
.remote-picker {
    position: relative;
}

.picker-search {
    position: relative;
}

.picker-search > .icon {
    position: absolute;
    top: 13px;
    left: 13px;
    color: #587194;
}

.picker-search .control {
    min-height: 46px;
    padding-left: 43px;
    background: #ffffffed;
}

.picker-results {
    position: absolute;
    top: 49px;
    right: 0;
    left: 0;
    z-index: 40;
    max-height: 320px;
    overflow-y: auto;
    border: 1px solid #becfe8;
    border-radius: 12px;
    background: white;
    box-shadow: 0 14px 36px #19365120;
}

.picker-status {
    padding: 12px 15px;
    color: var(--muted);
    background: #fbfcff;
    font-size: var(--text-small);
}

.picker-results [role="option"] {
    display: flex;
    width: 100%;
    min-height: 47px;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    padding: 12px 15px;
    border: 0;
    border-top: 1px solid #e7edf5;
    color: var(--ink);
    background: white;
    text-align: left;
}

.picker-results [role="option"] > span:first-child {
    min-width: 0;
    overflow-wrap: anywhere;
}

.picker-results [role="option"]:hover,
.picker-results .is-active {
    background: #edf4ff;
}

.picker-results [aria-selected="true"] {
    background: #eef8f2;
}

.picker-add {
    flex-shrink: 0;
    padding: 3px 8px;
    border-radius: 6px;
    color: #2457c9;
    background: #edf3ff;
    font-size: var(--text-small);
    font-weight: 600;
}

.picker-results [aria-selected="true"] .picker-add {
    color: var(--green);
    background: #e3f3ea;
}

.picker-more {
    width: 100%;
    padding: 14px;
}

.selection-heading {
    display: flex;
    gap: 9px;
    align-items: center;
    margin-top: 18px;
    color: #38516e;
    font-size: var(--text-small);
}

.selection-count {
    display: inline-grid;
    min-width: 25px;
    min-height: 25px;
    padding: 2px 6px;
    place-items: center;
    border-radius: 7px;
    color: #305895;
    background: #eaf1ff;
    font-weight: 650;
}

.selection-help,
.selection-empty {
    margin: 8px 0;
    color: var(--muted);
    font-size: var(--text-small);
}

.picker-selected {
    display: flex;
    gap: 9px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.selected-chip {
    display: inline-flex;
    max-width: 100%;
    gap: 10px;
    align-items: center;
    padding: 7px 7px 7px 13px;
    border: 1px solid #cbdaf0;
    border-left: 3px solid #6995e5;
    border-radius: 9px;
    color: #234a80;
    background: #f2f6ff;
    font-size: var(--text-small);
    overflow-wrap: anywhere;
    animation: chip-in 160ms ease-out;
}

.selected-chip .icon-button {
    min-width: 29px;
    min-height: 29px;
    padding: 5px;
    border: 0;
    background: #e4edfc;
}

.selected-chip .icon {
    width: 16px;
    height: 16px;
}

.upload-zone {
    padding: 22px;
    border: 1.5px dashed #98b5df;
    border-radius: 13px;
    background: linear-gradient(120deg, #f4f8ff, #fafcff);
    transition:
        border-color 150ms,
        background 150ms;
}

.upload-heading {
    display: flex;
    gap: 13px;
    align-items: center;
    margin-bottom: 18px;
}

.upload-heading strong {
    font-size: 15px;
    font-weight: 650;
}

.upload-heading p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: var(--text-small);
}

.upload-icon {
    display: grid;
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    place-items: center;
    border: 1px solid #d0e0f8;
    border-radius: 13px;
    color: var(--blue);
    background: #e8f0ff;
}

.upload-zone input[type="file"] {
    min-height: 40px;
    padding: 0;
    border: 0;
    background: transparent;
}

.upload-zone input[type="file"]::file-selector-button {
    min-height: 40px;
    margin-right: 12px;
    padding: 9px 15px;
    border: 1px solid #bfd2f1;
    border-radius: 8px;
    color: #2457b8;
    background: #e9f1ff;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.upload-zone input[type="file"]::file-selector-button:hover {
    border-color: #81a5e8;
    background: #dfebff;
}

.upload-zone > p {
    margin: 12px 0 0;
    color: var(--muted);
    font-size: var(--text-small);
}

.upload-zone > .icon {
    margin-bottom: 10px;
    color: var(--blue);
}

.upload-zone.dragover,
.upload-zone:focus-within {
    border-color: var(--blue);
    background: #eaf2ff;
}

.upload-preview {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-top: 14px;
    color: #345371;
    font-size: var(--text-small);
    overflow-wrap: anywhere;
}

.upload-preview img {
    width: 64px;
    height: 64px;
    border: 3px solid white;
    border-radius: 10px;
    box-shadow: 0 2px 8px #1e3c6612;
    object-fit: contain;
}

.upload-clear {
    margin-top: 12px;
}

.upload-existing-clear {
    display: flex;
    gap: 8px;
    align-items: center;
    margin: 12px 0;
}

.supplier-modal {
    width: min(550px, calc(100% - 32px));
    max-height: 90vh;
    padding: 28px;
    border: 1px solid #d6e1ef;
    border-radius: 18px;
    color: var(--ink);
    box-shadow: 0 30px 100px #10263f45;
}

.supplier-modal::backdrop {
    background: #0c203b88;
    backdrop-filter: blur(5px);
}

/* Expediente y navegación entre sus secciones. */
.shipment-heading {
    position: relative;
    margin-bottom: 20px;
    padding: 25px 28px;
    border: 1px solid #d9e4f4;
    border-radius: 17px;
    background: linear-gradient(120deg, #eaf1ff, #f9fbff 80%);
}

.shipment-heading .eyebrow {
    color: #2b59a2;
}

.shipment-heading h1 {
    max-width: 750px;
    font-size: 29px;
}

.detail-section-nav {
    margin-bottom: 22px;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: white;
}

[data-workspace-section] {
    scroll-margin-top: 25px;
}

.detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 350px;
    gap: 22px;
    align-items: start;
}

.detail-grid > div {
    min-width: 0;
}

.overview-panel {
    display: flex;
    gap: 24px;
    align-items: flex-start;
    justify-content: space-between;
    padding: 23px 26px;
    flex-wrap: wrap;
}

.overview-panel > div {
    min-width: 100px;
    max-width: 240px;
}

.overview-panel small,
.balance-grid small {
    display: block;
    margin-bottom: 6px;
    color: var(--muted);
    font-size: var(--text-small);
}

.overview-panel strong {
    font-size: var(--text-small);
    font-weight: 600;
}

.account-block {
    padding: 24px;
    border-bottom: 1px solid var(--border);
}

.account-block:last-child {
    border-bottom: 0;
}

.account-heading {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 20px;
}

.account-heading strong {
    font-size: 16px;
    font-weight: 650;
}

.account-heading p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: var(--text-small);
}

.balance-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 20px;
    padding: 17px;
    border: 1px solid #e0e8f4;
    border-radius: 11px;
    background: #f7faff;
}

.balance-grid strong {
    font-size: 18px;
    font-weight: 650;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.4px;
    overflow-wrap: anywhere;
}

.balance-grid > div:first-child > strong {
    color: #285bc0;
}

.balance-grid strong + small {
    margin: 6px 0 0;
    font-size: var(--text-small);
}

.green-text {
    color: var(--green);
}

.anticipo-strip {
    display: flex;
    gap: 12px 18px;
    margin-bottom: 18px;
    padding: 13px 15px;
    border: 1px solid #dcebe4;
    border-radius: 10px;
    color: #356752;
    background: #f0f8f3;
    font-size: var(--text-small);
    flex-wrap: wrap;
}

.payment-table {
    min-width: 650px;
}

.payment-table th,
.payment-table td {
    padding: 12px 10px;
}

.payment-table td:nth-child(2) {
    white-space: nowrap;
}

.table-actions {
    display: flex;
    min-width: 190px;
    gap: 8px;
    align-items: flex-start;
    flex-wrap: wrap;
}

.table-actions .button {
    white-space: nowrap;
}

.correction {
    color: var(--red);
    font-size: var(--text-small);
}

.correction > summary {
    list-style: none;
}

.correction form {
    min-width: 160px;
    margin-top: 10px;
}

.correction button {
    margin-top: 9px;
}

.account-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-top: 18px;
    font-size: var(--text-small);
    flex-wrap: wrap;
}

.documentation-progress {
    padding: 20px 23px 10px;
    color: var(--muted);
    font-size: var(--text-small);
}

.documentation-progress strong {
    color: var(--blue);
    font-size: 24px;
    font-weight: 650;
}

.documentation-progress progress {
    display: block;
    width: 100%;
    height: 7px;
    margin-top: 12px;
    accent-color: var(--blue);
}

.checklist {
    margin: 0;
    padding: 7px 20px 15px;
    list-style: none;
}

.checklist li {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 12px 2px;
    border-bottom: 1px solid #edf1f6;
    font-size: var(--text-small);
}

.checklist li:last-child {
    border-bottom: 0;
}

.requirement-text {
    min-width: 0;
    flex: 1;
}

.checklist small {
    display: block;
    margin-top: 3px;
    color: var(--muted);
    font-size: var(--text-small);
}

.check-icon {
    display: grid;
    width: 29px;
    height: 29px;
    flex-shrink: 0;
    place-items: center;
    border-radius: 9px;
    color: #526a88;
    background: #edf2f8;
}

.check-icon .icon {
    width: 16px;
    height: 16px;
}

.check-icon.checked {
    color: var(--green);
    background: #e5f4ec;
}

.check-icon.missing {
    color: var(--amber);
    background: #fff2d9;
}

.document-action {
    margin-left: auto;
    flex-shrink: 0;
}

.future-documents {
    margin: 0 20px 20px;
    border: 1px solid #e0e7f2;
    border-radius: 10px;
    background: #fbfcff;
}

.future-documents > summary {
    display: flex;
    gap: 8px;
    align-items: center;
    padding: 13px 11px;
    color: #405d7f;
    font-size: var(--text-small);
    list-style: none;
}

.future-documents .checklist {
    padding-right: 12px;
    padding-left: 12px;
}

.document-list {
    padding: 0 23px 17px;
}

.document-item {
    padding: 15px 0;
    border-top: 1px solid #e4ebf5;
    font-size: var(--text-small);
    overflow-wrap: anywhere;
}

.document-item strong {
    font-weight: 550;
}

.document-item small {
    display: block;
    margin-top: 6px;
    color: var(--muted);
}

.superseded {
    color: var(--muted);
}

.timeline {
    margin: 0;
    padding: 23px;
    list-style: none;
}

.timeline li {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 18px;
}

.timeline li:last-child {
    margin-bottom: 0;
}

.timeline strong {
    font-size: var(--text-small);
    font-weight: 450;
    line-height: 1.6;
}

.timeline small {
    display: block;
    margin-top: 5px;
    color: var(--muted);
}

.timeline-dot {
    width: 9px;
    height: 9px;
    flex-shrink: 0;
    margin: 7px 4px 0;
    border-radius: 50%;
    background: #6491d6;
    box-shadow: 0 0 0 4px #edf3fd;
}

.notes {
    margin: 0;
    padding: 22px;
    font-size: var(--text-small);
    overflow-wrap: anywhere;
}

.document-options {
    display: grid;
    gap: 11px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fbfcff;
}

.document-options label {
    display: flex;
    gap: 10px;
    align-items: center;
    margin: 0;
    font-weight: 400;
}

.document-options input {
    width: 18px;
    height: 18px;
    accent-color: var(--blue);
}

/* Calendario y pantallas auxiliares. */
.calendar-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 310px;
    gap: 22px;
    align-items: start;
}

.calendar-grid {
    display: grid;
    min-width: 800px;
    grid-template-columns: repeat(7, minmax(0, 1fr));
}

.weekday {
    padding: 13px 10px;
    border-bottom: 1px solid var(--border);
    color: #526783;
    background: #f7f9fd;
    font-size: var(--text-small);
    text-align: center;
}

.calendar-day {
    min-height: 140px;
    padding: 9px 7px;
    border-right: 1px solid #e7edf6;
    border-bottom: 1px solid #e7edf6;
}

.day-number {
    display: grid;
    width: 29px;
    height: 29px;
    margin: 0 0 8px 2px;
    place-items: center;
    color: var(--muted);
    font-size: var(--text-small);
}

.is-today .day-number {
    border-radius: 9px;
    color: white;
    background: var(--blue);
    font-weight: 650;
}

.is-today {
    background: #fbfcff;
}

.outside {
    background: #f6f8fc;
}

.calendar-event {
    display: block;
    margin-bottom: 7px;
    padding: 10px 8px;
    border: 1px solid #d4e3fa;
    border-left: 3px solid #6596e4;
    border-radius: 8px;
    color: #28568e;
    background: #edf4ff;
    font-size: var(--text-small);
    overflow-wrap: anywhere;
}

.calendar-event strong,
.calendar-event span,
.calendar-event small {
    display: block;
}

.calendar-event:hover,
.calendar-event:focus-visible {
    border-color: var(--blue);
    background: var(--blue-soft);
    text-decoration: none;
}

.calendar-event strong {
    font-weight: 600;
}

.calendar-event small {
    margin-top: 5px;
    color: #466486;
}

.previous-arrow {
    display: inline-flex;
    transform: rotate(180deg);
}

.supplier-group {
    border-bottom: 1px solid var(--border);
}

.supplier-group summary {
    display: flex;
    gap: 12px;
    justify-content: space-between;
    padding: 20px;
    color: #425d7f;
    font-size: var(--text-small);
    list-style: none;
}

.supplier-group summary strong {
    display: block;
    margin-top: 7px;
    color: var(--ink);
    font-size: 17px;
}

.supplier-payment {
    display: block;
    padding: 16px 20px;
    border-top: 1px solid #e3ebf7;
    background: #f4f8ff;
    font-size: var(--text-small);
}

.supplier-payment span,
.supplier-payment small {
    display: block;
    margin-top: 5px;
    color: var(--muted);
}

.form-panel {
    max-width: 1050px;
    padding: 28px;
}

.form-footer {
    display: flex;
    gap: 14px;
    align-items: center;
    justify-content: space-between;
    padding-top: 22px;
    border-top: 1px solid var(--border);
    font-size: var(--text-small);
}

.message {
    margin-bottom: 18px;
    padding: 14px 17px;
    border: 1px solid #d0dff7;
    border-radius: 10px;
    color: #315989;
    background: #edf4ff;
    font-size: var(--text-small);
}

.message.error {
    border-color: #edc5ce;
    color: #a62c41;
    background: #fff2f4;
}

.message.success {
    border-color: #c9e5d8;
    color: #17634a;
    background: #edf8f1;
}

.message ul {
    margin: 0;
    padding-left: 18px;
}

.empty {
    padding: 35px 24px;
    text-align: center;
}

.empty strong {
    display: block;
    margin-top: 12px;
    font-size: 16px;
    font-weight: 600;
}

.empty p {
    max-width: 430px;
    margin: 8px auto 0;
    color: var(--muted);
    font-size: var(--text-small);
    line-height: 1.7;
}

.empty-symbol {
    width: 52px;
    height: 52px;
    margin: 0 auto;
    color: #3468b8;
    background: #edf3ff;
}

.empty .button {
    margin-top: 20px;
}

.empty-check {
    display: inline-grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border-radius: 50%;
    color: var(--green);
    background: var(--success-bg);
}

.padded {
    padding: 25px;
}

.padded > h2 {
    margin-bottom: 22px;
}

.footer {
    display: flex;
    gap: 16px;
    justify-content: space-between;
    max-width: 1740px;
    margin: auto;
    padding: 8px 32px 27px;
    color: var(--muted);
    font-size: var(--text-small);
    flex-wrap: wrap;
}

.swal2-popup {
    border-radius: 16px;
    font-family: inherit;
}

.login-workspace {
    min-height: 100vh;
    background: radial-gradient(ellipse at top left, #dfebff, #f3f6fb 65%);
}

.login-layout {
    display: grid;
    max-width: 1040px;
    min-height: calc(100vh - 64px);
    grid-template-columns: 1.1fr 1fr;
    gap: 32px;
    align-items: center;
    margin: auto;
}

.login-intro {
    padding: 40px;
    border-radius: 24px;
    color: var(--panel);
    background: var(--navy);
}

.login-intro .eyebrow {
    color: #c5d5e9;
}

.login-steps span {
    padding: 6px 10px;
    border: 1px solid #62758d;
    border-radius: 6px;
}

.password-control {
    position: relative;
}

.password-control .control {
    padding-right: 100px;
}

.password-toggle {
    position: absolute;
    top: 1px;
    right: 1px;
    min-height: 44px;
    padding: 8px 12px;
    border: 0;
    border-radius: 8px;
    color: var(--blue);
    background: transparent;
    font-size: var(--text-small);
    font-weight: 600;
}

.password-toggle:hover {
    background: var(--blue-soft);
}

.suppliers-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(300px, 1fr);
    gap: 24px;
    align-items: start;
}

.supplier-create {
    scroll-margin-top: 24px;
}

.supplier-create > p {
    color: var(--muted);
    font-size: var(--text-small);
}

.login-intro h1 {
    max-width: 460px;
    font-size: 48px;
    letter-spacing: -2px;
}

.login-intro p {
    max-width: 380px;
    margin-top: 22px;
    color: #c5d5e9;
    line-height: 1.8;
}

.login-steps {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 35px;
    color: #c5d5e9;
    font-size: var(--text-small);
}

.login-card {
    padding: 38px;
    border: 1px solid #d8e3f3;
    border-radius: 20px;
    background: #ffffffed;
    box-shadow: 0 18px 70px #1838590c;
}

.login-card h2 {
    margin: 24px 0 10px;
    font-size: 27px;
}

.login-card > p {
    margin-bottom: 25px;
    color: var(--muted);
    font-size: var(--text-small);
}

.login-card .login-note {
    margin: 24px 0 0;
    text-align: center;
}

/* Transición de entrada breve, sin ocultar contenido ni demorar enlaces. */
@keyframes workspace-enter {
    from {
        opacity: 0.96;
        transform: translateY(4px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

/* Respuestas de la interfaz, sin alterar los controles. */
@keyframes chip-in {
    from {
        opacity: 0;
        transform: translateY(3px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.sidebar-collapsed .sidebar {
    width: 80px;
    padding-right: 10px;
    padding-left: 10px;
}

.sidebar-collapsed .workspace {
    margin-left: 80px;
}

.sidebar-collapsed .brand-label,
.sidebar-collapsed .nav-label,
.sidebar-collapsed .nav-caption,
.sidebar-collapsed .sidebar-bottom > div,
.sidebar-collapsed .sidebar-bottom .avatar {
    display: none;
}

.sidebar-collapsed .nav-link {
    justify-content: center;
}

.sidebar-collapsed .sidebar-bottom {
    justify-content: center;
    margin-top: auto;
}

.sidebar-collapsed .brand {
    margin-bottom: 25px;
    padding: 0;
    justify-content: center;
}

.sidebar-collapsed .nav-link.active::after {
    display: none;
}

@media (max-width: 1450px) {
    .today {
        display: none;
    }

    .identity-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .money-fields {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .calendar-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .calendar-layout > div {
        display: grid;
        grid-template-columns: 1fr 2fr;
        gap: 22px;
        align-items: start;
    }
}

@media (max-width: 1250px) {
    :root {
        --sidebar-width: 210px;
    }

    .brand {
        gap: 8px;
        padding: 0;
        font-size: 18px;
    }

    .main {
        padding: 26px;
    }

    .topbar {
        padding-right: 26px;
        padding-left: 26px;
    }

    .import-layout {
        grid-template-columns: minmax(0, 1fr) 300px;
        gap: 18px;
    }

    .workbench-section {
        padding-right: 22px;
        padding-left: 22px;
    }

    .identity-grid,
    .import-form .form-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .metric {
        gap: 10px;
        padding: 18px;
    }

    .metric-arrow {
        right: 18px;
    }

    .metric-icon {
        width: 34px;
        height: 34px;
    }

    .detail-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 1080px) {
    .import-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .purchase-sidebar {
        position: static;
    }

    .import-form .form-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .suppliers-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .summary-content {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0 24px;
    }

    .summary-advance {
        grid-row: span 2;
        margin: 15px 0 0;
    }

    .metric-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .operations-deck {
        grid-template-columns: minmax(0, 1fr) 280px;
    }

    .page-context {
        display: none;
    }

    .breadcrumb {
        flex: 1;
    }

    .login-layout {
        gap: 35px;
    }
}

@media (max-width: 760px) {
    .sidebar {
        position: static;
        width: 100%;
        padding: 17px 18px;
        max-height: none;
        overflow: visible;
    }

    .brand {
        gap: 10px;
        font-size: 20px;
    }

    .brand-mark {
        width: 37px;
        height: 40px;
    }

    .brand small {
        font-size: var(--text-small);
    }

    .nav-caption {
        display: none;
    }

    .sidebar-bottom {
        display: flex;
    }

    .js-navigation .sidebar-bottom {
        display: none;
    }

    .sidebar nav {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        margin-top: 20px;
    }

    .js-navigation .sidebar nav {
        display: none;
    }

    .sidebar .mobile-menu-toggle {
        display: inline-flex;
        flex-shrink: 0;
        border-color: #62758d;
        color: white;
        background: transparent;
    }

    .mobile-menu-toggle:hover {
        color: white;
        background: #ffffff18;
    }

    #toggle-sidebar {
        display: none;
    }

    .mobile-nav-open .sidebar nav {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 7px;
        margin-top: 20px;
    }

    .mobile-nav-open .sidebar-bottom {
        display: flex;
        margin-top: 17px;
    }

    .mobile-nav-open .nav-link {
        margin-bottom: 0;
    }

    .workspace,
    .sidebar-collapsed .workspace {
        margin-left: 0;
    }

    .sidebar-collapsed .sidebar {
        width: 100%;
        padding: 17px 18px;
    }

    .sidebar-collapsed .brand {
        margin-bottom: 0;
        justify-content: flex-start;
    }

    .sidebar-collapsed .brand-label,
    .sidebar-collapsed .nav-label {
        display: inline;
    }

    .sidebar-collapsed .nav-link {
        justify-content: flex-start;
    }

    .topbar {
        min-height: 68px;
        gap: 10px;
        padding: 12px 16px;
        flex-wrap: wrap;
    }

    .global-search {
        min-width: 0;
        max-width: none;
        flex-basis: 100%;
    }

    .global-search input {
        font-size: var(--text-body);
    }

    .import-form .form-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .button.small,
    .icon-button,
    .selected-chip .icon-button {
        min-width: 44px;
        min-height: 44px;
    }

    .tag {
        max-width: 100%;
        white-space: normal;
        overflow-wrap: anywhere;
    }

    .workbench-nav,
    .detail-section-nav {
        flex-wrap: wrap;
    }

    .main {
        padding: 25px 16px;
    }

    .page-heading {
        gap: 18px;
        align-items: flex-start;
        margin-bottom: 22px;
        flex-direction: column;
    }

    .eyebrow {
        letter-spacing: 0.7px;
    }

    .page-heading p {
        font-size: var(--text-small);
    }

    .metric-grid {
        gap: 12px;
    }

    .metric {
        min-height: 165px;
        padding: 16px;
    }

    .metric-icon {
        display: none;
    }

    .metric strong {
        margin-top: 12px;
        font-size: 31px;
    }

    .metric small {
        display: block;
        max-width: 120px;
    }

    .metric-arrow {
        right: 13px;
        bottom: 13px;
    }

    .operations-deck,
    .form-grid,
    .calendar-layout > div,
    .summary-content {
        grid-template-columns: minmax(0, 1fr);
    }

    .attention-center .alert-list {
        max-height: 310px;
    }

    .panel-heading {
        gap: 12px;
        padding: 18px;
        flex-wrap: wrap;
    }

    .panel-heading > .tag {
        display: none;
    }

    .heading-with-icon {
        gap: 10px;
    }

    .heading-icon {
        width: 34px;
        height: 34px;
    }

    .alert-counter {
        margin-left: auto;
    }

    .platform-card {
        padding: 23px;
    }

    .board-filters {
        padding: 16px;
    }

    .filters > div {
        flex-basis: 125px;
    }

    .workbench-nav {
        gap: 2px;
        padding: 9px;
    }

    .workbench-nav a {
        gap: 6px;
        padding: 9px 10px;
    }

    .workbench-nav .icon {
        width: 17px;
        height: 17px;
        flex-basis: 17px;
    }

    .workbench-section {
        padding: 22px 18px 12px;
    }

    .section-kicker {
        display: none;
    }

    .section-heading {
        gap: 10px;
    }

    .supplier-block {
        gap: 9px;
        padding: 14px 13px 0;
    }

    .supplier-block-icon {
        display: none;
    }

    .observation-disclosure summary > span {
        margin: 3px 0 0 29px;
    }

    .advance-agreement {
        gap: 10px;
        padding: 15px 13px 0;
    }

    .agreement-icon {
        width: 30px;
        height: 34px;
    }

    .workbench-footnote {
        padding: 17px 18px;
    }

    .upload-zone {
        padding: 17px;
    }

    .upload-heading {
        align-items: flex-start;
        gap: 10px;
    }

    .upload-icon {
        width: 34px;
        height: 36px;
    }

    .summary-content {
        display: block;
    }

    .summary-advance {
        margin: 20px -5px 0;
    }

    .journey-card > summary {
        gap: 10px;
        padding: 18px;
        flex-wrap: wrap;
    }

    .journey-identity {
        flex-basis: calc(100% - 65px);
    }

    .journey-card summary > .tag {
        margin-left: 52px;
    }

    .journey-toggle {
        margin-left: auto;
    }

    .tracking-row {
        padding: 12px 15px 20px;
    }

    .shipment-heading {
        padding: 22px;
    }

    .shipment-heading h1 {
        font-size: 27px;
    }

    .overview-panel {
        gap: 20px;
        padding: 22px;
    }

    .balance-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .account-block {
        padding: 19px;
    }

    .account-heading {
        flex-wrap: wrap;
    }

    .form-panel {
        padding: 22px;
    }

    .form-footer {
        align-items: flex-start;
        flex-direction: column;
    }

    .form-footer .actions {
        width: 100%;
        justify-content: flex-end;
    }

    .footer {
        padding-right: 18px;
        padding-left: 18px;
    }

    .login-layout {
        min-height: 85vh;
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .login-intro {
        padding: 24px;
    }

    .login-intro h1 {
        font-size: 36px;
    }

    .login-intro p,
    .login-steps {
        display: none;
    }

    .login-card {
        padding: 27px;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    .button,
    .metric,
    .nav-link,
    .journey-toggle,
    .control,
    .upload-zone {
        transition: none;
    }

    .main,
    .selected-chip {
        animation: none;
    }
}

/* Costos y liquidación: importes registrados, separados de sus pagos. */
.cost-overview {
    overflow: hidden;
}

.cost-symbol,
.cost-count-icon {
    display: grid;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    place-items: center;
    border-radius: 12px;
    color: var(--blue);
    background: var(--blue-soft);
}

.cost-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    padding: 24px;
}

.cost-grid > div {
    min-width: 0;
}

.cost-label {
    display: block;
    margin-bottom: 8px;
    color: var(--muted);
    font-size: var(--text-small);
}

.cost-grid strong {
    display: block;
    font-size: clamp(19px, 1.6vw, 25px);
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
}

.cost-percentage strong,
.cost-ratio {
    color: #1d50bc;
}

.cost-percentage {
    padding-left: 18px;
    border-left: 2px solid #d7e3ff;
}

.cost-formula {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    margin: 0;
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    color: var(--muted);
    background: #f8faff;
    font-size: var(--text-small);
}

.cost-note {
    margin: 18px 24px 0;
}

.cost-payment-strip {
    display: flex;
    gap: 12px 32px;
    padding: 0 24px 20px;
    flex-wrap: wrap;
    color: var(--muted);
    font-size: var(--text-small);
}

.cost-payment-strip strong {
    color: var(--ink);
}

.cost-counts {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.cost-counts article {
    display: flex;
    gap: 14px;
    align-items: center;
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: white;
}

.cost-counts strong {
    display: block;
    font-size: 28px;
    line-height: 1.2;
}

.cost-counts article div > span {
    display: block;
    margin-top: 5px;
    color: var(--muted);
    font-size: var(--text-small);
}

.cost-filters {
    padding: 22px;
}

.cost-filter-fields {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0 20px;
}

.cost-filters > p {
    margin: 16px 0 0;
    font-size: var(--text-small);
}

.cost-analysis-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr);
    gap: 22px;
}

.cost-analysis-grid > section {
    min-width: 0;
}

.cost-comparison-table {
    min-width: 1250px;
}

.cost-comparison-table .table-actions {
    min-width: 120px;
}

.liquidation-header {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    justify-content: space-between;
    padding: 28px;
    border-bottom: 1px solid var(--border);
}

.liquidation-header h2 {
    margin: 0;
    font-size: 26px;
}

.liquidation-header p {
    margin: 10px 0 0;
    color: var(--muted);
}

.report-date {
    text-align: right;
}

.report-date small {
    display: block;
    margin-top: 12px;
    color: var(--muted);
}

.report-identity {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
    margin: 0;
    padding: 24px;
    border-bottom: 1px solid var(--border);
}

.report-identity dt {
    color: var(--muted);
    font-size: var(--text-small);
}

.report-identity dd {
    margin: 5px 0 0;
    font-weight: 650;
    overflow-wrap: anywhere;
}

.report-identity small {
    display: block;
    color: var(--muted);
    font-weight: normal;
}

.report-products {
    grid-column: 1 / -1;
}

.liquidation-table {
    min-width: 1000px;
}

.liquidation-table td,
.liquidation-table th {
    padding: 14px;
}

.liquidation-table td:nth-child(n+3):nth-child(-n+7) {
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.liquidation-table .button {
    margin-top: 8px;
}

@media (max-width: 1100px) {
    .cost-counts,
    .cost-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .cost-analysis-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 650px) {
    .cost-filter-fields,
    .report-identity {
        grid-template-columns: minmax(0, 1fr);
    }

    .cost-counts {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .cost-counts article {
        padding: 14px;
        flex-direction: column;
        align-items: flex-start;
    }

    .cost-grid {
        gap: 20px 14px;
        padding: 20px;
    }

    .cost-percentage {
        padding-left: 0;
        border-left: 0;
    }

    .liquidation-header {
        flex-direction: column;
        padding: 22px;
    }

    .report-date {
        text-align: left;
    }
}

@media print {
    @page {
        size: A4 landscape;
        margin: 12mm;
    }

    .sidebar,
    .topbar,
    .footer,
    .print-actions,
    .messages,
    .scroll-hint,
    .skip-link {
        display: none !important;
    }

    body,
    .workspace,
    .sidebar-collapsed .workspace,
    .main {
        min-height: 0;
        margin: 0;
        padding: 0;
        width: 100%;
        max-width: none;
        background: white;
    }

    .main {
        animation: none;
    }

    .liquidation-report {
        border: 0;
        box-shadow: none;
    }

    .table-scroll {
        overflow: visible;
    }

    body {
        font-size: 13px;
    }

    .liquidation-header h2 {
        font-size: 22px;
    }

    .liquidation-report > .panel-heading {
        min-height: 52px;
        padding: 12px 0;
    }

    .liquidation-report > .panel-heading h2 {
        font-size: 17px;
    }

    .liquidation-report > .panel-heading p,
    .report-identity dt {
        font-size: 12px;
    }

    .cost-grid strong {
        font-size: 20px;
    }

    .cost-label {
        font-size: 12px;
    }

    .cost-formula {
        padding: 10px 12px;
        font-size: 11px;
    }

    .liquidation-table {
        width: 100%;
        min-width: 0;
        font-size: 12px;
    }

    .liquidation-table th,
    .liquidation-table td {
        padding: 7px;
        white-space: normal;
        font-size: 12px;
    }

    .liquidation-table td:nth-child(n+3):nth-child(-n+7) {
        white-space: normal;
    }

    .cost-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        padding: 16px 0;
    }

    .report-identity {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 12px;
        padding: 12px 0;
    }

    .liquidation-header {
        padding: 0 0 16px;
    }

    tr {
        break-inside: avoid;
    }

    thead {
        display: table-header-group;
    }
}

/* Liquidaciones: lista compacta, con pagos y acciones al abrir una fila. */
.liquidation-workspace {
    padding: 24px;
    border-top: 1px solid var(--border);
}

.liquidation-list-heading {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 16px;
}

.liquidation-list-heading > div {
    min-width: 0;
}

.liquidation-list-heading h3 {
    display: flex;
    gap: 8px;
    align-items: center;
    margin: 0;
    font-size: 19px;
}

.liquidation-list-heading p {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: var(--text-small);
}

.liquidation-list-heading > .button {
    flex-shrink: 0;
}

.liquidation-column-headings,
.liquidation-summary {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) repeat(3, minmax(0, 1fr)) minmax(0, 1.3fr);
    gap: 12px;
    align-items: center;
}

.liquidation-column-headings {
    padding: 10px 16px;
    color: var(--muted);
    font-size: var(--text-small);
    font-weight: 600;
}

.liquidation-list {
    border: 1px solid var(--border);
    border-radius: 12px;
}

.liquidation-row + .liquidation-row {
    border-top: 1px solid var(--border);
}

.liquidation-summary {
    min-height: 84px;
    padding: 14px 16px;
    border-radius: 10px;
    list-style: none;
    transition: background 160ms ease-out;
}

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

.liquidation-summary:hover,
.liquidation-row[open] > .liquidation-summary {
    background: var(--blue-soft);
}

.liquidation-summary:focus-visible {
    outline-offset: -3px;
}

.liquidation-identity,
.liquidation-amount,
.liquidation-row-state {
    min-width: 0;
    overflow-wrap: anywhere;
}

.liquidation-identity > strong {
    display: block;
    margin-bottom: 6px;
    color: var(--ink);
    font-size: 16px;
    line-height: 1.4;
}

.liquidation-identity > span {
    display: flex;
    gap: 6px;
    align-items: flex-start;
    color: var(--muted);
    font-size: var(--text-small);
}

.liquidation-identity .icon {
    width: 16px;
    height: 16px;
    flex-basis: 16px;
    margin-top: 2px;
}

.liquidation-amount {
    color: var(--ink);
    font-size: var(--text-small);
    font-variant-numeric: tabular-nums;
}

.liquidation-paid {
    color: var(--green);
}

.liquidation-mobile-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

.liquidation-row-state .tag {
    max-width: 100%;
    white-space: normal;
}

.liquidation-disclosure {
    display: inline-flex;
    gap: 6px;
    align-items: center;
    min-height: 36px;
    margin-top: 5px;
    padding: 6px 8px;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--blue);
    background: var(--panel);
    font-size: var(--text-small);
    font-weight: 600;
    line-height: 1.4;
}

.liquidation-disclosure .icon {
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
    transition: transform 160ms ease-out;
    transform: rotate(90deg);
}

.liquidation-open-label,
.liquidation-row[open] .liquidation-closed-label {
    display: none;
}

.liquidation-row[open] .liquidation-open-label {
    display: inline;
}

.liquidation-row[open] .liquidation-disclosure .icon {
    transform: rotate(-90deg);
}

.liquidation-detail {
    padding: 20px 16px;
    border-top: 1px solid var(--border);
}

.liquidation-row[open] .liquidation-detail {
    animation: workspace-enter 160ms ease-out;
}

@media (max-width: 767px) {
    .liquidation-workspace {
        padding: 20px 16px;
    }

    .liquidation-list-heading {
        flex-wrap: wrap;
    }

    .liquidation-column-headings {
        display: none;
    }

    .liquidation-summary {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 14px 10px;
        padding: 16px;
    }

    .liquidation-identity,
    .liquidation-row-state {
        grid-column: 1 / -1;
    }

    .liquidation-mobile-label {
        position: static;
        display: block;
        width: auto;
        height: auto;
        margin-bottom: 5px;
        overflow: visible;
        clip-path: none;
        color: var(--muted);
        white-space: normal;
        font-size: var(--text-small);
    }

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

    .liquidation-disclosure {
        margin-top: 0;
    }

    .liquidation-detail {
        padding: 16px 12px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .liquidation-summary,
    .liquidation-disclosure .icon {
        transition: none;
    }

    .liquidation-row[open] .liquidation-detail {
        animation: none;
    }
}

/* Dashboards compactos: resumen visible y detalle bajo demanda. */
.choice-picker {
    position: relative;
    min-width: 0;
}

.choice-input {
    min-height: 44px;
    padding-right: 38px;
    cursor: pointer;
    text-overflow: ellipsis;
}

.choice-chevron {
    position: absolute;
    top: 14px;
    right: 12px;
    width: 16px;
    height: 16px;
    transform: rotate(90deg);
    color: var(--muted);
    pointer-events: none;
}

.choice-options {
    position: absolute;
    z-index: 70;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    max-height: 280px;
    overflow-y: auto;
    padding: 6px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--panel);
    box-shadow: 0 10px 30px rgb(16 38 63 / 15%);
}

.choice-option {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--ink);
    text-align: left;
    font: inherit;
    font-size: var(--text-small);
    cursor: pointer;
}

.choice-option .icon {
    flex-shrink: 0;
    visibility: hidden;
}

.choice-option[aria-selected="true"] {
    color: var(--blue);
    background: var(--blue-soft);
    font-weight: 700;
}

.choice-option[aria-selected="true"] .icon {
    visibility: visible;
}

.choice-option:hover,
.choice-option.is-active {
    color: var(--blue);
    background: var(--blue-soft);
    outline: 1px solid var(--blue);
    outline-offset: -2px;
}

.choice-empty {
    margin: 8px;
    font-size: var(--text-small);
    color: var(--muted);
}

.filter-toolbar {
    position: relative;
    z-index: 5;
    padding: 12px 16px;
    margin-bottom: 18px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--panel);
}

.filter-main-row {
    display: grid;
    grid-template-columns: minmax(160px, 1.25fr) repeat(2, minmax(130px, 1fr)) auto auto auto;
    gap: 12px;
    align-items: end;
}

.filter-toolbar .field {
    min-width: 0;
    margin: 0;
}

.filter-toolbar .field > label {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 5px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
}

.filter-toolbar label .icon {
    width: 15px;
    height: 15px;
}

.filter-toolbar .control,
.filter-toolbar .button {
    min-height: 40px;
    height: 40px;
    font-size: var(--text-small);
}

.filter-toolbar .button {
    padding: 8px 12px;
    white-space: nowrap;
}

.filter-reset {
    width: 40px;
}

.filter-toolbar .picker-selected:empty {
    display: none;
}

.filter-toolbar .picker-selected {
    margin-top: 5px;
}

.filter-toolbar .selected-chip {
    padding: 3px 6px;
    font-size: 12px;
}

.filter-toolbar .selected-chip > span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.filter-toolbar .choice-chevron {
    top: 12px;
}

.filter-more {
    position: relative;
}

.filter-more > summary {
    list-style: none;
}

.filter-more > summary::-webkit-details-marker {
    display: none;
}

.filter-more[open] > summary {
    color: var(--blue);
    border-color: var(--blue);
}

.filter-extra {
    position: absolute;
    z-index: 80;
    top: calc(100% + 8px);
    right: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    width: min(480px, 80vw);
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--panel);
    box-shadow: 0 12px 32px rgb(16 38 63 / 16%);
}

.filter-extra > button {
    justify-self: start;
}

.filter-applied {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding-top: 9px;
    font-size: 12px;
}

.filter-applied > span,
.filter-applied > a {
    display: inline-flex;
    gap: 4px;
    align-items: center;
    padding: 3px 8px;
    border-radius: 6px;
    color: var(--muted);
    background: var(--surface-subtle);
}

.compact-heading {
    margin-bottom: 18px;
}

.compact-heading h1 {
    font-size: 28px;
}

.executive-strip {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.executive-stat {
    min-width: 0;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--panel);
    color: var(--ink);
    font: inherit;
    text-align: left;
    transition: border-color 140ms;
}

.executive-stat:hover {
    border-color: var(--blue);
}

.stat-heading {
    display: flex;
    gap: 7px;
    align-items: center;
    min-height: 38px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.4;
}

.stat-icon {
    display: grid;
    flex: 0 0 28px;
    height: 28px;
    place-items: center;
    border-radius: 8px;
}

.stat-icon .icon {
    width: 17px;
    height: 17px;
}

.executive-stat > strong {
    display: block;
    margin: 8px 0 5px;
    font-size: 29px;
    line-height: 1.2;
}

.stat-foot {
    display: flex;
    gap: 4px;
    align-items: center;
    color: var(--blue);
    font-size: 12px;
}

.stat-foot .icon {
    width: 14px;
    height: 14px;
}

.operations-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.65fr) minmax(310px, 1fr);
    gap: 18px;
    align-items: start;
}

.operations-layout > * {
    min-width: 0;
    margin-bottom: 0;
}

.compact-orders .panel-heading,
.dashboard-chart-panel .panel-heading {
    padding: 16px 18px;
}

.compact-orders h2,
.dashboard-chart-panel h2 {
    font-size: 17px;
}

.compact-order-scroll {
    max-height: 550px;
    overflow: auto;
}

.compact-order-table {
    width: 100%;
    min-width: 520px;
    table-layout: fixed;
    font-size: var(--text-small);
}

.compact-order-table th,
.compact-order-table td {
    padding: 12px;
    overflow-wrap: anywhere;
    white-space: normal;
}

.compact-order-table th:first-child {
    width: 39%;
}

.compact-order-table th:nth-child(2) {
    width: 25%;
}

.compact-order-table th:nth-child(3) {
    width: 23%;
}

.compact-order-table th:last-child {
    width: 13%;
}

.compact-order-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: var(--surface-subtle);
}

.compact-supplier {
    display: block;
    margin-top: 4px;
    font-weight: 600;
}

.compact-order-table small {
    font-size: 12px;
}

.compact-open {
    width: 36px;
    min-height: 36px;
    padding: 6px;
}

.compact-order-table .tag {
    font-size: 12px;
    white-space: normal;
}

.tag .icon {
    width: 14px;
    height: 14px;
    vertical-align: middle;
}

.chart-switches {
    display: flex;
    gap: 3px;
    flex-wrap: wrap;
    padding: 3px;
    border-radius: 8px;
    background: var(--surface-subtle);
}

.dashboard-chart-panel > .chart-switches {
    margin: 0 18px 8px;
}

.chart-switches button {
    min-height: 36px;
    padding: 6px 12px;
    border: 1px solid transparent;
    border-radius: 6px;
    color: var(--muted);
    background: transparent;
    font: inherit;
    font-size: var(--text-small);
}

.chart-switches .is-active {
    border-color: var(--border);
    color: var(--blue);
    background: var(--panel);
}

.chart-content {
    min-width: 0;
    padding: 10px 18px 16px;
}

.chart-canvas-wrap {
    position: relative;
    width: 100%;
    height: 280px;
    min-width: 0;
}

.chart-canvas-wrap canvas {
    max-width: 100%;
}

.chart-values {
    margin-top: 8px;
    color: var(--muted);
    font-size: 12px;
}

.chart-values > summary {
    display: flex;
    align-items: center;
    gap: 5px;
    min-height: 36px;
    width: fit-content;
    color: var(--blue);
}

.chart-values .icon {
    width: 15px;
    height: 15px;
}

.chart-values th,
.chart-values td {
    padding: 8px;
    font-size: 12px;
}

.chart-empty {
    padding: 36px 12px;
    color: var(--muted);
    font-size: var(--text-small);
}

.indicator-dialog {
    width: min(860px, calc(100% - 32px));
    max-height: min(80vh, 800px);
    padding: 0;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 16px;
    color: var(--ink);
    background: var(--panel);
    box-shadow: 0 24px 80px rgb(16 38 63 / 25%);
}

.indicator-dialog::backdrop {
    background: rgb(16 38 63 / 52%);
}

.indicator-dialog-heading {
    display: flex;
    gap: 16px;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px;
    border-bottom: 1px solid var(--border);
}

.indicator-dialog-heading h2 {
    margin: 0;
    font-size: 20px;
}

.indicator-dialog-heading p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: var(--text-small);
}

.indicator-dialog-body {
    max-height: calc(80vh - 110px);
    overflow-y: auto;
    padding: 0 22px 18px;
}

.indicator-results {
    margin: 0;
    padding: 0;
    list-style: none;
}

.indicator-result {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
}

.indicator-result > div {
    min-width: 0;
    overflow-wrap: anywhere;
}

.indicator-result strong,
.indicator-result small {
    display: block;
}

.indicator-result small {
    margin-top: 4px;
    color: var(--muted);
    font-size: 12px;
}

.indicator-result .button {
    flex-shrink: 0;
}

body.has-indicator-dialog {
    overflow: hidden;
}

.compact-cost-counts {
    gap: 12px;
    margin-bottom: 18px;
}

.compact-cost-counts article {
    padding: 14px 16px;
}

.cost-chart-panel .panel-heading {
    flex-wrap: wrap;
    gap: 12px;
}

.cost-chart-panel .chart-canvas-wrap {
    height: 250px;
}

.supporting-analysis > summary {
    display: flex;
    gap: 8px;
    align-items: center;
    min-height: 52px;
    padding: 14px 18px;
    font-weight: 600;
    font-size: var(--text-small);
}

.supporting-analysis .cost-analysis-grid {
    padding: 0 16px;
    margin-bottom: 0;
}

@media (max-width: 1200px) {
    .filter-main-row {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .filter-more,
    .filter-main-row > .button {
        justify-self: start;
    }

    .operations-layout {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 1000px) {
    .executive-strip {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 767px) {
    .compact-heading h1 {
        font-size: 25px;
    }

    .filter-toolbar {
        padding: 12px;
    }

    .filter-main-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .filter-main-row > .field:first-child {
        grid-column: 1 / -1;
    }

    .filter-toolbar .control,
    .filter-toolbar .button,
    .chart-switches button,
    .compact-open {
        min-height: 44px;
        height: auto;
    }

    .filter-reset {
        width: 44px;
    }

    .filter-more {
        position: static;
    }

    .filter-extra {
        left: 12px;
        right: 12px;
        top: calc(100% - 8px);
        width: auto;
        grid-template-columns: minmax(0, 1fr);
        max-height: 60vh;
        overflow-y: auto;
    }

    .executive-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .stat-heading {
        min-height: 34px;
    }

    .executive-stat {
        padding: 12px;
    }

    .indicator-dialog {
        width: calc(100% - 20px);
        max-height: 90vh;
    }

    .indicator-dialog-heading {
        padding: 14px;
    }

    .indicator-dialog-body {
        padding: 0 14px 16px;
    }

    .indicator-result {
        flex-wrap: wrap;
    }

    .chart-canvas-wrap {
        height: 270px;
    }
}

.compact-order-scroll,
.chart-values .table-scroll {
    position: relative;
}

@media (max-width: 767px) {
    .filter-main-row {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 44px;
    }

    .filter-main-row > .field:nth-child(2) {
        grid-column: 1;
    }

    .filter-main-row > .field:nth-child(3) {
        grid-column: 2 / -1;
    }

    .filter-more {
        grid-column: 1;
    }
}

.compact-order-table .tag {
    overflow-wrap: normal;
    word-break: normal;
}

/* Operación: estado siempre visible y recorrido de cada pedido. */
.filter-main-row {
    grid-template-columns: minmax(130px, 1.15fr) minmax(115px, 1fr) minmax(105px, 0.9fr) minmax(140px, 1.1fr) auto auto auto;
    gap: 10px;
}

.orders-primary .panel-heading,
.route-panel .panel-heading {
    padding: 16px 18px;
}

.orders-primary h2,
.route-panel h2 {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 17px;
}

.orders-data-scroll,
.route-scroll {
    position: relative;
    overflow: auto;
    max-height: 570px;
}

.orders-data-table {
    width: 100%;
    min-width: 1050px;
    table-layout: fixed;
    font-size: var(--text-small);
}

.orders-data-table th,
.orders-data-table td {
    padding: 12px;
    overflow-wrap: anywhere;
    white-space: normal;
}

.orders-data-table thead th {
    overflow-wrap: normal;
    font-size: 12px;
}

.orders-data-table thead th,
.route-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--surface-subtle);
}

.orders-data-table th:first-child {
    width: 22%;
}

.orders-data-table th:nth-child(2) {
    width: 15%;
}

.orders-data-table th:nth-child(3) {
    width: 12%;
}

.orders-data-table th:nth-child(4) {
    width: 15%;
}

.orders-data-table th:nth-child(5) {
    width: 14%;
}

.orders-data-table th:nth-child(6) {
    width: 10%;
}

.orders-data-table th:last-child {
    width: 12%;
}

.orders-data-table small {
    font-size: 12px;
}

.orders-data-table .tag {
    overflow-wrap: normal;
    font-size: 12px;
}

.orders-data-table progress {
    display: block;
    width: 72px;
    height: 6px;
    margin-top: 6px;
    accent-color: var(--green);
}

.order-product {
    display: block;
    margin-bottom: 3px;
}

.operations-bottom {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(320px, 1fr);
    gap: 18px;
    align-items: start;
}

.operations-bottom > * {
    min-width: 0;
}

.operations-side .panel {
    margin-bottom: 18px;
}

.route-legend {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    padding: 0 18px 14px;
    color: var(--muted);
    font-size: 12px;
}

.route-legend > span {
    display: flex;
    gap: 6px;
    align-items: center;
}

.route-legend-check,
.route-legend-current,
.route-legend-pending {
    display: grid;
    width: 17px;
    height: 17px;
    place-items: center;
    border-radius: 50%;
}

.route-legend-check {
    background: var(--green);
    color: var(--panel);
}

.route-legend-check .icon {
    width: 13px;
    height: 13px;
}

.route-legend-current {
    background: var(--blue);
    outline: 3px solid var(--blue-soft);
}

.route-legend-pending {
    border: 2px solid var(--control-border);
    background: var(--panel);
}

.route-scroll {
    max-height: 520px;
}

.route-table {
    min-width: 720px;
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    font-size: 12px;
}

.route-table thead th {
    padding: 10px 3px;
    text-align: center;
    white-space: normal;
    overflow-wrap: normal;
    font-size: 12px;
    font-weight: 500;
}

.route-table th:first-child {
    width: 160px;
    padding-left: 14px;
    text-align: left;
}

.route-table tbody th {
    padding: 12px 6px 12px 14px;
    font-size: 12px;
    white-space: normal;
    border-bottom: 1px solid var(--border);
}

.route-table small {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-weight: 400;
    font-size: 12px;
}

.route-cell {
    position: relative;
    padding: 12px 0;
    text-align: center;
}

.route-cell::before {
    position: absolute;
    z-index: 0;
    top: 50%;
    right: 50%;
    width: 100%;
    height: 2px;
    background: var(--border);
    content: "";
}

.route-first::before {
    display: none;
}

.route-done::before {
    background: var(--green);
}

.route-node {
    position: relative;
    z-index: 1;
    display: inline-grid;
    width: 24px;
    height: 24px;
    place-items: center;
    border: 2px solid var(--control-border);
    border-radius: 50%;
    background: var(--panel);
    vertical-align: middle;
}

.route-node .icon {
    width: 16px;
    height: 16px;
}

.route-done .route-node {
    border-color: var(--green);
    background: var(--green);
    color: var(--panel);
}

.route-current .route-node {
    border-color: var(--blue);
    background: var(--blue);
    box-shadow: 0 0 0 4px var(--blue-soft);
}

@media (max-width: 1200px) {
    .filter-main-row {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 1500px) {
    .operations-bottom {
        grid-template-columns: minmax(0, 1fr);
    }

    .operations-side {
        display: block;
    }
}

@media (max-width: 767px) {
    .filter-main-row {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }

    .filter-main-row > .field:first-child,
    .filter-main-row > .field:nth-child(2),
    .filter-main-row > .field:nth-child(3),
    .filter-main-row > .field:nth-child(4) {
        grid-column: span 3;
    }

    .filter-main-row > .filter-more {
        grid-column: span 2;
    }

    .filter-main-row > button {
        grid-column: span 3;
    }

    .filter-main-row > .filter-reset {
        grid-column: span 1;
    }

}

/* Volumen de compra, tipos de unidad y procedencia. */
:root {
    --chart-top: #88bdf1;
    --chart-line: #173e68;
}

.activity-panel {
    background: linear-gradient(160deg, var(--panel), #f5f9ff);
    border-top: 3px solid var(--blue);
}

.activity-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    padding: 16px 20px 4px;
}

.activity-heading h2 {
    margin: 4px 0;
    font-size: 20px;
}

.activity-heading p,
.activity-note {
    margin: 4px 0;
    color: var(--muted);
    font-size: 12px;
}

.activity-totals {
    display: flex;
    gap: 24px;
    flex-shrink: 0;
    color: var(--muted);
    font-size: 12px;
}

.activity-totals strong {
    display: block;
    color: var(--ink);
    font-size: 27px;
    line-height: 1.25;
}

.activity-totals span:last-child strong {
    color: var(--chart-line);
}

.activity-panel .chart-canvas-wrap {
    height: 250px;
}

.activity-panel .chart-content {
    padding-bottom: 0;
}

.activity-note {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    padding: 0 20px 14px;
}

.activity-note .icon {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
}

.container-distributions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin-top: 18px;
}

.distribution-panel {
    min-width: 0;
}

.distribution-panel .panel-heading {
    gap: 10px;
    flex-wrap: wrap;
    padding: 16px 18px;
}

.distribution-panel h2 {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 17px;
}

.distribution-panel .chart-viewport {
    max-height: 300px;
    overflow-y: auto;
}

.route-table th:first-child {
    width: 170px;
}

.route-detail {
    display: inline-flex;
    margin-top: 8px;
    min-height: 30px;
    font-size: 12px;
}

.origin-map-view {
    padding: 12px 18px 16px;
}

.origin-map {
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 10px;
    aspect-ratio: 2 / 1;
    background: var(--surface-subtle);
}

.origin-map svg {
    display: block;
    width: 100%;
    height: 100%;
}

.origin-map [data-country] {
    fill: #d6e2ec;
    stroke: var(--panel);
    stroke-width: 0.8;
}

.origin-map .has-containers {
    cursor: pointer;
}

.origin-map .has-containers:hover,
.origin-map .has-containers:focus {
    stroke: var(--ink);
    stroke-width: 2;
    outline: none;
}

.map-selection {
    min-height: 38px;
    margin: 10px 0;
    color: var(--ink);
    font-size: 13px;
    font-weight: 600;
}

.map-legend {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 12px;
}

.map-scale {
    width: 90px;
    height: 8px;
    border-radius: 4px;
    background: linear-gradient(90deg, #8bafe9, #1f58a3);
}

.map-credit {
    margin: 8px 0;
    color: var(--muted);
    font-size: 12px;
}

.map-data summary {
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 36px;
    color: var(--blue);
    font-size: 12px;
    cursor: pointer;
}

.origin-country-list {
    max-height: 240px;
    overflow-y: auto;
    margin: 0;
    padding: 0;
    list-style: none;
}

.origin-country-list li {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 9px 0;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}

.origin-country-list strong {
    margin-left: auto;
    white-space: nowrap;
}

.country-flag {
    width: 24px;
    height: 18px;
    object-fit: cover;
    border: 1px solid var(--border);
    border-radius: 3px;
}

@media (max-width: 900px) {
    .container-distributions {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 600px) {
    .activity-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
        padding: 14px 16px 4px;
    }

    .activity-heading h2 {
        font-size: 18px;
    }

    .activity-totals {
        gap: 28px;
    }

    .activity-totals strong {
        display: inline;
        margin-right: 4px;
        font-size: 21px;
    }
}

/* Vista rápida: consulta junto al acceso al expediente. */
.order-action-group {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
    vertical-align: middle;
}

.order-action-group .button {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    margin: 0;
    padding: 8px;
}

.quick-view-trigger {
    min-width: 44px;
    min-height: 44px;
    vertical-align: middle;
}

.quick-order-dialog .icon-button {
    min-width: 44px;
    min-height: 44px;
}

.quick-order-dialog {
    width: min(1080px, calc(100% - 32px));
    max-height: 90vh;
}

.quick-order-dialog[open] {
    display: flex;
    flex-direction: column;
}

.quick-order-dialog .indicator-dialog-heading {
    flex-shrink: 0;
}

.quick-order-dialog .indicator-dialog-body {
    flex: 0 1 auto;
    min-height: 0;
    max-height: none;
    overflow-y: auto;
    scroll-padding-block: 12px;
}

.quick-order-footer .button {
    scroll-margin-block: 12px;
}

.quick-order-dialog .quick-loading {
    min-height: min(360px, 50vh);
}

.quick-order-page {
    max-width: 1100px;
    margin: 0 auto;
}

.quick-order-page h1 {
    font-size: 24px;
}

.quick-page-body {
    padding: 22px;
}

.quick-order-heading,
.quick-costs-heading,
.quick-order-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
}

.quick-order-heading {
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.quick-order-heading h2 {
    margin: 5px 0;
    font-size: 23px;
}

.quick-order-heading p {
    margin: 0;
    color: var(--muted);
    overflow-wrap: anywhere;
}

.quick-order-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    gap: 22px;
    margin-top: 18px;
}

.quick-order-grid > * {
    min-width: 0;
}

.quick-order-facts,
.quick-money-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin: 0;
}

.quick-order dt {
    margin-bottom: 4px;
    color: var(--muted);
    font-size: 12px;
}

.quick-order dd {
    margin: 0;
    color: var(--ink);
    font-size: 14px;
    font-weight: 600;
    overflow-wrap: anywhere;
}

.quick-order-section {
    margin-top: 18px;
}

.quick-order h3 {
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 0 0 10px;
    font-size: 15px;
}

.quick-order-section > p {
    margin: 6px 0;
    color: var(--muted);
    font-size: 13px;
}

.quick-product-list,
.quick-container-list {
    max-height: 170px;
    overflow-y: auto;
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 13px;
}

.quick-product-list li {
    padding: 4px 0;
}

.quick-container-list li {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    overflow-wrap: anywhere;
}

.quick-container-list strong,
.quick-container-list div > span {
    display: block;
}

.quick-container-list span {
    color: var(--muted);
    font-size: 12px;
}

.quick-origin {
    align-self: start;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface-subtle);
}

.quick-origin-country {
    display: flex;
    gap: 9px;
    align-items: center;
    margin-bottom: 12px;
}

.quick-origin .map-selection {
    min-height: 0;
    font-size: 12px;
}

.quick-costs {
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface-subtle);
}

.quick-money-row {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    padding-top: 12px;
}

.quick-ratio {
    color: var(--muted);
    font-size: 12px;
}

.quick-ratio strong {
    color: var(--blue);
    font-size: 16px;
}

.quick-order-footer {
    margin-top: 18px;
    font-size: 12px;
}

.quick-loading {
    margin: 0;
    padding: 40px 16px;
    color: var(--muted);
    text-align: center;
}

@media (max-width: 700px) {
    .quick-order-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 16px;
    }

    .quick-money-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .quick-order-dialog .indicator-dialog-body,
    .quick-page-body {
        padding: 16px;
    }

    .quick-order-footer .button {
        width: 100%;
    }
}

/* El tipo conserva texto y un icono de transporte decorativo. */
.container-type .icon {
    width: 14px;
    height: 14px;
    vertical-align: middle;
    margin-right: 3px;
}

.import-list-table {
    min-width: 930px;
}

.import-list-table td,
.import-list-table th {
    padding: 10px 12px;
    vertical-align: middle;
}

.import-list-table .tag,
.import-list-table .list-weight {
    white-space: nowrap;
}

.import-list-table .import-list-description {
    max-width: 260px;
    overflow-wrap: anywhere;
}

.import-list-filters .button {
    min-height: 44px;
}

.import-list-filter-actions {
    display: contents;
}

.import-list-mobile {
    display: none;
}

@media (min-width: 768px) and (max-width: 1100px) {
    .import-list-table .import-list-actions {
        position: sticky;
        right: 0;
        z-index: 1;
        width: 1%;
        border-left: 1px solid var(--border);
        background: var(--panel);
    }
}

@media (max-width: 767px) {
    .import-list-filter-actions {
        display: grid;
        grid-column: 1 / -1;
        grid-template-columns: repeat(2, minmax(0, 1fr)) 44px;
        gap: 8px;
        align-items: start;
    }

    .import-list-filter-actions > .button,
    .import-list-filter-actions summary {
        width: 100%;
        justify-content: center;
        padding-inline: 6px;
    }

    .import-list-table {
        min-width: 0;
    }

    .import-list-table :is(th, td):nth-child(n+2):nth-child(-n+7) {
        display: none;
    }

    .import-list-table .import-list-description {
        display: none;
    }

    .import-list-table .import-list-actions {
        width: 1%;
    }

    .import-list-table .import-list-code {
        white-space: nowrap;
    }

    .import-list-mobile {
        display: block;
    }

    .import-list-mobile .tag {
        margin-top: 4px;
    }
}

.import-list-pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    padding: 12px 16px;
    border-top: 1px solid var(--border);
    color: var(--muted);
}

.weight-trigger {
    min-height: 44px;
}

.weight-dialog {
    width: min(430px, calc(100% - 32px));
}

.weight-dialog .indicator-dialog-body {
    padding-top: 18px;
}

.weight-dialog .icon-button {
    width: 44px;
    height: 44px;
}

.weight-form .actions {
    justify-content: flex-end;
    gap: 8px;
}

.annual-calendar-layout {
    grid-template-columns: minmax(0, 1fr);
}

.annual-calendar-total {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    padding: 12px 16px 0;
}

.annual-calendar-total > strong {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.annual-calendar-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin: 0;
    padding: 16px;
    list-style: none;
}

.annual-calendar-month {
    display: flex;
    min-height: 112px;
    height: 100%;
    padding: 14px;
    flex-direction: column;
    gap: 4px;
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--ink);
    background: var(--panel);
    text-decoration: none;
}

.annual-calendar-month:hover,
.annual-calendar-month:focus-visible {
    border-color: var(--blue);
    background: var(--blue-soft);
}

.annual-calendar-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.annual-calendar-heading .icon {
    color: var(--blue);
}

.annual-calendar-count {
    color: var(--muted);
    font-size: var(--text-small);
}

.annual-calendar-amounts {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 10px;
    margin-top: 4px;
    overflow-wrap: anywhere;
}

@media (max-width: 980px) {
    .annual-calendar-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 600px) {
    .annual-calendar-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        padding: 12px;
    }

    .annual-calendar-month {
        min-height: 100px;
        padding: 10px;
    }
}

.correction-accounts {
    margin-bottom: 18px;
}

.correction-accounts h2 {
    margin: 0 0 8px;
    font-size: 16px;
}

.correction-accounts ul {
    margin: 0;
    padding-left: 20px;
}

.correction-confirm label {
    display: flex;
    align-items: center;
    gap: 8px;
}

.supplier-compare-filter {
    display: grid;
    grid-template-columns: minmax(220px, 1.5fr) minmax(160px, 1fr) auto auto auto;
    align-items: end;
    gap: 12px;
}

.supplier-compare-filter .button {
    min-height: 44px;
}

.supplier-compare-filter .filter-applied {
    grid-column: 1 / -1;
}

.supplier-compare-context {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 8px 16px;
    margin: 0 0 18px;
}

.supplier-compare-context > span {
    color: var(--muted);
    font-size: var(--text-small);
}

.supplier-compare-section {
    margin-bottom: 20px;
}

.supplier-compare-section h2 {
    display: flex;
    gap: 8px;
    align-items: center;
}

.supplier-compare-chart {
    padding: 8px 16px 16px;
}

.supplier-compare-chart .chart-canvas-wrap {
    height: 280px;
}

.supplier-compare-table {
    min-width: 980px;
    table-layout: fixed;
}

.supplier-compare-table th:first-child {
    width: 210px;
}

.supplier-compare-table td,
.supplier-compare-table th {
    vertical-align: top;
    padding: 12px 10px;
    white-space: normal;
}

.supplier-compare-table small {
    display: block;
    margin-top: 4px;
    font-weight: 400;
}

.supplier-compare-table thead th {
    font-size: 12px;
}

.supplier-compare-table tbody th {
    min-width: 190px;
    max-width: 280px;
    text-align: left;
    font-weight: 400;
    overflow-wrap: anywhere;
}

.supplier-concept-chart {
    border-top: 1px solid var(--border);
}

.supplier-concept-chart > summary,
.supplier-compare-operations > summary {
    padding: 14px 18px;
    min-height: 44px;
    color: var(--ink);
    font-weight: 600;
    cursor: pointer;
}

.supplier-row-details {
    margin-top: 8px;
}

.supplier-row-details > summary {
    color: var(--blue);
    font-size: var(--text-small);
    cursor: pointer;
}

.supplier-row-details ul {
    max-height: 260px;
    overflow: auto;
    margin: 8px 0 0;
    padding-left: 18px;
}

.supplier-row-details li {
    margin-bottom: 10px;
}

.supplier-compare-note {
    color: var(--muted);
    font-size: var(--text-small);
    margin: 0 0 18px;
}

@media (max-width: 1100px) {
    .supplier-compare-filter {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
    }

    .supplier-compare-filter > .field:first-child {
        grid-column: span 2;
    }
}

@media (max-width: 600px) {
    .supplier-compare-filter {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 44px;
        gap: 10px;
    }

    .supplier-compare-filter > .field:first-child,
    .supplier-compare-filter > .field:nth-child(2) {
        grid-column: 1 / -1;
    }

    .supplier-compare-filter > .filter-more {
        position: static;
    }

    .supplier-compare-filter > button {
        padding-inline: 8px;
        width: 100%;
    }

    .supplier-compare-filter > .filter-more > summary {
        justify-content: center;
    }

    .supplier-compare-table {
        min-width: 0;
        table-layout: auto;
    }

    .supplier-compare-table thead {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip-path: inset(50%);
    }

    .supplier-compare-table tbody,
    .supplier-compare-table tbody tr {
        display: block;
    }

    .supplier-compare-table tbody tr {
        padding: 12px;
        border-bottom: 1px solid var(--border);
    }

    .supplier-compare-table tbody th {
        display: block;
        width: auto;
        max-width: none;
        padding: 0 0 10px;
    }

    .supplier-compare-table td {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
        gap: 6px;
        padding: 6px 0;
        border: 0;
        overflow-wrap: anywhere;
    }

    .supplier-compare-table td::before {
        content: attr(data-label);
        color: var(--muted);
        font-size: var(--text-small);
    }

    .supplier-compare-table td > small {
        grid-column: 2;
    }
}

/* Comparación por totales y estado de cuenta del proveedor. */
.supplier-analysis-filter,
.supplier-statement-filter {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 10px;
}

.supplier-analysis-filter > .field,
.supplier-statement-filter > .field {
    flex: 1 1 160px;
    min-width: 0;
}

.supplier-analysis-filter > .filter-applied {
    flex-basis: 100%;
}

.supplier-analysis-filter .remote-picker {
    min-width: 0;
}

.supplier-analysis-panel,
.supplier-balance-panel {
    margin-bottom: 18px;
}

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

.supplier-summary > div {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.supplier-summary span,
.supplier-analysis-note {
    font-size: var(--text-small);
}

.supplier-summary span {
    color: var(--muted);
}

.supplier-summary strong {
    font-size: 1.2rem;
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
}

.supplier-chart-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
    padding: 0 18px 18px;
    align-items: start;
}

.supplier-chart-grid > div {
    min-width: 0;
}

.supplier-chart-grid h3 {
    margin: 8px 0 14px;
    font-size: 1rem;
}

.supplier-chart-grid .chart-canvas-wrap {
    height: 300px;
}

.supplier-analysis-table {
    min-width: 900px;
}

.supplier-analysis-table th:first-child {
    min-width: 240px;
}

.supplier-analysis-table small {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-weight: 400;
}

.supplier-statement-table td:nth-child(1),
.supplier-statement-table td:nth-child(3),
.supplier-statement-table td:nth-child(4),
.supplier-statement-table td:nth-child(5) {
    white-space: nowrap;
}

.supplier-statement-table td:nth-child(2) {
    max-width: 360px;
    overflow-wrap: anywhere;
}

@media (max-width: 1050px) {
    .supplier-chart-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 620px) {
    .supplier-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .supplier-analysis-filter > .field,
    .supplier-statement-filter > .field {
        flex-basis: calc(50% - 10px);
    }

    .supplier-analysis-filter > .field:nth-child(3) {
        flex-basis: 100%;
    }
}


.supplier-statement-table {
    min-width: 1040px;
}
