/* Componentes reutilizados entre abas. */

/* Metric card (4 no topo de Logbook/Esquadrão) */
.metric-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 14px 15px;
}

.metric-card__value {
  font-family: "Barlow Condensed", Arial, sans-serif;
  font-size: 34px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.1;
}

.metric-card__hint {
  font-size: 12px;
  color: var(--text-2);
}

.metric-card__hint--up {
  color: var(--green);
}

/* Card genérico (Condecorações, Campanha/Dogfight, Destruição acumulada, etc.) */
.info-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 16px 18px;
}

/* Fitas de condecoração */
.ribbon-row {
  display: grid;
  grid-template-columns: 1fr 30px 56px;
  align-items: center;
  gap: 10px;
}

.ribbon-row + .ribbon-row {
  margin-top: 10px;
}

.ribbon-row__name {
  font-size: 13px;
  color: #4a443f;
}

.ribbon-row__count {
  font-family: "Barlow Condensed", Arial, sans-serif;
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  text-align: right;
}

.ribbon-bar {
  height: 15px;
  border: 1px solid #b9bec4;
}

/* Campanha/Dogfight - 2 colunas de pares label/valor */
.stat-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-top: 14px;
}

.stat-col {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
}

.stat-row__value {
  color: var(--text);
  font-weight: 600;
}

.stat-row__value--alert {
  color: var(--alert);
}

.kill-ratio {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.kill-ratio__value {
  font-family: "Barlow Condensed", Arial, sans-serif;
  font-size: 30px;
  font-weight: 700;
  color: var(--wine);
  line-height: 1;
}

/* Sparklines */
.sparkline-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 14px 16px 8px;
}

.sparkline-card__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.sparkline-card__value {
  font-family: "Barlow Condensed", Arial, sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
}

.sparkline-card svg {
  width: 100%;
  height: 78px;
  display: block;
  margin-top: 6px;
}

/* Pilotos */
.pilots-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 8px;
}

.pilots-list-label {
  padding: 0 14px 8px;
}

.pilot-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pilot-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}

.pilot-row--top {
  border-left-color: var(--wine);
}

.pilot-row--near {
  border-left-color: #cbb7b4;
}

.pilot-row__rank {
  font-family: "Barlow Condensed", Arial, sans-serif;
  font-size: 17px;
  font-weight: 700;
  color: #c0b5af;
}

.pilot-row__rank--top {
  color: var(--wine);
}

.pilot-row__rank--near {
  color: #a3928c;
}

.pilot-row__name {
  flex: 1 1 130px;
  font-family: "Barlow Semi Condensed", Arial, sans-serif;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

.pilot-row__bar-wrap {
  flex: 1 1 160px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.pilot-row__bar-track {
  flex: 1;
  height: 6px;
  background: var(--bar-track);
  border-radius: 3px;
  overflow: hidden;
}

.pilot-row__bar-fill {
  height: 6px;
  background: var(--wine);
}

.pilot-row__bar-fill--low {
  background: #a8686c;
}

.pilot-row__hours {
  font-family: "Barlow Condensed", Arial, sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  width: 34px;
  text-align: right;
}

.pilot-row__score {
  flex: 0 0 auto;
  min-width: 60px;
  font-family: "Barlow Condensed", Arial, sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  text-align: right;
}

.pilot-row__updated {
  flex: 0 0 auto;
  min-width: 104px;
  font-size: 12px;
  text-align: right;
  color: #a09690;
}

.pilot-row__updated--recent {
  color: var(--green);
}

/* Esquadrão - médias por missão + contribuição por piloto */
.avg-row {
  display: grid;
  grid-template-columns: 88px 1fr 40px;
  gap: 10px;
  align-items: center;
}

.avg-row + .avg-row {
  margin-top: 11px;
}

.avg-row__label {
  font-size: 13px;
  color: var(--text-2);
}

.avg-row__track {
  height: 6px;
  background: var(--bar-track);
  border-radius: 3px;
}

.avg-row__fill {
  height: 6px;
  background: var(--wine);
  border-radius: 3px;
}

.avg-row__fill--low {
  background: #a8686c;
}

.avg-row__value {
  font-family: "Barlow Condensed", Arial, sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  text-align: right;
}

.contrib-chart {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  height: 150px;
  margin-top: 18px;
  padding: 0 4px;
}

.contrib-bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.contrib-bar-col__value {
  font-family: "Barlow Condensed", Arial, sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.contrib-bar-col__bar {
  width: 100%;
  background: linear-gradient(180deg, var(--wine), var(--wine-dark));
  border-radius: 3px 3px 0 0;
}

.contrib-bar-col__bar--low {
  background: linear-gradient(180deg, #a8686c, #8d4a4e);
}

.contrib-bar-col__label {
  font-family: "Barlow Semi Condensed", Arial, sans-serif;
  font-size: 12px;
  color: var(--text-2);
}

/* Assinatura */
.sig-layout {
  display: flex;
  flex-wrap: wrap;
  gap: 26px;
  align-items: flex-start;
}

.sig-main {
  flex: 1 1 560px;
  min-width: 0;
}

.sig-preview-wrap {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-3);
  padding: 20px;
  display: flex;
  justify-content: center;
  overflow-x: auto;
}

.sig-preview {
  flex: 0 0 550px;
  width: 550px;
  min-width: 550px;
  height: 150px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .35);
  background: #0b0b0d;
}

.sig-preview img {
  display: block;
  width: 550px;
  height: 150px;
}

.sig-preview-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #6f6b64;
  font-size: 13px;
  font-family: "Barlow Semi Condensed", Arial, sans-serif;
}

.fundo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.fundo-card {
  border: 2px solid var(--border);
  border-radius: 5px;
  overflow: hidden;
  cursor: pointer;
  background: var(--surface);
  display: block;
}

.fundo-card:hover {
  color: inherit;
}

.fundo-card--active {
  border-color: var(--wine);
  box-shadow: 0 0 0 3px rgba(123, 15, 20, .12);
}

.fundo-card__thumb {
  aspect-ratio: 550 / 150;
  background-color: #15161a;
  background-size: cover;
  background-position: center;
}

.fundo-card__foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 8px;
  background: var(--surface);
  font-family: "Barlow Semi Condensed", Arial, sans-serif;
  font-size: 12px;
  color: #4a443f;
}

.fundo-card__tag {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: 2px 5px;
  border-radius: 2px;
}

.fundo-card__tag--new {
  background: #eef6f1;
  color: var(--green);
}

.fundo-card__tag--original {
  background: #f2ece9;
  color: #a09690;
}

.fundo-card input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.sig-panel {
  flex: 1 1 280px;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 18px;
}

.form-field {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--border-2);
  border-radius: var(--radius-sm);
  font-family: Barlow, Arial, sans-serif;
  font-size: 13px;
  color: var(--text);
  background: var(--surface-2);
}

.btn-primary {
  display: block;
  width: 100%;
  background: var(--wine);
  color: #fff;
  text-align: center;
  padding: 11px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: "Barlow Semi Condensed", Arial, sans-serif;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  cursor: pointer;
}

.btn-primary:hover {
  background: var(--wine-dark);
}

.code-box {
  border: 1px solid var(--border-2);
  border-radius: var(--radius-sm);
  background: var(--surface-3);
  padding: 9px 11px;
  font-family: "Courier New", monospace;
  font-size: 11px;
  color: #4a443f;
  word-break: break-all;
  line-height: 1.5;
  min-height: 44px;
  white-space: pre-wrap;
}

/* Atualizar - dropzone */
.dropzone {
  border: 2px dashed #d6ccc6;
  border-radius: 8px;
  background: #fbf8f7;
  padding: 34px;
  text-align: center;
}

.dropzone__icon {
  width: 44px;
  height: 44px;
  margin: 0 auto 14px;
  border: 2px solid var(--wine);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: var(--wine);
  font-weight: 600;
}

.dropzone__title {
  font-family: "Barlow Semi Condensed", Arial, sans-serif;
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
}

.dropzone__hint {
  font-size: 13px;
  color: var(--text-2);
  margin: 4px 0 16px;
}

.dropzone input[type="file"] {
  display: block;
  margin: 0 auto 14px;
  font-family: Barlow, Arial, sans-serif;
  font-size: 13px;
}

.dropzone input[type="submit"] {
  display: inline-block;
  background: var(--wine);
  color: #fff;
  padding: 9px 22px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: "Barlow Semi Condensed", Arial, sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  cursor: pointer;
}

.dropzone input[type="submit"]:hover {
  background: var(--wine-dark);
}

.last-upload-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 14px 16px;
  margin-top: 14px;
  flex-wrap: wrap;
  gap: 10px;
}

.last-upload-card__title {
  font-family: "Barlow Semi Condensed", Arial, sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.last-upload-card__meta {
  font-size: 13px;
  color: var(--text-2);
}

.status-processed {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  color: var(--green);
  font-weight: 600;
}

/* Download */
.download-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 15px 16px;
}

.download-row + .download-row {
  margin-top: 8px;
}

.download-row__title {
  font-family: "Barlow Semi Condensed", Arial, sans-serif;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

.download-row__meta {
  font-size: 13px;
  color: var(--text-2);
}

.download-row__name {
  flex: 1 1 200px;
  min-width: 0;
}

.download-row__size {
  flex: 0 0 auto;
  min-width: 70px;
  font-family: "Barlow Condensed", Arial, sans-serif;
  font-size: 14px;
  color: #a09690;
}

.btn-outline {
  flex: 0 0 120px;
  text-align: center;
  border: 1px solid var(--wine);
  color: var(--wine);
  padding: 8px;
  border-radius: var(--radius-sm);
  font-family: "Barlow Semi Condensed", Arial, sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  cursor: pointer;
  background: var(--surface);
}

.btn-outline:hover {
  background: var(--wine);
  color: #fff;
}

/* Campo readonly do hash do FNTools (era <style> inline em index.php) */
.field-hash {
  width: 220px;
  text-align: center;
  box-sizing: border-box;
  border: 1px solid var(--border-2);
  padding: 7px;
  border-radius: var(--radius-sm);
  font-family: "Courier New", monospace;
  font-size: 12px;
  color: var(--text-2);
  background: var(--surface-2);
}

.hash-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 24px;
  flex-wrap: wrap;
}

.hash-row__label {
  font-size: 12px;
  color: var(--text-3);
}

.btn-small {
  border: 1px solid var(--border-2);
  background: var(--surface);
  color: var(--text-2);
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  font-family: "Barlow Semi Condensed", Arial, sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  cursor: pointer;
}

.btn-small:hover {
  border-color: var(--wine);
  color: var(--wine);
}

.empty-note {
  font-size: 13px;
  color: var(--text-2);
  padding: 20px;
  text-align: center;
}

/* Selo de status (online.php - servidor MP dedicado) */
.badge-status {
  display: inline-block;
  padding: 5px 12px;
  border-radius: 999px;
  font-family: "Barlow Semi Condensed", Arial, sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.badge-status--online {
  background: color-mix(in srgb, var(--green) 16%, transparent);
  color: var(--green);
}

.badge-status--warn {
  background: color-mix(in srgb, var(--gold) 25%, transparent);
  color: #8a6a1f;
}

.badge-status--offline {
  background: color-mix(in srgb, var(--alert) 14%, transparent);
  color: var(--alert);
}

/* Tabela simples (online.php - roster de pilotos) */
.painel-tabela {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.painel-tabela th {
  text-align: left;
  padding: 6px 8px;
  color: var(--text-3);
  font-family: "Barlow Semi Condensed", Arial, sans-serif;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  font-size: 11px;
  border-bottom: 1px solid var(--border);
}

.painel-tabela td {
  padding: 7px 8px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}
