/* Painel do piloto — Cubana UI */
body.cv-app { background: var(--cv-bg); color: var(--cv-text); font-family: var(--cv-font); -webkit-font-smoothing: antialiased; }
.cv-p, .cv-p-gate { max-width: var(--cv-wrap); margin: 0 auto; padding: 48px 24px 96px; box-sizing: border-box; color: var(--cv-text); font-family: var(--cv-font); }
.cv-p *, .cv-p *::before, .cv-p *::after { box-sizing: border-box; }
.cv-p { display: flex; flex-direction: column; gap: 20px; }

/* Estados sem painel (sem login, sem perfil, em revisão) */
.cv-p-gate { text-align: center; padding-top: 120px; min-height: 60vh; }
.cv-p-gate h1 { margin: 0 0 12px; font-family: var(--cv-display); font-weight: 600; font-size: 32px; letter-spacing: -0.02em; color: var(--cv-text); }
.cv-p-gate p { margin: 0 auto 28px; max-width: 520px; font-size: 16px; line-height: 1.6; color: var(--cv-muted); }
.cv-p-gate__btns { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }

/* Botões */
.cv-p-btn { appearance: none; display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 0 18px; border-radius: 999px; border: 1px solid transparent; font: 600 14px var(--cv-font); cursor: pointer; text-decoration: none; white-space: nowrap; transition: background .2s, border-color .2s, color .2s; }
.cv-p-btn--primary { background: var(--cv-red); color: #fff !important; }
.cv-p-btn--primary:hover { background: var(--cv-red-hover); }
.cv-p-btn--ghost { background: transparent; border-color: var(--cv-border-2); color: var(--cv-text) !important; }
.cv-p-btn--ghost:hover { border-color: rgba(255,255,255,.35); background: rgba(255,255,255,.04); }
.cv-p-btn--quiet { background: transparent; color: var(--cv-subtle) !important; }
.cv-p-btn--quiet:hover { color: #fff !important; }
.cv-p-btn:disabled { opacity: .6; cursor: progress; }
.cv-p-btn:focus-visible, .cv-p-link:focus-visible, .cv-p-liv:focus-visible, .cv-p-chart__col:focus-visible { outline: 2px solid #7E9BFF; outline-offset: 2px; }
.cv-p-link { appearance: none; border: 0; background: none; padding: 0; color: var(--cv-blue-text); font: 500 13px var(--cv-font); cursor: pointer; }
.cv-p-link:hover { text-decoration: underline; }

/* Cabeçalho do piloto */
.cv-p-hero { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px; padding: 28px; border-radius: 22px; background: radial-gradient(600px 260px at 85% 0%, rgba(38,69,150,.45), transparent 70%), rgba(255,255,255,.025); border: 1px solid var(--cv-border); }
.cv-p-hero__who { display: flex; align-items: center; gap: 20px; min-width: 0; }
.cv-p-avatar { width: 84px; height: 84px; flex: none; border-radius: 999px; overflow: hidden; background: rgba(38,69,150,.55); color: #DCE3FF; display: inline-flex; align-items: center; justify-content: center; font: 600 30px var(--cv-display); border: 2px solid rgba(255,255,255,.12); }
.cv-p-avatar img { width: 100%; height: 100%; object-fit: cover; }
.cv-p-avatar--md { width: 64px; height: 64px; font-size: 24px; }
.cv-p-eyebrow { margin: 0; font-size: 13px; font-weight: 500; color: var(--cv-subtle); }
.cv-p-title { margin: 4px 0 10px; font-family: var(--cv-display); font-weight: 600; font-size: clamp(24px, 3vw, 32px); letter-spacing: -0.02em; line-height: 1.15; color: var(--cv-text); }
.cv-p-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.cv-p-tag { display: inline-flex; align-items: center; gap: 6px; min-height: 28px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--cv-border-2); font-size: 13px; font-weight: 600; color: var(--cv-text); }
.cv-p-tag img { width: 22px; height: 22px; object-fit: contain; margin-left: -6px; }
.cv-p-tag--call { background: #fff; color: #11131A; border-color: #fff; letter-spacing: .03em; }
.cv-p-tag--blue { border-color: rgba(126,155,255,.35); color: var(--cv-blue-text); background: rgba(38,69,150,.18); }
.cv-p-hero__actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* Números */
.cv-p-stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.cv-p-stat { padding: 18px 20px; border-radius: 16px; border: 1px solid var(--cv-border); background: var(--cv-card); display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.cv-p-stat span { font-size: 13px; color: var(--cv-subtle); }
.cv-p-stat strong { font-family: var(--cv-display); font-weight: 600; font-size: 30px; letter-spacing: -0.02em; line-height: 1.1; font-variant-numeric: tabular-nums; color: var(--cv-text); }
.cv-p-stat__sm { font-size: 20px !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cv-p-stat em { font-style: normal; font-size: 12px; color: var(--cv-subtle); }

/* Cards */
.cv-p-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 20px; }
.cv-p-grid--wide { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); align-items: start; }
.cv-p-stack { display: flex; flex-direction: column; gap: 20px; }
.cv-p-card { padding: 24px; border-radius: 18px; border: 1px solid var(--cv-border); background: var(--cv-card); min-width: 0; }
.cv-p-card--flush { padding: 24px 0 8px; }
.cv-p-card--flush .cv-p-card__head { padding: 0 24px; }
.cv-p-card__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.cv-p-h2 { margin: 0; font-family: var(--cv-display); font-weight: 600; font-size: 18px; letter-spacing: -0.01em; color: var(--cv-text); }
.cv-p-sub { margin: 4px 0 0; }
.cv-p-muted { color: var(--cv-subtle); font-size: 14px; }
.cv-p-note { margin: 14px 0 0; font-size: 12px; color: var(--cv-subtle); }
.cv-p-empty { padding: 24px; color: var(--cv-muted); font-size: 14px; line-height: 1.6; margin: 0; }

/* Carreira */
.cv-p-career { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 16px 0 18px; }
.cv-p-career__now span { display: block; font-size: 13px; color: var(--cv-subtle); }
.cv-p-career__now strong { display: block; margin-top: 2px; font-family: var(--cv-display); font-weight: 600; font-size: 24px; letter-spacing: -0.01em; }
.cv-p-career__now em { display: block; margin-top: 4px; font-style: normal; font-size: 13px; color: var(--cv-muted); }
.cv-p-career__badge { width: 72px; height: 72px; object-fit: contain; }
.cv-p-progress { height: 10px; border-radius: 999px; background: rgba(255,255,255,.06); overflow: hidden; margin-bottom: 10px; }
.cv-p-progress span { display: block; height: 100%; border-radius: 999px; background: #5B7FE8; }
.cv-p-career + .cv-p-progress + .cv-p-muted, .cv-p-progress + .cv-p-muted { margin: 0; }

/* Gráfico de barras (uma série: horas por mês) */
.cv-p-chart { position: relative; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 2px; align-items: end; height: 200px; margin-top: 18px; padding-bottom: 24px;
  background: repeating-linear-gradient(to top, rgba(255,255,255,.05) 0, rgba(255,255,255,.05) 1px, transparent 1px, transparent 25%) 0 0 / 100% calc(100% - 24px) no-repeat; }
.cv-p-chart__col { position: relative; height: 100%; display: flex; align-items: flex-end; justify-content: center; cursor: default; outline: none; }
.cv-p-chart__bar { width: min(24px, 70%); min-height: 0; border-radius: 4px 4px 0 0; background: #5B7FE8; transition: background .15s; }
.cv-p-chart__col.is-on .cv-p-chart__bar { background: #7E9BFF; }
.cv-p-chart__x { position: absolute; bottom: -22px; font-size: 11px; color: var(--cv-subtle); }
.cv-p-chart__tip { position: absolute; top: -8px; transform: translate(-50%, -100%); padding: 6px 10px; border-radius: 8px; background: #fff; color: #11131A; font-size: 12px; font-weight: 600; white-space: nowrap; pointer-events: none; box-shadow: 0 8px 20px rgba(0,0,0,.35); }

/* Tabela de voos */
.cv-p-table-wrap { overflow-x: auto; }
.cv-p-table { width: 100%; min-width: 560px; border-collapse: collapse; font-size: 14px; color: var(--cv-text); margin: 0; }
.cv-p-table th, .cv-p-table td { border: 0 !important; background: transparent !important; text-align: left; padding: 11px 12px; vertical-align: middle; }
.cv-p-table th { font-size: 12px; font-weight: 500; color: var(--cv-subtle); border-bottom: 1px solid var(--cv-border) !important; }
.cv-p-table td { border-top: 1px solid rgba(255,255,255,.04) !important; }
.cv-p-table th:first-child, .cv-p-table td:first-child { padding-left: 24px; }
.cv-p-table th:last-child, .cv-p-table td:last-child { padding-right: 24px; }
.cv-p-num { font-variant-numeric: tabular-nums; color: var(--cv-muted); white-space: nowrap; }

/* Favoritos e dados */
.cv-p-favs { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 14px; }
.cv-p-favs h3 { margin: 0 0 8px; font-size: 12px; font-weight: 500; color: var(--cv-subtle); }
.cv-p-favs ol { list-style: none; margin: 0; padding: 0; }
.cv-p-favs li { display: flex; justify-content: space-between; gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--cv-border); font-size: 14px; font-weight: 500; }
.cv-p-favs li em { font-style: normal; color: var(--cv-subtle); font-variant-numeric: tabular-nums; }
.cv-p-defs { margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.cv-p-defs > div { padding: 9px 0; border-bottom: 1px solid var(--cv-border); min-width: 0; }
.cv-p-defs dt { font-size: 12px; color: var(--cv-subtle); }
.cv-p-defs dd { margin: 2px 0 0; font-size: 14px; font-weight: 500; overflow-wrap: anywhere; }

/* Lembrete de voo */
.cv-p-remind { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding: 22px 24px; border-radius: 18px; border: 1px solid rgba(255,124,132,.22); background: linear-gradient(160deg, rgba(224,49,60,.14), rgba(224,49,60,.03)); }
.cv-p-remind p { margin: 6px 0 0; font-size: 14px; color: var(--cv-muted); max-width: 560px; line-height: 1.6; }
.cv-p-remind code { padding: 2px 6px; border-radius: 6px; background: rgba(255,255,255,.08); color: #fff; font-size: 13px; }
.cv-p-remind__links { display: flex; flex-wrap: wrap; gap: 8px; }

/* Texturas */
.cv-p-liveries { padding: 24px; border-radius: 18px; border: 1px solid var(--cv-border); background: var(--cv-card); }
.cv-p-search input { width: 300px; max-width: 100%; min-height: 40px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--cv-border-2); background: rgba(255,255,255,.03); color: var(--cv-text); font: 400 14px var(--cv-font); }
.cv-p-search input:focus { outline: none; border-color: rgba(126,155,255,.6); }
.cv-p-livgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin-top: 6px; }
.cv-p-liv { display: flex; flex-direction: column; border-radius: 14px; overflow: hidden; border: 1px solid var(--cv-border); background: rgba(255,255,255,.02); text-decoration: none; color: var(--cv-text) !important; transition: border-color .2s, transform .2s; }
.cv-p-liv[hidden] { display: none; }
.cv-p-liv:hover { border-color: var(--cv-border-2); transform: translateY(-2px); }
.cv-p-liv__img { aspect-ratio: 16 / 9; background: rgba(255,255,255,.04); }
.cv-p-liv__img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cv-p-liv__body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 2px; }
.cv-p-liv__body strong { font-size: 13px; font-weight: 600; line-height: 1.35; }
.cv-p-liv__body em { font-style: normal; font-size: 12px; color: var(--cv-blue-text); }

/* Modais */
.cv-p-dialog { width: min(560px, calc(100vw - 32px)); padding: 0; border: 1px solid var(--cv-border-2); border-radius: 20px; background: #10131C; color: var(--cv-text); box-shadow: 0 40px 80px rgba(0,0,0,.6); }
.cv-p-dialog::backdrop { background: rgba(4,6,12,.7); backdrop-filter: blur(4px); }
.cv-p-dialog__inner { padding: 24px; display: flex; flex-direction: column; gap: 16px; margin: 0; }
.cv-p-dialog h2 { margin: 0; font-family: var(--cv-display); font-weight: 600; font-size: 20px; color: var(--cv-text); }
.cv-p-photo { display: flex; align-items: center; gap: 14px; }
.cv-p-file { position: relative; overflow: hidden; }
.cv-p-file input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.cv-p-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.cv-p-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.cv-p-field label { font-size: 13px; font-weight: 500; color: var(--cv-muted); }
.cv-p-field input, .cv-p-field select { width: 100%; min-height: 44px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--cv-border-2); background: rgba(255,255,255,.04); color: var(--cv-text); font: 400 15px var(--cv-font); }
.cv-p-field select option { background: #10131C; color: #fff; }
.cv-p-field input:focus, .cv-p-field select:focus { outline: none; border-color: rgba(126,155,255,.6); }
.cv-p-field small { font-size: 12px; color: var(--cv-subtle); }
.cv-p-field small.is-ok { color: #3DDC97; } .cv-p-field small.is-bad { color: var(--cv-red-text); }
.cv-p .is-invalid { border-color: rgba(255,124,132,.8) !important; }
.cv-p-hint { margin: 0; font-size: 12px; color: var(--cv-subtle); }
.cv-p-error { margin: 0; color: var(--cv-red-text); font-size: 13px; }
.cv-p-error:empty { display: none; }
.cv-p-dialog__foot { display: flex; justify-content: flex-end; gap: 8px; padding-top: 16px; border-top: 1px solid var(--cv-border); }

@media (max-width: 1100px) {
  .cv-p-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cv-p-grid, .cv-p-grid--wide { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .cv-p { padding: 28px 16px 72px; gap: 16px; }
  .cv-p-hero { padding: 20px; }
  .cv-p-hero__who { flex-direction: column; align-items: flex-start; }
  .cv-p-avatar { width: 68px; height: 68px; font-size: 24px; }
  .cv-p-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cv-p-stat strong { font-size: 24px; }
  .cv-p-card, .cv-p-liveries { padding: 18px; }
  .cv-p-card--flush { padding: 18px 0 6px; }
  .cv-p-card--flush .cv-p-card__head { padding: 0 18px; }
  .cv-p-table th:first-child, .cv-p-table td:first-child { padding-left: 18px; }
  .cv-p-fields, .cv-p-defs, .cv-p-favs { grid-template-columns: 1fr; }
  .cv-p-search input { width: 100%; }
  .cv-p-livgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Rótulo só na barra mais alta (o resto fica no tooltip) */
.cv-p-chart__bar { position: relative; }
.cv-p-chart__peak { position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); font-size: 11px; font-weight: 600; color: var(--cv-muted); white-space: nowrap; }
/* Textura sem foto: cauda da Cubana como reserva */
.cv-p-liv__img.is-empty { background: rgba(255,255,255,.03) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 78'%3E%3Cpolygon fill='%23DB202C' fill-opacity='.55' points='0 3.46 18.14 77.52 61.08 77.52 0 3.46'/%3E%3Cpolygon fill='%233D63D6' fill-opacity='.55' points='5.88 3.46 24.18 25.88 56.6 25.88 38.46 3.46'/%3E%3Cpolygon fill='%233D63D6' fill-opacity='.55' points='27.54 29.28 45.85 51.7 78.26 51.7 60.12 29.28'/%3E%3Cpolygon fill='%233D63D6' fill-opacity='.55' points='49.21 55.03 67.51 77.45 99.93 77.45 81.79 55.03'/%3E%3C/svg%3E") center / 34% no-repeat; }
.cv-p-chart { margin-top: 34px; }

/* Perfil público */
.cv-p-back { align-self: flex-start; font-size: 14px; font-weight: 500; color: var(--cv-subtle) !important; text-decoration: none; }
.cv-p-back:hover { color: #fff !important; }
.cv-p-avatar--lg { width: 112px; height: 112px; font-size: 40px; }
.cv-p-hero__badge { width: 96px; height: 96px; object-fit: contain; opacity: .95; }
.cv-p-tag--plain { font-weight: 500; color: var(--cv-muted); }
.cv-p-tag .cv-flag { margin-right: 0; }
.cv-p-defs--top { margin-top: 14px; }
.cv-p-defs dd a { color: var(--cv-blue-text); text-decoration: none; }
.cv-p-defs dd a:hover { text-decoration: underline; }
.cv-p-awards { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 16px; }
.cv-p-award { margin: 0; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--cv-border); background: rgba(255,255,255,.02); display: flex; align-items: center; gap: 12px; }
.cv-p-award img { height: 34px; width: auto; display: block; border-radius: 3px; }
.cv-p-award figcaption { font-size: 14px; font-weight: 600; }
@media (max-width: 640px) {
  .cv-p-avatar--lg { width: 84px; height: 84px; font-size: 30px; }
  .cv-p-hero__badge { display: none; }
}
.cv-p .cv-p-award figcaption { font-style: normal !important; color: var(--cv-text) !important; font-size: 14px !important; font-weight: 600; margin: 0 !important; text-align: left; }

/* Insígnias originais têm 29x16 px: mostrar perto do tamanho real, sem ampliar */
.cv-p-tag img { width: auto !important; height: 16px !important; max-width: 32px; margin-left: -4px; image-rendering: auto; }
