:root {
  --bg: #050b12;
  --bg-deep: #02070d;
  --panel: rgba(10, 20, 32, .88);
  --panel-solid: #0a1420;
  --panel-2: #0d1927;
  --panel-3: #112033;
  --line: rgba(106, 154, 200, .16);
  --line-strong: rgba(77, 203, 255, .26);
  --text: #f5fbff;
  --muted: #8aa0b6;
  --muted-2: #62788e;
  --cyan: #19d5ff;
  --cyan-strong: #00b8f0;
  --blue: #277cff;
  --red: #ff5a68;
  --green: #4ee6a5;
  --amber: #ffc15c;
  --violet: #8d7dff;
  --glow: 0 0 0 1px rgba(25,213,255,.05), 0 18px 55px rgba(0,0,0,.34);
  --glow-cyan: 0 0 24px rgba(25,213,255,.18);
  --radius: 16px;
}

/* RC11.8.7 · Módulo independiente de renovaciones detectadas */
.renewal-detection-intro {
  display:flex; align-items:center; justify-content:space-between; gap:24px; margin-bottom:15px; padding:20px 22px;
  border:1px solid var(--line-strong); border-radius:var(--radius); background:linear-gradient(145deg,rgba(10,31,39,.95),rgba(7,17,28,.95)); box-shadow:var(--glow);
}
.renewal-detection-intro h2 { margin:5px 0; font-size:23px; }
.renewal-detection-intro p { max-width:760px; margin:0; color:var(--muted); font-size:13px; }
.renewal-detection-actions { display:flex; gap:8px; flex:0 0 auto; }
.renewal-detection-cards { margin-bottom:15px; }
.renewal-detection-panel .toolbar { justify-content:space-between; }
.renewal-detection-panel .field { width:min(520px,100%); }
.renewal-tracking-tabs { display:flex; gap:6px; padding:12px 14px 0; border-bottom:1px solid var(--line); overflow-x:auto; }
.renewal-tracking-tabs button { display:flex; align-items:center; gap:8px; flex:0 0 auto; padding:10px 13px; border:1px solid transparent; border-radius:10px 10px 0 0; color:var(--muted); background:transparent; font-weight:750; }
.renewal-tracking-tabs button:hover { color:var(--text); background:rgba(16,40,57,.6); }
.renewal-tracking-tabs button.is-active { color:#9eeeff; border-color:var(--line); border-bottom-color:#0a1926; background:#0a1926; }
.renewal-tracking-tabs b { display:inline-grid; min-width:23px; height:21px; place-items:center; padding:0 6px; border-radius:999px; color:#dff7ff; background:rgba(26,91,117,.72); font-size:11px; }
.renewal-tracking-toolbar { gap:10px; flex-wrap:wrap; }
.renewal-tracking-toolbar .select { min-width:190px; }
.renewal-tracking-pagination { display:flex; align-items:center; justify-content:space-between; gap:14px; padding:12px 14px; border-top:1px solid var(--line); color:var(--muted); font-size:12px; }
.renewal-tracking-pagination > div { display:flex; gap:8px; }
.renewal-detection-table td > strong,.renewal-detection-table td > span { display:block; }
.renewal-detection-table td > span { margin-top:4px; color:var(--muted); font-size:11px; }
.renewal-detection-table td:nth-child(1) { min-width:225px; }
.renewal-detection-table td:nth-child(2) { min-width:215px; }
.renewal-detection-table td:nth-child(3) { min-width:245px; }
.renewal-category-section { margin:15px 0; padding:18px; border:1px solid var(--line); border-radius:var(--radius); background:rgba(8,21,32,.86); box-shadow:var(--glow); }
.renewal-category-head { display:flex; align-items:flex-end; justify-content:space-between; gap:16px; margin-bottom:13px; }
.renewal-category-head h3 { margin:5px 0 0; font-size:16px; }
.renewal-category-head > span { color:var(--muted); font-size:11px; }
.renewal-category-grid { display:grid; grid-template-columns:repeat(4,minmax(160px,1fr)); gap:10px; }
.renewal-category-grid article { display:grid; gap:5px; padding:14px; border:1px solid var(--line); border-radius:12px; background:rgba(5,15,24,.65); }
.renewal-category-grid article > span { color:#83a6bd; font-size:10px; font-weight:800; letter-spacing:.7px; text-transform:uppercase; }
.renewal-category-grid article strong { color:var(--green); font-size:25px; letter-spacing:-.5px; }
.renewal-category-grid article b { color:#dcecf4; font-size:12px; }
.renewal-category-grid article small { color:var(--muted); }
.renewal-category-note { margin:11px 0 0; color:var(--muted-2); font-size:10px; }
@media (max-width:760px) {
  .renewal-detection-intro { align-items:flex-start; flex-direction:column; }
  .renewal-detection-actions { width:100%; }
  .renewal-detection-actions .btn { flex:1; }
  .renewal-detection-panel .toolbar { align-items:stretch; flex-direction:column; }
  .renewal-tracking-toolbar .field,.renewal-tracking-toolbar .select { width:100%; }
  .renewal-tracking-pagination { align-items:stretch; flex-direction:column; }
  .renewal-tracking-pagination > div .btn { flex:1; }
  .renewal-category-head { align-items:flex-start; flex-direction:column; }
  .renewal-category-grid { grid-template-columns:1fr 1fr; }
}
* { box-sizing: border-box; }
html { background: var(--bg-deep); }
html, body { margin: 0; min-height: 100%; color: var(--text); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
body {
  background:
    radial-gradient(circle at 78% -5%, rgba(0,184,240,.12), transparent 28rem),
    radial-gradient(circle at 18% 28%, rgba(39,124,255,.075), transparent 30rem),
    linear-gradient(180deg, #06101b 0%, var(--bg) 42%, #03080e 100%);
  background-attachment: fixed;
}
body::before {
  content:""; position:fixed; inset:0; pointer-events:none; z-index:-1; opacity:.22;
  background-image:
    linear-gradient(rgba(78,159,217,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(78,159,217,.035) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,.85), transparent 82%);
}
button, input, select { font: inherit; }
button { cursor: pointer; }
::selection { background:rgba(25,213,255,.22); color:#fff; }

.shell { min-height:100vh; display:block; }
.app-header {
  min-height:68px; padding:10px 28px; display:flex; align-items:center; justify-content:space-between; gap:20px;
  border-bottom:1px solid var(--line); background:rgba(4,12,20,.9); position:sticky; top:0; z-index:40;
  backdrop-filter:blur(22px) saturate(130%);
}
.brand { display:flex; align-items:center; gap:13px; padding:0; flex:0 0 auto; }
.brand-mark {
  width:42px; height:42px; border-radius:14px; display:grid; place-items:center; position:relative;
  color:#fff; font-weight:850; overflow:hidden;
  border:1px solid rgba(91,221,255,.35);
  background:linear-gradient(145deg, rgba(24,56,79,.92), rgba(5,17,29,.98));
  box-shadow:inset 0 0 18px rgba(25,213,255,.07), 0 0 24px rgba(0,184,240,.11);
}
.brand-mark::before { content:""; position:absolute; width:22px; height:22px; border:1.5px solid var(--cyan); border-radius:7px; transform:rotate(45deg); opacity:.8; }
.brand-orbit { position:absolute; width:31px; height:14px; border:1px solid rgba(25,213,255,.42); border-radius:50%; transform:rotate(-28deg); }
.brand-core { position:relative; z-index:2; font-size:16px; text-shadow:0 0 12px rgba(25,213,255,.8); }
.brand-copy strong { display:block; font-size:16px; letter-spacing:2.6px; font-weight:800; }
.brand-copy span { display:block; color:#6e879d; font-size:10px; margin-top:3px; letter-spacing:.18px; }
.nav {
  min-height:50px; padding:0 28px; display:flex; align-items:stretch; gap:8px; position:sticky; top:68px; z-index:35;
  border-bottom:1px solid var(--line); background:rgba(6,16,27,.94); backdrop-filter:blur(20px);
}
.nav button {
  position:relative; text-align:left; border:0; border-bottom:2px solid transparent; background:transparent; color:#8da2b7;
  padding:12px 15px 10px; border-radius:0; display:flex; gap:9px; align-items:center; justify-content:center; transition:.18s ease;
}
.nav button:hover { background:rgba(13,35,52,.45); color:#eaf9ff; border-bottom-color:rgba(100,176,222,.2); }
.nav button.active {
  color:#9eeeff; border-bottom-color:var(--cyan);
  background:linear-gradient(180deg, transparent, rgba(7,69,93,.28));
  box-shadow:0 8px 24px rgba(0,0,0,.12);
}
.nav button.active::after { display:none; }
.nav .icon { width:18px; text-align:center; opacity:.95; color:#7bdfff; }

.main { min-width:0; }
.topbar {
  min-height:66px; display:flex; align-items:flex-end; justify-content:space-between;
  padding:16px 30px 8px; background:transparent; position:static;
}
.page-title small { color:#5e89a5; display:block; text-transform:uppercase; font-size:9px; letter-spacing:1.9px; font-weight:800; }
.page-title h1 { margin:4px 0 0; font-size:23px; letter-spacing:-.4px; font-weight:720; }
.top-actions { display:flex; gap:9px; align-items:center; flex-wrap:wrap; }
.btn {
  border:1px solid rgba(116,157,190,.22); color:#dff5ff; background:rgba(14,30,44,.78);
  border-radius:10px; padding:9px 13px; font-weight:650; transition:.18s ease;
}
.btn:hover { border-color:rgba(25,213,255,.38); background:rgba(16,40,57,.9); transform:translateY(-1px); }
.btn-primary {
  background:linear-gradient(135deg, #04bde8, #267dff); border-color:rgba(68,217,255,.55); color:#fff;
  box-shadow:0 8px 26px rgba(0,157,224,.18);
}
.btn-wanway { background:rgba(12,36,53,.78); border-color:rgba(38,167,213,.28); color:#9eeeff; }
.btn-success { background:rgba(16,67,56,.62); border-color:rgba(78,230,165,.25); color:#8ff1c2; }
.btn-danger { background:rgba(82,25,35,.58); border-color:rgba(255,90,104,.25); color:#ff9ca6; }

.content { padding:14px 30px 58px; width:100%; max-width:1920px; margin:auto; }
.cards { display:grid; grid-template-columns:repeat(4,minmax(170px,1fr)); gap:14px; }
.card {
  background:linear-gradient(155deg, rgba(13,29,44,.94), rgba(7,17,27,.94));
  border:1px solid var(--line); border-radius:var(--radius); padding:18px; box-shadow:var(--glow);
  position:relative; overflow:hidden;
}
.card::before { content:""; position:absolute; inset:0 auto 0 0; width:2px; background:linear-gradient(180deg,var(--card-accent,var(--cyan)),transparent); opacity:.9; }
.card::after { content:""; position:absolute; width:100px; height:100px; right:-50px; top:-50px; border-radius:50%; background:var(--card-accent,var(--cyan)); filter:blur(46px); opacity:.07; }
.metric-label { color:#7f95a9; font-size:11px; text-transform:uppercase; letter-spacing:.55px; }
.metric-value { font-size:29px; font-weight:760; margin-top:7px; letter-spacing:-.8px; }
.metric-note { color:#5f758a; font-size:11px; margin-top:8px; }
.status-banner { margin-top:14px; border:1px solid rgba(78,230,165,.22); background:rgba(13,62,48,.38); color:#91f1c6; padding:11px 14px; border-radius:11px; font-size:13px; display:flex; justify-content:space-between; gap:12px; }

.panel {
  background:linear-gradient(180deg, rgba(9,22,34,.93), rgba(7,16,26,.95));
  border:1px solid var(--line); border-radius:var(--radius); margin-top:16px; overflow:hidden; box-shadow:var(--glow);
}
.toolbar { padding:14px; display:grid; grid-template-columns:minmax(260px,1fr) 170px 170px 170px auto; gap:9px; border-bottom:1px solid var(--line); background:rgba(8,20,31,.66); }
.field, .select {
  background:rgba(4,13,22,.88); border:1px solid rgba(105,147,180,.22); border-radius:9px; padding:9px 11px;
  color:#e8f8ff; outline:none; min-width:0; transition:.18s ease;
}
.field::placeholder { color:#51687c; }
.field:focus, .select:focus { border-color:rgba(25,213,255,.54); box-shadow:0 0 0 3px rgba(25,213,255,.06); }

.table-wrap { overflow:auto; scrollbar-color:#1d5368 #09131d; }
table { width:100%; border-collapse:collapse; min-width:1050px; }
th, td { padding:12px 13px; border-bottom:1px solid rgba(107,146,177,.11); text-align:left; font-size:12px; white-space:nowrap; }
th { color:#67829a; font-size:9.5px; text-transform:uppercase; letter-spacing:.9px; background:#07121c; position:sticky; top:0; }
td { color:#d2e0e9; }
tbody tr { transition:.15s ease; }
tbody tr:hover { background:rgba(17,63,84,.18); }

.badge { display:inline-flex; align-items:center; gap:6px; border-radius:999px; padding:4px 8px; font-size:10px; font-weight:750; border:1px solid transparent; }
.badge-wanway { color:#d0c7ff; background:rgba(71,53,118,.34); border-color:rgba(141,125,255,.26); }
.badge-app { color:#91edff; background:rgba(10,69,85,.36); border-color:rgba(25,213,255,.2); }
.badge-active { color:#8ff1c2; background:rgba(15,74,54,.42); border-color:rgba(78,230,165,.23); }
.badge-muted { color:#91a1b0; background:rgba(36,50,63,.45); border-color:rgba(116,145,169,.15); }
.badge-warning { color:#ffd88d; background:rgba(94,63,13,.4); border-color:rgba(255,193,92,.22); }
.badge-violet { color:#d0c7ff; background:rgba(71,53,118,.34); border-color:rgba(141,125,255,.26); }

.actions { display:flex; gap:6px; }
.icon-btn { border:1px solid rgba(105,147,180,.18); background:rgba(12,28,42,.72); color:#cde9f5; border-radius:8px; padding:6px 8px; }
.icon-btn:hover { border-color:rgba(25,213,255,.34); color:#fff; }
.empty, .loading { padding:44px 18px; color:var(--muted); text-align:center; }
.recovery-note { font-size:11px; color:#70869a; padding:10px 14px; border-top:1px solid var(--line); background:#07121c; }

.run-detail-row:hover { background:transparent; }
.run-detail-row > td { padding:0 14px 14px; white-space:normal; background:#07121c; }
.renewal-run-row { cursor:pointer; }
.renewal-run-row td { background:rgba(7,18,28,.88); }
.renewal-run-row:hover td { background:rgba(11,42,58,.72); }
.renewal-run-row:focus-visible { outline:none; }
.renewal-run-row:focus-visible td,.renewal-run-row.is-expanded td {
  background:rgba(8,46,63,.74); border-top:1px solid rgba(25,213,255,.42); border-bottom:1px solid rgba(25,213,255,.28);
}
.renewal-run-row.is-expanded td:first-child { box-shadow:inset 2px 0 0 var(--cyan); }
.renewal-runs-table .run-folio-cell { position:sticky; left:0; z-index:2; }
.renewal-runs-table th:first-child { position:sticky; left:0; z-index:4; }
.renewal-runs-table { min-width:1680px; }
.renewal-runs-table th:nth-child(1),.renewal-runs-table td:nth-child(1) { min-width:315px; width:315px; }
.renewal-runs-table th:nth-child(2),.renewal-runs-table td:nth-child(2) { min-width:125px; width:125px; }
.renewal-runs-table .run-folio-cell { background:#081722; box-shadow:8px 0 14px rgba(0,0,0,.18); }
.run-folio-cell strong { vertical-align:middle; }
.run-status-stack { display:grid; gap:7px; min-width:230px; }
.run-status-stack > .badge { justify-self:start; }
.run-sync-progress { display:grid; gap:4px; min-width:220px; white-space:normal; }
.run-sync-progress strong { color:#bdefff; font-size:10px; font-weight:650; line-height:1.25; }
.run-sync-progress small { color:#70889b; font-size:9px; line-height:1.25; }
.run-sync-progress small.is-stale { color:#ffb45f; }
.run-sync-track { height:5px; overflow:hidden; border-radius:999px; background:rgba(75,119,146,.2); box-shadow:inset 0 0 0 1px rgba(105,157,195,.08); }
.run-sync-track span { display:block; height:100%; border-radius:inherit; background:linear-gradient(90deg,#16bfdc,#2d8cff); box-shadow:0 0 10px rgba(25,213,255,.35); transition:width .35s ease; }
.run-dispatch-progress { min-width:285px; }
.run-dispatch-progress .run-sync-track { height:7px; }
.sync-health.is-clean { border-color:rgba(78,230,165,.3); }
.sync-health.is-warning { border-color:rgba(255,180,95,.35); color:#ffd88d; }
.sync-health-progress { display:grid; gap:6px; min-width:min(720px,70vw); }
.sync-health-progress .run-sync-track { width:100%; }
.sync-monitor-card { margin:14px 0; padding:18px; border:1px solid #29445a; border-radius:14px; background:linear-gradient(135deg,#071722,#0a202c); box-shadow:0 12px 30px rgba(0,0,0,.18); }
.sync-monitor-card.is-clean { border-color:#176d58; }
.sync-monitor-card.is-warning { border-color:#7b6220; }
.sync-monitor-card.is-error { border-color:#8d3038; }
.sync-monitor-head { display:flex; align-items:flex-start; justify-content:space-between; gap:16px; margin-bottom:12px; }
.sync-monitor-head>div { display:flex; flex-direction:column; gap:5px; }
.sync-monitor-head strong { font-size:16px; color:#e8f7ff; }
.sync-monitor-kicker { font-size:10px; font-weight:800; letter-spacing:.14em; color:#6fa4bd; }
.sync-monitor-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; margin-top:14px; }
.sync-monitor-grid span { display:flex; flex-direction:column; gap:3px; padding:10px 12px; border:1px solid #17394a; border-radius:10px; background:#07141d; color:#d8e9f2; }
.sync-monitor-grid b { font-size:10px; letter-spacing:.08em; text-transform:uppercase; color:#6f91a4; }
.sync-monitor-error { margin-top:10px; padding:10px 12px; border-radius:9px; background:#39171c; color:#ffb5bc; overflow-wrap:anywhere; }
.run-row-chevron {
  width:20px; height:20px; margin-right:7px; display:inline-grid; place-items:center; vertical-align:middle;
  color:#8eeaff; border:1px solid rgba(25,213,255,.18); border-radius:6px; background:rgba(8,37,51,.7);
}
.run-detail-card {
  padding:17px; border:1px solid rgba(25,213,255,.18); border-left:2px solid var(--cyan);
  border-radius:12px; background:linear-gradient(155deg,rgba(12,29,44,.96),rgba(7,17,27,.96));
  box-shadow:0 14px 38px rgba(0,0,0,.24);
}
.run-detail-head { display:flex; justify-content:space-between; align-items:flex-start; gap:14px; }
.run-detail-head-actions { display:flex; justify-content:flex-end; flex-wrap:wrap; gap:8px; }
.run-detail-title { display:flex; align-items:center; flex-wrap:wrap; gap:9px; margin-bottom:5px; }
.run-detail-title strong { color:#effbff; font-size:15px; }
.run-detail-metrics { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:14px; margin-top:15px; padding:13px 0; border-top:1px solid var(--line); border-bottom:1px solid var(--line); }
.run-detail-metrics div { display:grid; gap:5px; }
.run-detail-metrics span { color:#70869a; font-size:10px; text-transform:uppercase; letter-spacing:.55px; }
.run-detail-metrics strong { color:#e8f8ff; font-size:14px; }
.run-flow { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:10px; padding:15px 0; }
.run-flow > span,.run-status-cell { display:flex; align-items:center; gap:7px; color:#8da2b4; }
.run-flow > span.done { color:#bfead5; }
.run-flow > span.current { color:#b9eaff; }
.run-flow > span.problem { color:#ffadb5; }
.run-status-mark { width:8px; height:8px; border-radius:50%; background:#698093; flex:0 0 auto; box-shadow:0 0 0 3px rgba(105,128,147,.08); }
.run-status-ok { background:var(--green); box-shadow:0 0 0 3px rgba(78,230,165,.08); }
.run-status-pending { background:var(--cyan); box-shadow:0 0 0 3px rgba(25,213,255,.08); }
.run-status-failed,.run-status-problem { background:var(--red); box-shadow:0 0 0 3px rgba(255,90,104,.08); }
.run-status-current { background:var(--cyan); box-shadow:0 0 0 3px rgba(25,213,255,.08); }
.run-status-muted { background:#698093; }
.run-detail-table-wrap { overflow:auto; border-top:1px solid rgba(107,146,177,.09); }
.run-detail-table { min-width:760px; }
.run-detail-table.payment-table { min-width:1120px; }
.run-detail-table th { position:static; background:rgba(7,18,28,.72); }
.run-detail-actions { display:flex; justify-content:flex-end; gap:7px; margin-top:13px; }
.run-payment-summary {
  display:grid; grid-template-columns:repeat(3,minmax(0,1fr)) auto; align-items:center; gap:14px;
  margin:0 0 12px; padding:12px 14px; border:1px solid rgba(25,213,255,.24); border-radius:11px;
  background:linear-gradient(90deg,rgba(8,36,49,.72),rgba(8,24,37,.76));
}
.run-payment-summary>div { display:grid; gap:4px; }
.run-payment-summary span { color:#708da1; font-size:10px; text-transform:uppercase; letter-spacing:.6px; }
.run-payment-summary strong { color:#e7f7ff; font-size:14px; }
.run-payment-summary .payment-total { color:var(--green); }
.payment-action { border-color:rgba(25,213,255,.55); color:#82eaff; }
.payment-warning { margin-bottom:14px; padding:11px 13px; border:1px solid rgba(255,193,92,.24); border-radius:10px; background:rgba(94,63,13,.22); color:#ffd88d; line-height:1.45; }
.payment-gps-list { display:grid; gap:8px; }
.payment-gps-option { display:flex; align-items:center; gap:11px; padding:11px 12px; border:1px solid rgba(105,147,180,.2); border-radius:10px; background:rgba(7,23,34,.75); cursor:pointer; }
.payment-gps-option:hover { border-color:rgba(25,213,255,.35); }
.payment-gps-option.is-paid { opacity:.6; cursor:not-allowed; }
.payment-gps-option span { display:grid; gap:3px; }
.payment-gps-option strong { color:#dff4fc; }
.payment-gps-option small { color:#71899a; }
.payment-notes { min-height:86px; resize:vertical; }
.payment-modal-actions { display:flex; justify-content:flex-end; flex-wrap:wrap; gap:8px; margin-top:16px; }

@media (max-width:900px) {
  .run-payment-summary { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .run-payment-summary .icon-btn { width:100%; }
}

.modal-backdrop { position:fixed; inset:0; background:rgba(0,5,10,.78); z-index:100; display:grid; place-items:center; padding:18px; backdrop-filter:blur(8px); }
.modal {
  width:min(1080px,96vw); max-height:92vh; overflow:auto;
  background:linear-gradient(155deg,#0a1723,#06101a); border:1px solid rgba(90,187,230,.22); border-radius:18px;
  box-shadow:0 36px 100px rgba(0,0,0,.68), 0 0 34px rgba(0,184,240,.08);
}
.modal-head { padding:18px 20px; border-bottom:1px solid var(--line); display:flex; justify-content:space-between; align-items:center; position:sticky; top:0; background:rgba(7,17,27,.96); z-index:2; backdrop-filter:blur(18px); }
.modal-head h2 { margin:0; font-size:18px; }
.modal-head p { margin:4px 0 0; color:var(--muted); font-size:12px; }
.modal-close { border:0; background:transparent; color:#7f98ad; font-size:24px; }
.modal-close:hover { color:var(--cyan); }
.modal-body { padding:20px; }
.analysis-form { display:grid; grid-template-columns:1fr auto; gap:9px; }
.analysis-grid { display:grid; grid-template-columns:repeat(4,1fr); gap:10px; margin-top:16px; }
.analysis-card { background:rgba(12,29,43,.76); border:1px solid rgba(105,157,195,.17); border-radius:12px; padding:13px; }
.analysis-card label { display:block; color:#6c89a0; font-size:9.5px; text-transform:uppercase; letter-spacing:.8px; }
.analysis-card strong { display:block; margin-top:6px; font-size:17px; }
.analysis-section { margin-top:18px; }
.analysis-section h3 { font-size:13px; margin:0 0 9px; color:#d7f2ff; }
.json { background:#030a10; border:1px solid rgba(65,131,169,.19); padding:13px; border-radius:10px; overflow:auto; max-height:320px; color:#85dfff; font:11px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; white-space:pre-wrap; }
.state-3 { color:#ff8794; }
.state-1, .state-2 { color:#83efbd; }
.module-placeholder { padding:30px; }
.module-placeholder h2 { margin-top:0; }
.module-placeholder p { color:var(--muted); max-width:750px; line-height:1.6; }
.auth-bar { display:flex; gap:8px; align-items:center; }
.auth-dot { width:8px; height:8px; border-radius:50%; background:#405264; }
.auth-dot.ok { background:var(--cyan); box-shadow:0 0 12px rgba(25,213,255,.75); }
.login-grid { grid-template-columns:1fr 1fr; margin-top:0; }
.login-grid label { display:block; color:var(--muted); font-size:12px; margin-bottom:7px; }
.form-error { min-height:20px; margin-top:12px; color:#ff9ca6; font-size:12px; }
.auth-message { margin:0 0 16px; }
.btn:disabled { cursor:wait; opacity:.65; transform:none; }

.sync-label { color:#607a90; font-size:11px; align-self:center; }
.clickable-row { cursor:pointer; }
details summary { cursor:pointer; color:#82dfff; }

@media (max-width:1050px){
  .app-header{padding-inline:18px}
  .nav{padding-inline:14px;gap:2px}
  .nav button{padding-inline:10px}
  .toolbar{grid-template-columns:1fr 1fr}
  .cards{grid-template-columns:repeat(2,1fr)}
  .content{padding-inline:18px}
  .run-detail-metrics{grid-template-columns:repeat(2,1fr)}
}
@media (max-width:680px){
  .app-header{position:static;min-height:60px;padding:8px 12px}
  .brand-mark{width:38px;height:38px}
  .brand-copy span{display:none}
  .brand-copy strong{font-size:14px}
  .top-actions{justify-content:flex-end}
  .top-actions .auth-bar .btn{padding-inline:9px}
  .nav{position:static;min-height:auto;padding:4px 6px;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:2px}
  .nav button{padding:8px 3px 7px;font-size:10px;gap:4px;display:grid;justify-items:center}
  .nav .icon{width:auto}
  .topbar{padding:12px 14px 6px;min-height:58px}
  .page-title h1{font-size:18px}
  .content{padding:14px}
  .cards{grid-template-columns:1fr 1fr;gap:9px}
  .toolbar{grid-template-columns:1fr}
  .status-banner{display:block}
  .analysis-grid{grid-template-columns:1fr 1fr}
  .run-detail-head{display:grid}
  .run-detail-head-actions{justify-content:stretch}
  .run-detail-head-actions .btn,.run-detail-head-actions .icon-btn{flex:1}
  .run-detail-metrics{grid-template-columns:1fr}
  .run-flow{grid-template-columns:1fr 1fr}
  .login-grid{grid-template-columns:1fr}
  .sync-monitor-grid{grid-template-columns:1fr}
  .sync-monitor-head{flex-direction:column}
  .top-actions #analyzeBtn,.top-actions #syncBtn,.top-actions #newClientBtn{display:none}
}
.renewal-gps-ledger{padding:5px 0;border-bottom:1px solid rgba(126,164,190,.16);line-height:1.35}.renewal-gps-ledger:last-child{border-bottom:0}

/* TRAQIVA QA RC11.8.1 - Payment UI polish
   Overlay for RC11.8. Does not alter application logic. */

.run-payment-summary {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.run-payment-summary .icon-btn {
  width: 100%;
  max-width: 100%;
  white-space: normal;
  text-align: center;
}

.analysis-grid:has(#paymentCommunication) {
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 12px;
}

.analysis-grid:has(#paymentCommunication) > div {
  display: grid;
  align-content: start;
  gap: 6px;
  min-width: 0;
}

.analysis-grid:has(#paymentCommunication) > div label {
  display: block;
}

.analysis-grid:has(#paymentCommunication) > div .field,
.analysis-grid:has(#paymentCommunication) > div .select {
  width: 100%;
  box-sizing: border-box;
}

.analysis-grid:has(#paymentCommunication) > div:nth-child(1) {
  grid-column: span 6;
}

.analysis-grid:has(#paymentCommunication) > div:nth-child(2),
.analysis-grid:has(#paymentCommunication) > div:nth-child(3),
.analysis-grid:has(#paymentCommunication) > div:nth-child(4) {
  grid-column: span 2;
}

.analysis-grid:has(#paymentCommunication) > div:nth-child(5) {
  grid-column: span 4;
}

.analysis-grid:has(#paymentCommunication) > div:nth-child(6) {
  grid-column: span 8;
}

.analysis-section:has(#paymentGpsItems) + div {
  display: grid;
  gap: 6px;
  margin-top: 16px;
}

.analysis-section:has(#paymentGpsItems) + div > label {
  display: block;
}

.analysis-section:has(#paymentGpsItems) + div > .payment-notes {
  width: 100%;
  box-sizing: border-box;
}

@media (max-width: 900px) {
  .run-payment-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .analysis-grid:has(#paymentCommunication) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .analysis-grid:has(#paymentCommunication) > div {
    grid-column: span 1 !important;
  }

  .analysis-grid:has(#paymentCommunication) > div:nth-child(1),
  .analysis-grid:has(#paymentCommunication) > div:nth-child(6) {
    grid-column: span 2 !important;
  }
}

@media (max-width: 600px) {
  .analysis-grid:has(#paymentCommunication) {
    grid-template-columns: 1fr;
  }

  .analysis-grid:has(#paymentCommunication) > div {
    grid-column: span 1 !important;
  }
}

/* TRAQIVA QA RC11.8.2 - Payment table viewport fit
   Additive overlay for RC11.8/RC11.8.1. */

@media (min-width: 1101px) {
  .run-detail-table-wrap {
    overflow-x: hidden;
  }

  .run-detail-table.payment-table {
    width: 100%;
    min-width: 0;
    table-layout: fixed;
  }

  .run-detail-table.payment-table th,
  .run-detail-table.payment-table td {
    padding-inline: 10px;
    white-space: normal;
    overflow-wrap: anywhere;
    vertical-align: middle;
  }

  .run-detail-table.payment-table th:nth-child(1),
  .run-detail-table.payment-table td:nth-child(1) {
    width: 23%;
  }

  .run-detail-table.payment-table th:nth-child(2),
  .run-detail-table.payment-table td:nth-child(2) {
    width: 7%;
  }

  .run-detail-table.payment-table th:nth-child(3),
  .run-detail-table.payment-table td:nth-child(3) {
    width: 18%;
  }

  .run-detail-table.payment-table th:nth-child(4),
  .run-detail-table.payment-table td:nth-child(4) {
    width: 14%;
  }

  .run-detail-table.payment-table th:nth-child(5),
  .run-detail-table.payment-table td:nth-child(5) {
    width: 12%;
  }

  .run-detail-table.payment-table th:nth-child(6),
  .run-detail-table.payment-table td:nth-child(6) {
    width: 16%;
  }

  .run-detail-table.payment-table th:nth-child(7),
  .run-detail-table.payment-table td:nth-child(7) {
    width: 10%;
  }

  .run-detail-table.payment-table .icon-btn,
  .run-detail-table.payment-table .btn {
    max-width: 100%;
    padding-inline: 10px;
    white-space: normal;
    text-align: center;
  }
}

@media (min-width: 681px) and (max-width: 1100px) {
  .run-detail-table.payment-table {
    width: 100%;
    min-width: 940px;
    table-layout: fixed;
  }

  .run-detail-table.payment-table th,
  .run-detail-table.payment-table td {
    padding-inline: 9px;
    white-space: normal;
    overflow-wrap: anywhere;
  }
}

/* TRAQIVA QA RC11.8.3 - Expanded renewal run viewport fit
   Additive overlay for RC11.8 through RC11.8.2. */

@media (min-width: 681px) {
  .renewal-runs-table:has(.run-detail-row) {
    width: 100%;
    min-width: 0;
    table-layout: fixed;
  }

  .renewal-runs-table:has(.run-detail-row) > thead > tr > th,
  .renewal-runs-table:has(.run-detail-row) > tbody > tr.renewal-run-row > td {
    padding-inline: 7px;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .renewal-runs-table:has(.run-detail-row) > thead > tr > th:nth-child(1),
  .renewal-runs-table:has(.run-detail-row) > tbody > tr.renewal-run-row > td:nth-child(1) {
    width: 14%;
  }

  .renewal-runs-table:has(.run-detail-row) > thead > tr > th:nth-child(2),
  .renewal-runs-table:has(.run-detail-row) > tbody > tr.renewal-run-row > td:nth-child(2) {
    width: 8%;
  }

  .renewal-runs-table:has(.run-detail-row) > thead > tr > th:nth-child(3),
  .renewal-runs-table:has(.run-detail-row) > tbody > tr.renewal-run-row > td:nth-child(3) {
    width: 17%;
  }

  .renewal-runs-table:has(.run-detail-row) > thead > tr > th:nth-child(4),
  .renewal-runs-table:has(.run-detail-row) > tbody > tr.renewal-run-row > td:nth-child(4) {
    width: 6%;
  }

  .renewal-runs-table:has(.run-detail-row) > thead > tr > th:nth-child(5),
  .renewal-runs-table:has(.run-detail-row) > tbody > tr.renewal-run-row > td:nth-child(5) {
    width: 5%;
  }

  .renewal-runs-table:has(.run-detail-row) > thead > tr > th:nth-child(6),
  .renewal-runs-table:has(.run-detail-row) > tbody > tr.renewal-run-row > td:nth-child(6) {
    width: 8%;
  }

  .renewal-runs-table:has(.run-detail-row) > thead > tr > th:nth-child(7),
  .renewal-runs-table:has(.run-detail-row) > tbody > tr.renewal-run-row > td:nth-child(7) {
    width: 12%;
  }

  .renewal-runs-table:has(.run-detail-row) > thead > tr > th:nth-child(8),
  .renewal-runs-table:has(.run-detail-row) > tbody > tr.renewal-run-row > td:nth-child(8) {
    width: 14%;
  }

  .renewal-runs-table:has(.run-detail-row) > thead > tr > th:nth-child(9),
  .renewal-runs-table:has(.run-detail-row) > tbody > tr.renewal-run-row > td:nth-child(9),
  .renewal-runs-table:has(.run-detail-row) > thead > tr > th:nth-child(10),
  .renewal-runs-table:has(.run-detail-row) > tbody > tr.renewal-run-row > td:nth-child(10) {
    width: 8%;
  }

  .renewal-runs-table:has(.run-detail-row) > tbody > tr.run-detail-row > td {
    width: auto;
    max-width: 100%;
  }

  .renewal-runs-table:has(.run-detail-row) .run-detail-card {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
}

/* TRAQIVA QA RC11.8.4 - Operational tables viewport fit
   Additive overlay for daily runs and auditable queue. */

@media (min-width: 681px) {
  .renewal-runs-wrap {
    overflow-x: hidden;
  }

  .renewal-runs-table {
    width: 100%;
    min-width: 0;
    table-layout: fixed;
  }

  .renewal-runs-table > thead > tr > th,
  .renewal-runs-table > tbody > tr.renewal-run-row > td {
    padding-inline: 7px;
    white-space: normal;
    overflow-wrap: anywhere;
    vertical-align: middle;
  }

  .renewal-runs-table > thead > tr > th:nth-child(1),
  .renewal-runs-table > tbody > tr.renewal-run-row > td:nth-child(1) {
    width: 14%;
  }

  .renewal-runs-table > thead > tr > th:nth-child(2),
  .renewal-runs-table > tbody > tr.renewal-run-row > td:nth-child(2) {
    width: 8%;
  }

  .renewal-runs-table > thead > tr > th:nth-child(3),
  .renewal-runs-table > tbody > tr.renewal-run-row > td:nth-child(3) {
    width: 17%;
  }

  .renewal-runs-table > thead > tr > th:nth-child(4),
  .renewal-runs-table > tbody > tr.renewal-run-row > td:nth-child(4) {
    width: 6%;
  }

  .renewal-runs-table > thead > tr > th:nth-child(5),
  .renewal-runs-table > tbody > tr.renewal-run-row > td:nth-child(5) {
    width: 5%;
  }

  .renewal-runs-table > thead > tr > th:nth-child(6),
  .renewal-runs-table > tbody > tr.renewal-run-row > td:nth-child(6) {
    width: 8%;
  }

  .renewal-runs-table > thead > tr > th:nth-child(7),
  .renewal-runs-table > tbody > tr.renewal-run-row > td:nth-child(7) {
    width: 12%;
  }

  .renewal-runs-table > thead > tr > th:nth-child(8),
  .renewal-runs-table > tbody > tr.renewal-run-row > td:nth-child(8) {
    width: 14%;
  }

  .renewal-runs-table > thead > tr > th:nth-child(9),
  .renewal-runs-table > tbody > tr.renewal-run-row > td:nth-child(9),
  .renewal-runs-table > thead > tr > th:nth-child(10),
  .renewal-runs-table > tbody > tr.renewal-run-row > td:nth-child(10) {
    width: 8%;
  }

  .panel:has(#loadQueue) > .table-wrap {
    overflow-x: hidden;
  }

  .panel:has(#loadQueue) > .table-wrap > table {
    width: 100%;
    min-width: 0;
    table-layout: fixed;
  }

  .panel:has(#loadQueue) > .table-wrap > table th,
  .panel:has(#loadQueue) > .table-wrap > table td {
    padding-inline: 7px;
    white-space: normal;
    overflow-wrap: anywhere;
    vertical-align: middle;
  }

  .panel:has(#loadQueue) > .table-wrap > table th:nth-child(1),
  .panel:has(#loadQueue) > .table-wrap > table td:nth-child(1) {
    width: 3%;
    text-align: center;
  }

  .panel:has(#loadQueue) > .table-wrap > table th:nth-child(2),
  .panel:has(#loadQueue) > .table-wrap > table td:nth-child(2) {
    width: 13%;
  }

  .panel:has(#loadQueue) > .table-wrap > table th:nth-child(3),
  .panel:has(#loadQueue) > .table-wrap > table td:nth-child(3) {
    width: 22%;
  }

  .panel:has(#loadQueue) > .table-wrap > table th:nth-child(4),
  .panel:has(#loadQueue) > .table-wrap > table td:nth-child(4) {
    width: 16%;
  }

  .panel:has(#loadQueue) > .table-wrap > table th:nth-child(5),
  .panel:has(#loadQueue) > .table-wrap > table td:nth-child(5) {
    width: 7%;
  }

  .panel:has(#loadQueue) > .table-wrap > table th:nth-child(6),
  .panel:has(#loadQueue) > .table-wrap > table td:nth-child(6) {
    width: 12%;
  }

  .panel:has(#loadQueue) > .table-wrap > table th:nth-child(7),
  .panel:has(#loadQueue) > .table-wrap > table td:nth-child(7) {
    width: 9%;
  }

  .panel:has(#loadQueue) > .table-wrap > table th:nth-child(8),
  .panel:has(#loadQueue) > .table-wrap > table td:nth-child(8) {
    width: 10%;
  }

  .panel:has(#loadQueue) > .table-wrap > table th:nth-child(9),
  .panel:has(#loadQueue) > .table-wrap > table td:nth-child(9) {
    width: 8%;
  }
}

@media (max-width: 680px) {
  .renewal-runs-wrap,
  .panel:has(#loadQueue) > .table-wrap {
    overflow-x: auto;
  }
}

/* RC11.8.6 · Vista humana de notificaciones */
.notification-simple-shell { display:grid; gap:16px; }
.notification-view-tabs {
  width:max-content; max-width:100%; display:flex; gap:5px; padding:5px;
  border:1px solid var(--line); border-radius:13px; background:rgba(5,14,23,.72);
}
.notification-view-tabs button {
  border:0; border-radius:9px; padding:9px 14px; color:var(--muted); background:transparent; font-weight:750;
}
.notification-view-tabs button:hover { color:var(--text); background:rgba(17,43,61,.58); }
.notification-view-tabs button.is-active { color:#07121b; background:var(--cyan); box-shadow:var(--glow-cyan); }
.notification-view-tabs b {
  display:inline-grid; min-width:20px; height:20px; place-items:center; margin-left:5px; padding:0 6px;
  border-radius:999px; color:#2b1400; background:var(--amber); font-size:11px;
}
.notification-simple-panel {
  border:1px solid var(--line-strong); border-radius:var(--radius); overflow:hidden;
  background:linear-gradient(145deg, rgba(10,25,38,.96), rgba(7,17,28,.95)); box-shadow:var(--glow);
}
.notification-sync-strip {
  min-height:46px; display:flex; align-items:center; justify-content:space-between; gap:16px; padding:10px 16px;
  border-bottom:1px solid var(--line); color:#bdd0df; font-size:13px;
}
.notification-sync-strip > span { display:flex; align-items:center; gap:7px; flex-wrap:wrap; }
.notification-sync-strip.is-clean { background:rgba(19,76,63,.24); }
.notification-sync-strip.is-warning { background:rgba(102,70,13,.24); color:#ffd98f; }
.notification-today-hero {
  display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:center; gap:28px; padding:27px 25px 22px;
}
.notification-simple-kicker { color:#78a0bb; font-size:10px; font-weight:850; letter-spacing:1.45px; text-transform:uppercase; }
.notification-today-hero h2, .notification-page-head h2, .notification-audit-head h2 { margin:5px 0; font-size:23px; letter-spacing:-.4px; }
.notification-today-hero p, .notification-page-head p, .notification-audit-head p { margin:0; color:var(--muted); font-size:13px; }
.notification-primary-action { min-width:185px; }
.notification-primary-action .btn { width:100%; min-height:44px; }
.notification-simple-flow { display:flex; align-items:center; gap:0; margin-top:22px; }
.notification-simple-flow span { display:flex; align-items:center; gap:7px; min-width:120px; color:var(--muted-2); font-size:12px; font-weight:720; }
.notification-simple-flow span:not(:last-child)::after { content:""; width:42px; height:1px; margin:0 10px; background:var(--line-strong); }
.notification-simple-flow span.is-done { color:#9fdcc1; }
.notification-simple-flow span.is-current { color:#ffd88b; }
.notification-simple-grid { display:grid; grid-template-columns:minmax(0,1.35fr) minmax(300px,.65fr); gap:14px; padding:0 16px 16px; }
.notification-simple-card { padding:17px; border:1px solid var(--line); border-radius:13px; background:rgba(9,23,35,.78); }
.notification-simple-card-head { display:flex; align-items:flex-start; justify-content:space-between; gap:14px; }
.notification-simple-card-head > div { display:grid; gap:3px; }
.notification-simple-card-head strong { font-size:15px; }
.notification-simple-card-head span { color:var(--muted); font-size:12px; }
.notification-simple-metrics { display:flex; flex-wrap:wrap; gap:9px; margin-top:15px; }
.notification-simple-metrics > span {
  display:grid; min-width:145px; gap:3px; padding:10px 12px; border:1px solid var(--line); border-radius:10px;
  color:var(--muted); background:rgba(5,15,24,.58); font-size:11px;
}
.notification-simple-metrics b { color:#cde7f3; font-size:12px; text-transform:uppercase; }
.notification-simple-details { margin-top:12px; border-top:1px solid var(--line); }
.notification-simple-details summary { padding:12px 0 2px; color:#9fd7ea; cursor:pointer; font-size:12px; font-weight:750; }
.notification-simple-details > div {
  display:grid; grid-template-columns:minmax(160px,.8fr) minmax(180px,1fr) auto; align-items:center; gap:12px;
  padding:9px 0; border-top:1px solid rgba(106,154,200,.1); color:var(--muted); font-size:12px;
}
.notification-simple-attention { display:grid; gap:9px; margin:16px 0; }
.notification-simple-attention span { display:flex; align-items:center; gap:8px; color:#bdd0df; font-size:12px; }
.notification-simple-attention + .btn { width:100%; }
.notification-simple-next {
  display:flex; align-items:center; justify-content:space-between; gap:15px; padding:11px 17px;
  border-top:1px solid var(--line); color:var(--muted); font-size:11px;
}
.notification-page-head, .notification-audit-head {
  display:flex; align-items:center; justify-content:space-between; gap:24px; padding:21px 22px; border-bottom:1px solid var(--line);
}
.notification-attention-list, .notification-history-list { padding:8px 16px 16px; }
.notification-attention-list article {
  display:grid; grid-template-columns:minmax(220px,1fr) minmax(200px,.55fr) auto; align-items:center; gap:18px;
  padding:14px 4px; border-bottom:1px solid var(--line);
}
.notification-attention-list article > div { display:grid; gap:4px; }
.notification-attention-list article span { color:var(--muted); font-size:12px; }
.notification-attention-result b { color:#ffb6bd; }
.notification-history-list details { border-bottom:1px solid var(--line); }
.notification-history-list summary {
  display:flex; align-items:center; justify-content:space-between; gap:20px; padding:15px 4px; cursor:pointer; list-style:none;
}
.notification-history-list summary::-webkit-details-marker { display:none; }
.notification-history-list summary > span { display:grid; gap:4px; }
.notification-history-list small { color:var(--muted); }
.notification-history-detail { margin:0 0 12px 14px; padding-left:14px; border-left:2px solid var(--line-strong); }
.notification-history-detail > div {
  display:flex; align-items:center; justify-content:space-between; gap:16px; padding:9px 0; color:var(--muted); font-size:12px;
}
.notification-history-detail > div > span:first-child { display:grid; gap:3px; }
.notification-history-detail b { color:#dcecf4; }
.notification-history-actions { display:flex; gap:7px; }
.notification-audit-view { display:none; }
.notification-audit-view.is-visible { display:block; }
.notification-audit-head {
  margin-bottom:14px; border:1px solid var(--line-strong); border-radius:var(--radius); background:rgba(10,25,38,.9); box-shadow:var(--glow);
}

@media (max-width: 900px) {
  .notification-simple-grid { grid-template-columns:1fr; }
  .notification-today-hero { grid-template-columns:1fr; }
  .notification-primary-action { min-width:0; }
  .notification-simple-flow { overflow-x:auto; padding-bottom:5px; }
  .notification-attention-list article { grid-template-columns:1fr auto; }
  .notification-attention-result { grid-column:1 / -1; grid-row:2; }
}

@media (max-width: 640px) {
  .notification-view-tabs { width:100%; overflow-x:auto; }
  .notification-view-tabs button { flex:1 0 auto; }
  .notification-sync-strip, .notification-page-head, .notification-audit-head, .notification-simple-next { align-items:flex-start; flex-direction:column; }
  .notification-today-hero { padding:21px 16px; }
  .notification-simple-flow span { min-width:105px; }
  .notification-simple-flow span:not(:last-child)::after { width:22px; }
  .notification-simple-details > div { grid-template-columns:1fr; }
  .notification-history-detail > div { align-items:flex-start; flex-direction:column; }
}
