/* ÚLTIMA MILLA — sistema visual alineado con la app Docker (rojo de marca + gris) */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("../vendor/fonts/inter-latin-wght-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("../vendor/fonts/inter-latin-ext-wght-normal.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  /* Línea gráfica Proveo (app Docker): rojo #e91210, gris #eeedf2, blanco y negro puro */
  --um-display: "Avenir Next", Avenir, "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --um-red: #e91210;
  --um-red-600: #c00e0c;
  --um-red-700: #a50b0a;
  --um-red-soft: #fde7e7;
  --um-ink: #000000;
  --um-ink-2: #2c2c2e;
  --um-muted: #6b6b70;
  --um-subtle: #8e8e93;
  --um-faint: #b4b4b9;
  --um-line: #e3e2e8;
  --um-line-soft: #eeedf2;
  --um-hover: #f6f6f8;
  --um-bg: #eeedf2;
  --um-card: #ffffff;
  --um-shadow: 0 8px 28px rgba(0, 0, 0, .05);
  --um-side-1: #6b6b6e;
  --um-side-2: #6b6b6e;
  --um-side-ink: #f2f2f7;
  --um-side-muted: #dcdce1;
  --um-side-active: #58585c;
  --um-sidebar-w: 268px;
  --um-radius: 11px;
  /* Colores de estado del Docker (STATUS_META y .metric-icon--*) */
  --um-green: #34a17e; --um-green-soft: #e8f6f0;
  --um-orange: #e28750; --um-orange-soft: #fff0e6;
  --um-purple: #8971d1; --um-purple-soft: #f0edfa;
  --um-coral: #c96a5c; --um-coral-soft: #fff0ee;
  --um-amber: #b9862a; --um-amber-soft: #fbf3e1;
  --um-slate: #66778d; --um-slate-soft: #eef1f5;
  --um-blue: #4f6fbf; --um-blue-soft: #edf1fb;
  /* Bootstrap */
  --bs-primary: #e91210; --bs-primary-rgb: 233, 18, 16;
  --bs-link-color: #c00e0c; --bs-link-color-rgb: 192, 14, 12; --bs-link-hover-color: #a50b0a;
  --bs-body-font-family: "Avenir Next", Avenir, "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --bs-body-color: #000000; --bs-border-color: #e3e2e8; --bs-border-radius: .45rem;
  --bs-focus-ring-color: rgba(233, 18, 16, .3);
}
body { background: var(--um-bg); color: var(--um-ink); font-size: .93rem; -webkit-font-smoothing: antialiased; }
.font-display, h1, .h1, .kpi .value, .page-title { font-family: var(--um-display); font-weight: 750; letter-spacing: -.04em; }
a { color: var(--um-red-600); }
:focus-visible { outline: 3px solid rgba(233, 18, 16, .3); outline-offset: 2px; }

/* Botones */
.btn { border-radius: 7px; font-weight: 600; }
.btn-primary { --bs-btn-bg: var(--um-red); --bs-btn-border-color: var(--um-red); --bs-btn-hover-bg: var(--um-red-600); --bs-btn-hover-border-color: var(--um-red-600); --bs-btn-active-bg: var(--um-red-700); --bs-btn-active-border-color: var(--um-red-700); --bs-btn-disabled-bg: var(--um-red); --bs-btn-disabled-border-color: var(--um-red); box-shadow: 0 4px 10px rgba(233, 18, 16, .18); }
.btn-outline-primary { --bs-btn-color: var(--um-red-600); --bs-btn-border-color: #f7c4c3; --bs-btn-hover-bg: var(--um-red); --bs-btn-hover-border-color: var(--um-red); --bs-btn-active-bg: var(--um-red-700); }
.btn-light, .btn-white { --bs-btn-bg: #fff; --bs-btn-border-color: var(--um-line); --bs-btn-hover-bg: #f7f7f9; --bs-btn-hover-border-color: #d9d9e0; }
.btn-lg { padding: .75rem 1.4rem; }
.form-control, .form-select { border-radius: 7px; border-color: var(--um-line); }
.form-control:focus, .form-select:focus { border-color: var(--um-red); box-shadow: 0 0 0 3px rgba(233, 18, 16, .08); }
.form-check-input:checked { background-color: var(--um-red); border-color: var(--um-red); }
.nav-pills .nav-link.active { background: var(--um-red); }
.nav-pills .nav-link { color: var(--um-ink); border-radius: .7rem; }
.page-link { color: var(--um-ink); } .active > .page-link, .page-link.active { background: var(--um-red); border-color: var(--um-red); }

/* Aviso de versión */
.um-notice { display: flex; align-items: center; gap: 1rem; background: #fff; border: 1px solid #f7c4c3; border-radius: 8px; padding: .8rem 1.2rem; margin-bottom: 1.5rem; }
.um-notice .ttl { color: var(--um-red); font-weight: 700; white-space: nowrap; display: flex; gap: .55rem; align-items: center; }
.um-notice .sep { width: 1px; align-self: stretch; background: var(--um-line); }
.um-notice .txt { color: #46464f; flex: 1; }
.um-notice .ok { color: var(--um-red); font-weight: 700; background: none; border: 0; white-space: nowrap; }
@media (max-width: 767.98px) { .um-notice { flex-direction: column; align-items: flex-start; gap: .35rem; } .um-notice .sep { display: none; } .um-notice .ok { padding: 0; } }

/* Estructura */
.app-shell { display: flex; min-height: 100vh; }
.sidebar { display: flex; flex-direction: column; width: var(--um-sidebar-w); background: var(--um-side-1); color: var(--um-side-ink); position: fixed; inset: 0 auto 0 0; overflow-y: auto; z-index: 1040; padding: 1.75rem 1.1rem 2rem; transition: transform .2s ease; }
.brand { display: flex; align-items: center; gap: .85rem; color: #fff; text-decoration: none; padding: 0 .4rem 1.6rem; }
.brand-mark { display: inline-flex; align-items: flex-end; justify-content: center; gap: 3px; width: 34px; height: 34px; padding: 7px 6px; border-radius: 10px; background: var(--um-red); flex: none; transform: rotate(-3deg); }
.brand-mark i { display: block; width: 5px; border-radius: 4px; background: #fff; transform: skewY(-20deg); }
.brand-mark i:nth-child(1) { height: 9px; opacity: .78; } .brand-mark i:nth-child(2) { height: 16px; } .brand-mark i:nth-child(3) { height: 12px; opacity: .9; }
.brand-text { font-family: var(--um-display); font-weight: 800; font-size: 1.4rem; line-height: 1; letter-spacing: -.05em; white-space: nowrap; }
.brand-mark-lg { width: 60px; height: 60px; gap: 5px; padding: 12px 10px; border-radius: 16px; } .brand-mark-lg i { width: 8px; } .brand-mark-lg i:nth-child(1) { height: 16px; } .brand-mark-lg i:nth-child(2) { height: 28px; } .brand-mark-lg i:nth-child(3) { height: 21px; }
.org-card { display: flex; gap: .8rem; align-items: center; border: 1px solid rgba(255,255,255,.12); background: rgba(255,255,255,.05); border-radius: 10px; padding: .85rem; margin-bottom: 1.8rem; }
.org-card .org-ic { width: 40px; height: 40px; border-radius: 9px; background: var(--um-red); color: #fff; display: flex; align-items: center; justify-content: center; font-family: var(--um-display); font-weight: 800; font-size: 1.15rem; flex: none; }
.org-card .n { font-weight: 600; color: #fff; line-height: 1.2; }
.org-card .s { font-size: .8rem; color: var(--um-side-muted); }
.nav-section { text-transform: uppercase; font-size: .72rem; letter-spacing: .14em; color: var(--um-side-muted); margin: 1.2rem .7rem .55rem; font-weight: 700; }
.nav-link-item { position: relative; display: flex; align-items: center; gap: .85rem; padding: .62rem .85rem; border-radius: 8px; color: var(--um-side-ink); text-decoration: none; font-size: .97rem; margin-bottom: .15rem; }
.nav-link-item i { font-size: 1.15rem; opacity: .9; width: 1.3rem; text-align: center; }
.nav-link-item:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav-link-item.active { background: var(--um-side-active); color: #fff; font-weight: 600; box-shadow: inset 3px 0 var(--um-red); }

.nav-badge { margin-left: auto; background: var(--um-red); color: #fff; border-radius: 6px; font-size: .75rem; font-weight: 700; min-width: 24px; text-align: center; padding: .1rem .4rem; }
.main { flex: 1; margin-left: var(--um-sidebar-w); display: flex; flex-direction: column; min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 1030; display: flex; align-items: center; gap: 1rem; background: rgba(255,255,255,.96); backdrop-filter: blur(6px); border-bottom: 1px solid var(--um-line); padding: .9rem 2rem; }
.crumbs { margin-right: auto; display: flex; align-items: center; gap: .7rem; font-size: 1rem; color: var(--um-muted); white-space: nowrap; overflow: hidden; }
.crumbs .cur { color: var(--um-ink); font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.today { color: var(--um-muted); display: flex; gap: .5rem; align-items: center; white-space: nowrap; }
.btn-icon { border: 0; background: transparent; color: var(--um-ink); padding: .35rem .5rem; border-radius: 10px; }
.btn-bell { position: relative; width: 44px; height: 44px; border: 1px solid var(--um-line); border-radius: 9px; background: #fff; display: inline-flex; align-items: center; justify-content: center; }
.btn-bell .dot { position: absolute; top: 9px; right: 10px; width: 8px; height: 8px; background: var(--um-red); border-radius: 50%; border: 2px solid #fff; box-sizing: content-box; }
.btn-bell .cnt { position: absolute; top: -6px; right: -6px; background: var(--um-red); color: #fff; border-radius: 999px; font-size: .66rem; font-weight: 700; padding: 0 .35rem; line-height: 17px; }
.notif-menu { width: 330px; padding: 0; border-radius: 14px; overflow: hidden; }
.btn-user { display: flex; align-items: center; gap: .7rem; border: 0; background: transparent; text-align: left; }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--um-bg); color: var(--um-ink); border: 2px solid #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: .9rem; }
.btn-user .n { font-weight: 600; line-height: 1.15; } .btn-user .r { font-size: .8rem; color: var(--um-muted); }
.content { padding: 1.6rem 2rem 2rem; flex: 1; }
.footer { color: var(--um-muted); font-size: .75rem; padding: .5rem 2rem 1.5rem; }
.sidebar-backdrop { display: none; }
@media (max-width: 991.98px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-backdrop.show { display: block; position: fixed; inset: 0; background: rgba(15,15,20,.45); z-index: 1035; }
  .main { margin-left: 0; }
  .topbar { padding: .7rem 1rem; } .content { padding: 1rem .8rem; }
  .today, .btn-user .meta { display: none !important; }
}

/* Encabezados de página */
.eyebrow { text-transform: uppercase; letter-spacing: .16em; font-size: .75rem; font-weight: 700; color: var(--um-muted); margin-bottom: .35rem; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 1rem; margin-bottom: 1.4rem; }
.page-head h1 { font-size: 1.75rem; margin: 0; line-height: 1.15; }
.page-head .sub { color: var(--um-muted); margin-top: .35rem; }
.page-head .actions { margin-left: auto; display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }
.hello { font-size: 2.3rem !important; }
.hello .spark { color: var(--um-red); font-size: 1.4rem; vertical-align: middle; }

/* Tarjetas */
.card { border: 1px solid var(--um-line); border-radius: var(--um-radius); box-shadow: var(--um-shadow); }
.card-header { background: transparent; border-bottom: 1px solid var(--um-line); font-weight: 700; padding: 1rem 1.2rem; }
.card-title-lg { font-family: var(--um-display); font-weight: 800; font-size: 1.15rem; margin: 0; }
.card-sub { color: var(--um-muted); font-size: .88rem; }
.kpi { padding: 1.25rem 1.3rem; height: 100%; }
.kpi .top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 1.4rem; }
.kpi .ic { width: 44px; height: 44px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; font-size: 1.25rem; }
.kpi .trend { font-size: .78rem; font-weight: 700; border-radius: 5px; padding: .25rem .45rem; }
.kpi .trend.up { background: #edf8f3; color: #329777; }
.kpi .trend.down { background: var(--um-red-soft); color: var(--um-red); }
.kpi .trend.flat { background: var(--um-slate-soft); color: var(--um-slate); }
.kpi .label { color: var(--um-muted); font-size: .92rem; font-weight: 500; }
.kpi .value { font-size: 2.1rem; line-height: 1.15; margin: .2rem 0 .45rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.kpi .value.sm { font-size: 1.5rem; }
.kpi .sub { font-size: .84rem; color: var(--um-subtle); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tone-red { background: var(--um-red-soft); color: var(--um-red); }
.tone-coral { background: var(--um-coral-soft); color: var(--um-coral); }
.tone-black { background: var(--um-bg); color: #000; }
.tone-green { background: var(--um-green-soft); color: var(--um-green); }
.tone-orange { background: var(--um-orange-soft); color: var(--um-orange); }
.tone-purple { background: var(--um-purple-soft); color: var(--um-purple); }
.tone-amber { background: var(--um-amber-soft); color: var(--um-amber); }
.tone-slate { background: var(--um-slate-soft); color: var(--um-slate); }
.tone-blue { background: var(--um-blue-soft); color: var(--um-blue); }
.donut-wrap { position: relative; max-width: 260px; margin: 0 auto; }
.donut-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; }
.donut-center .v { font-family: var(--um-display); font-weight: 800; font-size: 2rem; line-height: 1; } .donut-center .l { color: var(--um-muted); font-size: .85rem; }
.legend-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: .4rem; }

/* Tablas, filtros, listas */
.table { --bs-table-bg: transparent; margin-bottom: 0; }
.table thead th { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--um-subtle); font-weight: 700; border-bottom: 1px solid var(--um-line-soft); border-top: 1px solid var(--um-line-soft); white-space: nowrap; background: #f8f8fa; }
.table td { border-bottom-color: var(--um-line-soft); color: var(--um-ink-2); }
.table tbody tr:hover { background: #fbfbfc; }
.table td { vertical-align: middle; }
.table td a { white-space: nowrap; font-weight: 700; text-decoration: none; color: var(--um-ink); }
.table td a:hover { color: var(--um-red); }
.table-hover tbody tr:hover { --bs-table-hover-bg: #fafafb; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.filters { background: var(--um-card); border: 1px solid var(--um-line); border-radius: var(--um-radius); box-shadow: var(--um-shadow); padding: .9rem 1rem; margin-bottom: 1rem; }
.filters .form-label { font-size: .72rem; color: var(--um-muted); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; margin-bottom: .2rem; }
.dl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: .9rem 1.25rem; }
.dl-grid .k { font-size: .72rem; text-transform: uppercase; color: var(--um-muted); font-weight: 700; letter-spacing: .04em; }
.dl-grid .v { font-weight: 550; }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { position: relative; padding: 0 0 1rem 1.5rem; border-left: 2px solid var(--um-line); margin-left: .45rem; }
.timeline li::before { content: ""; position: absolute; left: -8px; top: .15rem; width: 14px; height: 14px; border-radius: 50%; background: var(--um-red); border: 3px solid #fff; box-shadow: 0 0 0 1px var(--um-line); }
.timeline li.ev-status::before { background: var(--um-ink); }
.timeline li.ev-novedad::before { background: var(--um-orange); }
.timeline li.ev-ok::before { background: var(--um-green); }
.timeline li:last-child { border-left-color: transparent; }
pre.json { background: #f6f6f8; color: #2b2b30; border: 1px solid #e3e2e8; padding: .6rem; border-radius: 10px; font-size: .75rem; max-height: 220px; overflow: auto; white-space: pre-wrap; margin: 0; }
.form-label { font-weight: 600; font-size: .83rem; }
.required::after { content: " *"; color: var(--um-red); }
.alert { border-radius: 8px; }
.modal-content { border-radius: 11px; border: 0; }
.dropdown-menu { border-radius: 9px; border-color: var(--um-line); }

/* Pastillas de estado (status-pill del Docker: radio 5 px y punto de color) */
.badge { display: inline-flex; align-items: center; gap: .38em; font-weight: 600; border-radius: 5px; padding: .38em .62em; }
.badge[class*="badge-soft-"]::before { content: ""; width: .45em; height: .45em; border-radius: 50%; background: currentColor; opacity: .85; }
.badge-soft-delivered { background: #eaf7f1; color: #398d70; }
.badge-soft-route { background: #fff3e8; color: #b4713a; }
.badge-soft-pending { background: #f1eefb; color: #7565b2; }
.badge-soft-issue { background: #fff0ee; color: #ba675a; }
.badge-soft-returning { background: #fcf4e1; color: #9b7424; }
.badge-soft-returned { background: #eef1f5; color: #5d6d82; }
.badge-soft-muted { background: #f1f1f4; color: #8e8e93; }
.badge-soft-brand { background: var(--um-red-soft); color: var(--um-red-600); }
.badge-soft-dark { background: #e4e3e9; color: #2c2c2e; }
.text-purple { color: var(--um-purple); }

/* Acceso */
.auth-body { background: radial-gradient(circle at 15% 10%, #fde3e0 0, transparent 38%), radial-gradient(circle at 90% 90%, #ececf1 0, transparent 40%), var(--um-bg); }
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1.5rem; }
.auth-card { width: 100%; max-width: 430px; background: #fff; border: 1px solid var(--um-line); border-radius: 22px; padding: 2.2rem; box-shadow: 0 30px 60px -30px rgba(20,20,30,.3); }

/* Impresión */
.print-only { display: none; }
@media print {
  .sidebar, .topbar, .footer, .no-print, .alert, .um-notice { display: none !important; }
  .main { margin-left: 0 !important; } .content { padding: 0 !important; }
  .card { border: 0; box-shadow: none; } .print-only { display: block; }
  body { background: #fff; font-size: 11pt; }
}
.print-sheet { background: #fff; border: 1px solid var(--um-line); border-radius: var(--um-radius); padding: 1.5rem; }
.signature-box { border-top: 1px solid #000; padding-top: .3rem; margin-top: 3rem; font-size: .85rem; }
@media (max-width: 575.98px) { .kpi .value { font-size: 1.6rem; } .hello { font-size: 1.6rem !important; } .page-head h1 { font-size: 1.3rem; } }
.page-head h1 .badge, h1 .badge { font-family: "Inter", sans-serif; font-size: .78rem; font-weight: 700; vertical-align: middle; letter-spacing: 0; }
.org-card .n { font-size: .92rem; }

/* Bloque de usuario al pie del menú lateral (como en la app Docker) */
.sidebar nav { flex: 1; }
.sidebar-user { display: flex; align-items: center; gap: .65rem; margin-top: 1.4rem; padding: 1rem .45rem .1rem; border-top: 1px solid rgba(255,255,255,.12); }
.sidebar-user .avatar { width: 36px; height: 36px; font-size: .75rem; border-color: rgba(255,255,255,.2); }
.sidebar-user .n { color: #fff; font-weight: 600; font-size: .85rem; line-height: 1.2; } .sidebar-user .r { color: var(--um-side-muted); font-size: .76rem; }
.sidebar-user .more { margin-left: auto; color: var(--um-side-muted); background: none; border: 0; letter-spacing: 2px; }
.sidebar-user .more:hover { color: #fff; }
/* Filtro segmentado (Todas / Impresos / Sin imprimir) */
.segmented { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--um-line); border-radius: 7px; background: var(--um-bg); }
.segmented a { display: inline-flex; align-items: center; gap: 6px; padding: .3rem .7rem; border-radius: 5px; color: var(--um-muted); text-decoration: none; font-size: .82rem; font-weight: 600; }
.segmented a span { min-width: 18px; padding: 0 5px; border-radius: 4px; background: #fff; font-size: .72rem; text-align: center; }
.segmented a.active { background: #fff; color: var(--um-ink); box-shadow: 0 1px 3px rgba(0,0,0,.1); } .segmented a.active span { background: var(--um-red); color: #fff; }
.print-badge { display: inline-flex; align-items: center; gap: .35rem; font-size: .8rem; font-weight: 600; white-space: nowrap; } .print-badge.yes { color: #398d70; } .print-badge.no { color: var(--um-faint); }

/* Auditoría legible */
ul.audit-diff { list-style: none; margin: 0; padding: 0; font-size: .8rem; }
ul.audit-diff li { padding: .15rem 0; border-bottom: 1px dashed var(--um-line, #e3e2e8); }
ul.audit-diff li:last-child { border-bottom: 0; }
ul.audit-diff .k { color: #6b6b6e; margin-right: .4rem; }
ul.audit-diff .k::after { content: ":"; }
ul.audit-diff .old { color: #8a8a90; }
ul.audit-diff .old.removed { text-decoration: line-through; }
ul.audit-diff .new { color: #1d1d22; font-weight: 600; }
ul.audit-diff .bi { font-size: .7rem; color: #e91210; }
.guide-lookup-info .guide-card { background: #f6f6f8; border: 1px solid #e3e2e8; border-left: 3px solid #e91210; border-radius: 8px; padding: .45rem .6rem; line-height: 1.45; }
.autofilled { background-color: #fff8e6 !important; border-color: #ed8950 !important; }
details.audit-more summary { font-size: .75rem; color: #e91210; cursor: pointer; margin-top: .2rem; }
.item-price.need-price:placeholder-shown { border-color: #e91210 !important; box-shadow: 0 0 0 .2rem rgba(233,18,16,.15); }
button.today { color: var(--um-muted); padding: 0; border: 0; background: none; font: inherit; }
button.today:hover { color: var(--um-ink, #1d1d22); }
