:root {
    --bg: #eef3f9;
    --panel: #ffffff;
    --ink: #111827;
    --muted: #64748b;
    --line: #d8e2ef;
    --soft: #f5f8fc;
    --primary: #175cd3;
    --primary-dark: #123c8c;
    --accent: #06aed5;
    --accent-2: #7c3aed;
    --green: #12b76a;
    --yellow: #f79009;
    --red: #f04438;
    --cyan: #0ea5e9;
    --shadow: 0 18px 40px rgba(15, 23, 42, 0.10);
    --radius: 8px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: Inter, Segoe UI, Arial, sans-serif;
    color: var(--ink);
    background: var(--bg);
}

button,
input,
select {
    font: inherit;
}

button {
    cursor: pointer;
}

.portal-loading {
    display: grid;
    min-height: 100vh;
    place-items: center;
    gap: 12px;
    color: var(--muted);
}

.loading-mark {
    display: grid;
    width: 72px;
    height: 72px;
    place-items: center;
    border-radius: 18px;
    color: #fff;
    background: var(--primary);
    font-weight: 900;
    box-shadow: var(--shadow);
}

.login-page {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(360px, 0.94fr) minmax(360px, 1.06fr);
    background: #faf9f4;
}

.login-copy {
    padding: 48px 6vw;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.login-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 34px;
    font-weight: 900;
}

.brand-mark {
    display: grid;
    width: 46px;
    height: 46px;
    place-items: center;
    border-radius: 12px;
    border: 1px solid #111;
    background: var(--accent);
    color: #111;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
}

.eyebrow {
    color: #b58a00;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0;
    text-transform: uppercase;
}

.login-copy h1 {
    margin: 10px 0 14px;
    max-width: 760px;
    font-size: clamp(34px, 5vw, 58px);
    line-height: 1;
    letter-spacing: 0;
}

.login-copy p {
    max-width: 700px;
    margin: 0;
    color: var(--muted);
    font-size: 17px;
    line-height: 1.55;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 34px;
}

.feature-card {
    min-height: 116px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(6px);
}

.feature-card strong {
    display: block;
    margin-bottom: 8px;
    font-size: 15px;
}

.feature-card span {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.45;
}

.login-side {
    padding: 36px 5vw 36px 0;
    display: flex;
    align-items: center;
}

.login-card {
    width: min(100%, 520px);
    margin-left: auto;
    padding: 26px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: var(--shadow);
}

.visual-panel {
    padding: 18px;
    margin-bottom: 20px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fffdf4;
}

.visual-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.visual-map {
    margin: 18px 0;
    height: 150px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background:
        linear-gradient(90deg, rgba(0, 0, 0, 0.06) 1px, transparent 1px) 0 0 / 34px 34px,
        linear-gradient(rgba(0, 0, 0, 0.06) 1px, transparent 1px) 0 0 / 34px 34px,
        #fff9e0;
    position: relative;
    overflow: hidden;
}

.route {
    position: absolute;
    inset: 32px 38px;
    border-top: 4px solid #111;
    border-right: 4px solid var(--accent);
    border-radius: 0 70px 0 0;
}

.route::before,
.route::after {
    content: "";
    position: absolute;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #111;
    box-shadow: 0 0 0 6px rgba(255, 196, 0, 0.22);
}

.route::before {
    left: -3px;
    top: -9px;
}

.route::after {
    right: -9px;
    bottom: -3px;
    background: var(--green);
}

.visual-kpis {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.visual-kpis div {
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
}

.visual-kpis strong {
    display: block;
    font-size: 20px;
}

.visual-kpis span {
    color: var(--muted);
    font-size: 11px;
}

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

.login-card .sub {
    margin: 0 0 18px;
    color: var(--muted);
    font-size: 14px;
}

.field {
    display: grid;
    gap: 7px;
    margin-bottom: 13px;
}

.field label {
    color: #474747;
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.field input,
.field select {
    width: 100%;
    min-height: 42px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    color: var(--ink);
    outline: none;
}

.field input:focus,
.field select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(255, 196, 0, 0.2);
}

.primary-btn,
.ghost-btn,
.danger-btn,
.soft-btn {
    min-height: 40px;
    padding: 10px 15px;
    border-radius: var(--radius);
    border: 1px solid transparent;
    font-weight: 850;
}

.primary-btn {
    color: #fff;
    background: var(--primary);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.14);
}

.primary-btn:hover {
    background: var(--primary-dark);
}

.ghost-btn {
    color: #222;
    background: #fff;
    border-color: var(--line);
}

.soft-btn {
    color: #111;
    background: var(--accent);
    border-color: #111;
}

.danger-btn {
    color: #fff;
    background: var(--red);
}

.login-submit {
    width: 100%;
    margin-top: 6px;
}

.login-error {
    display: none;
    margin: 12px 0 0;
    padding: 10px 12px;
    border-radius: var(--radius);
    color: #8a1f1f;
    background: #fff1f1;
    border: 1px solid #ffc7c7;
    font-size: 13px;
}

.portal-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 18px;
    background: #ffffff;
    border-right: 1px solid var(--line);
    overflow-y: auto;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 6px 18px;
    border-bottom: 1px solid var(--line);
    margin-bottom: 14px;
    font-weight: 900;
}

.user-chip {
    padding: 13px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fffdf4;
    margin-bottom: 14px;
}

.user-chip strong {
    display: block;
}

.user-chip span {
    color: var(--muted);
    font-size: 12px;
}

.profile-field {
    margin: 12px 0 0;
}

.profile-field select {
    min-height: 38px;
    font-size: 13px;
}

.nav-list {
    display: grid;
    gap: 7px;
}

.nav-btn {
    width: 100%;
    min-height: 42px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid transparent;
    border-radius: var(--radius);
    color: #303030;
    background: transparent;
    text-align: left;
    font-weight: 800;
}

.nav-btn:hover,
.nav-btn.active {
    color: #111;
    background: #fff3b7;
    border-color: var(--accent);
}

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

.nav-group.active {
    background: transparent;
}

.nav-parent {
    justify-content: flex-start;
}

.nav-parent strong {
    flex: 1;
    font: inherit;
}

.nav-parent em {
    display: inline-grid;
    width: 22px;
    height: 22px;
    place-items: center;
    border-radius: 6px;
    color: var(--primary);
    background: #eaf2ff;
    font-style: normal;
    font-weight: 900;
}

.nav-btn span {
    display: inline-grid;
    min-width: 24px;
    height: 24px;
    place-items: center;
    border-radius: 6px;
    background: #eaf2ff;
    color: var(--primary);
    font-size: 11px;
    font-weight: 900;
}

.nav-sublist {
    display: grid;
    gap: 4px;
    margin: -2px 0 2px 34px;
    padding: 4px 0 0 10px;
    border-left: 1px solid #cfe0f6;
}

.nav-sublist[hidden] {
    display: none !important;
}

.nav-subbtn {
    width: 100%;
    min-height: 36px;
    padding: 8px 10px;
    border: 1px solid transparent;
    border-radius: var(--radius);
    color: #4a5870;
    background: transparent;
    text-align: left;
    font-weight: 800;
}

.nav-subbtn:hover,
.nav-subbtn.active {
    color: var(--primary);
    border-color: #bdd4ff;
    background: #eaf2ff;
}

.sidebar-footer {
    margin-top: 18px;
    display: grid;
    gap: 8px;
}

.main {
    min-width: 0;
    padding: 22px;
}

.topbar,
.filter-card,
.panel,
.metric-card,
.table-card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.045);
}

.topbar {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    padding: 18px 22px;
    margin-bottom: 18px;
}

.topbar h1 {
    margin: 0;
    font-size: 25px;
    letter-spacing: 0;
}

.topbar p {
    margin: 6px 0 0;
    color: var(--muted);
}

.readonly {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 10px;
    border-radius: 999px;
    color: #064b30;
    background: #dcf8e7;
    font-size: 12px;
    font-weight: 900;
    white-space: nowrap;
}

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

.metric-card {
    min-height: 112px;
    padding: 16px;
    border-left: 4px solid var(--accent);
}

.metric-card .label {
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.metric-card .value {
    margin-top: 8px;
    font-size: 30px;
    font-weight: 900;
}

.metric-card .hint {
    margin-top: 5px;
    color: var(--muted);
    font-size: 13px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.95fr);
    gap: 16px;
}

.panel,
.table-card {
    padding: 18px;
    margin-bottom: 16px;
}

.panel h2,
.table-card h2 {
    margin: 0 0 4px;
    font-size: 18px;
}

.panel .hint,
.table-card .hint {
    margin: 0 0 14px;
    color: var(--muted);
    font-size: 13px;
}

.estado-bars {
    display: grid;
    gap: 10px;
}

.estado-row {
    display: grid;
    grid-template-columns: minmax(150px, 220px) 1fr 52px;
    align-items: center;
    gap: 12px;
    font-size: 13px;
}

.bar-track {
    height: 10px;
    border-radius: 99px;
    background: #eee9dc;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    width: 0;
    border-radius: inherit;
    background: linear-gradient(90deg, #111, var(--accent));
}

.filter-card {
    padding: 12px;
    margin-bottom: 12px;
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(120px, 1fr));
    gap: 8px;
    align-items: end;
}

.guide-filter-grid {
    grid-template-columns: minmax(210px, 1.4fr) repeat(5, minmax(112px, 1fr));
}

.mercaderia-filter-grid {
    grid-template-columns: minmax(220px, 1.4fr) repeat(5, minmax(120px, 1fr));
}

.filter-field {
    display: grid;
    gap: 4px;
}

.filter-field span {
    color: #474747;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0;
    text-transform: uppercase;
}

.filter-field input {
    width: 100%;
    min-height: 34px;
    padding: 7px 9px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    color: var(--ink);
    outline: none;
}

.filter-field input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(255, 196, 0, 0.18);
}

.filter-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    align-items: end;
    justify-content: flex-end;
}

.guide-filter-grid .filter-actions {
    grid-column: span 2;
    align-self: end;
    justify-content: flex-start;
    flex-wrap: nowrap;
}

.guide-filter-grid .filter-actions .soft-btn,
.guide-filter-grid .filter-actions .ghost-btn {
    white-space: nowrap;
}

.mercaderia-filter-grid .filter-actions {
    grid-column: span 3;
    align-self: end;
    justify-content: flex-start;
    flex-wrap: nowrap;
}

.mercaderia-filter-grid .filter-actions .soft-btn,
.mercaderia-filter-grid .filter-actions .ghost-btn {
    white-space: nowrap;
}

.inventory-filter-card {
    overflow: visible;
}

.inventory-filter-main {
    display: grid;
    grid-template-columns: minmax(320px, 1fr) auto;
    gap: 10px;
    align-items: end;
}

.inventory-branch-field {
    position: relative;
}

.portal-search-select {
    position: relative;
}

.portal-search-select input {
    padding-right: 34px;
}

.portal-search-select::after {
    content: "";
    position: absolute;
    right: 13px;
    top: 15px;
    width: 0;
    height: 0;
    pointer-events: none;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid #667085;
}

.portal-search-options {
    display: none;
    position: absolute;
    z-index: 80;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    max-height: 260px;
    overflow: auto;
    border: 1px solid #bfd0e5;
    border-radius: 7px;
    background: #fff;
    box-shadow: 0 18px 36px rgba(15, 23, 42, 0.16);
    padding: 4px;
}

.portal-search-select:focus-within .portal-search-options {
    display: grid;
    gap: 2px;
}

.portal-search-option {
    width: 100%;
    min-height: 34px;
    border: 0;
    border-radius: 5px;
    padding: 8px 9px;
    color: #26364f;
    background: transparent;
    text-align: left;
    font-weight: 750;
}

.portal-search-option:hover,
.portal-search-option.active {
    color: #fff;
    background: #3b82f6;
}

.portal-search-empty {
    padding: 10px;
    color: var(--muted);
    font-size: 13px;
    text-align: center;
}

.inventory-filter-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    align-items: end;
    justify-content: flex-end;
}

.inventory-filter-actions .soft-btn,
.inventory-filter-actions .ghost-btn {
    min-height: 34px;
    padding: 7px 10px;
    white-space: nowrap;
}

.inventory-advanced-filters {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--line);
}

.inventory-advanced-grid {
    grid-template-columns: repeat(4, minmax(140px, 1fr));
}

.filter-actions .soft-btn,
.filter-actions .ghost-btn {
    min-height: 34px;
    padding: 7px 10px;
}

.toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

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

.search-input {
    width: min(100%, 340px);
    min-height: 38px;
    padding: 9px 11px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.table-wrap {
    width: 100%;
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.table-wrap table {
    min-width: 1180px;
}

.table-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.subtabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 16px;
}

.subtab {
    min-height: 38px;
    padding: 9px 13px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    color: #222;
    background: #fff;
    font-weight: 850;
}

.subtab.active {
    color: #111;
    border-color: #111;
    background: var(--accent);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.notice-card {
    margin: 0 0 16px;
    padding: 12px 14px;
    border: 1px solid #bfdbfe;
    border-radius: var(--radius);
    color: #17345f;
    background: #eff6ff;
    font-weight: 750;
}

.notice-card.warning {
    border-color: #fed7aa;
    color: #7c2d12;
    background: #fff7ed;
}

.row-expander {
    width: 28px;
    height: 28px;
    border: 1px solid #b8c8dc;
    border-radius: 8px;
    background: #fff;
    color: #2563eb;
    font-weight: 900;
}

.invoice-row,
.lote-row {
    cursor: pointer;
}

.detail-row > td {
    background: #f8fbff;
    padding: 0;
}

.expanded-box {
    padding: 16px;
    border-top: 1px solid #dbe6f5;
}

.expanded-box h3 {
    margin: 0 0 10px;
    font-size: 16px;
    color: #172238;
}

.table-wrap.compact table {
    min-width: 980px;
}

.approval-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 12px;
}

.approval-note {
    display: block;
    margin: 0 0 12px;
    color: #536882;
    font-weight: 800;
}

.approval-note textarea,
.line-note,
.signature-editor input {
    width: 100%;
    border: 1px solid #cbd7e6;
    border-radius: 8px;
    padding: 9px 10px;
    background: #fff;
    color: #15223a;
}

.approval-note textarea {
    min-height: 68px;
    margin-top: 6px;
}

.line-note {
    min-width: 220px;
    min-height: 46px;
    resize: vertical;
}

.decision-select {
    min-width: 160px;
    border: 1px solid #cbd7e6;
    border-radius: 8px;
    padding: 8px;
    background: #fff;
}

.signature-editor {
    display: grid;
    gap: 14px;
}

.signature-editor label {
    display: grid;
    gap: 6px;
    color: #536882;
    font-weight: 800;
}

.signature-options {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.signature-option {
    display: grid;
    gap: 6px;
    align-items: center;
    justify-items: center;
    min-height: 112px;
    padding: 8px;
    border: 1px solid #d5e0ef;
    border-radius: 10px;
    background: #fff;
    color: #536882;
    font-weight: 850;
    cursor: pointer;
    transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.signature-option:hover,
.signature-option.active {
    border-color: #2563eb;
    box-shadow: 0 12px 24px rgba(37, 99, 235, 0.14);
    transform: translateY(-1px);
}

.signature-option.active {
    background: #eef5ff;
    color: #12315f;
}

.signature-option img {
    width: 100%;
    height: 70px;
    object-fit: contain;
    border-radius: 8px;
    background: #fff;
}

.signature-preview {
    height: 150px;
    min-height: 150px;
    display: grid;
    place-items: center;
    border: 1px dashed #b7c8df;
    border-radius: 10px;
    background: #f8fbff;
    overflow: hidden;
}

.signature-preview img {
    width: 100%;
    height: 132px;
    max-width: 100%;
    max-height: 132px;
    object-fit: contain;
}

@media (max-width: 760px) {
    .signature-options {
        grid-template-columns: 1fr;
    }
}

.portal-toast {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 5000;
    padding: 12px 16px;
    border-radius: 10px;
    color: #fff;
    background: #111827;
    box-shadow: 0 18px 38px rgba(15, 23, 42, 0.2);
    font-weight: 850;
    transition: opacity .24s ease, transform .24s ease;
}

.portal-toast.out {
    opacity: 0;
    transform: translateY(8px);
}

.metric-card.gold {
    border-left-color: #d7b400;
}

.metric-card.green {
    border-left-color: #73b936;
}

.metric-card.cyan {
    border-left-color: #0b9dcc;
}

.metric-card.orange {
    border-left-color: #f09933;
}

.tms-board {
    display: grid;
    gap: 14px;
}

.tms-lane {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    background: #fff;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.045);
}

.tms-lane header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    color: #111;
    background: #faf7ec;
    font-weight: 900;
}

.tms-lane.gold header {
    background: #fff7c8;
}

.tms-lane.green header {
    background: #e7f8d6;
}

.tms-lane.cyan header {
    background: #e4f7ff;
}

.tms-lane.orange header {
    background: #fff0dc;
}

.lane-table {
    border: 0;
    border-radius: 0;
}

.guides-table .guide-row {
    cursor: pointer;
}

.guides-table .guide-row:hover td {
    background: #fff9e7;
}

.guide-detail-row td {
    padding: 0;
    background: #fffdf4;
}

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

.guide-detail h3 {
    margin: 0 0 12px;
    font-size: 15px;
}

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

.icon-btn,
.link-btn {
    border-radius: 7px;
    border: 1px solid #111;
    background: #fff7ce;
    color: #111;
    font-weight: 850;
}

.icon-btn {
    min-height: 30px;
    padding: 6px 8px;
    font-size: 12px;
}

.link-btn {
    padding: 3px 6px;
    background: transparent;
    border-color: transparent;
    text-decoration: underline;
}

.pagination-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding-top: 12px;
    color: var(--muted);
    font-size: 13px;
}

.pagination-bar > div {
    display: flex;
    gap: 8px;
}

.pagination-bar button:disabled {
    cursor: not-allowed;
    opacity: 0.45;
}

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

.detail-item {
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fffdf4;
}

.detail-item span {
    display: block;
    margin-bottom: 5px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

.detail-item strong {
    display: block;
    font-size: 13px;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-bottom: 16px;
}

.attachment-list {
    display: grid;
    gap: 8px;
}

.attachment-link {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    color: var(--ink);
    background: #fffdf4;
    text-decoration: none;
}

.attachment-link img {
    width: 86px;
    height: 58px;
    object-fit: cover;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
}

.attachment-link > span {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.attachment-link:hover {
    border-color: var(--accent);
}

.attachment-link small {
    color: var(--muted);
    font-size: 12px;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 780px;
}

th,
td {
    padding: 11px 12px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    font-size: 13px;
    vertical-align: top;
}

th {
    color: #303030;
    background: #faf7ec;
    font-size: 11px;
    letter-spacing: 0;
    text-transform: uppercase;
}

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

.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 999px;
    color: #111;
    background: #f1eee5;
    font-size: 11px;
    font-weight: 900;
}

.badge.green {
    color: #107243;
    background: #def9e9;
}

.badge.yellow {
    color: #815900;
    background: #ffe59b;
}

.badge.gray {
    color: #52647e;
    background: #edf1f6;
}

.empty {
    padding: 24px;
    color: var(--muted);
    text-align: center;
}

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

.placeholder {
    max-width: 860px;
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
}

.placeholder h2 {
    margin-top: 0;
}

.placeholder-list {
    display: grid;
    gap: 10px;
    margin: 18px 0 0;
    padding: 0;
    list-style: none;
}

.placeholder-list li {
    padding: 12px;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: #fffdf4;
}

.modal-layer {
    position: fixed;
    inset: 0;
    z-index: 12000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 18px;
    background: rgba(0, 0, 0, 0.55);
}

.modal-layer.open {
    display: flex;
}

.modal {
    width: min(920px, 100%);
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 12px;
    background: #fff;
    box-shadow: var(--shadow);
}

.modal-head {
    position: relative;
    top: 0;
    z-index: 3;
    flex: 0 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 16px 18px;
    color: #111;
    background: var(--accent);
}

.modal-head h3 {
    margin: 0;
    font-size: 17px;
}

.modal-title-wrap {
    min-width: 0;
}

.modal-head.has-current-status {
    align-items: center;
}

.modal-head.has-current-status h3 {
    line-height: 1.2;
}

.modal-current-status {
    display: grid;
    gap: 2px;
    min-width: 196px;
    max-width: 340px;
    padding: 8px 13px;
    border: 1px solid rgba(255, 255, 255, 0.42);
    border-radius: 8px;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.16);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.26), 0 10px 24px rgba(15, 23, 42, 0.12);
}

.modal-current-status span {
    color: rgba(255, 255, 255, 0.78);
    font-size: 10px;
    font-weight: 900;
    line-height: 1;
    text-transform: uppercase;
}

.modal-current-status strong {
    color: #ffffff;
    font-size: 19px;
    font-weight: 900;
    line-height: 1.08;
    overflow-wrap: anywhere;
}

.modal-close {
    min-width: 34px;
    height: 34px;
    border: 0;
    border-radius: 8px;
    background: #111;
    color: #fff;
    font-weight: 900;
}

.modal-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    padding: 18px;
}

.timeline {
    display: grid;
    gap: 12px;
}

.timeline-item {
    padding: 13px;
    border: 1px solid var(--line);
    border-left: 4px solid var(--accent);
    border-radius: var(--radius);
    background: #fffdf4;
}

.timeline-item strong {
    display: block;
    margin-bottom: 5px;
}

.timeline-item span {
    display: block;
    color: var(--muted);
    font-size: 13px;
}

.guide-history-track {
    position: relative;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px 24px;
    align-items: start;
}

.guide-history-track:not(.is-single)::before {
    content: "";
    position: absolute;
    top: 10px;
    bottom: 10px;
    left: 50%;
    width: 2px;
    background: #d7e3f2;
    transform: translateX(-50%);
}

.guide-history-track.is-single {
    grid-template-columns: 1fr;
}

.guide-history-group {
    position: relative;
    align-self: start;
    overflow: hidden;
    border: 1px solid #cfdbea;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.07);
}

.guide-history-group.is-mercaderia-start {
    border-color: #bdd1f3;
    background: #f8fbff;
}

.guide-history-group.is-left {
    grid-column: 1;
}

.guide-history-group.is-right {
    grid-column: 2;
    margin-top: 28px;
}

.guide-history-track.is-single .guide-history-group {
    grid-column: 1;
    margin-top: 0;
}

.guide-history-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 13px 16px;
    border-bottom: 1px solid #dce7f4;
    background: #f1f7ff;
}

.guide-history-head.is-mercaderia-start {
    background: linear-gradient(180deg, #eef6ff, #f8fbff);
}

.guide-history-head span {
    display: block;
    color: #5b6b82;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}

.guide-history-head.is-mercaderia-start span {
    color: #155eef;
}

.guide-history-head strong {
    display: block;
    margin-top: 3px;
    color: #102a56;
    font-size: 20px;
    line-height: 1;
}

.guide-history-head.is-mercaderia-start strong {
    font-size: 30px;
    letter-spacing: 0;
}

.guide-history-head small {
    flex: 0 0 auto;
    padding: 5px 9px;
    border-radius: 999px;
    color: #155eef;
    background: #eaf2ff;
    font-size: 12px;
    font-weight: 900;
}

.guide-history-summary {
    display: grid;
    gap: 7px;
    padding: 12px 16px;
    border-bottom: 1px solid #e4edf7;
    background: #fbfdff;
}

.guide-history-summary.is-mercaderia-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 14px;
    background: #ffffff;
}

.guide-history-summary span,
.guide-history-meta span {
    display: block;
    color: #46566c;
    font-size: 12px;
    line-height: 1.35;
}

.guide-history-summary b,
.guide-history-meta b {
    display: block;
    margin-bottom: 2px;
    color: #172033;
    font-size: 11px;
    text-transform: uppercase;
}

.guide-history-events {
    position: relative;
    display: grid;
    gap: 11px;
    margin: 0;
    padding: 14px 16px 16px 42px;
    list-style: none;
}

.guide-history-events::before {
    content: "";
    position: absolute;
    top: 18px;
    bottom: 18px;
    left: 25px;
    width: 2px;
    background: #d9e5f3;
}

.guide-history-event {
    position: relative;
}

.guide-history-marker {
    position: absolute;
    top: 10px;
    left: -27px;
    z-index: 1;
    display: grid;
    width: 24px;
    height: 24px;
    place-items: center;
    border: 2px solid #fff;
    border-radius: 50%;
    color: #fff;
    background: #155eef;
    box-shadow: 0 4px 12px rgba(21, 94, 239, 0.24);
    font-size: 11px;
    font-weight: 900;
}

.guide-history-event-body {
    padding: 11px;
    border: 1px solid #e0e9f4;
    border-radius: 8px;
    background: #ffffff;
}

.guide-history-event.is-milestone-event .guide-history-marker {
    top: 14px;
    left: -31px;
    width: 32px;
    height: 32px;
    background: #f59e0b;
    box-shadow: 0 0 0 5px rgba(245, 158, 11, 0.16), 0 10px 22px rgba(245, 158, 11, 0.28);
    font-size: 12px;
}

.guide-history-event.is-milestone-desvio .guide-history-marker {
    background: #dc2626;
    box-shadow: 0 0 0 5px rgba(220, 38, 38, 0.16), 0 10px 22px rgba(220, 38, 38, 0.26);
}

.guide-history-event.is-milestone-event .guide-history-event-body {
    border-color: #f59e0b;
    background: #fffbeb;
    box-shadow: inset 5px 0 0 #f59e0b, 0 12px 26px rgba(245, 158, 11, 0.14);
}

.guide-history-event.is-milestone-desvio .guide-history-event-body {
    border-color: #dc2626;
    background: #fff7f7;
    box-shadow: inset 5px 0 0 #dc2626, 0 12px 26px rgba(220, 38, 38, 0.14);
}

.guide-history-event-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}

.guide-history-event-top strong {
    color: #102a56;
    font-size: 14px;
}

.milestone-spotlight {
    margin: 0 0 10px;
    padding: 11px;
    border: 1px solid #f7c35f;
    border-radius: 8px;
    background: #fff7d6;
}

.milestone-spotlight.is-desvio {
    border-color: #f0a4a4;
    background: #ffe8e8;
}

.milestone-spotlight-head {
    display: flex;
    align-items: center;
    gap: 10px;
}

.milestone-spotlight-icon {
    display: grid;
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    place-items: center;
    border-radius: 8px;
    color: #ffffff;
    background: #f59e0b;
    font-weight: 900;
}

.milestone-spotlight.is-desvio .milestone-spotlight-icon {
    background: #dc2626;
}

.milestone-spotlight-head div {
    flex: 1 1 auto;
    min-width: 0;
}

.milestone-spotlight-head b {
    display: block;
    color: #7a4a00;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0;
}

.milestone-spotlight.is-desvio .milestone-spotlight-head b {
    color: #991b1b;
}

.milestone-spotlight-head strong {
    display: block;
    color: #172033;
    font-size: 14px;
    line-height: 1.25;
}

.milestone-spotlight-head em {
    flex: 0 0 auto;
    padding: 5px 8px;
    border-radius: 999px;
    color: #7a4a00;
    background: #ffffff;
    font-size: 11px;
    font-style: normal;
    font-weight: 900;
}

.milestone-spotlight.is-desvio .milestone-spotlight-head em {
    color: #991b1b;
}

.milestone-spotlight-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 12px;
    margin-top: 9px;
}

.milestone-spotlight-meta span {
    color: #4b5563;
    font-size: 12px;
    line-height: 1.35;
}

.milestone-spotlight-meta b {
    display: block;
    color: #172033;
    font-size: 10px;
    text-transform: uppercase;
}

.guide-history-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 12px;
}

@media (max-width: 720px) {
    .guide-history-track,
    .guide-history-track.is-single {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .guide-history-track:not(.is-single)::before {
        display: none;
    }

    .guide-history-group.is-left,
    .guide-history-group.is-right {
        grid-column: 1;
        margin-top: 0;
    }

    .guide-history-head {
        align-items: flex-start;
    }

    .guide-history-meta {
        grid-template-columns: 1fr;
    }

    .milestone-spotlight-head {
        align-items: flex-start;
    }

    .milestone-spotlight-head em {
        white-space: nowrap;
    }

    .milestone-spotlight-meta {
        grid-template-columns: 1fr;
    }

    .guide-history-summary.is-mercaderia-summary {
        grid-template-columns: 1fr;
    }

    .modal-head.has-current-status {
        align-items: stretch;
        flex-wrap: wrap;
    }

    .modal-head.has-current-status .modal-title-wrap {
        flex: 1 1 calc(100% - 46px);
    }

    .modal-current-status {
        order: 3;
        width: 100%;
        max-width: none;
        min-width: 0;
    }
}

.mobile-only {
    display: none;
}

@media (max-width: 1100px) {
    .login-page,
    .portal-shell,
    .dashboard-grid,
    .two-col {
        grid-template-columns: 1fr;
    }

    .login-side {
        padding: 0 6vw 46px;
    }

    .login-card {
        margin: 0;
        width: 100%;
    }

    .sidebar {
        position: relative;
        height: auto;
        display: block;
        padding: 12px;
    }

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

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

    .filter-grid,
    .guide-filter-grid,
    .mercaderia-filter-grid,
    .inventory-advanced-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .inventory-filter-main {
        grid-template-columns: 1fr;
    }

    .inventory-filter-actions {
        justify-content: flex-start;
    }
}

@media (max-width: 720px) {
    .login-copy {
        padding: 30px 18px;
    }

    .feature-grid,
    .metric-grid,
    .visual-kpis,
    .nav-list {
        grid-template-columns: 1fr;
    }

    .main {
        padding: 12px;
    }

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

    .metric-card {
        min-height: 92px;
    }

    .table-card-head,
    .pagination-bar,
    .attachment-link {
        align-items: stretch;
        flex-direction: column;
    }

    .detail-grid {
        grid-template-columns: 1fr;
    }

    .filter-grid,
    .guide-filter-grid,
    .mercaderia-filter-grid,
    .inventory-advanced-grid {
        grid-template-columns: 1fr;
    }

    .inventory-filter-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .estado-row {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .desktop-only {
        display: none;
    }

    .mobile-only {
        display: inline-flex;
    }

    .login-copy h1 {
        font-size: 34px;
    }
}

/* Corporate B2B skin */
body {
    background:
        radial-gradient(circle at 12% 0%, rgba(23, 92, 211, 0.12), transparent 28%),
        linear-gradient(180deg, #f7fbff 0%, var(--bg) 42%, #e9f0f8 100%);
}

.login-page {
    background:
        linear-gradient(120deg, rgba(23, 92, 211, 0.10), transparent 34%),
        linear-gradient(180deg, #fbfdff 0%, #eef4fb 100%);
}

.brand-mark {
    border: 0;
    color: #fff;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    box-shadow: 0 14px 32px rgba(23, 92, 211, 0.25);
}

.eyebrow {
    color: var(--primary);
}

.login-copy h1,
.topbar h1 {
    color: #0b1220;
}

.feature-card,
.login-card,
.visual-panel,
.topbar,
.filter-card,
.panel,
.metric-card,
.table-card,
.user-chip,
.placeholder,
.future-card,
.ops-card {
    border-color: rgba(148, 163, 184, 0.34);
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 18px 44px rgba(15, 23, 42, 0.08);
}

.visual-panel {
    background: linear-gradient(145deg, #ffffff, #eff8ff);
}

.visual-map {
    background:
        linear-gradient(90deg, rgba(14, 165, 233, 0.12) 1px, transparent 1px) 0 0 / 34px 34px,
        linear-gradient(rgba(23, 92, 211, 0.10) 1px, transparent 1px) 0 0 / 34px 34px,
        linear-gradient(135deg, #eff8ff, #ffffff);
}

.route {
    border-top-color: var(--primary);
    border-right-color: var(--accent);
}

.route::before {
    background: var(--primary);
    box-shadow: 0 0 0 6px rgba(23, 92, 211, 0.16);
}

.route::after {
    background: var(--green);
    box-shadow: 0 0 0 6px rgba(18, 183, 106, 0.16);
}

.sidebar {
    background: rgba(255, 255, 255, 0.84);
    backdrop-filter: blur(14px);
    border-color: rgba(148, 163, 184, 0.34);
}

.nav-btn {
    color: #334155;
}

.nav-btn:hover,
.nav-btn.active {
    color: var(--primary-dark);
    background: linear-gradient(90deg, rgba(23, 92, 211, 0.12), rgba(6, 174, 213, 0.08));
    border-color: rgba(23, 92, 211, 0.20);
}

.nav-btn span {
    color: var(--primary);
}

.primary-btn,
.soft-btn,
.ghost-btn,
.danger-btn {
    border-radius: 8px;
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.08);
}

.primary-btn,
.soft-btn {
    color: #fff;
    border-color: transparent;
    background: linear-gradient(135deg, var(--primary), #4f7df3);
}

.primary-btn:hover,
.soft-btn:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
}

.ghost-btn {
    color: #334155;
    background: #fff;
    border-color: #cbd5e1;
}

.danger-btn {
    background: linear-gradient(135deg, var(--red), #fb7185);
}

.readonly {
    color: #047857;
    background: #dcfce7;
}

.metric-card {
    min-height: 108px;
    border-left: 5px solid var(--primary);
}

.metric-card.blue {
    border-left-color: var(--primary);
}

.metric-card.gold {
    border-left-color: #f59e0b;
}

.metric-card.green {
    border-left-color: var(--green);
}

.metric-card.cyan {
    border-left-color: var(--cyan);
}

.metric-card.orange {
    border-left-color: var(--yellow);
}

.metric-card .value {
    color: #172554;
}

.bar-track,
.chart-track {
    background: #e2e8f0;
}

.bar-fill,
.chart-fill {
    background: linear-gradient(90deg, var(--primary), var(--accent));
}

.filter-card {
    background: linear-gradient(180deg, #ffffff, #f7fbff);
}

.filter-field input,
.field input,
select {
    border-color: #cbd5e1;
    background: #fff;
}

.filter-field input:focus,
.field input:focus,
select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(23, 92, 211, 0.12);
}

th {
    color: #475569;
    background: #f1f5f9;
}

td {
    border-bottom-color: #e2e8f0;
}

tbody tr:hover {
    background: #f8fbff;
}

.badge {
    color: #334155;
    background: #e2e8f0;
}

.badge.green {
    color: #027a48;
    background: #d1fadf;
}

.badge.yellow {
    color: #93370d;
    background: #fef0c7;
}

.badge.gray {
    color: #475467;
    background: #eef2f7;
}

.icon-btn,
.link-btn {
    color: var(--primary);
    border-color: rgba(23, 92, 211, 0.35);
    background: #eff6ff;
}

.icon-btn:hover,
.link-btn:hover {
    color: #fff;
    background: var(--primary);
}

.tms-lane {
    background: #fff;
    overflow: hidden;
}

.tms-lane header,
.future-card header,
.ops-card summary {
    color: #0f172a;
    background: #f8fafc;
}

.tms-lane.gold header,
.ops-card.gold summary {
    background: #fffbeb;
}

.tms-lane.green header,
.ops-card.green summary {
    background: #ecfdf3;
}

.tms-lane.cyan header,
.ops-card.cyan summary {
    background: #ecfeff;
}

.tms-lane.orange header,
.ops-card.orange summary {
    background: #fff7ed;
}

.modal-layer {
    background: rgba(15, 23, 42, 0.62);
    backdrop-filter: blur(3px);
}

.modal {
    border: 1px solid rgba(148, 163, 184, 0.36);
    border-radius: 12px;
}

.modal-head {
    color: #fff;
    background: linear-gradient(135deg, var(--primary), var(--accent));
}

.modal-close {
    background: rgba(15, 23, 42, 0.28);
}

.timeline-item {
    border-left-color: var(--primary);
    background: #f8fbff;
}

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

.ops-card {
    overflow: hidden;
}

.ops-card summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 13px 14px;
    cursor: pointer;
    font-weight: 900;
}

.ops-card summary strong,
.future-card header span,
.tms-lane header span {
    display: inline-flex;
    min-width: 34px;
    height: 26px;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    color: var(--primary-dark);
    background: #dbeafe;
}

.today-board,
.future-grid {
    display: grid;
    gap: 12px;
    margin-top: 14px;
}

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

.board-title {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 16px;
    border: 1px solid rgba(148, 163, 184, 0.34);
    border-radius: var(--radius);
    background: linear-gradient(90deg, #ffffff, #f0f7ff);
}

.board-title h2 {
    margin: 0 0 3px;
    font-size: 18px;
}

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

.future-card header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
}

.insight-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin: 14px 0;
}

.insight-card.wide {
    grid-column: span 2;
}

.chart-list {
    display: grid;
    gap: 12px;
}

.chart-row {
    display: grid;
    grid-template-columns: minmax(150px, 0.9fr) minmax(180px, 1.4fr) minmax(110px, 0.5fr);
    align-items: center;
    gap: 12px;
}

.chart-label {
    display: grid;
    gap: 3px;
}

.chart-label span {
    color: var(--muted);
    font-size: 12px;
}

.chart-track {
    height: 12px;
    overflow: hidden;
    border-radius: 999px;
}

.chart-fill {
    height: 100%;
    border-radius: inherit;
}

.rse-filter-grid,
.sustainability-filter-grid {
    grid-template-columns: repeat(6, minmax(130px, 1fr));
}

@media (max-width: 1100px) {
    .ops-strip,
    .today-board,
    .future-grid,
    .insight-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

@media (max-width: 720px) {
    .ops-strip,
    .today-board,
    .future-grid,
    .insight-grid,
    .chart-row {
        grid-template-columns: 1fr;
    }

    .insight-card.wide {
        grid-column: auto;
    }

    .rse-filter-grid,
    .sustainability-filter-grid {
        grid-template-columns: 1fr;
    }
}

/* Enterprise portal refresh */
:root {
    --bg: #f3f6fb;
    --panel: #ffffff;
    --ink: #101828;
    --muted: #667085;
    --line: #d9e2ec;
    --soft: #f6f9fc;
    --primary: #155eef;
    --primary-dark: #0b3b8f;
    --accent: #0891b2;
    --accent-2: #475467;
    --green: #12b76a;
    --yellow: #f79009;
    --red: #f04438;
    --cyan: #0ea5e9;
    --shadow: 0 18px 50px rgba(16, 24, 40, 0.10);
    --radius: 8px;
}

body {
    color: var(--ink);
    background:
        linear-gradient(180deg, #f8fbff 0%, #f3f6fb 38%, #eef3f9 100%);
}

.login-page {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(420px, 1fr) minmax(420px, 0.92fr);
    background:
        linear-gradient(135deg, rgba(21, 94, 239, 0.10), transparent 38%),
        linear-gradient(180deg, #f8fbff 0%, #eef3f9 100%);
}

.login-copy {
    padding: 56px 7vw;
}

.login-brand {
    margin-bottom: 42px;
    color: #0f172a;
}

.brand-mark,
.loading-mark {
    border: 0;
    border-radius: 10px;
    color: #fff;
    background: linear-gradient(135deg, #155eef, #0e7490);
    box-shadow: 0 18px 36px rgba(21, 94, 239, 0.24);
}

.eyebrow {
    color: #155eef;
    letter-spacing: 0;
}

.login-copy h1 {
    max-width: 760px;
    color: #0b1220;
    font-size: clamp(40px, 5vw, 64px);
    line-height: 0.98;
}

.login-copy p {
    max-width: 720px;
    color: #475467;
}

.feature-card {
    min-height: 124px;
    border-color: rgba(21, 94, 239, 0.12);
    background: rgba(255, 255, 255, 0.78);
    box-shadow: 0 14px 34px rgba(16, 24, 40, 0.06);
}

.login-side {
    padding: 44px 6vw 44px 0;
}

.login-card {
    width: min(100%, 560px);
    border: 1px solid rgba(21, 94, 239, 0.14);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 30px 70px rgba(16, 24, 40, 0.16);
}

.visual-panel {
    position: relative;
    overflow: hidden;
    border-color: rgba(21, 94, 239, 0.12);
    background:
        linear-gradient(135deg, rgba(21, 94, 239, 0.10), rgba(8, 145, 178, 0.06)),
        #fff;
}

.visual-panel::after {
    content: "";
    position: absolute;
    inset: auto 18px 18px auto;
    width: 128px;
    height: 128px;
    border-radius: 28px;
    border: 1px solid rgba(21, 94, 239, 0.14);
    background:
        linear-gradient(135deg, rgba(21, 94, 239, 0.12), rgba(8, 145, 178, 0.04));
    transform: rotate(8deg);
}

.visual-map {
    background:
        linear-gradient(90deg, rgba(21, 94, 239, 0.10) 1px, transparent 1px) 0 0 / 34px 34px,
        linear-gradient(rgba(8, 145, 178, 0.10) 1px, transparent 1px) 0 0 / 34px 34px,
        linear-gradient(135deg, #f8fbff, #ffffff);
}

.route {
    border-top-color: #155eef;
    border-right-color: #0891b2;
}

.route::before {
    background: #155eef;
    box-shadow: 0 0 0 6px rgba(21, 94, 239, 0.16);
}

.route::after {
    background: #12b76a;
    box-shadow: 0 0 0 6px rgba(18, 183, 106, 0.16);
}

.portal-shell {
    grid-template-columns: 286px minmax(0, 1fr);
}

.sidebar {
    padding: 18px 16px;
    color: #e5e7eb;
    background:
        linear-gradient(180deg, #101828 0%, #0f172a 100%);
    border-right: 0;
    box-shadow: 18px 0 50px rgba(16, 24, 40, 0.16);
}

.sidebar-brand {
    padding: 8px 4px 18px;
    border-bottom-color: rgba(255, 255, 255, 0.10);
}

.sidebar-brand small {
    color: #94a3b8;
}

.sidebar .brand-mark {
    width: 42px;
    height: 42px;
    box-shadow: 0 12px 28px rgba(21, 94, 239, 0.34);
}

.user-chip {
    border-color: rgba(255, 255, 255, 0.10);
    background: rgba(255, 255, 255, 0.06);
}

.user-chip span {
    color: #cbd5e1;
}

.profile-field label {
    color: #93c5fd;
}

.profile-field select {
    color: #0f172a;
    background: #fff;
}

.nav-list {
    gap: 8px;
}

.nav-btn {
    color: #cbd5e1;
    border-color: rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.02);
}

.nav-btn span {
    min-width: 34px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 7px;
    color: #93c5fd;
    background: rgba(255, 255, 255, 0.06);
    font-size: 11px;
}

.nav-btn:hover,
.nav-btn.active {
    color: #fff;
    border-color: rgba(21, 94, 239, 0.58);
    background: linear-gradient(90deg, rgba(21, 94, 239, 0.88), rgba(8, 145, 178, 0.72));
    box-shadow: 0 14px 30px rgba(21, 94, 239, 0.20);
}

.nav-btn:hover span,
.nav-btn.active span {
    color: #fff;
    background: rgba(255, 255, 255, 0.16);
}

.sidebar-footer .ghost-btn {
    color: #e5e7eb;
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.16);
}

.main {
    padding: 12px 26px 26px;
}

.topbar {
    min-height: 124px;
    padding: 18px 26px;
    border-color: rgba(21, 94, 239, 0.12);
    background:
        linear-gradient(90deg, rgba(21, 94, 239, 0.07), transparent 48%),
        #fff;
    box-shadow: 0 18px 44px rgba(16, 24, 40, 0.07);
}

.topbar h1 {
    color: #101828;
    font-size: 26px;
}

.readonly {
    color: #047857;
    background: #dcfce7;
}

.topbar-logo {
    width: 122px;
    height: 102px;
    flex: 0 0 auto;
    object-fit: contain;
    border-radius: 8px;
    background: #0b1220;
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.16);
}

.subtabs {
    padding: 4px;
    width: fit-content;
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 12px 24px rgba(16, 24, 40, 0.05);
}

.subtab {
    border: 0;
    color: #475467;
    background: transparent;
}

.subtab.active {
    color: #fff;
    background: #155eef;
    box-shadow: 0 12px 24px rgba(21, 94, 239, 0.20);
}

.filter-card,
.panel,
.metric-card,
.table-card,
.future-card,
.ops-card {
    border-color: rgba(148, 163, 184, 0.32);
    background: #fff;
    box-shadow: 0 14px 36px rgba(16, 24, 40, 0.06);
}

.filter-card {
    padding: 14px;
    background: linear-gradient(180deg, #fff, #f8fbff);
}

.filter-field span,
.field label {
    color: #475467;
}

.filter-field input,
.field input,
.field select,
select,
.search-input {
    border-color: #cbd5e1;
    background: #fff;
    color: #101828;
}

.filter-field input:focus,
.field input:focus,
.field select:focus,
select:focus,
.search-input:focus {
    border-color: #155eef;
    box-shadow: 0 0 0 3px rgba(21, 94, 239, 0.12);
}

.primary-btn,
.soft-btn {
    color: #fff;
    border-color: transparent;
    background: linear-gradient(135deg, #155eef, #2563eb);
}

.primary-btn:hover,
.soft-btn:hover {
    background: linear-gradient(135deg, #0b3b8f, #155eef);
}

.ghost-btn {
    color: #344054;
    background: #fff;
    border-color: #cbd5e1;
}

.ghost-btn:hover {
    color: #155eef;
    border-color: rgba(21, 94, 239, 0.42);
    background: #eff6ff;
}

.danger-btn {
    background: #f04438;
}

.metric-card {
    min-height: 104px;
    padding: 17px 18px;
    border-left-width: 4px;
    background:
        linear-gradient(180deg, #fff, #fbfdff);
}

.metric-card .label {
    color: #475467;
}

.metric-card .value {
    color: #101828;
    font-size: 31px;
}

.metric-card .hint {
    color: #667085;
}

.metric-card.gold {
    border-left-color: #eab308;
}

.metric-card.green {
    border-left-color: #12b76a;
}

.metric-card.cyan {
    border-left-color: #0ea5e9;
}

.metric-card.orange {
    border-left-color: #f79009;
}

.table-wrap {
    border-color: #d9e2ec;
    background: #fff;
}

table {
    min-width: 900px;
}

th {
    color: #475467;
    background: #f3f6fb;
    border-bottom: 1px solid #d9e2ec;
}

td {
    color: #344054;
    border-bottom-color: #e5edf5;
}

tbody tr:hover td {
    background: #f8fbff;
}

.guides-table .guide-row:hover td {
    background: #f1f7ff;
}

.guide-detail-row td {
    background: #f8fbff;
}

.guide-detail {
    border-top-color: #d9e2ec;
}

.icon-btn,
.link-btn {
    color: #155eef;
    border-color: rgba(21, 94, 239, 0.28);
    background: #eff6ff;
}

.icon-btn:hover,
.link-btn:hover {
    color: #fff;
    background: #155eef;
}

.inventory-row-actions {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 100px;
}

.inventory-row-actions .icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    text-decoration: none;
    white-space: nowrap;
}

.inventory-row-actions .icon-btn.is-disabled,
.inventory-row-actions .icon-btn:disabled,
.inventory-row-actions .icon-btn.is-disabled:hover,
.inventory-row-actions .icon-btn:disabled:hover {
    color: #94a3b8;
    border-color: #d6e0ec;
    background: #f3f6fa;
    box-shadow: none;
    cursor: not-allowed;
}

.guide-detail-link {
    font-size: 12px;
    font-weight: 900;
    text-align: left;
}

.guide-modal-detail h4 {
    margin: 14px 0 10px;
}

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

.badge {
    color: #344054;
    background: #eef2f7;
}

.badge.green {
    color: #027a48;
    background: #d1fadf;
}

.badge.yellow {
    color: #93370d;
    background: #fef0c7;
}

.ops-strip,
.today-board,
.future-grid,
.insight-grid {
    gap: 14px;
}

.ops-card summary,
.future-card header,
.tms-lane header {
    background: #f8fbff;
}

.ops-card.gold summary,
.tms-lane.gold header {
    background: #fffbeb;
}

.ops-card.green summary,
.tms-lane.green header {
    background: #ecfdf3;
}

.ops-card.cyan summary,
.tms-lane.cyan header {
    background: #ecfeff;
}

.ops-card.orange summary,
.tms-lane.orange header {
    background: #fff7ed;
}

.board-title {
    background:
        linear-gradient(90deg, rgba(21, 94, 239, 0.08), transparent),
        #fff;
}

.chart-row {
    padding: 10px;
    border: 1px solid #e5edf5;
    border-radius: 8px;
    background: #fbfdff;
}

.bar-track,
.chart-track {
    background: #e5edf5;
}

.bar-fill,
.chart-fill {
    background: linear-gradient(90deg, #155eef, #0891b2);
}

.modal-layer {
    background: rgba(15, 23, 42, 0.66);
    backdrop-filter: blur(4px);
}

.modal {
    border: 1px solid rgba(148, 163, 184, 0.34);
    border-radius: 12px;
}

.modal-head {
    color: #fff;
    background: linear-gradient(135deg, #155eef, #0891b2);
}

.modal-close {
    color: #fff;
    background: rgba(15, 23, 42, 0.28);
}

.timeline-item,
.detail-item,
.attachment-link,
.placeholder-list li {
    background: #f8fbff;
}

.provider-form {
    display: grid;
    gap: 12px;
}

.provider-form-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(180px, 1fr));
    gap: 12px;
}

.field span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
}

.field.wide {
    grid-column: span 2;
}

.compact-input {
    width: 100%;
    min-width: 90px;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--ink);
    outline: none;
}

.compact-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(255, 196, 0, 0.18);
}

.field textarea {
    width: 100%;
    min-height: 78px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    color: var(--ink);
    resize: vertical;
    outline: none;
}

.field textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(255, 196, 0, 0.2);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
}

.mini-list {
    display: grid;
    gap: 8px;
    margin-top: 12px;
}

.mini-row {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    color: var(--ink);
    text-align: left;
}

.mini-row:hover {
    border-color: #bdd4ff;
    background: #f8fbff;
}

.mini-row.static {
    cursor: default;
}

.mini-row span {
    color: var(--muted);
    font-size: 12px;
}

.soft-link {
    color: var(--primary);
    font-weight: 800;
    text-decoration: none;
}

.soft-link:hover {
    text-decoration: underline;
}

@media (max-width: 1100px) {
    .portal-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: relative;
        height: auto;
        display: block;
        border-bottom: 1px solid rgba(255, 255, 255, 0.10);
    }

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

    .login-page {
        grid-template-columns: 1fr;
    }

    .provider-form-grid {
        grid-template-columns: repeat(2, minmax(180px, 1fr));
    }

    .login-side {
        padding: 0 7vw 48px;
    }
}

@media (max-width: 720px) {
    .main {
        padding: 14px;
    }

    .sidebar {
        padding: 14px;
    }

    .nav-list {
        grid-template-columns: 1fr;
    }

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

    .topbar {
        min-height: auto;
        padding: 18px;
    }

    .login-copy {
        padding: 34px 20px;
    }

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

.brand-logo {
    display: block;
    object-fit: contain;
    border-radius: 10px;
    background: #0b1220;
    box-shadow: 0 14px 32px rgba(15, 23, 42, 0.18);
}

.brand-logo-login {
    width: 132px;
    height: 88px;
}

.brand-logo-sidebar {
    width: 88px;
    height: 64px;
    flex: 0 0 auto;
}

.sidebar-brand-text {
    transform: translate(8px, -6px);
    line-height: 1.25;
}

.sidebar-brand-text > div {
    font-size: 16px;
}

.loading-logo {
    width: 136px;
    max-height: 92px;
    object-fit: contain;
    border-radius: 14px;
    background: #0b1220;
    box-shadow: var(--shadow);
}

@media (max-width: 720px) {
    .topbar-logo {
        width: 96px;
        height: 78px;
    }
}

.travel-metric,
.travel-card {
    cursor: pointer;
}

.travel-metric {
    width: 100%;
    text-align: left;
    border-top: 1px solid var(--border);
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.travel-metric:hover,
.travel-card:hover {
    box-shadow: 0 16px 34px rgba(15, 23, 42, 0.12);
    transform: translateY(-1px);
}

.modal-summary {
    display: inline-flex;
    align-items: baseline;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    background: #eaf2ff;
    color: #155eef;
    font-weight: 800;
    margin-bottom: 12px;
}

.modal-summary span {
    color: #536579;
    font-size: 12px;
}

.profile-settings {
    display: grid;
    gap: 16px;
}

.profile-detail-grid {
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    margin-bottom: 0;
}

.profile-password-form {
    display: grid;
    gap: 10px;
    padding: 14px;
    border: 1px solid #dbe5f3;
    border-radius: 8px;
    background: #f8fbff;
}

.profile-password-form h4 {
    margin: 0 0 2px;
    color: #142033;
    font-size: 16px;
}

.profile-password-form .field {
    margin-bottom: 0;
}

.profile-password-form .modal-actions {
    margin: 4px 0 0;
}

.profile-feedback {
    min-height: 18px;
    color: #047857;
    font-size: 12px;
    font-weight: 800;
}

.profile-feedback.is-error {
    color: #b42318;
}

.profile-password-form button:disabled {
    opacity: 0.7;
    cursor: progress;
}

.modal-table table {
    min-width: 1180px;
}

.modal.modal-wide {
    width: min(1240px, calc(100vw - 36px));
    max-height: min(92vh, calc(100vh - 28px));
}

.modal.modal-wide .modal-body {
    padding: 20px 22px 22px;
}

.guide-modal-detail,
.mercaderia-modal-detail {
    display: grid;
    gap: 14px;
}

.guide-modal-detail .detail-grid,
.mercaderia-modal-detail .detail-grid {
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 12px;
    margin-bottom: 0;
}

.guide-modal-detail .compact-detail-grid {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.modal.modal-wide .detail-item {
    padding: 13px 14px;
}

.modal.modal-wide .detail-item strong {
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.guide-modal-detail h4,
.mercaderia-modal-detail h4 {
    margin: 4px 0 0;
}

.mercaderia-modal-actions {
    margin: 0;
}

.sku-detail-table table {
    min-width: 0;
    table-layout: fixed;
}

.sku-detail-table th,
.sku-detail-table td {
    white-space: normal;
    overflow-wrap: anywhere;
}

.sku-detail-table th:nth-child(1),
.sku-detail-table td:nth-child(1) {
    width: 14%;
}

.sku-detail-table th:nth-child(2),
.sku-detail-table td:nth-child(2) {
    width: 42%;
}

.sku-detail-table th:nth-child(n+3),
.sku-detail-table td:nth-child(n+3) {
    width: 14.66%;
    text-align: right;
}

@media (max-width: 720px) {
    .modal-layer {
        padding: 10px;
    }

    .modal.modal-wide {
        width: 100%;
        max-height: calc(100vh - 20px);
    }

    .modal.modal-wide .modal-body {
        padding: 14px;
    }

    .guide-modal-detail .detail-grid,
    .mercaderia-modal-detail .detail-grid {
        grid-template-columns: 1fr;
    }

    .sku-detail-table {
        overflow-x: auto;
    }

    .sku-detail-table table {
        min-width: 720px;
        table-layout: auto;
    }
}

/* Portal B2B login redesign: visual-only layer. Auth ids, API calls and security flow stay unchanged. */
.login-page {
    --login-bg: #050b18;
    --login-panel: rgba(15, 23, 42, 0.78);
    --login-panel-strong: rgba(17, 25, 42, 0.94);
    --login-line: rgba(148, 163, 184, 0.22);
    --login-text: #f8fbff;
    --login-muted: #cbd5e1;
    --login-soft: #8ea0b8;
    --login-cyan: #18d5d0;
    --login-teal: #18b994;
    --login-violet: #8b5cf6;
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(420px, 0.78fr);
    grid-template-rows: 102px minmax(0, 1fr) auto;
    color: var(--login-text);
    background:
        linear-gradient(90deg, rgba(148, 163, 184, 0.06) 1px, transparent 1px) 0 0 / 40px 40px,
        linear-gradient(rgba(148, 163, 184, 0.06) 1px, transparent 1px) 0 0 / 40px 40px,
        radial-gradient(circle at 7% 18%, rgba(24, 213, 208, 0.12), transparent 25%),
        radial-gradient(circle at 84% 12%, rgba(24, 185, 148, 0.16), transparent 28%),
        linear-gradient(180deg, #071120 0%, #081426 58%, #0a1730 100%);
}

.login-topbar {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: minmax(220px, 1fr) auto minmax(220px, 1fr);
    align-items: center;
    gap: 22px;
    min-height: 102px;
    padding: 22px 30px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.20);
    background: rgba(5, 11, 24, 0.74);
    backdrop-filter: blur(10px);
}

.login-topbar-brand {
    display: flex;
    align-items: center;
    gap: 18px;
}

.login-isotipo,
.login-page .brand-logo-login {
    width: 60px;
    height: 60px;
    flex: 0 0 auto;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 8px;
    background: #0b1323;
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.30);
    object-fit: cover;
}

.login-topbar-brand strong {
    color: var(--login-cyan);
    font-size: 21px;
    font-weight: 900;
}

.login-topbar-links {
    display: flex;
    align-items: center;
    gap: 38px;
    color: #dbe4f0;
    font-size: 18px;
    font-weight: 850;
}

.login-topbar-links span {
    position: relative;
}

.login-topbar-links .active {
    color: #f8fbff;
}

.login-topbar-links .active::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -9px;
    height: 3px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--login-teal), var(--login-cyan));
}

.login-topbar-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 18px;
}

.login-topbar-actions span {
    width: 36px;
    height: 36px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 50%;
    background:
        radial-gradient(circle at 50% 50%, rgba(24, 213, 208, 0.26), transparent 45%),
        rgba(15, 23, 42, 0.64);
}

.login-copy {
    grid-column: 1;
    grid-row: 2;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
    padding: 52px 30px 62px;
}

.login-brand {
    display: none;
}

.login-page .eyebrow {
    color: var(--login-cyan);
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

.login-copy h1 {
    max-width: 760px;
    margin: 0 0 30px;
    color: #f8fbff;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 54px;
    line-height: 1.16;
    font-weight: 900;
    text-shadow: 0 2px 0 rgba(255, 255, 255, 0.10);
}

.login-copy h1 span {
    color: var(--login-cyan);
}

.login-copy > p {
    max-width: 880px;
    margin: 0;
    color: var(--login-muted);
    font-size: 24px;
    line-height: 1.48;
}

.login-pill-row {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    margin-top: 42px;
}

.login-pill-row span {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    padding: 0 22px;
    border: 1px solid rgba(24, 213, 208, 0.34);
    border-radius: 999px;
    color: var(--login-cyan);
    background: rgba(24, 213, 208, 0.05);
    box-shadow: 0 0 22px rgba(24, 213, 208, 0.10);
    font-size: 14px;
    font-weight: 900;
    text-transform: uppercase;
}

.login-pill-row span:nth-child(2) {
    color: #a78bfa;
    border-color: rgba(139, 92, 246, 0.40);
    background: rgba(139, 92, 246, 0.05);
}

.quick-access {
    grid-column: 1 / -1;
    grid-row: 3;
    margin-top: 0;
    padding: 18px 30px 86px;
}

.quick-access h3 {
    margin: 0 0 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.26);
    color: #f8fbff;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 28px;
    font-weight: 900;
}

.login-page .feature-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 30px;
    margin: 0;
}

.login-page .feature-card {
    min-height: 292px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 30px;
    border: 1px solid rgba(148, 163, 184, 0.24);
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.62);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 22px 54px rgba(0, 0, 0, 0.22);
}

.login-page .feature-icon {
    width: 60px;
    height: 60px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(24, 213, 208, 0.40);
    border-radius: 8px;
    color: var(--login-cyan);
    background: rgba(24, 213, 208, 0.12);
    font-size: 14px;
    font-weight: 900;
}

.login-page .feature-icon.vendor {
    color: #a78bfa;
    border-color: rgba(139, 92, 246, 0.45);
    background: rgba(139, 92, 246, 0.14);
}

.login-page .feature-icon.staff {
    color: #93c5fd;
    border-color: rgba(59, 130, 246, 0.45);
    background: rgba(59, 130, 246, 0.14);
}

.login-page .feature-card small {
    align-self: flex-end;
    color: #dbe4f0;
    font-size: 14px;
    font-weight: 900;
    text-transform: uppercase;
}

.login-page .feature-card strong {
    margin: 12px 0 10px;
    color: #f8fbff;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 23px;
    font-weight: 900;
}

.login-page .feature-card span {
    display: block;
    min-height: 42px;
    padding: 11px 14px;
    border: 1px solid rgba(148, 163, 184, 0.20);
    border-radius: 8px;
    color: #dbe4f0;
    background: rgba(3, 9, 20, 0.34);
    font-size: 14px;
    font-weight: 800;
}

.login-side {
    grid-column: 2;
    grid-row: 2;
    display: flex;
    align-items: start;
    justify-content: center;
    padding: 24px 30px 42px 12px;
}

.login-card {
    width: min(100%, 625px);
    margin: 0;
    padding: 48px 40px 34px;
    border: 1px solid rgba(24, 213, 208, 0.26);
    border-radius: 8px;
    color: #f8fbff;
    background:
        radial-gradient(circle at 92% 18%, rgba(24, 185, 148, 0.16), transparent 38%),
        rgba(15, 23, 42, 0.86);
    box-shadow: 0 26px 70px rgba(0, 0, 0, 0.30), inset 0 1px 0 rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(16px);
}

.login-card h2 {
    margin: 0 0 26px;
    color: #f8fbff;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 30px;
    font-weight: 900;
}

.login-card .sub {
    margin: -16px 0 30px;
    color: var(--login-soft);
    font-size: 13px;
    line-height: 1.5;
}

.login-page .field {
    display: grid;
    gap: 10px;
    margin-bottom: 26px;
}

.login-page .field label {
    color: #dbe4f0;
    font-size: 13px;
    font-weight: 900;
    text-transform: uppercase;
}

.login-page .field input {
    width: 100%;
    min-height: 54px;
    padding: 14px 15px;
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 0;
    color: #111827;
    background: #ffffff;
    outline: none;
    font-size: 17px;
    font-weight: 750;
}

.login-page .field input:focus {
    border-color: var(--login-cyan);
    box-shadow: 0 0 0 3px rgba(24, 213, 208, 0.16);
}

.login-security-note {
    margin: -6px 0 24px;
    color: var(--login-cyan);
    font-size: 13px;
    font-weight: 800;
}

.login-page .primary-btn.login-submit {
    width: 100%;
    min-height: 70px;
    margin-top: 4px;
    border: 0;
    border-radius: 8px;
    color: #03111f;
    background: linear-gradient(90deg, var(--login-teal), #11bad0);
    box-shadow: 0 0 28px rgba(24, 213, 208, 0.18);
    font-size: 20px;
    font-family: Georgia, "Times New Roman", serif;
    font-weight: 900;
}

.login-page .primary-btn.login-submit:hover,
.login-page .primary-btn.login-submit:focus {
    background: linear-gradient(90deg, #20d4ad, #25d5ea);
}

.login-page .primary-btn.login-submit:disabled {
    opacity: 0.68;
    cursor: not-allowed;
}

.login-error {
    margin-top: 16px;
    border-color: rgba(248, 113, 113, 0.34);
    color: #fecaca;
    background: rgba(127, 29, 29, 0.32);
}

.login-secure-channel {
    margin-top: 26px;
    color: var(--login-soft);
    text-align: center;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

.login-footer {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 22px;
    min-height: 72px;
    padding: 20px 30px;
    border-top: 1px solid rgba(148, 163, 184, 0.22);
    color: #dbe4f0;
    background: rgba(5, 11, 24, 0.58);
    font-size: 13px;
    font-weight: 800;
}

.login-footer span {
    color: #aab8ca;
}

@media (max-width: 1180px) {
    .login-page {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto auto;
    }

    .login-topbar {
        grid-template-columns: 1fr;
        justify-items: start;
    }

    .login-topbar-links,
    .login-topbar-actions {
        display: none;
    }

    .login-copy,
    .login-side {
        grid-column: 1;
        grid-row: auto;
        padding-left: 26px;
        padding-right: 26px;
    }

    .login-side {
        justify-content: flex-start;
        padding-top: 0;
    }

    .login-page .feature-grid {
        grid-template-columns: 1fr;
        max-width: 760px;
    }

    .quick-access {
        grid-column: 1;
        grid-row: auto;
        padding: 14px 26px 62px;
    }
}

@media (max-width: 720px) {
    .login-topbar {
        min-height: 82px;
        padding: 16px 18px;
    }

    .login-isotipo {
        width: 50px;
        height: 50px;
    }

    .login-topbar-brand strong {
        font-size: 18px;
    }

    .login-copy {
        padding: 34px 18px 26px;
    }

    .login-copy h1 {
        font-size: 40px;
        line-height: 1.12;
    }

    .login-copy > p {
        font-size: 17px;
    }

    .login-pill-row {
        margin-top: 28px;
    }

    .quick-access {
        margin-top: 0;
        padding: 12px 18px 46px;
    }

    .login-side {
        padding: 4px 18px 30px;
    }

    .login-card {
        padding: 30px 20px 24px;
    }

    .login-page .field input {
        font-size: 15px;
    }

    .login-page .primary-btn.login-submit {
        min-height: 58px;
        font-size: 16px;
    }

    .login-footer {
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
        padding: 18px;
    }
}

/* B2B authenticated command center skin. Visual layer only. */
.portal-shell {
    --cmd-bg: #07101f;
    --cmd-panel: rgba(12, 22, 39, 0.88);
    --cmd-panel-strong: rgba(16, 28, 49, 0.96);
    --cmd-line: rgba(148, 163, 184, 0.24);
    --cmd-line-strong: rgba(103, 232, 249, 0.40);
    --cmd-text: #eef4ff;
    --cmd-muted: #aeb8ca;
    --cmd-soft: #d7e2f4;
    --cmd-cyan: #51d8f2;
    --cmd-teal: #19c9ac;
    --cmd-blue: #2456d9;
    --cmd-purple: #8a5cf6;
    min-height: 100vh;
    grid-template-columns: 350px minmax(0, 1fr);
    color: var(--cmd-text);
    background:
        linear-gradient(rgba(79, 216, 242, 0.055) 1px, transparent 1px),
        linear-gradient(90deg, rgba(79, 216, 242, 0.055) 1px, transparent 1px),
        radial-gradient(circle at 72% 12%, rgba(28, 184, 211, 0.14), transparent 30%),
        radial-gradient(circle at 18% 90%, rgba(36, 86, 217, 0.12), transparent 34%),
        var(--cmd-bg);
    background-size: 40px 40px, 40px 40px, auto, auto, auto;
}

.portal-shell .sidebar {
    padding: 30px 20px 22px;
    color: var(--cmd-text);
    background:
        linear-gradient(90deg, rgba(255, 255, 255, 0.05), transparent 1px),
        linear-gradient(180deg, rgba(11, 22, 39, 0.96), rgba(9, 17, 31, 0.98));
    border-right: 1px solid rgba(148, 163, 184, 0.18);
    box-shadow: 24px 0 70px rgba(0, 0, 0, 0.26);
}

.portal-shell .sidebar-brand {
    align-items: center;
    gap: 16px;
    padding: 8px 10px 30px;
    border-bottom: 0;
}

.portal-shell .brand-logo-sidebar {
    width: 60px;
    height: 60px;
    object-fit: contain;
    border-radius: 8px;
    background: rgba(16, 185, 129, 0.10);
    box-shadow: 0 16px 34px rgba(0, 0, 0, 0.28);
}

.portal-shell .sidebar-brand-text {
    transform: none;
    line-height: 1.06;
}

.portal-shell .sidebar-brand-text > div {
    color: var(--cmd-cyan);
    font-size: 30px;
    font-weight: 950;
    letter-spacing: -0.01em;
    text-transform: uppercase;
    text-shadow: 0 0 18px rgba(81, 216, 242, 0.18);
}

.portal-shell .sidebar-brand-text small {
    display: block;
    margin-top: 5px;
    color: #dce5f4;
    font-family: "Consolas", "Courier New", monospace;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.portal-shell .user-chip {
    margin: 8px 0 26px;
    padding: 16px;
    color: var(--cmd-text);
    border: 1px solid rgba(148, 163, 184, 0.20);
    border-radius: 8px;
    background: rgba(15, 25, 43, 0.82);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.portal-shell .user-chip strong {
    color: #f8fbff;
    font-size: 15px;
    font-weight: 900;
}

.portal-shell .user-chip span {
    display: block;
    margin-top: 5px;
    color: var(--cmd-muted);
    font-size: 11px;
    font-weight: 800;
    line-height: 1.35;
    text-transform: uppercase;
}

.portal-shell .profile-field label {
    color: var(--cmd-cyan);
    font-family: "Consolas", "Courier New", monospace;
    letter-spacing: 0.08em;
}

.portal-shell .nav-list {
    gap: 12px;
}

.portal-shell .nav-btn,
.portal-shell .nav-subbtn {
    min-height: 60px;
    border: 1px solid transparent;
    border-radius: 9px;
    color: #d7deeb;
    background: transparent;
    font-family: "Consolas", "Courier New", monospace;
    font-size: 17px;
    font-weight: 900;
    letter-spacing: 0;
    transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.portal-shell .nav-subbtn {
    min-height: 42px;
    padding-left: 68px;
    font-size: 14px;
}

.portal-shell .nav-btn span {
    min-width: 42px;
    height: 42px;
    border-radius: 8px;
    color: var(--cmd-cyan);
    background: rgba(81, 216, 242, 0.10);
}

.portal-shell .nav-btn:hover,
.portal-shell .nav-btn.active,
.portal-shell .nav-subbtn:hover,
.portal-shell .nav-subbtn.active {
    color: var(--cmd-cyan);
    border-color: rgba(81, 216, 242, 0.32);
    background: linear-gradient(90deg, rgba(81, 216, 242, 0.12), rgba(36, 86, 217, 0.05));
    box-shadow: inset 4px 0 0 var(--cmd-cyan);
}

.portal-shell .nav-btn:hover span,
.portal-shell .nav-btn.active span {
    color: #08111f;
    background: var(--cmd-cyan);
}

.portal-shell .nav-parent em {
    color: var(--cmd-cyan);
    background: rgba(81, 216, 242, 0.14);
}

.portal-shell .sidebar-footer {
    margin-top: 28px;
    padding-top: 24px;
    border-top: 1px solid rgba(148, 163, 184, 0.22);
}

.portal-shell .main {
    min-width: 0;
    padding: 0 40px 52px;
    color: var(--cmd-text);
    background:
        linear-gradient(rgba(148, 163, 184, 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(148, 163, 184, 0.08) 1px, transparent 1px);
    background-size: 40px 40px;
}

.portal-shell .main::before {
    content: "Logistics Command";
    display: block;
    min-height: 80px;
    padding: 26px 0 18px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.18);
    color: var(--cmd-cyan);
    font-size: 31px;
    font-weight: 950;
    letter-spacing: 0;
    text-shadow: 0 0 18px rgba(81, 216, 242, 0.22);
}

.portal-shell #viewHost {
    max-width: 1320px;
    margin: 0 auto;
}

.portal-shell .topbar {
    min-height: 170px;
    margin: 0 0 20px;
    padding: 36px 0 18px;
    border: 0;
    border-radius: 0;
    color: var(--cmd-text);
    background: transparent;
    box-shadow: none;
}

.portal-shell .topbar .eyebrow {
    color: var(--cmd-cyan);
    font-family: "Consolas", "Courier New", monospace;
    font-size: 16px;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.portal-shell .topbar h1 {
    margin-top: 12px;
    color: #edf3ff;
    font-size: clamp(42px, 5vw, 64px);
    font-weight: 950;
    line-height: 1;
    text-shadow: 0 18px 34px rgba(0, 0, 0, 0.38);
}

.portal-shell .topbar p {
    max-width: 820px;
    margin-top: 18px;
    color: var(--cmd-soft);
    font-size: 21px;
    line-height: 1.42;
}

.portal-shell .topbar-logo {
    width: 104px;
    height: 78px;
    padding: 8px;
    border: 1px solid rgba(81, 216, 242, 0.18);
    border-radius: 8px;
    background: rgba(11, 19, 35, 0.76);
    box-shadow: 0 18px 38px rgba(0, 0, 0, 0.22);
}

.portal-shell .subtabs {
    justify-content: flex-end;
    width: fit-content;
    margin: -74px 0 40px auto;
    padding: 6px;
    border: 1px solid rgba(148, 163, 184, 0.32);
    border-radius: 9px;
    background: rgba(28, 39, 60, 0.94);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.portal-shell .subtab {
    min-height: 46px;
    padding: 11px 26px;
    border: 0;
    border-radius: 6px;
    color: #d8deea;
    background: transparent;
    font-family: "Consolas", "Courier New", monospace;
    font-size: 17px;
    font-weight: 900;
    letter-spacing: 0.06em;
}

.portal-shell .subtab.active {
    color: #061120;
    background: var(--cmd-cyan);
    box-shadow: 0 0 24px rgba(81, 216, 242, 0.22);
}

.portal-shell .metric-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.portal-shell .metric-card {
    min-height: 242px;
    padding: 28px 30px;
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 12px;
    color: var(--cmd-text);
    background:
        radial-gradient(circle at 82% 18%, rgba(81, 216, 242, 0.08), transparent 28%),
        linear-gradient(180deg, rgba(13, 25, 44, 0.94), rgba(9, 18, 33, 0.92));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 24px 54px rgba(0, 0, 0, 0.20);
}

.portal-shell .metric-card .label {
    color: #d8deea;
    font-family: "Consolas", "Courier New", monospace;
    font-size: 18px;
    letter-spacing: 0.12em;
}

.portal-shell .metric-card .value {
    margin-top: 18px;
    color: #edf3ff;
    max-width: 100%;
    font-size: clamp(48px, 4.4vw, 70px);
    font-weight: 950;
    letter-spacing: 0;
    line-height: 0.95;
    overflow-wrap: normal;
    word-break: normal;
    text-shadow: 0 12px 26px rgba(0, 0, 0, 0.32);
}

.portal-shell .metric-card .hint {
    max-width: 230px;
    margin-top: 16px;
    color: var(--cmd-muted);
    font-family: "Consolas", "Courier New", monospace;
    font-size: 16px;
    line-height: 1.18;
}

.portal-shell .metric-grid .metric-card:nth-child(4) .value {
    font-size: clamp(24px, 1.55vw, 38px);
    line-height: 1.14;
    overflow-wrap: anywhere;
}

.portal-shell .metric-card.gold {
    border-color: rgba(138, 92, 246, 0.42);
}

.portal-shell .metric-card.green {
    border-color: rgba(25, 201, 172, 0.38);
}

.portal-shell .metric-card.cyan {
    border-color: rgba(81, 216, 242, 0.42);
}

.portal-shell .metric-card.orange {
    border-color: rgba(251, 146, 60, 0.38);
}

.portal-shell .dashboard-grid {
    grid-template-columns: minmax(0, 1.25fr) minmax(390px, 0.9fr);
    gap: 30px;
}

.portal-shell .panel,
.portal-shell .table-card,
.portal-shell .filter-card,
.portal-shell .future-card,
.portal-shell .ops-card,
.portal-shell .today-board,
.portal-shell .tms-lane,
.portal-shell .placeholder {
    border: 1px solid rgba(148, 163, 184, 0.26);
    border-radius: 12px;
    color: var(--cmd-text);
    background:
        radial-gradient(circle at 90% 10%, rgba(81, 216, 242, 0.055), transparent 32%),
        var(--cmd-panel);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 24px 56px rgba(0, 0, 0, 0.18);
}

.portal-shell .panel,
.portal-shell .table-card,
.portal-shell .filter-card {
    padding: 30px;
}

.portal-shell .panel h2,
.portal-shell .table-card h2,
.portal-shell .board-title h2 {
    color: #edf3ff;
    font-size: 31px;
    font-weight: 950;
    letter-spacing: 0;
}

.portal-shell .panel .hint,
.portal-shell .table-card .hint,
.portal-shell .board-title .hint,
.portal-shell .hint {
    color: var(--cmd-soft);
    font-size: 18px;
    line-height: 1.45;
}

.portal-shell .estado-bars {
    margin-top: 32px;
}

.portal-shell .estado-row {
    grid-template-columns: minmax(190px, 1fr) minmax(220px, 1.4fr) 58px;
    gap: 24px;
    color: var(--cmd-text);
    font-family: "Consolas", "Courier New", monospace;
    font-size: 17px;
}

.portal-shell .estado-row strong {
    color: #edf3ff;
    font-weight: 900;
}

.portal-shell .estado-row span {
    color: var(--cmd-soft);
    text-align: right;
}

.portal-shell .bar-track,
.portal-shell .chart-track {
    height: 11px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.24);
}

.portal-shell .bar-fill,
.portal-shell .chart-fill {
    background: linear-gradient(90deg, var(--cmd-cyan), var(--cmd-teal));
    box-shadow: 0 0 18px rgba(81, 216, 242, 0.22);
}

.portal-shell .table-wrap {
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 8px;
    background: rgba(5, 12, 24, 0.38);
}

.portal-shell table {
    color: var(--cmd-text);
}

.portal-shell th {
    color: #dce5f4;
    border-bottom: 1px solid rgba(148, 163, 184, 0.22);
    background: rgba(13, 24, 42, 0.92);
    font-family: "Consolas", "Courier New", monospace;
    font-size: 13px;
    letter-spacing: 0.08em;
}

.portal-shell td {
    color: #d7e2f4;
    border-bottom-color: rgba(148, 163, 184, 0.14);
    font-size: 15px;
}

.portal-shell td strong,
.portal-shell .link-btn {
    color: #edf3ff;
}

.portal-shell tbody tr:hover td {
    background: rgba(81, 216, 242, 0.06);
}

.portal-shell .badge {
    border: 1px solid rgba(148, 163, 184, 0.20);
    color: #dce5f4;
    background: rgba(148, 163, 184, 0.14);
    font-family: "Consolas", "Courier New", monospace;
    font-weight: 900;
}

.portal-shell .badge.green {
    color: #22f0bd;
    border-color: rgba(25, 201, 172, 0.36);
    background: rgba(25, 201, 172, 0.14);
}

.portal-shell .badge.yellow {
    color: #c7a7ff;
    border-color: rgba(138, 92, 246, 0.38);
    background: rgba(74, 42, 137, 0.42);
}

.portal-shell .badge.gray {
    color: var(--cmd-cyan);
    border-color: rgba(81, 216, 242, 0.30);
    background: rgba(81, 216, 242, 0.10);
}

.portal-shell .filter-grid label,
.portal-shell .field label,
.portal-shell label {
    color: #dce5f4;
    font-family: "Consolas", "Courier New", monospace;
    font-weight: 900;
    letter-spacing: 0.06em;
}

.portal-shell input:not([type="checkbox"]):not([type="radio"]),
.portal-shell select,
.portal-shell textarea {
    border: 1px solid rgba(148, 163, 184, 0.25);
    color: var(--cmd-text);
    background: rgba(5, 12, 24, 0.52);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.portal-shell input::placeholder,
.portal-shell textarea::placeholder {
    color: rgba(215, 226, 244, 0.54);
}

.portal-shell input:not([type="checkbox"]):not([type="radio"]):focus,
.portal-shell select:focus,
.portal-shell textarea:focus {
    border-color: var(--cmd-cyan);
    box-shadow: 0 0 0 3px rgba(81, 216, 242, 0.16);
}

.portal-shell .primary-btn,
.portal-shell .soft-btn,
.portal-shell .icon-btn {
    color: #061120;
    border-color: transparent;
    background: linear-gradient(90deg, var(--cmd-teal), var(--cmd-cyan));
    box-shadow: 0 0 28px rgba(81, 216, 242, 0.14);
}

.portal-shell .primary-btn:hover,
.portal-shell .soft-btn:hover,
.portal-shell .icon-btn:hover {
    color: #061120;
    background: linear-gradient(90deg, #24dcb9, #6ee7f8);
}

.portal-shell .ghost-btn {
    color: #dce5f4;
    border-color: rgba(148, 163, 184, 0.28);
    background: rgba(12, 22, 39, 0.78);
}

.portal-shell .ghost-btn:hover {
    color: var(--cmd-cyan);
    border-color: rgba(81, 216, 242, 0.42);
    background: rgba(81, 216, 242, 0.08);
}

.portal-shell .danger-btn {
    color: #fff;
    border-color: rgba(248, 113, 113, 0.36);
    background: linear-gradient(135deg, #ef4444, #b91c1c);
}

.portal-shell .empty,
.portal-shell .readonly {
    color: var(--cmd-soft);
    background: rgba(148, 163, 184, 0.12);
}

.modal-layer .modal-card {
    color: var(--cmd-text, #eef4ff);
    border: 1px solid rgba(148, 163, 184, 0.26);
    background:
        radial-gradient(circle at 90% 8%, rgba(81, 216, 242, 0.10), transparent 34%),
        rgba(10, 20, 36, 0.98);
    box-shadow: 0 34px 90px rgba(0, 0, 0, 0.42);
}

.modal-layer .modal-header {
    border-bottom-color: rgba(148, 163, 184, 0.20);
    background: rgba(15, 27, 48, 0.88);
}

.modal-layer .modal-header h3,
.modal-layer .modal-body h2,
.modal-layer .modal-body h3,
.modal-layer .modal-body strong {
    color: #edf3ff;
}

.modal-layer .modal-body,
.modal-layer .modal-body p,
.modal-layer .modal-body span,
.modal-layer .modal-body label {
    color: #d7e2f4;
}

.modal-layer .modal-close {
    color: #061120;
    background: var(--cmd-cyan, #51d8f2);
}

@media (max-width: 1180px) {
    .portal-shell {
        grid-template-columns: 1fr;
    }

    .portal-shell .sidebar {
        position: relative;
        height: auto;
    }

    .portal-shell .main {
        padding: 0 20px 36px;
    }

    .portal-shell .main::before {
        min-height: 64px;
        padding: 20px 0 12px;
    }

    .portal-shell .subtabs {
        margin: 0 0 24px;
    }

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

    .portal-shell .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1500px) {
    .portal-shell .subtabs {
        margin: 0 0 28px auto;
    }

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

    .portal-shell .metric-card {
        min-height: 210px;
    }

    .portal-shell .metric-card .value {
        font-size: clamp(42px, 4vw, 62px);
        line-height: 1;
    }
}

@media (max-width: 720px) {
    .portal-shell .sidebar {
        padding: 22px 14px;
    }

    .portal-shell .main {
        padding: 0 14px 28px;
    }

    .portal-shell .main::before {
        font-size: 24px;
    }

    .portal-shell .topbar {
        flex-direction: column;
        align-items: flex-start;
        min-height: auto;
        padding-top: 26px;
    }

    .portal-shell .topbar h1 {
        font-size: 38px;
    }

    .portal-shell .topbar p,
    .portal-shell .panel .hint,
    .portal-shell .table-card .hint {
        font-size: 16px;
    }

    .portal-shell .metric-card {
        min-height: 160px;
    }

    .portal-shell .metric-grid {
        grid-template-columns: 1fr;
    }

    .portal-shell .metric-card .value {
        font-size: 46px;
    }

    .portal-shell .estado-row {
        grid-template-columns: 1fr;
        gap: 10px;
    }
}

/* B2B hybrid refinement: dark navigation, light operational workspace. */
.portal-shell {
    --cmd-bg: #f4f7fb;
    --cmd-panel: #ffffff;
    --cmd-panel-strong: #ffffff;
    --cmd-line: #d8e3f1;
    --cmd-line-strong: #33c7e8;
    --cmd-text: #111827;
    --cmd-muted: #5f6f86;
    --cmd-soft: #334155;
    --cmd-cyan: #12bde4;
    --cmd-teal: #18c7a7;
    grid-template-columns: 252px minmax(0, 1fr);
    color: #111827;
    background: #f4f7fb;
    font-family: "Inter", "Segoe UI", Arial, sans-serif;
    background-image: none;
}

.portal-shell .sidebar {
    padding: 16px 14px;
    color: #eaf2ff;
    background: linear-gradient(180deg, #08111f 0%, #0b1526 100%);
    border-right: 1px solid rgba(148, 163, 184, 0.22);
    box-shadow: 14px 0 32px rgba(15, 23, 42, 0.16);
}

.portal-shell .sidebar-brand {
    gap: 12px;
    padding: 8px 6px 18px;
}

.portal-shell .brand-logo-sidebar {
    width: 44px;
    height: 44px;
}

.portal-shell .sidebar-brand-text > div {
    font-size: 20px;
    letter-spacing: 0;
}

.portal-shell .sidebar-brand-text small {
    margin-top: 3px;
    font-family: "Inter", "Segoe UI", Arial, sans-serif;
    font-size: 10px;
    letter-spacing: 0.10em;
}

.portal-shell .user-chip {
    margin: 4px 0 16px;
    padding: 12px;
    border-color: rgba(148, 163, 184, 0.22);
    background: rgba(15, 23, 42, 0.42);
}

.portal-shell .user-chip strong {
    font-size: 12px;
}

.portal-shell .user-chip span {
    font-size: 9px;
}

.portal-shell .entity-filter-card {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(148, 163, 184, 0.22);
}

.portal-shell .entity-filter-card label {
    display: block;
    margin-bottom: 5px;
    color: #67e8f9;
    font-size: 9px;
    font-weight: 900;
    text-transform: uppercase;
}

.portal-shell .entity-filter-card select {
    width: 100%;
    min-height: 82px;
    max-height: 112px;
    padding: 5px;
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 7px;
    background: #f8fbff;
    color: #0f172a;
    font-size: 11px;
    font-weight: 700;
    outline: none;
}

.portal-shell .entity-filter-card option {
    padding: 4px 6px;
}

.portal-shell .entity-filter-card small {
    display: block;
    margin: 5px 0 7px;
    color: #cbd5e1;
    font-size: 9px;
    line-height: 1.25;
}

.portal-shell .entity-filter-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

.portal-shell .entity-filter-actions button {
    min-height: 28px;
    padding: 6px 7px;
    border: 1px solid rgba(81, 216, 242, 0.45);
    border-radius: 7px;
    color: #05111f;
    background: #4dd8f2;
    font-size: 10px;
    font-weight: 900;
    cursor: pointer;
}

.portal-shell .entity-filter-actions button:last-child {
    color: #eaf2ff;
    background: rgba(15, 23, 42, 0.55);
}

.portal-shell .nav-list {
    gap: 8px;
}

.portal-shell .nav-btn,
.portal-shell .nav-subbtn {
    min-height: 42px;
    border-radius: 7px;
    font-family: "Inter", "Segoe UI", Arial, sans-serif;
    font-size: 12px;
    font-weight: 850;
    letter-spacing: 0;
}

.portal-shell .nav-subbtn {
    min-height: 34px;
    padding: 7px 10px 7px 50px;
    font-size: 11px;
}

.portal-shell .nav-btn span {
    min-width: 30px;
    height: 30px;
    border-radius: 7px;
    font-size: 10px;
}

.portal-shell .nav-btn:hover,
.portal-shell .nav-btn.active,
.portal-shell .nav-subbtn:hover,
.portal-shell .nav-subbtn.active {
    color: #67e8f9;
    border-color: rgba(81, 216, 242, 0.42);
    background: rgba(81, 216, 242, 0.10);
    box-shadow: inset 3px 0 0 #4dd8f2;
}

.portal-shell .nav-btn:hover span,
.portal-shell .nav-btn.active span {
    color: #061120;
    background: #4dd8f2;
}

.portal-shell .sidebar-footer {
    margin-top: 16px;
    padding-top: 14px;
}

.portal-shell .sidebar-footer .ghost-btn {
    color: #eaf2ff;
    border-color: rgba(148, 163, 184, 0.30);
    background: rgba(15, 23, 42, 0.42);
}

.portal-shell .sidebar-footer .ghost-btn:hover {
    color: #67e8f9;
    border-color: rgba(81, 216, 242, 0.44);
    background: rgba(81, 216, 242, 0.10);
}

.portal-shell .main {
    padding: 14px 22px 32px;
    color: #111827;
    background: #f4f7fb;
    background-image: none;
}

.portal-shell .main::before {
    min-height: 34px;
    padding: 6px 0 12px;
    border-bottom: 1px solid #d8e3f1;
    color: #0ea5c6;
    font-size: 21px;
    font-weight: 900;
    text-shadow: none;
}

.portal-shell #viewHost {
    max-width: none;
    margin: 0;
}

.portal-shell .topbar {
    min-height: auto;
    margin: 0 0 14px;
    padding: 14px 18px;
    border: 1px solid #d8e3f1;
    border-radius: 8px;
    color: #111827;
    background: #ffffff;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}

.portal-shell .topbar .eyebrow {
    color: #0b8fb0;
    font-family: "Inter", "Segoe UI", Arial, sans-serif;
    font-size: 10px;
    letter-spacing: 0.06em;
}

.portal-shell .topbar h1 {
    margin-top: 5px;
    color: #0f172a;
    font-size: clamp(25px, 2.4vw, 34px);
    line-height: 1.08;
    text-shadow: none;
}

.portal-shell .topbar p {
    max-width: 980px;
    margin-top: 7px;
    color: #475569;
    font-size: 14px;
    line-height: 1.35;
}

.portal-shell .topbar-logo {
    width: 78px;
    height: 54px;
    padding: 6px;
    border-color: #d8e3f1;
    background: #0b1526;
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.12);
}

.portal-shell .subtabs {
    margin: 0 0 12px;
    padding: 4px;
    border-color: #d8e3f1;
    background: #ffffff;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
}

.portal-shell .subtab {
    min-height: 34px;
    padding: 7px 14px;
    color: #334155;
    font-family: "Inter", "Segoe UI", Arial, sans-serif;
    font-size: 12px;
    letter-spacing: 0;
}

.portal-shell .subtab.active {
    color: #ffffff;
    background: linear-gradient(135deg, #155eef, #0ea5c6);
}

.portal-shell .metric-grid,
.portal-shell .tms-metric-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 14px;
}

.portal-shell .metric-card {
    min-height: 104px;
    padding: 14px 16px;
    border-color: #d8e3f1;
    border-left: 4px solid #12bde4;
    border-radius: 8px;
    color: #111827;
    background: #ffffff;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}

.portal-shell .metric-card .label {
    color: #334155;
    font-family: "Inter", "Segoe UI", Arial, sans-serif;
    font-size: 11px;
    letter-spacing: 0.04em;
}

.portal-shell .metric-card .value,
.portal-shell .metric-grid .metric-card:nth-child(4) .value {
    margin-top: 7px;
    color: #0f172a;
    font-size: clamp(26px, 2.5vw, 36px);
    line-height: 1.05;
    overflow-wrap: normal;
    text-shadow: none;
}

.portal-shell .metric-card .hint {
    max-width: none;
    margin-top: 5px;
    color: #64748b;
    font-family: "Inter", "Segoe UI", Arial, sans-serif;
    font-size: 12px;
    line-height: 1.25;
}

.portal-shell .dashboard-grid {
    grid-template-columns: minmax(0, 1.15fr) minmax(360px, 0.85fr);
    gap: 14px;
}

.portal-shell .panel,
.portal-shell .table-card,
.portal-shell .filter-card,
.portal-shell .future-card,
.portal-shell .ops-card,
.portal-shell .today-board,
.portal-shell .tms-lane,
.portal-shell .placeholder {
    border-color: #d8e3f1;
    border-radius: 8px;
    color: #111827;
    background: #ffffff;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}

.portal-shell .panel,
.portal-shell .table-card,
.portal-shell .filter-card {
    padding: 14px;
}

.portal-shell .panel h2,
.portal-shell .table-card h2,
.portal-shell .board-title h2 {
    color: #0f172a;
    font-size: 20px;
    line-height: 1.18;
}

.portal-shell .panel .hint,
.portal-shell .table-card .hint,
.portal-shell .board-title .hint,
.portal-shell .hint {
    color: #475569;
    font-size: 12px;
    line-height: 1.35;
}

.portal-shell .filter-grid label,
.portal-shell .field label,
.portal-shell label {
    color: #475569;
    font-family: "Inter", "Segoe UI", Arial, sans-serif;
    font-size: 9px;
    letter-spacing: 0.04em;
}

.portal-shell input:not([type="checkbox"]):not([type="radio"]),
.portal-shell select,
.portal-shell textarea {
    min-height: 32px;
    border-color: #cbd8e8;
    color: #0f172a;
    background: #ffffff;
    box-shadow: none;
}

.portal-shell select option {
    color: #0f172a;
    background: #ffffff;
}

.portal-shell input::placeholder,
.portal-shell textarea::placeholder {
    color: #667085;
}

.portal-shell input:not([type="checkbox"]):not([type="radio"]):focus,
.portal-shell select:focus,
.portal-shell textarea:focus {
    border-color: #0ea5c6;
    box-shadow: 0 0 0 3px rgba(14, 165, 198, 0.14);
}

.portal-shell .filter-actions {
    gap: 6px;
    flex-wrap: wrap;
}

.portal-shell .filter-actions .soft-btn,
.portal-shell .filter-actions .ghost-btn {
    min-height: 32px;
    padding: 7px 10px;
    font-size: 12px;
    white-space: nowrap;
}

.portal-shell .guide-filter-grid .filter-actions,
.portal-shell .mercaderia-filter-grid .filter-actions {
    flex-wrap: wrap;
}

.portal-shell .table-wrap {
    border-color: #d8e3f1;
    background: #ffffff;
}

.portal-shell table {
    color: #111827;
}

.portal-shell th {
    color: #334155;
    border-bottom-color: #d8e3f1;
    background: #f1f5f9;
    font-family: "Inter", "Segoe UI", Arial, sans-serif;
    font-size: 10px;
    letter-spacing: 0.04em;
}

.portal-shell td {
    color: #172033;
    border-bottom-color: #e5edf6;
    font-size: 12px;
}

.portal-shell td strong,
.portal-shell .link-btn {
    color: #0f172a;
}

.portal-shell tbody tr:hover td,
.portal-shell .guides-table .guide-row:hover td {
    background: #edf8ff;
}

.portal-shell .guide-detail-row td,
.portal-shell .detail-row > td {
    color: #172033;
    background: #f8fbff;
}

.portal-shell .guide-detail,
.portal-shell .expanded-box {
    color: #172033;
    background: #f8fbff;
    border-top-color: #d8e3f1;
}

.portal-shell .guide-detail h3,
.portal-shell .expanded-box h3 {
    color: #0f172a;
}

.portal-shell .guide-detail td,
.portal-shell .expanded-box td {
    color: #172033;
    background: #ffffff;
}

.portal-shell .guide-detail th,
.portal-shell .expanded-box th {
    color: #334155;
    background: #eaf1f8;
}

.portal-shell .dashboard-grid .table-wrap table {
    min-width: 560px;
}

.portal-shell .guides-table table {
    min-width: 980px;
}

.portal-shell .guides-table th,
.portal-shell .guides-table td {
    padding: 8px 9px;
}

.portal-shell .guides-table .row-actions {
    gap: 5px;
    flex-wrap: nowrap;
}

.portal-shell .guides-table .row-actions .icon-btn,
.portal-shell .guides-table .row-actions .soft-btn {
    min-height: 28px;
    padding: 5px 8px;
    font-size: 11px;
}

.portal-shell .primary-btn,
.portal-shell .soft-btn,
.portal-shell .icon-btn {
    color: #061120;
    background: linear-gradient(135deg, #18d4c1, #4dd8f2);
    box-shadow: 0 8px 18px rgba(14, 165, 198, 0.14);
}

.portal-shell .ghost-btn {
    color: #334155;
    border-color: #cbd8e8;
    background: #ffffff;
}

.portal-shell .ghost-btn:hover {
    color: #0b8fb0;
    background: #eefaff;
}

.portal-shell .badge {
    color: #334155;
    border-color: #d8e3f1;
    background: #eef2f7;
}

.portal-shell .badge.green {
    color: #047857;
    border-color: #a8ebcf;
    background: #dcfce7;
}

.portal-shell .badge.yellow {
    color: #6d3fc0;
    border-color: #d8c6ff;
    background: #f0e8ff;
}

.portal-shell .badge.gray {
    color: #0b8fb0;
    border-color: #afeaf4;
    background: #e7fbff;
}

.portal-shell .estado-bars {
    margin-top: 14px;
}

.portal-shell .estado-row {
    grid-template-columns: minmax(190px, 1fr) minmax(180px, 1.3fr) 44px;
    gap: 14px;
    color: #172033;
    font-family: "Inter", "Segoe UI", Arial, sans-serif;
    font-size: 12px;
}

.portal-shell .estado-row strong,
.portal-shell .estado-row span {
    color: #172033;
}

.portal-shell .bar-track,
.portal-shell .chart-track {
    height: 8px;
    background: #dfe8f3;
}

.portal-shell .bar-fill,
.portal-shell .chart-fill {
    background: linear-gradient(90deg, #155eef, #0ea5c6);
    box-shadow: none;
}

.portal-shell .empty,
.portal-shell .readonly {
    color: #475569;
    background: #f1f5f9;
}

.modal-layer .modal-card {
    color: #111827;
    border-color: #d8e3f1;
    background: #ffffff;
    box-shadow: 0 28px 72px rgba(15, 23, 42, 0.28);
}

.modal-layer .modal-header {
    border-bottom-color: #d8e3f1;
    color: #ffffff;
    background: linear-gradient(135deg, #155eef, #0ea5c6);
}

.modal-layer .modal-header h3 {
    color: #ffffff;
}

.modal-layer .modal-body,
.modal-layer .modal-body p,
.modal-layer .modal-body span,
.modal-layer .modal-body label,
.modal-layer .modal-body h2,
.modal-layer .modal-body h3,
.modal-layer .modal-body strong {
    color: #172033;
}

.modal-layer .modal-close {
    color: #ffffff;
    background: rgba(15, 23, 42, 0.28);
}

@media (min-width: 1501px) {
    .portal-shell .metric-grid,
    .portal-shell .tms-metric-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 1500px) {
    .portal-shell .subtabs {
        margin: 0 0 12px;
    }

    .portal-shell .metric-grid,
    .portal-shell .tms-metric-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .portal-shell .metric-card {
        min-height: 104px;
    }

    .portal-shell .metric-card .value,
    .portal-shell .metric-grid .metric-card:nth-child(4) .value {
        font-size: clamp(25px, 2.3vw, 34px);
    }
}

@media (max-width: 1180px) {
    .portal-shell {
        grid-template-columns: 1fr;
    }

    .portal-shell .sidebar {
        position: relative;
        height: auto;
    }

    .portal-shell .main {
        padding: 12px 14px 28px;
    }

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

    .portal-shell .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .portal-shell .metric-grid,
    .portal-shell .tms-metric-grid {
        grid-template-columns: 1fr;
    }

    .portal-shell .topbar h1 {
        font-size: 27px;
    }
}

.portal-shell .tms-status-board {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin: 0 0 16px;
}

.portal-shell .tms-status-button {
    min-height: 152px;
    display: grid;
    align-content: space-between;
    gap: 12px;
    padding: 20px;
    border: 1px solid #d8e3f1;
    border-left: 6px solid #12bde4;
    border-radius: 10px;
    color: #0f172a;
    background: #ffffff;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
    text-align: left;
    cursor: pointer;
    transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.portal-shell .tms-status-button:hover,
.portal-shell .tms-status-button:focus-visible {
    transform: translateY(-2px);
    border-color: #8ddff0;
    box-shadow: 0 18px 36px rgba(14, 165, 198, 0.18);
    outline: none;
}

.portal-shell .tms-status-button.gold {
    border-left-color: #f59e0b;
}

.portal-shell .tms-status-button.green {
    border-left-color: #10b981;
}

.portal-shell .tms-status-button.cyan {
    border-left-color: #06b6d4;
}

.portal-shell .tms-status-button.orange {
    border-left-color: #f97316;
}

.portal-shell .tms-status-label {
    color: #334155;
    font-size: 15px;
    font-weight: 950;
    line-height: 1.15;
    text-transform: uppercase;
}

.portal-shell .tms-status-button strong {
    color: #0f172a;
    font-size: 48px;
    font-weight: 950;
    line-height: 0.9;
}

.portal-shell .tms-status-hint {
    color: #0b8fb0;
    font-size: 13px;
    font-weight: 850;
}

.travel-guides-modal.modal.modal-wide {
    width: min(1540px, calc(100vw - 28px));
    max-height: min(94vh, calc(100vh - 24px));
}

.travel-guides-modal .modal-body {
    padding: 16px;
}

.travel-guides-modal .modal-summary {
    margin-bottom: 12px;
}

.travel-guides-modal .modal-table {
    max-height: calc(94vh - 150px);
    border-color: #d8e3f1;
}

.travel-guides-modal .travel-guides-table {
    width: 100%;
    min-width: 1180px;
}

.travel-guides-modal th,
.travel-guides-modal td {
    padding: 8px 9px;
    font-size: 11px;
}

.travel-guides-modal .travel-guides-table th:last-child,
.travel-guides-modal .travel-guides-table td:last-child {
    position: sticky;
    right: 0;
    z-index: 2;
    width: 166px;
    min-width: 166px;
    background: #ffffff;
    box-shadow: -10px 0 18px rgba(15, 23, 42, 0.08);
}

.travel-guides-modal .travel-guides-table th:last-child {
    z-index: 3;
    background: #f1f5f9;
}

.travel-guides-modal .travel-modal-actions {
    display: flex;
    gap: 6px;
    flex-wrap: nowrap;
}

.travel-guides-modal .travel-modal-actions .icon-btn {
    min-height: 30px;
    padding: 6px 9px;
    font-size: 11px;
    white-space: nowrap;
}

@media (max-width: 1180px) {
    .portal-shell .tms-status-board {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .portal-shell .tms-status-board {
        grid-template-columns: 1fr;
    }

    .portal-shell .tms-status-button {
        min-height: 124px;
    }
}

/* Ajuste de legibilidad al 100%: la grilla principal de guias debe entrar en el ancho operativo. */
.portal-shell table.guides-table {
    width: 100%;
    min-width: 0;
    table-layout: fixed;
}

.portal-shell .main,
.portal-shell #viewHost,
.portal-shell .topbar,
.portal-shell .filter-card,
.portal-shell .table-card,
.portal-shell .table-wrap {
    min-width: 0;
    max-width: 100%;
}

.portal-shell table.guides-table th,
.portal-shell table.guides-table td {
    padding: 8px 7px;
    font-size: 11px;
    line-height: 1.25;
    white-space: normal;
    overflow-wrap: anywhere;
}

.portal-shell table.guides-table th:nth-child(1),
.portal-shell table.guides-table td:nth-child(1) {
    width: 5%;
}

.portal-shell table.guides-table th:nth-child(2),
.portal-shell table.guides-table td:nth-child(2) {
    width: 7%;
}

.portal-shell table.guides-table th:nth-child(3),
.portal-shell table.guides-table td:nth-child(3) {
    width: 8%;
}

.portal-shell table.guides-table th:nth-child(4),
.portal-shell table.guides-table td:nth-child(4) {
    width: 11%;
}

.portal-shell table.guides-table th:nth-child(5),
.portal-shell table.guides-table td:nth-child(5),
.portal-shell table.guides-table th:nth-child(6),
.portal-shell table.guides-table td:nth-child(6) {
    width: 10%;
}

.portal-shell table.guides-table th:nth-child(7),
.portal-shell table.guides-table td:nth-child(7),
.portal-shell table.guides-table th:nth-child(8),
.portal-shell table.guides-table td:nth-child(8) {
    width: 7%;
}

.portal-shell table.guides-table th:nth-child(9),
.portal-shell table.guides-table td:nth-child(9) {
    width: 9%;
}

.portal-shell table.guides-table th:nth-child(10),
.portal-shell table.guides-table td:nth-child(10) {
    width: 7%;
    text-align: right;
}

.portal-shell table.guides-table th:nth-child(11),
.portal-shell table.guides-table td:nth-child(11) {
    width: 8%;
    text-align: right;
}

.portal-shell table.guides-table th:nth-child(12),
.portal-shell table.guides-table td:nth-child(12) {
    width: 11%;
    min-width: 124px;
}

.portal-shell table.guides-table .numeric-cell {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.portal-shell table.guides-table .row-actions {
    display: flex;
    flex-wrap: nowrap;
    gap: 4px;
    justify-content: flex-start;
}

.portal-shell table.guides-table .row-actions .icon-btn {
    min-height: 27px;
    padding: 5px 7px;
    font-size: 10px;
    white-space: nowrap;
}

@media (max-width: 1280px) {
    .portal-shell {
        grid-template-columns: 238px minmax(0, 1fr);
    }

    .portal-shell .main {
        padding-right: 14px;
        padding-left: 14px;
    }

    .portal-shell table.guides-table th,
    .portal-shell table.guides-table td {
        padding: 7px 6px;
        font-size: 10.5px;
    }
}

/* Ajuste general: todos los listados operativos del portal deben entrar al 100% de zoom. */
.portal-shell .table-card .table-wrap > table:not(.travel-guides-table) {
    width: 100%;
    min-width: 0;
    table-layout: fixed;
}

.portal-shell .table-card .table-wrap > table:not(.travel-guides-table) th,
.portal-shell .table-card .table-wrap > table:not(.travel-guides-table) td {
    padding: 7px 6px;
    font-size: 10.5px;
    line-height: 1.25;
    white-space: normal;
    overflow-wrap: anywhere;
}

.portal-shell .table-card .table-wrap > table:not(.travel-guides-table) th:last-child,
.portal-shell .table-card .table-wrap > table:not(.travel-guides-table) td:last-child {
    width: 124px;
}

.portal-shell .table-card .row-actions,
.portal-shell .table-card .inventory-row-actions {
    display: flex;
    flex-wrap: nowrap;
    gap: 4px;
    align-items: center;
}

.portal-shell .table-card .row-actions .icon-btn,
.portal-shell .table-card .row-actions .soft-btn,
.portal-shell .table-card .inventory-row-actions .icon-btn {
    min-height: 26px;
    padding: 5px 7px;
    font-size: 10px;
    white-space: nowrap;
}

.portal-shell .table-card .badge {
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
}

.portal-shell .table-card-head {
    flex-wrap: wrap;
}

@media (max-width: 1280px) {
    .portal-shell .filter-grid {
        grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
    }

    .portal-shell .guide-filter-grid,
    .portal-shell .mercaderia-filter-grid,
    .portal-shell .inventory-advanced-grid,
    .portal-shell .rse-filter-grid,
    .portal-shell .sostenibilidad-filter-grid {
        grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
    }

    .portal-shell .filter-grid .filter-actions,
    .portal-shell .guide-filter-grid .filter-actions,
    .portal-shell .mercaderia-filter-grid .filter-actions {
        grid-column: auto / span 2;
        min-width: 0;
        flex-wrap: wrap;
    }

    .portal-shell .filter-actions .soft-btn,
    .portal-shell .filter-actions .ghost-btn {
        flex: 1 1 auto;
        min-width: 92px;
        padding-right: 8px;
        padding-left: 8px;
    }
}

@media (max-width: 900px) {
    .portal-shell .filter-grid .filter-actions,
    .portal-shell .guide-filter-grid .filter-actions,
    .portal-shell .mercaderia-filter-grid .filter-actions {
        grid-column: 1 / -1;
    }
}

/* Login compacto B2B: misma funcionalidad, mejor calce al 100% de zoom. */
.login-page {
    grid-template-columns: minmax(0, 1.3fr) minmax(340px, 0.72fr);
    grid-template-rows: 74px minmax(0, calc(100vh - 74px)) auto;
}

.login-topbar {
    min-height: 74px;
    padding: 12px 26px;
    gap: 16px;
}

.login-isotipo,
.login-page .brand-logo-login {
    width: 48px;
    height: 48px;
}

.login-topbar-brand {
    gap: 14px;
}

.login-brand-copy {
    display: grid;
    gap: 3px;
    line-height: 1;
}

.login-brand-copy strong,
.login-topbar-brand strong {
    color: #f8fbff;
    font-size: 22px;
    font-weight: 950;
}

.login-brand-copy small {
    color: var(--login-cyan);
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
}

.login-topbar-links {
    gap: 28px;
    font-size: 15px;
}

.login-topbar-actions {
    gap: 12px;
}

.login-topbar-actions span {
    width: 28px;
    height: 28px;
}

.login-copy {
    padding: 34px 30px 36px;
}

.login-copy h1 {
    max-width: 700px;
    margin-bottom: 24px;
    font-size: clamp(36px, 4vw, 48px);
    line-height: 1.08;
}

.login-copy > p {
    max-width: 780px;
    font-size: 19px;
    line-height: 1.42;
}

.login-pill-row {
    gap: 14px;
    margin-top: 30px;
}

.login-pill-row span {
    min-height: 34px;
    padding: 0 18px;
    font-size: 12px;
}

.login-side {
    align-items: center;
    padding: 20px 30px 28px 10px;
}

.login-card {
    width: min(100%, 430px);
    padding: 30px 32px 24px;
}

.login-card h2 {
    margin-bottom: 16px;
    font-size: 25px;
}

.login-card .sub {
    margin: -8px 0 22px;
    font-size: 12px;
}

.login-page .field {
    gap: 7px;
    margin-bottom: 16px;
}

.login-page .field label {
    font-size: 11px;
}

.login-page .field input {
    min-height: 42px;
    padding: 10px 13px;
    font-size: 14px;
}

.login-security-note {
    margin: -2px 0 18px;
    font-size: 12px;
    line-height: 1.25;
}

.login-page .primary-btn.login-submit {
    min-height: 50px;
    font-size: 15px;
}

.login-secure-channel {
    margin-top: 18px;
    font-size: 10px;
}

.quick-access {
    padding-top: 8px;
    padding-bottom: 44px;
}

.quick-access h3 {
    margin-bottom: 16px;
    padding-bottom: 16px;
    font-size: 23px;
}

.login-page .feature-grid {
    gap: 18px;
}

.login-page .feature-card {
    min-height: 210px;
    gap: 10px;
    padding: 20px;
}

.login-page .feature-icon {
    width: 46px;
    height: 46px;
}

.login-page .feature-card small {
    font-size: 12px;
}

.login-page .feature-card strong {
    margin: 8px 0 6px;
    font-size: 20px;
}

.login-page .feature-card span {
    min-height: 34px;
    padding: 8px 11px;
    font-size: 12px;
}

@media (max-width: 1180px) {
    .login-page {
        grid-template-rows: auto auto auto auto;
    }
}

@media (max-width: 720px) {
    .login-copy h1 {
        font-size: 34px;
    }

    .login-copy > p {
        font-size: 15px;
    }
}

/* Ajuste operativo compacto para dashboard, RSE y sostenibilidad. */
.portal-shell .dashboard-grid {
    grid-template-columns: minmax(0, 1.02fr) minmax(0, 0.98fr);
    align-items: start;
}

.portal-shell .dashboard-grid .panel {
    overflow: hidden;
}

.portal-shell .dashboard-grid .table-wrap {
    overflow: hidden;
}

.portal-shell .dashboard-grid .table-wrap table {
    width: 100%;
    min-width: 0;
    table-layout: fixed;
}

.portal-shell .dashboard-grid th,
.portal-shell .dashboard-grid td {
    padding: 7px 8px;
    font-size: 11px;
    line-height: 1.25;
    white-space: normal;
    overflow-wrap: anywhere;
}

.portal-shell .dashboard-grid th:nth-child(1),
.portal-shell .dashboard-grid td:nth-child(1) {
    width: 12%;
}

.portal-shell .dashboard-grid th:nth-child(2),
.portal-shell .dashboard-grid td:nth-child(2) {
    width: 20%;
}

.portal-shell .dashboard-grid th:nth-child(3),
.portal-shell .dashboard-grid td:nth-child(3) {
    width: 28%;
}

.portal-shell .dashboard-grid th:nth-child(4),
.portal-shell .dashboard-grid td:nth-child(4) {
    width: 40%;
}

.portal-shell .estado-bars {
    gap: 8px;
}

.portal-shell .estado-row {
    grid-template-columns: minmax(150px, 210px) minmax(120px, 280px) 38px;
    gap: 10px;
}

.portal-shell .estado-row .bar-track {
    max-width: 280px;
    justify-self: stretch;
}

.portal-shell .bar-track,
.portal-shell .chart-track {
    height: 7px;
}

.portal-shell .insight-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
    gap: 12px;
    margin: 12px 0;
}

.portal-shell .insight-card.wide {
    grid-column: auto;
}

.portal-shell .insight-card {
    min-width: 0;
    overflow: hidden;
}

.portal-shell .insight-card h2 {
    font-size: 18px;
}

.portal-shell .chart-list {
    gap: 8px;
}

.portal-shell .chart-row {
    grid-template-columns: minmax(116px, 0.85fr) minmax(120px, 1fr) minmax(82px, 0.45fr);
    gap: 8px;
    min-height: 44px;
    padding: 8px 10px;
    border: 1px solid #d8e3f1;
    border-radius: 7px;
    background: #f8fbff;
}

.portal-shell .chart-label {
    gap: 2px;
    min-width: 0;
}

.portal-shell .chart-label strong,
.portal-shell .chart-row > strong {
    font-size: 12px;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.portal-shell .chart-label span {
    font-size: 10px;
}

.portal-shell .chart-row .chart-track {
    max-width: 230px;
    justify-self: stretch;
}

.portal-shell .rse-filter-grid,
.portal-shell .sustainability-filter-grid {
    grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
}

.portal-shell .rse-filter-grid .filter-actions,
.portal-shell .sustainability-filter-grid .filter-actions {
    grid-column: auto;
    align-self: end;
}

@media (max-width: 1280px) {
    .portal-shell .metric-grid {
        gap: 10px;
    }

    .portal-shell .metric-card {
        min-height: 88px;
        padding: 12px 14px;
    }

    .portal-shell .metric-card .value,
    .portal-shell .metric-grid .metric-card:nth-child(4) .value {
        font-size: clamp(23px, 2vw, 30px);
    }

    .portal-shell .metric-card .hint {
        font-size: 11px;
    }

    .portal-shell .dashboard-grid,
    .portal-shell .insight-grid {
        grid-template-columns: minmax(0, 1fr) minmax(0, 0.82fr);
    }
}

@media (max-width: 980px) {
    .portal-shell .dashboard-grid,
    .portal-shell .insight-grid {
        grid-template-columns: 1fr;
    }

    .portal-shell .estado-row,
    .portal-shell .chart-row {
        grid-template-columns: 1fr;
    }

    .portal-shell .estado-row .bar-track,
    .portal-shell .chart-row .chart-track {
        max-width: none;
    }
}

.portal-shell .otros-cargos-cell {
    display: grid;
    gap: 5px;
    align-items: start;
    min-width: 118px;
}

.portal-shell .otros-cargos-cell strong {
    white-space: nowrap;
}

.portal-shell .extra-charge-btn {
    width: fit-content;
    min-height: 24px;
    padding: 4px 8px;
    border: 1px solid #8fdde9;
    border-radius: 7px;
    color: #075f72;
    background: #e8fbff;
    font-size: 10px;
    font-weight: 900;
    text-decoration: none;
}

.portal-shell .extra-charge-btn:hover {
    color: #053d4a;
    background: #d7f6fb;
}

.otros-cargos-modal {
    background: #ffffff;
}

.otros-cargos-modal .modal-head {
    color: #ffffff;
    background: linear-gradient(135deg, #1769e8, #0a9fb9);
}

.otros-cargos-modal .modal-body,
.otros-cargos-modal .modal-body p,
.otros-cargos-modal .modal-body span,
.otros-cargos-modal .modal-body strong,
.otros-cargos-modal .modal-body td,
.otros-cargos-modal .modal-body th {
    color: #172033;
}

.otros-cargos-detail {
    display: grid;
    gap: 14px;
}

.otros-cargos-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(140px, 1fr));
    gap: 10px;
}

.otros-cargos-summary div {
    padding: 12px 14px;
    border: 1px solid #d8e3f1;
    border-radius: 8px;
    background: #f8fbff;
}

.otros-cargos-summary span {
    display: block;
    margin-bottom: 5px;
    color: #64748b;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.otros-cargos-summary strong {
    font-size: 18px;
    font-weight: 900;
}

.otros-cargos-table table {
    min-width: 760px;
}

.otros-cargos-table th,
.otros-cargos-table td {
    white-space: normal;
    vertical-align: top;
}

.otros-cargos-table th:nth-child(3),
.otros-cargos-table td:nth-child(3),
.otros-cargos-table th:nth-child(4),
.otros-cargos-table td:nth-child(4),
.otros-cargos-table th:nth-child(5),
.otros-cargos-table td:nth-child(5) {
    text-align: right;
    white-space: nowrap;
}

@media (max-width: 760px) {
    .otros-cargos-summary {
        grid-template-columns: 1fr;
    }

    .otros-cargos-table table {
        min-width: 640px;
    }
}
