@import url("https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,600;9..144,700&family=Outfit:wght@400;500;600;700&display=swap");

:root {
  --navy: #071824;
  --ocean: #0c3d52;
  --sea: #14708a;
  --mist: #f3f8fa;
  --ink: #102432;
  --muted: #5c7380;
  --line: rgba(16, 36, 50, 0.12);
  --ok: #2f8f6b;
  --warn: #c45c2a;
  --white: #fff;
  --shadow: 0 18px 50px rgba(7, 24, 36, 0.12);
  --font: "Outfit", sans-serif;
  --display: "Fraunces", Georgia, serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(900px 400px at 0% 0%, rgba(20, 112, 138, 0.16), transparent 55%),
    linear-gradient(180deg, #eef6f8, #f7fbfc 40%, #e8f2f5);
  min-height: 100vh;
}
a { color: var(--sea); text-decoration: none; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 24px; }
.top {
  display: flex; justify-content: space-between; align-items: center;
  gap: 16px; margin-bottom: 22px; flex-wrap: wrap;
}
.brand { font-family: var(--display); font-size: 1.5rem; margin: 0; }
.login-brand {
  text-align: center;
  margin: -22px -22px 18px;
  padding: 20px 16px 16px;
  background: #071824;
  border-radius: 18px 18px 0 0;
}
.logo-login {
  max-width: 220px;
  width: 100%;
  height: auto;
  display: inline-block;
}
.top-brand { display: flex; align-items: center; gap: 14px; }
.logo-header {
  height: 52px;
  width: auto;
  max-width: 160px;
  object-fit: contain;
  display: block;
}
.muted { color: var(--muted); font-size: 0.9rem; }
.card {
  background: rgba(255,255,255,0.86);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 22px;
}
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: 12px; padding: 11px 16px; font-weight: 600;
  cursor: pointer; font: inherit;
}
.btn-primary { background: linear-gradient(135deg, #1785a2, #0c4a63); color: #fff; }
.btn-secondary { background: #fff; border: 1px solid var(--line); color: var(--ink); }
.btn-danger { background: rgba(196,92,42,.12); color: var(--warn); }
.field { margin-bottom: 14px; }
.field label { display: block; margin-bottom: 6px; color: var(--muted); font-size: 0.85rem; }
.field input, .field select, .field textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 12px;
  padding: 11px 12px; font: inherit; background: #fff;
}
.field textarea { min-height: 72px; resize: vertical; }
.maestro-docno {
  border: 2px solid var(--ocean);
  background: #fff;
  padding: 8px 14px;
  font-size: 0.82rem;
  line-height: 1.45;
  min-width: 200px;
}
.maestro-table .mae-in { width: 120px; padding: 4px 6px; }
.maestro-table .mae-nombre { width: 180px; }
.maestro-table .mae-code { width: 130px; }
.maestro-table .mae-rev { width: 52px; }
.maestro-table .mae-url { width: 160px; }
.maestro-table .mae-obs { width: 180px; }
.maestro-table select { max-width: 140px; padding: 4px 6px; }
.field input.is-fixed {
  background: #eef4f6;
  color: var(--muted);
  cursor: default;
}
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.period-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
}
.period-bar .field { min-width: 140px; }
.input-upper, .inp-desc { text-transform: uppercase; }
.cat-combo { position: relative; }
.cat-row { display: flex; gap: 6px; align-items: stretch; }
.cat-search {
  flex: 1 1 auto;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 12px;
  font: inherit;
  background: #fff;
}
.cat-add-btn { min-width: 44px; padding: 0 12px; }
.cat-list {
  position: absolute;
  left: 0;
  right: 50px;
  top: calc(100% + 4px);
  z-index: 30;
  margin: 0;
  padding: 6px 0;
  list-style: none;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  max-height: 240px;
  overflow-y: auto;
}
.cat-list li {
  padding: 8px 12px;
  cursor: pointer;
  font-size: 0.9rem;
}
.cat-list li.is-on,
.cat-list li:hover { background: #14708a; color: #fff; }
.cat-new {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}
.cat-new[hidden] { display: none !important; }
.cat-new-input {
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 12px;
  font: inherit;
}
.period-bar input[type="number"] { width: 110px; }
.alert {
  padding: 12px 14px; border-radius: 12px; margin-bottom: 14px;
  background: rgba(196,92,42,.1); color: #7a3418;
}
.alert-ok { background: rgba(47,143,107,.12); color: #1f6b4d; }
.nav { display: flex; gap: 10px; flex-wrap: wrap; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
th, td { padding: 10px 8px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
th { color: var(--ink); font-size: 0.72rem; text-transform: none; letter-spacing: .02em; font-weight: 600; line-height: 1.25; }
th .muted { display: block; font-weight: 400; text-transform: none; font-size: 0.68rem; }
tfoot td { font-weight: 700; background: rgba(20,112,138,.06); }
tr.is-warn td { background: rgba(201, 162, 39, .14); }
.login-body { min-height: 100vh; }
.login-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
  padding:
    max(24px, env(safe-area-inset-top))
    max(24px, env(safe-area-inset-right))
    max(24px, env(safe-area-inset-bottom))
    max(24px, env(safe-area-inset-left));
}
.login-card {
  width: min(420px, 100%);
  text-align: center;
}
.login-card h1 {
  font-family: var(--display);
  margin: 0 0 6px;
  font-size: clamp(1.35rem, 4.5vw, 1.75rem);
}
.login-card .field { text-align: left; }
.login-tagline { margin: 0 0 18px; }
.login-form .field input {
  min-height: 48px;
  font-size: 16px;
}
.btn-login {
  width: 100%;
  min-height: 48px;
  margin-top: 4px;
  font-size: 1rem;
  background: #071824;
  color: #fff;
}
.btn-login:hover {
  background: #0c3d52;
}
.login-foot { margin: 16px 0 0; font-size: 0.8rem; }
.modules { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.mod {
  padding: 18px; border-radius: 16px; border: 1px solid var(--line);
  background: #fff; transition: transform .15s ease;
}
.mod:hover { transform: translateY(-2px); }
.mod h3 { margin: 0 0 6px; font-size: 1.05rem; }
.badge {
  display: inline-block; font-size: 0.72rem; padding: 4px 8px; border-radius: 999px;
  background: rgba(20,112,138,.12); color: var(--sea); font-weight: 600;
}
.badge-soon { background: rgba(92,115,128,.12); color: var(--muted); }
.rel-legend { margin: 0 0 12px; line-height: 1.5; }
.rel-swatch {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 3px;
  vertical-align: -1px;
  margin-right: 4px;
  border: 1px solid var(--line);
}
.rel-swatch-pending { background: #ffe566; }
.rel-swatch-ok { background: #f4c27a; }
.rel-swatch-in { background: #8fd4a8; }
.rel-swatch-warn { background: #f4b4a8; }
.atn-ok td { background: #f8d9b0; }
.atn-incomplete td { background: #f8d0c8; }
.atn-incomplete .atn-da-label { color: #9b2c2c; font-weight: 700; }
.atn-table .atn-in { width: 110px; padding: 4px 6px; }
.atn-table .atn-haven { width: 168px; padding: 4px 6px; font-size: 0.78rem; }
.atn-table .atn-num { width: 92px; padding: 4px 6px; }
.atn-da-label { font-size: 0.75rem; font-weight: 600; }
.atn-valor-fda, .atn-saldo { font-weight: 700; }
.itin-pending-rel td { background: #fff6c2; }
.itin-in-rel td { background: #d8f3e2; }
.badge-pending-rel {
  background: #ffe566;
  color: #5c4b00;
}
.badge-in-rel {
  background: #c6ebd4;
  color: #1f6b4d;
}
.rel-forms { display: none; }
.rel-pending td { background: #fff6c2; }
.rel-ok td { background: #f8d9b0; }
.rel-table .rel-in,
.rel-table .rel-num,
.rel-table .rel-fact {
  width: 100%;
  min-width: 72px;
  max-width: 140px;
  padding: 4px 6px;
  font: inherit;
  font-size: 0.85rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.rel-table .rel-num { max-width: 100px; }
.rel-table .rel-tax { max-width: 168px; min-width: 120px; }
.rel-table .rel-fact { max-width: 88px; }
.rel-table .rel-st {
  min-width: 148px;
  max-width: 180px;
  padding: 4px 6px;
  font: inherit;
  font-size: 0.8rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.rel-valor { font-weight: 700; white-space: nowrap; }
.rel-row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.rel-arr-form {
  display: flex;
  align-items: center;
  gap: 6px;
}
.rel-arr-input {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 6px 8px;
  font: inherit;
  font-size: 0.85rem;
  min-width: 140px;
  background: #fff;
}
.rel-arr-desvio .rel-arr-input {
  border-color: #c0392b;
  background: #fdecea;
  color: #9b2c2c;
  font-weight: 600;
}
.rel-arr-itinerary,
.rel-arr-warn-txt {
  color: #9b2c2c;
  font-size: 0.72rem;
  margin-top: 4px;
  font-weight: 600;
  white-space: normal;
  max-width: 220px;
}
/* —— Responsive global —— */
html { -webkit-text-size-adjust: 100%; }
.field input,
.field select,
.pda-table input,
.pda-notes {
  font-size: 16px; /* evita zoom automático en iOS */
}
@media (max-width: 700px) {
  .grid2 { grid-template-columns: 1fr; }
  .wrap, .wrap-wide { padding: 14px; }
  .brand { font-size: 1.2rem; }
  .logo-header { height: 40px; max-width: 120px; }
  .top { align-items: flex-start; margin-bottom: 14px; }
  .top-brand { gap: 10px; min-width: 0; flex: 1 1 auto; }
  .top-brand .muted { font-size: 0.8rem; }
  .nav { width: 100%; }
  .nav .btn { flex: 1 1 auto; min-height: 44px; padding: 10px 12px; font-size: 0.88rem; }
  .card { padding: 16px; border-radius: 14px; }
  .modules { grid-template-columns: 1fr; }
  .mod { min-height: 44px; }
  .login-page {
    padding: 16px;
    padding:
      max(16px, env(safe-area-inset-top))
      max(16px, env(safe-area-inset-right))
      max(16px, env(safe-area-inset-bottom))
      max(16px, env(safe-area-inset-left));
    align-content: center;
  }
  .login-card {
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
    padding: 20px 18px;
  }
  .logo-login { max-width: min(200px, 70vw); }
  .login-form .field { margin-bottom: 16px; }
  .login-form .field label { font-size: 0.9rem; margin-bottom: 8px; }
  .login-form .field input {
    min-height: 52px;
    padding: 14px 14px;
    border-radius: 14px;
  }
  .btn-login { min-height: 52px; border-radius: 14px; }
  .table-wrap {
    margin: 0 -4px;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
  }
  table { font-size: 0.8rem; }
}

/* PDA / FDA form */
.wrap-wide { max-width: 1280px; }
.atn-forms { position: absolute; width: 0; height: 0; overflow: hidden; }
.pda-estimate {
  color: #9b2c2c;
  font-size: 0.88rem;
  margin: 0 0 14px;
  font-weight: 500;
}
.pda-subh {
  font-size: 0.95rem;
  margin: 18px 0 10px;
  color: var(--ocean);
}
.grid-specs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
}
.grid-specs-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px 28px;
  align-items: start;
}
.specs-col {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.specs-col .field label {
  display: flex;
  align-items: center;
  gap: 6px;
}
.term-help {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid rgba(20, 112, 138, 0.35);
  background: rgba(20, 112, 138, 0.1);
  color: var(--ocean);
  font: 600 0.7rem/1 var(--font);
  cursor: help;
}
.term-help:hover,
.term-help:focus {
  background: var(--ocean);
  color: #fff;
  border-color: var(--ocean);
  outline: none;
}
.term-help-th {
  width: 16px;
  height: 16px;
  font-size: 0.62rem;
  vertical-align: middle;
  margin-right: 2px;
  background: rgba(255,255,255,0.2);
  border-color: rgba(255,255,255,0.45);
  color: #fff;
}
.term-help-th:hover,
.term-help-th:focus {
  background: #fff;
  color: var(--ocean);
}
.term-popover {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(7, 24, 36, 0.45);
  display: grid;
  place-items: center;
  padding: 20px;
}
.term-popover[hidden] { display: none !important; }
.term-popover-card {
  position: relative;
  width: min(420px, 100%);
  background: #fff;
  border-radius: 16px;
  padding: 22px 22px 18px;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
}
.term-popover-card h4 {
  margin: 0 0 6px;
  font-family: var(--display);
  font-size: 1.15rem;
  color: var(--ink);
  padding-right: 28px;
}
.term-popover-card p { margin: 0 0 10px; line-height: 1.45; font-size: 0.92rem; }
.term-popover-close {
  position: absolute;
  top: 10px;
  right: 12px;
  border: 0;
  background: transparent;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  color: var(--muted);
}
.pda-lines-wrap {
  margin-bottom: 16px;
  padding: 0;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}
.pda-lines-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: #f4fafc;
}
.pda-lines-toolbar .muted { margin: 0; font-size: 0.8rem; }
.pda-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 0.82rem;
}
.pda-table th {
  background: var(--ocean);
  color: #fff;
  padding: 10px 8px;
  font-size: 0.72rem;
  letter-spacing: .03em;
  white-space: nowrap;
}
.pda-table td { padding: 4px 6px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.pda-table th:nth-child(1),
.pda-table td[data-label="Item"] { width: 5%; }
.pda-table th:nth-child(2),
.pda-table td[data-label="Inv. No."] { width: 8%; }
.pda-table th:nth-child(3),
.pda-table td[data-label="Descripción"] {
  width: 22%;
  white-space: normal;
  word-break: break-word;
}
.pda-table th:nth-child(4),
.pda-table th:nth-child(5),
.pda-table th:nth-child(6),
.pda-table td[data-label="DATA"],
.pda-table td[data-label="RATE"],
.pda-table td[data-label="HOURS"] { width: 8%; }
.pda-table th:nth-child(7),
.pda-table th:nth-child(8),
.pda-table td[data-label="TOTAL USD"],
.pda-table td[data-label="COP"] { width: 10%; }
.pda-table th:nth-child(9) { width: 13%; }
.pda-table th:last-child,
.pda-table td.pda-line-actions,
.pda-table td.pda-sec-actions {
  position: sticky;
  right: 0;
  z-index: 2;
  background: #fff;
  box-shadow: -8px 0 10px -8px rgba(7, 24, 36, .18);
}
.pda-section-row td.pda-sec-actions { background: #d6eaf0; }
.pda-section-row td {
  position: relative;
  background: #d6eaf0;
  color: var(--ocean);
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: .04em;
  padding: 10px 12px;
  text-align: center;
  border-bottom: 1px solid #b7d4de;
}
.pda-section-title {
  display: block;
  font-size: 1.05rem;
  letter-spacing: .06em;
  text-align: center;
}
.pda-sec-tot {
  text-align: right !important;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  font-size: 0.88rem !important;
  letter-spacing: 0 !important;
}
.pda-sec-actions {
  min-width: 0;
  width: 1%;
  white-space: nowrap;
  text-align: right !important;
}
.pda-section-row .pda-add-line {
  float: right;
  font-weight: 600;
  font-size: 0.75rem;
  padding: 4px 10px;
}
.pda-section-add {
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: flex-end;
  font-weight: 400;
}
.pda-pick {
  min-width: 140px;
  max-width: 220px;
  font-size: 0.78rem;
  padding: 4px 8px;
  border-radius: 8px;
  border: 1px solid rgba(20, 112, 138, 0.25);
}
.pda-table .inp-detalle {
  display: block;
  margin-top: 3px;
  padding: 4px 8px;
  font-size: 0.72rem;
  color: var(--muted);
  background: #f7fafb;
  border: 1px dashed var(--line);
}
.pda-table .inp-detalle:focus {
  color: var(--ink);
  background: #fff;
  border-style: solid;
}
.pda-table .pda-copbase {
  display: none;
  margin-top: 4px;
  width: 100%;
  max-width: 160px;
  font-size: 0.75rem;
}
.pda-table tr.is-watch-cop .pda-copbase {
  display: block;
}
.pda-pilot-kind-pop {
  position: fixed;
  z-index: 81;
  width: 280px;
  padding: 12px 14px 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
}
.pda-pilot-kind-pop .nav {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.pda-formula {
  display: block;
  font-size: 0.68rem;
  color: var(--muted);
  font-weight: 600;
  margin-top: 3px;
  letter-spacing: .02em;
}
.pda-table input {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 7px 8px;
  font: inherit;
  background: #fff;
}
.pda-table input:focus {
  outline: none;
  border-color: rgba(20, 112, 138, 0.45);
  background: #f7fcfd;
}
.pda-table .inp-sm { min-width: 0; max-width: 100%; }
.pda-table .inp-desc {
  min-width: 0;
  background: transparent;
  cursor: default;
  font-weight: 600;
}
.pda-table .inp-desc:focus {
  border-color: transparent;
  background: transparent;
}
.pda-table .inp-num { min-width: 0; text-align: right; }
.pda-cop { position: relative; }
.pda-cop .js-cop { display: block; text-align: right; font-variant-numeric: tabular-nums; }
.pda-line-trm-hint {
  display: block;
  margin-top: 2px;
  font-size: 0.68rem;
  color: var(--muted);
  text-align: right;
  white-space: normal;
  max-width: 140px;
  margin-left: auto;
}
.pda-roe-btn.is-on {
  background: rgba(20, 112, 138, 0.16);
  color: var(--ocean);
  font-weight: 700;
}
.pda-line-roe-date {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.pda-line.pda-roe-open .pda-line-roe-date {
  position: static;
  width: 100%;
  height: auto;
  opacity: 1;
  pointer-events: auto;
  margin-top: 4px;
}
.pda-table .inp-calc {
  width: 100%;
  min-width: 132px;
  font-size: 0.72rem;
  padding: 6px 4px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: #fff;
}
.pda-line-actions {
  white-space: nowrap;
  text-align: right;
  width: 1%;
  background: #fff;
}
.pda-line-actions .btn {
  padding: 4px 8px;
  min-width: 32px;
}
.pda-link {
  font-size: 0.72rem;
  min-width: auto !important;
  padding: 4px 8px !important;
}
.pda-link.is-linked {
  background: #d6eaf0;
  color: var(--ocean);
  border-color: #b7d7e4;
}
.pda-line.pda-inv-start td:nth-child(1),
.pda-line.pda-inv-cont td:nth-child(1),
.pda-line.pda-inv-start td:nth-child(2),
.pda-line.pda-inv-cont td:nth-child(2) {
  background: #eef6f9;
}
.pda-line.pda-inv-start td:nth-child(1) {
  box-shadow: inset 3px 0 0 var(--ocean);
  border-bottom-color: transparent !important;
}
.pda-line.pda-inv-cont td:nth-child(1) {
  box-shadow: inset 3px 0 0 var(--ocean);
}
.pda-line.pda-inv-start td:nth-child(2) {
  border-bottom-color: transparent !important;
}
.pda-line.pda-inv-cont .js-itemno,
.pda-line.pda-inv-cont .js-invno,
.pda-line.pda-inv-cont .pda-claim-sum {
  visibility: hidden;
}
.pda-claim-sum[hidden] { display: none !important; }
.pda-claim-sum {
  display: block;
  margin: 4px auto 0;
  width: 28px;
  height: 22px;
  padding: 0;
  border: 1px solid rgba(20, 112, 138, 0.35);
  border-radius: 8px;
  background: #fff;
  color: var(--ocean);
  font-weight: 700;
  font-size: 0.78rem;
  cursor: pointer;
  line-height: 20px;
}
.pda-claim-sum:hover { background: #d6eaf0; }
.pda-claim-pop {
  position: fixed;
  z-index: 80;
  width: 300px;
  padding: 12px 14px 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
}
.pda-claim-pop-h { margin: 0 0 4px; font-size: 0.92rem; }
.pda-claim-pop label {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
  margin: 8px 0 4px;
}
.pda-claim-row { display: flex; gap: 6px; }
.pda-claim-row input {
  flex: 1;
  font: inherit;
  font-variant-numeric: tabular-nums;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  background: #f4f8fa;
}
.pda-claim-row .btn { padding: 8px 10px; }
.pda-claim-pop textarea {
  width: 100%;
  min-height: 92px;
  font: inherit;
  line-height: 1.35;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  background: #f4f8fa;
  resize: vertical;
  text-transform: uppercase;
}
.pda-cop { text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); white-space: nowrap; padding-right: 10px !important; }
.pda-vat-auto .js-usd,
.pda-vat-auto .js-rate,
.pda-vat-auto .js-data,
.pda-gmf-auto .js-usd,
.pda-gmf-auto .js-rate {
  background: #f0f7f9;
  color: var(--ocean);
}
.pda-summary-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 14px;
}
.pda-sum { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.pda-sum td { padding: 8px 6px; border-bottom: 1px solid var(--line); }
.pda-sum td.num { text-align: right; font-variant-numeric: tabular-nums; }
.pda-sum tr.strong td { font-weight: 700; background: rgba(20, 112, 138, 0.08); }
.pay-block { font-size: 0.88rem; line-height: 1.55; margin: 0 0 12px; }
.pay-notify { margin: 0; padding-left: 18px; font-size: 0.85rem; color: var(--sea); }
.pda-notes {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 12px;
  font: inherit;
  resize: vertical;
  background: #fff;
  color: #9b2c2c;
}
@media (max-width: 900px) {
  .pda-summary-grid { grid-template-columns: 1fr; }
  .grid-specs-2 { grid-template-columns: 1fr; }
}

/* PDA líneas → tarjetas en celular */
@media (max-width: 760px) {
  .pda-lines-wrap {
    overflow: visible;
    background: transparent;
    border: 0;
    box-shadow: none;
    padding: 0;
  }
  .pda-table thead { display: none; }
  .pda-table,
  .pda-table tbody {
    display: block;
    width: 100%;
    min-width: 0;
  }
  .pda-section-row {
    display: block;
    margin: 14px 0 8px;
  }
  .pda-section-row td {
    display: block;
    border-radius: 0;
    padding: 8px 12px !important;
    letter-spacing: .03em;
    text-align: center;
  }
  .pda-section-row td:first-child {
    border-radius: 10px 10px 0 0;
    padding-top: 12px !important;
  }
  .pda-section-row td:last-child {
    border-radius: 0 0 10px 10px;
    padding-bottom: 12px !important;
  }
  .pda-sec-tot {
    text-align: center !important;
  }
  .pda-sec-tot::before {
    content: attr(data-label) ": ";
    font-weight: 600;
    font-size: 0.72rem;
    letter-spacing: .03em;
  }
  .pda-section-title { font-size: 1.02rem; }
  .pda-section-add {
    position: static;
    transform: none;
    justify-content: center;
    margin-top: 4px;
    float: none;
  }
  .pda-line {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 10px;
    margin-bottom: 12px;
    padding: 12px;
    background: rgba(255,255,255,0.95);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: 0 8px 24px rgba(7, 24, 36, 0.06);
  }
  .pda-line td {
    display: flex;
    flex-direction: column;
    gap: 4px;
    border: 0 !important;
    padding: 0 !important;
    white-space: normal;
    min-width: 0;
  }
  .pda-line td::before {
    content: attr(data-label);
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--muted);
    letter-spacing: .02em;
  }
  .pda-line td[data-label="Descripción"],
  .pda-line td[data-label="Cálculo"] {
    grid-column: 1 / -1;
  }
  .pda-table th:last-child,
  .pda-table td.pda-line-actions,
  .pda-table td.pda-sec-actions {
    position: static;
    box-shadow: none;
  }
  .pda-line td.pda-line-actions {
    grid-column: 1 / -1;
    flex-direction: row;
    justify-content: flex-end;
    gap: 8px;
  }
  .pda-line.pda-inv-start,
  .pda-line.pda-inv-cont {
    border-left: 3px solid var(--ocean);
  }
  .pda-line.pda-inv-cont .js-itemno,
  .pda-line.pda-inv-cont .js-invno {
    visibility: visible;
  }
  .pda-line.pda-inv-start td:nth-child(1),
  .pda-line.pda-inv-cont td:nth-child(1),
  .pda-line.pda-inv-start td:nth-child(2),
  .pda-line.pda-inv-cont td:nth-child(2) {
    background: transparent;
    box-shadow: none;
    border-bottom-color: inherit !important;
  }
  .pda-line td.pda-line-actions::before { content: none; }
  .pda-line td[data-label="TOTAL USD"],
  .pda-line td[data-label="COP"] {
    grid-column: span 1;
  }
  .pda-table .inp-sm,
  .pda-table .inp-desc,
  .pda-table .inp-num {
    min-width: 0;
    max-width: none;
    width: 100%;
    min-height: 42px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 10px;
    font-size: 16px;
  }
  .pda-cop {
    padding: 10px !important;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #f7fbfc;
    text-align: right;
    min-height: 42px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
  }
  .pda-estimate { font-size: 0.82rem; line-height: 1.4; }
  .pda-subh { font-size: 0.9rem; }
  .pda-sum td { white-space: normal; font-size: 0.85rem; }
  .term-help {
    width: 28px;
    height: 28px;
    font-size: 0.8rem;
  }
  .term-popover { padding: 12px; align-items: end; }
  .term-popover-card {
    width: 100%;
    border-radius: 16px 16px 12px 12px;
    max-height: 70vh;
    overflow: auto;
  }
}

/* Itinerario / listados: scroll horizontal suave en móvil */
@media (max-width: 700px) {
  .table-wrap:not(.pda-lines-wrap) {
    overflow-x: auto;
  }
  .table-wrap:not(.pda-lines-wrap) table {
    min-width: 720px;
  }
}

/* —— Shell: menú lateral (Operaciones / Calidad) —— */
.app-body { background: #eef6f8; }
.app-menu-btn {
  display: none;
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 40;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 12px;
  background: #071824;
  color: #fff;
  font-size: 1.2rem;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(7, 24, 36, .25);
}
.app-side-brand-row {
  display: flex;
  align-items: center;
  gap: 4px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.app-side-brand-row .app-side-brand {
  flex: 1;
  min-width: 0;
  border-bottom: 0;
}
.app-side-hide {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  margin: 0 10px 0 0;
  border: 0;
  border-radius: 8px;
  background: rgba(255,255,255,.08);
  color: #c5d7e0;
  font-size: 1.05rem;
  line-height: 1;
  cursor: pointer;
}
.app-side-hide:hover { background: rgba(255,255,255,.16); color: #fff; }
.app-shell {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  min-height: 100vh;
}
.app-sidebar {
  background: #071824;
  color: #d7e6ee;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  position: sticky;
  top: 0;
  max-height: 100vh;
  overflow: auto;
}
.app-side-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 12px 14px 16px;
  color: #fff;
  font-weight: 700;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.app-side-brand img { height: 52px; width: auto; max-width: 210px; object-fit: contain; display: block; }
.app-side-nav { padding: 12px 10px; flex: 1; }
.app-side-home, .app-side-link {
  display: block;
  padding: 9px 12px;
  border-radius: 8px;
  color: #c5d7e0;
  font-size: 0.9rem;
}
.app-side-home { margin-bottom: 8px; font-weight: 600; }
.app-side-home:hover, .app-side-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.app-side-home.is-active, .app-side-link.is-active {
  background: #14708a;
  color: #fff;
  font-weight: 600;
}
.app-side-group { margin: 4px 0 10px; }
.app-side-group summary {
  list-style: none;
  cursor: pointer;
  padding: 9px 12px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #8fb4c4;
}
.app-side-group summary::-webkit-details-marker { display: none; }
.app-side-group summary::after {
  content: "▸";
  float: right;
  opacity: .7;
}
.app-side-group[open] summary::after { content: "▾"; }
.app-side-group summary:hover { background: rgba(255,255,255,.05); color: #fff; }
.app-side-sub { padding: 2px 0 6px 8px; display: flex; flex-direction: column; gap: 2px; }
.app-side-foot {
  padding: 14px 16px 18px;
  border-top: 1px solid rgba(255,255,255,.08);
  font-size: 0.82rem;
}
.app-side-user { color: #fff; font-weight: 600; margin-bottom: 6px; }
.app-side-foot a { color: #8fb4c4; }
.app-main { min-width: 0; display: flex; flex-direction: column; }
.app-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  padding: 16px 22px;
  background: rgba(255,255,255,.7);
  border-bottom: 1px solid var(--line);
}
.app-header h1 {
  font-family: var(--display);
  font-size: 1.35rem;
  margin: 0;
}
.app-header p { margin: 4px 0 0; color: var(--muted); font-size: 0.88rem; }
.app-header-text { flex: 1 1 200px; min-width: 0; }
.app-header-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.app-content { padding: 18px 22px 28px; max-width: 1200px; }
.app-content.is-wide { max-width: none; width: 100%; }

.esc-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.esc-table th {
  background: #14708a;
  color: #fff;
  font-size: 0.78rem;
  letter-spacing: .03em;
  padding: 10px 12px;
}
.esc-table td { padding: 9px 12px; border-bottom: 1px solid var(--line); }
.esc-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.esc-table tr.esc-subtot td {
  background: #d6eaf0;
  color: var(--ocean);
  font-weight: 700;
}
.esc-table tr.esc-gap td { padding: 8px; border: 0; background: transparent; }
.app-backdrop { display: none; }

@media (min-width: 901px) {
  html.nav-collapsed .app-shell {
    grid-template-columns: minmax(0, 1fr);
  }
  html.nav-collapsed .app-sidebar {
    display: none;
  }
  html.nav-collapsed .app-menu-btn {
    display: block;
  }
  html.nav-collapsed .app-header {
    padding-left: 64px;
  }
}

@media (max-width: 900px) {
  .app-menu-btn { display: block; }
  .app-side-hide { display: none; }
  .app-shell { grid-template-columns: 1fr; }
  .app-sidebar {
    position: fixed;
    z-index: 35;
    left: 0;
    top: 0;
    width: min(280px, 88vw);
    transform: translateX(-105%);
    transition: transform .2s ease;
  }
  .nav-open .app-sidebar { transform: translateX(0); }
  .nav-open .app-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(7,24,36,.45);
    z-index: 30;
  }
  .app-header { padding: 16px 16px 16px 60px; }
  .app-content { padding: 14px; }
}

.chk-legend { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.chk-legend span, .chk-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
}
.chk-role-oficina { background: #f4c7c3; }
.chk-role-supervisor { background: #c5daf0; }
.chk-role-campo { background: #d9d9d9; }
.chk-st-ok { background: #2f8f6b; color: #fff; }
.chk-st-pend { background: #e3b341; color: #3a2a00; }
.chk-st-na { background: #8a97a0; color: #fff; }
.chk-sec-txt { color: #c1121f; font-weight: 700; }
.chk-note { margin: 0 0 10px; }
.chk-table td, .chk-table th { white-space: normal; }
.chk-table select.chk-status { min-width: 88px; font-weight: 700; border: 0; border-radius: 8px; padding: 6px 8px; }
.chk-table input { width: 100%; min-width: 140px; border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; font: inherit; }
.ls-matrix th, .ls-matrix td { text-align: center; }
.ls-matrix th:first-child, .ls-matrix td:first-child { text-align: left; }

.asist-punch { margin-bottom: 14px; }
.asist-punch.is-focus { outline: 2px solid var(--sea); }
.asist-punch .btn { min-height: 48px; font-size: 1.05rem; }
.asist-punch input[type="file"] { min-height: 44px; }
.asist-pick {
  list-style: none;
  margin: 6px 0 0;
  padding: 6px 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  max-height: 220px;
  overflow-y: auto;
}
.asist-pick li {
  padding: 8px 12px;
  cursor: pointer;
  font-size: 0.9rem;
}
.asist-pick li:hover { background: #14708a; color: #fff; }
.lote-person .muted { font-size: 0.78rem; margin-left: 4px; }

.usr-mods {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin: 8px 0 4px;
}
.usr-mod-col h3 {
  margin: 0 0 8px;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
}
.usr-mod {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 6px;
  font-size: 0.9rem;
  cursor: pointer;
}
.usr-mod input { width: auto; }

.fp-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 16px;
}
.fp-chip {
  display: inline-block;
  font-size: 0.78rem;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(20,112,138,.1);
  color: var(--sea);
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
}
.fp-chip.is-on { border-color: var(--sea); background: rgba(20,112,138,.18); }
.fp-st-pendiente { background: rgba(201,162,39,.16); color: #7a5b10; }
.fp-st-autorizada { background: rgba(20,112,138,.14); color: var(--sea); }
.fp-st-rechazada { background: rgba(196,92,42,.14); color: #7a3418; }
.fp-st-causada { background: rgba(47,143,107,.16); color: #1f6b4d; }
.fp-layout { display: grid; grid-template-columns: 1fr; gap: 16px; }
.fp-layout.has-open { grid-template-columns: minmax(0, 1fr) minmax(280px, 420px); }
.fp-table tr.is-open td { background: rgba(20,112,138,.08); }
.fp-pdf {
  width: 100%;
  min-height: 52vh;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f4f6f7;
}
.fp-row-acts {
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 8px;
}
.fp-del-form { display: inline; margin: 0; }
.fp-pdf-btn { padding: 4px 10px; font-size: 0.8rem; }
body.fp-modal-open { overflow: hidden; }
.fp-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(12, 28, 36, .55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.fp-modal[hidden] { display: none; }
.fp-modal-box {
  width: min(1100px, 96vw);
  height: min(88vh, 900px);
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 18px 50px rgba(0,0,0,.28);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.fp-modal-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
}
.fp-modal-box .fp-pdf {
  flex: 1;
  min-height: 0;
  border: 0;
  border-radius: 0;
}
.fp-hist {
  margin: 0 0 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f7fafb;
}
.fp-hist h3 {
  margin: 0 0 8px;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
}
.fp-hist ol {
  margin: 0;
  padding: 0;
  list-style: none;
}
.fp-hist li {
  font-size: 0.85rem;
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
  line-height: 1.35;
}
.fp-hist li:last-child { border-bottom: 0; }
.fp-hist-when {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
}
@media (max-width: 1100px) {
  .fp-layout.has-open { grid-template-columns: 1fr; }
}
