@font-face { font-family: "Open Sans"; src: url("/static/fonts/open-sans-latin.woff2") format("woff2"); font-style: normal; font-weight: 400 700; font-display: swap; }

:root {
  --navy: #0b223f;
  --navy-soft: #173655;
  --navy-ink: #071b35;
  --orange: #ff7a18;
  --orange-dark: #e86208;
  --orange-pale: #fff4eb;
  --paper: #f4f6f9;
  --white: #ffffff;
  --line: #dfe5ed;
  --muted: #66758a;
  --red: #b13a32;
  --green: #157257;
  --shadow: 0 12px 34px rgba(11, 34, 63, .07);
}

* { box-sizing: border-box; }
html { min-width: 320px; scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--navy-ink); font-family: "Open Sans", "Segoe UI", system-ui, sans-serif; font-size: 16px; line-height: 1.55; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; font-variant-numeric: tabular-nums; }
button, input, select, textarea { font: inherit; }
button { min-height: 44px; border: 0; cursor: pointer; }
h1, h2, h3, h4, p { margin: 0; }
h1, h2, h3, h4 { text-wrap: balance; }
p { text-wrap: pretty; }
h1 { font-size: 26px; line-height: 1.15; letter-spacing: -.025em; }
h2 { font-size: clamp(24px, 3vw, 32px); line-height: 1.2; letter-spacing: -.025em; }
h3 { font-size: 19px; line-height: 1.25; letter-spacing: -.015em; }
h4 { font-size: 15px; line-height: 1.3; letter-spacing: -.01em; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 244px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; z-index: 20; height: 100vh; height: 100dvh; display: flex; flex-direction: column; padding: 18px 12px 12px; overflow-y: auto; overscroll-behavior: contain; background: var(--navy); color: #fff; }
.brand { display: flex; align-items: center; gap: 12px; min-height: 62px; padding: 0 4px 18px; }
.brandmark { width: 42px; height: 42px; flex: 0 0 42px; display: grid; place-items: center; border-radius: 13px; background: var(--orange); color: #fff; font-size: 15px; font-weight: 700; box-shadow: 0 10px 24px rgba(255, 122, 24, .32); }
.brand strong { display: block; font-size: 17px; }
.brand span { display: block; margin-top: 4px; color: #d9e5f3; font-size: 12px; line-height: 1.35; letter-spacing: .08em; text-transform: uppercase; }
.sidebar-nav { display: grid; gap: 6px; margin-top: 14px; }
.sidebar-nav button { position: relative; width: 100%; min-height: 50px; display: flex; align-items: center; gap: 13px; padding: 0 14px; border-radius: 11px; background: transparent; color: #e5edf7; text-align: left; font-size: 15px; font-weight: 600; }
.sidebar-nav button::before { content: ""; position: absolute; left: -5px; top: 8px; bottom: 8px; width: 3px; border-radius: 2px; background: transparent; }
.sidebar-nav button:hover { background: rgba(255,255,255,.07); }
.sidebar-nav button.active { background: rgba(255, 122, 24, .14); color: #fff; }
.sidebar-nav button.active::before { background: var(--orange); }
.nav-icon { width: 20px; color: #fff; font-size: 20px; line-height: 1; text-align: center; }
.sidebar-status { display: grid; gap: 8px; margin-top: auto; padding-top: 28px; }
.status-card { display: flex; align-items: center; gap: 10px; min-height: 58px; padding: 10px 12px; border: 1px solid rgba(255,255,255,.1); border-radius: 11px; background: rgba(255,255,255,.055); }
.status-card small, .sidebar-user small { display: block; color: #bacade; font-size: 12px; line-height: 1.35; }
.status-card strong { display: block; margin-top: 3px; font-size: 13px; }
.status-dot { width: 9px; height: 9px; flex: 0 0 9px; border-radius: 50%; background: #9aabc0; box-shadow: 0 0 0 5px rgba(154,171,192,.12); }
.status-dot.ready { background: #43c597; box-shadow: 0 0 0 5px rgba(67,197,151,.12); }
.status-dot.pending { background: var(--orange); box-shadow: 0 0 0 5px rgba(255,122,24,.13); }
.sidebar-user { display: grid; grid-template-columns: 34px minmax(0,1fr) auto; align-items: center; gap: 9px; margin: 12px -12px -12px; padding: 12px; border-top: 1px solid rgba(255,255,255,.08); background: rgba(0,0,0,.12); }
.sidebar-user strong { display: block; overflow: hidden; color: #fff; font-size: 13px; text-overflow: ellipsis; }
.user-avatar { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; background: var(--orange); font-size: 12px; font-weight: 700; }
.logout-button { min-height: 38px; padding: 0 11px; border-radius: 8px; background: #284561; color: #fff; font-size: 12px; font-weight: 700; }
.logout-button:hover { background: #375776; }

.content-shell { min-width: 0; }
.topbar { min-height: 78px; display: flex; align-items: center; gap: 14px; padding: 14px clamp(22px, 4.6vw, 64px); border-bottom: 1px solid var(--line); background: var(--white); }
.topbar > div, .page-intro > div, .panel-heading > div, .card > div { min-width: 0; }
.topbar h1, .page-intro h2, .panel-heading h3, .card h3 { overflow-wrap: anywhere; }
.eyebrow, .step-label { margin-bottom: 6px; color: var(--orange-dark); font-size: 12px; font-weight: 700; letter-spacing: .11em; text-transform: uppercase; }
.menu-toggle { display: none; width: 40px; height: 40px; border-radius: 9px; background: var(--navy); color: #fff; font-size: 20px; }
main { max-width: 1320px; margin: 0 auto; padding: 38px clamp(22px, 4.6vw, 64px) 70px; }
.page-intro { display: flex; justify-content: space-between; align-items: center; gap: 24px; margin-bottom: 26px; }
.page-intro p { max-width: 700px; margin-top: 9px; color: var(--muted); line-height: 1.55; }
.primary-action, dialog button[type="submit"], .login-card button[type="submit"] { min-height: 48px; flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; padding: 0 20px; border-radius: 10px; background: var(--orange); color: #fff; font-size: 16px; font-weight: 700; box-shadow: 0 9px 20px rgba(255,122,24,.19); }
.primary-action:hover, dialog button[type="submit"]:hover, .login-card button[type="submit"]:hover, .actions button:hover { background: var(--orange-dark); }
.section-panel { min-height: 280px; padding: 25px; border: 1px solid var(--line); border-radius: 17px; background: var(--white); box-shadow: var(--shadow); }
.panel-heading { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 20px; padding-bottom: 19px; border-bottom: 1px solid var(--line); }
.panel-heading > p { max-width: 430px; color: var(--muted); font-size: 14px; line-height: 1.5; text-align: right; }
.list-controls { display: grid; grid-template-columns: minmax(240px,1fr) minmax(170px,240px); gap: 12px; align-items: end; margin-bottom: 14px; }
#customers .list-controls { grid-template-columns: minmax(240px,1fr); }
.list-controls label { margin-bottom: 0; }
.list-pager { display: flex; justify-content: center; align-items: center; gap: 12px; margin: 12px 0; color: var(--muted); font-size: 14px; }
.list-pager button { min-height: 44px; padding: 0 15px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--navy); font-size: 14px; font-weight: 700; }
.list-pager button:disabled { opacity: .45; cursor: not-allowed; }
.cards { display: grid; gap: 12px; }
.card { display: grid; grid-template-columns: minmax(200px,1.2fr) minmax(115px,.65fr) minmax(120px,.5fr) minmax(100px,.5fr) minmax(400px,1.4fr); gap: 15px; align-items: center; padding: 17px; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
.card:hover { border-color: #cfd7e2; box-shadow: 0 8px 25px rgba(11,34,63,.055); }
.campaign-details { grid-column: 1 / -1; width: 100%; padding-top: 10px; border-top: 1px solid var(--line); }
.campaign-details summary { cursor: pointer; color: var(--navy); font-size: 14px; font-weight: 700; }
.campaign-details .import-table-wrap { margin-top: 12px; }
.campaign-decision { min-height: 36px; margin-top: 8px; padding: 0 10px; border-radius: 7px; background: var(--navy); color: #fff; font-size: 14px; }
.import-table td button { min-height: 36px; margin: 8px 6px 0 0; padding: 0 11px; border-radius: 7px; background: var(--navy); color: #fff; font-size: 13px; font-weight: 700; }
.import-table td button:hover { background: var(--navy-soft); }
.actions button:disabled { cursor: not-allowed; opacity: .45; }
.review-document-link { display: inline-flex; align-items: center; min-height: 44px; margin-top: 15px; padding: 0 14px; border-radius: 8px; background: var(--navy); color: #fff; font-weight: 700; text-decoration: none; }
.review-signature-found { padding: 10px 12px; border-left: 4px solid var(--orange); border-radius: 0 8px 8px 0; background: #fff4eb; color: #82410f; font-weight: 600; }
.review-checklist { display: grid; gap: 6px; margin: 18px 0; }
.card h3 { margin: 0 0 4px; font-size: 17px; }
.meta { margin-top: 5px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.status { display: inline-flex; align-items: center; min-height: 28px; padding: 4px 10px; border-radius: 999px; background: #e8f7f1; color: var(--green); font-size: 12px; font-weight: 600; }
.status.queued, .status.draft, .status.received_review, .status.legacy_review { background: var(--orange-pale); color: #a64c0b; }
.status.partial, .status.scheduled, .status.running { background: #fff1e5; color: #a64c0b; }
.status.cancelled, .status.failed { background: #fcebea; color: var(--red); }
.actions { min-width: 0; display: flex; justify-content: flex-end; align-items: stretch; gap: 6px; flex-wrap: wrap; }
.actions button, .actions a, .actions .upload { height: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; margin: 0; padding: 0 10px; border: 1px solid transparent; border-radius: 8px; background: var(--orange); color: #fff; font-size: 14px; line-height: 1.2; font-weight: 600; white-space: nowrap; text-decoration: none; }
.actions a, .actions .upload { border-color: var(--line); background: #f6f8fb; color: var(--navy); }
.empty { padding: 52px 24px; border: 1px dashed #c7d0dc; border-radius: 13px; background: #fbfcfd; color: var(--muted); text-align: center; }
.directory-tools { margin-bottom: 20px; padding: 18px; border: 1px solid #f3c49c; border-radius: 13px; background: var(--orange-pale); }
.directory-search-form { display: grid; grid-template-columns: minmax(220px,1fr) auto; align-items: end; gap: 12px; }
.directory-search-form label { margin: 0; }
.directory-search-form button { min-height: 44px; padding: 0 18px; border-radius: 9px; background: var(--navy); color: #fff; font-size: 13px; font-weight: 700; }
.directory-help { margin-top: 10px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.directory-results { display: grid; gap: 8px; margin-top: 13px; }
.directory-result { display: grid; grid-template-columns: minmax(190px,1fr) auto auto; align-items: center; gap: 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.directory-result strong { display: block; font-size: 14px; }
.directory-result span { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; }
.directory-result button { min-height: 40px; padding: 0 14px; border-radius: 8px; background: var(--orange); color: #fff; font-size: 12px; font-weight: 700; }
.review-flag { color: #a64c0b !important; font-weight: 700; }
.notice { margin-bottom: 20px; padding: 13px 15px; border: 1px solid #f3c49c; border-radius: 10px; background: var(--orange-pale); color: #82410f; font-size: 13px; line-height: 1.45; }
.import-safety { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 20px; padding: 15px 17px; border-left: 4px solid var(--orange); border-radius: 10px; background: var(--orange-pale); color: #82410f; }
.import-safety strong { flex: 0 0 auto; font-size: 13px; }
.import-safety span { font-size: 13px; line-height: 1.5; }
.campaign-controls { display: flex; align-items: end; flex-wrap: wrap; gap: 16px; margin-bottom: 18px; }
.campaign-controls label { min-width: 180px; }
.campaign-controls p { margin-bottom: 16px; color: var(--muted); font-size: 14px; }
.import-controls { display: grid; grid-template-columns: minmax(240px,1fr) minmax(150px,.45fr) auto; align-items: end; gap: 12px; }
.secondary-action, .import-list-head button { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; padding: 0 17px; border-radius: 9px; background: var(--navy); color: #fff; font-size: 13px; font-weight: 700; }
.secondary-action:hover, .import-list-head button:hover:not(:disabled) { background: var(--navy-soft); }
.secondary-action:disabled, .import-list-head button:disabled { cursor: not-allowed; opacity: .48; }
.import-metrics { display: grid; grid-template-columns: repeat(6,minmax(110px,1fr)); gap: 10px; margin: 20px 0; }
.import-metrics > div { padding: 14px; border: 1px solid var(--line); border-radius: 11px; background: #f8fafc; }
.import-metrics strong, .import-metrics span { display: block; }
.import-metrics strong { color: var(--navy); font-size: 22px; line-height: 1.2; }
.import-metrics span { margin-top: 5px; color: var(--muted); font-size: 12px; }
.import-list-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.import-list-head strong, .import-list-head span { display: block; }
.import-list-head strong { font-size: 15px; }
.import-list-head span { margin-top: 3px; color: var(--muted); font-size: 12px; }
.import-table-wrap { max-width: 100%; overflow: auto; overscroll-behavior-inline: contain; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: 12px; }
.import-table { width: 100%; min-width: 1050px; border-collapse: collapse; background: #fff; font-size: 14px; }
.import-table th { padding: 11px 12px; border-bottom: 1px solid var(--line); background: #f5f7fa; color: var(--muted); font-size: 12px; text-align: left; text-transform: uppercase; letter-spacing: .04em; }
.import-table td { max-width: 290px; padding: 13px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.import-table tr:last-child td { border-bottom: 0; }
.import-table td strong, .import-table td span { display: block; }
.import-table td span { margin-top: 4px; color: var(--muted); line-height: 1.4; }
.import-table ul { margin: 6px 0 0; padding-left: 17px; color: var(--muted); }
.import-table li { margin-top: 3px; line-height: 1.4; }
.import-table .import-checkbox { width: 18px; min-height: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--orange); }
.import-class, .reconciliation { display: inline-flex !important; width: fit-content; min-height: 25px; align-items: center; margin: 0 !important; padding: 3px 8px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.import-class.ready, .reconciliation.exact { background: #e8f7f1; color: var(--green); }
.import-class.review, .reconciliation.mismatch, .reconciliation.multiple_invoices { background: var(--orange-pale); color: #a64c0b; }
.import-class.excluded { background: #eef1f5; color: #4f6075; }
.import-class.error { background: #faecea; color: var(--red); }
.reconciliation.not_reported, .reconciliation.not_comparable { background: #eef3f8; color: #51667c; }
.matched { color: var(--green) !important; font-weight: 700; }
.unmatched { color: #a64c0b !important; font-weight: 700; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.hidden, [hidden] { display: none !important; }
.tab { display: none; }
.tab.active { display: block; }

.guide-anchor { display: block; scroll-margin-top: 18px; }
.guide-hero { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 30px; margin-bottom: 18px; padding: 30px 32px; overflow: hidden; border-radius: 18px; background: linear-gradient(125deg,var(--navy) 0%,#143c62 100%); color: #fff; box-shadow: 0 16px 36px rgba(11,34,63,.14); }
.guide-hero::after { content: ""; position: absolute; right: -75px; bottom: -105px; width: 250px; height: 250px; border: 38px solid rgba(255,122,24,.12); border-radius: 50%; }
.guide-hero > * { position: relative; z-index: 1; }
.guide-hero h3 { font-size: 26px; }
.guide-hero p:not(.step-label) { max-width: 760px; margin-top: 10px; color: #d3deea; font-size: 14px; line-height: 1.6; }
.guide-hero-badge { flex: 0 0 auto; display: flex; align-items: center; gap: 10px; min-width: 150px; padding: 13px 16px; border: 1px solid rgba(255,255,255,.16); border-radius: 13px; background: rgba(255,255,255,.08); }
.guide-hero-badge strong { color: var(--orange); font-size: 30px; line-height: 1; }
.guide-hero-badge span { color: #e1e9f2; font-size: 12px; line-height: 1.35; }
.guide-index { margin-bottom: 22px; padding: 24px; border: 1px solid var(--line); border-radius: 17px; background: #fff; box-shadow: var(--shadow); }
.guide-index-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 18px; }
.guide-index-heading > p { color: var(--muted); font-size: 13px; }
.guide-flow { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 11px; }
.guide-card { width: 100%; min-height: 118px; display: grid; grid-template-columns: 40px minmax(0,1fr) 24px; align-items: start; gap: 13px; padding: 17px; border: 1px solid var(--line); border-radius: 13px; background: #f8fafc; color: var(--navy-ink); text-align: left; transition: border-color .18s ease, transform .18s ease, box-shadow .18s ease, background .18s ease; }
.guide-card:hover { transform: translateY(-2px); border-color: #f0a56e; background: #fff; box-shadow: 0 12px 24px rgba(11,34,63,.08); }
.guide-card:focus-visible { outline: 3px solid rgba(255,122,24,.24); outline-offset: 2px; }
.guide-step { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 11px; background: var(--orange); color: #fff; font-size: 15px; font-weight: 700; box-shadow: 0 7px 16px rgba(255,122,24,.2); }
.guide-card-copy, .guide-card-copy strong, .guide-card-copy small { display: block; }
.guide-card-copy strong { margin: 1px 0 7px; color: var(--navy); font-size: 15px; line-height: 1.3; }
.guide-card-copy small { color: var(--muted); font-size: 12px; line-height: 1.5; }
.guide-arrow { align-self: center; color: var(--orange-dark); font-size: 20px; line-height: 1; }
.guide-chapters { display: grid; gap: 22px; }
.guide-chapter { scroll-margin-top: 18px; padding: 30px; border: 1px solid var(--line); border-radius: 18px; background: #fff; box-shadow: var(--shadow); }
.guide-chapter-head { display: grid; grid-template-columns: 48px minmax(0,1fr); gap: 16px; align-items: start; margin-bottom: 22px; padding-bottom: 21px; border-bottom: 1px solid var(--line); }
.guide-chapter-number { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 14px; background: var(--navy); color: #fff; font-size: 18px; font-weight: 700; box-shadow: 0 8px 18px rgba(11,34,63,.17); }
.guide-chapter-head h3 { font-size: 22px; }
.guide-chapter-head p:not(.step-label) { margin-top: 8px; color: var(--muted); font-size: 14px; line-height: 1.6; }
.guide-chapter-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
.guide-chapter > * + * { margin-top: 16px; }
.guide-chapter > .guide-chapter-head + * { margin-top: 0; }
.guide-info-card { padding: 22px; border: 1px solid var(--line); border-radius: 14px; background: #f8fafc; }
.guide-info-card h4 { margin: 0 0 14px; color: var(--navy); font-size: 15px; }
.guide-info-card p { color: var(--muted); font-size: 14px; line-height: 1.65; }
.guide-info-card ol, .guide-detail-list { display: grid; gap: 11px; margin: 0; padding-left: 21px; color: var(--muted); font-size: 14px; line-height: 1.6; }
.guide-info-card ol li::marker { color: var(--orange-dark); font-weight: 700; }
.guide-info-card li strong { color: var(--navy); }
.guide-check-card { background: #fffaf6; border-color: #f4d5bc; }
.guide-checks { display: grid; gap: 11px; margin: 0; padding: 0; list-style: none; }
.guide-checks li { position: relative; padding-left: 28px; color: #45576d; font-size: 14px; line-height: 1.55; }
.guide-checks li::before { content: "✓"; position: absolute; left: 0; top: 1px; width: 20px; height: 20px; display: grid; place-items: center; border-radius: 50%; background: #e8f7f1; color: var(--green); font-size: 12px; font-weight: 700; }
.guide-chapter-footer { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 16px 18px; border-left: 4px solid var(--orange); border-radius: 10px; background: var(--orange-pale); }
.guide-chapter-footer p { color: #82410f; font-size: 14px; line-height: 1.6; }
.guide-chapter-footer button { flex: 0 0 auto; min-height: 42px; display: inline-flex; align-items: center; gap: 9px; padding: 0 15px; border-radius: 9px; background: var(--navy); color: #fff; font-size: 12px; font-weight: 700; }
.guide-chapter-footer button:hover { background: var(--navy-soft); }
.guide-chapter-footer button span { color: var(--orange); font-size: 18px; }
.guide-result-card { display: flex; align-items: center; gap: 16px; background: #f6f9fc; }
.guide-result-icon { width: 58px; height: 58px; flex: 0 0 58px; display: grid; place-items: center; border-radius: 15px; background: var(--orange); color: #fff; font-size: 14px; font-weight: 700; box-shadow: 0 8px 18px rgba(255,122,24,.2); }
.guide-result-card h4 { margin-bottom: 6px; }
.guide-example-strip { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; }
.guide-example-strip > div { padding: 14px 15px; border: 1px solid var(--line); border-radius: 11px; background: #fff; }
.guide-example-strip small, .guide-example-strip strong, .guide-example-strip span { display: block; }
.guide-example-strip small { margin-bottom: 5px; color: var(--orange-dark); font-size: 12px; font-weight: 700; }
.guide-example-strip strong { color: var(--navy); font-size: 14px; overflow-wrap: anywhere; }
.guide-example-strip span { margin-top: 4px; color: var(--muted); font-size: 12px; }
.guide-process { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr auto 1fr; align-items: center; gap: 10px; }
.guide-process > div { min-height: 144px; padding: 18px; border: 1px solid var(--line); border-radius: 13px; background: #f8fafc; }
.guide-process > div > span { width: 28px; height: 28px; display: grid; place-items: center; margin-bottom: 13px; border-radius: 8px; background: var(--orange); color: #fff; font-size: 12px; font-weight: 700; }
.guide-process strong, .guide-process small { display: block; }
.guide-process strong { color: var(--navy); font-size: 14px; }
.guide-process small { margin-top: 5px; color: var(--muted); font-size: 12px; line-height: 1.45; }
.guide-process > i { color: var(--orange-dark); font-size: 20px; font-style: normal; }
.guide-process-three { grid-template-columns: 1fr auto 1fr auto 1fr; }
.guide-process-four { grid-template-columns: 1fr auto 1fr auto 1fr auto 1fr; }
.guide-status-row { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; margin-top: 14px; }
.guide-status-row > span { display: flex; align-items: center; gap: 9px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); font-size: 12px; }
.guide-status-row .status { flex: 0 0 auto; }
.guide-option { display: grid; grid-template-columns: 38px 1fr; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.guide-option > span { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 9px; background: var(--orange-pale); color: var(--orange-dark); font-size: 18px; font-weight: 700; }
.guide-option strong { color: var(--navy); font-size: 14px; }
.guide-option p { margin-top: 3px; font-size: 12px; }
.guide-warning-card { border-color: #f1c69f; background: #fffaf6; }
.guide-warning-card > p { margin-top: 14px; padding-top: 14px; border-top: 1px solid #f1d8c3; color: #82410f; }
.guide-tags { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 13px; }
.guide-tags span { padding: 6px 9px; border-radius: 999px; background: #eaf0f6; color: var(--navy); font-size: 12px; font-weight: 600; }
.guide-back-top { position: fixed; right: 26px; bottom: 24px; z-index: 12; width: 44px; height: 44px; min-height: 44px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%; background: #000; color: #fff; box-shadow: 0 12px 28px rgba(0,0,0,.24); opacity: 0; visibility: hidden; pointer-events: none; transform: translateY(10px); transition: opacity .18s ease, transform .18s ease, visibility .18s ease; }
.guide-back-top.visible { opacity: 1; visibility: visible; pointer-events: auto; transform: translateY(0); }
.guide-back-top:hover { background: #222; }
.guide-back-top:focus-visible { outline: 3px solid var(--orange); outline-offset: 4px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .guide-back-top { transition: none; transform: none; } }

dialog { width: min(780px, calc(100% - 30px)); max-height: calc(100vh - 34px); max-height: calc(100dvh - 34px); padding: 0; overflow: auto; overscroll-behavior: contain; border: 0; border-radius: 17px; box-shadow: 0 30px 80px rgba(7,27,53,.25); }
dialog::backdrop { background: rgba(7,27,53,.72); }
dialog form { padding: 26px; }
#wizardDialog { width: min(880px, calc(100% - 30px)); }
#wizardDialog > .dialog-head { margin: 0; padding: 26px 26px 0; }
#wizardDialog > .wizard-panel { padding: 26px; }
#wizardDialog form { padding-top: 18px; }
.wizard-steps { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 0; padding: 0 26px 18px; border-bottom: 1px solid var(--line); list-style: none; }
.wizard-steps li { display: flex; align-items: center; gap: 9px; flex: 1 1 130px; padding: 10px 13px; border: 1px solid var(--line); border-radius: 10px; background: #f6f8fb; color: var(--muted); font-size: 13px; font-weight: 700; letter-spacing: -.005em; }
.wizard-steps li.current { border-color: var(--orange); background: var(--orange-pale); color: #a64c0b; }
.wizard-steps li.done { border-color: #cbd4df; background: #fff; color: var(--navy); }
.wizard-step-number { width: 24px; height: 24px; flex: 0 0 24px; display: grid; place-items: center; border-radius: 50%; background: #e3e9f1; color: var(--navy); font-size: 12px; }
.wizard-steps li.current .wizard-step-number { background: var(--orange); color: #fff; }
.wizard-steps li.done .wizard-step-number { background: var(--navy); color: #fff; }
.wizard-lead { margin: 0 0 20px; color: var(--muted); font-size: 14px; line-height: 1.65; }
.wizard-search { display: flex; align-items: end; gap: 10px; }
.wizard-search label { flex: 1 1 auto; min-width: 0; }
.wizard-search button { flex: 0 0 auto; min-height: 44px; margin-bottom: 14px; padding: 0 18px; border-radius: 9px; background: var(--navy); color: #fff; font-size: 13px; font-weight: 700; }
.wizard-search button:hover { background: var(--navy-soft); }
.wizard-fieldset { margin-top: 24px; padding-top: 22px; border-top: 1px solid var(--line); }
.wizard-fieldset h3 { margin: 0 0 16px; color: var(--navy); font-size: 17px; }
.wizard-summary { margin-bottom: 18px; padding: 16px 17px; border: 1px solid var(--line); border-radius: 12px; background: #f6f8fb; }
.wizard-summary > label:last-of-type { margin-bottom: 0; }
.wizard-other-customer { margin-top: 12px; }
.special-cases { margin: 4px 0 16px; padding: 13px 15px; border: 1px solid var(--line); border-radius: 12px; background: #fbfcfe; }
.special-cases[open] { background: #fff; }
.special-cases > summary { cursor: pointer; color: var(--navy); font-size: 15px; font-weight: 700; }
.special-cases > *:not(summary) { margin-top: 13px; }
.special-block { margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--line); }
.special-block h4 { margin: 0 0 12px; color: var(--navy); font-size: 14px; }
.wizard-done { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 18px; }
.wizard-done h3 { margin: 0 0 5px; color: var(--navy); font-size: 19px; }
.wizard-done-mark { width: 40px; height: 40px; flex: 0 0 40px; display: grid; place-items: center; border-radius: 50%; background: #e7f5ef; color: var(--green); font-size: 20px; font-weight: 700; }
.wizard-actions { flex-wrap: wrap; margin-top: 16px; }
.wizard-actions .primary-action:disabled { cursor: not-allowed; opacity: .5; }
#inboxIncidentsDialog { padding: 26px; }
#inboxIncidentsDialog .card { grid-template-columns: minmax(180px,.8fr) minmax(260px,1.5fr) auto; }
.incident-toolbar { display: flex; justify-content: flex-end; margin: -6px 0 14px; }
.dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.dialog-head h2 { font-size: 23px; letter-spacing: -.022em; }
.icon { min-height: 40px; padding: 1px 8px; background: transparent; color: var(--navy); font-size: 26px; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 15px; }
.customer-lookup { display: flex; align-items: end; gap: 10px; }
.customer-lookup label { flex: 1 1 auto; min-width: 0; }
.customer-lookup button { flex: 0 0 auto; margin-bottom: 14px; }
label:not(.upload) { display: grid; gap: 7px; margin-bottom: 16px; color: var(--navy); font-size: 15px; font-weight: 600; letter-spacing: -.005em; }
.import-controls > label, .directory-search-form > label { margin-bottom: 0; grid-template-rows: 19px 44px; }
input, select, textarea { width: 100%; min-height: 44px; padding: 10px 11px; border: 1px solid #cbd4df; border-radius: 8px; outline: none; background: #fff; color: var(--navy-ink); }
input:focus, select:focus, textarea:focus { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(255,122,24,.12); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 8px; }
button.ghost { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; padding: 0 16px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--navy); font-size: 13px; font-weight: 700; box-shadow: none; }
.muted { color: var(--muted); line-height: 1.5; }
.error { min-height: 20px; color: var(--red); font-size: 13px; white-space: pre-wrap; }
.form-note { margin: 3px 0 10px; padding: 10px 12px; border-radius: 8px; background: #edf7f3; color: var(--green); font-size: 12px; }
.check-row { grid-template-columns: 22px 1fr; align-items: center; gap: 10px !important; }
.check-row input { width: 20px; min-height: 20px; height: 20px; accent-color: var(--orange); }
details { margin: 2px 0 16px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: #f8fafc; }
details summary { cursor: pointer; font-size: 13px; font-weight: 600; }
.grid.compact { margin-top: 14px; }
.pagination { display: flex; align-items: center; justify-content: flex-end; gap: 12px; margin-top: 14px; }
.pagination-top { margin: 0 0 14px; }
.import-selection-note { color: var(--muted); font-size: 14px; margin: 0 0 10px; }
.pagination button { height: 44px; min-height: 44px; padding: 0 16px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--navy); font-size: 13px; font-weight: 600; }
.pagination button:disabled { cursor: not-allowed; opacity: .45; }
.pagination span { min-width: 110px; color: var(--muted); font-size: 13px; text-align: center; }

.login-body { min-height: 100vh; display: grid; grid-template-columns: minmax(290px, .9fr) minmax(420px, 1.1fr); background: #fff; }
.login-aside { position: relative; display: flex; flex-direction: column; justify-content: space-between; min-height: 100vh; padding: clamp(30px,6vw,72px); overflow: hidden; background: var(--navy); color: #fff; }
.login-aside::after { content: ""; position: absolute; right: -120px; bottom: -150px; width: 440px; height: 440px; border: 75px solid rgba(255,122,24,.1); border-radius: 50%; }
.login-brand { display: flex; align-items: center; gap: 13px; position: relative; z-index: 1; }
.login-brand strong { font-size: 18px; }
.login-copy { position: relative; z-index: 1; max-width: 520px; }
.login-copy h2 { font-size: clamp(32px,5vw,54px); }
.login-copy p { margin-top: 18px; color: #c6d4e5; font-size: 16px; line-height: 1.6; }
.login-copy .eyebrow { color: var(--orange); }
.login-security { position: relative; z-index: 1; color: #9fb2c9; font-size: 12px; }
.login-main { display: grid; place-items: center; min-height: 100vh; padding: 34px; background: var(--paper); }
.login-card { width: min(430px, 100%); padding: 36px; border: 1px solid var(--line); border-radius: 18px; background: #fff; box-shadow: var(--shadow); }
.login-card h1 { margin-bottom: 10px; font-size: 30px; }
.login-card > .muted { margin-bottom: 26px; }
.login-card button[type="submit"] { width: 100%; margin-top: 3px; }
.login-session-note { display: flex; gap: 9px; margin-top: 20px; padding: 11px 12px; border-radius: 9px; background: var(--orange-pale); color: #82410f; font-size: 12px; line-height: 1.5; }
.sidebar-scrim { display: none; }

@media (max-width: 1050px) {
  .card { grid-template-columns: minmax(200px,1fr) repeat(2,minmax(110px,.7fr)); }
  .card .actions { grid-column: 1 / -1; justify-content: flex-start; padding-top: 4px; }
  .import-metrics { grid-template-columns: repeat(3,1fr); }
  .guide-flow { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .guide-example-strip { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .guide-process, .guide-process-three, .guide-process-four { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .guide-process > i { display: none; }
}
@media (max-width: 780px) {
  .app-shell { display: block; }
  body.menu-open { overflow: hidden; }
  .sidebar { position: fixed; inset: 0 auto 0 0; transform: translateX(-105%); width: min(280px, calc(100vw - 46px)); height: 100vh; height: 100dvh; padding-bottom: max(12px, env(safe-area-inset-bottom)); transition: transform .2s ease; box-shadow: 18px 0 45px rgba(7,27,53,.25); }
  body.menu-open .sidebar { transform: translateX(0); }
  .sidebar-scrim { position: fixed; z-index: 15; inset: 0; display: block; visibility: hidden; background: rgba(7,27,53,.55); opacity: 0; transition: opacity .2s ease; }
  body.menu-open .sidebar-scrim { visibility: visible; opacity: 1; }
  .topbar { position: sticky; top: 0; z-index: 14; }
  .menu-toggle { flex: 0 0 40px; display: grid; place-items: center; }
  main { padding-top: 28px; }
  .page-intro, .panel-heading { align-items: flex-start; flex-direction: column; }
  .panel-heading > p { text-align: left; }
  .import-controls { grid-template-columns: 1fr 1fr; }
  .import-controls .secondary-action { grid-column: 1 / -1; }
  .guide-hero { align-items: flex-start; flex-direction: column; }
  .guide-index-heading { align-items: flex-start; flex-direction: column; gap: 6px; }
  .guide-chapter-grid, .guide-process, .guide-process-three, .guide-process-four { grid-template-columns: 1fr; }
  .guide-chapter-footer { align-items: flex-start; flex-direction: column; }
  .card { grid-template-columns: 1fr; }
  .card .actions { grid-column: auto; }
  .card .actions > * { flex: 1 1 128px; }
  .login-body { display: block; background: var(--paper); }
  .login-aside { min-height: 245px; padding: 28px; }
  .login-copy { margin: 36px 0 10px; }
  .login-copy h2 { font-size: 31px; }
  .login-copy p, .login-security { display: none; }
  .login-main { min-height: auto; padding: 24px 18px 40px; }
}
@media (max-width: 560px) {
  #wizardDialog > .dialog-head { padding: 18px 18px 0; }
  #wizardDialog > .wizard-panel, #wizardDialog form { padding: 18px; }
  .wizard-steps { gap: 6px; padding: 0 18px 14px; }
  .wizard-steps li { flex: 1 1 100%; }
  .wizard-search, .customer-lookup { align-items: stretch; flex-direction: column; gap: 0; }
  .wizard-search button, .customer-lookup button { width: 100%; margin-bottom: 14px; }
  .wizard-actions { justify-content: stretch; }
  .wizard-actions > * { flex: 1 1 100%; }
  .list-controls { grid-template-columns: 1fr; }
  .list-pager { justify-content: space-between; gap: 7px; }
  .list-pager button { padding-inline: 8px; }
  .topbar { min-height: 70px; padding: 12px 16px; }
  main { padding: 24px 16px 50px; }
  .page-intro { gap: 18px; }
  .page-intro .primary-action { width: 100%; }
  .section-panel { min-height: 0; padding: 18px; border-radius: 14px; }
  .panel-heading { gap: 8px; margin-bottom: 16px; padding-bottom: 16px; }
  .card { gap: 13px; padding: 15px; }
  .actions { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); width: 100%; }
  .actions button, .actions a, .actions .upload { width: 100%; min-width: 0; padding-inline: 9px; white-space: normal; text-align: center; }
  .actions > :last-child:nth-child(odd) { grid-column: 1 / -1; }
  .grid { grid-template-columns: 1fr; }
  .customer-lookup { flex-wrap: wrap; }
  .customer-lookup label, .customer-lookup button { width: 100%; }
  .customer-lookup button { margin: 0 0 14px; }
  dialog { width: 100%; max-width: none; height: 100vh; height: 100dvh; max-height: 100vh; max-height: 100dvh; margin: 0; border-radius: 0; }
  dialog form { min-height: 100%; padding: 20px 17px max(22px, env(safe-area-inset-bottom)); }
  #inboxIncidentsDialog { min-height: 100%; padding: 20px 17px max(22px, env(safe-area-inset-bottom)); }
  #inboxIncidentsDialog .card { grid-template-columns: 1fr; }
  .dialog-head { position: sticky; top: -20px; z-index: 2; margin: -20px -17px 18px; padding: 20px 17px 13px; border-bottom: 1px solid var(--line); background: #fff; }
  .dialog-head h2 { font-size: 21px; }
  .dialog-actions, .signature-actions { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); width: 100%; }
  .dialog-actions > *, .signature-actions > * { width: 100%; min-width: 0; }
  .dialog-actions > :only-child, .dialog-actions > :last-child:nth-child(odd) { grid-column: 1 / -1; }
  .login-card { padding: 27px 22px; }
  .directory-search-form, .directory-result { grid-template-columns: 1fr; }
  .directory-result button { width: 100%; }
  .import-safety, .import-list-head { align-items: stretch; flex-direction: column; }
  .import-controls { grid-template-columns: 1fr; }
  .import-metrics { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .import-controls .secondary-action { grid-column: auto; width: 100%; }
  .import-list-head button { width: 100%; }
  .pagination { justify-content: space-between; gap: 8px; }
  .pagination button { flex: 1 1 0; padding-inline: 10px; }
  .pagination span { min-width: 0; }
  .guide-flow, .guide-example-strip, .guide-status-row { grid-template-columns: 1fr; }
  .guide-anchor, .guide-chapter { scroll-margin-top: 88px; }
  .guide-card { min-height: 0; padding: 17px; }
  .guide-index, .guide-chapter, .guide-hero { padding: 20px; }
  .guide-chapter-head { grid-template-columns: 42px minmax(0,1fr); gap: 12px; }
  .guide-chapter-number { width: 42px; height: 42px; border-radius: 12px; }
  .guide-chapter-footer button { width: 100%; justify-content: center; }
  .guide-result-card { align-items: flex-start; flex-direction: column; }
  .guide-back-top { right: 14px; bottom: max(14px, env(safe-area-inset-bottom)); }
}

@media (max-width: 370px) {
  .topbar { padding-inline: 12px; }
  main { padding-inline: 12px; }
  .section-panel { padding: 15px; }
  .actions { grid-template-columns: 1fr; }
  .guide-card { grid-template-columns: 36px minmax(0,1fr) 18px; gap: 10px; padding: 15px; }
  .guide-step { width: 36px; height: 36px; }
  .guide-index, .guide-chapter, .guide-hero { padding: 17px; }
  .guide-back-top { right: 10px; padding: 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* ---------- 25/09: selector de aplicaciones, tarjetas, diálogos propios ---------- */
.app-switch { width: 100%; display: flex; gap: 4px; margin: 0 0 10px; padding: 4px; border-radius: 11px; background: rgba(255,255,255,.06); }
.app-switch a { flex: 1 1 0; min-width: 0; min-height: 36px; display: grid; place-items: center; border-radius: 8px; color: #d9e5f3; font-size: 13px; font-weight: 600; text-decoration: none; }
.app-switch a:hover { background: rgba(255,255,255,.08); color: #fff; }
.app-switch a.current { background: var(--orange); color: #fff; cursor: default; }

.directory-card { width: 100%; min-height: 64px; display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--navy-ink); text-align: left; }
.directory-card:hover, .directory-card:focus-visible { border-color: #f0a56e; background: #fffaf6; outline: none; }
.directory-code { min-width: 76px; padding: 5px 8px; border-radius: 7px; background: #eef2f7; color: var(--navy); font-size: 13px; font-weight: 700; text-align: center; }
.directory-main strong, .directory-main small { display: block; overflow-wrap: anywhere; }
.directory-main strong { font-size: 15px; }
.directory-main small { margin-top: 2px; color: var(--muted); font-size: 13px; }
.directory-tag { padding: 6px 12px; border-radius: 999px; background: var(--orange); color: #fff; font-size: 12px; font-weight: 700; white-space: nowrap; }
.list-subtitle { margin: 22px 0 10px; color: var(--muted); font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }

.equipment-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; margin-bottom: 14px; }
.equipment-card { display: grid; gap: 3px; min-height: 92px; padding: 13px 15px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; color: var(--navy-ink); text-align: left; }
.equipment-card strong { font-size: 15px; }
.equipment-card span { color: #45576d; font-size: 13px; }
.equipment-card small { color: var(--muted); font-size: 12px; }
.equipment-card:hover { border-color: #f0a56e; }
.equipment-card.active { border-color: var(--orange); background: var(--orange-pale); box-shadow: 0 0 0 3px rgba(255,122,24,.14); }

.contact-choice { display: grid; gap: 10px; margin: 12px 0 18px; }
.contact-choice > span { color: var(--navy); font-size: 14px; font-weight: 600; }
.contact-choice > div { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.contact-choice .chip { min-height: 64px; display: grid; align-content: center; gap: 4px; padding: 12px 16px; border: 1.5px solid var(--line); border-radius: 12px; font-size: 14px; line-height: 1.3; overflow-wrap: anywhere; cursor: pointer; transition: border-color .15s, background .15s, box-shadow .15s; }
.contact-choice .chip small { font-size: 12px; font-weight: 500; text-transform: none; }
.contact-choice .chip:hover, .contact-choice .chip:focus-visible { border-color: #f0a56e; background: #fffaf6; outline: none; }
.contact-choice .chip.active { border-color: var(--orange); background: var(--orange-pale); box-shadow: 0 0 0 3px rgba(255,122,24,.14); }
.chip { min-height: 38px; display: inline-grid; gap: 1px; padding: 6px 13px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--navy); font-size: 13px; font-weight: 600; text-align: left; }
.chip small { color: var(--muted); font-size: 11px; font-weight: 500; }
.chip.active { border-color: var(--orange); background: var(--orange-pale); }
input.fixed-value { background: #f3f6f9; color: var(--navy); font-weight: 700; cursor: default; }
.payment-warning, .observations-hint { margin: -4px 0 14px; padding: 10px 13px; border-left: 3px solid var(--orange); border-radius: 8px; background: var(--orange-pale); color: #82410f; font-size: 13px; line-height: 1.5; }
.observations-hint { border-left-color: #9aabc0; background: #f5f7fa; color: #45576d; white-space: pre-line; }
.check-row-main { margin: 4px 0 16px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: #f8fafc; }

.ask-dialog { width: min(480px, calc(100vw - 32px)); }
.ask-dialog form { padding: 22px; }
.ask-dialog .dialog-head { padding: 0 0 8px; border: 0; }
.ask-text { margin-bottom: 14px; color: #45576d; font-size: 15px; line-height: 1.55; }
.ask-dialog button.danger { background: var(--red); box-shadow: none; }
.toast { position: fixed; z-index: 60; left: 50%; bottom: 24px; max-width: min(560px, calc(100vw - 32px)); padding: 12px 18px; border-radius: 10px; background: var(--navy); color: #fff; font-size: 14px; box-shadow: 0 14px 34px rgba(7,27,53,.28); transform: translateX(-50%); }
.toast.error { background: var(--red); }
.toast.ok { background: var(--green); }

.campaign-controls { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; }
.campaign-controls label { margin-bottom: 0; }
.mini-steps { display: flex; flex-wrap: wrap; gap: 6px 22px; margin: 14px 0 20px; padding: 0 0 0 18px; color: var(--muted); font-size: 13px; }
.mini-steps li::marker { color: var(--orange-dark); font-weight: 700; }

.import-steps { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 10px; margin-bottom: 14px; }
.import-step { display: grid; grid-template-columns: 34px minmax(0,1fr); grid-template-rows: 1fr auto; gap: 10px 12px; padding: 15px; border: 1px solid var(--line); border-radius: 13px; background: #f8fafc; }
.import-step strong, .import-step small { display: block; }
.import-step strong { color: var(--navy); font-size: 15px; }
.import-step small { margin-top: 3px; color: var(--muted); font-size: 12.5px; line-height: 1.45; }
.import-step > button { grid-column: 1 / -1; }
.import-step-number { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; background: var(--orange); color: #fff; font-weight: 700; }
.progress { height: 6px; margin-top: 8px; overflow: hidden; border-radius: 99px; background: #e6ebf1; }
.progress span { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--orange); transition: width .4s ease; }
.import-metrics { grid-template-columns: repeat(4, minmax(0,1fr)); }
.import-metrics .metric { display: block; min-height: 0; padding: 14px; border: 1px solid var(--line); border-radius: 11px; background: #fff; color: inherit; text-align: left; }
.import-metrics .metric.active { border-color: var(--orange); background: var(--orange-pale); }
.import-metrics .metric strong { display: block; color: var(--navy); font-size: 22px; }
.import-metrics .metric span { display: block; margin-top: 4px; color: var(--muted); font-size: 12.5px; }
.import-controls { grid-template-columns: minmax(200px, 320px) minmax(200px, 320px); margin-bottom: 12px; }
.import-table { min-width: 760px; }
.import-table td button.ghost { min-height: 36px; margin: 0; background: #fff; color: var(--navy); }
.import-class.pending { background: #eef1f5; color: #4f6075; }

/* Guía con el mismo formato que Avisos y Rutas: índice y apartados plegables. */
.guide-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 18px; align-items: start; }
.guide-toc { position: sticky; top: 24px; display: flex; flex-direction: column; gap: 2px; padding: 10px; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: 0 1px 2px rgba(16,35,63,.06); }
.guide-toc a { padding: 9px 12px; border-radius: 8px; color: var(--muted); font-size: 14px; font-weight: 600; text-decoration: none; }
.guide-toc a:hover { background: #f8fafc; color: var(--navy); }
.guide-toc a.active { background: var(--orange-pale); color: #a64200; }
.guide-body { display: flex; flex-direction: column; gap: 12px; }
.guide-item { border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: 0 1px 2px rgba(16,35,63,.06); scroll-margin-top: 24px; }
.guide-item summary { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; cursor: pointer; color: var(--navy-ink); font-size: 16px; font-weight: 600; list-style: none; }
.guide-item summary::-webkit-details-marker { display: none; }
.guide-item summary::after { content: ""; width: 10px; height: 10px; margin-right: 4px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform .15s; }
.guide-item[open] summary::after { transform: rotate(-135deg); }
.guide-item[open] summary { border-bottom: 1px solid var(--line); }
.guide-item ol { margin: 0; padding: 18px 22px 6px 44px; color: #273444; }
.guide-item li { margin-bottom: 10px; font-size: 14px; line-height: 1.55; }
.guide-item li::marker { color: var(--orange-dark); font-weight: 700; }
.guide-item .hint { padding: 0 22px 18px; color: var(--muted); font-size: 13px; }

.login-sso { margin-top: 10px; padding: 10px 12px; border-radius: 8px; background: var(--orange-pale); color: #82410f; font-size: 14px; }

@media (max-width: 1050px) {
  .import-steps { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 780px) {
  .topbar .eyebrow { display: none; }
  .topbar h1 { font-size: 20px; }
  .guide-layout { grid-template-columns: 1fr; }
  .guide-toc { position: static; flex-direction: row; overflow-x: auto; scrollbar-width: none; }
  .guide-toc a { white-space: nowrap; }
  .import-controls { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .import-steps { grid-template-columns: 1fr; }
  .import-metrics { grid-template-columns: 1fr 1fr; }
  .directory-card { grid-template-columns: 1fr auto; }
  .directory-code { grid-column: 1 / -1; justify-self: start; }
  .campaign-controls > * { flex: 1 1 100%; }
}

.modality-terms { margin: -4px 0 12px; padding: 10px 13px; border-radius: 8px; background: #f5f7fa; color: #273444; font-size: 13.5px; line-height: 1.5; }
.modality-terms:empty, .office-note:empty { display: none; }
.office-note { margin: 0 0 14px; color: var(--muted); font-size: 12.5px; }

.price-table-panel { margin-top: 18px; min-height: 0; }
.price-table { min-width: 720px; }
.price-table-preview { margin-bottom: 14px; padding: 14px 16px; border: 1px solid #f3c49c; border-radius: 12px; background: var(--orange-pale); }
.price-change { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid #f3d9c2; font-size: 14px; }
.price-change:last-of-type { border-bottom: 0; }

.test-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: -6px 0 16px; padding: 10px 12px; border: 1px dashed #d0d7e1; border-radius: 10px; color: var(--muted); font-size: 13px; }
.test-tools > span { margin-right: auto; font-weight: 700; }
.test-tag { display: inline-block; margin-right: 8px; padding: 2px 8px; border-radius: 999px; background: #fdecea; color: #b42318; font-size: 12px; font-weight: 700; vertical-align: middle; }
.card.is-test { border-style: dashed; border-color: #f1b8b2; }

/* Tarjeta de contrato: estado, cliente e importe arriba; datos en fila; un paso principal. */
.contract-card { display: grid; gap: 16px; padding: 18px 20px; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: 0 1px 2px rgba(11,34,63,.04); }
.contract-card.is-test { border: 1.5px dashed #f1b8b2; background: #fffdfc; }
.contract-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; }
.contract-card-title { min-width: 0; }
.contract-card-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 8px; }
.contract-card-tags .test-tag { margin: 0; }
.contract-card .status { min-height: 24px; padding: 2px 10px; }
.rev-tag { display: inline-block; padding: 2px 8px; border-radius: 999px; background: var(--paper); color: var(--muted); font-size: 12px; font-weight: 600; }
.contract-card h3 { margin: 0; font-size: 17px; line-height: 1.3; color: var(--navy-ink); overflow-wrap: anywhere; }
.contract-card-title p { margin: 4px 0 0; color: var(--muted); font-size: 13.5px; }
.contract-card-title .ref { font-variant-numeric: tabular-nums; }
.contract-card-price { flex: none; display: grid; justify-items: end; text-align: right; line-height: 1.25; }
.contract-card-price strong { font-size: 22px; color: var(--navy-ink); font-variant-numeric: tabular-nums; }
.contract-card-price span { color: var(--muted); font-size: 12.5px; }
.contract-card-price small { margin-top: 2px; color: var(--muted); font-size: 12px; }
.contract-card-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); }
.contract-card-facts > div { min-width: 0; padding: 10px 14px; }
.contract-card-facts > div + div { border-left: 1px solid var(--line); }
.contract-card-facts dt { margin: 0 0 3px; color: var(--muted); font-size: 11.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.contract-card-facts dd { display: grid; gap: 2px; margin: 0; color: var(--navy-ink); font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.contract-card-facts dd small { color: var(--muted); font-size: 12.5px; font-weight: 500; }
.contract-card-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 8px; }
.contract-card-actions > * { min-height: 40px; display: inline-flex; align-items: center; justify-content: center; margin: 0; padding: 0 14px; border: 1px solid transparent; border-radius: 9px; font-size: 14px; font-weight: 600; white-space: nowrap; text-decoration: none; cursor: pointer; }
.contract-card-actions button:not(.ghost) { background: var(--orange); color: #fff; }
.contract-card-actions button:not(.ghost):hover { background: var(--orange-dark); }
.contract-card-actions .ghost { border-color: var(--line); background: #fff; color: var(--navy); }
.contract-card-actions .ghost:hover { border-color: #c7d1dd; background: var(--paper); }
@media (max-width: 900px) {
  .contract-card-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .contract-card-facts > div:nth-child(3) { border-left: 0; }
  .contract-card-facts > div:nth-child(n+3) { border-top: 1px solid var(--line); }
}
@media (max-width: 560px) {
  .contract-card { padding: 16px; }
  .contract-card-head { flex-direction: column; gap: 10px; }
  .contract-card-price { justify-items: start; text-align: left; }
  .contract-card-actions > * { flex: 1 1 140px; }
}

/* Indicador de espera */
.spinner { display: inline-block; width: 14px; height: 14px; margin-right: 8px; vertical-align: -2px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: ec-spin .7s linear infinite; opacity: .8; }
button.is-busy { cursor: progress; opacity: .85; }
.loading-line, .loading-card { color: var(--muted); font-size: 14px; }
.loading-card { min-height: 64px; align-content: center; border-style: dashed; }
@keyframes ec-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2s; } }

/* Cartera: tres cifras y lista de dudas */
.section-line { margin: -6px 0 12px; color: #45576d; font-size: 14px; line-height: 1.5; }
.progress-block { margin: 6px 0 14px; }
.progress-block p { margin-top: 8px; color: var(--muted); font-size: 13.5px; }
.big-figures { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px; margin: 8px 0 16px; }
.big-figure { padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: #fff; text-align: center; }
.big-figure strong { display: block; color: var(--navy); font-size: 34px; line-height: 1.1; }
.big-figure span { display: block; margin-top: 4px; color: var(--muted); font-size: 14px; font-weight: 600; }
.big-figure.ok strong { color: var(--green); }
.big-figure.is-doubt strong { color: var(--orange-dark); }
.big-figure.is-unchecked strong { color: #4f6075; }
.big-figures:has(.is-unchecked:not(.hidden)) { grid-template-columns: repeat(4, minmax(0,1fr)); }
@media (max-width: 560px) { .big-figures:has(.is-unchecked:not(.hidden)) { grid-template-columns: repeat(2, minmax(0,1fr)); } }
.incorporate-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 8px; }
.doubt-list { display: grid; gap: 8px; }
.doubt { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px 14px; align-items: center; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.doubt-main strong, .doubt-main span { display: block; overflow-wrap: anywhere; }
.doubt-main strong { font-size: 14px; }
.doubt-main span { margin-top: 3px; color: #82410f; font-size: 13.5px; }
.doubt-actions { display: flex; gap: 6px; }
.doubt-actions button { min-height: 38px; padding: 0 12px; border-radius: 8px; background: var(--navy); color: #fff; font-size: 13px; font-weight: 700; }
.doubt-actions button.ghost { background: #fff; color: var(--navy); }
.doubt-panel { grid-column: 1 / -1; }
.doubt-options { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.doubt-price { max-width: 220px; }
#importMore { margin-top: 10px; }
@media (max-width: 560px) {
  .big-figure strong { font-size: 26px; }
  .doubt { grid-template-columns: 1fr; }
}

.bulk-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.doubt-group { border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.doubt-group + .doubt-group { margin-top: 8px; }
.doubt-group summary { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 13px 16px; cursor: pointer; font-weight: 600; list-style: none; }
.doubt-group summary::-webkit-details-marker { display: none; }
.doubt-group summary b { min-width: 42px; padding: 3px 10px; border-radius: 999px; background: var(--orange-pale); color: #a64200; text-align: center; }
.doubt-group[open] summary { border-bottom: 1px solid var(--line); }
.doubt-group-rows { display: grid; gap: 8px; padding: 10px; }
.doubt-group-rows .doubt { border-color: #edf0f4; }
.group-more { justify-self: start; }

.equipment-error { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border: 1px solid #f1b8b2; border-radius: 12px; background: #fdecea; color: #912018; font-size: 14px; }

.heading-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ghost-link { min-height: 44px; display: inline-flex; align-items: center; padding: 0 16px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--navy); font-size: 13px; font-weight: 700; text-decoration: none; }
.ghost-link:hover { border-color: #cfd7e2; background: #f8fafc; }

/* Revisión automática del PDF firmado */
.auto-review { margin: 14px 0 4px; }
.auto-review ul { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.auto-review li { display: grid; grid-template-columns: 22px 1fr; gap: 8px; align-items: start; padding: 8px 10px; border-radius: 8px; font-size: 13px; line-height: 1.4; background: #f8fafc; color: #475467; }
.auto-review li b { color: var(--navy); margin-right: 4px; }
.auto-review li span { font-weight: 800; text-align: center; }
.auto-review li.auto-ok { background: #eef2f7; }
.auto-review li.auto-ok span { color: var(--navy); }
.auto-review li.auto-warn { background: #fff4ea; border-left: 3px solid var(--orange); }
.auto-review li.auto-warn span { color: var(--orange); }
.auto-review-summary { margin: 0; font-weight: 700; font-size: 14px; }
.auto-review-summary.is-ok { color: var(--navy); }
.auto-review-summary.is-warn { color: var(--orange); }

/* Lo que vio la revisión automática, en la tarjeta del contrato */
.auto-strip { display: flex; align-items: center; gap: 8px; margin: 10px 0 0; padding: 9px 12px; border-radius: 8px; font-size: 13px; font-weight: 600; background: #eef2f7; color: var(--navy); }
.auto-strip span { font-weight: 800; }
.auto-strip.is-warn { background: var(--orange-pale); color: var(--navy); border-left: 3px solid var(--orange); }
.auto-strip.is-warn span { color: var(--orange); }

/* Fichas de cliente: tres datos por fila */
#customerList .contract-card-facts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 700px) { #customerList .contract-card-facts { grid-template-columns: 1fr; } }

/* Revisión: datos del contrato y miniaturas de lo escrito a mano */
.review-data { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 16px; margin: 12px 0 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper, #f8fafc); }
.review-data dt { font-size: 11px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: #667085; }
.review-data dd { margin: 2px 0 0; font-size: 13px; font-weight: 600; color: var(--navy); }
.ink-title { margin: 14px 0 8px; font-size: 13px; font-weight: 700; color: var(--navy); }
.ink-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.ink-grid a { display: grid; gap: 4px; text-decoration: none; color: #667085; font-size: 11px; text-align: center; }
.ink-grid img { width: 100%; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.ink-grid a:hover img { border-color: var(--orange); }
@media (max-width: 560px) { .review-data { grid-template-columns: 1fr; } .ink-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.incident-toolbar { gap: 8px; flex-wrap: wrap; }
#openPendingReviews { gap: 6px; }
.address-choice { display: grid; gap: 6px; margin: 12px 0 14px; }
.address-choice small { color: var(--muted, #5f6f83); font-size: 12px; font-weight: 500; }
.price-breakdown { margin: -4px 0 10px; padding: 10px 13px; border-radius: 8px; background: var(--orange-pale); color: var(--navy); font-size: 14px; font-weight: 600; }
.price-breakdown:empty { display: none; }
.auto-strip.is-cancelled { background: #fcebea; color: var(--red); }
.contract-card-actions .danger-text { color: var(--red); }
