:root {
  --ink: #263348;
  --muted: #6c778a;
  --blue: #315dca;
  --blue-dark: #1c3d7a;
  --blue-light: #f1f5ff;
  --line: #dfe4ed;
  --canvas: #f5f5f5;
  --shadow: 0 2px 8px rgba(24, 39, 75, .08);
}
* { box-sizing: border-box; }
body {
  margin: 0 0 0 70px;
  background: var(--canvas);
  color: var(--ink);
  font: 14px/1.45 'Segoe UI', Tahoma, sans-serif;
}
.hidden { display: none !important; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .48; cursor: not-allowed; }
button:focus-visible, input:focus-visible, select:focus-visible, .dropzone:focus-within {
  outline: 3px solid rgba(102, 126, 234, .55);
  outline-offset: 2px;
}
.side-rail {
  position: fixed;
  inset: 0 auto 0 0;
  width: 70px;
  z-index: 30;
  display: flex;
  justify-content: center;
  padding-top: 20px;
  background: #000;
  box-shadow: 2px 0 5px rgba(0, 0, 0, .1);
}
.rail-current {
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  color: #fff;
  border-radius: 10px;
  background: linear-gradient(135deg, #667eea 0%, #1e3a8a 100%);
  box-shadow: 0 4px 12px rgba(102, 126, 234, .4);
}
.rail-current svg { width: 25px; height: 25px; }
.top {
  position: sticky;
  top: 0;
  z-index: 35;
  min-height: 66px;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  color: white;
  background: linear-gradient(135deg, #1c1565 0%, #5b84f7 100%);
}
.brand { display: flex; align-items: center; gap: 14px; min-width: 0; }
.brand-logo { width: auto; height: 38px; flex: none; }
.brand-text { min-width: 0; }
.brand-text small { display: block; font-size: 10px; letter-spacing: 2px; opacity: .75; }
.brand-text strong { display: block; font-size: 20px; line-height: 1.2; }
.top-note { font-size: 13px; white-space: nowrap; opacity: .8; }
.lock { font-size: 9px; margin-right: 6px; color: #c7e5ff; }
main { max-width: 1600px; margin: auto; }
.welcome {
  min-height: calc(100vh - 66px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 500px);
  align-items: center;
  gap: 70px;
  padding: 55px 7% 115px;
  position: relative;
}
.intro { max-width: 570px; }
.eyebrow, .step-kicker { color: #667eea; font-size: 10px; font-weight: 700; letter-spacing: 1.5px; }
.intro h1 {
  margin: 16px 0;
  color: #1c3d7a;
  font-size: clamp(36px, 4vw, 54px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -.9px;
}
.intro h1 em { color: #667eea; font-style: normal; }
.intro p { max-width: 440px; color: var(--muted); font-size: 16px; line-height: 1.65; }
.intro-foot { position: absolute; bottom: 44px; left: 7%; display: flex; flex-wrap: wrap; gap: 28px; color: #667eea; font-size: 11px; font-weight: 700; }
.intro-foot b { margin-left: 6px; color: #6c778a; font-weight: 600; }
.upload-card, .pdf-panel, .right-panel { background: #fff; border: 1px solid #e8ebf1; border-radius: 10px; box-shadow: var(--shadow); }
.upload-card { padding: 28px; }
.card-heading, .panel-top, .review-head, .subhead, .results-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.card-heading h2 { margin: 6px 0 20px; color: #1c3d7a; font-size: 20px; font-weight: 600; }
.round-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; background: #eef2ff; color: #526cdd; font-size: 20px; }
.dropzone {
  min-height: 190px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 20px;
  border: 1.5px dashed #aebfea;
  border-radius: 8px;
  background: #f7f9ff;
  color: #74819c;
  cursor: pointer;
  text-align: center;
}
.dropzone.dragging, .dropzone.has-file { background: #edf2ff; border-color: #667eea; }
.dropzone.dragging { outline: 3px solid #a8b9ff; outline-offset: 4px; }
.dropzone strong { color: #263b68; font-size: 14px; }
.dropzone span { font-size: 12px; }
.dropzone u { color: #315dca; }
.dropzone small { margin-top: 8px; color: #8390a6; font-size: 11px; }
.upload-icon { display: grid; place-items: center; width: 40px; height: 40px; margin-bottom: 5px; border: 1px solid #d6dff7; border-radius: 9px; color: #526cdd; background: #fff; font-size: 23px !important; }
.file-name { margin: 10px 0 15px; color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
.primary { padding: 13px 17px; border: 0; border-radius: 6px; background: linear-gradient(135deg, #667eea 0%, #1e3a8a 100%); color: white; font-weight: 600; text-align: left; }
.primary span { float: right; }
.primary:hover { opacity: .9; }
.wide { width: 100%; }
.privacy { margin: 15px 0 0; color: #8792a2; font-size: 11px; text-align: center; }
.work-head { display: flex; justify-content: space-between; align-items: end; gap: 20px; padding: 26px 24px 20px; }
.work-head h1 { margin: 9px 0 4px; color: #1c3d7a; font-size: 25px; font-weight: 600; }
.work-head p, .muted { margin: 0; color: var(--muted); line-height: 1.55; }
.text-button { padding: 0; border: 0; background: none; color: #526cdd; font-size: 12px; font-weight: 600; }
.text-button:hover { text-decoration: underline; }
.workflow { display: flex; align-items: center; gap: 10px; color: #8993a3; font-size: 11px; white-space: nowrap; }
.workflow span { display: flex; align-items: center; gap: 7px; }
.workflow span.active { color: #315dca; }
.workflow i { width: 35px; height: 1px; background: #ccd5e6; }
.workspace-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; gap: 16px; padding: 0 24px 30px; }
.pdf-panel, .right-panel { min-width: 0; }
.pdf-panel { position: sticky; top: 78px; scroll-margin-top: 78px; }
.panel-top { padding: 18px 20px; border-bottom: 1px solid var(--line); }
.panel-top h2, .right-panel h2 { margin: 5px 0 0; color: #1c3d7a; font-size: 19px; font-weight: 600; }
.panel-top h2 span { color: #8490a1; font-size: 11px; font-weight: 400; }
.pager { display: flex; align-items: center; gap: 10px; color: #697890; font-size: 12px; font-weight: 600; }
.pager button { width: 30px; height: 30px; border: 1px solid var(--line); border-radius: 6px; background: #f8f9fc; color: #526b9b; font-size: 18px; }
.page-wrap { height: calc(100vh - 245px); min-height: 500px; padding: 0; overflow: auto; background: #eceff4; }
.page-wrap:focus-visible { outline: 3px solid #667eea; outline-offset: -3px; }
.page-image { position: relative; max-width: 100%; margin: auto; touch-action: none; user-select: none; line-height: 0; box-shadow: 0 4px 18px rgba(24, 39, 75, .16); }
.page-image img { display: block; width: 100%; height: auto; }
.page-image.reviewing-pdf { touch-action: pan-y; }
[data-area="summary"] { --area-color: #2859c5; --area-fill: rgba(40, 89, 197, .16); }
[data-area="header"] { --area-color: #7042b8; --area-fill: rgba(112, 66, 184, .16); }
[data-area="end"] { --area-color: #a44d19; --area-fill: rgba(164, 77, 25, .16); }
.selection, #drawBox { position: absolute; border: 2px dashed var(--area-color); background: transparent; pointer-events: none; }
.selection.focused { border-style: solid; background: var(--area-fill); }
#drawBox { display: none; border-style: solid; background: var(--area-fill); }
.column-highlight { position: absolute; border-left: 1px solid #3565d4; border-right: 1px solid #3565d4; background: rgba(55, 110, 220, .12); pointer-events: none; }
.pdf-source { position: absolute; left: 1%; right: 1%; min-height: 4px; border: 0; background: rgba(255, 235, 0, .38); mix-blend-mode: multiply; pointer-events: none; }
.pdf-hint { margin: 0; padding: 13px 20px; color: #7a8799; font-size: 11px; }
.right-panel { padding: 22px; overflow: hidden; }
.right-panel > .muted, #setup > .muted { margin-top: 9px; }
.area-list { display: grid; gap: 8px; margin: 20px 0 24px; }
.area { display: flex; align-items: center; gap: 12px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 7px; background: transparent; color: var(--ink); text-align: left; }
.area:hover { border-color: var(--area-color); }
.area.selected { border-color: var(--area-color); background: var(--area-color); color: white; }
.area-num { display: grid; place-items: center; flex: none; width: 28px; height: 28px; border: 1px solid var(--area-color); border-radius: 6px; color: var(--area-color); font-size: 11px; font-weight: 700; }
.area.selected .area-num { border-color: rgba(255, 255, 255, .7); color: white; }
.area strong, .area small { display: block; }
.area strong { font-size: 12px; }
.area small { margin-top: 4px; color: #8490a1; font-size: 11px; }
.area.selected small { color: rgba(255, 255, 255, .8); }
.area-arrow { margin-left: auto; color: var(--area-color); }
.area.selected .area-arrow { color: white; }
.subhead { margin-bottom: 14px; padding-top: 20px; border-top: 1px solid var(--line); }
.subhead h3, .results-head h3 { margin: 0; font-size: 14px; }
.subhead p { margin: 5px 0; color: var(--muted); font-size: 11px; }
.small-button { padding: 8px 10px; border: 1px solid #cfd8ec; border-radius: 6px; background: #fff; color: #315d9d; font-size: 11px; font-weight: 600; }
.small-button:hover { background: #f4f7ff; border-color: #a9bcec; }
.totals-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.totals-form label, .columns-form label { color: #5f6e84; font-size: 11px; font-weight: 600; }
.totals-form input, .columns-form input { display: block; width: 100%; margin-top: 6px; padding: 10px; border: 1px solid #d4dce9; border-radius: 6px; background: #fff; color: var(--ink); }
.notice, .comparison { margin-bottom: 16px; padding: 12px; border: 1px solid #f0dda8; border-radius: 7px; background: #fffbeb; color: #806319; font-size: 11px; line-height: 1.5; }
.review-head { align-items: flex-start; }
.review-head p { margin: 7px 0 18px; }
.status-card { margin: 4px 0 12px; padding: 15px; border: 1px solid #f0d9b1; border-radius: 8px; background: #fff9ef; }
.status-card.ok { border-color: #c9e6d0; background: #f1f9f2; }
.status-title { display: flex; align-items: center; gap: 10px; }
.status-title > span { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: #f4dfc2; color: #9d5b18; font-weight: 700; }
.ok .status-title > span { background: #d6ecd9; color: #247645; }
.status-title strong, .status-title small { display: block; }
.status-title strong { font-size: 12px; }
.status-title small { margin-top: 4px; color: #796f60; font-size: 11px; }
.check-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.check-grid div { min-width: 0; padding-top: 9px; border-top: 1px solid #e8e3d7; }
.check-grid span, .check-grid strong, .check-grid small { display: block; }
.check-grid span { color: #776e60; font-size: 11px; }
.check-grid strong { margin: 4px 0; font-size: 13px; }
.check-grid small { color: #87643e; font-size: 10px; line-height: 1.4; overflow-wrap: anywhere; }
.status-card p { margin: 10px 0 0; color: #87643e; font-size: 11px; }
.results-head { margin: 18px 0 10px; }
.results-head span { color: #8490a1; font-size: 11px; }
.compact { padding: 9px 12px; font-size: 11px; }
/* Each movement adapts to the available width and keeps every field visible. */
.table-wrap { max-height: 440px; overflow-y: auto; overflow-x: hidden; border: 1px solid var(--line); border-radius: 7px; container: results / inline-size; }
.table-wrap table, .table-wrap tbody { display: block; width: 100%; min-width: 0; border-collapse: collapse; text-align: left; }
.table-wrap thead { display: none; }
.table-wrap tr { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(140px, 100%), 1fr)); gap: 6px 10px; padding: 10px; border-top: 1px solid #e9edf3; }
.table-wrap tr:first-child { border-top: 0; }
.table-wrap td { display: block; min-width: 0; padding: 0; border: 0; vertical-align: top; }
.table-wrap td.field-description, .table-wrap td.field-actions, .table-wrap td.wide-value { grid-column: 1 / -1; }
@container results (min-width: 460px) { .table-wrap td.field-description { grid-column: span 2; } }
.field-label { display: block; margin: 0 0 2px 4px; color: #62718a; font-size: 10px; font-weight: 600; line-height: 1.25; overflow-wrap: anywhere; }
.table-wrap td input:not(.native-date-picker), .table-wrap td textarea { display: block; width: 100%; min-width: 0; max-width: 100%; padding: 4px; border: 1px solid transparent; background: transparent; color: var(--ink); font-size: 11px; line-height: 1.4; }
.table-wrap td textarea { font-family: inherit; min-height: 25px; overflow: hidden; resize: none; white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word; }
.table-wrap td input:focus, .table-wrap td textarea:focus { border-color: #9badde; border-radius: 4px; }
.table-wrap td small { display: block; margin: 4px; color: #8692a4; font-size: 10px; }
.table-wrap td.field-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.table-wrap .field-actions .delete { margin-left: auto; }
.table-wrap .row-flag:empty { display: none; }
.table-wrap .amount-kind { width: 100%; min-width: 0; max-width: 100%; }
.table-wrap tr.source-active { background: #edf3ff; }
.suspect { background: #fffbf3; }
.source-active { box-shadow: inset 3px 0 #5276e2; }
.table-wrap .source-active td { background: transparent; }
.delete { border: 0; background: none; color: #8a97aa; font-size: 17px; }
.row-source { padding: 3px; border: 0; background: none; color: #315dca; font-size: 18px; }
.row-source:disabled { color: #aeb7c4; }
.row-source svg { display: block; width: 17px; height: 17px; }
.row-flag { padding: 3px; border: 0; background: transparent; color: #ae6a22; font-size: 12px; font-weight: 700; cursor: pointer; }
.table-note { color: #7f8b9d; font-size: 11px; }
.toast { position: fixed; right: 20px; bottom: 20px; z-index: 40; max-width: 420px; padding: 13px 18px; border-radius: 7px; background: #1c3d7a; color: white; box-shadow: 0 8px 25px #0002; }
.columns-form { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.column-note { color: #7b899d; font-size: 11px; line-height: 1.5; }
.column-marker { position: absolute; z-index: 3; top: 0; bottom: 0; width: 18px; margin-left: -9px; cursor: col-resize; touch-action: none; }
.column-marker::before { content: ''; position: absolute; top: 0; bottom: 0; left: 50%; border-left: 2px dashed #3b65cc; }
.column-marker-handle { position: absolute; top: var(--handle-top); left: 50%; transform: translate(-50%, -50%); display: grid; place-items: center; width: 25px; height: 25px; border: 2px solid #fff; border-radius: 6px; background: #315dca; color: white; font-size: 15px; font-weight: 700; line-height: 1; box-shadow: 0 1px 5px #1c3d7a55; }
.column-marker:hover::before, .column-marker:focus-visible::before, .column-marker.dragging::before { border-left-style: solid; border-left-color: #142f80; }
.column-marker:focus-visible .column-marker-handle, .column-marker.dragging .column-marker-handle { background: #142f80; outline: 3px solid #9fb4ff; }
#resumeReview { margin-bottom: 10px; text-align: center; }
.money-note { display: block; margin: 5px 0 0; color: #9a611f; font-size: 10px; line-height: 1.4; overflow-wrap: anywhere; }
.column-hint { margin: 0 0 10px; color: #65738a; font-size: 11px; line-height: 1.5; }
.column-toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 9px; }
.column-toolbar > span { color: #65738a; font-size: 11px; font-weight: 600; }
.columns-list { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 10px; }
.column-row { position: relative; flex: 1 0 120px; min-width: 120px; max-width: 230px; padding: 10px; border: 1px solid var(--line); border-radius: 7px; background: #fbfcfe; cursor: pointer; }
.column-row:hover { border-color: #9cb3eb; }
.column-row.column-selected { border-color: #3565d4; background: #eef4ff; box-shadow: 0 0 0 1px #3565d4; }
.column-title { min-width: 0; padding-right: 13px; }
.column-select { display: block; width: 100%; padding: 0; border: 0; background: none; color: var(--ink); font-size: 11px; font-weight: 700; text-align: left; }
.column-select:hover { color: #315dca; }
.column-title small { display: block; }
.column-title small { margin-top: 3px; color: #7d8ca0; font-size: 10px; overflow-wrap: anywhere; }
.column-row label { color: #62718a; font-size: 10px; font-weight: 600; }
.column-row input { display: block; width: 100%; margin-top: 3px; padding: 7px; border: 1px solid #d4dce9; border-radius: 6px; color: var(--ink); }
.column-remove { position: absolute; top: 4px; right: 5px; padding: 2px 5px; border: 0; background: none; color: #8492a7; font-size: 17px; }
.column-add { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 18px; }
.column-add select, .amount-kind, .column-meaning select { padding: 7px; border: 1px solid #d4dce9; border-radius: 6px; background: #fff; color: #526581; font-size: 11px; }
.column-add select { min-width: 0; max-width: 190px; }
.amount-kind { display: block; max-width: 100%; margin: 4px 0; padding: 4px; }
.column-title .column-custom-name { width: 100%; max-width: 220px; margin-top: 5px; padding: 5px; font-size: 11px; }
.column-meaning { display: block; margin-top: 5px; color: #62718a; font-size: 10px; }
.column-meaning select { display: block; width: 100%; max-width: 230px; margin-top: 3px; padding: 5px; }
@media (max-width: 1100px) {
  .welcome { gap: 35px; padding-right: 5%; padding-left: 5%; }
  .intro-foot { left: 5%; }
  .workspace-grid { grid-template-columns: minmax(0, 1fr); }
  .pdf-panel { position: static; }
  .page-wrap { height: 560px; min-height: 0; }
}
@media (max-width: 768px) {
  body { margin-left: 54px; }
  .side-rail { width: 54px; }
  .rail-current { width: 40px; height: 40px; }
  .rail-current svg { width: 21px; height: 21px; }
  .top { padding: 12px 16px; }
  .brand-logo { height: 32px; }
  .brand-text strong { font-size: 17px; }
  .top-note { font-size: 11px; }
  .welcome { display: block; min-height: 0; padding: 36px 18px 35px; }
  .intro h1 { font-size: 36px; }
  .intro p { font-size: 14px; }
  .upload-card { margin-top: 25px; padding: 21px; }
  .intro-foot { position: static; margin-top: 25px; gap: 16px; }
  .work-head { display: block; padding: 24px 16px 18px; }
  .workflow { margin-top: 16px; }
  .workspace-grid { display: flex; flex-direction: column; align-items: stretch; padding: 0 12px 24px; }
  .right-panel { padding: 18px; }
  .page-wrap { height: 430px; padding: 0; }
}
@media (max-width: 480px) {
  .top-note { display: none; }
  .top { gap: 8px; }
  .brand { gap: 6px; overflow: hidden; }
  .brand-text small { font-size: 9px; letter-spacing: .7px; white-space: nowrap; }
  .brand-logo { height: 24px; }
  .brand-text strong { font-size: 16px; white-space: nowrap; }
  .brand-service { display: none; }
  .review-head, .subhead { align-items: flex-start; }
  .check-grid { grid-template-columns: 1fr; }
}
/* Los campos conservan el formato visible de la fecha y el calendario nativo. */
.date-editor { position: relative; display: flex; align-items: center; min-width: 0; width: 100%; margin-top: 6px; border: 1px solid #d4dce9; border-radius: 6px; background: #fff; }
.totals-form .date-editor input:not(.native-date-picker) { flex: 1; min-width: 0; margin: 0; padding: 10px; border: 0; background: transparent; }
.date-trigger { display: grid; flex: none; place-items: center; width: 30px; height: 32px; padding: 5px; border: 0; background: transparent; color: #6c778a; }
.date-trigger svg { width: 17px; height: 17px; }
.date-editor .native-date-picker, .totals-form .date-editor .native-date-picker, td .date-editor .native-date-picker { position: absolute; right: 0; bottom: 0; width: 1px; height: 1px; margin: 0; padding: 0; border: 0; opacity: 0; pointer-events: none; }
.date-editor input[aria-invalid="true"] { color: #b3261e; }
td .date-editor { margin-top: 0; border-color: transparent; background: transparent; }
td .date-editor:focus-within { border-color: #9badde; }
td .date-editor input:not(.native-date-picker) { flex: 1; min-width: 0; padding: 4px; border: 0; }
td .date-trigger { width: 24px; height: 25px; padding: 3px; }
.summary-check { margin: 0 0 18px; padding: 10px 12px; border: 1px solid #f0d9b1; border-radius: 6px; background: #fff9ef; color: #76521f; font-size: 12px; line-height: 1.45; }
.summary-check.ok { border-color: #c9e6d0; background: #f1f9f2; color: #23633c; }
.row-suggestion, .undo-correction { display: block; max-width: 190px; margin: 5px 0; padding: 5px 7px; border: 1px solid #a8bbee; border-radius: 5px; background: #f2f6ff; color: #1d4c9c; font-size: 10px; font-weight: 600; line-height: 1.3; text-align: left; }
.undo-correction { border-color: #d4dce9; background: #fff; color: #64748b; }
.correction-note { color: #805514; line-height: 1.35; overflow-wrap: anywhere; }
.correction-summary { display: grid; gap: 8px; max-height: 240px; margin: 0 0 12px; padding: 12px; overflow: auto; border: 1px solid #cbd9f3; border-radius: 8px; background: #f7faff; }
.correction-summary > strong { color: #1c3d7a; font-size: 12px; }
.correction-summary-item { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; padding-top: 7px; border-top: 1px solid #e1e9f7; }
.correction-summary-item > span { flex: 1 1 180px; font-size: 11px; overflow-wrap: anywhere; }
/* Áreas y acciones opcionales */
.setup-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.xml-pending { display: block; margin: 0 0 12px; color: #6c778a; font-size: 11px; overflow-wrap: anywhere; }
.area-panel { min-width: 0; padding: 14px; border: 1px solid #e0e6f0; border-radius: 7px; background: #fff; }
.area-panel .subhead:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.layout-choice { margin-bottom: 16px; padding: 12px; border: 1px solid #d4dff2; border-radius: 7px; background: #f7f9ff; }
.layout-choice > label { display: block; margin-bottom: 6px; color: #526581; font-size: 11px; font-weight: 600; }
.layout-controls { display: flex; flex-wrap: wrap; gap: 6px; }
.layout-controls select { flex: 1 1 150px; min-width: 0; padding: 8px; border: 1px solid #d4dce9; border-radius: 6px; background: #fff; color: var(--ink); font-size: 11px; }
.layout-choice small { display: block; margin-top: 6px; color: #718099; font-size: 11px; line-height: 1.45; }
#reloadLayouts { margin-top: 8px; }
.results-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.modal { width: min(460px, calc(100% - 32px)); max-height: calc(100% - 32px); padding: 0; overflow: auto; border: 0; border-radius: 10px; background: #fff; color: var(--ink); box-shadow: 0 18px 55px rgba(15, 23, 42, .3); }
.modal::backdrop { background: rgba(15, 23, 42, .55); }
.modal-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 20px; color: #fff; background: linear-gradient(135deg, #1c1565 0%, #5b84f7 100%); }
.modal-head h2 { margin: 0; font-size: 17px; font-weight: 600; }
.modal-close { width: 28px; height: 28px; padding: 0; border: 0; border-radius: 5px; background: transparent; color: #fff; font-size: 22px; line-height: 1; }
.modal-close:hover { background: rgba(255, 255, 255, .18); }
.modal > p, .modal-field, .modal-note { display: block; margin: 16px 20px; color: #617087; font-size: 13px; line-height: 1.5; }
.modal-field { color: #40516a; font-weight: 600; }
.modal-field input { display: block; width: 100%; max-width: 100%; margin-top: 6px; padding: 9px; border: 1px solid #d4dce9; border-radius: 6px; background: #fff; color: var(--ink); font-size: 13px; font-weight: 400; }
.modal-note { color: #7b899c; font-size: 11px; }
.modal .modal-status { font-size: 12px; }
.modal .modal-error { padding: 9px; border: 1px solid #fecaca; border-radius: 6px; background: #fff5f5; color: #a12626; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px 20px; }

/* Access and session controls */
.top-actions { display:flex; align-items:center; gap:16px; }
.logout-button { border:1px solid #fff; border-radius:6px; padding:8px 12px; color:#1c3d7a; background:#fff; font-size:12px; font-weight:600; white-space:nowrap; }
.logout-button:hover { background:#edf2ff; }
.login-page { margin:0; min-height:100vh; display:flex; align-items:center; justify-content:center; padding:24px; background:linear-gradient(135deg,#1c1565,#587ee8); }
.login-shell { width:min(100%,420px); }
.login-brand { display:flex; align-items:center; gap:12px; margin:0 0 20px; color:white; }
.login-brand img { width:110px; height:auto; flex:0 0 110px; }
.login-brand small, .login-brand strong { display:block; }
.login-brand small { font-size:10px; letter-spacing:.14em; opacity:.8; }
.login-brand strong { font-size:21px; }
.login-card { padding:32px; border-radius:12px; background:white; box-shadow:0 15px 50px rgba(12,19,60,.25); }
.login-card h1 { margin:9px 0; font-size:27px; }
.login-card > p { margin:0 0 24px; color:#617087; font-size:14px; }
.login-card label { display:block; margin-bottom:16px; color:#40516a; font-weight:600; font-size:13px; }
.login-card input { display:block; width:100%; margin-top:6px; padding:11px; border:1px solid #cbd5e1; border-radius:6px; font-size:15px; color:var(--ink); }
.login-card .login-message { margin:0 0 14px; color:#8c302d; font-size:13px; }
.login-foot { text-align:center; color:rgba(255,255,255,.8); font-size:12px; }
@media (max-width:480px) { .top-actions { gap:6px; } .logout-button { padding:7px 8px; font-size:11px; } .login-brand img { width:88px; flex-basis:88px; } .login-brand strong { font-size:18px; } .login-card { padding:24px; } }

/* Extraction warnings stay separate from individual movement warnings. */
.extraction-problem { display:flex; justify-content:space-between; align-items:center; flex-wrap:wrap; gap:8px 12px; margin:12px 0 0; font-size:12px; }
.problem-actions { display:flex; flex-wrap:wrap; gap:6px; }
.problem-actions button { padding:5px 9px; border:1px solid currentColor; border-radius:5px; background:transparent; color:inherit; font-size:11px; font-weight:600; }
.problem-actions button:hover { background:rgba(255,255,255,.6); }
.reviewed-problems { margin-top:12px; font-size:12px; }
.reviewed-problems summary { cursor:pointer; font-weight:600; }

.movement-problem > span, .extraction-problem > span { overflow-wrap:anywhere; }

/* Selección de documento y convención de signos */
.statement-types { margin: 4px 0 14px; padding: 0; border: 0; }
.statement-types legend { margin-bottom: 7px; color: #526581; font-size: 11px; font-weight: 600; }
.statement-types label { display: inline-flex; align-items: center; gap: 6px; margin: 0 13px 6px 0; color: #40516a; font-size: 12px; }
.statement-types input { accent-color: #315dca; }
.card-sign-settings { margin: 0 0 16px; padding: 12px; border: 1px solid #dbe4f4; border-radius: 7px; background: #f7f9ff; }
.card-sign-settings p { margin: 0 0 8px; color: #40516a; font-size: 12px; }
.card-sign-settings > div { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(160px,100%),1fr)); gap: 10px; }
.card-sign-settings label { color: #526581; font-size: 11px; font-weight: 600; }
.card-sign-settings select { display: block; width: 100%; margin-top: 4px; padding: 7px; border: 1px solid #d4dce9; border-radius: 5px; color: #263348; background: #fff; }
.card-sign-settings small { display: block; margin-top: 8px; color: #65738a; font-size: 11px; }

.card-breakdown { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.card-breakdown h4 { margin: 0 0 5px; font-size: 14px; }
.card-breakdown p { margin: 0 0 12px; color: var(--muted); }
.summary-alternative { margin: 5px 0 0; padding: 4px 8px; color: var(--blue-dark); border: 1px solid #cad6ec; border-radius: 5px; background: white; font-size: 11px; }

/* Resumen editable: sigue el orden de los conceptos del estado de cuenta. */
.summary-table-heading { display:none; }
.account-mode .summary-figures { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; margin-bottom:18px; }
.summary-figure { min-width:0; color:#5f6e84; font-size:11px; font-weight:600; }
.summary-value { display:block; min-width:0; }
.summary-value input { display:block; width:100%; min-width:0; margin-top:6px; padding:10px; border:1px solid #d4dce9; border-radius:6px; background:#fff; color:var(--ink); }
.summary-operator { display:none; }
.card-mode .summary-figures { border:1px solid var(--line); border-radius:6px; overflow:hidden; }
.card-mode .summary-figure, .card-mode .summary-table-heading { display:grid; grid-template-columns:minmax(0,1fr) 24px minmax(110px,170px); gap:4px; align-items:center; padding:2px 8px; }
.card-mode .summary-table-heading { padding-top:5px; padding-bottom:5px; border:1px solid var(--line); border-bottom:0; border-radius:6px 6px 0 0; background:#f2f4f8; color:#526581; font-size:11px; font-weight:700; }
.card-mode .summary-figures { border-radius:0 0 6px 6px; }
.card-mode .summary-figure + .summary-figure { border-top:1px solid var(--line); }
.card-mode .summary-operator { display:block; text-align:center; color:#5f6e84; }
.card-mode .summary-value input { height:26px; margin-top:0; padding:3px 6px; text-align:right; }
.summary-extras { margin:12px 0 18px; }
.summary-extras summary { cursor:pointer; color:#526581; font-size:11px; font-weight:600; }
.summary-extras .summary-figures { margin-top:8px; border-radius:6px; }
@media (max-width:480px) { .card-mode .summary-figure,.card-mode .summary-table-heading { grid-template-columns:minmax(0,1fr) 18px minmax(94px,39%); padding:3px 6px; } .card-mode .summary-value input { height:36px; } }

.summary-source { margin:0 0 10px; color:#65738a; font-size:11px; line-height:1.45; }

.summary-reviewed { margin:3px 0 0; padding:3px 6px; border:1px solid #cfd8ec; border-radius:5px; background:#fff; color:#315d9d; font-size:10px; font-weight:600; }

.type-choice { margin: 12px 0; padding: 14px; border: 1px solid #cbd9f2; border-radius: 8px; background: #f6f8fd; color: #1c3d7a; font-size: 13px; }
.type-choice p { margin: 6px 0 10px; color: #617087; }
.type-choice > div, .type-dialog-options { display: flex; flex-wrap: wrap; gap: 8px; }
.type-dialog-options { padding: 0 20px 20px; }
.detected-type { display: flex; align-items: center; gap: 10px; margin-top: 8px; color: #526581; font-size: 12px; }
.detected-type .text-button { font-size: 12px; }
