:root {
  color-scheme: light;
  --navy: #102a43;
  --navy-2: #173e63;
  --blue: #1572a1;
  --blue-2: #0b5278;
  --green: #198754;
  --orange: #f2994a;
  --red: #d64545;
  --purple: #9b51e0;
  --teal: #17bebb;
  --yellow: #f2c94c;
  --slate: #6b778c;
  --bg: #f3f6fa;
  --surface: #fff;
  --surface-2: #f8fafc;
  --border: #dce5ef;
  --text: #172b4d;
  --muted: #6b778c;
  --shadow: 0 18px 45px rgba(16, 42, 67, .12);
  --sidebar-width: 250px;
  font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
}
button, input, select { font: inherit; }
button { cursor: pointer; }
.is-hidden { display: none !important; }
.muted { color: var(--muted); }
.eyebrow {
  margin: 0 0 8px;
  color: #507092;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .11em;
}

.login-view {
  min-height: 100%;
  display: grid;
  grid-template-columns: minmax(360px, 1.2fr) minmax(360px, .8fr);
  background: #edf3f8;
}
.login-brand {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(42px, 8vw, 120px);
  color: #fff;
  background:
    radial-gradient(circle at 20% 20%, rgba(47, 128, 237, .22), transparent 36%),
    linear-gradient(145deg, #0b2239, #102a43 58%, #173e63);
}
.login-brand .eyebrow { color: #a9c7e4; margin-top: 24px; }
.login-brand h1 {
  max-width: 640px;
  margin: 0 0 18px;
  font-size: clamp(32px, 4.5vw, 58px);
  line-height: 1.03;
  letter-spacing: -.035em;
}
.login-brand > p:not(.eyebrow) {
  max-width: 590px;
  margin: 0;
  color: #dbe9f5;
  font-size: 17px;
  line-height: 1.7;
}
.brand-mark {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  color: #fff;
  background: var(--navy);
  box-shadow: inset -8px 0 0 var(--orange);
  font-size: 27px;
  font-weight: 900;
  letter-spacing: -.08em;
}
.brand-mark--large {
  width: 92px;
  height: 92px;
  border-radius: 24px;
  background: rgba(255, 255, 255, .08);
  box-shadow: inset -13px 0 0 var(--orange), 0 18px 38px rgba(0, 0, 0, .18);
  font-size: 42px;
}
.local-badge {
  width: fit-content;
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 34px;
  padding: 10px 14px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 999px;
  color: #e9f6ee;
  background: rgba(255,255,255,.07);
}
.status-dot {
  width: 9px;
  height: 9px;
  display: inline-block;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #2ecc71;
  box-shadow: 0 0 0 4px rgba(46,204,113,.14);
}
.status-dot.is-offline {
  background: var(--red);
  box-shadow: 0 0 0 4px rgba(214,69,69,.14);
}
.login-card {
  width: min(430px, calc(100% - 48px));
  align-self: center;
  justify-self: center;
  display: grid;
  gap: 20px;
  padding: clamp(32px, 4vw, 52px);
  border: 1px solid var(--border);
  border-radius: 22px;
  background: #fff;
  box-shadow: var(--shadow);
}
.login-card h2 { margin: 0; font-size: 32px; }
.login-card p { margin: 6px 0 0; }
label {
  display: grid;
  gap: 7px;
  color: #36516e;
  font-size: 12px;
  font-weight: 700;
}
input, select {
  min-width: 0;
  height: 42px;
  padding: 0 12px;
  border: 1px solid #cdd9e5;
  border-radius: 8px;
  outline: none;
  color: var(--text);
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
textarea {
  width: 100%;
  min-height: 82px;
  padding: 10px 12px;
  resize: vertical;
  border: 1px solid #cdd9e5;
  border-radius: 8px;
  outline: none;
  color: var(--text);
  background: #fff;
  font: inherit;
}
textarea:focus {
  border-color: #2f80ed;
  box-shadow: 0 0 0 3px rgba(47,128,237,.13);
}
input:focus, select:focus {
  border-color: #2f80ed;
  box-shadow: 0 0 0 3px rgba(47,128,237,.13);
}
.button {
  min-height: 40px;
  padding: 0 18px;
  border: 0;
  border-radius: 8px;
  font-weight: 700;
  transition: transform .12s, filter .12s, background .12s;
}
.button:hover { filter: brightness(.97); }
.button:active { transform: translateY(1px); }
.button:disabled { cursor: wait; opacity: .6; }
.button--primary { color: #fff; background: linear-gradient(135deg, #167cb0, #0b5b85); }
.button--secondary { color: #21415f; background: #eaf0f6; }
.button--success { color: #fff; background: var(--green); }
.button--danger { color: #fff; background: var(--red); }
.button--warning { color: #543d00; background: #ffd56a; }
.button--small { min-height: 32px; padding: 0 11px; font-size: 11px; }
.button--wide { width: 100%; }
.button--sidebar {
  width: calc(100% - 28px);
  margin: 12px 14px 16px;
  color: #fff;
  background: #1b4d78;
}
.form-error { min-height: 18px; color: var(--red); font-weight: 600; }
.server-state { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 12px; }
.version { text-align: center; color: #8ea0b2; font-size: 11px; }

.app-shell {
  min-height: 100%;
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  transition: grid-template-columns .22s ease;
}
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: #fff;
  background: var(--navy);
  z-index: 30;
  transition: transform .22s ease, opacity .18s ease;
}
.app-shell.is-sidebar-collapsed { grid-template-columns: 0 minmax(0, 1fr); }
.app-shell.is-sidebar-collapsed .sidebar {
  transform: translateX(-100%);
  opacity: 0;
  pointer-events: none;
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 86px;
  padding: 13px 17px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.sidebar-brand .brand-mark { width: 50px; height: 50px; background: rgba(255,255,255,.08); font-size: 24px; }
.sidebar-brand-copy { display: grid; gap: 4px; }
.sidebar-brand-copy strong { font-size: 14px; }
.sidebar-brand-copy span { color: #b9cde0; font-size: 11px; }
.module-nav {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
}
.nav-button {
  width: 100%;
  min-height: 54px;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  align-items: center;
  gap: 3px;
  padding: 6px 14px;
  border: 0;
  border-left: 3px solid transparent;
  color: #fff;
  text-align: left;
  background: transparent;
}
.nav-button:hover { background: rgba(255,255,255,.055); }
.nav-button.is-active { border-left-color: #58a9ff; background: #1b4d78; }
.nav-button span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-weight: 700; }
.module-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
  color: #fff;
  background: #2f80ed;
}
.module-icon svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.sidebar-user {
  display: grid;
  grid-template-columns: 38px minmax(0,1fr);
  gap: 10px;
  align-items: center;
  margin: 12px 14px 0;
  padding-top: 14px;
  border-top: 1px solid rgba(255,255,255,.1);
}
.avatar { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; color: #fff; background: #1684bd; font-weight: 800; }
.sidebar-user-copy { display: grid; gap: 4px; min-width: 0; }
.sidebar-user-copy strong, .sidebar-user-copy span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user-copy strong { font-size: 12px; }
.sidebar-user-copy span { color: #b9cde0; font-size: 10px; }

.workspace { min-width: 0; min-height: 100vh; }
.topbar {
  position: sticky;
  top: 0;
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 10px 22px;
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(12px);
  z-index: 20;
}
.topbar-left, .topbar-right { display: flex; align-items: center; gap: 12px; }
.topbar-left > strong { font-size: 17px; }
.topbar .module-icon { width: 40px; height: 40px; }
.icon-button { width: 38px; height: 38px; display: grid; place-content: center; gap: 4px; border: 0; border-radius: 8px; background: transparent; }
.icon-button:hover { background: #edf3f8; }
.icon-button span { width: 18px; height: 2px; border-radius: 3px; background: var(--navy); }
.connection-state { display: flex; align-items: center; gap: 9px; color: var(--green); font-size: 12px; font-weight: 700; }
.clock { color: var(--muted); font-size: 12px; }
.main-content { min-width: 0; padding: clamp(16px, 2vw, 28px); outline: none; }
.screen-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; margin-bottom: 18px; }
.screen-heading h1 { margin: 0 0 5px; color: #0e2a47; font-size: clamp(24px, 2.4vw, 32px); letter-spacing: -.02em; }
.screen-heading p { margin: 0; color: var(--muted); }
.heading-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.heading-actions--end { justify-content: flex-end; margin-top: 12px; }
.section-gap { margin-top: 14px; }

.filter-bar, .card {
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--surface);
}
.filter-bar {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
  padding: 14px;
  margin-bottom: 14px;
}
.field { display: grid; gap: 6px; }
.field > span { color: #56718c; font-size: 10px; font-weight: 800; letter-spacing: .04em; }
.field--4 { grid-column: span 4; }
.field--3 { grid-column: span 3; }
.field--2 { grid-column: span 2; }
.filter-actions { grid-column: span 3; display: flex; gap: 8px; }
.filter-actions .button { flex: 1; }
.filter-actions--wide { grid-column: span 4; }
.metrics-grid { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap: 12px; margin-bottom: 14px; }
.metrics-grid--three { grid-template-columns: repeat(3, minmax(0,1fr)); }
.metrics-grid--four { grid-template-columns: repeat(4, minmax(0,1fr)); }
input[type="checkbox"], input[type="radio"] {
  width: 16px;
  height: 16px;
  min-height: 16px;
  padding: 0;
  vertical-align: middle;
}
.metric-card {
  min-height: 104px;
  display: grid;
  grid-template-columns: 46px minmax(0,1fr);
  align-items: center;
  gap: 12px;
  padding: 15px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--surface);
}
.metric-icon { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 13px; color: #1f6fb2; background: #e7f2fd; font-size: 20px; font-weight: 800; }
.metric-card:nth-child(2) .metric-icon { color: #16834f; background: #e8f6ee; }
.metric-card:nth-child(3) .metric-icon { color: #a36500; background: #fff3d6; }
.metric-card:nth-child(4) .metric-icon { color: #8d3bc5; background: #f1e7fa; }
.metric-card:nth-child(5) .metric-icon { color: #b74141; background: #fbeaea; }
.metric-copy { min-width: 0; display: grid; gap: 5px; }
.metric-copy span { color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.metric-copy strong { overflow: hidden; text-overflow: ellipsis; color: #0c4871; font-size: 22px; }
.content-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(300px, .65fr); gap: 14px; }
.card { min-width: 0; padding: 14px; }
.card-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 11px; }
.card-header h2 { margin: 0; font-size: 14px; }
.card-header span { color: var(--muted); font-size: 11px; }
.alert-list { display: grid; gap: 8px; }
.alert-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px; border-left: 4px solid #f2c94c; border-radius: 7px; background: #fff8e8; }
.alert-item strong { font-size: 12px; }
.alert-item span { color: #765c12; font-weight: 800; }

.table-wrap {
  width: 100%;
  min-height: 180px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}
table { width: 100%; border-collapse: collapse; font-size: 12px; }
thead { position: sticky; top: 0; z-index: 2; }
th {
  padding: 10px 9px;
  border-bottom: 1px solid #c8d5e2;
  color: #27445f;
  text-align: left;
  white-space: nowrap;
  background: #eaf0f6;
}
td { padding: 9px; border-bottom: 1px solid #e5ebf1; white-space: nowrap; }
tbody tr { cursor: pointer; }
tbody tr:hover { background: #f3f8fc; }
tbody tr.is-selected { background: #dff0fb; }
.cell-wrap { min-width: 180px; max-width: 300px; white-space: normal; }
.empty-state { display: grid; place-items: center; min-height: 180px; padding: 30px; color: var(--muted); text-align: center; }
.detail-panel {
  display: grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap: 12px 20px;
  margin-top: 12px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #f9fbfd;
}
.detail-item { min-width: 0; display: grid; gap: 5px; }
.detail-item span { color: var(--muted); font-size: 9px; font-weight: 800; text-transform: uppercase; }
.detail-item strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.module-placeholder { min-height: 420px; display: grid; place-items: center; text-align: center; }
.placeholder-inner { max-width: 570px; }
.placeholder-icon { margin: 0 auto 18px; transform: scale(1.35); }
.placeholder-inner h2 { margin: 0 0 8px; font-size: 24px; }
.placeholder-inner p { margin: 0; color: var(--muted); line-height: 1.7; }
.phase-badge { display: inline-block; margin-top: 16px; padding: 7px 11px; border-radius: 999px; color: #0b5b85; background: #e4f2fb; font-size: 11px; font-weight: 800; }

.stack { display: grid; gap: 14px; }
.split-layout { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(310px, .65fr); gap: 14px; }
.split-layout--equal { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 12px; }
.form-grid .field--full { grid-column: 1 / -1; }
.form-grid .field--7 { grid-column: span 7; }
.form-grid .field--6 { grid-column: span 6; }
.form-grid .field--5 { grid-column: span 5; }
.form-grid .field--4 { grid-column: span 4; }
.form-grid .field--3 { grid-column: span 3; }
.form-grid .field--2 { grid-column: span 2; }
.form-grid textarea {
  min-height: 82px;
  padding: 10px 12px;
  resize: vertical;
  border: 1px solid #cdd9e5;
  border-radius: 8px;
  color: var(--text);
  background: #fff;
  font: inherit;
}
.form-grid textarea:focus {
  border-color: #2f80ed;
  outline: none;
  box-shadow: 0 0 0 3px rgba(47,128,237,.13);
}
.checkbox-field { display: flex; align-items: center; gap: 8px; min-height: 42px; color: #36516e; font-size: 12px; font-weight: 700; }
.checkbox-field input { width: 17px; height: 17px; min-width: 17px; }
.toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.toolbar-group { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.toolbar-note { color: var(--muted); font-size: 11px; }
.compact-filter { width: min(360px, 48vw); min-width: 220px; }
.guide-chips, .compact-buttons { display: flex; flex-wrap: wrap; gap: 7px; }
.guide-chip, .compact-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 31px;
  padding: 5px 10px;
  border: 1px solid #c9d7e4;
  border-radius: 999px;
  color: #24445f;
  background: #f5f9fc;
  font-size: 11px;
  font-weight: 700;
}
.guide-chip.is-active { color: #0d684e; border-color: #2a9874; background: #e7f7f1; box-shadow: 0 0 0 2px rgba(42,152,116,.12); }
.guide-chip .guide-chip-select { padding: 0; border: 0; color: inherit; background: transparent; font: inherit; line-height: 1.2; cursor: pointer; }
.guide-chip [data-delete-guide] { padding: 0; border: 0; color: var(--red); background: transparent; font-size: 15px; line-height: 1; cursor: pointer; }
.guide-empty-message { color: var(--muted); font-size: 11px; }
.digitization-guide-bar { padding: 11px 13px; border-left: 3px solid #268c6c; }
.digitization-guide-list { display: grid; gap: 2px; min-width: min(560px, 100%); }
.digitization-guide-list .subheading { margin-bottom: 5px; }
.digitization-guide-add { flex-wrap: nowrap; }
.digitization-guide-add .field { min-width: 230px; }
.digitization-guide-add .button { align-self: end; white-space: nowrap; }
.compact-button.is-active { color: #fff; border-color: #1572a1; background: #1572a1; }
.work-banner {
  display: grid;
  grid-template-columns: minmax(190px, 1.4fr) repeat(4, minmax(90px, .55fr));
  gap: 8px;
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid #bcd8e8;
  border-radius: 10px;
  background: #eaf6fd;
}
.work-banner-item { display: grid; gap: 4px; min-width: 0; padding: 4px 7px; }
.work-banner-item span { color: #56718c; font-size: 9px; font-weight: 800; text-transform: uppercase; }
.work-banner-item strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #0b5278; }
.subheading { margin: 0 0 11px; font-size: 13px; }
.tab-bar { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 14px; padding: 4px; border: 1px solid var(--border); border-radius: 9px; background: #eaf0f6; }
.tab-button { min-height: 34px; padding: 0 13px; border: 0; border-radius: 6px; color: #36516e; background: transparent; font-size: 11px; font-weight: 800; }
.tab-button.is-active { color: #0d4f75; background: #fff; box-shadow: 0 1px 4px rgba(16,42,67,.12); }
.status-badge { display: inline-flex; align-items: center; min-height: 24px; padding: 3px 8px; border-radius: 999px; color: #31506d; background: #e8eef4; font-size: 10px; font-weight: 800; }
.status-badge--success { color: #0d6a3c; background: #e4f5eb; }
.status-badge--danger { color: #9f2929; background: #fbe7e7; }
.status-badge--warning { color: #745700; background: #fff3cf; }
.kpi-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; margin-bottom: 12px; }
.kpi { padding: 12px; border: 1px solid var(--border); border-radius: 8px; background: #f8fbfd; }
.kpi span { display: block; margin-bottom: 5px; color: var(--muted); font-size: 9px; font-weight: 800; text-transform: uppercase; }
.kpi strong { color: #0d5078; font-size: 18px; }
.scroll-panel { max-height: min(58vh, 620px); overflow: auto; }
.selectable-list { display: grid; gap: 6px; }
.selectable-item { width: 100%; padding: 11px; border: 1px solid var(--border); border-radius: 8px; text-align: left; color: var(--text); background: #fff; }
.selectable-item:hover, .selectable-item.is-active { border-color: #8ec4e2; background: #eef8fd; }
.selectable-item strong, .selectable-item span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.selectable-item span { margin-top: 4px; color: var(--muted); font-size: 10px; }
.error-list { margin: 0; padding-left: 20px; color: #9f2929; line-height: 1.55; }

.dialog-layer {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(7, 25, 42, .48);
  z-index: 160;
}
.dialog {
  width: min(720px, 100%);
  max-height: calc(100vh - 40px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid #c7d5e2;
  border-radius: 13px;
  background: #fff;
  box-shadow: 0 24px 72px rgba(6, 28, 47, .3);
}
.dialog--small { width: min(480px, 100%); }
.dialog--large { width: min(1080px, 100%); }
.dialog--wide { width: min(1320px, 100%); }
.dialog--xlarge { width: min(1420px, 100%); }
.dialog-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 16px 18px; color: #fff; background: linear-gradient(135deg, #123b5c, #0c638d); }
.dialog-header h2 { margin: 0; font-size: 17px; }
.dialog-header p { margin: 4px 0 0; color: #d8ecf7; font-size: 11px; }
.dialog-close { width: 34px; height: 34px; border: 0; border-radius: 8px; color: #fff; background: rgba(255,255,255,.12); font-size: 24px; line-height: 1; }
.dialog-body { min-height: 0; overflow: auto; padding: 17px; }
.dialog-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; margin-top: 16px; padding-top: 13px; border-top: 1px solid var(--border); }
.callout { padding: 11px 13px; border-left: 4px solid #2f80ed; border-radius: 7px; color: #31516f; background: #edf6fd; line-height: 1.5; }
.callout--warning { border-left-color: #e2ae20; background: #fff8e3; }
.callout--danger { border-left-color: var(--red); color: #813030; background: #fcecec; }
.chart-list { display: grid; gap: 12px; padding: 5px 2px; }
.chart-row { display: grid; grid-template-columns: minmax(110px, .6fr) minmax(150px, 1.4fr) 92px; align-items: center; gap: 10px; }
.chart-row strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.chart-row span { text-align: right; font-size: 11px; font-weight: 700; }
.chart-row progress { width: 100%; height: 16px; border: 0; border-radius: 999px; overflow: hidden; accent-color: #2f80ed; }
.chart-row progress::-webkit-progress-bar { background: #e8eff6; }
.chart-row progress::-webkit-progress-value { background: linear-gradient(90deg, #2f80ed, #1972bd); }
.multi-select { min-height: 150px; padding: 7px; }
.permission-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; max-height: 430px; overflow: auto; }
.permission-group { padding: 10px; border: 1px solid var(--border); border-radius: 8px; background: #f8fbfd; }
.permission-group h3 { margin: 0 0 7px; color: #31516f; font-size: 11px; }
.permission-group .checkbox-field { min-height: 30px; font-size: 10px; }
.logo-preview { width: 240px; height: 125px; display: grid; place-items: center; overflow: hidden; border: 1px solid var(--border); border-radius: 9px; background: #f7fafc; }
.logo-preview img { max-width: 100%; max-height: 100%; object-fit: contain; }
.file-button { display: inline-flex; align-items: center; cursor: pointer; }
.file-button input { display: none; }
.invoice-paper-preview { min-height: 600px; align-self: start; box-shadow: 0 8px 30px rgba(16,42,67,.12); }
.invoice-preview-header { display: grid; grid-template-columns: 90px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 13px; border-bottom: 4px solid #1572a1; color: #102a43; }
.invoice-preview-header img { max-width: 86px; max-height: 64px; object-fit: contain; }
.invoice-preview-header div { display: grid; gap: 4px; }
.invoice-preview-header strong { font-size: 16px; }
.invoice-preview-header span { color: var(--muted); font-size: 10px; }
.invoice-preview-header h2 { margin: 0; font-size: 20px; }
.invoice-preview-client { margin: 14px 0; padding: 13px; border-radius: 7px; color: #31516f; background: #edf6fd; font-size: 11px; font-weight: 700; }
.invoice-preview-total { margin-top: 16px; text-align: right; color: #102a43; font-size: 19px; font-weight: 800; }

/* Vista previa de la plantilla oficial configurable. */
.invoice-paper-preview { --invoice-primary:#0B3B35; --invoice-accent:#0E5963; --invoice-text:#102A43; --invoice-background:#FFFFFF; --invoice-primary-contrast:#FFFFFF; --invoice-accent-contrast:#FFFFFF; color:var(--invoice-text); background:var(--invoice-background); border-color:var(--invoice-primary); box-shadow:none; }
.invoice-paper-preview .invoice-preview-header { color:var(--invoice-text); background:var(--invoice-background); border-bottom-color:var(--invoice-primary); }
.invoice-paper-preview .invoice-preview-header span { color:var(--invoice-text); opacity:.72; }
.invoice-paper-preview .invoice-preview-client { color:var(--invoice-text); background:color-mix(in srgb,var(--invoice-accent) 9%,var(--invoice-background)); border:1px solid var(--invoice-primary); }
.invoice-paper-preview table thead th { color:var(--invoice-primary-contrast); background:var(--invoice-primary); border-color:var(--invoice-background); }
.invoice-paper-preview table td { color:var(--invoice-text); border-color:color-mix(in srgb,var(--invoice-primary) 28%,transparent); }
.invoice-paper-preview .invoice-preview-total { color:var(--invoice-primary); }

/* Clientes: directorio, política tarifaria y crédito sin desplazamiento innecesario. */
.client-admin-layout{display:grid;grid-template-columns:minmax(280px,32%) minmax(0,1fr);gap:14px;align-items:start}
.client-directory-card,.client-editor-card{min-height:calc(100vh - 220px)}
.client-directory-tools{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px;margin-top:10px}
.client-inactive-toggle{margin:9px 0 6px}
.client-directory-list{max-height:calc(100vh - 350px);overflow:auto;padding-right:3px}
.client-directory-item{display:grid!important;grid-template-columns:38px minmax(0,1fr) auto!important;align-items:center;gap:9px;text-align:left}
.client-avatar{display:grid;place-items:center;width:36px;height:36px;border-radius:10px;color:#0B132B;background:#DDF7F5;font-size:11px;font-weight:900}
.client-directory-copy{display:grid;gap:2px;min-width:0}.client-directory-copy strong,.client-directory-copy small{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.client-directory-copy small{color:var(--muted);font-size:10px}
.status-muted{color:#607086;background:#EDF1F5}.client-editor-card{padding:0;overflow:hidden}.client-editor-heading{display:grid;grid-template-columns:44px minmax(0,1fr) auto;gap:12px;align-items:center;padding:14px 16px;border-bottom:1px solid var(--border)}
.client-editor-heading h2,.client-editor-heading p{margin:0}.client-editor-heading p{margin-top:2px;color:var(--muted);font-size:11px}.client-editor-icon{display:grid;place-items:center;width:42px;height:42px;border-radius:12px;color:#0B132B;background:#DDF7F5}.client-editor-icon .hero-icon{width:23px;height:23px}
.hero-icon{width:17px;height:17px;fill:currentColor;flex:0 0 auto}.button--icon{display:inline-flex;align-items:center;gap:7px}.button--danger{color:#fff;background:#B4232D;border-color:#B4232D}.button--danger:hover{background:#921C24}
.client-editor-tabs{display:flex;gap:4px;padding:8px 16px;border-bottom:1px solid var(--border);background:#F7F9FB}.client-editor-tabs button{display:flex;align-items:center;gap:6px;padding:8px 12px;border:0;border-radius:8px;color:#52657A;background:transparent;font-weight:800;cursor:pointer}.client-editor-tabs button.is-active{color:#0B132B;background:#fff;box-shadow:0 1px 5px rgba(11,19,43,.12)}
.client-editor-form{display:grid;grid-template-rows:minmax(0,1fr) auto;min-height:calc(100vh - 360px)}.client-tab-panel{padding:14px 16px;overflow:auto}.client-compact-form{gap:10px}.client-compact-form textarea{min-height:70px}.client-editor-actions{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:10px 16px;border-top:1px solid var(--border);background:#fff}.client-editor-actions span{color:var(--muted);font-size:10px}
.client-policy-grid{display:grid;grid-template-columns:minmax(220px,1fr) minmax(180px,.55fr) minmax(220px,.8fr);gap:10px;align-items:end}.client-currency-options{display:flex;align-items:center;gap:12px;min-height:41px;padding:7px 10px;border:1px solid var(--border);border-radius:8px}.client-currency-options>span{margin-right:auto;color:#52657A;font-size:10px;font-weight:800}.client-rate-note{margin:10px 0;padding:8px 10px;border-left:3px solid #5BC0BE;color:#40566D;background:#F0FBFA;font-size:11px}
.client-rate-matrix{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.client-rate-transport{overflow:hidden;border:1px solid var(--border);border-radius:10px}.client-rate-transport>header{display:flex;justify-content:space-between;align-items:center;padding:9px 11px;color:#fff;background:#1C2541}.client-rate-transport>header span{font-size:10px;opacity:.78}.client-rate-table{display:grid;grid-template-columns:minmax(150px,1fr) minmax(92px,.72fr) minmax(92px,.72fr)}.client-rate-head{padding:6px 8px;color:#52657A;background:#F2F6F9;font-size:9px;font-weight:900;text-transform:uppercase}.client-rate-label{display:grid;gap:1px;padding:7px 8px;border-top:1px solid var(--border)}.client-rate-label strong{font-size:11px}.client-rate-label small,.client-rate-cell small{color:var(--muted);font-size:9px}.client-rate-cell{display:grid;gap:2px;padding:5px 6px;border-top:1px solid var(--border);border-left:1px solid var(--border)}.client-rate-cell input{height:31px;padding:5px 7px}.client-credit-toggle{display:flex;gap:14px;margin-bottom:12px;padding:10px 12px;border:1px solid var(--border);border-radius:9px;background:#F7F9FB}
@media(max-width:1150px){.client-admin-layout{grid-template-columns:1fr}.client-directory-card,.client-editor-card{min-height:auto}.client-directory-list{max-height:320px}.client-rate-matrix{grid-template-columns:1fr}.client-editor-form{min-height:0}}
@media(max-width:720px){.client-policy-grid{grid-template-columns:1fr}.client-rate-table{grid-template-columns:minmax(120px,1fr) minmax(82px,.7fr) minmax(82px,.7fr)}.client-editor-heading{grid-template-columns:40px minmax(0,1fr)}.client-editor-heading .button--danger{grid-column:1/-1}.client-editor-tabs{overflow:auto}.client-editor-actions{align-items:stretch;flex-direction:column}}

/* Configuración de facturación: reglas generales y matriz tarifaria visibles sin formulario interminable. */
.settings-billing-layout{display:grid;grid-template-columns:minmax(310px,.72fr) minmax(620px,1.45fr);gap:14px;align-items:start}.settings-compact-form{gap:9px}.settings-compact-form textarea{min-height:62px}.settings-form-actions{display:flex;justify-content:space-between;align-items:center;gap:12px;padding-top:10px;border-top:1px solid var(--border)}.settings-form-actions span{color:var(--muted);font-size:10px}.settings-tariff-workspace{display:grid;grid-template-columns:190px minmax(0,1fr);gap:12px;margin-top:10px}.settings-tariff-list{display:grid;align-content:start;gap:6px}.settings-tariff-list button{display:grid;gap:3px;padding:9px 10px;border:1px solid var(--border);border-radius:9px;text-align:left;color:#172033;background:#fff;cursor:pointer}.settings-tariff-list button span{color:var(--muted);font-size:9px}.settings-tariff-list button.is-active{border-color:#5BC0BE;background:#F0FBFA;box-shadow:inset 3px 0 #1C8F8B}.settings-tariff-editor{display:grid;gap:9px}.settings-tariff-meta{display:grid;grid-template-columns:minmax(170px,1fr) minmax(120px,.65fr) auto auto;gap:8px;align-items:end}.settings-tariff-meta>.checkbox-field{min-height:41px;padding:8px;border:1px solid var(--border);border-radius:8px}.settings-tariff-matrix{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}.settings-tariff-transport{overflow:hidden;border:1px solid var(--border);border-radius:9px}.settings-tariff-transport>header{display:flex;justify-content:space-between;align-items:center;padding:8px 10px;color:#fff;background:#1C2541}.settings-tariff-transport>header span{font-size:9px;opacity:.8}.settings-tariff-grid{display:grid;grid-template-columns:minmax(130px,1fr) minmax(78px,.65fr) minmax(78px,.65fr)}.settings-tariff-head{padding:5px 7px;color:#52657A;background:#F2F6F9;font-size:8px;font-weight:900;text-transform:uppercase}.settings-tariff-label{display:grid;gap:1px;padding:6px 7px;border-top:1px solid var(--border)}.settings-tariff-label strong{font-size:10px}.settings-tariff-label small,.settings-tariff-cell small{color:var(--muted);font-size:8px}.settings-tariff-cell{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:3px;padding:4px 5px;border-top:1px solid var(--border);border-left:1px solid var(--border)}.settings-tariff-cell input{height:29px;padding:4px 6px;font-size:11px}
@media(max-width:1320px){.settings-billing-layout{grid-template-columns:1fr}.settings-tariff-workspace{grid-template-columns:220px minmax(0,1fr)}}
@media(max-width:860px){.settings-tariff-workspace{grid-template-columns:1fr}.settings-tariff-list{grid-template-columns:repeat(2,minmax(0,1fr))}.settings-tariff-matrix{grid-template-columns:1fr}.settings-tariff-meta{grid-template-columns:1fr 1fr}.settings-form-actions{align-items:stretch;flex-direction:column}}

/* Diseño de factura: editor compacto y documento completo en vivo. */
.invoice-design-workspace{grid-template-columns:minmax(420px,.72fr) minmax(680px,1.28fr);align-items:start}.invoice-design-workspace>.card:first-child{max-height:calc(100vh - 190px);overflow:auto}.invoice-paper-preview{position:sticky;top:12px;display:flex;flex-direction:column;gap:10px;min-height:0;padding:14px;overflow:hidden;border:1px solid var(--invoice-primary);border-radius:12px}.invoice-live-badge{align-self:flex-end;padding:4px 8px;border-radius:999px;color:var(--invoice-primary-contrast);background:var(--invoice-primary);font-size:8px;font-weight:900;letter-spacing:.08em}.invoice-paper-preview .invoice-preview-header{display:grid;grid-template-columns:minmax(155px,.85fr) minmax(260px,1.3fr) minmax(150px,.8fr);align-items:center;gap:12px;min-height:86px;padding:8px 10px;border:0;border-bottom:2px solid var(--invoice-primary)}.invoice-preview-brand{display:flex;align-items:center;gap:9px;min-width:0}.invoice-paper-preview .invoice-preview-brand img{display:block;flex:none;max-width:none;max-height:none;object-fit:contain}.invoice-preview-brand>div{display:grid;gap:2px;min-width:0}.invoice-preview-brand strong{font-size:11px;line-height:1.15}.invoice-preview-brand span{font-size:8px}.invoice-preview-heading{text-align:center}.invoice-preview-heading h2{margin:0;color:var(--invoice-primary);font-size:22px;letter-spacing:.03em}.invoice-preview-heading span{font-size:9px}.invoice-preview-number{display:grid;gap:3px;text-align:right}.invoice-preview-number small{font-size:8px}.invoice-preview-number strong{color:var(--invoice-primary);font-size:16px}.invoice-preview-number span{font-size:8px}.invoice-paper-preview[data-logo-position="DERECHA"] .invoice-preview-brand{order:3;justify-content:flex-end;text-align:right}.invoice-paper-preview[data-logo-position="DERECHA"] .invoice-preview-heading{order:2}.invoice-paper-preview[data-logo-position="DERECHA"] .invoice-preview-number{order:1;text-align:left}.invoice-paper-preview[data-logo-position="CENTRO"] .invoice-preview-header{grid-template-columns:1fr}.invoice-paper-preview[data-logo-position="CENTRO"] .invoice-preview-brand{justify-content:center;text-align:center}.invoice-paper-preview[data-logo-position="CENTRO"] .invoice-preview-heading,.invoice-paper-preview[data-logo-position="CENTRO"] .invoice-preview-number{text-align:center}.invoice-preview-parties,.invoice-preview-bottom,.invoice-preview-signatures{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.invoice-preview-parties section,.invoice-preview-bottom section{display:grid;grid-template-columns:44px minmax(0,1fr);gap:9px;min-height:72px;padding:9px;border:1px solid var(--invoice-primary);border-radius:9px}.invoice-preview-parties section>div,.invoice-preview-bottom section>div{display:grid;align-content:center;gap:3px}.invoice-preview-parties small{color:var(--invoice-primary);font-weight:900}.invoice-preview-parties strong{font-size:12px}.invoice-preview-parties span{font-size:8px}.invoice-preview-icon{display:grid!important;place-items:center;width:44px;height:100%;min-height:44px;border-radius:8px;color:var(--invoice-accent-contrast)!important;background:var(--invoice-accent);font-size:16px!important;font-weight:900}.invoice-preview-table{overflow:hidden;border:1px solid var(--invoice-primary);border-radius:8px}.invoice-preview-table table{width:100%;border-collapse:collapse;font-size:7.5px}.invoice-preview-table th{padding:6px 4px;color:var(--invoice-primary-contrast);background:var(--invoice-primary)}.invoice-preview-table td{height:22px;padding:4px;border:1px solid color-mix(in srgb,var(--invoice-primary) 20%,transparent)}.invoice-preview-table tr.is-empty td{height:20px;background:color-mix(in srgb,var(--invoice-primary) 3%,var(--invoice-background))}.invoice-preview-processed{padding:4px 8px;border:1px solid var(--invoice-primary);border-radius:5px;text-align:center;font-size:8px}.invoice-preview-bottom section{min-height:82px}.invoice-preview-bottom strong{color:var(--invoice-primary);font-size:9px}.invoice-preview-bottom p{margin:2px 0;font-size:8px;line-height:1.45}.invoice-preview-summary span{display:flex;justify-content:space-between;gap:10px;font-size:8px}.invoice-preview-summary .invoice-preview-total{margin:2px 0 0;padding-top:3px;border-top:1px solid var(--invoice-primary);font-size:10px}.invoice-preview-signatures>div{display:grid;align-content:space-between;min-height:74px;padding:9px;border:1px solid var(--invoice-primary);border-radius:9px;text-align:center}.invoice-preview-signatures strong{font-size:9px}.invoice-preview-signatures span{display:block;margin:0 30px 5px;border-top:1px solid var(--invoice-primary)}
@media(max-width:1500px){.invoice-design-workspace{grid-template-columns:minmax(390px,.8fr) minmax(600px,1.2fr)}.invoice-paper-preview .invoice-preview-header{grid-template-columns:minmax(130px,.75fr) minmax(210px,1.2fr) minmax(130px,.75fr)}}
@media(max-width:1120px){.invoice-design-workspace{grid-template-columns:1fr}.invoice-design-workspace>.card:first-child{max-height:none}.invoice-paper-preview{position:relative;top:auto}.invoice-preview-parties,.invoice-preview-bottom,.invoice-preview-signatures{grid-template-columns:1fr}}
.color-code-field { display:grid; grid-template-columns:minmax(0,1fr) 48px; gap:8px; align-items:center; }
.color-code-field input[type="color"] { width:48px; height:38px; padding:3px; cursor:pointer; }

.toast-region { position: fixed; top: 18px; right: 18px; display: grid; gap: 9px; z-index: 1000; pointer-events: none; }
.toast { width: min(460px, calc(100vw - 36px)); min-height: 52px; padding: 13px 12px 13px 15px; display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: start; gap: 12px; border: 1px solid rgba(255,255,255,.35); border-radius: 9px; color: #fff; background: #163a5b; box-shadow: 0 18px 48px rgba(5,9,20,.34); animation: toast-in .18s ease-out; pointer-events: auto; }
.toast-message { overflow-wrap: anywhere; font-size: 14px; font-weight: 650; line-height: 1.4; }
.toast-close { width: 28px; height: 28px; padding: 0; border: 1px solid rgba(255,255,255,.45); border-radius: 6px; color: #fff; background: rgba(255,255,255,.10); font-size: 21px; line-height: 1; cursor: pointer; }
.toast-close:hover { background: rgba(255,255,255,.22); }
.toast.is-error { background: #a52f2f; }
.toast.is-success { background: #147447; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-10px); } }
.loading-layer { position: fixed; inset: 0; display: grid; place-content: center; justify-items: center; gap: 12px; color: #fff; background: rgba(9,30,50,.36); z-index: 200; }
.spinner { width: 40px; height: 40px; border: 4px solid rgba(255,255,255,.35); border-top-color: #fff; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 1180px) {
  :root { --sidebar-width: 214px; }
  .metrics-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .metrics-grid--three { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .metrics-grid--four { grid-template-columns: repeat(4, minmax(0,1fr)); }
  .content-grid { grid-template-columns: 1fr; }
  .split-layout { grid-template-columns: 1fr; }
  .work-banner { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 880px) {
  .login-view { grid-template-columns: 1fr; }
  .login-brand { display: none; }
  .login-card { min-height: auto; margin: 40px auto; }
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; transform: translateX(-102%); width: min(300px, 88vw); box-shadow: var(--shadow); transition: transform .2s; }
  .sidebar.is-open { transform: translateX(0); }
  .clock { display: none; }
  .metrics-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .metrics-grid--three { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .metrics-grid--four { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .filter-bar { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .field--4, .field--3, .field--2, .filter-actions { grid-column: span 1; }
  .detail-panel { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .form-grid .field--7, .form-grid .field--6, .form-grid .field--4, .form-grid .field--3, .form-grid .field--2 { grid-column: span 6; }
  .kpi-row { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 560px) {
  .topbar { padding: 9px 12px; }
  .topbar-right { display: none; }
  .main-content { padding: 12px; }
  .screen-heading { display: grid; }
  .metrics-grid, .filter-bar { grid-template-columns: 1fr; }
  .metrics-grid--three { grid-template-columns: 1fr; }
  .metrics-grid--four { grid-template-columns: 1fr; }
  .field--4, .field--3, .field--2, .filter-actions { grid-column: 1; }
  .metric-card { min-height: 88px; }
  .detail-panel { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .field--full, .form-grid .field--7, .form-grid .field--6, .form-grid .field--4, .form-grid .field--3, .form-grid .field--2 { grid-column: 1; }
  .work-banner, .kpi-row { grid-template-columns: 1fr; }
  .dialog-layer { padding: 8px; }
  .dialog { max-height: calc(100vh - 16px); }
  .compact-filter { width: 100%; min-width: 0; }
}

/* AVA 11.2 — identidad aprobada y componentes de paridad funcional. */
:root {
  --navy: #00312a;
  --navy-2: #0b473d;
  --blue: #02a261;
  --blue-2: #007748;
  --green: #02a261;
  --orange: #6cd6a9;
  --purple: #3f8f77;
  --teal: #35b99a;
  --yellow: #a7e8cc;
  --slate: #5d756f;
  --bg: #f2f8f5;
  --surface-2: #f7fbf9;
  --border: #d7e7e1;
  --text: #0a2d27;
  --muted: #5e756f;
  --shadow: 0 18px 45px rgba(0, 49, 42, .12);
}

.eyebrow { color: #0a6a58; }
input, select, textarea { border-color: #c9ddd6; }
input:focus, select:focus, textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(2, 162, 97, .13);
}
.button--primary { background: linear-gradient(135deg, #006c56, #003d34); }
.button--secondary { color: #164d43; background: #e9f4f0; }
.button--sidebar { background: rgba(108, 214, 169, .14); }
.screen-heading h1, .kpi strong { color: var(--navy); }
.callout { border-left-color: var(--green); color: #285f54; background: #ecf8f3; }
.dialog-header { background: linear-gradient(135deg, #00312a, #0b5b4c); }
.dialog-header p { color: #caeee0; }
.chart-row progress { accent-color: var(--green); }
.chart-row progress::-webkit-progress-value { background: linear-gradient(90deg, #02a261, #6cd6a9); }

.login-view {
  grid-template-columns: minmax(370px, 1.12fr) minmax(360px, .88fr);
  background: linear-gradient(135deg, #eff8f4, #e8f4ef);
}
.login-brand {
  justify-content: space-between;
  padding: clamp(30px, 5vw, 76px);
  background:
    radial-gradient(circle at 18% 18%, rgba(108, 214, 169, .13), transparent 34%),
    linear-gradient(150deg, #003d34, #00312a 58%, #061a21);
}
.login-brand-logo {
  width: 100%;
  display: grid;
  justify-items: start;
  align-content: start;
  gap: 14px;
  min-height: 168px;
}
.login-brand-logo img {
  width: clamp(260px, 26vw, 390px);
  max-height: 126px;
  object-fit: contain;
  object-position: left center;
}
.login-brand-logo span {
  color: #fff;
  font-size: clamp(13px, 1.15vw, 17px);
  font-weight: 700;
  letter-spacing: .14em;
}
.login-brand-copy { margin-top: auto; margin-bottom: auto; }
.login-brand .login-brand-copy .eyebrow { margin: 0 0 18px; color: #6cd6a9; }
.login-brand .login-brand-copy h1 {
  max-width: 560px;
  margin: 0 0 16px;
  color: #fff;
  font-size: clamp(32px, 4.2vw, 56px);
  line-height: 1.03;
}
.login-brand .login-brand-copy > p:not(.eyebrow) {
  max-width: 560px;
  margin: 0;
  color: #e3f4ed;
  font-size: 16px;
  line-height: 1.65;
}
.login-brand .local-badge { margin-top: 0; }
.login-access-panel {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 36px;
}
.login-card {
  width: min(430px, 100%);
  gap: 13px;
  padding: clamp(30px, 4vw, 46px);
  border-color: rgba(0, 49, 42, .08);
  border-radius: 24px;
}
.login-card label { margin-top: 4px; color: #315f56; }
.login-input {
  height: 48px;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  align-items: center;
  padding: 0 10px;
  border: 1px solid #c9ddd6;
  border-radius: 10px;
  background: #fff;
}
.login-input:focus-within {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(2, 162, 97, .13);
}
.login-input > svg, .password-toggle svg, .login-submit svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.login-input > svg { color: #6e9289; }
.login-input input {
  height: 44px;
  padding: 0 8px;
  border: 0;
  box-shadow: none;
  background: transparent;
}
.login-input input:focus { border: 0; box-shadow: none; }
.password-toggle {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 7px;
  color: #6e9289;
  background: transparent;
}
.password-toggle:hover { background: #edf7f3; }
.login-submit { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 6px; }

.sidebar { background: linear-gradient(180deg, #003d34, #00312a 68%, #061a21); }
.sidebar-brand {
  min-height: 112px;
  justify-content: flex-start;
  padding: 16px 18px;
}
.sidebar-brand-logo {
  width: min(178px, 88%);
  max-height: 76px;
  object-fit: contain;
  object-position: left center;
}
.sidebar-brand-copy span, .sidebar-user-copy span { color: #acd8c8; }
.nav-button:hover { background: rgba(108, 214, 169, .08); }
.nav-button.is-active { border-left-color: #6cd6a9; background: rgba(108, 214, 169, .17); }
.module-icon--dashboard,
.module-icon--digitacion,
.module-icon--buscador,
.module-icon--facturacion,
.module-icon--consolidar,
.module-icon--clientes,
.module-icon--reportes,
.module-icon--auditoria,
.module-icon--configuracion {
  color: #00312a;
  background: #a7e8cc;
  box-shadow: inset 0 0 0 1px rgba(0, 49, 42, .08);
}
.nav-button.is-active .module-icon { background: #d7f6e9; }
.module-icon svg { stroke-width: 1.75; }
.avatar { background: var(--green); }
.icon-button:hover { background: #e9f4f0; }

.work-create-grid { align-items: end; }
.work-create-grid .button { min-height: 42px; }
.work-create-footer { padding-top: 2px; }
.digitization-workspace {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(310px, .68fr) minmax(620px, 1.55fr);
  gap: 12px;
  align-items: stretch;
}
.digitization-entry-card,
.digitization-records-card {
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.package-form--compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 10px;
}
.package-form--compact .package-field { grid-column: span 1; }
.package-form--compact .field { gap: 4px; }
.package-form--compact input,
.package-form--compact select { height: 38px; }
.package-form-actions {
  align-items: flex-end;
  margin-top: 4px;
}
.package-form-actions .toolbar-note {
  max-width: 310px;
  line-height: 1.45;
}
.digitization-records-header {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 11px;
}
.digitization-records-title {
  min-width: 180px;
  flex: 1 1 auto;
  margin-bottom: 0;
}
.digitization-records-header .button {
  min-height: 36px;
  padding: 0 13px;
  font-size: 11px;
}
.digitization-records-table {
  min-height: 340px;
  max-height: min(62vh, 660px);
  flex: 1 1 auto;
}
.client-search-field { position: relative; z-index: 7; }
.client-search-field > input[type="search"].has-valid-selection {
  border-color: var(--blue);
  background: linear-gradient(90deg, var(--surface) 0, color-mix(in srgb, var(--blue) 5%, var(--surface)) 100%);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 10%, transparent);
}
.client-search-results {
  position: absolute;
  top: calc(100% + 5px);
  right: 0;
  left: 0;
  max-height: 270px;
  overflow: auto;
  padding: 5px;
  border: 1px solid #bcd8cf;
  border-radius: 9px;
  background: #fff;
  box-shadow: 0 14px 34px rgba(0, 49, 42, .16);
  z-index: 80;
}
.client-search-option,
.client-search-empty {
  width: 100%;
  min-height: 40px;
  display: grid;
  gap: 2px;
  padding: 8px 10px;
  border: 0;
  border-radius: 7px;
  color: #164d43;
  text-align: left;
  background: transparent;
}
.client-search-option:hover,
.client-search-option:focus { background: #e8f7f1; outline: none; }
.client-search-option strong { font-size: 12px; }
.client-search-option span,
.client-search-empty { color: var(--muted); font-size: 10px; }
.agency-owner-client-picker { z-index: 18; }
.agency-owner-client-picker > input[type="search"] { padding-right: 42px; }
.agency-owner-client-picker > input[type="search"].has-valid-selection {
  border-color: var(--blue);
  background: linear-gradient(90deg, var(--surface) 0, color-mix(in srgb, var(--blue) 5%, var(--surface)) 100%);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 10%, transparent);
}
.agency-owner-client-results {
  max-height: 310px;
  padding: 7px;
  border-color: var(--border);
  box-shadow: var(--shadow);
}
.agency-owner-client-option {
  min-height: 54px;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 9px 11px;
  border-bottom: 1px solid var(--border);
}
.agency-owner-client-option:last-child { border-bottom: 0; }
.agency-owner-client-option:hover,
.agency-owner-client-option:focus,
.agency-owner-client-option.is-active { background: color-mix(in srgb, var(--blue) 8%, var(--surface)); }
.agency-owner-client-main { min-width: 0; display: grid; gap: 3px; }
.agency-owner-client-main strong { overflow: hidden; color: var(--navy); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.agency-owner-client-main small { overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.agency-owner-client-action { color: var(--blue)!important; font-size: 10px!important; font-weight: 800; text-transform: uppercase; }
.saved-work-list { display: grid; gap: 8px; }
.saved-work-row {
  display: grid;
  grid-template-columns: minmax(170px, 1fr) repeat(3, minmax(90px, .4fr)) auto;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface-2);
}
.saved-work-row div { min-width: 0; display: grid; gap: 3px; }
.saved-work-row span { color: var(--muted); font-size: 9px; font-weight: 800; text-transform: uppercase; }
.saved-work-row strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.invoice-document-preview {
  height: min(74vh, 900px);
  min-height: 560px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #eef4f1;
}
.invoice-document-preview iframe {
  width: 100%;
  height: 100%;
  display: block;
  border: 0;
  background: #fff;
}
.document-preview-loading { display: grid; place-items: center; width: 100%; min-height: 430px; padding: 28px; color: var(--text-muted); font-size: 15px; font-weight: 650; text-align: center; }
.document-preview-loading.is-error { color: var(--danger); }
.document-preview-pages { display: grid; justify-items: center; gap: 18px; width: 100%; min-height: 430px; padding: 12px; overflow: auto; background: #dfe3e8; }
.document-preview-page { display: block; max-width: 100%; height: auto; background: #fff; box-shadow: 0 4px 18px rgba(11, 19, 43, .18); }
.document-preview-image { display: block; max-width: 100%; max-height: 72vh; margin: auto; object-fit: contain; background: #fff; }

.kpi-row--six { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.correction-banner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  border-left: 5px solid var(--green);
  background: linear-gradient(120deg, #ecf8f3, #fff);
}
.correction-banner h2 { margin: 0 0 6px; color: var(--navy); }
.correction-banner p:last-child { margin: 0; color: var(--muted); }
.order-row {
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2);
}
.allocation-input { width: 130px; }

@media (max-width: 1180px) {
  .digitization-workspace { grid-template-columns: 1fr; }
  .digitization-records-table { min-height: 300px; }
  .kpi-row--six { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .saved-work-row { grid-template-columns: minmax(170px, 1fr) repeat(2, minmax(90px, .45fr)) auto; }
  .saved-work-row .saved-work-transport { display: none; }
}
@media (max-width: 880px) {
  .login-access-panel { min-height: 100vh; padding: 24px; }
  .kpi-row--six { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .app-shell.is-sidebar-collapsed { grid-template-columns: 1fr; }
  .app-shell.is-sidebar-collapsed .sidebar { opacity: 1; }
  .form-grid .field--7, .form-grid .field--5 { grid-column: span 6; }
  .saved-work-row { grid-template-columns: minmax(150px, 1fr) minmax(80px, .4fr) auto; }
  .saved-work-row .saved-work-packages { display: none; }
}
@media (max-width: 560px) {
  .package-form--compact { grid-template-columns: 1fr; }
  .package-form--compact .package-field { grid-column: 1; }
  .digitization-records-header { align-items: stretch; }
  .digitization-records-header .toolbar-group { width: 100%; }
  .digitization-records-header .button { flex: 1 1 auto; }
  .kpi-row--six { grid-template-columns: 1fr; }
  .correction-banner { display: grid; }
  .form-grid .field--7, .form-grid .field--5 { grid-column: 1; }
  .saved-work-row { grid-template-columns: 1fr; }
  .saved-work-row .saved-work-transport,
  .saved-work-row .saved-work-packages { display: grid; }
  .invoice-document-preview { min-height: 430px; height: 68vh; }
}

/* Facturación 11.3 — espacios compactos, acciones contextuales y respuesta adaptable. */
#billing-tabs {
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: thin;
}
#billing-tabs .tab-button { flex: 0 0 auto; }
.button--danger-outline {
  color: #a22f34;
  border: 1px solid #e7b9bb;
  background: #fff4f4;
}
.button--danger-outline:hover { background: #fde8e8; }
.status-badge--neutral { color: #315f56; background: #e9f4f0; }

.billing-client-card {
  display: grid;
  grid-template-columns: minmax(420px, .72fr) minmax(240px, 1fr);
  align-items: end;
  gap: 10px 22px;
  padding: 11px 14px;
}
.billing-client-bar {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  align-items: end;
  gap: 9px;
}
.billing-client-picker { min-width: 0; }
.billing-client-card > .toolbar-note {
  align-self: center;
  padding-bottom: 3px;
}
.billing-new-layout {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(340px, .82fr);
  gap: 12px;
  align-items: start;
}
.billing-new-main { min-width: 0; gap: 10px; }
.billing-kpi-row {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-bottom: 0;
}
.billing-kpi-row .kpi,
.billing-credit-metrics .kpi,
.billing-cash-kpis .kpi { padding: 9px 11px; }
.billing-kpi-row .kpi strong,
.billing-credit-metrics .kpi strong,
.billing-cash-kpis .kpi strong { font-size: 16px; }
.billing-pending-card { padding: 11px; }
.billing-pending-card .subheading { margin-bottom: 3px; }
.billing-pending-table {
  min-height: 318px;
  max-height: calc(100vh - 420px);
}
.billing-summary-card {
  position: sticky;
  top: 78px;
  min-width: 0;
  padding: 12px;
}
.billing-summary-form { gap: 8px 9px; }
.billing-summary-form .field { gap: 4px; }
.billing-summary-form input,
.billing-summary-form select { height: 37px; }
.billing-summary-form textarea { min-height: 54px; max-height: 90px; }
.billing-credit-row,
.billing-primary-actions,
.billing-cash-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
}
.billing-primary-actions { justify-content: flex-end; }

.billing-filter-bar {
  display: grid;
  grid-template-columns: minmax(190px, 1.2fr) minmax(125px, .55fr) minmax(210px, 1fr) repeat(2, minmax(145px, .65fr)) auto;
  align-items: end;
  gap: 9px;
  padding: 11px 13px;
}
.billing-filter-bar--drafts {
  grid-template-columns: minmax(210px, 1.2fr) minmax(230px, 1fr) repeat(2, minmax(145px, .65fr)) auto;
}
.billing-filter-bar .field,
.billing-advanced-grid .field,
.billing-receipts-filter .field { gap: 4px; }
.billing-filter-bar input,
.billing-filter-bar select,
.billing-advanced-grid input,
.billing-advanced-grid select,
.billing-receipts-filter input,
.billing-receipts-filter select { height: 38px; }
.billing-filter-bar .filter-actions,
.billing-receipts-filter .filter-actions {
  display: flex;
  align-items: flex-end;
}
.billing-filter-bar .filter-actions .button,
.billing-receipts-filter .filter-actions .button { white-space: nowrap; }
.billing-advanced-filters {
  grid-column: 1 / -1;
  border-top: 1px solid var(--border);
}
.billing-advanced-filters summary {
  width: fit-content;
  padding: 8px 2px 2px;
  color: #315f56;
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
}
.billing-advanced-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 8px;
  padding-top: 8px;
}
.billing-filter-footer {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.billing-quick-filters { display: flex; flex-wrap: wrap; gap: 7px; }
.billing-list-card {
  min-width: 0;
  display: grid;
  gap: 10px;
  padding: 12px;
}
.billing-list-card .card-header { margin-bottom: 0; }
.billing-invoice-card-header {
  display: grid;
  grid-template-columns: minmax(155px, auto) minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px 14px;
}
.billing-invoice-title { min-width: 0; }
.billing-invoice-title h2 { margin: 0; }
.billing-invoice-header-actions {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}
.billing-invoice-header-actions .billing-selection-summary {
  justify-content: flex-end;
  text-align: right;
}
.billing-invoice-header-actions .toolbar-group { flex: 0 0 auto; }
.billing-invoice-header-actions .button { min-height: 36px; padding: 7px 12px; }
.billing-document-table {
  min-height: 330px;
  max-height: calc(100vh - 340px);
}
.billing-document-table th,
.billing-document-table td,
.billing-receipts-table th,
.billing-receipts-table td,
.billing-credit-table th,
.billing-credit-table td,
.billing-credit-movements th,
.billing-credit-movements td { padding: 7px 8px; }
.billing-selection-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 54px;
  padding: 8px 10px;
  border: 1px solid #c8e2d8;
  border-radius: 8px;
  background: #f0faf6;
}
.billing-selection-bar--stacked { align-items: flex-end; }
.billing-selection-summary {
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 14px;
}
.billing-selection-summary strong { color: var(--navy); }
.billing-selection-summary span { color: var(--muted); font-size: 11px; }

.billing-payment-layout {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(330px, .45fr);
  gap: 12px;
  align-items: start;
}
.billing-payment-allocation,
.billing-receipt-form-card { min-width: 0; padding: 12px; }
.billing-payment-topline {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(100px, .55fr) minmax(120px, .7fr) minmax(280px, 1.25fr);
  gap: 12px;
}
.billing-payment-topline > .field { grid-column: auto; }
.billing-allocation-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 9px;
}
.billing-file-drop {
  padding: 9px;
  border: 1px dashed #afd4c6;
  border-radius: 8px;
  background: #f4fbf8;
}
.billing-receipt-form-card .form-grid { gap: 8px; }
.billing-receipt-form-card textarea { min-height: 58px; }
.billing-receipt-credit-panel {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(90px, .72fr) minmax(150px, 1.28fr);
  grid-template-areas: "summary input" "help help";
  align-items: end;
  gap: 6px 10px;
}
.billing-receipt-credit-summary { grid-area: summary; display: grid; align-content: center; gap: 3px; min-width: 0; }
.billing-receipt-credit-summary span,
.billing-receipt-credit-input > span { color: #35645e; font-size: 9px; font-weight: 800; text-transform: uppercase; }
.billing-receipt-credit-summary strong { overflow: hidden; color: #0f675b; font-size: 16px; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; }
.billing-receipt-credit-input { grid-area: input; min-width: 0; }
.billing-receipt-credit-control { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 6px; min-width: 0; }
.billing-receipt-credit-control .button { width: fit-content; white-space: nowrap; }
.billing-receipt-credit-panel > small { grid-area: help; }
.billing-receipts-filter {
  display: grid;
  grid-template-columns: minmax(220px, 1.2fr) repeat(2, minmax(130px, .55fr)) repeat(2, minmax(145px, .65fr)) auto;
  align-items: end;
  gap: 8px;
}
.billing-receipts-table { min-height: 245px; max-height: 410px; }
.receipt-document-preview { background: #edf7f3; }

.billing-credit-metrics {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 0;
}
.billing-credits-layout {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(330px, .72fr) minmax(0, 1.28fr);
  gap: 12px;
}
.billing-credit-table,
.billing-credit-movements { min-height: 330px; max-height: calc(100vh - 390px); }
.amount-positive { color: #087347; font-weight: 800; }
.amount-negative { color: #a22f34; font-weight: 800; }

.billing-cash-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
}
.billing-cash-status-copy {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 18px;
  color: var(--muted);
  font-size: 11px;
}
.billing-cash-status-copy strong {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--navy);
  font-size: 13px;
}
.billing-refresh-button {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid #c8e2d8;
  border-radius: 50%;
  color: var(--navy);
  background: #eff9f5;
  font-size: 19px;
}
.billing-cash-kpis { margin-bottom: 0; }
.billing-cash-card { padding: 12px; }
.billing-cash-open-grid { align-items: end; gap: 9px; }
.billing-cash-action { align-self: end; }
.billing-cash-close-grid {
  display: grid;
  grid-template-columns: minmax(240px, .72fr) minmax(340px, 1.28fr);
  gap: 12px;
}
.billing-cash-readonly {
  display: grid;
  grid-template-columns: 1fr auto;
  align-content: start;
  gap: 12px;
  padding: 13px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2);
}
.billing-cash-readonly span { color: var(--muted); font-size: 10px; font-weight: 800; }
.billing-cash-readonly strong { color: var(--navy); }
.billing-reconciliation {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 10px 0;
}
.billing-reconciliation > div {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2);
}
.billing-reconciliation span { color: var(--muted); font-size: 9px; font-weight: 800; text-transform: uppercase; }
.billing-reconciliation .is-balanced { border-color: #9fd8bf; background: #eef9f4; }
.billing-reconciliation .is-different { border-color: #e8b6b8; background: #fff3f3; }

@media (max-width: 1280px) {
  .billing-new-layout { grid-template-columns: minmax(0, 1.4fr) minmax(330px, .8fr); }
  .billing-filter-bar,
  .billing-filter-bar--drafts { grid-template-columns: repeat(4, minmax(150px, 1fr)); }
  .billing-filter-bar .filter-actions { grid-column: span 1; }
  .billing-payment-layout { grid-template-columns: minmax(0, 1.18fr) minmax(310px, .82fr); }
  .billing-receipts-filter { grid-template-columns: repeat(3, minmax(150px, 1fr)); }
}
@media (max-width: 1040px) {
  .billing-client-card { grid-template-columns: 1fr; }
  .billing-new-layout,
  .billing-payment-layout,
  .billing-credits-layout,
  .billing-cash-close-grid { grid-template-columns: 1fr; }
  .billing-summary-card { position: static; }
  .billing-pending-table,
  .billing-document-table,
  .billing-credit-table,
  .billing-credit-movements { max-height: 430px; }
  .billing-kpi-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .billing-invoice-card-header { grid-template-columns: minmax(155px, 1fr) auto; }
  .billing-invoice-header-actions { grid-column: 1 / -1; justify-content: space-between; }
  .billing-invoice-header-actions .billing-selection-summary { justify-content: flex-start; text-align: left; }
}
@media (max-width: 760px) {
  #billing-tabs { margin-right: -4px; }
  .billing-client-bar,
  .billing-payment-topline,
  .billing-filter-bar,
  .billing-filter-bar--drafts,
  .billing-receipts-filter,
  .billing-advanced-grid { grid-template-columns: 1fr 1fr; }
  .billing-client-bar .client-search-field { grid-column: 1 / -1; }
  .billing-kpi-row,
  .billing-credit-metrics,
  .billing-cash-kpis,
  .billing-reconciliation { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .billing-selection-bar,
  .billing-filter-footer,
  .billing-cash-footer { align-items: stretch; flex-direction: column; }
  .billing-selection-bar .toolbar-group,
  .billing-primary-actions { width: 100%; }
  .billing-selection-bar .button,
  .billing-primary-actions .button { flex: 1 1 auto; }
  .billing-invoice-card-header { grid-template-columns: 1fr; align-items: stretch; }
  .billing-invoice-header-actions { grid-column: auto; align-items: stretch; flex-direction: column; }
  .billing-invoice-header-actions .toolbar-group { width: 100%; }
  .billing-invoice-header-actions .button { flex: 1 1 auto; }
  .billing-invoice-card-header .view-expand-button { width: 100%; }
}
@media (max-width: 520px) {
  .billing-client-bar,
  .billing-payment-topline,
  .billing-filter-bar,
  .billing-filter-bar--drafts,
  .billing-receipts-filter,
  .billing-advanced-grid,
  .billing-kpi-row,
  .billing-credit-metrics,
  .billing-cash-kpis,
  .billing-reconciliation { grid-template-columns: 1fr; }
  .billing-credit-row,
  .billing-primary-actions,
  .billing-allocation-bar { align-items: stretch; flex-direction: column; }
  .billing-primary-actions .button { width: 100%; }
}

/* Reporte de paquetes y Dashboard operativo v12.0 */
.incident-metrics { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.incident-filter-card { margin-bottom: 12px; }
.incident-filter-grid { align-items: end; }
.incident-filter-actions { justify-content: flex-end; align-self: end; }
.incident-table { min-height: 320px; max-height: calc(100vh - 430px); }
.status-pill { display: inline-flex; align-items: center; padding: 4px 8px; border-radius: 999px; font-size: 10px; font-weight: 800; }
.status-pill--danger { color: #8d2529; background: #ffebec; }
.status-pill--warning { color: #6b4b00; background: #fff1c8; }
.package-picker { display: grid; gap: 10px; }
.inline-search { display: flex; gap: 8px; }
.inline-search input { flex: 1 1 auto; }
.package-picker-list { display: grid; gap: 6px; max-height: 210px; overflow: auto; }
.package-picker-row { display: grid; gap: 3px; width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; color: var(--navy); background: var(--surface); text-align: left; }
.package-picker-row span { color: var(--muted); font-size: 11px; }
.package-picker-row:hover, .package-picker-row.is-selected { border-color: var(--green); background: #eff9f5; }
.package-picker-row.is-unavailable,
.package-picker-row.is-unavailable:hover {
  cursor: not-allowed;
  border-color: #e5d9d3;
  color: #6f6661;
  background: #faf7f5;
  opacity: 1;
}
.package-picker-row.is-unavailable small { color: #9a3e32; font-size: 11px; font-weight: 750; line-height: 1.35; }
.return-picker-message { margin: -2px 0 0; color: #315d54; font-size: 12px; font-weight: 750; line-height: 1.4; }
.selected-package { display: grid; gap: 4px; padding: 11px; border-left: 4px solid var(--green); background: var(--surface-2); }
.selected-package span { color: var(--muted); font-size: 11px; }
.incident-detail-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(310px, .75fr); gap: 12px; }
.incident-detail-main, .incident-detail-side { display: grid; align-content: start; gap: 12px; }
.detail-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.detail-kpis > div { display: grid; gap: 4px; padding: 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); }
.detail-kpis span { color: var(--muted); font-size: 9px; font-weight: 800; text-transform: uppercase; }
.incident-timeline { display: grid; gap: 13px; margin-top: 12px; }
.timeline-item { display: grid; grid-template-columns: 16px 1fr; gap: 8px; }
.timeline-dot { width: 10px; height: 10px; margin-top: 4px; border: 2px solid #b7ead5; border-radius: 50%; background: var(--green); }
.timeline-item p { margin: 3px 0; color: var(--muted); }
.timeline-item small { color: var(--muted); }
.evidence-list { display: grid; gap: 5px; margin: 9px 0; }
.evidence-link { padding: 7px; border: 1px solid var(--border); border-radius: 6px; color: var(--green-dark); background: #f4fbf8; text-align: left; }
.dashboard-status-strip { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.dashboard-status-item { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; color: var(--navy); background: var(--surface); }
.dashboard-status-item:hover { border-color: var(--green); background: #eff9f5; }
.dashboard-alert-link { width: 100%; border: 0; text-align: left; }
@media (max-width: 1120px) {
  .incident-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .incident-detail-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .incident-metrics, .dashboard-status-strip, .detail-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Gestión profesional de casos v12.0 */
.ui-icon {
  width: 18px;
  height: 18px;
  display: inline-block;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: middle;
}
.metric-grid--five { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.metric-icon--blue { color: #1769aa; background: #e7f1fb; }
.metric-icon--green { color: #08744d; background: #e4f5ed; }
.metric-icon--amber { color: #9a6800; background: #fff2d2; }
.metric-icon--violet { color: #7845aa; background: #f1e8fa; }
.metric-icon--red { color: #ae3e3e; background: #fbe8e8; }
.incident-client-picker { position: relative; z-index: 20; }
.incident-client-input { position: relative; }
.incident-client-input input { padding-right: 42px; }
.incident-client-search-icon {
  position: absolute;
  top: 0;
  right: 0;
  width: 42px;
  height: 100%;
  display: grid;
  place-items: center;
  color: var(--green-dark);
  border-left: 1px solid var(--border);
  pointer-events: none;
}
.incident-case-shell {
  margin: -17px;
  color: #143c36;
  background: #f7fbf9;
}
.incident-summary-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(105px, .7fr)) minmax(190px, 1.1fr);
  align-items: center;
  gap: 0;
  padding: 17px 24px;
  border-bottom: 1px solid #d6e5df;
  background: #fff;
}
.incident-summary-strip > div {
  min-width: 0;
  display: grid;
  gap: 5px;
  padding: 2px 28px;
  border-right: 1px solid #cbdad5;
}
.incident-summary-strip > div:first-child { padding-left: 14px; }
.incident-summary-strip span { color: #526d68; font-size: 11px; }
.incident-summary-strip strong {
  overflow: hidden;
  color: #16483f;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.incident-link-button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 0;
  color: #087553;
  background: transparent;
  font-weight: 800;
}
.incident-case-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(380px, .95fr);
  gap: 14px;
  padding: 14px 18px 18px;
}
.incident-case-main,
.incident-management-panel {
  min-width: 0;
  border: 1px solid #cfdfd9;
  border-radius: 11px;
  background: #fff;
}
.incident-stage-card {
  padding: 18px 22px 14px;
  border-bottom: 1px solid #d8e5e0;
}
.incident-stage-card > p {
  margin: 15px 0 0;
  color: #526d68;
  text-align: center;
  line-height: 1.5;
}
.incident-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  position: relative;
}
.incident-steps::before {
  content: "";
  position: absolute;
  top: 18px;
  right: 16%;
  left: 16%;
  height: 3px;
  background: #d1d7d5;
}
.incident-step {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  gap: 8px;
  text-align: center;
}
.incident-step b {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 3px solid #d5dcda;
  border-radius: 50%;
  color: #52605d;
  background: #fff;
  font-size: 16px;
}
.incident-step > span { display: none; }
.incident-step strong { color: #183b36; font-size: 12px; }
.incident-step.is-done b {
  border-color: #078559;
  color: #fff;
  background: #078559;
}
.incident-step.is-current b { box-shadow: 0 0 0 5px rgba(7, 133, 89, .14); }
.incident-step.is-active b { border-color: #078559; color: #086547; }
.incident-evidence-section,
.incident-activity { padding: 14px; }
.incident-evidence-section { border-bottom: 1px solid #d8e5e0; }
.incident-evidence-section h3,
.incident-activity h3,
.incident-management-panel h3 { margin: 0 0 12px; font-size: 15px; }
.incident-evidence-gallery {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
}
.incident-evidence-card {
  min-width: 0;
  overflow: hidden;
  padding: 0;
  border: 1px solid #cfddd8;
  border-radius: 9px;
  color: #163d37;
  text-align: left;
  background: #fff;
}
.incident-evidence-card:nth-child(n+5) { display: none; }
.incident-evidence-gallery.show-all .incident-evidence-card { display: block; }
.incident-evidence-preview {
  height: 132px;
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
  background: #eef4f1;
}
.incident-evidence-preview img { width: 100%; height: 100%; object-fit: cover; }
.incident-pdf-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 3px 6px;
  border-radius: 4px;
  color: #fff;
  background: #df2020;
  font-size: 10px;
  font-weight: 900;
}
.incident-pdf-icon { color: #d52424; font-size: 20px; }
.incident-evidence-meta { display: grid; grid-template-columns: 17px minmax(0, 1fr); gap: 3px 5px; padding: 8px; }
.incident-evidence-meta .ui-icon { width: 15px; height: 15px; color: #087553; }
.incident-evidence-meta strong {
  overflow: hidden;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.incident-evidence-meta span { grid-column: 2; color: #5d746f; font-size: 9px; }
.incident-evidence-actions {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
}
.incident-evidence-actions .button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; }
.incident-activity-item {
  display: grid;
  grid-template-columns: 12px 38px minmax(0, 1fr) 145px;
  gap: 9px;
  position: relative;
  padding: 6px 0 12px;
}
.incident-activity-item::before {
  content: "";
  position: absolute;
  top: 18px;
  bottom: -8px;
  left: 5px;
  width: 2px;
  background: #b9dfd1;
}
.incident-activity-item:last-child::before { display: none; }
.incident-activity-dot {
  width: 11px;
  height: 11px;
  margin-top: 11px;
  border: 2px solid #d8f2e8;
  border-radius: 50%;
  background: #049668;
  z-index: 1;
}
.incident-activity-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #087553;
  background: #e4f4ee;
}
.incident-activity-item p { margin: 3px 0; color: #58706a; font-size: 10px; }
.incident-activity-item small { color: #58706a; text-align: right; font-size: 9px; line-height: 1.45; }
.incident-management-panel { align-self: start; padding: 16px; }
.incident-management-panel .incident-client-picker { margin-bottom: 9px; }
.incident-management-row { gap: 9px; }
.incident-created-record {
  display: grid;
  gap: 4px;
  margin: 5px 0 10px;
  padding: 10px;
  border: 1px solid #a7d7c6;
  border-radius: 8px;
  color: #086247;
  background: #ebf8f3;
}
.incident-created-record span { font-size: 10px; }
.incident-process-note {
  margin-top: 10px;
  padding: 11px 12px;
  border-radius: 8px;
  color: #175b4d;
  text-align: center;
  background: linear-gradient(90deg, #e5f6ef, #f4fbf8);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.5;
}
.incident-management-panel .button--wide {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 9px;
}

@media (max-width: 1120px) {
  .metric-grid--five { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .incident-case-grid { grid-template-columns: 1fr; }
  .incident-summary-strip { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .incident-link-button { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .metric-grid--five { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .incident-summary-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .incident-summary-strip > div { padding: 8px 12px; }
  .incident-evidence-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .incident-activity-item { grid-template-columns: 12px 34px minmax(0, 1fr); }
  .incident-activity-item small { grid-column: 3; text-align: left; }
}

/* Reportes interactivos compactos v12.0 */
.incident-metric-strip {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 8px;
}
.incident-metric-card {
  min-width: 0;
  min-height: 94px;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid #cbded8;
  border-radius: 12px;
  color: #123f37;
  text-align: left;
  background: #fff;
  box-shadow: 0 4px 14px rgba(0, 49, 42, .035);
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}
.incident-metric-card:hover,
.incident-metric-card:focus-visible {
  border-color: #188c69;
  box-shadow: 0 7px 20px rgba(0, 73, 61, .1);
  outline: none;
  transform: translateY(-1px);
}
.incident-metric-card.is-selected {
  border-color: #006b52;
  background: linear-gradient(135deg, #f5fcf9, #fff);
  box-shadow: inset 0 0 0 1px #006b52, 0 6px 18px rgba(0, 73, 61, .09);
}
.incident-metric-icon {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border-radius: 50%;
}
.incident-metric-icon .ui-icon { width: 31px; height: 31px; stroke-width: 1.65; }
.incident-metric-card--active .incident-metric-icon { color: #087354; background: #e3f5ed; }
.incident-metric-card--damaged .incident-metric-icon { color: #dc4e32; background: #fff0eb; }
.incident-metric-card--ownerless .incident-metric-icon { color: #c78200; background: #fff4d9; }
.incident-metric-card--overdue .incident-metric-icon { color: #8244b2; background: #f2e9fb; }
.incident-metric-card--closed .incident-metric-icon { color: #2d8734; background: #eaf6e8; }
.incident-metric-copy { min-width: 0; display: grid; gap: 6px; }
.incident-metric-copy span {
  overflow: visible;
  color: #405d58;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
  text-overflow: clip;
  white-space: normal;
}
.incident-metric-copy strong { color: #0a4439; font-size: 23px; line-height: 1; }
.incident-metric-check { visibility: hidden; color: #086b50; }
.incident-metric-check .ui-icon { width: 21px; height: 21px; }
.incident-metric-card.is-selected .incident-metric-check { visibility: visible; }
.incident-active-filter {
  min-height: 28px;
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 8px;
  color: #48635e;
  font-size: 11px;
}
.incident-active-filter strong { color: #164c42; }
.incident-active-filter button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 5px;
  border: 0;
  color: #087357;
  background: transparent;
  font-size: 11px;
  font-weight: 800;
}
.incident-active-filter button .ui-icon { width: 13px; height: 13px; }
.incident-filters { margin-bottom: 12px; padding: 13px 15px; }
.incident-filter-grid {
  display: grid;
  grid-template-columns: minmax(220px, 1.35fr) minmax(145px, .72fr) minmax(160px, .8fr)
    minmax(170px, .9fr) minmax(270px, 1.25fr) auto;
  align-items: end;
  gap: 10px;
}
.incident-filter-grid .field { min-width: 0; margin: 0; }
.incident-search-control { position: relative; }
.incident-search-control .ui-icon {
  position: absolute;
  top: 50%;
  left: 12px;
  width: 17px;
  height: 17px;
  color: #56716b;
  transform: translateY(-50%);
}
.incident-search-control input { padding-left: 39px; }
.incident-date-range > div {
  display: grid;
  grid-template-columns: minmax(112px, 1fr) 14px minmax(112px, 1fr);
  align-items: center;
  gap: 4px;
}
.incident-date-range i { color: #82948f; text-align: center; font-style: normal; }
.incident-filter-actions { min-width: 205px; margin: 0; }
.incident-filter-actions .button { min-width: 96px; }
.incident-table { min-height: 390px; max-height: calc(100vh - 395px); }
.incident-client-picker { z-index: 90; }
.incident-client-search-icon {
  padding: 0;
  border: 0;
  border-left: 1px solid var(--border);
  cursor: pointer;
}
.incident-client-search-icon:hover { color: #005f48; background: #eaf7f2; }
.incident-client-picker .client-search-results { top: calc(100% + 3px); }
.client-search-option.is-highlighted { background: #e1f3ec; outline: 1px solid #73bda5; }
.client-search-option:disabled { cursor: not-allowed; opacity: .55; }
.incident-owner-fields { display: grid; gap: 10px; margin-bottom: 10px; }
.incident-final-client small { margin-top: 4px; color: #56716b; font-size: 10px; }
.incident-management-row { align-items: start; }
.incident-notes-field textarea {
  min-height: 118px;
  max-height: 310px;
  resize: vertical;
  line-height: 1.45;
}
.incident-steps::before { top: 20px; }
.incident-step {
  border: 0;
  color: inherit;
  background: transparent;
  cursor: pointer;
}
.incident-step b { transition: color .15s ease, border-color .15s ease, background .15s ease, transform .15s ease; }
.incident-step small { color: #657b76; font-size: 9px; }
.incident-step.is-next:not(:disabled):hover b,
.incident-step.is-next:not(:disabled):focus-visible b {
  border-color: #078559;
  color: #087553;
  background: #e8f7f1;
  transform: scale(1.06);
}
.incident-step:disabled { cursor: default; opacity: 1; }
.incident-step:not(.is-done):not(.is-next):disabled { opacity: .58; }
.incident-step[aria-current="step"] strong { color: #006b4f; }

@media (max-width: 1280px) {
  .incident-metric-strip { gap: 8px; }
  .incident-metric-card { grid-template-columns: 46px minmax(0, 1fr) 18px; gap: 9px; padding: 12px; }
  .incident-metric-icon { width: 44px; height: 44px; }
  .incident-metric-icon .ui-icon { width: 25px; height: 25px; }
  .incident-filter-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .incident-filter-search { grid-column: span 2; }
  .incident-date-range { grid-column: span 2; }
  .incident-filter-actions { grid-column: span 2; justify-content: flex-end; }
}
@media (max-width: 900px) {
  .incident-metric-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .incident-filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .incident-case-grid { grid-template-columns: 1fr; }
  .incident-management-panel { order: -1; }
}
@media (max-width: 580px) {
  .incident-metric-strip,
  .incident-filter-grid { grid-template-columns: 1fr; }
  .incident-filter-search,
  .incident-date-range,
  .incident-filter-actions { grid-column: auto; }
  .incident-filter-actions { min-width: 0; }
  .incident-filter-actions .button { flex: 1 1 0; min-width: 0; }
  .incident-date-range > div { grid-template-columns: 1fr; }
  .incident-date-range i { display: none; }
}

/* AVA 12 - Digitacion, incidencias y peso consolidado */
.package-field-header{display:flex;align-items:center;justify-content:space-between;gap:10px;min-height:24px}.package-field-header>span{font-size:12px;font-weight:700;letter-spacing:.04em}.field-freeze{display:inline-flex;align-items:center;gap:5px;font-size:11px;font-weight:600;color:var(--muted,#667);cursor:pointer}.field-freeze input{margin:0}.field-freeze:has(input:checked){color:#00695c}.quick-incident-panel{display:flex;align-items:center;gap:16px;flex-wrap:wrap;border:1px solid #d9e5e2;border-radius:12px;padding:12px 14px;background:#f7fbfa}.quick-incident-panel>div{display:flex;flex-direction:column;min-width:240px;margin-right:auto}.quick-incident-panel>div span{font-size:12px;color:#64748b}.quick-incident-panel label{display:flex;align-items:center;gap:6px;font-weight:600}.saved-work-actions{display:flex;gap:8px;justify-content:flex-end}.weight-group-card{display:grid;grid-template-columns:minmax(220px,1fr) minmax(150px,220px) auto auto;align-items:end;gap:12px;border:1px solid #dbe5e3;border-radius:12px;padding:14px}.weight-group-card>div:first-child{display:flex;flex-direction:column;gap:4px}.weight-group-card>div:first-child span{font-size:12px;color:#64748b}.package-check-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:8px;padding:10px;border:1px solid #dbe5e3;border-radius:10px;max-height:240px;overflow:auto}.package-check-grid label{display:flex;align-items:flex-start;gap:7px;padding:7px;border-radius:8px;background:#f8fafc}.dialog-actions{display:flex;justify-content:flex-end;gap:10px;align-items:center}.field textarea{width:100%;resize:vertical}
@media(max-width:900px){.weight-group-card{grid-template-columns:1fr}.quick-incident-panel{align-items:flex-start}.saved-work-actions{flex-direction:column}}

/* AVA 12 - Reportes completos y garantia simplificada */
.incident-create-mode,.incident-type-selector{display:flex;align-items:center;gap:18px;flex-wrap:wrap;padding:12px 14px;border:1px solid #dbe5e3;border-radius:12px;background:#f8fbfa}.incident-create-mode label,.incident-type-selector label{display:flex;align-items:center;gap:7px;font-weight:600}.incident-type-selector strong{margin-right:auto}.warranty-progress{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin:16px 0}.warranty-step{min-width:0;display:flex;align-items:center;gap:9px;border:1px solid #dce5e3;border-radius:10px;padding:10px;background:#fff;color:#64748b}.warranty-step span{min-width:0;overflow-wrap:anywhere}.warranty-step b{display:grid;place-items:center;width:28px;height:28px;flex:0 0 28px;border-radius:50%;background:#eef3f2}.warranty-step.is-current{border-color:#087f70;background:#eefaf7;color:#075e54}.warranty-step.is-current b,.warranty-step.is-done b{background:#087f70;color:#fff}.warranty-step.is-done{color:#087f70}.warranty-decision-actions{display:grid;grid-template-columns:1fr 1fr;gap:12px}.status-pill+ .status-pill{margin-left:4px}
@media(max-width:760px){.warranty-progress{grid-template-columns:1fr}.warranty-decision-actions{grid-template-columns:1fr}.incident-create-mode,.incident-type-selector{align-items:flex-start;flex-direction:column}}

/* AVA 12 · Salida del almacén, agencias y estados de cuenta */
.module-icon--salidas,.module-icon--agencias,.module-icon--estados-cuenta{background:#e8f4ef;color:#0b5d4b}
.warehouse-filter-bar{display:grid;grid-template-columns:minmax(260px,1fr) 220px auto;align-items:end;gap:16px;margin-bottom:18px}
.warehouse-metric{border:0;text-align:left;cursor:pointer}
.warehouse-invoice-summary{display:grid;grid-template-columns:repeat(4,minmax(120px,1fr));gap:12px}
.warehouse-invoice-summary>div,.aging-grid>div{display:flex;flex-direction:column;gap:5px;padding:14px;border:1px solid var(--border);border-radius:12px;background:var(--surface-soft)}
.warehouse-invoice-summary span,.aging-grid span{font-size:.78rem;color:var(--text-muted);text-transform:uppercase;letter-spacing:.04em}
.warehouse-invoice-summary strong,.aging-grid strong{font-size:1.08rem;color:var(--text)}
.delivery-history-row{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 0;border-bottom:1px solid var(--border)}
.delivery-history-row div{display:flex;flex-direction:column;gap:4px}.delivery-history-row span{color:var(--text-muted);font-size:.88rem}
.agency-org-field{min-width:230px;margin:0}.agency-tabs{margin-bottom:18px}.compact-heading{margin-bottom:16px}
.agency-flow{display:grid;gap:10px}.agency-flow>div{display:grid;grid-template-columns:34px 1fr;align-items:center;gap:10px;padding:10px;border:1px solid var(--border);border-radius:10px}.agency-flow strong{display:grid;place-items:center;width:30px;height:30px;border-radius:50%;background:#e8f4ef;color:#0b5d4b}.agency-flow span{font-weight:600}
.agency-workspace-card{width:100%;font:inherit;text-align:left;cursor:pointer;transition:transform .15s ease,border-color .15s ease,box-shadow .15s ease}
.agency-workspace-card:hover,.agency-workspace-card:focus-visible{transform:translateY(-2px);border-color:var(--accent);box-shadow:0 8px 22px rgba(11,59,53,.12);outline:none}
.agency-invoice-detail{font-size:13px}.agency-invoice-detail .warehouse-invoice-summary{grid-template-columns:repeat(4,minmax(150px,1fr))}
.agency-invoice-parties{align-items:stretch}.agency-invoice-parties .card{padding:16px}.agency-invoice-parties .detail-list{display:grid;gap:5px}.agency-invoice-parties p{margin:0;line-height:1.45}
.agency-invoice-search{grid-template-columns:minmax(320px,1fr) auto;align-items:end;margin-bottom:0}.agency-invoice-items{max-height:52vh}.agency-invoice-items table{min-width:1500px;font-size:13px}.agency-invoice-items th,.agency-invoice-items td{padding:10px 11px}
.agency-package-filters{grid-template-columns:minmax(250px,1.25fr) minmax(190px,.75fr) minmax(250px,1fr) 140px 190px;align-items:end;justify-content:center;gap:14px}
.agency-package-filters .field,.agency-custody-filters .field{grid-column:auto;min-width:0}
.agency-package-filters .button,.agency-custody-filters .button{width:100%;min-height:42px;justify-content:center;text-align:center;line-height:1.2}
.agency-custody-filters{width:100%;grid-template-columns:minmax(360px,1fr) 160px;align-items:end;justify-content:stretch;margin:0}
.agency-custody-filters>.field{width:100%}
.agency-packages-table{max-height:60vh}.agency-packages-table table{min-width:1450px}.agency-reception-packages-table table{min-width:1150px}
.action-grid{display:grid;gap:10px}.package-select-list{display:grid;gap:8px;max-height:330px;overflow:auto;padding:4px}.package-select-row{display:flex;align-items:flex-start;gap:10px;padding:10px 12px;border:1px solid var(--border);border-radius:10px;cursor:pointer}.package-select-row:hover{background:var(--surface-soft)}.package-select-row span{display:flex;flex-direction:column;gap:3px}.package-select-row small{color:var(--text-muted)}
.statement-filters{margin-bottom:18px}.statement-filter-actions{display:flex;align-items:end}.statement-preview{display:grid;gap:16px}.statement-preview-header{display:flex;align-items:flex-start;justify-content:space-between;gap:20px;padding-bottom:12px;border-bottom:1px solid var(--border)}.statement-preview-header h3{margin:0}.statement-preview-header p{margin:4px 0 0;color:var(--text-muted)}.statement-preview-header>div:last-child{display:flex;flex-direction:column;align-items:flex-end;gap:4px}.statement-detail-metrics{margin:0}.statement-aging{box-shadow:none}.aging-grid{display:grid;grid-template-columns:repeat(5,minmax(110px,1fr));gap:10px}.statement-toolbar{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:12px}.date-input-wrap{display:flex;width:100%;min-width:0;border:1px solid var(--border);border-radius:10px;padding:9px 11px;background:var(--surface)}.date-input-wrap input{display:block;width:100%;min-width:0;border:0;background:transparent;padding:0;color:inherit}
.status-pill--danger{background:#feeceb;color:#a62a23}.status-pill--warning{background:#fff4d7;color:#8b5b00}
@media (max-width:1200px){.agency-package-filters{grid-template-columns:repeat(2,minmax(240px,1fr))}.agency-package-filters .button{min-width:0}}
@media (max-width:900px){.warehouse-filter-bar{grid-template-columns:1fr}.warehouse-invoice-summary,.aging-grid,.agency-invoice-detail .warehouse-invoice-summary{grid-template-columns:repeat(2,minmax(120px,1fr))}.statement-toolbar,.statement-preview-header{align-items:stretch;flex-direction:column}.statement-preview-header>div:last-child{align-items:flex-start}.agency-org-field{min-width:0}.agency-invoice-search,.agency-package-filters,.agency-custody-filters{width:100%;grid-template-columns:1fr}}
@media (max-width:520px){.warehouse-invoice-summary,.aging-grid{grid-template-columns:1fr}}

/* AVA 13.1 · Sistema visual unificado */
:root {
  --navy: #003f35;
  --navy-2: #005b4b;
  --green: #07855f;
  --blue: #087f70;
  --blue-2: #005f50;
  --bg: #f5f7f6;
  --surface: #ffffff;
  --surface-2: #f7faf9;
  --border: #dbe5e1;
  --text: #112c27;
  --muted: #637871;
  --shadow: 0 12px 34px rgba(0, 55, 46, .09);
  --sidebar-width: 224px;
}
body { background: linear-gradient(180deg, #f9fbfa 0, #f3f6f5 100%); }
.app-shell { max-width: 1920px; margin: 0 auto; background: var(--bg); box-shadow: 0 0 0 1px rgba(0,49,42,.05); }
.sidebar { background: linear-gradient(180deg, #003f35 0%, #004d40 54%, #00342d 100%); box-shadow: 4px 0 18px rgba(0,41,34,.12); }
.sidebar-brand { min-height: 78px; padding: 15px 22px; }
.sidebar-brand-logo { width: 122px; height: auto; }
.nav-button { min-height: 48px; grid-template-columns: 34px minmax(0,1fr); margin: 2px 10px; width: calc(100% - 20px); padding: 7px 11px; border-left: 0; border-radius: 8px; }
.nav-button.is-active { border-left: 0; color: #fff; background: linear-gradient(135deg, #087e68, #079270); box-shadow: 0 7px 18px rgba(0,31,26,.2); }
.nav-button .module-icon { width: 31px; height: 31px; border-radius: 8px; }
.topbar { min-height: 72px; display: grid; grid-template-columns: minmax(230px,.8fr) minmax(280px,1.2fr) minmax(350px,1fr); gap: 20px; padding: 10px 24px; border-bottom: 1px solid #dbe5e1; background: rgba(255,255,255,.96); backdrop-filter: blur(12px); }
.topbar-left, .topbar-right { min-width: 0; }
.topbar-right { justify-content: flex-end; gap: 16px; }
.connection-state { padding: 8px 10px; border: 1px solid #dce6e2; border-radius: 8px; background: #fafcfb; }
.profile-button { min-width: 154px; display: grid; grid-template-columns: 34px minmax(0,1fr); align-items: center; gap: 9px; padding: 5px 8px; border: 0; border-radius: 9px; color: var(--text); text-align: left; background: transparent; }
.profile-button:hover { background: #eef6f3; }
.profile-avatar { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: #006451; font-size: 11px; font-weight: 800; }
.profile-copy { min-width: 0; display: grid; gap: 1px; }
.profile-copy strong, .profile-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-copy strong { font-size: 12px; }.profile-copy small { color: var(--muted); font-size: 10px; }
.clock { display: none; }
.main-content { padding: 24px 28px 38px; }
.screen-heading { align-items: center; margin-bottom: 20px; }
.screen-heading h1 { color: #102b26; font-size: clamp(25px,2vw,31px); font-weight: 750; }
.card, .filter-bar, .metric-card { border-color: #dbe5e1; border-radius: 11px; box-shadow: 0 3px 12px rgba(0,49,42,.035); }
.card { padding: 18px; }
.metric-card { min-height: 100px; padding: 17px; background: linear-gradient(145deg,#fff,#fbfdfc); }
.metric-copy strong { color: #102f28; }
.button--primary { background: linear-gradient(135deg, #005e50, #00856b); box-shadow: 0 5px 13px rgba(0,95,79,.16); }
.button--secondary { color: #174a40; background: #eaf3f0; }
table thead th { color: #526b64; background: #f4f8f6; }
table tbody tr:hover { background: #f5fbf8; }
input:focus, select:focus, textarea:focus { border-color: #16866d; box-shadow: 0 0 0 3px rgba(7,133,95,.11); }
@media (max-width: 1220px) {
  .topbar { grid-template-columns: minmax(210px,.8fr) minmax(240px,1fr) auto; }
  .connection-state { display: none; }
}
@media (max-width: 880px) {
  .topbar { min-height: 62px; grid-template-columns: minmax(0,1fr) auto; padding: 8px 12px; }
  .profile-copy, .topbar .module-icon { display: none; }
  .profile-button { min-width: 38px; padding: 2px; }
  .topbar-right { display: flex; }
  .main-content { padding: 16px 12px 28px; }
}

/* AVA 13.1 · Diseño final azul marino con navegación superior */
:root {
  --navy: #0B3B35;
  --navy-2: #072D29;
  --blue: #C9953D;
  --blue-2: #A97728;
  --green: #0c8b68;
  --orange: #e59b18;
  --purple: #6b45b8;
  --teal: #12959a;
  --yellow: #e8b62e;
  --slate: #64718a;
  --bg: #F4F6F5;
  --surface: #ffffff;
  --surface-2: #f8f9fc;
  --border: #dce2ee;
  --text: #18233d;
  --muted: #69758d;
  --shadow: 0 12px 32px rgba(7,45,41, .10);
}

body { background: #F4F6F5; }
.login-brand { background: var(--navy); box-shadow: inset -8px 0 0 #C9953D; }
.login-access-panel { background: #F4F6F5; }
.button--primary { color: #fff; background: var(--navy); box-shadow: 0 5px 14px rgba(7,45,41,.18); }
.button--primary:hover { background: #072D29; }
.button--secondary { color: var(--navy); background: #EAF1EF; }
.screen-heading h1, .metric-copy strong, .kpi strong { color: var(--navy); }
input:focus, select:focus, textarea:focus { border-color: #C9953D; box-shadow: 0 0 0 3px rgba(201,149,61,.12); }

.app-shell {
  min-height: 100%;
  max-width: none;
  display: block;
  margin: 0;
  background: var(--bg);
  box-shadow: none;
}

.topbar {
  position: sticky;
  top: 0;
  min-height: 78px;
  display: grid;
  grid-template-columns: minmax(245px,.8fr) minmax(300px,1.25fr) minmax(390px,1fr);
  align-items: center;
  gap: 22px;
  padding: 12px 22px;
  border: 0;
  color: #fff;
  background: var(--navy);
  backdrop-filter: none;
  z-index: 40;
}
.topbar-brand { min-width: 0; display: flex; align-items: center; gap: 12px; }
.topbar-brand-logo { width: 96px; height: auto; flex: 0 0 auto; }
.topbar-brand > span { min-width: 0; display: grid; gap: 2px; }
.topbar-brand strong, .topbar-brand small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-brand strong { font-size: 13px; }
.topbar-brand small { color: rgba(255,255,255,.7); font-size: 10px; }
.topbar-right { min-width: 0; display: flex; justify-content: flex-end; align-items: center; gap: 10px; }
.topbar .connection-state { color: #c7f4e6; border-color: rgba(255,255,255,.15); background: rgba(255,255,255,.07); }
.topbar .clock { color: rgba(255,255,255,.75); }
.topbar .profile-button { min-width: 145px; color: #fff; }
.topbar .profile-button:hover { background: rgba(255,255,255,.09); }
.topbar .profile-avatar { color: var(--navy); background: #fff; border-radius: 7px; }
.topbar .profile-copy small { color: rgba(255,255,255,.7); }
.header-logout { min-height: 36px; display: inline-flex; align-items: center; gap: 7px; padding: 0 10px; border: 1px solid rgba(255,255,255,.2); border-radius: 7px; color: #fff; background: rgba(255,255,255,.06); }
.header-logout:hover { background: rgba(255,255,255,.13); }
.header-logout svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.sidebar {
  position: relative;
  top: auto;
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
  padding: 14px 18px 16px;
  color: var(--text);
  background: #fff;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 5px 18px rgba(7,45,41,.05);
  transform: none;
  opacity: 1;
  z-index: 25;
}
.module-strip-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 11px; }
.module-current { display: flex; align-items: center; gap: 10px; padding-left: 11px; border-left: 4px solid var(--navy); }
.module-current > span:last-child { display: grid; gap: 2px; }
.module-current small, .module-strip-note { color: var(--muted); font-size: 10px; }
.module-current strong { color: var(--navy); font-size: 14px; }
.module-current .module-icon { width: 44px; height: 44px; }
.module-strip-note { padding-right: 4px; }
.module-strip-heading .icon-button { display: none; }
.module-nav {
  display: grid;
  grid-template-columns: repeat(12, minmax(84px, 1fr));
  gap: 8px;
  overflow: visible;
  padding: 0;
}
.nav-button {
  width: 100%;
  min-width: 0;
  min-height: 112px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  margin: 0;
  padding: 9px 7px;
  border: 1px solid var(--border);
  border-left: 1px solid var(--border);
  border-radius: 9px;
  color: var(--text);
  text-align: center;
  background: #fff;
  box-shadow: 0 2px 7px rgba(7,45,41,.035);
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease, background .16s ease;
}
.nav-button:hover { border-color: #9aa9c8; background: #f7f8fc; box-shadow: 0 6px 16px rgba(7,45,41,.08); transform: translateY(-1px); }
.nav-button.is-active { border: 1px solid var(--navy); border-left: 1px solid var(--navy); color: #fff; background: var(--navy); box-shadow: 0 8px 18px rgba(7,45,41,.18); }
.nav-button span:last-child { width: 100%; overflow: visible; text-overflow: clip; white-space: normal; font-size: 11px; font-weight: 700; line-height: 1.25; }
.module-icon,
.nav-button .module-icon,
.topbar .module-icon {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  overflow: visible;
  border-radius: 0;
  color: inherit;
  background: transparent;
}
.module-icon img { width: 100%; height: 100%; display: block; object-fit: contain; }
.nav-button.is-active .module-icon { background: transparent; }
.sidebar-user { display: none; }
.workspace { min-width: 0; min-height: 0; }
.main-content { max-width: 1600px; min-width: 0; margin: 0 auto; padding: 25px 28px 40px; }
.card, .filter-bar, .metric-card { border-color: var(--border); box-shadow: 0 3px 12px rgba(7,45,41,.045); }
.metric-card { background: #fff; }
table thead th { color: #526078; background: #f4f6fa; }
table tbody tr:hover { background: #f5f7fb; }

@media (max-width: 1380px) {
  .topbar { grid-template-columns: minmax(220px,.75fr) minmax(260px,1fr) auto; }
  .topbar .connection-state, .topbar .clock { display: none; }
  .module-nav { grid-template-columns: repeat(6, minmax(100px,1fr)); }
}

@media (max-width: 880px) {
  .topbar { min-height: 68px; grid-template-columns: minmax(0,1fr) auto; gap: 10px; padding: 9px 12px; }
  .topbar-brand-logo { width: 82px; }
  .topbar-brand > span { display: none; }
  .topbar-right { display: flex; }
  .topbar .profile-button { min-width: 38px; padding: 2px; }
  .topbar .profile-copy { display: none; }
  .header-logout span { display: none; }
  .header-logout { width: 38px; justify-content: center; padding: 0; }
  .sidebar { position: relative; left: auto; width: 100%; padding: 10px 12px 12px; box-shadow: 0 4px 14px rgba(7,45,41,.06); transform: none; }
  .module-strip-heading { margin: 0; }
  .module-strip-heading .icon-button { display: grid; flex: 0 0 auto; border: 1px solid var(--border); background: #f3f5fa; }
  .module-strip-heading .icon-button:hover { background: #e9edf6; }
  .module-strip-heading .icon-button span { background: var(--navy); }
  .module-current { flex: 1; }
  .module-strip-note { display: none; }
  .module-nav { display: none; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 8px; padding-top: 12px; }
  .sidebar.is-open .module-nav { display: grid; }
  .nav-button { min-height: 108px; }
  .main-content { padding: 18px 12px 30px; }
}

@media (max-width: 560px) {
  .module-nav { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .module-current .module-icon { width: 40px; height: 40px; }
  .nav-button { min-height: 104px; }
  .nav-button .module-icon { width: 54px; height: 54px; }
}

/* AVA 13.1 · Selector compacto de módulos con iconografía aprobada */
.topbar {
  grid-template-columns: minmax(410px,1fr) minmax(290px,1.2fr) minmax(330px,auto);
}
.topbar-brand { gap: 10px; }
.sidebar {
  display: none;
  padding: 7px 18px 9px;
  box-shadow: 0 3px 12px rgba(7,45,41,.045);
}
.sidebar.is-open { display: block; }
.header-module-switch {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-left: auto;
  padding: 2px 4px 2px 2px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  text-align: left;
  background: transparent;
}
.header-module-switch:hover { background: rgba(255,255,255,.09); }
.header-module-switch:focus-visible { outline: 3px solid rgba(255,255,255,.28); outline-offset: 2px; }
.module-switch-copy { min-width: 0; display: grid; gap: 1px; }
.module-switch-copy small { color: rgba(255,255,255,.68); font-size: 9px; }
.module-switch-copy strong { max-width: 118px; overflow: hidden; color: #fff; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.header-module-switch > .module-icon { width: 42px; height: 42px; flex: 0 0 42px; }
.module-switch-chevron {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform .16s ease;
}
.header-module-switch.is-open .module-switch-chevron { transform: rotate(180deg); }
.module-nav {
  display: grid;
  grid-template-columns: repeat(12, minmax(74px, 1fr));
  gap: 4px;
  padding: 0;
}
.sidebar.is-open .module-nav { display: grid; }
.nav-button {
  min-height: 88px;
  gap: 1px;
  padding: 3px 4px 5px;
  border: 0;
  border-bottom: 3px solid transparent;
  border-radius: 8px 8px 3px 3px;
  background: transparent;
  box-shadow: none;
}
.nav-button:hover {
  border-color: transparent;
  background: #F4F6F5;
  box-shadow: none;
  transform: none;
}
.nav-button.is-active {
  border: 0;
  border-bottom: 3px solid var(--navy);
  color: var(--navy);
  background: transparent;
  box-shadow: none;
}
.nav-button .module-icon {
  width: 68px;
  height: 68px;
}
.nav-button span:last-child {
  font-size: 10px;
  line-height: 1.15;
}

@media (max-width: 1180px) {
  .topbar { grid-template-columns: minmax(260px,.8fr) minmax(260px,1fr) auto; }
  .topbar-brand > span { display: none; }
  .module-nav { grid-template-columns: repeat(6, minmax(92px,1fr)); }
}

@media (max-width: 880px) {
  .topbar { grid-template-columns: minmax(0,1fr) auto; }
  .sidebar { padding: 6px 12px 7px; }
  .header-module-switch { margin-left: 0; }
  .header-module-switch > .module-icon { display: grid; width: 40px; height: 40px; flex-basis: 40px; }
  .module-nav { grid-template-columns: repeat(3, minmax(0,1fr)); gap: 5px; padding-top: 6px; }
  .nav-button { min-height: 88px; }
  .nav-button .module-icon { width: 66px; height: 66px; }
}

@media (max-width: 560px) {
  .module-nav { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .header-module-switch .module-switch-copy { display: none; }
}

/* Captura segura con lector de códigos */
.field-freeze {
  min-height: 24px;
  padding: 2px 8px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--muted);
  background: transparent;
  font: inherit;
  font-size: 11px;
  font-weight: 700;
}
.field-freeze:hover { border-color: #cbd5e1; background: #F4F6F5; }
.field-freeze.is-active {
  border-color: #91d2c0;
  color: #087354;
  background: #e8f6f0;
}
.scanner-field input { border-width: 2px; }
.scanner-field input.is-scan-valid {
  border-color: #0c8b68;
  box-shadow: 0 0 0 3px rgba(12,139,104,.12);
}
.scanner-field input.is-scan-invalid {
  border-color: #c43b3b;
  box-shadow: 0 0 0 3px rgba(196,59,59,.12);
}
.scanner-feedback {
  min-height: 22px;
  padding-left: 28px;
  position: relative;
}
.scanner-feedback::before {
  position: absolute;
  left: 0;
  content: "▣";
  color: var(--blue);
  font-size: 17px;
}
.scanner-feedback[data-tone="success"] { color: #087354; }
.scanner-feedback[data-tone="success"]::before { content: "✓"; color: #087354; }
.scanner-feedback[data-tone="error"] { color: #a22f2f; }
.scanner-feedback[data-tone="error"]::before { content: "!"; color: #a22f2f; }

/* AVA 13.1 · SVG aprobados, escala compacta y legibilidad profesional */
body { font-size: 15px; }

.topbar {
  min-height: 70px;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  padding: 9px 24px;
}
.topbar-brand { gap: 18px; }
.topbar-brand-logo { width: 148px; }
.topbar-brand > span { flex: 0 1 250px; }
.topbar-brand strong { font-size: 15px; }
.topbar-brand small { font-size: 12px; }
.header-module-switch { margin-left: 8px; }
.header-module-switch > .module-icon { width: 46px; height: 46px; flex-basis: 46px; }
.module-switch-copy small { font-size: 11px; }
.module-switch-copy strong { max-width: 160px; font-size: 13px; }
.topbar-right { gap: 12px; }
.topbar .profile-button { min-width: 154px; }
.topbar .profile-copy strong { font-size: 13px; }
.topbar .profile-copy small { font-size: 11px; }
.header-logout { min-height: 38px; padding: 0 12px; font-size: 13px; }

.sidebar { padding: 6px 18px 8px; }
.module-nav { grid-template-columns: repeat(12, minmax(78px, 1fr)); gap: 5px; }
.nav-button { min-height: 83px; padding: 2px 4px 5px; }
.nav-button .module-icon { width: 62px; height: 62px; }
.nav-button span:last-child { font-size: 11.5px; line-height: 1.2; }

.main-content { max-width: 1540px; padding: 18px 22px 28px; }
.screen-heading { margin-bottom: 12px; }
.screen-heading h1 { font-size: clamp(24px, 2vw, 29px); line-height: 1.15; }
.screen-heading p { margin-top: 4px; font-size: 14px; line-height: 1.4; }
.heading-actions { gap: 8px; }
.button { min-height: 38px; padding: 0 15px; font-size: 14px; }
.compact-button, .tab-button, .status-pill { font-size: 12px; }

.card, .filter-bar { padding: 14px; border-radius: 9px; }
.filter-bar { gap: 10px; margin-bottom: 12px; }
.dashboard-filter-bar {
  width: min(100%, 630px);
  grid-template-columns: repeat(2, minmax(220px, 1fr));
}
.dashboard-filter-bar .field--3 { grid-column: auto; }
.field { gap: 5px; }
.field > span, .field > label, .form-grid label { font-size: 12px; }
input, select, textarea { font-size: 14px; }
.field input, .field select { min-height: 38px; padding: 8px 11px; }

.dashboard-metrics {
  grid-template-columns: repeat(6, minmax(145px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}
.metric-card { min-height: 82px; gap: 12px; padding: 12px 14px; border-radius: 9px; }
.metric-icon { width: 42px; height: 42px; flex: 0 0 42px; border-radius: 10px; }
.metric-icon svg {
  width: 25px;
  height: 25px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.metric-icon--weight { color: #1267a7; background: #e8f3fb; }
.metric-icon--packages { color: #138259; background: #e8f6f0; }
.metric-icon--pending { color: #a96900; background: #fff4dc; }
.metric-icon--invoices { color: #7342b6; background: #f2eafd; }
.metric-icon--voided { color: #bd3d3d; background: #fdecec; }
.metric-icon--incidents { color: #bf551c; background: #fff0e7; }
.metric-copy { min-width: 0; }
.metric-copy span { font-size: 12px; line-height: 1.25; white-space: normal; }
.metric-copy strong { font-size: 22px; line-height: 1.2; }
.content-grid { gap: 12px; }
.section-gap { margin-top: 12px; }
.card-header { gap: 12px; margin-bottom: 10px; }
.card-header h2 { font-size: 16px; }
.card-header span, .toolbar-note, .muted { font-size: 12px; }

.table-wrap { overflow-x: auto; }
table { width: 100%; table-layout: auto; font-size: 13.5px; }
table th, table td {
  padding: 9px 10px;
  text-align: center;
  vertical-align: middle;
  line-height: 1.35;
  white-space: normal;
  overflow-wrap: anywhere;
}
table thead th { font-size: 12px; letter-spacing: .02em; }
table .cell-wrap { min-width: 145px; white-space: normal; }

.dialog { max-height: calc(100vh - 40px); border-radius: 10px; }
.dialog--medium { width: min(700px, 100%); }
.dialog--large { width: min(920px, 100%); }
.dialog--wide { width: min(1100px, 100%); }
.dialog--xlarge { width: min(1240px, 100%); }
.dialog-header { padding: 13px 15px; }
.dialog-header h2 { font-size: 19px; }
.dialog-header p { font-size: 13px; }
.dialog-body { padding: 14px 15px 16px; }

@media (max-width: 1240px) {
  .topbar-brand-logo { width: 126px; }
  .topbar-brand > span { display: grid; }
  .dashboard-metrics { grid-template-columns: repeat(3, minmax(170px, 1fr)); }
  .module-nav { grid-template-columns: repeat(6, minmax(92px, 1fr)); }
}

@media (max-width: 880px) {
  .topbar { min-height: 64px; padding: 8px 12px; }
  .topbar-brand { gap: 8px; }
  .topbar-brand-logo { width: 104px; }
  .topbar-brand > span { display: none; }
  .header-module-switch { margin-left: 0; }
  .main-content { padding: 15px 12px 24px; }
  .dashboard-filter-bar { grid-template-columns: 1fr 1fr; }
  .module-nav { grid-template-columns: repeat(3, minmax(0,1fr)); }
}

@media (max-width: 620px) {
  .dashboard-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-filter-bar { width: 100%; grid-template-columns: 1fr; }
  .screen-heading { align-items: flex-start; }
  table { font-size: 13px; }
}

/* AVA 13.1 · Iconos HD y ventanas realmente adaptativas */
.module-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  image-rendering: auto;
}
.header-module-switch > .module-icon { width: 48px; height: 44px; flex-basis: 48px; }
.nav-button .module-icon { width: 72px; height: 64px; }

.content-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 560px), 1fr));
  align-items: start;
  gap: 12px;
}
.content-grid > .card { align-self: start; height: auto; }
.table-wrap { min-width: 0; max-width: 100%; overflow: auto; }
.table-wrap table { min-width: 620px; }
table th, table td {
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: normal;
  text-align: center;
}
table .cell-wrap {
  min-width: 150px;
  max-width: 280px;
  white-space: normal;
  overflow-wrap: break-word;
  word-break: normal;
}

.dialog-layer { padding: clamp(8px, 2vw, 20px); }
.dialog {
  --dialog-target: 700px;
  width: min(var(--dialog-target), calc(100vw - clamp(16px, 4vw, 40px)));
  max-width: 100%;
  max-height: calc(100dvh - clamp(16px, 4vw, 40px));
}
.dialog--small { --dialog-target: 460px; }
.dialog--medium { --dialog-target: 680px; }
.dialog--large { --dialog-target: 900px; }
.dialog--wide { --dialog-target: 1080px; }
.dialog--xlarge { --dialog-target: 1220px; }
.dialog-body { min-width: 0; overflow: auto; }
.dialog-body > .table-wrap { max-width: 100%; }

@media (max-width: 1240px) {
  .content-grid { grid-template-columns: 1fr; }
  .content-grid > .card { width: 100%; }
}

@media (max-width: 720px) {
  .dialog-header { padding: 11px 12px; }
  .dialog-body { padding: 12px; }
  .dialog .form-grid,
  .dialog .split-layout,
  .dialog .detail-panel { grid-template-columns: 1fr; }
  .dialog .field,
  .dialog .field--2,
  .dialog .field--3,
  .dialog .field--4,
  .dialog .field--6 { grid-column: 1 / -1; }
  .table-wrap table { min-width: 560px; }
}

/* Centro de notificaciones: visible, discreto y consistente con la cabecera AVA. */
.notifications-button {
  position: relative;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  flex: 0 0 40px;
  padding: 0;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 8px;
  color: #fff;
  background: rgba(255,255,255,.07);
}
.notifications-button:hover { background: rgba(255,255,255,.14); }
.notifications-button svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.notifications-count {
  position: absolute;
  top: -6px;
  right: -7px;
  min-width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  padding: 0 5px;
  border: 2px solid var(--navy);
  border-radius: 999px;
  color: #fff;
  background: #d83a45;
  font-size: 10px;
  font-weight: 800;
}
.notification-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}
.notification-toolbar p { margin: 0; color: var(--muted); }
.notification-list { display: grid; gap: 7px; }
.notification-item {
  width: 100%;
  display: grid;
  grid-template-columns: 10px minmax(0,1fr) 20px;
  align-items: center;
  gap: 12px;
  padding: 12px 13px;
  border: 1px solid var(--border);
  border-radius: 9px;
  color: var(--text);
  text-align: left;
  background: #fff;
}
.notification-item:hover { border-color: #9aa9c8; background: #f7f9fc; }
.notification-item.is-unread { border-left: 4px solid var(--blue); background: #f7f9ff; }
.notification-item.is-read { opacity: .76; }
.notification-priority { width: 8px; height: 8px; border-radius: 50%; background: #8590a6; }
.notification-priority--high, .notification-priority--critical { background: #d83a45; }
.notification-priority--low { background: #55a385; }
.notification-copy { min-width: 0; display: grid; gap: 3px; }
.notification-copy strong { color: var(--navy); font-size: 14px; }
.notification-copy span { color: var(--text); font-size: 13px; line-height: 1.4; }
.notification-copy small { color: var(--muted); font-size: 11px; }
.notification-open { color: var(--muted); font-size: 25px; }

@media (max-width: 620px) {
  .notification-toolbar { align-items: stretch; flex-direction: column; }
  .notification-item { padding: 11px 9px; }
}

/* AVA 13.1 · Cierre de uniformidad: azul marino para navegación y controles.
   Verde, ámbar y rojo se reservan únicamente para estados semánticos. */
.eyebrow { color: var(--blue); }
.dialog-header { background: linear-gradient(135deg, var(--navy), var(--navy-2)); }
.dialog-header p { color: rgba(255,255,255,.76); }
.callout { border-left-color: var(--blue); color: #283b70; background: #FBF5E9; }
.chart-row progress { accent-color: var(--blue); }
.chart-row progress::-webkit-progress-value { background: linear-gradient(90deg, var(--blue), #6f8ce5); }
.chart-row progress::-moz-progress-bar { background: linear-gradient(90deg, var(--blue), #6f8ce5); }
.module-icon--salidas,
.module-icon--agencias,
.module-icon--estados-cuenta { color: var(--navy); background: #EAF1EF; }
.agency-flow strong { color: var(--navy); background: #EAF1EF; }
.field-freeze.is-active { border-color: #9aabe1; color: var(--navy); background: #EAF1EF; }
.package-field input.is-frozen,
.package-field select.is-frozen { color: #34405d; border-color: #b8c3de; background: #eef1f8; cursor: not-allowed; }
.incident-step.is-active,
.incident-active-filter,
.warranty-step.is-current { border-color: var(--blue); background: #FBF5E9; color: var(--navy); }
.incident-step.is-active b,
.warranty-step.is-current b { border-color: var(--blue); color: #fff; background: var(--blue); }
.login-card label { color: var(--navy); }
.login-input:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(201,149,61,.12); }
.module-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #eef1f7;
}
.module-tab {
  min-height: 36px;
  flex: 0 0 auto;
  padding: 0 13px;
  border: 0;
  border-radius: 6px;
  color: #4b5872;
  background: transparent;
  font-size: 12px;
  font-weight: 750;
}
.module-tab:hover { color: var(--navy); background: #f8f9fc; }
.module-tab.is-active { color: #fff; background: var(--navy); box-shadow: 0 3px 9px rgba(7,45,41,.16); }
.compact-button.is-active { color: #fff; border-color: var(--navy); background: var(--navy); }
.tab-button.is-active { color: #fff; background: var(--navy); box-shadow: 0 2px 7px rgba(7,45,41,.16); }
.table-action, .evidence-link { color: var(--blue); }
.client-search-option:focus,
.client-search-option.is-highlighted { background: #F7F0E4; outline: 1px solid #9aabe1; }
.package-picker-row:hover,
.package-picker-row.is-selected,
.dashboard-status-item:hover { border-color: #9aabe1; background: #F5F9F7; }
.timeline-dot { border-color: #bec9ec; background: var(--blue); }

/* AVA 13.1 R2 · Navegación superior adaptable, iconografía HD sin filtros. */
:root {
  --ava-primary: #0B3B35;
  --ava-primary-dark: #072D29;
  --ava-gold: #C9953D;
  --ava-bg: #F4F6F5;
  --ava-surface: #FFFFFF;
  --ava-text: #17211F;
  --ava-muted: #5F6F6B;
  --ava-border: #D8E0DD;
  --ava-success: #2E7D5B;
  --ava-warning: #B7791F;
  --ava-error: #B42318;
  --navy: var(--ava-primary);
  --navy-2: var(--ava-primary-dark);
  --blue: var(--ava-gold);
  --blue-2: #A97728;
  --green: var(--ava-success);
  --orange: var(--ava-warning);
  --bg: var(--ava-bg);
  --surface: var(--ava-surface);
  --surface-2: #F8FAF9;
  --border: var(--ava-border);
  --text: var(--ava-text);
  --muted: var(--ava-muted);
  --shadow: 0 10px 28px rgba(7,45,41,.08);
}

html, body { color: var(--ava-text); background: var(--ava-bg); }
body { font-size: 15px; }
.login-brand { background: var(--ava-primary); box-shadow: inset -7px 0 0 var(--ava-gold); }
.login-access-panel { background: var(--ava-bg); }
.login-card label, .screen-heading h1, .metric-copy strong, .kpi strong { color: var(--ava-text); }
.screen-heading p { color: var(--ava-muted); }
.card, .filter-bar, .metric-card {
  border: 1px solid var(--ava-border);
  border-radius: 10px;
  background: var(--ava-surface);
  box-shadow: 0 2px 8px rgba(7,45,41,.04);
}
.button--primary { color: #fff; background: var(--ava-primary); box-shadow: 0 4px 12px rgba(11,59,53,.18); }
.button--primary:hover { background: var(--ava-primary-dark); }
.button--secondary { color: var(--ava-primary); background: #EAF1EF; }
.button--secondary:hover { background: #DEE9E6; }
input, select, textarea { color: var(--ava-text); border-color: var(--ava-border); background: var(--ava-surface); }
input:focus, select:focus, textarea:focus, .login-input:focus-within { border-color: var(--ava-gold); box-shadow: 0 0 0 3px rgba(201,149,61,.16); }
table thead th { color: var(--ava-muted); background: #F6F8F7; }
table tbody tr:hover { background: #F5F9F7; }
.eyebrow, .table-action, .evidence-link { color: var(--ava-primary); }
.dialog-header { background: linear-gradient(135deg,var(--ava-primary),var(--ava-primary-dark)); }
.dialog-header p { color: rgba(255,255,255,.76); }
.callout { border-left-color: var(--ava-gold); color: #654B1D; background: #FBF5E9; }
.module-tabs { border-color: var(--ava-border); background: #EDF2F0; }
.module-tab { color: var(--ava-muted); }
.module-tab:hover { color: var(--ava-primary); background: #fff; }
.module-tab.is-active, .compact-button.is-active, .tab-button.is-active { color: #fff; border-color: var(--ava-primary); background: var(--ava-primary); }
.status-pill--success, .status-pill[data-tone="success"] { color: var(--ava-success); }
.status-pill--warning, .status-pill[data-tone="warning"] { color: var(--ava-warning); }
.status-pill--error, .status-pill[data-tone="error"] { color: var(--ava-error); }
.scanner-field input.is-scan-valid { border-color: var(--ava-success); box-shadow: 0 0 0 3px rgba(46,125,91,.13); }
.scanner-field input.is-scan-invalid { border-color: var(--ava-error); box-shadow: 0 0 0 3px rgba(180,35,24,.12); }
.scanner-feedback[data-tone="success"], .scanner-feedback[data-tone="success"]::before { color: var(--ava-success); }
.scanner-feedback[data-tone="error"], .scanner-feedback[data-tone="error"]::before { color: var(--ava-error); }
.metric-icon, .metric-icon--blue, .metric-icon--weight { color: var(--ava-primary); background: #EAF1EF; }
.metric-card:nth-child(2) .metric-icon, .metric-icon--green, .metric-icon--packages { color: var(--ava-success); background: #EAF5EF; }
.metric-card:nth-child(3) .metric-icon, .metric-icon--amber, .metric-icon--pending { color: var(--ava-warning); background: #FBF5E9; }
.metric-card:nth-child(4) .metric-icon, .metric-icon--violet, .metric-icon--invoices { color: var(--ava-gold); background: #FCF8EF; }
.metric-card:nth-child(5) .metric-icon, .metric-icon--red, .metric-icon--voided,
.metric-icon--incidents { color: var(--ava-error); background: #FDECEB; }

.app-shell {
  min-height: 100dvh;
  height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0,1fr);
  grid-template-rows: auto auto minmax(0,1fr);
  grid-template-areas: "topbar" "modules" "workspace";
  overflow: hidden;
  background: var(--ava-bg);
}

.topbar {
  grid-area: topbar;
  position: relative;
  top: auto;
  min-height: 82px;
  display: grid;
  grid-template-columns: minmax(176px,220px) minmax(190px,260px) minmax(250px,1fr) auto;
  grid-template-areas: "logo company module account";
  align-items: center;
  gap: 14px;
  padding: 10px 20px;
  color: #fff;
  background: var(--ava-primary-dark);
  box-shadow: 0 3px 16px rgba(7,45,41,.16);
  z-index: 60;
}

.topbar-brand {
  grid-area: logo;
  min-width: 0;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  overflow: hidden;
}
.topbar-brand-logo,
.topbar-brand > img {
  width: min(100%,190px);
  height: 58px;
  display: block;
  object-fit: contain;
  object-position: left center;
}

.topbar .approved-company-switch {
  grid-area: company;
  min-width: 0;
  min-height: 48px;
  margin: 0;
  padding: 0 13px;
  border: 1px solid rgba(255,255,255,.34);
  border-radius: 9px;
  color: #fff;
  background: rgba(255,255,255,.055);
}
.topbar .approved-company-switch span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.header-module-switch {
  grid-area: module;
  min-width: 0;
  width: fit-content;
  max-width: 340px;
  min-height: 56px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 4px 10px 4px 5px;
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 10px;
  color: #fff;
  text-align: left;
  background: rgba(255,255,255,.045);
}
.header-module-switch:hover { border-color: rgba(255,255,255,.34); background: rgba(255,255,255,.1); }
.header-module-switch > .module-icon {
  width: 58px;
  height: 50px;
  flex: 0 0 58px;
  overflow: visible;
  background: transparent;
}
.header-module-switch > .module-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: none;
  opacity: 1;
}
.module-switch-copy { min-width: 0; display: grid; gap: 2px; }
.module-switch-copy small { color: rgba(255,255,255,.7); font-size: 10px; }
.module-switch-copy strong { max-width: 190px; overflow: hidden; color: #fff; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.header-module-switch.is-open .module-switch-chevron { transform: rotate(180deg); }

.topbar-right {
  grid-area: account;
  width: auto;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
}

.sidebar,
.sidebar.is-open {
  grid-area: modules;
  position: relative;
  inset: auto;
  width: 100%;
  height: auto;
  max-height: min(38dvh,270px);
  overflow-x: hidden;
  overflow-y: auto;
  padding: 11px 18px 13px;
  color: var(--ava-text);
  background: var(--ava-surface);
  border: 0;
  border-bottom: 1px solid var(--ava-border);
  box-shadow: 0 5px 18px rgba(7,45,41,.07);
  transform: none;
  opacity: 1;
  z-index: 50;
}
.sidebar { display: none; }
.sidebar.is-open { display: block; }
.sidebar .module-nav,
.sidebar.is-open .module-nav {
  display: grid;
  grid-template-columns: repeat(12,minmax(88px,1fr));
  gap: 8px;
  overflow: visible;
  padding: 0;
}
.sidebar .nav-button {
  width: 100%;
  min-width: 0;
  min-height: 112px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin: 0;
  padding: 7px 5px 8px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--ava-text);
  text-align: center;
  background: transparent;
  box-shadow: none;
  transform: none;
}
.sidebar .nav-button:hover {
  border-color: var(--ava-border);
  color: var(--ava-primary);
  background: #F7F9F8;
  box-shadow: 0 5px 14px rgba(7,45,41,.07);
  transform: translateY(-1px);
}
.sidebar .nav-button.is-active {
  border: 1px solid rgba(201,149,61,.7);
  color: var(--ava-primary-dark);
  background: #FCF8EF;
  box-shadow: inset 0 -4px var(--ava-gold);
}
.sidebar .nav-button .module-icon {
  width: 78px;
  height: 74px;
  display: grid;
  place-items: center;
  overflow: visible;
  background: transparent;
}
.sidebar .nav-button .module-icon img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  object-position: center;
  filter: none;
  opacity: 1;
}
.sidebar .nav-button span:last-child {
  width: 100%;
  overflow: visible;
  color: inherit;
  font-size: 12px;
  font-weight: 720;
  line-height: 1.2;
  text-align: center;
  text-overflow: clip;
  white-space: normal;
}

.workspace {
  grid-area: workspace;
  min-width: 0;
  min-height: 0;
  overflow: auto;
}
.main-content { width: 100%; max-width: 1600px; margin: 0 auto; padding: 24px 26px 36px; }
.warehouse-error { margin: 0 0 14px; border-left: 5px solid var(--ava-error); }

@media (max-width: 1380px) {
  .topbar { grid-template-columns: minmax(160px,190px) minmax(175px,220px) minmax(225px,1fr) auto; padding-inline: 16px; }
  .topbar .connection-state, .topbar .clock { display: none; }
  .sidebar .module-nav, .sidebar.is-open .module-nav { grid-template-columns: repeat(12,minmax(78px,1fr)); gap: 5px; }
  .sidebar .nav-button .module-icon { width: 72px; height: 68px; }
}

@media (max-width: 1080px) {
  .topbar { grid-template-columns: minmax(150px,180px) minmax(170px,210px) minmax(210px,1fr) auto; gap: 9px; }
  .topbar .profile-copy, .header-logout span { display: none; }
  .topbar .profile-button { min-width: 42px; padding: 2px; }
  .header-logout { width: 42px; justify-content: center; padding: 0; }
  .sidebar, .sidebar.is-open { max-height: min(46dvh,360px); }
  .sidebar .module-nav, .sidebar.is-open .module-nav { grid-template-columns: repeat(6,minmax(110px,1fr)); gap: 8px; }
}

@media (max-width: 760px) {
  .app-shell { grid-template-rows: auto auto minmax(0,1fr); }
  .topbar {
    min-height: 132px;
    grid-template-columns: minmax(112px,150px) minmax(0,1fr) auto;
    grid-template-areas: "logo module account" "company company company";
    gap: 8px;
    padding: 8px 11px 10px;
  }
  .topbar-brand { height: 52px; }
  .topbar-brand-logo, .topbar-brand > img { width: 142px; height: 50px; display: block; }
  .topbar .approved-company-switch { width: 100%; min-height: 42px; }
  .header-module-switch { width: 100%; min-height: 50px; padding-right: 7px; }
  .header-module-switch > .module-icon { width: 52px; height: 44px; flex-basis: 52px; }
  .module-switch-copy small { display: none; }
  .module-switch-copy strong { max-width: 120px; font-size: 12px; }
  .notifications-button { width: 38px; height: 38px; flex-basis: 38px; }
  .topbar .profile-button { display: none; }
  .sidebar, .sidebar.is-open { position: relative; inset: auto; width: 100%; height: auto; max-height: 52dvh; padding: 9px 10px 11px; transform: none; }
  .sidebar .module-nav, .sidebar.is-open .module-nav { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 7px; }
  .sidebar .nav-button { min-height: 110px; }
  .sidebar .nav-button .module-icon { width: 76px; height: 72px; }
  .main-content { padding: 16px 12px 26px; }
}

@media (max-width: 480px) {
  .topbar { grid-template-columns: 116px minmax(0,1fr) auto; }
  .topbar-brand-logo, .topbar-brand > img { width: 112px; }
  .header-module-switch .module-switch-copy { display: none; }
  .header-module-switch { width: 64px; justify-self: start; }
  .sidebar .module-nav, .sidebar.is-open .module-nav { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

/* AVA 13.1 R3 · Estilo A definitivo · paleta azul e iconografía aprobada. */
:root {
  --ava-primary: #0B132B;
  --ava-primary-dark: #050914;
  --ava-secondary: #1C2541;
  --ava-slate: #3A506B;
  --ava-accent: #5BC0BE;
  --ava-accent-bright: #6FFFE9;
  --ava-bg: #F4F7FA;
  --ava-surface: #FFFFFF;
  --ava-text: #172033;
  --ava-muted: #607086;
  --ava-border: #D9E1E8;
  --navy: var(--ava-primary);
  --navy-2: var(--ava-secondary);
  --blue: var(--ava-slate);
  --blue-2: var(--ava-primary);
  --teal: var(--ava-accent);
  --bg: var(--ava-bg);
  --surface: var(--ava-surface);
  --surface-2: #F8FAFC;
  --border: var(--ava-border);
  --text: var(--ava-text);
  --muted: var(--ava-muted);
  --shadow: 0 12px 30px rgba(11,19,43,.09);
}

html, body { color: var(--ava-text); background: var(--ava-bg); }
body { font-size: 14px; }

.login-view { background: var(--ava-bg); }
.login-brand {
  background:
    radial-gradient(circle at 18% 20%, rgba(91,192,190,.20), transparent 38%),
    linear-gradient(145deg, var(--ava-primary-dark), var(--ava-primary) 56%, var(--ava-secondary));
  box-shadow: inset -6px 0 0 var(--ava-accent);
}
.login-brand .login-brand-copy .eyebrow { color: var(--ava-accent-bright); }
.login-brand .login-brand-copy > p:not(.eyebrow) { color: #DCE6F2; }
.login-card {
  border-color: var(--ava-border);
  border-radius: 14px;
  box-shadow: 0 18px 48px rgba(11,19,43,.13);
}
.login-card label, .screen-heading h1, .metric-copy strong, .kpi strong { color: var(--ava-primary); }
.eyebrow, .table-action, .evidence-link { color: var(--ava-slate); }
.login-input:focus-within,
input:focus,
select:focus,
textarea:focus {
  border-color: var(--ava-accent);
  box-shadow: 0 0 0 3px rgba(91,192,190,.18);
}

.button--primary {
  color: #fff;
  background: var(--ava-secondary);
  box-shadow: 0 4px 12px rgba(11,19,43,.18);
}
.button--primary:hover { background: var(--ava-primary); }
.button--secondary { color: var(--ava-secondary); background: #EAF1F4; }
.button--secondary:hover { color: var(--ava-primary); background: #DCEBED; }
.compact-button.is-active,
.tab-button.is-active,
.module-tab.is-active { color: #fff; border-color: var(--ava-secondary); background: var(--ava-secondary); }
.module-tabs { border-color: var(--ava-border); background: #EEF3F6; }
.module-tab { color: var(--ava-slate); }
.module-tab:hover { color: var(--ava-primary); background: #fff; }

.card, .filter-bar, .metric-card {
  border-color: var(--ava-border);
  border-radius: 9px;
  background: var(--ava-surface);
  box-shadow: 0 2px 8px rgba(11,19,43,.045);
}
.screen-heading h1 { font-size: clamp(23px,2vw,29px); }
.screen-heading p { color: var(--ava-muted); }
table thead th { color: var(--ava-slate); background: #F2F6F8; }
table tbody tr:hover { background: #F2F8F8; }
.dialog-header { background: linear-gradient(135deg,var(--ava-primary),var(--ava-secondary)); }
.callout { border-left-color: var(--ava-accent); color: var(--ava-primary); background: #EFF9F8; }
.metric-icon, .metric-icon--blue, .metric-icon--weight { color: var(--ava-secondary); background: #EAF0F5; }
.metric-card:nth-child(2) .metric-icon, .metric-icon--green, .metric-icon--packages { color: #287D7C; background: #E8F7F6; }
.metric-card:nth-child(3) .metric-icon, .metric-icon--amber, .metric-icon--pending { color: var(--ava-slate); background: #EDF2F6; }
.metric-card:nth-child(4) .metric-icon, .metric-icon--violet, .metric-icon--invoices { color: #25706F; background: #E7F5F4; }

.app-shell {
  min-height: 100dvh;
  height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0,1fr);
  grid-template-rows: 64px auto minmax(0,1fr);
  grid-template-areas: "topbar" "modules" "workspace";
  overflow: hidden;
  background: var(--ava-bg);
}

.topbar {
  grid-area: topbar;
  min-height: 64px;
  height: 64px;
  display: grid;
  grid-template-columns: 132px 40px 42px minmax(12px,1fr) auto;
  grid-template-areas: "logo company module spacer account";
  align-items: center;
  gap: 9px;
  padding: 7px 18px;
  color: #fff;
  background: var(--ava-primary);
  box-shadow: 0 3px 14px rgba(5,9,20,.20);
  z-index: 60;
}
.topbar-brand {
  grid-area: logo;
  width: 132px;
  height: 42px;
  display: flex;
  align-items: center;
  overflow: hidden;
}
.topbar-brand-logo,
.topbar-brand > img {
  width: 122px;
  height: 38px;
  display: block;
  object-fit: contain;
  object-position: left center;
}

.topbar .approved-company-switch {
  grid-area: company;
  width: 40px;
  min-width: 40px;
  height: 40px;
  min-height: 40px;
  display: grid;
  grid-template-columns: 1fr;
  place-items: center;
  margin: 0;
  padding: 0;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 8px;
  color: #fff;
  background: rgba(255,255,255,.06);
}
.topbar .approved-company-switch:hover { border-color: var(--ava-accent); background: rgba(91,192,190,.14); }
.topbar .approved-company-switch span {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}
.topbar .approved-company-switch svg { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.topbar .approved-company-switch .company-switch-icon { width: 21px; height: 21px; }
.topbar .approved-company-switch .company-switch-chevron { display: none; }

.header-module-switch {
  grid-area: module;
  width: 42px;
  min-width: 42px;
  max-width: 42px;
  min-height: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  margin: 0;
  padding: 5px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 8px;
  color: #fff;
  background: rgba(255,255,255,.05);
}
.header-module-switch:hover { border-color: var(--ava-accent); background: rgba(91,192,190,.14); }
.header-module-switch > .module-icon {
  width: 28px;
  height: 28px;
  flex: none;
  overflow: hidden;
  background: #fff;
  border-radius: 4px;
}
.header-module-switch > .module-icon img { width: 100%; height: 100%; object-fit: contain; filter: none; }
.header-module-switch .module-switch-copy,
.header-module-switch .module-switch-chevron { display: none; }

.topbar-right {
  grid-area: account;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}
.topbar .connection-state,
.topbar .clock { display: none; }
.notifications-button,
.topbar .profile-button,
.header-logout {
  min-height: 40px;
  border-color: rgba(255,255,255,.20);
  border-radius: 8px;
  background: rgba(255,255,255,.055);
}
.topbar .profile-button:hover,
.header-logout:hover,
.notifications-button:hover { border-color: rgba(111,255,233,.55); background: rgba(91,192,190,.13); }
.profile-avatar { color: var(--ava-primary); background: var(--ava-accent-bright); }

.sidebar,
.sidebar.is-open {
  grid-area: modules;
  position: relative;
  inset: auto;
  width: 100%;
  height: auto;
  max-height: 96px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 7px 14px 8px;
  color: var(--ava-text);
  background: #fff;
  border: 0;
  border-bottom: 1px solid var(--ava-border);
  box-shadow: 0 4px 12px rgba(11,19,43,.055);
  transform: none;
  opacity: 1;
  z-index: 50;
}
.sidebar { display: none; }
.sidebar.is-open { display: block; }
.sidebar .module-nav,
.sidebar.is-open .module-nav {
  min-width: 1080px;
  display: grid;
  grid-template-columns: repeat(12,minmax(82px,1fr));
  gap: 4px;
  overflow: visible;
  padding: 0;
}
.sidebar .nav-button {
  width: 100%;
  min-width: 0;
  min-height: 78px;
  height: 78px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin: 0;
  padding: 5px 4px 7px;
  border: 0;
  border-radius: 7px;
  color: var(--ava-text);
  text-align: center;
  background: transparent;
  box-shadow: inset 0 -3px transparent;
  transform: none;
}
.sidebar .nav-button:hover {
  border: 0;
  color: var(--ava-primary);
  background: #F1F7F8;
  box-shadow: inset 0 -3px rgba(91,192,190,.45);
  transform: none;
}
.sidebar .nav-button.is-active {
  border: 0;
  color: var(--ava-primary);
  background: rgba(91,192,190,.13);
  box-shadow: inset 0 -3px var(--ava-accent);
}
.sidebar .nav-button .module-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: transparent;
}
.sidebar .nav-button .module-icon img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  object-position: center;
  filter: none;
  opacity: 1;
}
.sidebar .nav-button span:last-child {
  width: 100%;
  min-height: 27px;
  display: grid;
  place-items: center;
  overflow: visible;
  color: inherit;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.15;
  text-align: center;
  white-space: normal;
}

.workspace { grid-area: workspace; min-width: 0; min-height: 0; overflow: auto; }
.main-content { width: 100%; max-width: 1600px; margin: 0 auto; padding: 20px 24px 34px; }

@media (max-width: 1080px) {
  .topbar { grid-template-columns: 116px 40px 42px minmax(8px,1fr) auto; padding-inline: 12px; }
  .topbar-brand { width: 116px; }
  .topbar-brand-logo, .topbar-brand > img { width: 108px; height: 36px; }
  .topbar .profile-copy, .header-logout span { display: none; }
  .topbar .profile-button { min-width: 40px; width: 40px; padding: 2px; }
  .header-logout { width: 40px; justify-content: center; padding: 0; }
}

@media (max-width: 760px) {
  .app-shell { grid-template-rows: 60px auto minmax(0,1fr); }
  .topbar {
    min-height: 60px;
    height: 60px;
    grid-template-columns: 104px 38px 40px minmax(4px,1fr) auto;
    grid-template-areas: "logo company module spacer account";
    gap: 6px;
    padding: 7px 9px;
  }
  .topbar-brand { width: 104px; height: 40px; }
  .topbar-brand-logo, .topbar-brand > img { width: 98px; height: 34px; }
  .topbar .approved-company-switch { width: 38px; min-width: 38px; height: 38px; min-height: 38px; }
  .header-module-switch { width: 40px; min-width: 40px; max-width: 40px; height: 38px; min-height: 38px; }
  .notifications-button { width: 38px; height: 38px; flex-basis: 38px; }
  .topbar .profile-button { display: none; }
  .sidebar, .sidebar.is-open { max-height: 250px; padding: 7px 9px 9px; overflow-y: auto; }
  .sidebar .module-nav, .sidebar.is-open .module-nav { min-width: 0; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 5px; }
  .sidebar .nav-button { min-height: 78px; height: 78px; }
  .sidebar .nav-button .module-icon { width: 32px; height: 32px; }
  .main-content { padding: 16px 12px 26px; }
}

@media (max-width: 480px) {
  .topbar { grid-template-columns: 96px 38px 40px minmax(0,1fr) 38px; }
  .topbar-brand { width: 96px; }
  .topbar-brand-logo, .topbar-brand > img { width: 90px; }
  .header-logout { width: 38px; }
  .sidebar .module-nav, .sidebar.is-open .module-nav { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

/* AVA 13.1 R3 · Corrección de fidelidad: navegación oscura e iconos monolineales aprobados. */
.sidebar,
.sidebar.is-open {
  max-height: 126px;
  padding: 7px 5px 4px;
  color: #fff;
  background: linear-gradient(90deg, var(--ava-secondary), var(--ava-primary));
  border-bottom-color: rgba(91,192,190,.45);
  box-shadow: 0 5px 16px rgba(5,9,20,.16);
  overflow-x: hidden;
}
.sidebar .module-nav,
.sidebar.is-open .module-nav {
  min-width: 0;
  grid-template-columns: repeat(12,minmax(0,1fr));
  gap: 0;
}
.sidebar .nav-button {
  min-height: 110px;
  height: 110px;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 5px;
  padding: 9px 3px 10px;
  color: rgba(255,255,255,.94);
  border-radius: 0;
  box-shadow: inset 0 -4px transparent;
}
.sidebar .nav-button:hover {
  color: #fff;
  background: rgba(91,192,190,.10);
  box-shadow: inset 0 -4px rgba(91,192,190,.48);
}
.sidebar .nav-button.is-active {
  color: var(--ava-accent-bright);
  background: rgba(91,192,190,.16);
  box-shadow: inset 0 -4px var(--ava-accent);
}
.sidebar .nav-button .module-icon {
  width: 58px;
  height: 58px;
  flex: 0 0 58px;
}
.sidebar .nav-button .module-icon img {
  filter: none;
}
.sidebar .nav-button.is-active .module-icon img {
  filter: none;
}
.sidebar .nav-button span:last-child {
  width: 100%;
  min-height: 27px;
  display: block;
  color: inherit;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.08;
  text-align: center;
  white-space: normal;
}
.header-module-switch > .module-icon { background: transparent; }

@media (max-width: 760px) {
  .sidebar,
  .sidebar.is-open { max-height: 52dvh; padding: 6px 8px 8px; overflow-x: hidden; overflow-y: auto; }
  .sidebar .module-nav,
  .sidebar.is-open .module-nav { min-width: 0; }
  .sidebar .nav-button { min-height: 99px; height: 99px; padding: 7px 3px 8px; }
  .sidebar .nav-button .module-icon { width: 48px; height: 48px; flex-basis: 48px; }
  .sidebar .nav-button span:last-child { font-size: 11.25px; }
}

/* AVA 13.1 R3 · Tipografía profesional optimizada para Windows. */
:root {
  font-family: "Segoe UI Variable Text", "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  font-optical-sizing: auto;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}
body, button, input, select, textarea { font-family: inherit; }
body { font-weight: 400; letter-spacing: -.006em; }
h1, h2, h3, .screen-heading h1, .login-card h2 {
  font-family: "Segoe UI Variable Display", "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif;
  font-weight: 650;
  letter-spacing: -.026em;
}
.screen-heading p, .muted { letter-spacing: 0; }
.button, .module-tab, .tab-button, .compact-button { font-weight: 650; letter-spacing: -.008em; }
.sidebar .nav-button span:last-child {
  font-family: "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif;
  font-size: 11.25px;
  font-weight: 620;
  letter-spacing: -.012em;
  line-height: 1.16;
}
.profile-copy strong { font-weight: 650; letter-spacing: -.01em; }
.profile-copy small, .eyebrow, table thead th { letter-spacing: .015em; }
table { font-variant-numeric: tabular-nums; }
table thead th { font-weight: 650; }
table tbody td { font-weight: 430; }
.metric-copy span { font-weight: 620; letter-spacing: .018em; }
.metric-copy strong, .kpi strong { font-weight: 670; letter-spacing: -.02em; }

@media (max-width: 760px) {
  .sidebar .nav-button span:last-child { font-size: 10.5px; font-weight: 620; }
}

/* Inter se distribuye localmente para que AVA conserve la misma tipografía sin Internet. */
@font-face {
  font-family: "Inter AVA";
  src: url("/assets/fonts/InterVariable.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}
:root {
  font-family: "Inter AVA", "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif;
}
body {
  font-size: 15px;
  line-height: 1.42;
  letter-spacing: -.004em;
}
h1, h2, h3, .screen-heading h1, .login-card h2 {
  font-family: "Inter AVA", "Segoe UI Variable Display", "Segoe UI", system-ui, sans-serif;
}
.screen-heading p { font-size: 14.5px; line-height: 1.45; }
label { font-size: 13px; line-height: 1.3; }
input, select, textarea { font-size: 14px; }
.button { font-size: 13.5px; }
.module-tab, .tab-button, .compact-button { font-size: 13px; }
.sidebar .nav-button span:last-child {
  font-family: "Inter AVA", "Segoe UI", system-ui, sans-serif;
  font-size: 12px;
  font-weight: 590;
  line-height: 1.22;
}
.profile-copy strong { font-size: 13.5px; }
.profile-copy small { font-size: 11.5px; }
table { font-size: 13.5px; line-height: 1.38; }
table thead th { font-size: 12.5px; }
.metric-copy span { font-size: 12.5px; line-height: 1.2; }
.metric-copy strong { font-size: 22px; }
.card h2, .card h3 { line-height: 1.3; }
.muted, .helper, .field-help { font-size: 13px; line-height: 1.45; }

@media (max-width: 760px) {
  body { font-size: 14.5px; }
  .sidebar .nav-button span:last-child { font-size: 11.25px; }
  table { font-size: 13px; }
}
/* AVA 13.1 - workspaces operativos compactos */
.statement-filters{display:grid;grid-template-columns:minmax(180px,.9fr) minmax(260px,1.8fr) minmax(180px,.8fr) minmax(150px,.7fr) minmax(150px,.7fr) auto;gap:14px;align-items:end;padding:16px}
.statement-currency-metrics{display:grid;grid-template-columns:repeat(auto-fit,minmax(520px,1fr));gap:16px;margin:16px 0}
.statement-currency-group{background:#fff;border:1px solid var(--border);border-radius:14px;padding:14px;box-shadow:0 5px 18px rgba(11,19,43,.06)}
.statement-currency-group>header{display:flex;align-items:center;gap:10px;margin-bottom:12px}.statement-currency-group>header strong{display:grid;place-items:center;min-width:48px;height:32px;border-radius:9px;background:#0b132b;color:#fff;font-size:15px}.statement-currency-group>header span{color:var(--muted);font-size:12px}
.statement-metric-row,.statement-detail-metrics{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}.statement-metric{min-height:86px;padding:12px;display:flex;align-items:center;gap:11px;overflow:hidden}.statement-metric .metric-copy strong{font-size:clamp(16px,1.35vw,22px);white-space:nowrap}
.statement-icon,.statement-metric-icon{width:38px;height:38px;flex:0 0 38px;border-radius:10px;background:#e8f8f7;position:relative}.statement-icon:after,.statement-metric-icon:after{content:"";position:absolute;inset:8px;background:#159c9a;mask:center/contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='black' stroke-width='1.7'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M2.25 18.75a60.07 60.07 0 0115.797 2.101c.727.198 1.453-.342 1.453-1.096V18M3.75 4.5v.75A.75.75 0 013 6h-.75m0 0v-.375c0-.621.504-1.125 1.125-1.125H20.25M2.25 6v9m18-10.5v.75c0 .414.336.75.75.75h.75m-1.5-1.5h.375c.621 0 1.125.504 1.125 1.125V15m0 0h-.75a.75.75 0 00-.75.75v.75m1.5-1.5h-18m0 0h-.75a.75.75 0 01-.75-.75v-.75m1.5 1.5v1.5m0 0v.375c0 .621.504 1.125 1.125 1.125h1.5m13.5-1.5v.375c0 .621-.504 1.125-1.125 1.125h-1.5m-9-7.5h6m-3-3v6'/%3E%3C/svg%3E")}.statement-metric-icon--alert{background:#fff2e2}.statement-metric-icon--alert:after{background:#d97706}.statement-metric-icon--payment{background:#eaf8ef}.statement-metric-icon--payment:after{background:#16834f}.statement-metric-icon--users{background:#eef1ff}.statement-metric-icon--users:after{background:#5264c9}.currency-badge{display:inline-grid;place-items:center;min-width:42px;padding:5px 8px;border-radius:8px;background:#0b132b;color:#fff;font-weight:800}.statement-portfolio .card-header p{margin:3px 0 0;color:var(--muted);font-size:12px}.statement-table tbody tr{cursor:pointer}.statement-table tbody tr:hover{background:#f1fbfb}

.warehouse-filter-bar{display:grid;grid-template-columns:minmax(180px,.8fr) minmax(320px,2fr) minmax(200px,.8fr) auto;gap:14px;align-items:end}.warehouse-metric{position:relative;padding-left:68px;text-align:left;min-height:92px}.warehouse-metric:before{content:"";position:absolute;left:16px;top:50%;translate:0 -50%;width:40px;height:40px;border-radius:11px;background:#e7f8f7}.warehouse-metric:after{content:"";position:absolute;left:25px;top:50%;translate:0 -50%;width:22px;height:22px;background:#159c9a;mask:center/contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='black' stroke-width='1.7'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M21 8.25c0-.621-.504-1.125-1.125-1.125H4.125C3.504 7.125 3 7.629 3 8.25m18 0v8.25A2.25 2.25 0 0118.75 18.75H5.25A2.25 2.25 0 013 16.5V8.25m18 0V6a2.25 2.25 0 00-2.25-2.25H5.25A2.25 2.25 0 003 6v2.25m6 3.75h6'/%3E%3C/svg%3E")}.warehouse-invoice-summary{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}.warehouse-invoice-summary>div{min-height:76px;padding:12px 14px!important;border-radius:12px!important}.warehouse-invoice-summary span{font-size:11px;letter-spacing:.04em}.warehouse-invoice-summary strong{font-size:18px}.dialog__body .warehouse-invoice-summary+.table-wrap{max-height:260px}.dialog__body #warehouse-delivery-form{background:#f8fafc;border:1px solid var(--border);border-radius:14px;padding:15px;gap:12px}.dialog__body #warehouse-delivery-form textarea{min-height:74px}.dialog__body #delivery-evidence{background:#fff}

.agency-invoice-detail{display:flex!important;flex-direction:column;gap:12px}.agency-invoice-detail>.warehouse-invoice-summary{order:1;grid-template-columns:repeat(6,minmax(0,1fr))}.agency-invoice-detail>.warehouse-invoice-summary>div{min-height:62px;padding:9px 11px!important}.agency-invoice-detail>.warehouse-invoice-summary strong{font-size:15px}.agency-invoice-search{order:2;margin:0!important;padding:10px 12px}.agency-invoice-items{order:3;max-height:390px;min-height:230px}.agency-invoice-parties{order:4;gap:10px}.agency-invoice-parties>.card{padding:12px}.agency-invoice-parties .detail-list p{margin:3px 0;font-size:12px}.agency-invoice-detail>.inline-alert{order:5}.agency-invoice-detail>.invoice-preview-total{order:6}.agency-reception-packages-table{min-height:240px;max-height:430px}.package-source-owner{grid-column:1/-1;display:flex;flex-direction:column;gap:4px;padding:12px 14px;border:1px solid #72d5d1;border-left:4px solid #159c9a;border-radius:10px;background:#f0fbfa}.package-source-owner span{font-size:11px;font-weight:800;color:#55708c}.package-source-owner strong{font-size:18px}.package-source-owner small{color:#53657a}.package-owner-search{margin-bottom:8px}.agency-packages-table{min-height:420px;max-height:62vh}.agency-package-filters{position:sticky;top:0;z-index:3;background:#fff;box-shadow:0 5px 18px rgba(11,19,43,.06)}
@media(max-width:1100px){.statement-filters{grid-template-columns:repeat(2,minmax(0,1fr))}.statement-currency-metrics{grid-template-columns:1fr}.statement-metric-row,.statement-detail-metrics{grid-template-columns:repeat(2,minmax(0,1fr))}.warehouse-filter-bar{grid-template-columns:1fr 1fr}.agency-invoice-detail>.warehouse-invoice-summary{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:680px){.statement-filters,.warehouse-filter-bar{grid-template-columns:1fr}.statement-metric-row,.statement-detail-metrics,.warehouse-invoice-summary{grid-template-columns:1fr 1fr!important}}

/* Salida del almacén · ventana de entrega de alto volumen */
.warehouse-delivery-workspace{display:flex;flex-direction:column;gap:12px;color:#17233a}
.delivery-summary-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}
.delivery-summary-card{display:flex;align-items:center;gap:14px;min-height:76px;padding:12px 15px;border:1px solid #d9e2ec;border-radius:12px;background:#fff;box-shadow:0 2px 8px rgba(11,19,43,.035)}
.delivery-summary-card>div{display:flex;flex-direction:column;gap:2px}.delivery-summary-card strong{font-size:21px;line-height:1.1;color:#111c34}.delivery-summary-card>div>span{font-size:13px;color:#475569}
.delivery-summary-icon{display:grid;place-items:center;width:46px;height:46px;flex:0 0 46px;border-radius:10px}.delivery-summary-icon svg{width:27px;height:27px}
.delivery-summary-card--blue .delivery-summary-icon{color:#1677e8;background:#eaf3ff}.delivery-summary-card--green .delivery-summary-icon{color:#16885b;background:#e9f8f0}.delivery-summary-card--amber .delivery-summary-icon{color:#e47700;background:#fff4e7}.delivery-summary-card--violet .delivery-summary-icon{color:#6546d7;background:#f1edff}
.delivery-package-panel{overflow:hidden;border:1px solid #d6e0ea;border-radius:12px;background:#fff}
.delivery-table-toolbar{display:grid;grid-template-columns:minmax(260px,1.35fr) minmax(180px,.65fr) auto minmax(150px,auto);gap:10px;align-items:center;padding:10px 12px;border-bottom:1px solid #dce4ed;background:#fff}
.delivery-search,.delivery-status-filter{position:relative;display:flex;align-items:center}.delivery-search input,.delivery-status-filter select{width:100%;height:42px;padding-left:40px;border-color:#d5dee8;background:#fff}.delivery-control-icon{position:absolute;left:13px;z-index:1;display:grid;color:#65758b;pointer-events:none}.delivery-control-icon svg{width:18px;height:18px}
.delivery-select-all{display:inline-flex;align-items:center;gap:8px;height:42px;white-space:nowrap}.delivery-select-all svg{width:19px;height:19px}.delivery-selection-count{font-size:13px;color:#11275d;white-space:nowrap}
.delivery-packages-table{height:clamp(250px,35vh,390px);max-height:none;overflow:auto;background:#fff}
.delivery-packages-table table{min-width:1380px;width:100%;font-size:13px}.delivery-packages-table thead{position:sticky;top:0;z-index:2}.delivery-packages-table th{height:40px;padding:8px 11px;white-space:nowrap;background:#f3f6f9;color:#23436c;text-transform:none;letter-spacing:0}.delivery-packages-table td{height:38px;padding:7px 11px;white-space:nowrap;border-bottom:1px solid #e5ebf1}.delivery-packages-table td:nth-child(3){min-width:220px;white-space:normal}.delivery-packages-table td:nth-child(4){min-width:150px}.delivery-packages-table tr.is-selected{background:#f1f7ff}.delivery-packages-table tbody tr:hover{background:#edf6ff}.delivery-check-column{width:42px;text-align:center!important}.delivery-check-column input{width:17px;height:17px;accent-color:#1677e8}
.delivery-status{display:inline-flex;align-items:center;gap:6px;padding:4px 9px;border-radius:999px;font-size:12px;font-weight:700}.delivery-status:before{content:"";width:6px;height:6px;border-radius:50%;background:currentColor}.delivery-status--available{color:#147a4c;background:#eaf8f0}.delivery-status--held{color:#b66300;background:#fff2df}.delivery-status--delivered{color:#4e6076;background:#edf1f5}
.delivery-table-footer{display:grid;grid-template-columns:1fr auto auto;align-items:center;gap:18px;min-height:44px;padding:6px 12px;border-top:1px solid #dce4ed;color:#465870;font-size:12px}.delivery-table-footer>label{display:flex;align-items:center;gap:7px}.delivery-table-footer select{height:32px;padding:4px 30px 4px 9px}
.delivery-pagination{display:flex;align-items:center;gap:4px}.delivery-pagination button{display:grid;place-items:center;min-width:31px;height:31px;padding:0 8px;border:1px solid transparent;border-radius:7px;background:transparent;color:#32445c;cursor:pointer}.delivery-pagination button:hover:not(:disabled){background:#eef5ff}.delivery-pagination button.is-active{border-color:#8cbcff;background:#edf5ff;color:#075fc7;font-weight:800}.delivery-pagination button:disabled{opacity:.35;cursor:not-allowed}
.dialog__body #warehouse-delivery-form.warehouse-delivery-form{display:flex;flex-direction:column;gap:10px;padding:0;border:0;border-radius:0;background:#fff}
.delivery-form-heading{display:flex;align-items:center;gap:10px;padding-top:3px}.delivery-form-heading>span{display:grid;place-items:center;width:32px;height:32px;border-radius:9px;color:#1677e8;background:#eaf3ff}.delivery-form-heading svg{width:20px;height:20px}.delivery-form-heading h3{margin:0;font-size:16px;color:#173264}.delivery-form-heading p{margin:2px 0 0;font-size:12px;color:#66758a}
.delivery-primary-fields{display:grid;grid-template-columns:minmax(190px,.9fr) minmax(260px,1.25fr) minmax(220px,1fr) minmax(220px,1fr);gap:11px}.delivery-secondary-fields{display:grid;grid-template-columns:minmax(320px,1.15fr) minmax(430px,1.55fr);gap:11px;align-items:stretch}
.warehouse-delivery-form .field{min-width:0}.warehouse-delivery-form .field>span:first-child{font-size:11px}.warehouse-delivery-form input,.warehouse-delivery-form select{height:42px}.dialog__body #warehouse-delivery-form.warehouse-delivery-form textarea{min-height:66px;height:66px;resize:vertical}
.delivery-evidence-drop{position:relative}.dialog__body #warehouse-delivery-form.warehouse-delivery-form #delivery-evidence{position:absolute;width:1px;height:1px;opacity:0;pointer-events:none}.delivery-evidence-content{display:flex!important;align-items:center;justify-content:center;gap:12px;height:66px;padding:8px 13px;border:1.5px dashed #aebdcd;border-radius:9px;background:#fbfcfe;color:#1d5fd0;cursor:pointer;text-transform:none!important;letter-spacing:0!important}.delivery-evidence-content:hover{border-color:#3889e8;background:#f5f9ff}.delivery-evidence-content>svg{width:28px;height:28px;flex:0 0 28px}.delivery-evidence-content>span{display:flex;min-width:0;flex-direction:column;gap:2px}.delivery-evidence-content strong{overflow:hidden;color:#263751;font-size:11px;text-overflow:ellipsis;white-space:nowrap}.delivery-evidence-content small{overflow:hidden;color:#65758b;font-size:10px;font-weight:500;text-overflow:ellipsis;white-space:nowrap}
.delivery-sticky-actions{position:sticky;bottom:-16px;z-index:4;display:flex;align-items:center;justify-content:space-between;gap:18px;margin:2px -16px -16px;padding:11px 16px;border-top:1px solid #dbe3ec;background:rgba(255,255,255,.97);box-shadow:0 -8px 20px rgba(11,19,43,.05);backdrop-filter:blur(8px)}.delivery-sticky-actions>div:last-child{display:flex;gap:9px;flex:0 0 auto}.delivery-sticky-actions .button{height:42px}.delivery-sticky-actions .button--success{display:inline-flex;align-items:center;gap:8px;padding-inline:18px}.delivery-sticky-actions .button--success svg{width:20px;height:20px}.delivery-finance-note{display:flex;align-items:center;gap:9px;min-width:0;color:#35465c;font-size:12px}.delivery-finance-note svg{width:20px;height:20px;flex:0 0 20px;color:#1677e8}
@media(max-width:1200px){.delivery-primary-fields{grid-template-columns:repeat(3,minmax(0,1fr))}.delivery-secondary-fields{grid-template-columns:repeat(2,minmax(0,1fr))}.delivery-evidence-drop{grid-column:1/-1}.delivery-table-toolbar{grid-template-columns:1fr 1fr}.delivery-summary-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:720px){.delivery-summary-grid,.delivery-primary-fields,.delivery-secondary-fields,.delivery-table-toolbar{grid-template-columns:1fr}.delivery-table-footer{grid-template-columns:1fr}.delivery-sticky-actions{align-items:stretch;flex-direction:column}.delivery-sticky-actions>div:last-child{justify-content:flex-end}.delivery-selection-count{white-space:normal}}

/* Flujos operativos: entrega, factura recibida y bodega de agencia. */
.delivery-evidence-list{display:flex;flex-wrap:wrap;gap:7px;margin-top:7px}.delivery-evidence-list small{color:#64748b}.delivery-evidence-list .table-action{max-width:360px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.agency-invoice-detail>.agency-invoice-items{min-height:360px;max-height:calc(100vh - 350px)}
.owner-similar-label{display:block;margin-top:3px;color:#936000;font-size:10px;font-weight:800}.agency-invoice-selection{display:flex!important;align-items:center;gap:7px}.agency-invoice-selection svg{width:20px;height:20px;flex:0 0 20px}.package-source-owner{margin:0}.package-source-owner+label small{margin-top:5px;color:#64748b}
@media(max-width:1350px){.agency-package-filters{grid-template-columns:repeat(3,minmax(210px,1fr))}.agency-package-filters .button{min-width:0}}

/* Ventanas de trabajo maximizables en todos los módulos */
.dialog-layer.has-maximized-dialog{padding:0;background:rgba(7,25,42,.3)}
.dialog{transition:width .18s ease,height .18s ease,max-height .18s ease,border-radius .18s ease}
.dialog.dialog--maximized{--dialog-target:100vw;width:100vw;max-width:100vw;height:100dvh;max-height:100dvh;border-width:0;border-radius:0}
.dialog.dialog--maximized .dialog-body{height:100%;max-height:none}
.dialog-header{cursor:default;user-select:none}.dialog-header>div:first-child{min-width:0;flex:1}.dialog-header h2,.dialog-header p{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.dialog-window-controls{display:flex;align-items:center;gap:7px;flex:0 0 auto}
.dialog-maximize,.dialog-window-controls .dialog-close{display:grid;place-items:center;width:36px;height:36px;padding:0;border:1px solid rgba(255,255,255,.14);border-radius:8px;color:#fff;background:rgba(255,255,255,.1);cursor:pointer;transition:background .15s ease,border-color .15s ease}
.dialog-maximize:hover,.dialog-window-controls .dialog-close:hover{border-color:rgba(255,255,255,.3);background:rgba(255,255,255,.2)}.dialog-maximize:focus-visible,.dialog-window-controls .dialog-close:focus-visible{outline:2px solid #6fffe9;outline-offset:2px}.dialog-maximize svg{width:19px;height:19px}.dialog-window-controls .dialog-close{font-size:24px;line-height:1}
@media(max-width:520px){.dialog-maximize,.dialog-window-controls .dialog-close{width:34px;height:34px}.dialog-header{gap:9px}.dialog-header p{max-width:55vw}}

/* Iconografía semántica automática para todas las tarjetas informativas */
.auto-card-icon{display:grid;place-items:center;width:42px;height:42px;flex:0 0 42px;border-radius:11px;color:#267d7b;background:#e8f7f6}.auto-card-icon svg{width:23px;height:23px}
.auto-card-icon--package{color:#1677e8;background:#eaf3ff}.auto-card-icon--money{color:#6546d7;background:#f1edff}.auto-card-icon--user{color:#167b61;background:#e8f7f0}.auto-card-icon--clock{color:#d46f00;background:#fff2e3}.auto-card-icon--check{color:#16834f;background:#e9f8f0}.auto-card-icon--warning{color:#c34c3c;background:#fff0ed}.auto-card-icon--building{color:#236d91;background:#e9f5fa}.auto-card-icon--document{color:#3166bb;background:#edf3ff}.auto-card-icon--shield{color:#2c7380;background:#e8f5f7}.auto-card-icon--chart{color:#5264c9;background:#eef1ff}
.metric-card.has-auto-card-icon{grid-template-columns:46px minmax(0,1fr)}
.warehouse-invoice-summary>div.has-auto-card-icon,.aging-grid>div.has-auto-card-icon{position:relative;justify-content:center;min-height:76px;padding-left:66px!important}.warehouse-invoice-summary>div.has-auto-card-icon>.auto-card-icon,.aging-grid>div.has-auto-card-icon>.auto-card-icon{position:absolute;left:13px;top:50%;translate:0 -50%}
.agency-invoice-detail>.warehouse-invoice-summary>div.has-auto-card-icon{min-height:66px;padding-left:58px!important}.agency-invoice-detail>.warehouse-invoice-summary>div.has-auto-card-icon>.auto-card-icon{left:10px;width:36px;height:36px}.agency-invoice-detail>.warehouse-invoice-summary>div.has-auto-card-icon>.auto-card-icon svg{width:20px;height:20px}

/* Visor documental: página completa, zoom y ajuste responsivo */
.dialog-body.document-preview-dialog-body{display:grid;grid-template-rows:minmax(0,1fr) auto;gap:10px;height:calc(100dvh - 110px);min-height:0;overflow:hidden}
.document-preview-shell{display:grid;grid-template-rows:auto minmax(0,1fr);min-height:0;overflow:hidden;border:1px solid #d7e0e9;border-radius:11px;background:#e3e8ed}
.document-preview-toolbar{display:flex;align-items:center;justify-content:center;gap:9px;min-height:48px;padding:6px 12px;border-bottom:1px solid #d4dde7;background:#f7f9fb;box-shadow:0 2px 8px rgba(11,19,43,.04)}
.document-preview-toolbar button{display:grid;place-items:center;width:36px;height:36px;padding:0;border:1px solid #d4dee8;border-radius:8px;color:#20314a;background:#fff;font-size:21px;font-weight:700;cursor:pointer}.document-preview-toolbar button:hover{border-color:#87b7dd;background:#eef7fd}.document-preview-toolbar select{width:auto;min-width:154px;height:36px;padding:5px 34px 5px 12px;border-color:#d4dee8;background-color:#fff;font-weight:700}.document-preview-toolbar output{min-width:52px;color:#2c3e57;font-size:12px;font-weight:800;text-align:center}
.document-preview-dialog-body .invoice-document-preview{height:auto;min-height:0;overflow:hidden;border:0;border-radius:0;background:#e3e8ed}.document-preview-dialog-body .document-preview-pages{align-content:safe center;justify-content:center;width:100%;height:100%;min-height:0;padding:14px;overflow:auto;background:#e3e8ed}.document-preview-dialog-body .document-preview-loading{height:100%;min-height:240px}.document-preview-dialog-body .document-preview-page{flex:none;max-width:none;box-shadow:0 5px 22px rgba(11,19,43,.2)}
.document-preview-actions{flex:0 0 auto;margin:0;padding-top:10px}
.dialog.dialog--maximized .dialog-body.document-preview-dialog-body{height:auto}
@media(max-width:720px){.dialog-body.document-preview-dialog-body{height:calc(100dvh - 88px);padding:8px}.document-preview-toolbar{justify-content:flex-start;overflow-x:auto}.document-preview-toolbar select{min-width:140px}.document-preview-dialog-body .document-preview-pages{padding:8px}}

/* Estados de cuenta · densidad profesional e iconos sólidos */
.statement-filters{grid-template-columns:minmax(190px,.85fr) minmax(300px,1.8fr) minmax(170px,.72fr) minmax(145px,.62fr) minmax(145px,.62fr) auto;gap:9px;padding:10px 12px;margin-bottom:10px}
.statement-filters .field{gap:4px}.statement-filters .field>span{font-size:10.5px}.statement-filters input,.statement-filters select,.statement-filters .button{height:38px;min-height:38px;padding-top:6px;padding-bottom:6px}.statement-filters .button{padding-inline:14px}
.statement-currency-metrics{grid-template-columns:repeat(auto-fit,minmax(460px,1fr));gap:10px;margin:10px 0 12px}.statement-currency-group{padding:9px 10px;border-radius:11px}.statement-currency-group>header{gap:8px;margin-bottom:7px}.statement-currency-group>header strong{min-width:44px;height:28px;border-radius:7px;font-size:13px}.statement-currency-group>header span{font-size:11px}
.statement-metric-row,.statement-detail-metrics{gap:7px}.statement-metric{min-height:62px;padding:8px 9px;gap:8px;border-radius:9px}.statement-metric .metric-copy{gap:2px;overflow:visible}.statement-metric .metric-copy span{font-size:10.5px;line-height:1.08}.statement-metric .metric-copy strong{overflow:visible;text-overflow:clip;font-size:clamp(13px,.92vw,17px);line-height:1.1;letter-spacing:-.035em;white-space:nowrap}
.statement-icon{display:grid;place-items:center;width:32px;height:32px;flex:0 0 32px;border-radius:9px;color:#167f91;background:#e7f7f8}.statement-icon:after{display:none!important}.statement-icon svg{display:block;width:19px;height:19px}.statement-icon--alert{color:#d97706;background:#fff2df}.statement-icon--payment{color:#16834f;background:#e8f7ef}.statement-icon--users{color:#6546d7;background:#f0edff}.statement-icon--refresh{color:#2d6fc5;background:#eaf3ff}
#statement-refresh .statement-icon{width:22px;height:22px;flex-basis:22px;border-radius:6px;background:rgba(255,255,255,.16);color:#fff}#statement-refresh .statement-icon svg{width:14px;height:14px}
.statement-portfolio{padding-top:12px}.statement-portfolio .card-header{margin-bottom:8px}.statement-table th,.statement-table td{padding-top:8px;padding-bottom:8px}
@media(max-width:1250px){.statement-filters{grid-template-columns:repeat(3,minmax(0,1fr))}.statement-currency-metrics{grid-template-columns:1fr}.statement-metric .metric-copy strong{font-size:16px}}
@media(max-width:720px){.statement-filters{grid-template-columns:1fr}.statement-metric-row,.statement-detail-metrics{grid-template-columns:repeat(2,minmax(0,1fr))}}

/* Estados de cuenta: registro profesional de facturas y aislamiento visible por empresa. */
.statement-filters{grid-template-columns:minmax(180px,.8fr) minmax(270px,1.45fr) minmax(155px,.7fr) minmax(170px,.78fr) minmax(135px,.58fr) minmax(135px,.58fr) auto}
.statement-metric-row{grid-template-columns:repeat(5,minmax(0,1fr))}
.statement-invoices{margin-bottom:12px;overflow:hidden}.statement-invoices .card-header,.statement-client-invoices .card-header{align-items:flex-start}.statement-invoices .card-header p,.statement-client-invoices .card-header p{margin:3px 0 0;color:var(--muted);font-size:12px}
.statement-invoices .scroll-panel{max-height:430px}.statement-invoice-ledger{min-width:2380px}.statement-invoice-ledger th,.statement-invoice-ledger td{white-space:nowrap}.statement-invoice-ledger td:nth-child(2){min-width:210px;white-space:normal}
.statement-client-invoices{display:grid;gap:8px;padding-top:4px}.statement-client-invoices table{min-width:1700px}.statement-client-invoices th,.statement-client-invoices td{white-space:nowrap}
@media(max-width:1380px){.statement-filters{grid-template-columns:repeat(4,minmax(0,1fr))}.statement-metric-row{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:820px){.statement-filters{grid-template-columns:repeat(2,minmax(0,1fr))}.statement-metric-row{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:520px){.statement-filters,.statement-metric-row{grid-template-columns:1fr}}

/* Servidor: telemetría PostgreSQL obtenida en tiempo real. */
.server-health-grid{display:grid;grid-template-columns:repeat(4,minmax(180px,1fr));gap:10px;margin-top:10px}.server-health-grid .kpi{display:flex;min-width:0;min-height:100px;flex-direction:column;align-items:flex-start;justify-content:center;padding:13px 15px;text-align:left}.server-health-grid .kpi span{font-size:11px;font-weight:750;letter-spacing:.025em;text-transform:uppercase}.server-health-grid .kpi strong{font-size:22px;line-height:1.15}.server-health-grid .kpi small{margin-top:4px;color:var(--muted);font-size:11px;line-height:1.3}.server-health-grid .kpi:nth-child(5),.server-health-grid .kpi:nth-child(6){border-left:3px solid #16834f}.server-health-grid .kpi:nth-child(9){border-left:3px solid #d97706}
.server-admin-workspace{gap:12px}.server-admin-workspace .card-header p,.server-technical-reset-card p{margin:3px 0 0;color:var(--muted);font-size:12px;line-height:1.45}.server-volume-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(270px,1fr));gap:10px}.server-volume{display:grid;gap:8px;padding:13px 14px;border:1px solid var(--border);border-radius:10px;background:var(--surface-2)}.server-volume>div:first-child{display:flex;align-items:flex-start;justify-content:space-between;gap:10px}.server-volume>div:first-child span{color:var(--muted);font-size:11px;font-weight:800}.server-volume p{margin:0;color:var(--muted);font-size:12px}.server-volume-meter{height:8px;overflow:hidden;border-radius:999px;background:#dce5ee}.server-volume-meter i{display:block;height:100%;border-radius:inherit;background:#218a67}.server-volume--warning{border-color:#b97013}.server-volume--warning .server-volume-meter i{background:#b97013}.server-volume--critical{border-color:#c8443b}.server-volume--critical .server-volume-meter i{background:#c8443b}.server-admin-table{max-height:330px;margin-top:9px}.server-admin-table table{min-width:920px}.server-admin-table small{color:var(--muted)}.server-policy-form{align-items:end;margin-bottom:10px;padding:12px;border:1px solid var(--border);border-radius:10px;background:var(--surface-2)}.server-policy-form .settings-form-actions{align-items:flex-end;justify-content:flex-end;padding:0}.server-technical-reset-card{display:flex;align-items:center;justify-content:space-between;gap:20px;border-left:4px solid #b97013}.server-technical-reset-card>div{min-width:0}.server-technical-reset-card .button{flex:0 0 auto}.status--success{color:#147a4c;background:#eaf8f0}.status--danger{color:#b42318;background:#fdeceb}
.inline-alert--success{border-color:#4fae80;background:#edf9f3;color:#145c3c}.inline-alert--warning{border-color:#d59a42;background:#fff7e8;color:#6f470b}
.server-backup-import{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:var(--ava-space-3);align-items:center;padding:var(--ava-space-4);border:1px solid var(--ava-border);border-radius:var(--ava-radius-card);background:var(--surface-2)}.server-backup-import-copy{min-width:0}.server-backup-import-copy p{margin:var(--ava-space-1) 0 0;color:var(--ava-text-secondary);font-size:var(--ava-font-sm);line-height:18px}.server-backup-import-actions{display:flex;align-items:center;justify-content:flex-end;gap:var(--ava-space-2);flex-wrap:wrap}.server-backup-import-selection,.server-backup-import-progress{grid-column:1/-1}.server-backup-import-selection{display:flex;align-items:center;justify-content:space-between;gap:var(--ava-space-3);min-width:0;padding:var(--ava-space-2) var(--ava-space-3);border:1px dashed var(--ava-border);border-radius:var(--ava-radius-input);color:var(--ava-text-secondary);background:var(--ava-surface);font-size:var(--ava-font-sm)}.server-backup-import-selection strong{min-width:0;overflow:hidden;color:var(--ava-text-primary);text-overflow:ellipsis;white-space:nowrap}.server-backup-import-selection span{flex:0 0 auto}.server-backup-import-selection--danger{border-color:var(--ava-danger);color:var(--ava-danger-dark);background:var(--ava-danger-soft)}.server-backup-import-progress{display:grid;gap:var(--ava-space-2)}.server-backup-import-progress>div{display:flex;justify-content:space-between;gap:var(--ava-space-3);font-size:var(--ava-font-sm)}.server-backup-import-progress progress{width:100%;height:9px;border:0;border-radius:var(--ava-radius-pill);overflow:hidden;accent-color:var(--ava-interactive);background:var(--ava-border)}.server-backup-import-progress progress::-webkit-progress-bar{background:var(--ava-border)}.server-backup-import-progress progress::-webkit-progress-value{background:var(--ava-interactive)}.server-backup-import-progress progress::-moz-progress-bar{background:var(--ava-interactive)}.server-backup-import-progress--danger{color:var(--ava-danger-dark)}.server-backup-import-progress--danger progress{accent-color:var(--ava-danger)}.server-backup-import-progress--danger progress::-webkit-progress-value{background:var(--ava-danger)}.server-backup-import-progress--danger progress::-moz-progress-bar{background:var(--ava-danger)}
@media(max-width:760px){.server-backup-import{grid-template-columns:1fr}.server-backup-import-actions{justify-content:flex-start}.server-backup-import-selection{align-items:flex-start;flex-direction:column}.server-backup-import-selection span{flex:initial}}
@media(max-width:1100px){.server-health-grid{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:720px){.server-health-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.server-technical-reset-card{align-items:stretch;flex-direction:column}.server-technical-reset-card .button{width:100%}}
@media(max-width:460px){.server-health-grid{grid-template-columns:1fr}}

/* Estados de cuenta: ampliación real del espacio de trabajo. */
.statement-expand-button{display:inline-flex;align-items:center;gap:7px}
.statement-expand-button .statement-icon{width:22px;height:22px;flex-basis:22px;border-radius:6px}
.statement-expand-button .statement-icon svg{width:14px;height:14px}
body.statement-focus-mode{overflow:hidden}
body.statement-focus-mode #app-shell{position:fixed;inset:0;z-index:900;display:grid;grid-template-areas:"workspace";grid-template-columns:1fr;grid-template-rows:minmax(0,1fr);background:#f4f7fa}
body.statement-focus-mode .topbar,
body.statement-focus-mode .sidebar{display:none!important}
body.statement-focus-mode .workspace{grid-area:workspace;height:100dvh;overflow:hidden}
body.statement-focus-mode #main-content{display:grid;width:100%;height:100dvh;max-width:none;grid-template-rows:auto auto minmax(0,1.2fr) minmax(0,.8fr);gap:7px;padding:8px 10px;overflow:hidden}
body.statement-focus-mode .statement-heading{margin:0;align-items:center}
body.statement-focus-mode .statement-heading h1{font-size:19px}
body.statement-focus-mode .statement-heading p{font-size:11px}
body.statement-focus-mode .statement-filters{margin:0;padding:7px 9px;gap:6px}
body.statement-focus-mode .statement-filters input,
body.statement-focus-mode .statement-filters select,
body.statement-focus-mode .statement-filters .button{height:32px;min-height:32px;font-size:11px}
body.statement-focus-mode .statement-currency-metrics{display:none}
body.statement-focus-mode .statement-invoices,
body.statement-focus-mode .statement-portfolio{display:grid;min-height:0;grid-template-rows:auto minmax(0,1fr);margin:0;padding:8px;overflow:hidden}
body.statement-focus-mode .statement-invoices .card-header,
body.statement-focus-mode .statement-portfolio .card-header{min-height:28px;margin-bottom:5px}
body.statement-focus-mode .statement-invoices .card-header h2,
body.statement-focus-mode .statement-portfolio .card-header h2{font-size:14px}
body.statement-focus-mode .statement-invoices .card-header p,
body.statement-focus-mode .statement-portfolio .card-header p{font-size:10px}
body.statement-focus-mode .statement-invoices .scroll-panel,
body.statement-focus-mode .statement-portfolio .scroll-panel{height:100%;max-height:none;min-height:0}
body.statement-focus-mode .statement-table th,
body.statement-focus-mode .statement-table td{padding:5px 7px;font-size:10.5px}
@media(max-width:760px){body.statement-focus-mode #main-content{grid-template-rows:auto auto minmax(260px,1fr) minmax(220px,.8fr);overflow:auto}body.statement-focus-mode .statement-invoices,body.statement-focus-mode .statement-portfolio{min-height:260px}}

/* Vistas de facturación de alta densidad */
body.billing-focus-mode{overflow:hidden}
body.billing-focus-mode #app-shell{position:fixed;inset:0;z-index:900;display:grid;grid-template-areas:"workspace";grid-template-columns:1fr;grid-template-rows:minmax(0,1fr);background:#f4f7fa}
body.billing-focus-mode .topbar,body.billing-focus-mode .sidebar{display:none!important}
body.billing-focus-mode .workspace{grid-area:workspace;height:100dvh;overflow:hidden}
body.billing-focus-mode #main-content{display:grid;width:100%;height:100dvh;max-width:none;grid-template-rows:auto auto minmax(0,1fr);gap:7px;padding:8px 10px;overflow:hidden}
body.billing-focus-mode .screen-heading{margin:0}
body.billing-focus-mode .screen-heading h1{font-size:19px}
body.billing-focus-mode .screen-heading p{font-size:11px}
body.billing-focus-mode #billing-panel{display:grid;grid-template-rows:auto minmax(0,1fr);gap:7px;min-height:0}
body.billing-focus-mode .billing-filter-bar{margin:0;padding:7px 9px;gap:6px;grid-template-columns:minmax(220px,1.5fr) minmax(150px,.8fr) minmax(220px,1.2fr) minmax(125px,.65fr) minmax(125px,.65fr) auto}
body.billing-focus-mode .billing-filter-bar input,body.billing-focus-mode .billing-filter-bar select,body.billing-focus-mode .billing-filter-bar .button{height:32px;min-height:32px;font-size:11px}
body.billing-focus-mode .billing-list-card{display:grid;grid-template-rows:auto minmax(0,1fr);min-height:0;margin:0;padding:8px;overflow:hidden}
body.billing-focus-mode .billing-list-card .billing-document-table{height:100%;max-height:none;min-height:0;overflow:auto}
body.billing-focus-mode .billing-list-card th,body.billing-focus-mode .billing-list-card td{padding:6px 7px;font-size:10.5px}
body.billing-focus-mode #ar-metrics{display:none}

.billing-receipts-dialog{display:grid;grid-template-rows:auto minmax(0,1fr) auto;height:calc(100dvh - 120px);min-height:0;gap:8px}
.billing-receipts-filter--single-line{display:grid;grid-template-columns:minmax(240px,1.6fr) minmax(140px,.7fr) minmax(120px,.55fr) minmax(140px,.65fr) minmax(140px,.65fr) auto;align-items:end;gap:8px;margin:0;padding:9px}
.billing-receipts-filter--single-line .button{height:40px}
.billing-receipts-dialog .billing-receipts-table{height:100%;min-height:0;overflow:auto}
.billing-payment-layout{align-items:start}
.billing-receipt-form-card .card-header{align-items:center}
@media(max-width:900px){.billing-receipts-filter--single-line{grid-template-columns:1fr 1fr}.billing-receipts-dialog{height:auto;min-height:70dvh}body.billing-focus-mode #main-content{overflow:auto}}

/* Casos de garantía: panel estable y trazabilidad navegable */
.warranty-step{font:inherit;text-align:left;cursor:pointer}
.incident-case-dialog textarea{resize:none}
.incident-case-dialog .incident-case-grid{align-items:start}
.incident-case-dialog .incident-case-main,.incident-case-dialog .incident-management-panel{overflow:visible}
.incident-history{display:grid;gap:7px;margin-bottom:10px}
.incident-history-card{display:grid;gap:3px;padding:9px 11px;border:1px solid #d9e5e2;border-left:4px solid #16866d;border-radius:8px;background:#f8fbfa;transition:box-shadow .2s,border-color .2s}
.incident-history-card span{font-size:10px;font-weight:800;color:#55716b}
.incident-history-card strong{font-size:12px}
.incident-history-card p{margin:0;font-size:10.5px;color:#536b66;line-height:1.35}
.incident-history-card--danger{border-left-color:#cf3f46}
.incident-history-card.is-highlighted{border-color:#22a891;box-shadow:0 0 0 3px rgba(34,168,145,.18)}

/* Reporte de paquetes: ventana estable sin barras visibles ni saltos al escribir */
.dialog-body.incident-case-dialog-body{height:100%;padding:0;overflow:hidden}
.incident-case-dialog{display:flex;width:100%;height:100%;min-height:0;margin:0;flex-direction:column;overflow:hidden}
.incident-case-dialog>.incident-summary-strip,.incident-case-dialog>.warranty-progress{flex:0 0 auto}
.incident-case-dialog>.warranty-progress{margin:10px 12px 0}
.incident-case-dialog>.incident-case-grid{flex:1 1 auto;min-height:0;margin:0;padding:10px 12px 12px;overflow:hidden}
.incident-case-dialog .incident-case-main,.incident-case-dialog .incident-management-panel{height:100%;min-height:0;max-height:100%;overflow-x:hidden;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:none}
.incident-case-dialog .incident-case-main::-webkit-scrollbar,.incident-case-dialog .incident-management-panel::-webkit-scrollbar{display:none;width:0;height:0}
.incident-case-dialog .incident-summary-strip{padding-top:11px;padding-bottom:11px}
.incident-case-dialog .incident-evidence-section,.incident-case-dialog .incident-activity{padding:11px 13px}
.incident-case-dialog .incident-management-panel{padding:12px}
.incident-case-dialog .incident-history{gap:5px;margin-bottom:7px}
.incident-case-dialog .incident-history-card{padding:7px 9px}
.incident-case-dialog .dialog-form textarea{min-height:62px}
.warranty-study-form{display:grid;align-content:start;gap:11px;min-width:0}
.warranty-study-form h3,.warranty-study-form p{margin:0}
.warranty-study-values{display:grid;grid-template-columns:minmax(0,1.3fr) minmax(135px,.7fr);align-items:end;gap:12px;min-width:0}
.warranty-study-values>.field{grid-column:auto!important;min-width:0;width:100%}
.warranty-beneficiary{display:grid;gap:2px;padding:10px 12px;border:1px solid #d9e8e4;border-radius:8px;background:#f4faf8;color:#47635d;font-size:11px;line-height:1.4}
.warranty-beneficiary strong{color:#173f37;font-size:12px}
.warranty-beneficiary small{color:#607b75}
@media(max-width:900px){.dialog-body.incident-case-dialog-body{overflow:auto}.incident-case-dialog{height:auto;overflow:visible}.incident-case-dialog>.incident-case-grid{overflow:visible}.incident-case-dialog .incident-case-main,.incident-case-dialog .incident-management-panel{height:auto;max-height:none;overflow:visible}}
@media(max-width:580px){.warranty-study-values{grid-template-columns:1fr}}

/* Facturación ampliada: una sola fila operativa, sin controles secundarios. */
body.billing-focus-mode #invoices-filter,
body.billing-focus-mode #ar-filter{display:grid;grid-template-columns:minmax(320px,1.55fr) minmax(180px,.55fr) minmax(280px,1fr);align-items:end}
body.billing-focus-mode #invoices-filter>.field,
body.billing-focus-mode #ar-filter>.field{grid-column:auto!important;min-width:0}
body.billing-focus-mode #invoices-filter .billing-filter-search,
body.billing-focus-mode #ar-filter .billing-filter-search{order:1}
body.billing-focus-mode #invoices-filter .billing-filter-status,
body.billing-focus-mode #ar-filter .billing-filter-status{order:2}
body.billing-focus-mode #invoices-filter .billing-filter-client,
body.billing-focus-mode #ar-filter .billing-filter-client{order:3}
body.billing-focus-mode #invoices-filter .billing-filter-date,
body.billing-focus-mode #invoices-filter .filter-actions,
body.billing-focus-mode #ar-filter .billing-filter-currency,
body.billing-focus-mode #ar-filter .filter-actions,
body.billing-focus-mode #ar-filter .billing-advanced-filters,
body.billing-focus-mode #ar-filter .billing-filter-footer{display:none!important}

/* Recibos: historial de pantalla completa que aprovecha todo el espacio. */
.dialog.dialog--receipts{height:min(880px,calc(100dvh - 40px));max-height:calc(100dvh - 40px)}
.dialog.dialog--receipts.dialog--maximized{height:100dvh;max-height:100dvh}
.dialog-body.billing-receipts-dialog-body{height:100%;min-height:0;padding:10px;overflow:hidden}
.billing-receipts-dialog{display:grid;width:100%;height:100%;min-height:0;grid-template-rows:auto minmax(0,1fr) auto;gap:8px}
.billing-receipts-filter--single-line{display:grid;grid-template-columns:minmax(340px,1.55fr) minmax(180px,.55fr) minmax(280px,1fr);align-items:end;gap:8px;margin:0;padding:8px 10px}
.billing-receipts-filter--single-line>.field{grid-column:auto!important;min-width:0}
.billing-receipts-dialog .billing-receipts-table{width:100%;height:100%;min-height:0;max-height:none;overflow-x:hidden;overflow-y:auto}
.billing-receipts-dialog .billing-receipts-table table{width:100%;min-width:0;table-layout:fixed}
.billing-receipts-dialog .billing-receipts-table th,
.billing-receipts-dialog .billing-receipts-table td{padding:8px 7px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:11px}
.billing-receipts-dialog .billing-receipts-table th:nth-child(1){width:12%}
.billing-receipts-dialog .billing-receipts-table th:nth-child(2){width:14%}
.billing-receipts-dialog .billing-receipts-table th:nth-child(3){width:11%}
.billing-receipts-dialog .billing-receipts-table th:nth-child(4){width:9%}
.billing-receipts-dialog .billing-receipts-table th:nth-child(5){width:10%}
.billing-receipts-dialog .billing-receipts-table th:nth-child(6),
.billing-receipts-dialog .billing-receipts-table th:nth-child(7),
.billing-receipts-dialog .billing-receipts-table th:nth-child(8){width:10%}
.billing-receipts-dialog .billing-receipts-table th:nth-child(9){width:8%}
.billing-receipts-dialog .billing-receipts-table th:nth-child(10){width:12%}
.billing-receipts-dialog .billing-selection-bar{margin:0}

/* Reportes: la ventana controla su propio alto sin barras externas. */
.dialog.dialog--incident-case{height:min(860px,calc(100dvh - 40px));max-height:calc(100dvh - 40px)}
.dialog.dialog--incident-case.dialog--maximized{height:100dvh;max-height:100dvh}

/* Ampliar vista: único botón destacado, con el diseño aprobado en verde. */
.view-expand-button:not(:disabled){display:inline-flex;min-height:44px;align-items:center;justify-content:center;gap:10px;padding:7px 17px;border:1px solid #16805d;border-radius:12px;color:#fff;background:linear-gradient(135deg,#22a878,#137253);box-shadow:0 6px 15px rgba(19,114,83,.22);font-weight:800}
.view-expand-button:not(:disabled):hover{color:#fff;background:linear-gradient(135deg,#1c976c,#0f6247);box-shadow:0 8px 18px rgba(19,114,83,.28);transform:translateY(-1px)}
.view-expand-button:not(:disabled):active{transform:translateY(0)}
.view-expand-button .view-expand-icon,
.view-expand-button .statement-icon{display:grid;width:30px;height:30px;flex:0 0 30px;place-items:center;border-radius:8px;color:#0d6650;background:#dff8ef}
.view-expand-button .view-expand-icon svg,
.view-expand-button .statement-icon svg{width:18px;height:18px}
.view-expand-button>span:last-child{color:#fff!important;text-shadow:0 1px 1px rgba(0,0,0,.12)}
@media(max-width:900px){body.billing-focus-mode #invoices-filter,body.billing-focus-mode #ar-filter,.billing-receipts-filter--single-line{grid-template-columns:1fr}.dialog-body.billing-receipts-dialog-body{overflow:auto}.billing-receipts-dialog{height:auto;min-height:75dvh}.billing-receipts-dialog .billing-receipts-table{min-height:420px;overflow:auto}.billing-receipts-dialog .billing-receipts-table table{min-width:900px}}
/* Digitación multimodal: selector y área de captura compacta */
.entry-mode-selector{border:0;margin:0;padding:0;min-inline-size:0}.entry-mode-selector legend{font-size:.74rem;font-weight:800;color:var(--muted);letter-spacing:.035em;margin-bottom:.55rem}.entry-mode-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:.65rem}.entry-mode-card{position:relative;display:grid;grid-template-columns:2.6rem 1fr auto;align-items:center;gap:.7rem;min-height:5.35rem;padding:.8rem;border:1px solid var(--border);border-radius:.75rem;background:#fff;cursor:pointer;transition:border-color .16s,box-shadow .16s,transform .16s}.entry-mode-card:hover{border-color:#67b9ae;transform:translateY(-1px)}.entry-mode-card.is-selected{border-color:#16866c;box-shadow:0 0 0 2px rgba(22,134,108,.12);background:#f3fbf8}.entry-mode-card input{position:absolute;opacity:0;pointer-events:none}.entry-mode-icon{display:grid;place-items:center;width:2.6rem;height:2.6rem;border-radius:.65rem;color:#147c68;background:#e3f5ef}.entry-mode-icon svg,.kpi-mode-icon svg{width:1.55rem;height:1.55rem}.entry-mode-card strong,.entry-mode-card small{display:block}.entry-mode-card strong{font-size:.88rem;color:var(--ink)}.entry-mode-card small{margin-top:.2rem;font-size:.71rem;line-height:1.25;color:var(--muted)}.entry-mode-check{display:grid;place-items:center;width:1.25rem;height:1.25rem;border-radius:50%;font-size:.72rem;font-weight:900;color:#fff;background:#16866c;opacity:0}.entry-mode-card.is-selected .entry-mode-check{opacity:1}.work-banner{grid-template-columns:repeat(5,minmax(0,1fr));padding:.7rem 1rem}.work-banner-item{min-height:auto}.work-banner-mode strong{color:#16866c}.digitization-kpi-row{grid-template-columns:repeat(4,minmax(0,1fr));gap:.55rem}.digitization-kpi{position:relative;min-height:4.15rem;padding:.65rem .8rem}.digitization-kpi:first-child{padding-left:3.2rem}.kpi-mode-icon{position:absolute;left:.75rem;top:50%;display:grid;place-items:center;width:2rem;height:2rem;border-radius:.5rem;transform:translateY(-50%);color:#147c68;background:#e3f5ef}.calculated-field output{display:flex;align-items:center;min-height:2.65rem;padding:.65rem .8rem;border:1px solid #b9d8d2;border-radius:.5rem;background:#f1faf7;color:#0d5f50;font-weight:800}.calculated-field small{display:block;margin-top:.2rem;color:var(--muted)}.finalize-work-summary{display:grid;grid-template-columns:1fr;gap:.5rem}.finalize-work-summary div{display:flex;justify-content:space-between;gap:1rem;padding:.65rem .75rem;border:1px solid var(--border);border-radius:.55rem;background:#f7fafb}.finalize-work-summary span{font-size:.7rem;font-weight:800;color:var(--muted)}.finalize-work-summary strong{font-size:.84rem;text-align:right}.field-help{font-size:.74rem;color:var(--muted)}
@media(max-width:1100px){.entry-mode-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.work-banner{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:680px){.entry-mode-grid,.digitization-kpi-row,.work-banner{grid-template-columns:1fr}.entry-mode-card{min-height:4.5rem}}
@media(max-width:900px){.digitization-guide-bar .toolbar{align-items:stretch}.digitization-guide-list{min-width:100%}.digitization-guide-add{width:100%;flex-wrap:wrap}.digitization-guide-add .field{flex:1;min-width:200px}.digitization-guide-add .button{flex:1}}
.entry-mode-badge{display:inline-flex;align-items:center;white-space:nowrap;padding:.25rem .5rem;border-radius:999px;background:#e3f5ef;color:#106b59;font-size:.68rem;font-weight:800}.callout--error{border-color:#df6a6a!important;background:#fff2f2!important;color:#9c2e2e!important}.digitization-kpi{display:flex;flex-direction:column;justify-content:center;overflow:visible}.digitization-kpi>span:not(.kpi-mode-icon),.digitization-kpi>strong{position:relative;z-index:1}

/* Listados operativos: paginación compacta y estable. */
.list-pagination{display:grid;grid-template-columns:minmax(180px,1fr) auto minmax(110px,auto);align-items:center;gap:12px;padding:9px 10px;border-top:1px solid var(--border);background:#f8fafc;color:var(--muted);font-size:11px}
.list-pagination nav{display:flex;align-items:center;justify-content:center;gap:8px}.list-pagination nav strong{min-width:110px;text-align:center;color:var(--ink)}
.list-pagination button{display:grid;place-items:center;width:32px;height:30px;padding:0;border:1px solid var(--border);border-radius:7px;background:#fff;color:var(--ink);font-size:18px;cursor:pointer}.list-pagination button:hover:not(:disabled){border-color:#65afa2;background:#eef9f6}.list-pagination button:disabled{opacity:.35;cursor:not-allowed}
.list-pagination label{display:flex;align-items:center;justify-content:flex-end;gap:7px}.list-pagination select{width:68px;height:30px;padding:3px 24px 3px 8px}

/* Facturas: los cinco filtros y la acción ocupan una fila amplia o dos filas compactas. */
.billing-filter-bar>.field,.billing-filter-bar>.filter-actions{grid-column:auto!important;min-width:0}
.billing-filter-bar .filter-actions .button{width:100%;min-width:126px}
@media(max-width:1280px) and (min-width:761px){.billing-filter-bar,.billing-filter-bar--drafts{grid-template-columns:repeat(3,minmax(170px,1fr))}}

/* Cierre consolidado: evita títulos, valores y botones recortados. */
.finalize-work-summary{min-width:0}.finalize-work-summary div{align-items:center}.finalize-work-summary strong{min-width:0;overflow-wrap:anywhere;word-break:break-word}
.dialog--medium .finalize-work-summary+.field{min-width:0}.dialog--medium .dialog-actions{flex-wrap:wrap}.dialog--medium .dialog-actions .button{min-width:150px}
@media(max-width:620px){.list-pagination{grid-template-columns:1fr}.list-pagination>span,.list-pagination label{justify-content:center;text-align:center}}

/* Dashboard operativo R3: mantiene la navegación y los tokens oficiales de AVA. */
.dashboard-organization{display:inline-flex;align-items:center;min-height:38px;padding:0 13px;border:1px solid var(--border);border-radius:9px;background:var(--surface);color:var(--ava-secondary);font-size:12px;font-weight:800}
.dashboard-filter-bar{width:100%;grid-template-columns:repeat(4,minmax(160px,1fr));align-items:end}
.dashboard-kpi-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:11px;margin-bottom:12px}
.dashboard-kpi{display:grid;grid-template-columns:44px minmax(0,1fr) 18px;align-items:center;gap:12px;min-width:0;min-height:116px;padding:14px;border:1px solid var(--border);border-radius:12px;background:var(--surface);color:var(--ava-primary);text-align:left;box-shadow:0 4px 14px rgba(11,19,43,.045);transition:border-color .16s ease,box-shadow .16s ease,translate .16s ease}
.dashboard-kpi:not(:disabled){cursor:pointer}.dashboard-kpi:not(:disabled):hover{border-color:var(--ava-accent);box-shadow:0 8px 22px rgba(11,19,43,.09);translate:0 -1px}.dashboard-kpi:disabled{cursor:default;opacity:1}
.dashboard-kpi .metric-icon{width:44px;height:44px;flex:0 0 44px}.metric-icon--processing{color:#3A506B;background:#edf2f6}.metric-icon--delivery{color:#287d7c;background:#e8f7f6}.metric-icon--alert{color:#b5473f;background:#fdeceb}
.dashboard-kpi-copy{display:flex;flex-direction:column;min-width:0;gap:3px}.dashboard-kpi-copy>span:first-child{color:var(--muted);font-size:11px;font-weight:800;letter-spacing:.035em;text-transform:uppercase}.dashboard-kpi-copy>strong,.dashboard-money-stack strong{color:var(--ava-primary);font-size:clamp(18px,1.65vw,25px);line-height:1.12;white-space:nowrap}.dashboard-money-stack{display:flex;flex-wrap:wrap;gap:3px 10px}.dashboard-money-stack strong{font-size:clamp(16px,1.35vw,22px)}.dashboard-kpi-details{display:grid;gap:1px;min-width:0}.dashboard-kpi-details small{overflow:hidden;color:var(--muted);font-size:10px;line-height:1.3;text-overflow:ellipsis;white-space:nowrap}.dashboard-kpi-open{color:var(--muted);font-size:26px;font-weight:500;line-height:1;transition:translate .16s ease}.dashboard-kpi:not(:disabled):hover .dashboard-kpi-open{translate:3px 0}
.dashboard-analytics-grid{display:grid;grid-template-columns:minmax(0,1.55fr) minmax(320px,.85fr);gap:12px;margin-bottom:12px}.dashboard-chart-card{min-width:0}.dashboard-chart-card .card-header p,.dashboard-work-grid .card-header p,.dashboard-detail-grid .card-header p{margin:3px 0 0;color:var(--muted);font-size:11px}.dashboard-chart{min-height:248px}.dashboard-chart svg{display:block;width:100%;height:220px}.dashboard-chart-grid{stroke:#e4eaf0;stroke-width:1}.dashboard-chart-axis,.dashboard-chart-month{fill:#617188;font-size:11px}.dashboard-chart-month{text-transform:capitalize}.dashboard-chart-legend{display:flex;align-items:center;justify-content:center;gap:18px;margin-top:-4px;color:var(--muted);font-size:11px;font-weight:700}.dashboard-chart-legend span{display:inline-flex;align-items:center;gap:6px}.dashboard-chart-legend i,.dashboard-status-legend i{width:9px;height:9px;border-radius:3px}
.dashboard-donut-layout{display:grid;grid-template-columns:minmax(150px,.8fr) minmax(170px,1fr);align-items:center;gap:12px;min-height:248px}.dashboard-donut{display:grid;place-items:center}.dashboard-donut svg{width:min(190px,100%)}.dashboard-donut-total{fill:var(--ava-primary);font-size:25px;font-weight:850}.dashboard-donut-caption{fill:var(--muted);font-size:10px}.dashboard-status-legend{display:grid;gap:8px}.dashboard-status-legend>div{display:flex;align-items:center;justify-content:space-between;gap:12px;padding-bottom:7px;border-bottom:1px solid #edf1f4}.dashboard-status-legend span{display:flex;align-items:center;gap:8px;color:var(--muted);font-size:12px}.dashboard-status-legend strong{color:var(--ava-primary);font-size:14px}
.dashboard-work-grid{display:grid;gap:12px;margin-bottom:12px}.dashboard-work-grid--single{grid-template-columns:minmax(0,1fr)}.dashboard-work-grid>.card,.dashboard-detail-grid>.card{min-width:0;height:100%}.dashboard-compact-table table{min-width:520px;font-size:12px}.dashboard-compact-table table th,.dashboard-compact-table table td{padding:7px 8px}
.dashboard-detail-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.dashboard-detail-grid--balanced>.card{min-width:0}.dashboard-distribution{display:grid;grid-template-columns:1fr 1fr;gap:18px}.dashboard-distribution-group h3{margin:0 0 10px;font-size:12px}.dashboard-distribution-group>div{display:grid;grid-template-columns:minmax(90px,1fr) minmax(70px,1.4fr) 32px;align-items:center;gap:8px;margin:8px 0}.dashboard-distribution-group span{overflow:hidden;color:var(--muted);font-size:10px;text-overflow:ellipsis;white-space:nowrap}.dashboard-distribution-group b{display:block;height:7px;overflow:hidden;border-radius:99px;background:#e8edf2}.dashboard-distribution-group b i{display:block;height:100%;border-radius:inherit;background:linear-gradient(90deg,var(--ava-secondary),var(--ava-accent))}.dashboard-distribution-group strong{text-align:right;font-size:11px}
.dashboard-error{display:flex;align-items:center;gap:10px;margin-bottom:12px;padding:11px 13px;border:1px solid #efb9b4;border-left:4px solid var(--ava-error);border-radius:9px;background:#fff3f2;color:var(--ava-primary)}.dashboard-error span{flex:1;color:#8f3732;font-size:12px}.dashboard-skeleton{position:relative;overflow:hidden;border-radius:10px;background:#eaf0f4}.dashboard-skeleton:after{content:"";position:absolute;inset:0;translate:-100% 0;background:linear-gradient(90deg,transparent,rgba(255,255,255,.8),transparent);animation:dashboard-shimmer 1.25s infinite}.dashboard-skeleton--kpi{min-height:102px}.dashboard-skeleton--panel{min-height:180px}@keyframes dashboard-shimmer{to{translate:100% 0}}
@media(max-width:1240px){.dashboard-kpi-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:900px){.dashboard-filter-bar{grid-template-columns:repeat(2,minmax(0,1fr))}.dashboard-analytics-grid,.dashboard-detail-grid{grid-template-columns:1fr}.dashboard-work-grid{grid-template-columns:1fr}.dashboard-donut-layout{grid-template-columns:1fr 1fr}}
@media(max-width:620px){.dashboard-kpi-grid,.dashboard-filter-bar{grid-template-columns:1fr}.dashboard-donut-layout,.dashboard-distribution{grid-template-columns:1fr}.dashboard-organization{display:none}}

/* La navegacion aprobada conserva una sola fila desplazable en pantallas estrechas. */
@media(max-width:760px){
  .sidebar,.sidebar.is-open{max-height:108px;overflow-x:auto;overflow-y:hidden;overscroll-behavior-inline:contain;scrollbar-width:none}
  .sidebar::-webkit-scrollbar,.sidebar.is-open::-webkit-scrollbar{display:none}
  .sidebar .module-nav,.sidebar.is-open .module-nav{width:max-content;min-width:max-content;grid-template-columns:repeat(12,92px);gap:2px}
  .sidebar .nav-button{width:92px;min-height:92px;height:92px;padding:6px 3px 7px}
  .sidebar .nav-button .module-icon{width:42px;height:42px;flex-basis:42px}
  .sidebar .nav-button span:last-child{font-size:10px;line-height:1.08}
}

/* Facturacion R3 · registros creados en Digitacion pendientes por facturar. */
.billing-pending-record-filters{display:grid;grid-template-columns:minmax(260px,1.4fr) minmax(260px,1.2fr) minmax(150px,.55fr) minmax(190px,.75fr) auto;align-items:end;gap:10px}
.billing-pending-record-filters>.button{min-height:40px}
#pending-record-table table{min-width:1320px}
#pending-record-table td:first-child strong{display:block;white-space:nowrap}
#pending-record-table .table-secondary{display:block;margin-top:2px;color:var(--muted);font-size:10px}
#pending-record-table td:last-child{width:132px;white-space:nowrap}
@media(max-width:1280px){.billing-pending-record-filters{grid-template-columns:minmax(260px,1.4fr) minmax(260px,1.2fr) repeat(2,minmax(160px,.7fr))}.billing-pending-record-filters>.button{grid-column:1/-1;justify-self:end}}
@media(max-width:820px){.billing-pending-record-filters{grid-template-columns:1fr}.billing-pending-record-filters>.button{grid-column:auto;width:100%}}

/* Configuración · Diseño de factura en una sola área de trabajo.
   La representación visual real se abre con el visor PDF interno de AVA. */
.invoice-design-single{display:block;width:100%;min-width:0}
.invoice-design-card{width:100%;max-width:none;min-width:0}
.invoice-design-card>.card-header{align-items:flex-start;padding-bottom:var(--ava-space-3);border-bottom:1px solid var(--ava-border)}
.invoice-design-card>.card-header p{max-width:760px;margin:var(--ava-space-1) 0 0;color:var(--ava-text-secondary);font-size:var(--ava-font-sm);line-height:1.45}
.invoice-design-logo-panel{justify-content:flex-start;gap:var(--ava-space-4);margin-top:var(--ava-space-4);padding:var(--ava-space-3);border:1px solid var(--ava-border);border-radius:var(--ava-radius-card);background:var(--ava-background)}
.invoice-design-logo-panel .logo-preview{flex:0 0 240px;min-height:120px;background:var(--ava-surface)}
.invoice-design-card #invoice-design-form{margin-top:var(--ava-space-4)}
.invoice-design-actions{justify-content:flex-end;gap:var(--ava-space-2);padding-top:var(--ava-space-4);border-top:1px solid var(--ava-border)}
.invoice-preview-button{display:inline-flex;align-items:center;gap:var(--ava-space-2)}
.invoice-preview-button svg{flex:0 0 auto}
@media(max-width:720px){.invoice-design-logo-panel{align-items:stretch;flex-direction:column}.invoice-design-logo-panel .logo-preview{width:100%;flex-basis:auto}.invoice-design-actions{align-items:stretch;flex-direction:column}.invoice-design-actions .button{width:100%}}

/* Correcciones controladas de identidad, acceso y densidad operativa. */
.login-access-panel{position:relative;isolation:isolate;overflow:hidden}
.login-card-stage{position:relative;width:min(430px,100%);isolation:isolate}
.login-card-stage .login-card{width:100%}
.login-card{position:relative;z-index:2}
.login-guard{position:absolute;z-index:1;right:calc(100% - 22px);left:auto;top:50%;width:clamp(220px,24vw,330px);pointer-events:none;opacity:0;transform:translate(42%,-50%);transition:opacity .35s ease,transform 1.1s cubic-bezier(.18,.8,.24,1)}
.login-guard img{display:block;width:100%;height:auto;filter:drop-shadow(0 18px 28px rgba(5,18,45,.22))}
.login-view.has-login-error .login-guard{opacity:1;transform:translate(0,-50%)}
.login-brand-logo{width:min(520px,82%);height:auto;min-height:150px}
.login-brand-logo img{width:100%;height:auto;max-height:170px;object-fit:contain;object-position:left center}
@media(prefers-reduced-motion:reduce){.login-guard{transition:opacity .15s ease}.login-view.has-login-error .login-guard{transform:translate(0,-50%)}}
@media(max-width:860px){.login-guard{right:calc(100% - 86px);left:auto;width:clamp(160px,30vw,230px)}.login-brand-logo{width:min(440px,88%)} }

/* Navegación superior: iconos SVG blancos, uniformes y con el activo indicado por fondo. */
.module-bar,.module-bar.is-open{color:#fff;background:var(--ava-primary);border-bottom-color:rgba(255,255,255,.12)}
.module-bar .nav-button{color:#fff;background:transparent}
.module-bar .nav-button:hover{color:#fff;background:rgba(255,255,255,.09)}
.module-bar .nav-button.is-active{color:#fff;background:rgba(91,192,190,.18);box-shadow:inset 0 -3px #6fffe9}
.module-bar .nav-button .module-icon{width:36px;height:36px;flex:0 0 36px;background:transparent}
.module-bar .nav-button .module-icon img{width:32px;height:32px;object-fit:contain;filter:brightness(0) invert(1);opacity:1}
.module-bar .nav-button.is-active .module-icon img{filter:brightness(0) invert(1)}
.module-bar .nav-button span:last-child{color:#fff}

/* Condiciones del paquete: una fila compacta, alineada y sin controles sobredimensionados. */
.quick-incident-panel{display:grid;grid-template-columns:minmax(0,1fr);align-items:start;gap:6px;padding:10px 12px}
.quick-incident-title{display:block;min-width:0}
.quick-incident-panel>.quick-incident-options{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));align-items:center;gap:8px;width:100%;min-width:0;margin:0;flex-direction:initial}
.quick-incident-panel label{display:inline-flex;align-items:center;justify-content:center;min-height:32px;gap:7px;padding:4px 7px;border-radius:7px;white-space:nowrap}
.quick-incident-panel label input[type="checkbox"]{width:18px;height:18px;min-width:18px;margin:0}
.quick-incident-panel>.button{justify-self:center;min-height:36px}
.quick-incident-help{display:block;color:#64748b;font-size:12px;line-height:1.35}
@media(max-width:1050px){.quick-incident-panel>.quick-incident-options{align-items:start}}
@media(max-width:560px){.quick-incident-panel>.quick-incident-options{grid-template-columns:repeat(auto-fit,minmax(125px,1fr));gap:4px}.quick-incident-panel label{justify-content:flex-start;min-width:0;gap:5px;padding-inline:4px;font-size:11px;white-space:normal}.quick-incident-panel>.button{width:min(100%,220px)}}

.client-rate-cell--readonly{align-content:center;min-height:48px;background:#f8fafc}.client-rate-cell--readonly strong{font-size:13px;color:var(--ink)}

/* Aplicación del pago: campos y saldo comparten una fila estable sin desbordar. */
.form-grid.billing-payment-topline{display:grid;grid-template-columns:minmax(0,1.6fr) minmax(100px,.55fr) minmax(120px,.7fr) minmax(280px,1.25fr);align-items:end;gap:12px;width:100%}
.form-grid.billing-payment-topline>.field{grid-column:auto!important;min-width:0;width:100%}
.billing-receipt-credit-panel{align-self:stretch;min-width:0;padding:8px 10px;border:1px solid #b8d8d5;border-radius:10px;background:#f0faf8}
.receipt-detail-summary{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}
.receipt-detail-summary>div{display:grid;align-content:center;min-height:76px;padding:11px 13px;border:1px solid var(--border);border-radius:10px;background:#f8fafc}
.receipt-detail-summary span{color:var(--muted);font-size:10px;font-weight:800;text-transform:uppercase}
.receipt-detail-summary strong{margin-top:4px;color:var(--ink);font-size:14px;overflow-wrap:anywhere}
.receipt-evidence-list{display:grid;gap:8px}
.receipt-evidence-item{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 12px;border:1px solid var(--border);border-radius:9px;background:#fff}
.receipt-evidence-item>div{display:grid;min-width:0;gap:2px}
.receipt-evidence-item strong,.receipt-evidence-item span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.receipt-evidence-item span{color:var(--muted);font-size:11px}
@media(max-width:1050px){.form-grid.billing-payment-topline{grid-template-columns:minmax(0,1.4fr) minmax(110px,.6fr) minmax(140px,.8fr)}.form-grid.billing-payment-topline>.billing-receipt-credit-panel{grid-column:1/-1!important}.receipt-detail-summary{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:800px){.form-grid.billing-payment-topline{grid-template-columns:1fr 1fr}.form-grid.billing-payment-topline>.field:first-child{grid-column:1/-1!important}.receipt-evidence-item{align-items:stretch;flex-direction:column}.receipt-evidence-item .button{width:100%}}
@media(max-width:520px){.form-grid.billing-payment-topline{grid-template-columns:1fr}.form-grid.billing-payment-topline>.field:first-child,.form-grid.billing-payment-topline>.billing-receipt-credit-panel{grid-column:auto!important}.billing-receipt-credit-panel{grid-template-columns:1fr;grid-template-areas:"summary" "input" "help"}.receipt-detail-summary{grid-template-columns:1fr}}

/* Acerca de AVA: identidad oficial y propiedad intelectual comprensible. */
.ava-about-card{display:grid;grid-template-columns:minmax(280px,.75fr) minmax(420px,1.25fr);align-items:center;gap:clamp(28px,5vw,72px);min-height:430px;padding:clamp(28px,5vw,76px);overflow:hidden;background:linear-gradient(135deg,#f8fbfd 0%,#fff 54%,#edf7f7 100%)}
.ava-about-brand{display:grid;place-items:center;min-height:230px;padding:24px;border-radius:24px;background:var(--ava-primary);box-shadow:0 18px 45px rgba(11,19,43,.16)}
.ava-about-brand img{display:block;width:min(100%,440px);height:auto;filter:none}
.ava-about-copy{display:grid;gap:15px}.ava-about-copy h2{max-width:680px;margin:0;color:var(--ava-primary);font-size:clamp(28px,3vw,46px);line-height:1.08}.ava-about-copy>p{max-width:720px;margin:0;color:var(--ava-text-secondary);font-size:15px;line-height:1.65}.ava-about-values{display:flex;flex-wrap:wrap;gap:8px}.ava-about-values span{padding:8px 11px;border:1px solid #b8d8d5;border-radius:999px;color:#0f675b;background:#eaf8f5;font-size:12px;font-weight:800}.ava-about-copy .ava-about-note{padding-top:13px;border-top:1px solid var(--ava-border);font-size:12px;font-weight:650}
@media(max-width:900px){.ava-about-card{grid-template-columns:1fr;min-height:0}.ava-about-brand{min-height:180px}}

/* Ampliar/restaurar: conserva la barra superior y utiliza realmente todo el espacio de trabajo. */
body.billing-focus-mode #app-shell,body.statement-focus-mode #app-shell{position:fixed;inset:0;z-index:900;display:grid;grid-template-columns:1fr;grid-template-rows:64px auto minmax(0,1fr);grid-template-areas:"topbar" "modules" "workspace"}
body.billing-focus-mode .topbar,body.statement-focus-mode .topbar{display:grid!important;grid-area:topbar}
body.billing-focus-mode .module-bar.is-open,body.statement-focus-mode .module-bar.is-open{display:block!important;grid-area:modules}
body.billing-focus-mode .workspace,body.statement-focus-mode .workspace{grid-area:workspace;width:100%;height:auto;min-height:0;overflow:hidden}
body.billing-focus-mode #main-content,body.statement-focus-mode #main-content{width:100%;height:100%;max-width:none;min-width:0;padding:8px 10px;overflow:auto}
body.billing-focus-mode .module-bar,body.statement-focus-mode .module-bar{z-index:50}

/* Visibilidad del logo en acceso. */
@media(min-width:1100px){.login-brand-logo{transform:scale(1.12);transform-origin:left center}}

/* Salida del almacén: una sola superficie de arrastre, sin duplicar el selector nativo. */
.delivery-evidence-drop{position:relative}
.delivery-evidence-drop>input[type="file"]{position:absolute;width:1px;height:1px;overflow:hidden;opacity:0;pointer-events:none}

/* Auditoría legible: el botón es una acción real y los cambios se comparan sin exponer JSON crudo. */
.audit-detail-summary{display:block;max-width:280px;margin-top:4px;color:var(--ava-text-secondary);font-size:11px;line-height:1.35;white-space:normal}
.audit-change-card{margin-top:12px}
.audit-change-card .help-text{margin:0 0 10px;color:var(--ava-text-secondary);font-size:12px}
.audit-change-card table{table-layout:fixed;min-width:720px}
.audit-change-card th:first-child{width:24%}
.audit-value-before{color:#9f2d2d;background:#fff7f7}
.audit-value-after{color:#116149;background:#f2fbf7}

/* Configuración de facturación: grupos de tarifa en una única tabla amplia. */
.settings-billing-layout{grid-template-columns:minmax(0,1fr)}
.settings-tariff-workspace{grid-template-columns:220px minmax(0,1fr);gap:14px}
.settings-tariff-list button{padding:11px 12px}
.settings-tariff-list button span{font-size:10px}
.settings-tariff-meta{grid-template-columns:minmax(220px,1.2fr) minmax(160px,.7fr) auto auto;gap:10px}
.settings-tariff-table-wrap{width:100%;overflow:auto;border:1px solid var(--border);border-radius:10px}
.settings-tariff-table{width:100%;min-width:760px;border-collapse:collapse;table-layout:fixed}
.settings-tariff-table th{padding:10px 12px;color:#fff;background:#1C2541;font-size:11px;text-align:left}
.settings-tariff-table th:nth-child(1){width:18%}
.settings-tariff-table th:nth-child(2){width:34%}
.settings-tariff-table th:nth-child(3),.settings-tariff-table th:nth-child(4){width:24%}
.settings-tariff-table td,.settings-tariff-transport-cell{padding:8px 12px;border-top:1px solid var(--border);vertical-align:middle}
.settings-tariff-transport-cell{color:#153451;background:#F2F6F9;text-align:left}
.settings-tariff-transport-cell strong,.settings-tariff-transport-cell span,.settings-tariff-mode-cell strong,.settings-tariff-mode-cell small{display:block}
.settings-tariff-transport-cell strong{font-size:13px}
.settings-tariff-transport-cell span,.settings-tariff-mode-cell small{margin-top:2px;color:var(--muted);font-size:10px;font-weight:600}
.settings-tariff-mode-cell strong{font-size:12px}
.settings-tariff-rate-field{display:grid;grid-template-columns:minmax(0,1fr) 28px;align-items:center;gap:7px}
.settings-tariff-rate-field input{height:36px;padding:6px 9px;font-size:12px}
.settings-tariff-rate-field small{color:var(--muted);font-size:10px;font-weight:800}
.sr-only{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;white-space:nowrap!important;border:0!important}
@media(max-width:980px){.settings-tariff-workspace{grid-template-columns:1fr}.settings-tariff-list{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:680px){.settings-tariff-list,.settings-tariff-meta{grid-template-columns:1fr}.settings-form-actions{align-items:stretch;flex-direction:column}}

/* Entregas cerradas: comprobante y evidencias visibles dentro de AVA. */
.delivery-history-section{display:grid;gap:10px}
.delivery-history-heading{display:flex;align-items:flex-end;justify-content:space-between;gap:12px}
.delivery-history-heading h3,.delivery-history-heading p{margin:0}
.delivery-history-heading p{margin-top:3px;color:var(--muted);font-size:11px}
.delivery-history-heading>span{color:var(--muted);font-size:11px}
.delivery-history-row{align-items:flex-start;padding:12px;border:1px solid var(--border);border-radius:10px;background:#fff}
.delivery-history-copy{display:grid!important;flex:1 1 auto;gap:4px!important;min-width:0}
.delivery-history-row>.heading-actions{display:flex;flex-direction:row;flex:0 0 auto}
.delivery-evidence-panel{display:grid;gap:7px;margin-top:8px;padding:9px;border:1px solid #d9e5e2;border-radius:9px;background:#f7fbfa}
.delivery-evidence-heading{display:flex!important;flex-direction:row!important;align-items:center;justify-content:space-between;gap:12px}
.delivery-evidence-heading strong{font-size:11px}
.delivery-evidence-heading span{font-size:10px}
.delivery-evidence-list{display:flex!important;flex-direction:row!important;flex-wrap:wrap;gap:7px;margin-top:0}
.delivery-evidence-file{display:grid;grid-template-columns:34px minmax(0,1fr);grid-template-rows:auto auto;column-gap:8px;min-width:220px;max-width:360px;padding:8px 10px;border:1px solid var(--border);border-radius:8px;color:var(--text);background:#fff;text-align:left;cursor:pointer}
.delivery-evidence-file:hover,.delivery-evidence-file:focus-visible{border-color:var(--accent);box-shadow:0 3px 10px rgba(11,59,53,.10);outline:none}
.delivery-evidence-file>span{grid-row:1/3;display:grid;place-items:center;width:34px;height:34px;border-radius:8px;color:#0B5D54;background:#DDF7F5;font-size:10px;font-weight:900}
.delivery-evidence-file>strong{overflow:hidden;font-size:11px;text-overflow:ellipsis;white-space:nowrap}
.delivery-evidence-file>small{font-size:9px}
.delivery-evidence-empty{padding:6px 0;color:#64748b}
@media(max-width:720px){.delivery-history-row{align-items:stretch;flex-direction:column}.delivery-history-row>.heading-actions{width:100%}.delivery-evidence-file{width:100%;max-width:none}}

/* Salida del almacén: opción 3, acción principal visible y menú rápido fuera de la tabla. */
#warehouse-table>table{width:100%;min-width:1420px;table-layout:auto}
#warehouse-table th,#warehouse-table td{padding:7px 8px;white-space:nowrap;overflow-wrap:normal}
#warehouse-table th:nth-child(1){min-width:145px}
#warehouse-table th:nth-child(2){min-width:175px}
#warehouse-table th:nth-child(3){min-width:125px}
#warehouse-table th:nth-child(4){min-width:215px}
#warehouse-table th:nth-child(5){min-width:72px}
#warehouse-table th:nth-child(6){min-width:90px}
#warehouse-table th:nth-child(7){min-width:185px}
#warehouse-table th:nth-child(8){min-width:260px}
#warehouse-table .warehouse-client-cell{max-width:220px}
#warehouse-table .warehouse-client-cell>span{display:block;max-width:220px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#warehouse-table td:nth-child(3) small{display:inline-block;max-width:110px;margin-left:4px;overflow:hidden;text-overflow:ellipsis;vertical-align:middle;white-space:nowrap}
#warehouse-table .warehouse-delivery-cell small{display:inline;margin-left:4px}
#warehouse-table .warehouse-overdue-trigger{margin-left:6px;padding:2px 0;border:0;color:var(--primary);background:transparent;font-size:10px;text-decoration:underline;cursor:pointer}
.warehouse-overdue-popover{position:fixed;inset:auto;margin:0;box-sizing:border-box;width:min(360px,calc(100vw - 24px));max-height:min(260px,calc(100vh - 24px));padding:12px;border:1px solid var(--border);border-radius:10px;color:var(--text);background:var(--surface);box-shadow:0 18px 44px rgba(7,45,41,.24);overflow:auto;overflow-wrap:anywhere;white-space:normal;z-index:2147483000}
.warehouse-overdue-popover:not(:popover-open):not(.is-open){display:none}
.warehouse-overdue-popover strong{display:block;margin-bottom:8px;font-size:12px}
.warehouse-overdue-popover p{margin:0;font-size:12px;line-height:1.5}
#warehouse-table .warehouse-row-actions{display:inline-flex;align-items:center;flex-wrap:nowrap;gap:5px;min-width:max-content;max-width:none}
#warehouse-table td:last-child{white-space:nowrap}
.warehouse-row-primary{display:inline-flex;align-items:center;gap:7px;min-height:38px;padding:8px 12px;border-radius:9px;white-space:nowrap}
.warehouse-row-primary .warehouse-action-icon{width:18px;height:18px}
.warehouse-more-trigger{display:grid;place-items:center;flex:0 0 38px;width:38px;height:38px;padding:0;border:1px solid var(--border);border-radius:9px;color:var(--navy);background:var(--surface);cursor:pointer}
.warehouse-more-trigger:hover,.warehouse-more-trigger:focus-visible,.warehouse-more-trigger[aria-expanded="true"]{border-color:#78bcb5;background:#eef9f7;box-shadow:0 4px 12px rgba(11,59,53,.12);outline:none}
.warehouse-more-trigger svg{width:20px;height:20px}
.warehouse-preview-trigger{display:grid;place-items:center;flex:0 0 38px;width:38px;height:38px;padding:0;border:1px solid #8bc9c1;border-radius:9px;color:#0b6f63;background:#e6f7f4;cursor:pointer}
.warehouse-preview-trigger:hover,.warehouse-preview-trigger:focus-visible{border-color:#0b6f63;background:#d6f1ec;box-shadow:0 4px 12px rgba(11,111,99,.18);outline:none}
.warehouse-preview-trigger svg{width:20px;height:20px}
.warehouse-row-action-menu{position:fixed;inset:auto;margin:0;width:min(280px,calc(100vw - 24px));padding:7px;border:1px solid #c9d9d6;border-radius:12px;color:var(--text);background:var(--surface);box-shadow:0 18px 44px rgba(7,45,41,.24);z-index:2147483000}
.warehouse-row-action-menu:not(:popover-open):not(.is-open){display:none}
.warehouse-row-action-menu button{display:grid;grid-template-columns:38px minmax(0,1fr);align-items:center;gap:10px;width:100%;padding:9px;border:0;border-radius:9px;color:var(--text);background:transparent;text-align:left;cursor:pointer}
.warehouse-row-action-menu button:hover,.warehouse-row-action-menu button:focus-visible{background:#eef9f7;outline:none}
.warehouse-row-action-menu button>svg{width:22px;height:22px;padding:7px;box-sizing:content-box;border-radius:9px;color:#0b6f63;background:#ddf4ef}
.warehouse-row-action-menu button>span{display:grid;gap:2px;min-width:0}
.warehouse-row-action-menu button strong{font-size:12px}
.warehouse-row-action-menu button small{color:var(--muted);font-size:9px;line-height:1.35}
.warehouse-row-action-menu button.is-danger{color:#9f302e}
.warehouse-row-action-menu button.is-danger:hover,.warehouse-row-action-menu button.is-danger:focus-visible{background:#fff2f1}
.warehouse-row-action-menu button.is-danger>svg{color:#a93835;background:#fee5e3}
.warehouse-quick-deliveries{display:grid;gap:12px}
.warehouse-quick-hint{display:flex;align-items:center;gap:9px;padding:10px 12px;border:1px solid #b9ded9;border-radius:10px;color:#24564f;background:#eef9f7;font-size:11px;font-weight:700}
.warehouse-quick-hint svg{flex:0 0 20px;width:20px;height:20px}
.warehouse-quick-delivery{display:grid;grid-template-columns:minmax(260px,1fr) auto;gap:10px 14px;padding:13px;border:1px solid var(--border);border-radius:12px;background:#fff}
.warehouse-quick-delivery.is-voided{opacity:.75;background:#f8fafc}
.warehouse-quick-delivery-title{display:grid;grid-template-columns:42px minmax(0,1fr) auto;align-items:center;gap:10px;min-width:0}
.warehouse-quick-delivery-title>span:nth-child(2){display:grid;gap:3px;min-width:0}
.warehouse-quick-delivery-title strong,.warehouse-quick-delivery-title small{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.warehouse-quick-delivery-title small{color:var(--muted);font-size:10px}
.warehouse-quick-delivery-icon{display:grid;place-items:center;width:42px;height:42px;border-radius:11px;color:#0b6f63;background:#ddf4ef}
.warehouse-quick-delivery-icon svg{width:23px;height:23px}
.warehouse-quick-actions{display:flex;align-items:center;justify-content:flex-end;gap:7px}
.warehouse-quick-action{display:flex;align-items:center;gap:7px;min-height:38px;padding:8px 10px;border:1px solid var(--border);border-radius:9px;color:var(--navy);background:#fff;font-size:11px;font-weight:800;cursor:pointer}
.warehouse-quick-action svg{width:18px;height:18px}
.warehouse-quick-action:hover,.warehouse-quick-action:focus-visible,.warehouse-quick-action.is-recommended{border-color:#5caaa1;background:#eef9f7;outline:none}
.warehouse-quick-action--danger{color:#a13836}
.warehouse-quick-action--danger:hover,.warehouse-quick-action--danger:focus-visible,.warehouse-quick-action--danger.is-recommended{border-color:#e2aaa7;background:#fff2f1}
.warehouse-quick-delivery>.delivery-evidence-panel{grid-column:1/-1;margin-top:0}
.warehouse-quick-delivery>.delivery-evidence-panel.is-recommended{border-color:#5caaa1;box-shadow:0 0 0 2px rgba(49,159,152,.12)}
@media(max-width:760px){.warehouse-quick-delivery{grid-template-columns:1fr}.warehouse-quick-actions{justify-content:flex-start;flex-wrap:wrap}.warehouse-quick-delivery-title{grid-template-columns:42px minmax(0,1fr)}.warehouse-quick-delivery-title>.status-pill{grid-column:2}.warehouse-row-primary{padding-inline:9px}}

/* Productos, tarifas y asignación de clientes: una sola biblioteca visual. */
.billing-products-card{padding:14px}.billing-products-layout{display:grid;grid-template-columns:245px minmax(0,1fr);gap:14px;min-width:0}.billing-product-list{display:grid;align-content:start;gap:7px;max-height:570px;padding-right:3px;overflow:auto}.billing-product-list button{position:relative;display:grid;gap:4px;width:100%;padding:12px;border:1px solid var(--border);border-radius:10px;color:var(--text);background:#fff;text-align:left;cursor:pointer}.billing-product-list button:hover{border-color:#8fc9c5;background:#f7fbfa}.billing-product-list button.is-active{border-color:#319f98;background:#edf9f7;box-shadow:inset 4px 0 #16897f}.billing-product-list button strong{font-size:13px}.billing-product-list button span{color:var(--muted);font-size:10px}.billing-product-list button em{position:absolute;top:8px;right:8px;color:#a64040;font-size:9px;font-style:normal;font-weight:800}.billing-product-editor{display:grid;gap:12px;min-width:0}.billing-tariff-heading{margin-top:2px}.billing-tariff-heading h3{margin:0}.billing-tariff-table{max-height:375px}.billing-tariff-table table{min-width:760px}.billing-tariff-table th:nth-child(1){width:31%}.billing-tariff-table th:nth-child(2){width:18%}.billing-tariff-table th:nth-child(3){width:22%}.billing-tariff-table th:nth-child(4){width:16%}.billing-tariff-table th:nth-child(5){width:13%}.billing-tariff-table input,.billing-tariff-table select{height:36px}.field-inline-check{display:flex;align-items:center;gap:8px;min-height:37px;padding:7px 10px;border:1px solid var(--border);border-radius:8px;background:#fff;font-weight:700}.field-inline-check input{width:17px;height:17px}.client-assignment-panel{display:grid;gap:14px}.client-policy-grid{display:grid;grid-template-columns:minmax(220px,1.2fr) minmax(220px,1fr) auto;gap:12px;align-items:end}.client-billing-assignment{display:block;min-width:0;overflow:auto;border:1px solid #b9ded9;border-radius:11px;background:#fff}.client-assignment-table-head,.client-assignment-row{display:grid;grid-template-columns:minmax(190px,1.25fr) minmax(105px,.6fr) minmax(210px,1.15fr) minmax(105px,.55fr) minmax(150px,.7fr);gap:10px;align-items:center;min-width:850px;padding:10px 12px}.client-assignment-table-head{color:#52657a;background:#eef5f7;font-size:9px;font-weight:900;text-transform:uppercase}.client-assignment-row{border-top:1px solid var(--border)}.client-assignment-row.is-default{box-shadow:inset 4px 0 #16897f;background:#f2fbf9}.client-assignment-row>div{display:grid;gap:2px;min-width:0}.client-assignment-row strong{overflow:hidden;font-size:12px;text-overflow:ellipsis;white-space:nowrap}.client-assignment-row small{color:var(--muted);font-size:10px}.client-assignment-actions{display:flex;align-items:center;justify-content:flex-end;gap:6px}.client-rate-note{padding:10px 12px;border-left:3px solid #319f98;color:#52657a;background:#f6fafb;font-size:11px;line-height:1.45}

/* Nueva factura: asignación explícita y cálculo financiero legible. */
.billing-assignment-card{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;padding:10px;border:1px solid #b8dcd8;border-radius:10px;background:#eef9f7}.billing-assignment-card>span{grid-column:1/-1;color:var(--muted);font-size:10px;font-weight:900;text-transform:uppercase}.billing-assignment-card>div{display:grid;gap:3px;min-width:0;padding:8px;border-radius:8px;background:#fff}.billing-assignment-card .billing-assignment-selector{grid-column:1/-1;padding:0;background:transparent}.billing-assignment-card .billing-assignment-selector select{width:100%;min-width:0}.billing-assignment-card>div span,.billing-calculation-head span{color:var(--muted);font-size:9px;font-weight:900}.billing-assignment-card>div strong{overflow:hidden;font-size:12px;text-overflow:ellipsis;white-space:nowrap}.billing-calculation-card{display:grid;gap:0;padding:0;overflow:hidden;border:1px solid #b7d5d1;border-radius:10px;background:#fff}.billing-calculation-card>span,.billing-calculation-card>strong{padding:10px 12px}.billing-calculation-card--error{border-color:#e3aaa8;background:#fff7f7}.billing-calculation-card--error>strong{color:#a93835}.billing-calculation-card--error>span{color:#7c3a38}.billing-calculation-head{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:1px;background:#d8e8e5}.billing-calculation-head>div{display:grid;gap:3px;padding:9px 11px;background:#eff8f6}.billing-calculation-head strong{font-size:12px}.billing-calculation-row{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:7px 11px;border-top:1px solid #e3ecea;font-size:11px}.billing-calculation-row strong{font-size:12px}.billing-calculation-total{color:#fff;background:#123c5a}.billing-calculation-total strong{font-size:16px}.billing-calculation-balance{color:#0b5d54;background:#e7f7f3;font-weight:800}.text-danger{color:#a93835!important}
@media(max-width:980px){.billing-products-layout{grid-template-columns:1fr}.billing-product-list{grid-template-columns:repeat(2,minmax(0,1fr));max-height:260px}.client-policy-grid{grid-template-columns:1fr}}
@media(max-width:640px){.billing-product-list,.billing-assignment-card{grid-template-columns:1fr}.billing-calculation-head{grid-template-columns:1fr}}

/* CPL-008: captura manual compacta y evidencia visible antes de aprobar saldos. */
.digitization-entry-heading-actions{display:flex;align-items:center;justify-content:flex-end;gap:10px;min-width:0;flex-wrap:wrap}
.field-retain{display:inline-grid;place-items:center;flex:0 0 20px;width:20px;height:20px;margin:0;cursor:pointer}
.field-retain input{width:17px;height:17px;margin:0;accent-color:var(--blue);cursor:pointer}
.claim-evidence-section>.card-header{align-items:flex-start}
.claim-evidence-section>.card-header p{margin:4px 0 0;color:var(--muted);font-size:12px}
.claim-evidence-gallery{display:grid;grid-template-columns:repeat(auto-fit,minmax(190px,1fr));gap:10px}
.claim-evidence-card{min-width:0;display:grid;grid-template-columns:76px minmax(0,1fr);align-items:center;gap:10px;padding:8px;border:1px solid var(--border);border-radius:10px;background:#fff;color:var(--ink);text-align:left;cursor:pointer}
.claim-evidence-card:hover{border-color:#9eb2d2;background:#f7f9fd}
.claim-evidence-card img,.claim-evidence-file{width:76px;height:64px;border-radius:7px;object-fit:cover;background:#eaf1f8}
.claim-evidence-file{display:grid;place-items:center;color:var(--navy);font-size:13px;font-weight:800}
.claim-evidence-card>span:last-child{display:grid;gap:4px;min-width:0}
.claim-evidence-card strong,.claim-evidence-card small{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.claim-evidence-card small{color:var(--muted)}
@media(max-width:620px){.digitization-entry-heading-actions{justify-content:flex-start}.claim-evidence-gallery{grid-template-columns:1fr}}

/* Cuentas por cobrar: suma seleccionable en cabecera; los pagos permanecen en Pagos y recibos. */
.ar-list-card-header{align-items:center;gap:14px}
.ar-list-header-actions{display:flex;align-items:center;justify-content:flex-end;gap:10px;min-width:0;margin-left:auto}
.ar-selected-balance{display:grid;grid-template-columns:auto minmax(130px,auto);align-items:center;gap:1px 12px;min-width:245px;padding:8px 12px;border:1px solid var(--ava-border);border-radius:10px;background:var(--ava-primary-soft)}
.ar-selected-balance>span{grid-row:1;color:var(--ava-text-secondary);font-size:9px;font-weight:900;letter-spacing:.05em}
.ar-selected-balance>small{grid-column:1/-1;color:var(--ava-text-secondary);font-size:10px}
.ar-selected-balance>strong{grid-column:2;grid-row:1/3;justify-self:end;color:var(--ava-primary-dark);font-size:17px;font-variant-numeric:tabular-nums}
.ar-selected-balance-values{grid-column:2;grid-row:1/3;display:flex;align-items:center;justify-content:flex-end;flex-wrap:wrap;gap:4px 10px}
.ar-selected-balance-values strong{color:var(--ava-primary-dark);font-size:17px;font-variant-numeric:tabular-nums;white-space:nowrap}
.ar-selected-balance.is-empty{background:var(--ava-surface)}
.ar-check-column{width:42px;min-width:42px;text-align:center!important}
.ar-check-column input{width:17px;height:17px;margin:0;accent-color:var(--ava-primary)}
.billing-receivable-table tbody tr{cursor:default}
@media(max-width:900px){.ar-list-header-actions{width:100%;justify-content:flex-start;flex-wrap:wrap;margin-left:0}.ar-selected-balance{flex:1 1 280px}}
@media(max-width:560px){.ar-list-header-actions{align-items:stretch}.ar-selected-balance{grid-template-columns:1fr;width:100%;min-width:0}.ar-selected-balance>strong,.ar-selected-balance-values{grid-column:1;grid-row:auto;justify-self:start;justify-content:flex-start}.ar-list-header-actions>.button{flex:1 1 auto}}

/* CPL-009: llegada física y trazabilidad exacta de cada paquete. */
.operation-icon{display:block;width:24px;height:24px}
.arrival-selector-card{display:grid;grid-template-columns:52px minmax(190px,.85fr) minmax(230px,1fr) minmax(360px,1.45fr);align-items:end;gap:12px;padding:14px;border:1px solid #b8dcd8;border-radius:13px;background:linear-gradient(135deg,#f1fbf8 0%,#f8fbff 100%)}
.arrival-selector-icon,.arrival-work-icon,.consolidation-metric-icon,.arrival-batch-icon{display:grid;place-items:center;color:#0b7c67;background:#def5ee}
.arrival-selector-icon{align-self:center;width:52px;height:52px;border-radius:14px}
.arrival-selector-icon .operation-icon{width:29px;height:29px}
.arrival-selector-copy{align-self:center;display:grid;gap:3px;min-width:0}
.arrival-selector-copy>span{color:#487267;font-size:10px;font-weight:900;letter-spacing:.06em}
.arrival-selector-copy>strong{font-size:14px;line-height:1.25}
.arrival-selector-copy>small{color:var(--muted);font-size:10px;line-height:1.35}
.arrival-new-fields{display:grid;grid-template-columns:minmax(150px,.65fr) minmax(210px,1.35fr);gap:10px}.arrival-new-fields.is-hidden{display:none}
.arrival-work-card{display:grid;grid-template-columns:54px repeat(3,minmax(0,1fr));align-items:center;gap:14px;margin-bottom:12px;padding:13px 15px;border:1px solid #bdded9;border-radius:12px;background:linear-gradient(135deg,#f0faf7 0%,#f8fbff 100%)}
.arrival-work-icon{width:54px;height:54px;border-radius:14px}.arrival-work-icon .operation-icon{width:30px;height:30px}
.arrival-work-card>div{display:grid;gap:3px;min-width:0}.arrival-work-card span{color:#55706c;font-size:9px;font-weight:900;letter-spacing:.04em}.arrival-work-card strong{overflow:hidden;font-size:13px;text-overflow:ellipsis;white-space:nowrap}.arrival-work-card small{color:var(--muted);font-size:10px}
.digitization-kpi-row{grid-template-columns:repeat(4,minmax(0,1fr))}.digitization-kpi{display:grid!important;grid-template-columns:42px 1fr;grid-template-rows:auto auto;column-gap:10px;align-items:center;padding:8px 10px!important}.digitization-kpi-icon{grid-row:1/3;display:grid;place-items:center;width:42px;height:42px;border-radius:11px}.digitization-kpi-icon .operation-icon{width:24px;height:24px}.digitization-kpi>span:not(.digitization-kpi-icon){align-self:end}.digitization-kpi>strong{align-self:start;font-size:18px}.digitization-kpi--blue .digitization-kpi-icon{color:#176197;background:#e5f1fa}.digitization-kpi--green .digitization-kpi-icon{color:#168066;background:#e3f6ef}.digitization-kpi--amber .digitization-kpi-icon{color:#b87900;background:#fff1cf}.digitization-kpi--violet .digitization-kpi-icon{color:#7b3fba;background:#f0e4fc}
.package-registration-cell{display:grid;gap:3px;min-width:145px}.package-registration-cell>strong{font-size:11px;white-space:nowrap}.package-registration-cell>small{color:var(--muted);font-size:9px;line-height:1.3;white-space:normal}.package-registration-cell .status-badge{justify-self:start}
.detail-item--trace{border-color:#b9ddd8!important;background:#f2faf8!important}.detail-item--trace strong{color:#0b6254}
.package-trace-banner{display:flex;align-items:center;gap:10px;margin:0 0 10px;padding:9px 12px;border:1px solid #b9ddd8;border-radius:11px;background:#f2faf8;color:#164e46}.package-trace-banner>div{display:grid;gap:1px}.package-trace-banner strong{font-size:12px}.package-trace-banner div>span{color:#52706b;font-size:10px;line-height:1.35}
.package-trace-cell{display:grid;grid-template-columns:30px minmax(150px,1fr);align-items:center;gap:8px;min-width:195px}.package-trace-cell>span:last-child{display:grid;gap:2px}.package-trace-cell strong{font-size:10px;line-height:1.25;white-space:nowrap}.package-trace-cell small{color:#52706b;font-size:8px;line-height:1.3;white-space:normal}.package-trace-icon{display:grid;place-items:center;width:30px;height:30px;border-radius:9px;color:#7b3fba;background:#f0e4fc;flex:0 0 auto}.package-trace-icon svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}.package-trace-column{background:#fbf8ff!important}
.ava-action-layer{position:fixed;inset:0;z-index:13000;display:grid;place-items:center;padding:18px;background:rgba(7,32,53,.48);backdrop-filter:blur(3px)}.ava-action-dialog{width:min(520px,calc(100vw - 28px));overflow:hidden;border:1px solid #c8dadf;border-radius:16px;background:#fff;box-shadow:0 24px 70px rgba(5,30,50,.28)}.ava-action-header{display:grid;grid-template-columns:44px minmax(0,1fr) 36px;align-items:center;gap:11px;padding:16px 18px;color:#fff;background:#0d3657}.ava-action-header>div{display:grid;gap:2px}.ava-action-header>div>span{font-size:9px;font-weight:900;letter-spacing:.12em;opacity:.78}.ava-action-header h2{margin:0;color:inherit;font-size:18px}.ava-action-icon{display:grid;place-items:center;width:42px;height:42px;border-radius:12px;color:#a75a00;background:#fff0ce}.ava-action-dialog--danger .ava-action-icon{color:#c13b2d;background:#fde9e6}.ava-action-icon svg{width:23px;height:23px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}.ava-action-close{display:grid;place-items:center;width:34px;height:34px;border:1px solid rgba(255,255,255,.28);border-radius:9px;color:#fff;background:rgba(255,255,255,.08);font-size:22px;cursor:pointer}.ava-action-body{display:grid;gap:14px;padding:20px 20px 16px}.ava-action-body p{margin:0;color:#1a2938;font-size:14px;line-height:1.55}.ava-action-body>small{color:#64748b;font-size:10px}.ava-action-body textarea{min-height:92px;resize:vertical}.ava-action-footer{display:flex;justify-content:flex-end;gap:10px;padding:14px 20px 18px;border-top:1px solid #e1e8ed;background:#f8fafc}.ava-action-footer .button{min-width:112px}@media(max-width:520px){.ava-action-layer{padding:10px}.ava-action-header{grid-template-columns:38px minmax(0,1fr) 32px;padding:13px}.ava-action-icon{width:37px;height:37px}.ava-action-header h2{font-size:16px}.ava-action-body{padding:16px}.ava-action-footer{display:grid;grid-template-columns:1fr 1fr;padding:12px 16px 16px}.ava-action-footer .button{min-width:0}}
.consolidation-metrics{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:10px;margin:12px 0}
.consolidation-metric{display:grid;grid-template-columns:52px minmax(0,1fr);align-items:center;gap:11px;min-height:92px;padding:13px;border:1px solid #c9dedb;border-radius:13px;background:#fff;box-shadow:0 4px 13px rgba(23,58,70,.045)}
.consolidation-metric-icon{width:52px;height:52px;border-radius:14px}.consolidation-metric-icon .operation-icon{width:29px;height:29px}.consolidation-metric>div{display:grid;gap:2px;min-width:0}.consolidation-metric span{color:#4e6664;font-size:11px;font-weight:800}.consolidation-metric strong{color:#123c36;font-size:20px;line-height:1.1}.consolidation-metric small{overflow:hidden;color:var(--muted);font-size:9px;text-overflow:ellipsis;white-space:nowrap}
.consolidation-metric--blue .consolidation-metric-icon{color:#176197;background:#e5f1fa}.consolidation-metric--green .consolidation-metric-icon{color:#168066;background:#e3f6ef}.consolidation-metric--amber .consolidation-metric-icon{color:#b87900;background:#fff1cf}.consolidation-metric--violet .consolidation-metric-icon{color:#7b3fba;background:#f0e4fc}.consolidation-metric--coral .consolidation-metric-icon{color:#da4b37;background:#fdebe7}
.arrival-batch-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.arrival-batch-grid>.empty-state{grid-column:1/-1}
.arrival-batch-card{display:grid;grid-template-columns:48px minmax(145px,1fr) minmax(120px,.7fr);grid-template-rows:auto auto;align-items:center;gap:8px 12px;width:100%;padding:12px;border:1px solid #cbdcda;border-radius:12px;color:var(--ink);background:#fff;text-align:left;cursor:pointer;transition:transform .15s,border-color .15s,box-shadow .15s}.arrival-batch-card:hover{transform:translateY(-1px);border-color:#78b9b0;box-shadow:0 6px 16px rgba(21,70,65,.09)}.arrival-batch-card.is-active{border-color:#087863;box-shadow:0 0 0 2px rgba(8,120,99,.13)}
.arrival-batch-icon{grid-row:1/3;width:48px;height:48px;border-radius:12px}.arrival-batch-copy,.arrival-batch-totals{display:grid;gap:2px;min-width:0}.arrival-batch-copy>span{color:#52706b;font-size:9px;font-weight:900;letter-spacing:.04em}.arrival-batch-copy>strong,.arrival-batch-totals>strong{overflow:hidden;font-size:13px;text-overflow:ellipsis;white-space:nowrap}.arrival-batch-copy>small,.arrival-batch-totals>small,.arrival-billing-progress>small{color:var(--muted);font-size:9px}.arrival-batch-totals{justify-self:end;text-align:right}
.arrival-billing-progress{grid-column:2/4;display:grid;gap:5px}.arrival-billing-progress>span{display:flex;justify-content:space-between;gap:12px;font-size:9px}.arrival-billing-progress b{color:#16715f}.arrival-billing-progress em{color:#a36b00;font-style:normal;font-weight:800}.arrival-billing-progress progress{width:100%;height:7px;border:0;border-radius:99px;overflow:hidden;background:#e8eeed}.arrival-billing-progress progress::-webkit-progress-bar{background:#e8eeed}.arrival-billing-progress progress::-webkit-progress-value{background:#1d9b80}.arrival-billing-progress progress::-moz-progress-bar{background:#1d9b80}
.arrival-batch-card--all{grid-template-columns:48px 1fr;grid-template-rows:1fr;background:#f3faf8}.arrival-batch-card--all .arrival-batch-icon{grid-row:1}.arrival-batch-card--all>div{display:grid;gap:2px}.arrival-batch-card--all span{color:#50716b;font-size:9px;font-weight:900}.arrival-batch-card--all strong{font-size:14px}.arrival-batch-card--all small{color:var(--muted);font-size:9px}.arrival-batch-card--blue .arrival-batch-icon{color:#176197;background:#e5f1fa}.arrival-batch-card--green .arrival-batch-icon{color:#168066;background:#e3f6ef}.arrival-batch-card--violet .arrival-batch-icon{color:#7b3fba;background:#f0e4fc}.arrival-batch-card--coral .arrival-batch-icon{color:#da4b37;background:#fdebe7}
.incident-trace-card{display:grid;grid-template-columns:46px repeat(3,minmax(0,1fr));align-items:center;gap:12px;margin:0 0 12px;padding:11px 13px;border:1px solid #bdded9;border-radius:11px;background:#f2faf8}.incident-trace-card>.incident-trace-icon{display:grid;place-items:center;width:46px;height:46px;border-radius:12px;color:#176197;background:#e5f1fa}.incident-trace-card>div{display:grid;gap:2px;min-width:0}.incident-trace-card span{color:#54716c;font-size:9px;font-weight:900}.incident-trace-card strong{overflow:hidden;font-size:11px;text-overflow:ellipsis;white-space:nowrap}.incident-trace-card small{color:var(--muted);font-size:9px}
@media(max-width:1180px){.arrival-selector-card{grid-template-columns:52px 1fr 1fr}.arrival-new-fields{grid-column:2/4}.consolidation-metrics{grid-template-columns:repeat(3,minmax(0,1fr))}.arrival-work-card{grid-template-columns:54px repeat(2,minmax(0,1fr))}.arrival-work-card>div:last-child{grid-column:2/4}.incident-trace-card{grid-template-columns:46px repeat(2,minmax(0,1fr))}.incident-trace-card>div:last-child{grid-column:2/4}}
@media(max-width:760px){.arrival-selector-card,.arrival-work-card,.incident-trace-card{grid-template-columns:1fr}.arrival-selector-icon,.arrival-work-icon,.incident-trace-card>.incident-trace-icon{grid-column:1}.arrival-new-fields,.arrival-work-card>div:last-child,.incident-trace-card>div:last-child{grid-column:1}.arrival-new-fields,.arrival-batch-grid,.consolidation-metrics,.digitization-kpi-row{grid-template-columns:1fr}.arrival-batch-card{grid-template-columns:42px minmax(0,1fr)}.arrival-batch-icon{width:42px;height:42px}.arrival-batch-totals{grid-column:2;justify-self:start;text-align:left}.arrival-billing-progress{grid-column:1/3}.arrival-batch-card--all{grid-template-columns:42px 1fr}}

/* AVA 13.4.33: tracking único por empresa y peso consolidado corregible. */
.module-title-filter-row{display:flex;align-items:center;gap:7px;min-width:0}.module-title-filter-row h1{margin:0}.module-filter-toggle{display:inline-grid;place-items:center;width:27px;height:27px;min-width:27px;padding:0;border:1px solid var(--border);border-radius:8px;color:var(--navy);background:var(--surface);cursor:pointer;transition:background .15s,border-color .15s,color .15s}.module-filter-toggle:hover{border-color:var(--ava-primary);color:var(--ava-primary);background:var(--ava-primary-soft)}.module-filter-toggle:focus-visible{outline:2px solid var(--ava-primary);outline-offset:2px}.module-filter-toggle svg{width:15px;height:15px;fill:none;stroke:currentColor;stroke-width:1.9;stroke-linecap:round}.module-filter-toggle.is-collapsed{color:#fff;border-color:var(--ava-primary);background:var(--ava-primary)}[data-global-filter-region][hidden]{display:none!important}@media(max-width:760px){.module-title-filter-row{align-items:flex-start}.module-filter-toggle{width:30px;height:30px;min-width:30px}}
.warehouse-command-bar{display:grid;grid-template-columns:minmax(480px,1.2fr) minmax(150px,.48fr) minmax(260px,1fr) minmax(145px,.46fr) auto;align-items:end;gap:10px;margin-bottom:12px;padding:10px 12px}
.warehouse-inline-metrics{display:grid;grid-template-columns:repeat(4,minmax(92px,1fr));align-self:stretch;gap:6px;min-width:0}
#main-content[data-filters-hidden="true"] .warehouse-command-bar{grid-template-columns:1fr}
#main-content[data-filters-hidden="true"] .warehouse-inline-metrics{grid-column:1/-1}
.warehouse-command-bar .warehouse-metric{min-height:54px;padding:7px 7px 7px 40px;border-radius:9px;box-shadow:none}
.warehouse-command-bar .warehouse-metric:before{left:7px;width:27px;height:27px;border-radius:8px}
.warehouse-command-bar .warehouse-metric:after{left:13px;width:15px;height:15px}
.warehouse-command-bar .warehouse-metric .metric-copy{gap:1px;min-width:0}
.warehouse-command-bar .warehouse-metric .metric-copy span{font-size:8.5px;line-height:1.12;white-space:normal}
.warehouse-command-bar .warehouse-metric .metric-copy strong{font-size:18px;line-height:1}
.warehouse-command-bar .field{gap:3px;min-width:0}.warehouse-command-bar .field>span{font-size:9px}.warehouse-command-bar input,.warehouse-command-bar select,.warehouse-command-bar .button{height:38px;min-height:38px}
.warehouse-command-actions{display:flex;align-items:center;gap:6px;white-space:nowrap}
@media(max-width:1380px){.warehouse-command-bar{grid-template-columns:repeat(3,minmax(0,1fr))}.warehouse-inline-metrics{grid-column:1/-1}.warehouse-command-search{grid-column:1/3}.warehouse-command-actions{justify-content:flex-end}}
@media(max-width:760px){.warehouse-command-bar{grid-template-columns:1fr}.warehouse-inline-metrics,.warehouse-command-search{grid-column:1}.warehouse-inline-metrics{grid-template-columns:repeat(2,minmax(0,1fr))}.warehouse-command-actions{justify-content:stretch}.warehouse-command-actions .button{flex:1}}

.statement-workbench{display:grid;grid-template-rows:auto auto minmax(360px,1fr);gap:0;padding:0;overflow:hidden}
.statement-workbench .statement-filters{display:grid;grid-template-columns:repeat(12,minmax(0,1fr));gap:8px;margin:0;padding:10px 12px;border:0;border-bottom:1px solid var(--border);border-radius:0;background:#f8fafc;box-shadow:none}
.statement-workbench .statement-filters>.field:nth-child(1),.statement-workbench .statement-filters>.field:nth-child(2),.statement-workbench .statement-filters>.field:nth-child(3){grid-column:span 2}
.statement-workbench .statement-filters .field{gap:3px;min-width:0}.statement-workbench .statement-filters .field>span{font-size:9px}.statement-workbench .statement-filters input,.statement-workbench .statement-filters select,.statement-workbench .statement-filters .button{height:36px;min-height:36px;padding-top:5px;padding-bottom:5px;font-size:11px}
.statement-filter-actions{display:flex;align-items:flex-end;gap:6px;white-space:nowrap}
.statement-workbench-header{display:flex;align-items:center;gap:14px;min-height:64px;padding:9px 12px;border-bottom:1px solid var(--border)}
.statement-workbench-header>div:first-child{display:grid;gap:2px;min-width:210px}.statement-workbench-header h2,.statement-workbench-header p{margin:0}.statement-workbench-header h2{font-size:15px}.statement-workbench-header p{overflow:hidden;max-width:520px;color:var(--muted);font-size:10px;text-overflow:ellipsis;white-space:nowrap}
.statement-workbench-header>#statement-invoice-count{margin-left:auto;white-space:nowrap}
.statement-inline-summary{display:flex;align-items:center;flex:1;gap:7px;min-width:0;overflow:auto}
.statement-inline-summary>span{padding:7px 9px;border:1px solid #c9dedb;border-radius:9px;color:#375954;background:#f1faf8;font-size:10px;white-space:nowrap}.statement-inline-summary b{color:#0b6658}.statement-inline-summary strong{color:#123e58}
.statement-workbench-table{max-height:calc(100vh - 310px);min-height:360px;border:0;border-radius:0}
.statement-unified-ledger{min-width:1700px}.statement-unified-ledger th,.statement-unified-ledger td{padding:8px 9px;white-space:nowrap}.statement-unified-ledger td:nth-child(2){min-width:210px;white-space:normal}
.transport-badge{display:inline-grid;place-items:center;min-width:74px;padding:5px 8px;border-radius:8px;color:#0c6358;background:#e5f6f2;font-size:10px;font-weight:800}
body.statement-focus-mode #main-content{grid-template-rows:auto minmax(0,1fr)!important}
body.statement-focus-mode .statement-workbench{min-height:0;height:100%;grid-template-rows:auto auto minmax(0,1fr)}
body.statement-focus-mode .statement-workbench-table{height:100%;max-height:none;min-height:0}
@media(max-width:1650px){.statement-workbench .statement-filters{grid-template-columns:repeat(6,minmax(0,1fr))}.statement-workbench .statement-filters>.field:nth-child(1),.statement-workbench .statement-filters>.field:nth-child(2),.statement-workbench .statement-filters>.field:nth-child(3){grid-column:span 2}.statement-filter-actions{justify-content:flex-end}}
@media(max-width:1050px){.statement-workbench .statement-filters{grid-template-columns:repeat(3,minmax(0,1fr))}.statement-workbench .statement-filters>.field:nth-child(1){grid-column:span 2}.statement-workbench .statement-filters>.field:nth-child(2),.statement-workbench .statement-filters>.field:nth-child(3){grid-column:span 1}.statement-workbench-header{align-items:flex-start;flex-wrap:wrap}.statement-inline-summary{order:3;flex-basis:100%}}
@media(max-width:680px){.statement-workbench .statement-filters{grid-template-columns:1fr}.statement-workbench .statement-filters>.field:nth-child(1),.statement-workbench .statement-filters>.field:nth-child(2),.statement-workbench .statement-filters>.field:nth-child(3){grid-column:1}.statement-filter-actions{justify-content:stretch}.statement-filter-actions .button{flex:1}.statement-workbench-header{display:grid}.statement-workbench-header>#statement-invoice-count{margin-left:0}.statement-inline-summary{width:100%}}

/* Tres precios terrestres en una tarifa; el desplazamiento queda dentro del editor. */
.billing-tariff-table table{min-width:990px;table-layout:auto}
.billing-tariff-table th:nth-child(n){width:auto}
.billing-tariff-table td:first-child input{min-width:150px}
.billing-tariff-table input[type=number]{min-width:92px}
