:root {
  color-scheme: light;
  --bg: #f4f4f4;
  --surface: #ffffff;
  --line: #d9d9d9;
  --text: #0d0d0d;
  --muted: #4a4d4e;
  --accent: #e60000;
  --accent-dark: #c30000;
  --charcoal: #25282b;
  --shadow: 0 2px 8px rgba(0,0,0,.12);
}
.time-chart-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.time-chart-toolbar h2 { margin: 0; }
.time-chart-toolbar label { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 14px; }
.time-chart-toolbar select { width: auto; min-width: 125px; margin: 0; }
.time-chart-view[hidden] { display: none; }
.reason-view[hidden] { display: none; }
.reason-table-viewport { overflow-x: auto; }
.reason-table-viewport table { min-width: 900px; }
* { box-sizing: border-box; }
@font-face { font-display: swap; font-family: Vodafone; font-style: normal; font-weight: 400; src: url("https://www.vodafone.es/c/statics/fonts/vodafone-regular.woff2") format("woff2"); }
@font-face { font-display: swap; font-family: Vodafone; font-style: normal; font-weight: 300; src: url("https://www.vodafone.es/c/statics/fonts/vodafone-light.woff2") format("woff2"); }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.45 Vodafone, Arial, sans-serif; }
.meta-bar { background: #222; color: #fff; font-size: 13px; }
.meta-bar > div { display: flex; justify-content: space-between; margin: auto; max-width: 1440px; padding: 7px 32px; }
.meta-context { color: #d9d9d9; }
.topbar { align-items: center; background: var(--surface); box-shadow: 0 2px 5px rgba(0,0,0,.18); display: flex; justify-content: space-between; min-height: 72px; padding: 0 max(24px,calc((100vw - 1380px)/2)); position: relative; z-index: 10; }
.brand { align-items: center; color: var(--text); display: flex; font-size: 20px; font-weight: 700; gap: 12px; text-decoration: none; }
.brand img { height: 48px; width: 48px; }
.topnav { display: flex; gap: 16px; margin-left: auto; margin-right: 20px; }
.topnav a { border-bottom: 3px solid transparent; color: var(--text); font-weight: 600; padding: 25px 8px 22px; text-decoration: none; }
.topnav a:hover { border-bottom-color: var(--accent); color: var(--accent); }
.page { margin: 0 auto; max-width: 1280px; min-height: calc(100vh - 230px); padding: 38px 28px 70px; }
.page-title { border-left: 5px solid var(--accent); margin-bottom: 26px; padding-left: 18px; }
h1, h2, p { margin: 0; }
h1 { font-size: 34px; font-weight: 300; line-height: 1.15; }
h2 { font-size: 21px; margin: 32px 0 12px; }
p { color: var(--muted); margin-top: 6px; }
table { background: var(--surface); border: 0; border-collapse: collapse; box-shadow: var(--shadow); overflow: hidden; width: 100%; }
th, td { border-bottom: 1px solid #ebebeb; padding: 14px 16px; text-align: left; vertical-align: top; }
th { background: var(--charcoal); color: #fff; font-size: 13px; letter-spacing: .02em; }
tbody tr:hover { background: #fafafa; }
a { color: var(--accent); }
.login-panel { background: var(--surface); border-radius: 8px; box-shadow: var(--shadow); margin: 72px auto 0; max-width: 420px; padding: 34px; }
.login-panel form { display: grid; gap: 14px; margin-top: 20px; }
label { color: var(--muted); display: grid; gap: 6px; }
input, select { background: #fff; border: 1px solid #7e7e7e; border-radius: 4px; font: inherit; min-height: 46px; padding: 10px 12px; width: 100%; }
input:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(230,0,0,.16); outline: none; }
button { background: var(--accent); border: 0; border-radius: 5px; color: #ffffff; cursor: pointer; font: inherit; font-weight: 700; min-height: 44px; padding: 10px 18px; transition: background .15s,transform .15s; }
button:hover { background: var(--accent-dark); }
button:active { transform: translateY(1px); }
.button-danger { background: #b42318; }
.button-danger:hover { background: #7a271a; }
.button-small { min-height: 32px; padding: 5px 10px; }
.icon-button { min-height: 34px; }
.alert { background: #fff4d6; border: 1px solid #e3c66a; margin-bottom: 16px; padding: 10px 12px; }
.action-panel { background: var(--surface); border: 0; border-radius: 8px; box-shadow: var(--shadow); margin: 0 0 22px; padding: 24px; }
.action-panel h2 { margin: 0 0 8px; }
.inline-form { align-items: end; display: grid; gap: 12px; grid-template-columns: 2fr 1fr 2fr auto; margin-top: 14px; }
.workspace-title { align-items: center; display: flex; justify-content: space-between; }
.workspace-title h1 { margin-top: 8px; }
.back-button { flex: 0 0 auto; margin-left: 20px; }
.workflow { display: grid; gap: 2px; grid-template-columns: repeat(3,1fr); margin: 20px 0; }
.workflow-step { align-items: center; background: #ebebeb; color: var(--muted); display: flex; gap: 10px; padding: 14px; }
.workflow-step strong { align-items: center; background: #fff; border-radius: 50%; display: inline-flex; height: 28px; justify-content: center; width: 28px; }
.workflow-step.done { background: #fff; border-bottom: 3px solid var(--accent); color: var(--text); }
.workspace-grid { display: grid; gap: 16px; grid-template-columns: 2fr 1fr; }
.upload-form { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; margin-top: 16px; }
.upload-form label:last-of-type, .upload-form button { grid-column: 1 / -1; }
.upload-stack .subsection-title { border-top: 1px solid var(--line); margin-top: 24px; padding-top: 20px; }
.report-action { border-top: 4px solid var(--accent); }
.report-action form { margin: 20px 0 12px; }
.report-buttons { display: grid; gap: 8px; margin-top: 14px; }
.report-buttons form { margin: 0; }
.report-buttons button, .report-buttons .button-secondary { box-sizing: border-box; text-align: center; width: 100%; }
button:disabled { background: #a9b1ba; cursor: not-allowed; }
.button-secondary { border: 2px solid var(--accent); border-radius: 5px; display: inline-block; font-weight: 700; padding: 8px 13px; text-decoration: none; }
.button-secondary:hover { background: #fff1f1; }
.error-text { color: #991b1b; display: block; margin-top: 4px; max-width: 420px; }
.subtext { color: var(--muted); display: block; margin-top: 3px; }


.kpi-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); margin-bottom: 18px; }
.kpi { background: var(--surface); border: 0; border-radius: 8px; box-shadow: var(--shadow); padding: 20px; }
.kpi span { color: var(--muted); display: block; font-size: 12px; text-transform: uppercase; }
.kpi strong { display: block; font-size: 30px; line-height: 1.1; margin-top: 4px; }
.kpi strong.small-value { font-size: 20px; }
.kpi em { color: var(--muted); display: block; font-style: normal; margin-top: 4px; }
.chart-grid { display: grid; gap: 20px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.chart-panel { background: var(--surface); border: 1px solid #e8eaed; border-radius: 14px; box-shadow: 0 3px 16px rgba(37,40,43,.045); margin: 20px 0; min-width: 0; padding: 12px; }
.chart-grid > .chart-panel { margin: 0; }
.chart-grid:has(> .chart-panel) { grid-template-columns: 1fr; }
.chart-viewport { max-width: 100%; overflow-x: auto; scrollbar-width: thin; }
.chart-viewport svg { display: block; height: auto; min-width: 680px; width: 100%; }
.chart-viewport .chat-chart { min-width: 680px; }
@media (max-width: 640px) {
  .chart-viewport svg, .chart-viewport .chat-chart { min-width: 1120px; }
}
.sr-only { clip-path: inset(50%); height: 1px; overflow: hidden; position: absolute; white-space: nowrap; width: 1px; }
.chart-panel.wide { margin-top: 16px; }
.section-head { align-items: baseline; display: flex; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.section-head h2 { margin: 0; }
.section-head span { color: var(--muted); font-size: 12px; }
.legend { display: flex; gap: 18px; margin-top: 12px; }
.legend span { align-items: center; color: var(--muted); display: inline-flex; gap: 6px; }
.legend i { display: inline-block; height: 10px; width: 22px; }
.cohort-1 { background: #e60000; }
.cohort-2 { background: #9c2aa0; }
.cohort-3 { background: #00b0ca; }
.daily-chart { align-items: end; display: grid; gap: 6px; grid-template-columns: repeat(var(--days), minmax(22px, 1fr)); min-height: 240px; overflow-x: auto; padding-top: 8px; }
.day-group { align-items: center; display: grid; gap: 6px; grid-template-rows: 1fr auto; min-width: 24px; }
.day-bars { align-items: end; border-bottom: 1px solid var(--line); display: flex; gap: 3px; height: 210px; justify-content: center; width: 100%; }
.vbar { display: block; min-height: 2px; width: 8px; }
.day-group small { color: var(--muted); font-size: 10px; text-align: center; white-space: nowrap; writing-mode: vertical-rl; }
.bar-chart { display: grid; gap: 12px; }
.bar-chart.compact { gap: 10px; }
.bar-row { align-items: center; display: grid; gap: 12px; grid-template-columns: minmax(140px, 1.2fr) minmax(220px, 2fr) 70px; }
.bar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-stack { display: grid; gap: 5px; }
.hbar-line { align-items: center; display: grid; gap: 8px; grid-template-columns: 78px 1fr 38px; }
.hbar-name { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-track { background: #edf1f5; display: block; height: 12px; position: relative; width: 100%; }
.hbar-fill { display: block; height: 100%; min-width: 2px; }
.hbar-value { color: var(--muted); font-variant-numeric: tabular-nums; text-align: right; }
.delta { color: var(--muted); font-variant-numeric: tabular-nums; text-align: right; }
.delta small { display: block; font-size: 11px; }
.delta.up { color: #e60000; }
.delta.down { color: #008a00; }
@media (max-width: 860px) {
  .chart-grid { grid-template-columns: 1fr; }
  .bar-row { grid-template-columns: 1fr; }
  .delta { text-align: left; }
}

.report-panel { background: var(--surface); border: 0; border-radius: 8px; box-shadow: var(--shadow); margin: 18px 0; padding: 22px; }
.warning-panel { border-left: 4px solid #d97706; }
.report-lead { color: var(--text); font-size: 16px; margin: 0 0 14px; }
.report-note { color: var(--muted); margin: 0 0 14px; }
.report-stats { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.report-stats div { border: 1px solid var(--line); padding: 12px; }
.report-stats span { color: var(--muted); display: block; font-size: 12px; text-transform: uppercase; }
.report-stats strong { display: block; font-size: 24px; margin-top: 3px; }
.issue-card { background: #ffffff; border-left: 4px solid #0f3460; margin: 0 0 12px; padding: 14px 14px 14px 16px; }
.issue-card h3 { color: #16213e; font-size: 14px; margin: 0 0 5px; }
.issue-card p { color: #555; margin: 0; }
.issue-card.critical { border-left-color: #e74c3c; }
.issue-card.info, .issue-card.discarded { border-left-color: #95a5a6; }
.issue-card.recommendation { border-left-color: #e60000; }
.recommendations-list { display: grid; gap: 0; }
.root-cause-section { margin: 0 0 16px; }
.root-cause-section h3 { border-bottom: 2px solid #0f3460; color: #16213e; font-size: 15px; margin: 0 0 10px; padding-bottom: 6px; }
.rc-table { background: #fff; border: 1px solid var(--line); border-collapse: collapse; font-size: 13px; width: 100%; }
.rc-table th { background: #1a1a2e; color: #fff; }
.rc-table td, .rc-table th { border-bottom: 1px solid #ecf0f1; padding: 8px; }
.status { border-radius: 999px; display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 9px; }
.status-ready { background: #dff3e4; color: #166534; }
.status-failed { background: #fde2e0; color: #991b1b; }
.comparison-cards { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 16px; }
.comparison-card { background: #fff; border: 0; border-radius: 8px; box-shadow: var(--shadow); padding: 20px; }
.comparison-card.control { border-top: 5px solid #9c2aa0; }
.comparison-card.new_release { border-top: 5px solid #e60000; }
.comparison-card > span { color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; }
.comparison-card > strong { display: block; font-size: 36px; margin-top: 4px; }
@media (max-width: 700px) { .comparison-cards { grid-template-columns: 1fr; } .topnav { display: none; } }
@media (max-width: 800px) { .inline-form, .workspace-grid, .upload-form { grid-template-columns: 1fr; } .upload-form label:last-of-type, .upload-form button { grid-column: auto; } }
.site-footer { align-items: center; background: #25282b; color: #fff; display: flex; justify-content: space-between; min-height: 110px; padding: 24px max(28px,calc((100vw - 1280px)/2)); }
.site-footer div { display: grid; gap: 3px; }
.site-footer span, .site-footer small { color: #d9d9d9; }
.assistant-link { border-color: #9c2aa0; color: #5e2750; }
.assistant-link:hover { background: #f7eff7; }
.report-tabs { background: #fff; border-radius: 8px; box-shadow: var(--shadow); display: flex; gap: 4px; margin-bottom: 20px; padding: 7px; }
.report-tabs a { border-radius: 5px; color: var(--text); font-weight: 700; padding: 10px 14px; text-decoration: none; }
.report-tabs a.active { background: var(--accent); color: #fff; }
.assistant-layout { align-items: start; display: grid; gap: 20px; grid-template-columns: minmax(0,2fr) minmax(280px,1fr); }
.chat-panel, .revision-panel { background: #fff; border-radius: 8px; box-shadow: var(--shadow); }
.chat-history { display: grid; gap: 14px; max-height: 620px; min-height: 320px; overflow-y: auto; padding: 24px; }
.chat-message { border-radius: 12px; max-width: 84%; padding: 14px 16px; }
.chat-message p { color: inherit; white-space: pre-wrap; }
.chat-message.user { background: #f2f2f2; justify-self: end; }
.chat-message.assistant { background: #fff1f1; border-left: 4px solid var(--accent); justify-self: start; }
.chat-message.failed { background: #fff4d6; border-left-color: #eb9700; }
.chat-message a { display: inline-block; font-weight: 700; margin-top: 9px; }
.inline-report-chat { margin-top: 32px; scroll-margin-top: 24px; }
.inline-chat-heading { padding: 24px 24px 0; }
.inline-chat-heading h2 { margin-top: 0; }
.inline-report-chat .chat-history { min-height: 140px; }
.inline-report-chat .chat-message { width: 90%; max-width: 90%; }
.chat-chart { background: white; border: 1px solid #e8eaed; border-radius: 14px; display: block; height: auto; margin: 16px 0; max-width: 100%; width: 100%; }
.chat-artifact { border-top: 1px solid var(--line); margin: 14px 0; padding-top: 12px; }
.chat-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.chat-actions form { display: flex; margin: 0; padding: 0; }
.chat-message .chat-actions a, .chat-message .chat-actions small, .chat-artifact .chat-actions a { margin-top: 0; }
.chat-message small { color: #990000; display: block; margin-top: 8px; }
.assistant-empty { margin: auto; max-width: 520px; text-align: center; }
.assistant-empty h2 { margin-top: 0; }
.chat-compose { border-top: 1px solid var(--line); display: grid; gap: 9px; padding: 20px 24px 24px; }
.chat-compose textarea { border: 1px solid #7e7e7e; border-radius: 5px; font: inherit; min-height: 120px; padding: 12px; resize: vertical; }
.chat-compose textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(230,0,0,.16); outline: none; }
.revision-panel { padding: 22px; }
.revision-panel h2 { margin: 0 0 8px; }
.revision-panel h2:not(:first-child) { border-top: 1px solid var(--line); margin-top: 24px; padding-top: 20px; }
.revision-row { align-items: center; border-bottom: 1px solid #ebebeb; display: grid; gap: 8px; grid-template-columns: 1fr auto; padding: 12px 0; }
.revision-row div { display: grid; }
.revision-row span, .dataset-chip span { color: var(--muted); font-size: 12px; }
.revision-row form { grid-column: 1 / -1; }
.dataset-chip { background: #f4f4f4; border-radius: 5px; display: grid; margin-top: 8px; padding: 10px; }
.source-report-card { border-left: 5px solid #25282b; }
.revision-text { color: var(--text); font-size: 17px; white-space: pre-wrap; }
.assistant-chart { display: grid; gap: 14px; }
.assistant-chart-row { align-items: start; display: grid; gap: 14px; grid-template-columns: minmax(130px,1fr) minmax(280px,2fr); }
.assistant-chart-row > span { overflow-wrap: anywhere; }
.assistant-bar-line { align-items: center; display: grid; gap: 8px; grid-template-columns: minmax(110px,auto) minmax(2px,1fr) 65px; }
.assistant-bar-line small { color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.assistant-bar-line i { display: block; height: 14px; min-width: 2px; }
.assistant-bar-line b { font-variant-numeric: tabular-nums; text-align: right; }
@media (max-width: 700px) {
  .meta-context, .brand span { display: none; }
  .topbar { min-height: 62px; padding: 0 16px; }
  .brand img { height: 42px; width: 42px; }
  .page { padding: 28px 16px 50px; }
  h1 { font-size: 28px; }
  table { display: block; overflow-x: auto; }
  .site-footer { align-items: flex-start; flex-direction: column; gap: 16px; }
  .assistant-layout { grid-template-columns: 1fr; }
  .report-tabs { overflow-x: auto; }
  .report-tabs a { white-space: nowrap; }
  .chat-message { max-width: 94%; }
  .assistant-chart-row { grid-template-columns: 1fr; }
  .workspace-title { align-items: flex-start; flex-direction: column; gap: 16px; }
  .back-button { margin-left: 0; }
}
