






:root {
   
  --n-0:   #ffffff;
  --n-25:  #fafbfd;
  --n-50:  #f4f6fa;
  --n-100: #eceff5;
  --n-150: #e3e7ef;
  --n-200: #d7dce6;
  --n-300: #bcc4d2;
  --n-400: #94a0b3;
  --n-450: #75808f;    
  --n-500: #616c7b;
  --n-600: #556274;
  --n-700: #3e4a5a;
  --n-800: #2b3543;
  --n-900: #1a2230;
  --n-950: #101722;

   
  --brand-50:  #eef3fb;
  --brand-100: #dbe6f6;
  --brand-200: #b9cdec;
  --brand-500: #2b66b8;
  --brand-600: #1e5199;
  --brand-700: #173f7d;
  --brand-800: #123566;
  --brand-900: #0e2751;

   
  --canvas:      var(--n-50);
  --surface:     var(--n-0);
  --surface-alt: var(--n-25);
  --chrome:      var(--n-0);
  --border:      #dee3ec;
  --border-soft: #eaeef4;
  --ink:         var(--n-900);
  --ink-2:       var(--n-600);
  --ink-3:       var(--n-500);
  --accent:      var(--brand-700);
  --accent-hover:var(--brand-800);
  --accent-soft: var(--brand-50);
  --ring:        var(--brand-500);

  

  --st-neutral-bg: #eceff5; --st-neutral-bd: #d7dce6; --st-neutral-fg: #4c5868;
  --st-wait-bg:    #fdf3e3; --st-wait-bd:    #f0dcb4; --st-wait-fg:    #855100;
  --st-work-bg:    #e4f3f7; --st-work-bd:    #b7dfe9; --st-work-fg:    #0b5c6e;
  --st-block-bg:   #f0ebfc; --st-block-bd:   #dacff5; --st-block-fg:   #5b3aae;
  --st-done-bg:    #e6f4ea; --st-done-bd:    #bfe3cb; --st-done-fg:    #1c6b39;
  --st-stop-bg:    #fdeaea; --st-stop-bd:    #f3c6c6; --st-stop-fg:    #a32020;

  --ok:     var(--st-done-fg);
  --warn:   var(--st-wait-fg);
  --danger: var(--st-stop-fg);

   
  --r-xs: 4px;
  --r-sm: 6px;
  --r-md: 8px;
  --r-lg: 12px;
  --r-xl: 16px;
  --r-pill: 999px;

   
  --sh-sm: 0 1px 2px rgba(16, 23, 34, .06), 0 1px 1px rgba(16, 23, 34, .04);
  --sh-md: 0 4px 12px rgba(16, 23, 34, .08), 0 1px 3px rgba(16, 23, 34, .06);
  --sh-lg: 0 18px 48px rgba(16, 23, 34, .16), 0 4px 12px rgba(16, 23, 34, .08);

   
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
          "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;

   
  --topbar-h: 56px;
  --sidebar-w: 236px;
  




  --banner-h: 0px;
  


  --footer-h: 28px;

   
  --ease: cubic-bezier(.2, .8, .25, 1);
  --dur: 160ms;
}

 

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--sans);
  font-size: .875rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
   
  padding-bottom: var(--footer-h);
}

h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -.011em; color: var(--ink); }
h1 { font-size: 1.375rem; line-height: 1.25; }
h2 { font-size: 1rem; line-height: 1.35; }
h3 { font-size: .875rem; line-height: 1.4; }
p  { margin: 0 0 .75rem; }
p:last-child { margin-bottom: 0; }

a { color: var(--brand-600); text-decoration: none; }
a:hover { text-decoration: underline; }

:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
  border-radius: var(--r-xs);
}
:focus:not(:focus-visible) { outline: none; }

::selection { background: var(--brand-100); color: var(--brand-900); }

 

.muted { color: var(--ink-3); font-size: .8125rem; }
.mono  { font-family: var(--mono); font-size: .8125rem; letter-spacing: -.01em; }
.num   { font-variant-numeric: tabular-nums; text-align: right; }
.nowrap{ white-space: nowrap; }
.error   { color: var(--danger); font-size: .8125rem; margin-top: .625rem; }
.ok-msg  { color: var(--ok); font-size: .8125rem; margin-top: .625rem; }

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

.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 200;
  background: var(--accent); color: #fff; padding: 10px 16px;
  border-radius: var(--r-md); font-size: .8125rem; font-weight: 600;
  transition: top var(--dur) var(--ease);
}
.skip-link:focus { top: 12px; text-decoration: none; }

 
.icon {
  width: 1.125rem; height: 1.125rem; flex: none;
  stroke: currentColor; stroke-width: 1.5; stroke-linecap: round;
  stroke-linejoin: round; fill: none;
}
.icon-sm { width: 1rem; height: 1rem; }
.icon-lg { width: 1.25rem; height: 1.25rem; }

 

header.topbar {
  display: flex; align-items: center; gap: .875rem;
  height: var(--topbar-h); padding: 0 1.25rem;
  background: var(--chrome);
  border-bottom: 1px solid var(--border);
  position: sticky; top: var(--banner-h); z-index: 30;
  transition: box-shadow var(--dur) var(--ease);
}






body.is-scrolled header.topbar {
  box-shadow: 0 1px 0 rgba(16, 23, 34, .04), 0 6px 16px -10px rgba(16, 23, 34, .28);
}

.brand-logo { height: 30px; width: auto; display: block; }

.topbar .panel-label {
  font-size: .75rem; font-weight: 600; letter-spacing: .02em;
  color: var(--ink-2); padding: .25rem .625rem;
  background: var(--n-100); border-radius: var(--r-pill);
}






.topbar .who {
  margin-left: auto; color: var(--ink-2); font-size: .8125rem;
  display: flex; align-items: center; gap: .375rem;
  min-width: 0;
}
.topbar .who-saludo { color: var(--ink-3); white-space: nowrap; }
.topbar .who-nombre {
  color: var(--ink); font-weight: 600;
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.topbar .who .badge { flex: none; margin-left: .125rem; }





.sidebar-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; padding: 0;
  background: none; border: 1px solid var(--border); border-radius: var(--r-md);
  color: var(--ink); cursor: pointer;
}
.sidebar-toggle:hover { background: var(--n-50); }

 





.layout {
  display: flex; width: 100%; flex: 1; align-items: flex-start;
  padding-left: var(--sidebar-w);
  transition: padding-left var(--dur) var(--ease);
}
body.sidebar-plegada .layout { padding-left: 0; }

.layout main {
  flex: 1; min-width: 0;
  max-width: 1440px;
  padding: 1.5rem 1.75rem 3rem;
  margin: 0 auto;
}
.layout main.wide { max-width: none; }

 
main { max-width: 1100px; margin: 1.5rem auto; padding: 0 1.25rem; }

 






.sidebar {
  width: var(--sidebar-w); flex: none;
  background: var(--chrome);
  border-right: 1px solid var(--border);
  position: fixed; left: 0;
  top: calc(var(--topbar-h) + var(--banner-h));
  height: calc(100dvh - var(--topbar-h) - var(--banner-h) - var(--footer-h));
  overflow-y: auto;
  padding: .875rem .625rem;
  


  display: flex; flex-direction: column;
  transition: width var(--dur) var(--ease), padding var(--dur) var(--ease);
}



body.sidebar-plegada .sidebar {
  width: 0; padding-left: 0; padding-right: 0; border-right-color: transparent;
}
body.sidebar-plegada .sidebar-menu { white-space: nowrap; }
@media (prefers-reduced-motion: reduce) {
  .sidebar, .layout, .sidebar-children { transition: none; }
}

.sidebar-menu { display: flex; flex-direction: column; gap: 1px; }





.aviso-registro {
  margin-top: auto; padding: .5rem .625rem;
  display: flex; align-items: center; gap: .5rem;
  border-top: 1px solid var(--n-150);
  color: var(--n-450); font-size: .6875rem; line-height: 1.3;
  cursor: help;
}
.aviso-registro .icon { flex: none; }







[hidden] { display: none !important; }

.sidebar-menu button,
.sidebar-parent,
.sidebar-children button {
  display: flex; align-items: center; gap: .625rem;
  width: 100%; text-align: left;
  padding: .5rem .625rem;
  border: 0; background: none;
  color: var(--ink-2);
  border-radius: var(--r-md);
  font: inherit; font-size: .8125rem; font-weight: 500;
  cursor: pointer;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.sidebar-menu button .icon,
.sidebar-parent .icon { color: var(--n-450); transition: color var(--dur) var(--ease); }

.sidebar-menu button:hover,
.sidebar-parent:hover,
.sidebar-children button:hover { background: var(--n-100); color: var(--ink); }
.sidebar-menu button:hover .icon,
.sidebar-parent:hover .icon { color: var(--ink-2); }

.sidebar-menu button.active,
.sidebar-children button.active {
  background: var(--accent-soft); color: var(--brand-800); font-weight: 600;
}
.sidebar-menu button.active .icon { color: var(--brand-700); }

.sidebar-menu button .label {
  flex: 1; min-width: 0; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
}

 
.sidebar-group { display: flex; flex-direction: column; gap: 1px; }
.sidebar-parent { font-weight: 600; }
.sidebar-parent .arrow {
  margin-left: auto; color: var(--n-450);
  transition: transform var(--dur) var(--ease);
  display: inline-flex;
}
.sidebar-group.open .sidebar-parent .arrow { transform: rotate(90deg); }


.sidebar-parent .group-count { flex: none; }
.sidebar-group.open .sidebar-parent .group-count { display: none; }







.sidebar-children {
  display: flex; flex-direction: column; gap: 1px; padding-left: 1.75rem;
  height: 0; overflow: hidden; visibility: hidden;
  transition: height var(--dur) var(--ease), visibility var(--dur) var(--ease);
}
.sidebar-group.open .sidebar-children { height: auto; visibility: visible; }
.sidebar-children button { padding-block: .4375rem; }

.sidebar-overlay { display: none; }

 

.page-head {
  display: flex; align-items: flex-start; gap: 1rem;
  margin-bottom: 1.25rem;
}
.page-head .page-titles { min-width: 0; flex: 1; }
.page-head h1 + p { margin: .3125rem 0 0; color: var(--ink-3); font-size: .8125rem; max-width: 74ch; }
.page-head .page-actions { display: flex; gap: .5rem; align-items: center; flex: none; }






.page-head .engine-tag {
  margin: .375rem 0 0;
  font-size: .6875rem; letter-spacing: .04em; text-transform: uppercase;
  color: var(--n-450);
}





.page-head .engine-tag.engine-caido { color: var(--st-wait-fg); }
.page-head .engine-estado::before { content: " · "; }
.page-head .engine-estado { font-weight: 600; }

 

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}
.card:last-child { margin-bottom: 0; }
.card.flush { padding: 0; overflow: hidden; }

.card-head {
  display: flex; align-items: center; gap: .75rem;
  padding: .875rem 1.25rem;
  border-bottom: 1px solid var(--border-soft);
}
.card-head h2 { flex: 1; min-width: 0; }
.card > h2 { margin-bottom: .875rem; }
.card > h2 + p.muted { margin-top: -.5rem; }

 
.panel { padding: 1rem 0; border-top: 1px solid var(--border-soft); }
.panel:first-child { border-top: 0; padding-top: 0; }
.panel > h3 { margin-bottom: .625rem; }
.panel > h3 + p.muted { margin-top: -.375rem; }

.callout {
  background: var(--accent-soft);
  border: 1px solid var(--brand-100);
  border-radius: var(--r-md);
  padding: .875rem 1rem;
  font-size: .8125rem;
}




.callout.warn  { background: var(--st-wait-bg); border-color: var(--st-wait-bd); }
.callout.error { background: var(--st-stop-bg); border-color: var(--st-stop-bd); }
.callout .btn-row { margin-top: .5rem; flex-wrap: wrap; }

 

button { font-family: inherit; }

button.primary, button.ghost, button.subtle, button.danger, .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4375rem;
  height: 36px; padding: 0 .875rem;
  border-radius: var(--r-md);
  font-size: .8125rem; font-weight: 600; line-height: 1;
  white-space: nowrap; cursor: pointer;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease),
              color var(--dur) var(--ease);
}

button.primary {
  background: var(--accent); color: #fff; border: 1px solid var(--accent);
}
button.primary:hover:not(:disabled) { background: var(--accent-hover); border-color: var(--accent-hover); }
button.primary:active:not(:disabled) { background: var(--brand-900); }

button.ghost {
  background: var(--surface); color: var(--ink-2);
  border: 1px solid var(--border);
}
button.ghost:hover:not(:disabled) { background: var(--n-50); color: var(--ink); border-color: var(--n-300); }

button.subtle {
  background: none; color: var(--ink-2); border: 1px solid transparent;
}
button.subtle:hover:not(:disabled) { background: var(--n-100); color: var(--ink); }

button.danger {
  background: none; color: var(--danger); border: 1px solid transparent;
}
button.danger:hover:not(:disabled) { background: var(--st-stop-bg); border-color: var(--st-stop-bd); }






a.btn {
  background: var(--surface); color: var(--ink-2);
  border: 1px solid var(--border); text-decoration: none;
}
a.btn:hover { background: var(--n-50); color: var(--ink); border-color: var(--n-300); }

button:disabled, .btn:disabled { opacity: .45; cursor: not-allowed; }

.btn-sm { height: 30px; padding: 0 .625rem; font-size: .75rem; }
.btn-icon { width: 32px; height: 32px; padding: 0; }
.btn-block { width: 100%; }

.btn-row { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.row-actions { display: flex; gap: .125rem; justify-content: flex-end; }

 
button.is-busy { position: relative; color: transparent !important; }
button.is-busy::after {
  content: ''; position: absolute; inset: 0; margin: auto;
  width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid currentColor; border-top-color: transparent;
  color: #fff; animation: spin .7s linear infinite;
}
button.ghost.is-busy::after, button.subtle.is-busy::after { color: var(--ink-2); }
button.danger.is-busy::after { color: var(--danger); }

@keyframes spin { to { transform: rotate(360deg); } }

 

label {
  display: block; font-size: .75rem; font-weight: 600;
  color: var(--ink-2); margin: .875rem 0 .3125rem;
  letter-spacing: .005em;
}
label.inline { display: inline; margin: 0; font-weight: 500; color: var(--ink); }

input[type=text], input[type=password], input[type=email], input[type=number],
input[type=search], input[type=date], select, textarea {
  width: 100%; height: 36px; padding: 0 .6875rem;
  border: 1px solid var(--border); border-radius: var(--r-md);
  background: var(--surface); color: var(--ink);
  font-family: inherit; font-size: .8125rem;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
textarea {
  height: auto; min-height: 76px; padding: .5rem .6875rem;
  line-height: 1.5; resize: vertical;
}
input:hover:not(:disabled), select:hover:not(:disabled), textarea:hover:not(:disabled) {
  border-color: var(--n-300);
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--ring);
  box-shadow: 0 0 0 3px rgba(43, 102, 184, .16);
}
input::placeholder, textarea::placeholder { color: var(--ink-3); }
input:disabled, select:disabled, textarea:disabled {
  background: var(--n-50); color: var(--ink-3); cursor: not-allowed;
}

select {
  appearance: none;
  padding-right: 2rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23616c7b' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .625rem center;
}

input[type=checkbox] {
  width: 16px; height: 16px; accent-color: var(--accent);
  vertical-align: -2px; cursor: pointer;
}

.check-row {
  display: flex; align-items: center; gap: .5rem;
  padding: .375rem .5rem; border-radius: var(--r-sm);
}
.check-row:hover { background: var(--n-50); }
.check-row label { margin: 0; font-weight: 500; font-size: .8125rem; color: var(--ink); cursor: pointer; }

.field-row { display: flex; gap: .625rem; align-items: flex-end; flex-wrap: wrap; }
.field-row label { margin-top: 0; }
.field-row > div { min-width: 0; }




.input-icon { position: relative; display: inline-flex; align-items: center; }
.input-icon > span, .input-icon > .icon {
  position: absolute; left: .625rem; display: inline-flex;
  color: var(--ink-3); pointer-events: none;
}
.input-icon > input { padding-left: 2.125rem; }

 







.embed-tool {
  display: block; width: 100%; border: 1px solid var(--border);
  border-radius: var(--r-md); background: var(--surface);
  height: calc(100dvh - var(--topbar-h) - 9.5rem - var(--footer-h)); min-height: 460px;
}
@media (max-width: 860px) {
  .embed-tool { height: calc(100dvh - var(--topbar-h) - 7rem - var(--footer-h)); }
}


.embed-tool.auto-alto { min-height: 0; }

 

.table-toolbar {
  display: flex; align-items: center; gap: .625rem; flex-wrap: wrap;
  padding: .75rem 1.25rem; border-bottom: 1px solid var(--border-soft);
}
.table-toolbar .input-icon { width: min(280px, 100%); }
.table-toolbar .input-icon > input { width: 100%; }
.table-toolbar .spacer { flex: 1; }
kbd, .kbd {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 1.25rem; height: 1.25rem; padding: 0 .3125rem;
  font-family: var(--mono); font-size: .6875rem; color: var(--ink-3);
  background: var(--n-50); border: 1px solid var(--border); border-radius: var(--r-xs);
}
.input-icon > kbd { display: none; }
@media (hover: hover) and (pointer: fine) {
  .input-icon > kbd {
    display: inline-flex; position: absolute; right: .5rem; pointer-events: none;
  }
  




  .input-icon.con-atajo > input { padding-right: 2rem; }
}
.input-icon > input:focus ~ kbd, .input-icon > input:not(:placeholder-shown) ~ kbd { display: none; }

.table-count { font-size: .75rem; color: var(--ink-3); font-variant-numeric: tabular-nums; }

.table-wrap {
  overflow: auto;
  max-height: calc(100dvh - 20rem - var(--footer-h));
  overscroll-behavior: contain;
}



table {
  width: 100%; min-width: max-content;
  border-collapse: separate; border-spacing: 0; font-size: .8125rem;
}

th {
  position: sticky; top: 0; z-index: 1;
  background: var(--surface-alt);
  text-align: left; padding: .5625rem .75rem;
  color: var(--ink-3); font-weight: 600; font-size: .6875rem;
  text-transform: uppercase; letter-spacing: .06em;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
th:first-child, td:first-child { padding-left: 1.25rem; }
th:last-child,  td:last-child  { padding-right: 1.25rem; }

td {
  padding: .5625rem .75rem;
  border-bottom: 1px solid var(--border-soft);
  vertical-align: middle;
  color: var(--ink);
  white-space: nowrap;
}



td.wrap { white-space: normal; overflow-wrap: anywhere; }

tbody td { background: var(--surface); }
tbody tr:nth-child(even) td { background: #fbfcfe; }
tbody tr:hover td { background: var(--n-100); }
tbody tr:last-child td { border-bottom: 0; }







th:last-child, td:last-child { position: sticky; right: 0; }
.table-wrap.is-scrollable th:last-child,
.table-wrap.is-scrollable td:last-child {
  box-shadow: -7px 0 8px -7px rgba(16, 23, 34, .22);
}
th:last-child { z-index: 2; background: var(--surface-alt); }
tbody td:last-child { background: var(--surface); }
tbody tr:nth-child(even) td:last-child { background: #fbfcfe; }
tbody tr:hover td:last-child { background: var(--n-100); }
 
table.no-sticky th:last-child, table.no-sticky td:last-child {
  position: static; box-shadow: none;
}

td.mono, td .mono { font-variant-numeric: tabular-nums; }
th.num { text-align: right; }
tr.muted-row td:first-child { padding-left: 2rem; }
tr.muted-row td { color: var(--ink-2); }

 

.badge {
  display: inline-flex; align-items: center; gap: .375rem;
  padding: .1875rem .5rem .1875rem .4375rem;
  border-radius: var(--r-pill);
  font-size: .6875rem; font-weight: 600; letter-spacing: .01em;
  white-space: nowrap; text-transform: none;
  background: var(--st-neutral-bg); border: 1px solid var(--st-neutral-bd);
  color: var(--st-neutral-fg);
}
.badge::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%;
  background: currentColor; flex: none;
}
.badge.no-dot::before { display: none; }

.badge.pendiente     { background: var(--st-wait-bg);  border-color: var(--st-wait-bd);  color: var(--st-wait-fg); }
.badge.revision      { background: var(--st-work-bg);  border-color: var(--st-work-bd);  color: var(--st-work-fg); }
.badge.observaciones { background: var(--st-block-bg); border-color: var(--st-block-bd); color: var(--st-block-fg); }
.badge.aceptada      { background: var(--st-done-bg);  border-color: var(--st-done-bd);  color: var(--st-done-fg); }
.badge.rechazado,
.badge.entregado.no  { background: var(--st-stop-bg);  border-color: var(--st-stop-bd);  color: var(--st-stop-fg); }
.badge.entregado     { background: var(--st-done-bg);  border-color: var(--st-done-bd);  color: var(--st-done-fg); }
.badge.neutral       { background: var(--st-neutral-bg); border-color: var(--st-neutral-bd); color: var(--st-neutral-fg); }
.badge.brand         { background: var(--accent-soft); border-color: var(--brand-100); color: var(--brand-800); }

 
.badge.count {
  margin-left: auto; padding: .0625rem .375rem; min-width: 20px;
  justify-content: center; font-variant-numeric: tabular-nums;
  background: var(--st-wait-bg); border-color: var(--st-wait-bd); color: var(--st-wait-fg);
}
.badge.count::before { display: none; }

 

.empty {
  display: flex; flex-direction: column; align-items: center; gap: .375rem;
  padding: 3rem 1.5rem; text-align: center;
  color: var(--ink-3); font-size: .8125rem;
}
.empty .icon {
  width: 2rem; height: 2rem; color: var(--n-300); margin-bottom: .25rem;
}
.empty strong { display: block; color: var(--ink-2); font-size: .875rem; font-weight: 600; }

.skeleton {
  height: 12px; border-radius: var(--r-xs);
  background: linear-gradient(90deg, var(--n-100) 25%, var(--n-150) 37%, var(--n-100) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.3s ease-in-out infinite;
}
.skeleton + .skeleton { margin-top: .625rem; }
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

 

dialog {
  padding: 0; border: 0; border-radius: var(--r-xl);
  background: var(--surface); color: var(--ink);
  box-shadow: var(--sh-lg);
  width: min(920px, 94vw); max-height: min(88dvh, 940px);
}
dialog[open] { display: flex; flex-direction: column; }
dialog::backdrop { background: rgba(16, 23, 34, .45); backdrop-filter: blur(2px); }



.sheet-shell { display: flex; flex-direction: column; flex: 1; min-height: 0; }

.sheet-head {
  display: flex; align-items: flex-start; gap: 1rem;
  padding: 1.125rem 1.5rem 1rem;
  border-bottom: 1px solid var(--border-soft);
  flex: none;
}
.sheet-head .sheet-titles { flex: 1; min-width: 0; }
.sheet-head h2 { font-size: 1.0625rem; }
.sheet-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: .375rem .75rem;
  margin-top: .4375rem; font-size: .75rem; color: var(--ink-3);
}
.sheet-meta b { color: var(--ink-2); font-weight: 600; }

.sheet-body { flex: 1; overflow-y: auto; padding: 1.25rem 1.5rem; }
.sheet-foot {
  display: flex; align-items: center; gap: .5rem; justify-content: flex-end;
  padding: .875rem 1.5rem; border-top: 1px solid var(--border-soft);
  background: var(--surface-alt); flex: none;
}
.sheet-foot .spacer { flex: 1; }

 
.action-bar {
  display: flex; align-items: center; gap: .5rem; flex-wrap: wrap;
}

 
.detail-tabs {
  display: inline-flex; gap: 2px; padding: 3px;
  background: var(--n-100); border-radius: var(--r-md);
  margin-bottom: 1.125rem; flex-wrap: wrap;
}
.detail-tabs button {
  border: 0; background: none; color: var(--ink-2);
  padding: .375rem .75rem; border-radius: var(--r-sm);
  font: inherit; font-size: .75rem; font-weight: 600; cursor: pointer;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.detail-tabs button:hover { color: var(--ink); }
.detail-tabs button.active { background: var(--surface); color: var(--ink); box-shadow: var(--sh-sm); }

 
.fields {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: .75rem 1.25rem; margin: .75rem 0;
}
.fields > div { font-size: .8125rem; min-width: 0; }
.fields b {
  display: block; color: var(--ink-3); font-weight: 600;
  font-size: .6875rem; text-transform: uppercase; letter-spacing: .05em;
  margin-bottom: .125rem;
}
.fields .total { border-top: 1px solid var(--border); padding-top: .5rem; }
.fields .total span { font-weight: 600; font-variant-numeric: tabular-nums; }

 
.doc-item {
  padding: .875rem 0; border-top: 1px solid var(--border-soft);
}
.doc-item:first-of-type { border-top: 0; }
.doc-item-head {
  display: flex; align-items: center; gap: .625rem; flex-wrap: wrap;
}
.doc-item-head .doc-title {
  font-size: .875rem; font-weight: 600; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.doc-item-head .icon { color: var(--ink-3); }
.doc-item-sub {
  display: flex; align-items: center; gap: .75rem; flex-wrap: wrap;
  margin-top: .375rem; font-size: .75rem; color: var(--ink-3);
}
.doc-item-sub a { display: inline-flex; align-items: center; gap: .25rem; }




.doc-item-parte {
  margin-left: 1.25rem;
  padding-left: .875rem;
  border-top-color: transparent;
  border-left: 2px solid var(--border-soft);
}
.doc-item-parte .doc-title { font-weight: 500; }

 

.kanban-board {
  display: flex; gap: .875rem; overflow-x: auto;
  align-items: flex-start; padding-bottom: .5rem;
  scroll-snap-type: x proximity;
}

.kanban-col {
  min-width: 264px; max-width: 320px; flex: 1;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: .75rem;
  display: flex; flex-direction: column; scroll-snap-align: start;
}

.kanban-col-header {
  display: flex; align-items: center; gap: .5rem;
  padding-bottom: .625rem; margin-bottom: .625rem;
  border-bottom: 1px solid var(--border-soft);
}


.kanban-col-icon { display: inline-flex; color: var(--ink-3); }
 
.kanban-col[data-col="sin_gestion"]       .kanban-col-icon { color: var(--st-wait-fg); }
.kanban-col[data-col="atendidos"]         .kanban-col-icon { color: var(--st-work-fg); }
.kanban-col[data-col="esperando_cliente"] .kanban-col-icon { color: var(--st-block-fg); }
.kanban-col[data-col="numerados"]         .kanban-col-icon { color: var(--st-done-fg); }


.kanban-col[data-col="devuelto"]          .kanban-col-icon { color: var(--danger); }
.kanban-col[data-col="por_tramitar"]      .kanban-col-icon { color: var(--brand-700); }
.kanban-col[data-col="smda"]              .kanban-col-icon { color: var(--st-work-fg); }
.kanban-col[data-col="fondos"]            .kanban-col-icon { color: var(--st-block-fg); }



.kanban-col[data-col="pedidor"]           .kanban-col-icon { color: var(--brand-700); }
.kanban-col[data-col="adelanto"]          .kanban-col-icon { color: var(--st-wait-fg); }


.kanban-col[data-col="lista"]             .kanban-col-icon { color: var(--brand-700); }
.kanban-col[data-col="tramitada"]         .kanban-col-icon { color: var(--st-done-fg); }
.kanban-col-header h3 {
  flex: 1; min-width: 0; font-size: .8125rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.kanban-count {
  background: var(--n-100); color: var(--ink-2);
  font-size: .6875rem; font-weight: 700; font-variant-numeric: tabular-nums;
  min-width: 20px; height: 20px; border-radius: var(--r-pill);
  display: inline-flex; align-items: center; justify-content: center; padding: 0 .375rem;
}

.kanban-cards {
  display: flex; flex-direction: column; gap: .5rem; flex: 1;
  max-height: calc(100dvh - 17rem - var(--footer-h)); overflow-y: auto;
  overscroll-behavior: contain; padding-right: 2px;
}

.kanban-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: .625rem .75rem;
  cursor: pointer; text-align: left; width: 100%;
  font: inherit; color: inherit; display: block;
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.kanban-card:hover { border-color: var(--brand-200); background: var(--brand-50); }

.kanban-card-head { display: flex; align-items: center; gap: .5rem; margin-bottom: .25rem; }
.kanban-card-id {
  font-family: var(--mono); font-size: .75rem; font-weight: 700;
  color: var(--brand-700); font-variant-numeric: tabular-nums;
}
.kanban-card-despacho {
  font-family: var(--mono); font-size: .6875rem; margin-left: auto;
  color: var(--st-done-fg); background: var(--st-done-bg);
  border: 1px solid var(--st-done-bd);
  padding: .0625rem .375rem; border-radius: var(--r-xs);
}
.kanban-card-cliente {
  font-size: .8125rem; font-weight: 600; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.kanban-card-ref {
  font-size: .75rem; color: var(--ink-3); margin-top: .0625rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.kanban-card-meta {
  display: flex; align-items: center; gap: .625rem; flex-wrap: wrap;
  font-size: .6875rem; color: var(--ink-3); margin-top: .375rem;
}
.kanban-card-meta .icon { width: .8125rem; height: .8125rem; }
.kanban-card-meta span { display: inline-flex; align-items: center; gap: .25rem; }

.kanban-docs-badge {
  display: inline-flex; align-items: center; gap: .25rem;
  font-size: .6875rem; font-weight: 600;
  padding: .125rem .4375rem; border-radius: var(--r-pill);
  background: var(--st-wait-bg); border: 1px solid var(--st-wait-bd);
  color: var(--st-wait-fg); margin-top: .4375rem;
}
.kanban-docs-badge.ok {
  background: var(--n-100); border-color: var(--n-200); color: var(--ink-2);
}





.dup-keep { display: flex; flex-wrap: wrap; gap: .625rem; align-items: center; margin-bottom: .75rem; }
.dup-keep p { margin: 0; font-size: .8125rem; }
.dup-keep-opt {
  display: inline-flex; align-items: center; gap: .375rem; cursor: pointer;
  font-size: .8125rem; padding: .25rem .5rem;
  border: 1px solid var(--n-200); border-radius: var(--r-pill);
}
.dup-keep-opt:hover { background: var(--n-100); }

table.dup-compare th, table.dup-compare td { vertical-align: top; }
.dup-col-keep { color: var(--st-done-fg); }
.dup-col-del { color: var(--ink-3); }
.dup-col-tag { display: block; font-size: .6875rem; font-weight: 400; }
.dup-rotulo { font-size: .75rem; color: var(--ink-3); white-space: nowrap; }
.dup-conflicto { background: var(--st-wait-bg); }
.dup-elegible { cursor: pointer; }
.dup-elegible:hover { background: var(--n-100); }
.dup-elegible input { margin-right: .375rem; }
.dup-gana { font-weight: 600; }






.kanban-card-aduana {
  display: flex; flex-wrap: wrap; gap: .3125rem; margin-top: .4375rem;
}
.kanban-canal {
  font-size: .6875rem; font-weight: 600;
  padding: .125rem .4375rem; border-radius: var(--r-pill);
  background: var(--st-neutral-bg); border: 1px solid var(--st-neutral-bd);
  color: var(--st-neutral-fg);
}
.kanban-canal.rojo {
  background: var(--st-stop-bg); border-color: var(--st-stop-bd); color: var(--st-stop-fg);
}
.kanban-canal.amarillo {
  background: var(--st-wait-bg); border-color: var(--st-wait-bd); color: var(--st-wait-fg);
}
.kanban-canal.verde {
  background: var(--st-done-bg); border-color: var(--st-done-bd); color: var(--st-done-fg);
}
.kanban-card-estado-aduana {
  font-size: .6875rem; color: var(--ink-3); align-self: center;
}

.kanban-empty {
  padding: 1.5rem .5rem; text-align: center;
  font-size: .75rem; color: var(--ink-3);
}

 

.upload-layout { display: flex; gap: 1.25rem; align-items: flex-start; }
.upload-main { flex: 1; min-width: 0; }

.dropzone {
  display: flex; flex-direction: column; align-items: center; gap: .5rem;
  padding: 1.75rem 1.25rem; text-align: center;
  border: 1.5px dashed var(--n-300); border-radius: var(--r-lg);
  background: var(--surface-alt); color: var(--ink-3); font-size: .8125rem;
  cursor: pointer;
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.dropzone:hover, .dropzone.is-over { border-color: var(--brand-500); background: var(--brand-50); }
.dropzone .icon { width: 1.5rem; height: 1.5rem; color: var(--n-450); }
.dropzone strong { color: var(--ink); font-size: .875rem; font-weight: 600; }

.doc-row, .filerow {
  display: flex; gap: .625rem; align-items: center;
  padding: .5rem 0; border-bottom: 1px solid var(--border-soft);
}
.doc-row:last-child, .filerow:last-child { border-bottom: 0; }
.doc-row .doc-name, .filerow .name {
  flex: 1; min-width: 0; font-size: .8125rem;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.doc-row .doc-size { font-size: .75rem; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.doc-row select.tipo, .filerow select { width: 200px; }

.upload-preview {
  width: 400px; flex: none;
  border: 1px solid var(--border); border-radius: var(--r-lg);
  background: var(--surface); display: flex; flex-direction: column; overflow: hidden;
  position: sticky; top: calc(var(--topbar-h) + var(--banner-h) + 1.5rem);
}
.preview-toolbar {
  display: flex; align-items: center; gap: .5rem;
  padding: .5rem .75rem; border-bottom: 1px solid var(--border-soft);
  background: var(--surface-alt);
}
.preview-filename {
  flex: 1; min-width: 0; font-size: .75rem; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.preview-viewport {
  flex: 1; min-height: 280px; display: flex; align-items: center; justify-content: center;
  padding: .5rem; background: var(--n-100);
}
.pdf-embed { width: 100%; height: 460px; border: 0; border-radius: var(--r-sm); background: #fff; }
.img-preview { max-width: 100%; max-height: 460px; object-fit: contain; border-radius: var(--r-sm); }

#analizandoMsg { display: inline-flex; align-items: center; gap: .5rem; margin-left: .75rem; font-size: .8125rem; }
#analizandoMsg::before {
  content: ''; width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid var(--n-200); border-top-color: var(--accent);
  animation: spin .7s linear infinite;
}

 

.obs-item { padding: .75rem 0; border-top: 1px solid var(--border-soft); }
.obs-item:first-child { border-top: 0; padding-top: 0; }
.obs-head { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; font-size: .75rem; }
.obs-head strong { font-size: .8125rem; }
.obs-item p { margin: .3125rem 0 0; font-size: .8125rem; color: var(--ink); white-space: pre-wrap; }

.doc-solicitado {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem;
  padding: .75rem 0; border-top: 1px solid var(--border-soft);
}

 



.con-baja { display: inline-flex; align-items: baseline; gap: .375rem; }
.con-baja .badge { flex: none; font-size: .6875rem; opacity: .85; }

 








.toast-stack {
  position: fixed; inset: auto; right: 1rem; bottom: calc(1rem + var(--footer-h)); z-index: 200;
  display: flex; flex-direction: column; gap: .5rem;
  width: fit-content; max-width: min(400px, calc(100vw - 2rem));
  margin: 0; padding: 0; border: 0; background: none; overflow: visible;
  pointer-events: none;    
}
.toast-stack:not(:popover-open):not(.sin-popover) { display: none; }
.toast-stack.sin-popover { display: flex; }
.toast {
  display: flex; align-items: flex-start; gap: .625rem;
  padding: .75rem .875rem;
  background: var(--n-900); color: #fff;
  border-radius: var(--r-md); box-shadow: var(--sh-md);
  font-size: .8125rem; line-height: 1.4;
  animation: toast-in 220ms var(--ease);
}
.toast .icon { flex: none; margin-top: 1px; }
.toast { pointer-events: auto; }
.toast.ok    { background: #14532d; }
.toast.error { background: #7f1d1d; }
.toast.is-leaving { animation: toast-out 180ms var(--ease) forwards; }
@keyframes toast-in  { from { opacity: 0; transform: translateY(8px); } }
@keyframes toast-out { to   { opacity: 0; transform: translateY(6px); } }

 












main.login-split { max-width: none; margin: 0; padding: 0; }

.login-split {
  flex: 1;
  display: flex;
  background: var(--surface);
}

 

.login-brand {
  flex: 0 0 46%; max-width: 620px;
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 4.5rem 4rem 3.75rem;
  background: linear-gradient(162deg, var(--brand-900) 0%, var(--brand-700) 78%, var(--brand-600) 100%);
  color: #fff;
}



.login-brand::before {
  content: ''; position: absolute; inset: 0; opacity: .5;
  background-image:
    repeating-linear-gradient(to bottom, rgba(255, 255, 255, .055) 0 1px, transparent 1px 34px),
    repeating-linear-gradient(to right,  rgba(255, 255, 255, .035) 0 1px, transparent 1px 34px);
}
.login-brand::after {
  content: ''; position: absolute; top: -180px; right: -200px;
  width: 620px; height: 620px; border-radius: 50%;
  background: radial-gradient(circle, rgba(43, 102, 184, .42) 0%, rgba(43, 102, 184, 0) 68%);
}


.login-brand > * { position: relative; z-index: 1; }

.login-eyebrow {
  margin: 0; display: flex; align-items: center; gap: .625rem;
  font-family: var(--mono); font-size: .6875rem; font-weight: 600;
  letter-spacing: .14em; text-transform: uppercase;
  color: rgba(255, 255, 255, .72);
}

.login-claim { display: flex; flex-direction: column; gap: 1.25rem; }
.login-claim h2 {
  font-size: 2.5rem; line-height: 1.12; letter-spacing: -.024em;
  color: #fff; text-wrap: balance;
}
.login-claim p {
  margin: 0; font-size: 1rem; line-height: 1.6;
  color: rgba(255, 255, 255, .68); max-width: 44ch; text-wrap: pretty;
}

.login-meta {
  margin: 0; display: flex; align-items: center; gap: .75rem;
  padding-top: 1.375rem; border-top: 1px solid rgba(255, 255, 255, .14);
  font-family: var(--mono); font-size: .6875rem; letter-spacing: .04em;
  color: rgba(255, 255, 255, .5);
}
.login-meta > span + span::before {
  content: ''; display: inline-block; vertical-align: middle;
  width: 3px; height: 3px; border-radius: 50%; margin-right: .75rem;
  background: rgba(255, 255, 255, .3);
}

 

.login-panel {
  flex: 1; min-width: 0;
  display: flex; align-items: center; justify-content: center;
  padding: 2.5rem 3rem;
  background: var(--surface);
}
.login-col {
  width: 100%; max-width: 388px;
  display: flex; flex-direction: column; gap: 1.75rem;
}

.login-head { display: flex; flex-direction: column; gap: 1.375rem; }





.login-logo {
  display: block; align-self: flex-start; flex: none;
  width: 140px; height: 46px;
  aspect-ratio: 487 / 160; object-fit: contain;
}

.login-title { display: flex; flex-direction: column; gap: .3125rem; }
.login-title h1 { font-size: 1.5rem; letter-spacing: -.018em; }
.login-sub { margin: 0; font-size: .875rem; color: var(--ink-3); }

#loginForm { display: flex; flex-direction: column; gap: 1rem; }

 
.login-field { display: flex; flex-direction: column; gap: .375rem; }
.login-field label { margin: 0; }
.login-field input { height: 42px; padding: 0 .75rem; font-size: .875rem; }




input.login-id { font-family: var(--mono); letter-spacing: .02em; text-transform: uppercase; }

.login-pw { position: relative; }
.login-pw input { padding-right: 2.75rem; }
.login-eye {
  position: absolute; right: 5px; top: 5px;
  width: 32px; height: 32px; padding: 0;
  display: flex; align-items: center; justify-content: center;
  background: none; border: 1px solid transparent; border-radius: var(--r-sm);
  color: var(--n-450); cursor: pointer;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.login-eye:hover { background: var(--n-100); color: var(--ink-2); }




.login-caps, .login-alert {
  display: flex; align-items: flex-start; gap: .5625rem;
  


  margin: 0; padding: .625rem .75rem; font-size: .8125rem; line-height: 1.45;
}
.login-caps[hidden], .login-alert[hidden] { display: none; }
.login-caps {
  border: 1px solid var(--st-wait-bd); background: var(--st-wait-bg);
  border-radius: var(--r-md); color: var(--st-wait-fg);
}
.login-alert { color: var(--st-stop-fg); }


.login-caps [data-icon], .login-alert [data-icon], .login-eyebrow [data-icon] {
  display: flex; flex: none; margin-top: 1px;
}
.login-eyebrow [data-icon] { margin-top: 0; }

.login-col button.primary { height: 44px; font-size: .875rem; margin-top: .25rem; }
.login-foot { margin: 0; text-align: center; color: var(--ink-3); font-size: .75rem; }






@media (max-width: 1024px) {
  .login-brand { padding: 3.5rem 3rem 3rem; }
  .login-claim h2 { font-size: 2.125rem; }
  .login-panel { padding: 2.5rem 2rem; }
}




@media (max-width: 860px) {
  .login-split { flex-direction: column; }
  .login-brand {
    flex: none; max-width: none; min-height: 228px;
    justify-content: flex-end; gap: .75rem;
    padding: 2.5rem 1.5rem 1.875rem;
  }
  .login-brand::after { top: -140px; right: -140px; width: 380px; height: 380px; }
  .login-claim { gap: .75rem; }
  .login-claim h2 { font-size: 1.75rem; letter-spacing: -.022em; }
  .login-claim p, .login-meta { display: none; }
  .login-panel { flex: 1; padding: 1.75rem 1.5rem; }
  .login-col { max-width: 420px; gap: 1.625rem; }
}

 
@media (max-width: 480px) {
  .login-logo { width: 122px; height: 40px; }
  .login-title h1 { font-size: 1.375rem; }
  .login-field input { height: 48px; font-size: .9375rem; }
  .login-pw input { padding-right: 3rem; }
  .login-eye { right: 4px; top: 4px; width: 40px; height: 40px; }
  .login-col button.primary { height: 50px; font-size: .9375rem; }
}

 

.impersonation-banner {
  display: flex; align-items: center; justify-content: center; gap: .875rem;
  padding: .5rem 1.25rem; font-size: .8125rem;
  background: var(--st-wait-bg); color: var(--st-wait-fg);
  border-bottom: 1px solid var(--st-wait-bd);
  position: sticky; top: 0; z-index: 40;
}
.impersonation-banner .icon { flex: none; }
.impersonation-banner button.ghost {
  height: 28px; padding: 0 .625rem; font-size: .75rem;
  border-color: var(--st-wait-bd); color: var(--st-wait-fg); background: rgba(255, 255, 255, .6);
}
.impersonation-banner button.ghost:hover:not(:disabled) {
  background: #fff; color: var(--st-wait-fg); border-color: var(--st-wait-fg);
}

 

iframe.embed {
  width: 100%; height: calc(100dvh - 12rem - var(--footer-h));
  border: 1px solid var(--border); border-radius: var(--r-lg); background: #fff;
}

 










.aether-footer {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  display: flex; align-items: center;
  padding: .375rem .875rem;
  border-top: 1px solid var(--border); background: var(--chrome);
}
.aether-footer-copy {
  font-size: .625rem; font-family: var(--mono); font-weight: 600;
  color: var(--ink-3); letter-spacing: .04em; white-space: nowrap;
}
.aether-version { color: var(--ink-3); font-weight: 400; }
.aether-footer-lic {
  position: absolute; left: 50%; transform: translateX(-50%);
  font-size: .625rem; color: var(--ink-3); white-space: nowrap;
}
.aether-footer-lic a { color: var(--brand-600); }

 

@media (max-width: 1100px) {
  .upload-layout { flex-direction: column; }
  .upload-preview { width: 100%; position: static; }
}

@media (max-width: 900px) {
  .kanban-board { flex-direction: column; overflow-x: visible; }
  .kanban-col { max-width: none; min-width: 0; width: 100%; }
  .kanban-cards { max-height: none; }
}

@media (max-width: 860px) {
  


  body.sidebar-plegada .sidebar { width: 272px; padding: 1rem .75rem; }

   
  .layout, body.sidebar-plegada .layout { padding-left: 0; }

  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; height: 100dvh;
    width: 272px; z-index: 100;
    padding: 1rem .75rem;
    box-shadow: var(--sh-lg);
    transform: translateX(-100%);
    transition: transform 220ms var(--ease);
  }
  .sidebar.open { transform: translateX(0); }

  .sidebar-overlay {
    display: block; position: fixed; inset: 0;
    background: rgba(16, 23, 34, .4); z-index: 99;
    opacity: 0; pointer-events: none;
    transition: opacity 220ms var(--ease);
  }
  .sidebar.open + .sidebar-overlay { opacity: 1; pointer-events: auto; }

  .layout main { padding: 1.25rem 1rem 2.5rem; }
  .topbar .panel-label { display: none; }

  


  th:last-child, td:last-child { position: static; box-shadow: none; }
  th:first-child, td:first-child {
    position: sticky; left: 0; border-right: 1px solid var(--border-soft);
  }
  th:first-child { z-index: 3; }
  tbody td:first-child { background: var(--surface); }
  tbody tr:nth-child(even) td:first-child { background: #fbfcfe; }
  tbody tr:hover td:first-child { background: var(--n-100); }

  


  .table-wrap { max-height: calc(100dvh - 17rem - var(--footer-h)); }

  

  th:first-child, td:first-child { border-right: 0; }
  .table-wrap.is-scrollable th:first-child,
  .table-wrap.is-scrollable td:first-child {
    box-shadow: 7px 0 8px -7px rgba(16, 23, 34, .22);
  }
}

@media (max-width: 640px) {
  .page-head { flex-direction: column; gap: .75rem; }
  .page-head .page-actions { width: 100%; }
  

  .topbar .who { font-size: .75rem; max-width: 40vw; }
  .topbar .who-saludo { display: none; }
  .topbar .who .badge { display: none; }
  dialog { width: 100vw; max-width: 100vw; max-height: 100dvh; border-radius: 0; }
  .sheet-head, .sheet-body, .sheet-foot { padding-inline: 1rem; }
  .sheet-foot { flex-wrap: wrap; }
  .sheet-foot button { flex: 1 1 auto; }
}

@media (max-width: 580px) {
  .aether-footer-lic { position: static; transform: none; margin-left: auto; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important; animation-iteration-count: 1 !important;
    transition-duration: .01ms !important; scroll-behavior: auto !important;
  }
}






.kanban-col[data-col="en_transito"] .kanban-col-icon { color: var(--st-wait-fg); }
.kanban-col[data-col="arribadas"]   .kanban-col-icon { color: var(--st-block-fg); }
.kanban-col[data-col="numeradas"]   .kanban-col-icon { color: var(--st-work-fg); }
.kanban-col[data-col="tramitadas"]  .kanban-col-icon { color: var(--st-done-fg); }





.guia-dias {
  margin-left: auto; font-family: var(--mono);
  font-size: .6875rem; font-variant-numeric: tabular-nums; white-space: nowrap;
}

 
.guia-mas { width: 100%; margin-top: .5rem; flex-shrink: 0; }

.guias-toolbar { border-bottom: none; padding-bottom: .25rem; flex-wrap: wrap; gap: .5rem; }




@media (max-width: 720px) {
  .kanban-board { scroll-snap-type: x mandatory; }
  .kanban-col { min-width: 85vw; }
}




.guia-card { padding: 0; cursor: default; }
.guia-card > summary {
  cursor: pointer; list-style: none; padding: .5rem .625rem;
  display: flex; align-items: center; gap: .5rem; margin: 0;
  border-radius: var(--r-md);
}
.guia-card > summary::-webkit-details-marker { display: none; }
.guia-card > summary::after {
  content: ""; width: 6px; height: 6px; flex-shrink: 0;
  border-right: 1.5px solid var(--ink-3); border-bottom: 1.5px solid var(--ink-3);
  transform: rotate(-45deg); transition: transform var(--dur) var(--ease);
}
.guia-card[open] > summary::after { transform: rotate(45deg); }
.guia-card[open] > summary { border-bottom: 1px solid var(--border-soft); border-radius: var(--r-md) var(--r-md) 0 0; }
.guia-card > summary:focus-visible { outline: 2px solid var(--ring); outline-offset: -2px; }

.guia-detalle { padding: .5rem .625rem .625rem; display: flex; flex-direction: column; gap: .25rem; }
.guia-dato { display: flex; gap: .5rem; font-size: .75rem; line-height: 1.45; }
.guia-dato-k { color: var(--ink-3); min-width: 5.5rem; flex-shrink: 0; }
.guia-detalle-acciones { margin-top: .375rem; }





.guia-card.es-operacion { border-left: 3px solid var(--brand-300, var(--brand-200)); }
.guia-card.es-guia      { border-left: 3px solid var(--border); }





.kanban-card:has(.kanban-card-open) { padding: 0; cursor: default; }
.kanban-card-open {
  display: block; width: 100%; text-align: left; cursor: pointer;
  background: none; border: 0; font: inherit; color: inherit;
  padding: .625rem .75rem; border-radius: var(--r-md);
}
.kanban-card-open:focus-visible { outline: 2px solid var(--ring); outline-offset: -2px; }
.kanban-card-motivo {
  margin: 0; padding: 0 .75rem .5rem; font-size: .75rem; line-height: 1.45;
  color: var(--st-block-fg);
}
.kanban-card-etapas {
  gap: .25rem; flex-wrap: wrap; padding: .5rem .75rem .625rem;
  border-top: 1px solid var(--border-soft);
}





.tpill {
  display: inline-flex; align-items: center; gap: .375rem;
  padding: .3125rem .625rem; height: auto;
  font-size: .75rem; font-weight: 500; font-family: inherit;
  color: var(--ink-3); background: var(--n-50);
  border: 1px solid var(--border); border-radius: var(--r-md);
  cursor: pointer; white-space: nowrap;
  transition: color var(--dur) var(--ease), background var(--dur) var(--ease),
              border-color var(--dur) var(--ease);
}
.tpill .icon { width: .875rem; height: .875rem; }
.tpill:hover { color: var(--ink-2); border-color: var(--n-300); }
.tpill.active {
  color: var(--brand-800); background: var(--accent-soft);
  border-color: var(--brand-200);
}
.tpill.active:hover { border-color: var(--brand-500); }
.tpill:focus-visible { outline: 2px solid var(--ring); outline-offset: 1px; }





.aviso-cambio {
  position: fixed; right: 1rem; bottom: 1rem; z-index: 40;
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .5rem .75rem;
  background: var(--surface); color: var(--ink-2);
  border: 1px solid var(--brand-200); border-radius: var(--r-md);
  box-shadow: 0 4px 12px rgb(23 63 125 / .10);
  font-size: .75rem;
  opacity: 0; transform: translateY(.5rem);
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
  pointer-events: none;
}
.aviso-cambio.visible { opacity: 1; transform: none; }
.aviso-cambio .icon { color: var(--accent); }
@media (prefers-reduced-motion: reduce) { .aviso-cambio { transition: opacity var(--dur) var(--ease); transform: none; } }








.previa-campos { display: flex; flex-wrap: wrap; gap: .75rem 1.25rem; align-items: flex-end; }
.previa-campos .field-row { margin: 0; }
.previa-salida { margin-top: .875rem; display: flex; flex-direction: column; gap: .75rem; }
.previa-salida table { width: 100%; border-collapse: collapse; font-size: .8125rem; }
.previa-salida th {
  text-align: left; font-family: var(--mono, ui-monospace, monospace); font-size: .625rem;
  font-weight: 500; letter-spacing: .09em; text-transform: uppercase; color: var(--ink-3);
  padding: .375rem .625rem; border-bottom: 1px solid var(--border-soft);
}
.previa-salida td { padding: .375rem .625rem; border-bottom: 1px solid var(--border-soft); }
.previa-salida td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.previa-salida td.formula { font-size: .6875rem; }


.previa-salida tr.total td {
  font-weight: 700; background: var(--surface-2, var(--n-50)); border-top: 2px solid var(--border);
}
.previa-salida tr.total td.formula { font-weight: 400; }









.forms-split {
  display: grid; gap: 1.25rem; align-items: start;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
}
.forms-split > .card { margin-bottom: 0; }
@media (max-width: 1080px) { .forms-split { grid-template-columns: minmax(0, 1fr); } }








.forms-pantalla {
  display: flex; flex-direction: column; gap: 1.25rem;
  height: calc(100dvh - var(--topbar-h) - 8rem - var(--footer-h));
  min-height: 420px;
}









.forms-pantalla { overflow-y: auto; overscroll-behavior: contain; }
.forms-pantalla > .forms-split { flex: none; }


.forms-pantalla > .forms-historial-card {
  flex: 1 1 auto; min-height: 8rem; margin-bottom: 0;
  display: flex; flex-direction: column; overflow: hidden;
}
.forms-historial-card > h2 { flex: none; }


.forms-historial-card > .table-wrap { flex: 1 1 auto; min-height: 0; max-height: none; }




@media (max-width: 1080px) {
  .forms-pantalla { height: auto; min-height: 0; overflow: visible; }
  .forms-pantalla > .forms-historial-card { overflow: visible; margin-bottom: 1.25rem; }
  .forms-historial-card > .table-wrap { max-height: calc(100dvh - 20rem - var(--footer-h)); }
}









.forms-campos { display: grid; gap: .625rem .75rem; grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr)); }
.forms-campos { align-items: start; }
.forms-campos label { margin-top: 0; }



.forms-campos label .muted { font-weight: 400; font-size: .6875rem; }
.forms-campos label small.muted { display: block; margin-top: .25rem; line-height: 1.35; }
.forms-campos input, .forms-campos select { width: 100%; }
.forms-campo-ancho { grid-column: 1 / -1; }
.forms-nota { margin: .75rem 0 .875rem; }




.forms-salida h2 { margin-bottom: .75rem; }



.forms-tabla { width: 100%; min-width: 0; font-size: .8125rem; }
.forms-tabla th, .forms-tabla td {
  padding: .3125rem .25rem; border-bottom: 1px solid var(--border-soft);
  background: transparent;
}
.forms-tabla th {
  position: static; text-align: left; font-weight: 400; font-size: .8125rem;
  color: var(--ink-2); text-transform: none; letter-spacing: normal;
  border-bottom-color: var(--border-soft); white-space: normal;
}
.forms-tabla td { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.forms-tabla tbody td, .forms-tabla tbody tr:nth-child(even) td,
.forms-tabla tbody tr:hover td { background: transparent; }
.forms-tabla td:last-child { position: static; }
.forms-tabla td.libre { text-align: left; white-space: normal; font-size: .75rem; }
.forms-tabla tr.sep th, .forms-tabla tr.sep td { border-top: 1px solid var(--border); padding-top: .5rem; }
.forms-tabla tr.total th, .forms-tabla tr.total td {
  font-weight: 700; color: var(--ink); border-bottom-color: var(--border);
}
.forms-tabla tbody tr:last-child td, .forms-tabla tbody tr:last-child th { border-bottom: 0; }



.forms-historial th.num, .forms-historial td.num { text-align: right; }

.forms-salida .callout.aviso { margin-bottom: .75rem; background: var(--st-wait-bg); border-color: var(--st-wait-bd); }
.forms-salida .callout.aviso p { margin: 0; }
.forms-salida .callout.aviso + .callout.aviso { margin-top: -.375rem; }
