:root {
  --navy: #072f4a;
  --navy-2: #0b496b;
  --blue: #0798c9;
  --blue-dark: #006f9d;
  --blue-soft: #dff6fc;
  --cyan: #20c5dd;
  --ink: #172633;
  --muted: #5d7483;
  --line: #c8dfe9;
  --surface: #ffffff;
  --background: #dff4fb;
  --danger: #b42318;
  --danger-soft: #fef3f2;
  --success: #15805f;
  --success-soft: #eaf9f3;
  --warning: #b76e00;
  --shadow: 0 22px 60px rgba(6, 65, 95, .16);
  --radius: 18px;
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html {
  min-height: 100%; background: var(--background);
  overflow-x: clip;
  -webkit-text-size-adjust: 100%; text-size-adjust: 100%;
}
body { margin: 0; min-height: 100vh; overflow-x: clip; color: var(--ink); background: var(--background); }
body > .site-header, body > .public-shell, body > .site-footer { max-width: 100%; }
@supports not (overflow: clip) {
  html, body { overflow-x: hidden; }
}
button, input, textarea, select { font: inherit; }
button, a, label[for] { -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }

.site-header, .admin-header {
  min-height: 84px; padding: 12px clamp(20px, 5vw, 72px); display: flex; align-items: center;
  justify-content: space-between; gap: 24px; background: linear-gradient(90deg, rgba(255,255,255,.98), rgba(232,249,255,.98)); border-bottom: 1px solid #b9dce9;
  box-shadow: 0 7px 24px rgba(4, 81, 115, .08);
}
.brand { display: flex; align-items: center; gap: 14px; color: var(--ink); text-decoration: none; }
.brand img { width: 62px; height: 62px; object-fit: contain; }
.brand-copy { display: grid; gap: 2px; }
.brand-copy strong { font-size: 1rem; letter-spacing: -.01em; }
.brand-copy small { color: var(--muted); font-size: .78rem; }
.service-status { display: flex; align-items: center; gap: 9px; color: var(--success); font-size: .82rem; font-weight: 700; }
.service-status span { width: 9px; height: 9px; border-radius: 50%; background: #1fb985; box-shadow: 0 0 0 5px #e7f8f2; }

.public-page {
  background:
    radial-gradient(circle at 8% 6%, rgba(31, 197, 221, .45) 0, transparent 27%),
    radial-gradient(circle at 92% 18%, rgba(7, 152, 201, .28) 0, transparent 30%),
    linear-gradient(145deg, #c8eef9 0%, #e6f8fc 46%, #bce7f5 100%);
  background-attachment: fixed;
}
.public-shell { width: min(1180px, calc(100% - 40px)); margin: 46px auto 64px; display: grid; grid-template-columns: .82fr 1.35fr; gap: 42px; align-items: start; }
.public-shell > *, .dashboard-shell > * { min-width: 0; }
.intro-panel {
  position: sticky; top: 28px; overflow: hidden; padding: 38px 34px 32px; color: white;
  background:
    radial-gradient(circle at 100% 0, rgba(78, 220, 238, .35), transparent 34%),
    linear-gradient(155deg, #073d5d 0%, #076f98 58%, #0798bd 100%);
  border: 1px solid rgba(255,255,255,.24); border-radius: 24px;
  box-shadow: 0 24px 60px rgba(2, 58, 85, .24);
}
.intro-panel::after { content: ""; position: absolute; right: -70px; bottom: -85px; width: 210px; height: 210px; border: 1px solid rgba(255,255,255,.18); border-radius: 50%; box-shadow: 0 0 0 28px rgba(255,255,255,.045), 0 0 0 58px rgba(255,255,255,.03); pointer-events: none; }
.eyebrow { color: var(--blue-dark); font-size: .73rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.intro-panel .eyebrow { color: #8cecf5; }
.intro-panel h1, .form-heading h2, .dashboard-title h1 { margin: 10px 0 12px; letter-spacing: -.035em; line-height: 1.08; }
.intro-panel h1 { font-size: clamp(2.2rem, 5vw, 3.45rem); color: white; }
.intro-panel > p { max-width: 480px; margin: 0; color: #d8eef6; font-size: 1.04rem; line-height: 1.7; }
.steps { list-style: none; padding: 0; margin: 38px 0; display: grid; gap: 18px; }
.steps li { display: flex; align-items: center; gap: 14px; }
.steps li > span { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; background: rgba(255,255,255,.95); border: 1px solid rgba(255,255,255,.7); color: var(--blue-dark); font-weight: 800; box-shadow: 0 7px 18px rgba(1,48,72,.18); }
.steps div { display: grid; gap: 2px; }
.steps strong { color: white; font-size: .9rem; }
.steps small { color: #c8e6f0; }
.privacy-note { position: relative; z-index: 1; max-width: 480px; padding: 18px 20px; border: 1px solid rgba(143,234,245,.45); border-radius: 14px; background: rgba(2,47,72,.28); backdrop-filter: blur(4px); }
.privacy-note strong { color: white; font-size: .88rem; }
.privacy-note p { margin: 5px 0 0; color: #d5edf5; line-height: 1.5; font-size: .82rem; }

.form-card { padding: clamp(25px, 4vw, 46px); background: rgba(255,255,255,.98); border: 1px solid rgba(171,216,232,.95); border-radius: 24px; box-shadow: var(--shadow); }
.form-heading { margin-bottom: 30px; }
.form-heading h2 { font-size: clamp(1.7rem, 3vw, 2.25rem); color: var(--navy); }
.form-heading p { margin: 0; color: var(--muted); font-size: .88rem; }
.form-heading p span, label > span { color: var(--danger); }
fieldset { margin: 0 0 30px; padding: 0; border: 0; }
legend { width: 100%; margin-bottom: 18px; padding-bottom: 10px; border-bottom: 1px solid var(--line); color: var(--navy-2); font-size: .82rem; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.field-grid { display: grid; gap: 18px; }
.two-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.full-width { grid-column: 1 / -1; }
.field { display: grid; align-content: start; gap: 7px; }
.field label, .label-row label { color: #304757; font-size: .83rem; font-weight: 750; }
.label-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.label-row small, .field-help { color: var(--muted); font-size: .73rem; }
input, textarea, select { width: 100%; min-height: 46px; padding: 11px 13px; color: var(--ink); background: #fbfdfe; border: 1px solid #c9d8e0; border-radius: 10px; outline: none; transition: border-color .18s, box-shadow .18s, background .18s; }
textarea { min-height: 138px; line-height: 1.5; resize: vertical; }
input:focus, textarea:focus, select:focus { background: white; border-color: var(--blue); box-shadow: 0 0 0 4px rgba(19,132,180,.12); }
input[aria-invalid="true"], textarea[aria-invalid="true"], select[aria-invalid="true"] { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(180,35,24,.08); }
select:disabled { color: #82909a; cursor: wait; }
.field-error { min-height: 1em; color: var(--danger); font-size: .74rem; }

.drop-zone { min-height: 155px; display: grid; place-items: center; align-content: center; gap: 5px; padding: 24px; text-align: center; color: var(--muted); border: 1.5px dashed #9ebdcb; border-radius: 14px; background: #f8fbfc; cursor: pointer; transition: .18s ease; }
.drop-zone:hover, .drop-zone.dragging { border-color: var(--blue); background: var(--blue-soft); transform: translateY(-1px); }
.drop-zone.has-file { border-style: solid; border-color: #73b8d0; background: #f1fafc; }
.drop-zone input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.drop-zone strong { color: var(--navy-2); font-size: .9rem; }
.drop-zone small { font-size: .76rem; }
.upload-icon { width: 38px; height: 38px; display: grid; place-items: center; margin-bottom: 3px; border-radius: 12px; background: white; color: var(--blue); font-size: 1.35rem; font-weight: 500; box-shadow: 0 4px 14px rgba(31,93,122,.12); }
.file-selection { margin-top: 8px; color: var(--blue-dark); font-size: .8rem; font-weight: 700; }
.button-link { margin-top: 8px; padding: 0; color: var(--danger); background: none; border: 0; cursor: pointer; font-size: .78rem; font-weight: 700; }
.consent-row { display: flex; align-items: flex-start; gap: 11px; margin: -4px 0 7px; padding: 12px 13px; color: var(--danger); background: var(--danger-soft); border: 1px solid #f6ccc8; border-radius: 10px; font-size: .78rem; line-height: 1.45; transition: color .18s, background .18s, border-color .18s; }
.consent-row > span { color: inherit; }
.consent-row input { width: 18px; min-height: 18px; margin-top: 1px; accent-color: var(--blue); flex: 0 0 auto; }
.consent-row.is-checked { color: var(--success); background: var(--success-soft); border-color: #b8e2d3; }
.consent-error { display: block; margin: 0 0 16px; }

.button { min-height: 42px; display: inline-flex; align-items: center; justify-content: center; gap: 9px; padding: 10px 17px; color: inherit; border: 1px solid transparent; border-radius: 10px; cursor: pointer; font-size: .83rem; font-weight: 750; text-decoration: none; transition: transform .15s, background .15s, box-shadow .15s; }
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button:disabled { opacity: .56; cursor: not-allowed; }
.button-primary { color: white; background: linear-gradient(135deg, var(--blue), var(--blue-dark)); box-shadow: 0 8px 18px rgba(11,111,151,.19); }
.button-primary:hover:not(:disabled) { box-shadow: 0 11px 23px rgba(11,111,151,.25); }
.button-secondary { color: var(--navy-2); background: white; border-color: var(--line); }
.button-ghost { color: #dcecf3; background: rgba(255,255,255,.07); border-color: rgba(255,255,255,.14); }
.button-large { width: 100%; min-height: 52px; }
.spinner { width: 18px; height: 18px; border: 2px solid rgba(255,255,255,.4); border-top-color: white; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.alert { padding: 13px 15px; margin-bottom: 20px; border-radius: 10px; font-size: .82rem; line-height: 1.45; }
.alert-error { color: #8e2018; background: var(--danger-soft); border: 1px solid #f6ccc8; }
.site-footer { padding: 16px clamp(20px, 5vw, 72px); color: #d8eaf1; background: #073e59; border-top: 3px solid var(--cyan); font-size: .78rem; }
.footer-content { min-height: 38px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.footer-legal { margin: 0; color: #bad6e0; }
.footer-icons { display: flex; align-items: center; gap: 10px; }
.footer-icons a { width: 36px; height: 36px; display: grid; place-items: center; color: #dff8fb; border: 1px solid rgba(255,255,255,.2); border-radius: 50%; text-decoration: none; transition: color .15s, background .15s, border-color .15s, transform .15s; }
.footer-icons a:hover { color: white; background: rgba(32,197,221,.2); border-color: rgba(120,226,239,.65); transform: translateY(-1px); }
.footer-icons svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.footer-icons .whatsapp-icon { fill: currentColor; stroke: none; }

.result-dialog { width: min(430px, calc(100% - 32px)); padding: 38px; text-align: center; border: 0; border-radius: 22px; color: var(--ink); box-shadow: 0 30px 80px rgba(10,39,56,.28); }
.result-dialog::backdrop { background: rgba(8,29,43,.64); backdrop-filter: blur(4px); }
.result-dialog h2 { margin: 9px 0 18px; color: var(--navy); letter-spacing: -.025em; }
.result-dialog p { color: var(--muted); }
.result-icon { width: 58px; height: 58px; display: grid; place-items: center; margin: 0 auto 18px; border-radius: 50%; color: white; background: var(--success); font-size: 1.7rem; }
.protocol { display: block; margin: 8px auto 20px; padding: 9px 18px; color: var(--blue-dark); background: var(--blue-soft); border: 1px solid #c4e4f0; border-radius: 10px; cursor: pointer; font-size: 1.7rem; font-weight: 850; }
.protocol.copied::after { content: "  Copiado"; font-size: .65rem; }
.dialog-copy { line-height: 1.55; font-size: .87rem; }

.admin-page { background: #dceff6; }
.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 20% 12%, rgba(32,197,221,.38), transparent 32%), radial-gradient(circle at 85% 82%, rgba(7,152,201,.25), transparent 30%), linear-gradient(145deg, #c8ebf6, #effbfe); }
.login-card { width: min(420px, 100%); padding: 40px; text-align: center; background: white; border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow); }
.login-card > img { display: block; width: 92px; height: 92px; object-fit: contain; margin: 0 auto 15px; }
.login-card h1 { margin: 9px 0 8px; color: var(--navy); font-size: 1.7rem; letter-spacing: -.025em; }
.login-card > p { margin: 0 0 27px; color: var(--muted); font-size: .87rem; line-height: 1.55; }
.login-card form { display: grid; gap: 18px; text-align: left; }
.security-caption { display: block; margin-top: 22px; color: #8796a0; font-size: .72rem; }
.admin-header { color: white; background: linear-gradient(120deg, var(--navy), #076f98); border: 0; }
.admin-brand { color: white; }
.admin-brand img { width: 52px; height: 52px; padding: 3px; border-radius: 11px; background: white; }
.admin-brand .brand-copy small { color: #bcd1dc; }
.header-actions { display: flex; gap: 10px; }
.dashboard-shell { width: min(1380px, calc(100% - 40px)); margin: 38px auto 70px; }
.dashboard-title { display: flex; justify-content: space-between; align-items: flex-end; gap: 25px; margin-bottom: 25px; }
.dashboard-title h1 { font-size: clamp(1.7rem, 3vw, 2.3rem); }
.queue-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.queue-status { padding: 8px 12px; color: var(--success); background: var(--success-soft); border-radius: 999px; font-size: .75rem; font-weight: 750; }
.queue-status.is-pending { color: #8d5900; background: #fff4d9; }
.queue-status.has-error { color: var(--danger); background: var(--danger-soft); }
.print-report-context { display: none; }
.filter-bar { display: grid; grid-template-columns: minmax(300px, 1.7fr) minmax(235px, .9fr) auto; gap: 14px; align-items: start; margin-bottom: 22px; padding: 18px; background: white; border: 1px solid var(--line); border-radius: 15px; }
.filter-bar > .button { margin-top: 23px; }
.filter-bar input, .filter-bar select { min-height: 42px; padding: 8px 10px; }
.field-label { color: #304757; font-size: .83rem; font-weight: 750; }
.entity-filter-field { position: relative; }
.entity-filter-field > small { display: block; margin-top: 5px; color: #5e7380; font-size: .68rem; font-weight: 600; }
.entity-filter-hint > span { color: #a94e0a; font-weight: 900; }
.entity-picker { position: relative; display: flex; min-height: 42px; align-items: center; gap: 5px; padding: 5px; background: #fff; border: 1px solid #bed3dc; border-radius: 8px; cursor: text; }
.entity-picker:focus-within { border-color: #078bb3; box-shadow: 0 0 0 3px rgba(7,139,179,.13); }
.entity-picker-control { display: flex; min-width: 32px; flex: 0 0 32px; align-items: center; margin-left: auto; overflow: hidden; transition: flex-basis .16s ease; }
.entity-picker input { width: 0; min-width: 0; min-height: 30px; padding: 0; opacity: 0; pointer-events: none; border: 0; box-shadow: none; }
.entity-picker.is-editing .entity-picker-control { min-width: 150px; flex: 1 1 170px; }
.entity-picker.is-editing input { width: 100%; padding: 4px 6px; opacity: 1; pointer-events: auto; }
.entity-picker input:focus { outline: 0; box-shadow: none; }
.entity-picker-toggle { width: 32px; height: 32px; flex: 0 0 32px; margin-left: 0; padding: 0; color: #075f86; background: transparent; border: 0; border-radius: 7px; cursor: pointer; }
.entity-picker-toggle:hover, .entity-picker-toggle:focus-visible { background: #e7f5fa; outline: 0; }
.entity-picker-toggle span { display: inline-block; width: 8px; height: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-2px) rotate(45deg); transition: transform .16s ease; }
.entity-picker-toggle[aria-expanded="true"] span { transform: translateY(2px) rotate(225deg); }
.entity-picker-chips { display: flex; min-width: 0; flex: 1 1 auto; flex-wrap: wrap; gap: 5px; }
.entity-picker-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 7px; color: #075271; background: #dff3fa; border-radius: 999px; font-size: .7rem; font-weight: 700; }
.entity-picker-chip-all { color: #075f43; background: #dff6ec; }
.entity-picker-chip button { width: 18px; height: 18px; padding: 0; color: inherit; background: transparent; border: 0; border-radius: 50%; font-size: 1rem; line-height: 1; cursor: pointer; }
.entity-picker-options { position: absolute; z-index: 20; top: calc(100% + 5px); right: 0; left: 0; max-height: 230px; overflow-y: auto; padding: 5px; background: #fff; border: 1px solid #bed3dc; border-radius: 9px; box-shadow: 0 12px 28px rgba(7,58,82,.18); }
.entity-picker-option { display: block; width: 100%; padding: 9px 10px; color: #17384d; background: transparent; border: 0; border-radius: 6px; text-align: left; cursor: pointer; }
.entity-picker-option:hover, .entity-picker-option:focus-visible { background: #eaf7fb; outline: 0; }
.period-filter-field { position: relative; }
.period-picker { position: relative; }
.period-toggle { width: 100%; min-height: 42px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 11px; color: #17384d; background: #fff; border: 1px solid #bed3dc; border-radius: 8px; text-align: left; cursor: pointer; }
.period-toggle:hover { background: #f7fcfe; border-color: #93c6d8; }
.period-toggle:focus-visible { outline: 0; border-color: #078bb3; box-shadow: 0 0 0 3px rgba(7,139,179,.13); }
.period-chevron { width: 8px; height: 8px; flex: 0 0 8px; border-right: 2px solid #075f86; border-bottom: 2px solid #075f86; transform: translateY(-2px) rotate(45deg); transition: transform .16s ease; }
.period-toggle[aria-expanded="true"] .period-chevron { transform: translateY(2px) rotate(225deg); }
.period-panel { position: absolute; z-index: 19; top: calc(100% + 5px); right: 0; width: min(430px, calc(100vw - 48px)); padding: 13px; background: #fff; border: 1px solid #bed3dc; border-radius: 12px; box-shadow: 0 14px 34px rgba(7,58,82,.2); }
.period-presets { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.period-presets button, .period-clear { min-height: 36px; padding: 7px 9px; color: #294b5e; background: #f8fbfc; border: 1px solid #d4e4ea; border-radius: 8px; font-size: .72rem; font-weight: 700; cursor: pointer; }
.period-presets button:hover, .period-presets button:focus-visible, .period-clear:hover, .period-clear:focus-visible { color: #075f86; background: #eaf7fb; border-color: #9acddd; outline: 0; }
.period-presets button[aria-pressed="true"] { color: #075f43; background: #dff6ec; border-color: #81cdb0; }
.period-presets button[data-period="custom"] { grid-column: 1 / -1; }
.period-custom-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 12px; padding-top: 12px; border-top: 1px solid #e1ebef; }
.period-custom-fields input { width: 100%; }
.period-clear { width: 100%; margin-top: 10px; color: #8a4f00; background: #fffaf0; border-color: #ead7ad; }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 22px; }
.metric-card { position: relative; overflow: hidden; min-height: 142px; padding: 22px; display: grid; align-content: center; gap: 5px; background: white; border: 1px solid var(--line); border-radius: 15px; box-shadow: 0 10px 26px rgba(10,73,101,.08); }
.metric-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--metric-color); }
.metric-card span { color: var(--muted); font-size: .78rem; font-weight: 700; }
.metric-card strong { color: var(--navy); font-size: 2.15rem; line-height: 1; }
.metric-card small { color: #8896a0; font-size: .7rem; }
.metric-blue { --metric-color: var(--blue); background: linear-gradient(145deg, #fff, #e8f8fd); }.metric-amber { --metric-color: #e39a21; background: linear-gradient(145deg, #fff, #fff7e5); }.metric-green { --metric-color: #21a47d; background: linear-gradient(145deg, #fff, #eaf9f3); }.metric-red { --metric-color: #d74c43; background: linear-gradient(145deg, #fff, #fff0ee); }
.origin-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: -6px 0 22px; }
.origin-summary > div { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 2px 12px; padding: 13px 16px; background: #fff; border: 1px solid var(--line); border-radius: 11px; }
.origin-summary span { color: #274a5d; font-size: .75rem; font-weight: 800; }
.origin-summary strong { grid-row: 1 / span 2; grid-column: 2; color: var(--navy); font-size: 1.35rem; }
.origin-summary small { color: #71838d; font-size: .67rem; }
.table-card { overflow: hidden; background: white; border: 1px solid var(--line); border-radius: 15px; }
.table-heading { padding: 21px 23px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); }
.table-heading h2 { margin: 0 0 4px; color: var(--navy); font-size: 1.03rem; }
.table-heading p { margin: 0; color: var(--muted); font-size: .75rem; }
.table-heading > span { color: var(--muted); font-size: .75rem; }
.table-heading-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.section-meta { margin-right: 2px; color: var(--muted); font-size: .75rem; white-space: nowrap; }
.refresh-button { width: 42px; min-width: 42px; padding: 0; flex: 0 0 42px; }
.refresh-icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transform-origin: center; }
.refresh-button.is-loading .refresh-icon { animation: spin .7s linear infinite; }
.refresh-button:focus-visible { outline: 3px solid rgba(7,139,179,.28); outline-offset: 2px; }
.section-toggle { width: 42px; min-width: 42px; padding: 0; }
.section-chevron { width: 9px; height: 9px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(2px) rotate(225deg); transition: transform .18s ease; }
.section-toggle[aria-expanded="false"] .section-chevron { transform: translateY(-2px) rotate(45deg); }
.section-toggle:focus-visible { outline: 3px solid rgba(7,139,179,.28); outline-offset: 2px; }
.table-card.is-collapsed .table-heading { border-bottom-color: transparent; }
.section-content[hidden] { display: none; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .79rem; }
th { padding: 12px 15px; text-align: left; color: #6d7d88; background: #f7fafb; border-bottom: 1px solid var(--line); font-size: .68rem; letter-spacing: .055em; text-transform: uppercase; }
td { max-width: 360px; padding: 14px 15px; border-bottom: 1px solid #edf2f4; color: #3e5361; }
tbody tr:hover { background: #fafcfd; }
.ticket-id { color: var(--blue-dark); font-weight: 800; white-space: nowrap; }
.ticket-title { color: var(--ink); font-weight: 650; }
.status-badge { display: inline-flex; padding: 5px 8px; border-radius: 999px; font-size: .67rem; font-weight: 800; white-space: nowrap; }
.status-new { color: #fff; background: #168454; }
.status-progress { color: #fff; background: #287a4d; }
.status-planned { color: #fff; background: #7652b5; }
.status-pending { color: #4f3500; background: #f2bd4f; }
.status-solved { color: #fff; background: #b9570d; }
.status-closed { color: #fff; background: #20282e; }
.status-unknown { color: #334854; background: #dce6ea; }
.sla-overdue { color: var(--danger); font-weight: 750; }.sla-ok { color: var(--success); font-weight: 700; }
.empty-cell { padding: 38px; text-align: center; color: var(--muted); }
.ticket-history-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 14px; padding: 18px; background: #f3f9fb; }
.ticket-history-empty { grid-column: 1 / -1; margin: 0; padding: 24px; color: var(--muted); text-align: center; }
.ticket-history-record { min-width: 0; overflow: hidden; background: white; border: 1px solid #d6e5eb; border-left: 5px solid #8aa2ae; border-radius: 12px; }
.ticket-history-record[data-status="new"] { border-left-color: #168454; }
.ticket-history-record[data-status="progress"] { border-left-color: #43a86d; }
.ticket-history-record[data-status="planned"] { border-left-color: #7652b5; }
.ticket-history-record[data-status="pending"] { border-left-color: #d99a19; }
.ticket-history-record[data-status="solved"] { border-left-color: #d86b16; }
.ticket-history-record[data-status="closed"] { border-left-color: #20282e; }
.ticket-history-record-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 14px 15px; border-bottom: 1px solid #e1ebef; }
.ticket-history-record-identity { min-width: 0; }
.ticket-history-record-identity .ticket-id { display: block; margin: 0; font-size: .82rem; line-height: 1.25; }
.ticket-history-record-identity .ticket-title { margin: 5px 0 0; font-size: .83rem; line-height: 1.38; overflow-wrap: anywhere; }
.ticket-history-record-heading .status-badge { flex: 0 0 auto; }
.ticket-history-badges, .notification-record-context { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 6px; }
.context-badge { display: inline-flex; padding: 4px 7px; border-radius: 999px; font-size: .64rem; font-weight: 800; white-space: nowrap; }
.context-badge-portal { color: #075f43; background: #dff6ec; }
.context-badge-internal { color: #334d5b; background: #e5edf1; }
.context-badge-test { color: #5c3997; background: #eee5fb; }
.context-badge-operational { color: #365364; background: #edf3f6; }
.context-badge-communication-real { color: #075f43; background: #e3f7ee; }
.context-badge-communication-simulated { color: #5c3997; background: #eee5fb; }
.context-badge-communication-historical { color: #775300; background: #fff0c3; }
.context-badge-communication-not_applicable { color: #334d5b; background: #e5edf1; }
.notification-record-context { justify-content: flex-start; margin-top: 8px; }
.ticket-history-record-body { display: grid; }
.ticket-history-detail { display: grid; gap: 4px; min-width: 0; }
.ticket-history-detail > span,
.ticket-history-sla > span { color: #6b7d88; font-size: .72rem; }
.ticket-history-detail > strong { color: #3e5361; font-size: .78rem; font-weight: 650; line-height: 1.4; overflow-wrap: anywhere; }
.ticket-history-company { padding: 14px 15px; }
.ticket-history-operational { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 12px 14px; padding: 13px 15px 14px; background: #fbfdfe; border-top: 1px solid #e1ebef; }
.ticket-history-opening { grid-column: 1 / -1; }
.ticket-history-sla { display: grid; justify-items: end; gap: 4px; }
.ticket-history-sla strong { font-size: .78rem; }
.ticket-history-lifecycle { grid-column: 1; padding-top: 10px; border-top: 1px solid #e1ebef; }
.ticket-history-operational .ticket-history-sla { grid-column: 2; align-self: stretch; padding-top: 10px; border-top: 1px solid #e1ebef; }
.ticket-history-state-value { display: flex; align-items: center; gap: 7px; }
.ticket-history-state-icon { width: 18px; height: 18px; flex: 0 0 18px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.ticket-history-lifecycle[data-state="new"] .ticket-history-state-value,
.ticket-history-lifecycle[data-state="progress"] .ticket-history-state-value { color: #146b40; }
.ticket-history-lifecycle[data-state="planned"] .ticket-history-state-value { color: #6742a2; }
.ticket-history-lifecycle[data-state="pending"] .ticket-history-state-value { color: #8a5b00; }
.ticket-history-lifecycle[data-state="solved"] .ticket-history-state-value { color: #a94e0a; }
.ticket-history-lifecycle[data-state="closed"] .ticket-history-state-value { color: #20282e; }
.section-footer { min-height: 70px; padding: 14px 18px; display: flex; align-items: center; justify-content: space-between; gap: 16px; background: #fafcfd; border-top: 1px solid #e1ebef; }
.section-footer-toggle { flex: 0 0 42px; color: #fff; background: var(--blue-dark); border-color: var(--blue-dark); box-shadow: 0 5px 13px rgba(7,95,134,.18); }
.section-footer-toggle:hover:not(:disabled) { color: #fff; background: #075475; border-color: #075475; }
.section-footer-toggle:focus-visible { outline-color: rgba(7,95,134,.32); }
.pagination { padding: 0; display: flex; align-items: center; justify-content: flex-end; gap: 14px; background: transparent; }
.pagination span { color: var(--muted); font-size: .74rem; }

.report-dialog { width: min(760px, calc(100% - 28px)); max-height: calc(100dvh - 32px); overflow: hidden; padding: 0; color: var(--ink); background: white; border: 0; border-radius: 18px; box-shadow: 0 28px 80px rgba(7,45,65,.3); }
.report-dialog::backdrop { background: rgba(5,31,45,.65); backdrop-filter: blur(3px); }
.report-dialog form { display: flex; max-height: calc(100dvh - 32px); flex-direction: column; padding: 0; }
.report-dialog-heading { flex: 0 0 auto; padding: 24px 26px 18px; border-bottom: 1px solid var(--line); }
.report-dialog-heading h2 { margin: 6px 0 5px; color: var(--navy); font-size: 1.45rem; }
.report-dialog-heading p { margin: 0; color: var(--muted); font-size: .8rem; line-height: 1.45; }
.report-dialog-body { min-height: 0; overflow-y: auto; padding: 20px 26px; }
.report-dialog-body > .alert { margin-bottom: 16px; }
.report-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; margin: 0; }
.report-options legend { grid-column: 1 / -1; margin-bottom: 2px; }
.report-option { display: flex; min-height: 88px; align-items: flex-start; gap: 11px; padding: 14px; color: var(--ink); background: #fbfdfe; border: 1px solid var(--line); border-radius: 13px; cursor: pointer; transition: border-color .15s, background .15s, box-shadow .15s; }
.report-option:hover { background: #f3fbfe; border-color: #9dcfdf; }
.report-option:has(input:checked) { background: var(--blue-soft); border-color: #69b9d3; box-shadow: 0 0 0 3px rgba(19,132,180,.08); }
.report-option:has(input:disabled) { opacity: .52; cursor: not-allowed; }
.report-option-complete { grid-column: 1 / -1; min-height: 76px; border-style: dashed; }
.report-option input { width: 18px; min-height: 18px; margin: 2px 0 0; padding: 0; accent-color: var(--blue); flex: 0 0 auto; }
.report-option span { display: grid; gap: 2px; }
.report-option strong { color: var(--navy-2); font-size: .84rem; }
.report-option small { color: var(--muted); font-size: .73rem; line-height: 1.4; }
.report-password-field { margin-top: 18px; }
.report-password-field[hidden] { display: none; }
.report-dialog-actions { display: flex; flex: 0 0 auto; align-items: center; justify-content: space-between; gap: 18px; padding: 16px 26px; background: #fbfdfe; border-top: 1px solid var(--line); }
.report-selection-count { color: var(--muted); font-size: .74rem; font-weight: 750; }
.report-dialog-buttons { display: flex; justify-content: flex-end; gap: 10px; }

@media (max-width: 960px) {
  .public-shell { grid-template-columns: 1fr; gap: 20px; margin-top: 25px; }
  .intro-panel { position: static; padding: 30px; }
  .steps { grid-template-columns: repeat(3, 1fr); }
  .steps li { align-items: flex-start; }
  .steps li > span { flex: 0 0 auto; }
  .privacy-note { max-width: none; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .filter-bar { grid-template-columns: repeat(2, 1fr); }
  .entity-filter-field { grid-column: 1 / -1; }
  .origin-summary { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .public-page { background-attachment: scroll; }
  .site-header, .admin-header { min-height: 68px; padding: 9px 14px; }
  .brand { min-width: 0; gap: 10px; }
  .brand img { width: 46px; height: 46px; flex: 0 0 auto; }
  .brand-copy { min-width: 0; }
  .brand-copy strong { font-size: .95rem; white-space: nowrap; }
  .service-status, .brand-copy small { display: none; }
  .public-shell, .dashboard-shell { width: calc(100% - 24px); max-width: 1180px; }
  .public-shell { gap: 14px; margin-top: 16px; margin-bottom: 34px; }
  .intro-panel { padding: 22px 20px; border-radius: 18px; }
  .intro-panel h1 { margin: 7px 0 9px; font-size: clamp(1.75rem, 9vw, 2rem); }
  .intro-panel > p { font-size: .9rem; line-height: 1.5; }
  .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 20px 0; }
  .steps li { min-width: 0; flex-direction: column; align-items: flex-start; gap: 7px; }
  .steps li > span { width: 32px; height: 32px; border-radius: 10px; font-size: .82rem; }
  .steps div { min-width: 0; }
  .steps strong { font-size: .72rem; line-height: 1.25; }
  .steps small { display: none; }
  .privacy-note { padding: 13px 14px; border-radius: 12px; }
  .privacy-note strong { font-size: .8rem; }
  .privacy-note p { margin-top: 3px; font-size: .75rem; line-height: 1.4; }
  .form-card { padding: 25px 18px; border-radius: 18px; }
  .two-columns, .metric-grid, .filter-bar { grid-template-columns: 1fr; }
  .ticket-history-record-heading { flex-direction: column; }
  .ticket-history-badges { justify-content: flex-start; }
  .footer-content { flex-direction: column; justify-content: center; text-align: center; gap: 13px; }
  .login-card { padding: 32px 22px; }
  .admin-brand .brand-copy { display: none; }
  .header-actions .button { padding: 9px 11px; font-size: .74rem; }
  .dashboard-title { align-items: flex-start; flex-direction: column; }
  .queue-actions { justify-content: flex-start; }
  .table-heading { align-items: flex-start; flex-direction: column; gap: 8px; }
  .table-heading-actions { width: 100%; justify-content: flex-end; }
  .table-heading-actions .button:not(.section-toggle):not(.refresh-button) { flex: 1 1 auto; }
  .table-heading-actions .refresh-button { width: 42px; flex: 0 0 42px; }
  .table-heading-actions .section-toggle { width: 42px; flex: 0 0 42px; }
  .section-meta { margin-right: auto; }
  .ticket-history-list { grid-template-columns: 1fr; padding: 12px; }
  .section-footer { padding: 12px; }
  .pagination { justify-content: flex-end; gap: 8px; }
  .pagination .button { padding-left: 10px; padding-right: 10px; }
  .filter-bar .button { width: 100%; }
  .period-panel { right: auto; left: 0; width: 100%; }
  .table-wrap { -webkit-overflow-scrolling: touch; }
  .consent-row { padding: 12px; font-size: .8rem; }
  .report-dialog { max-height: calc(100dvh - 20px); }
  .report-dialog form { max-height: calc(100dvh - 20px); }
  .report-dialog-heading { padding: 20px 18px 15px; }
  .report-dialog-body { padding: 16px 18px; }
  .report-options { grid-template-columns: 1fr; }
  .report-option-complete { grid-column: auto; }
  .report-dialog-actions { padding: 14px 18px; }
  .report-dialog-actions { align-items: stretch; flex-direction: column; gap: 10px; }
  .report-dialog-buttons { width: 100%; }
  .report-dialog-buttons .button { flex: 1; padding-left: 10px; padding-right: 10px; }
}

@media (max-width: 420px) {
  .site-header, .admin-header { gap: 10px; }
  .brand img { width: 42px; height: 42px; }
  .brand-copy strong { font-size: .9rem; }
  .header-actions { gap: 6px; }
  .header-actions .button { min-height: 38px; padding: 8px 9px; }
  .login-shell { padding: 14px; }
  .login-card { padding: 28px 18px; border-radius: 18px; }
  .dashboard-shell { margin-top: 24px; }
  .metric-card { min-height: 122px; }
  .result-dialog { padding: 30px 20px; }
  .public-shell, .dashboard-shell { width: calc(100% - 20px); }
  .intro-panel { padding: 20px 17px; }
  .steps { gap: 6px; }
  .steps strong { font-size: .68rem; }
  .site-footer { padding-top: 18px; padding-bottom: 18px; }
}

@media print {
  @page { margin: 12mm; }
  html, body, body[data-print-scopes] { max-width: 100%; overflow: visible !important; }
  .admin-header, .filter-bar, .header-actions, .section-footer, .queue-actions, .table-heading-actions, .origin-summary { display: none !important; }
  .context-badge-portal, .context-badge-internal { display: none !important; }
  .notification-record[data-origin="glpi-internal"] { display: none !important; }
  .dashboard-title { display: none !important; }
  .section-toggle { display: none !important; }
  .section-content[hidden] { display: block !important; }
  .table-card.is-collapsed .table-heading { border-bottom-color: var(--line); }
  .admin-page, .dashboard-shell { background: white; }
  .dashboard-shell { width: 100%; margin: 0; }
  .metric-card { break-inside: avoid; box-shadow: none; }
  .table-card { overflow: visible; break-inside: auto; box-shadow: none; }
  .table-wrap { width: 100%; max-width: 100%; overflow: visible !important; }
  .table-heading { break-after: avoid; }
  thead { display: table-header-group; }
  tr { break-inside: avoid; break-after: auto; }
  .ticket-history-list { display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 0; background: transparent; }
  .ticket-history-record { break-inside: avoid; }
  .ticket-history-record-heading { padding: 9px 10px; }
  .ticket-history-company { padding: 9px 10px; }
  .ticket-history-operational { padding: 8px 10px 9px; }
  body[data-print-scopes] .print-report-context { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin: 0 0 20px; padding: 0 0 13px; color: #496575; border-bottom: 2px solid #9cc9d9; font-size: .75rem; }
  body[data-print-scopes] .print-report-identification { display: grid; gap: 5px; }
  body[data-print-scopes] .print-report-context strong { color: var(--navy); font-size: 1.18rem; line-height: 1.2; }
  body[data-print-scopes] #print-report-scope { color: #3f5c6c; font-size: .8rem; font-weight: 650; }
  body[data-print-scopes] #print-report-generated { white-space: nowrap; }
  .notification-history-list { display: grid !important; gap: 8px; padding: 0; background: transparent; }
  .notification-record { break-inside: avoid; box-shadow: none; }
  .notification-record-header { padding: 10px 12px; }
  .notification-record-stages { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .notification-stage { padding: 10px 12px; }
  .notification-acknowledge { display: none !important; }
  body[data-print-scopes] .metric-grid,
  body[data-print-scopes] #ticket-history-card,
  body[data-print-scopes] #notification-history-card,
  body[data-print-scopes] #closures-card { display: none !important; }
  body[data-print-scopes].print-include-overview .metric-grid { display: grid !important; }
  body[data-print-scopes].print-include-tickets #ticket-history-card,
  body[data-print-scopes].print-include-notifications #notification-history-card,
  body[data-print-scopes].print-include-closures #closures-card { display: block !important; }
}
