@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600&display=swap');

:root {
  --blue: #041a3d;
  --white: #ffffff;
  --light: #eef3ff;
  --accent: #00bcd4;
  --danger: #ff6b6b;
  --success: #29c48f;
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--light);
  color: #0f172a;
  transition: background 0.2s ease;
}

body.quiz-mode {
  background: #eef2ff;
  overflow: hidden;
}

.tv-layout {
  min-height: 100vh;
  background: var(--blue);
  color: var(--white);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 24px;
  overflow: hidden;
}

.tv-card {
  width: min(98vw, 1800px);
  height: calc(100vh - 32px);
  background: rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  padding: 32px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(4px);
  display: flex;
  flex-direction: column;
}

.tv-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
}

.tv-logo {
  width: 120px;
  height: auto;
}

.tv-title {
  font-size: 42px;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 2px;
  flex: 1;
  text-align: right;
}


.tv-gallery {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: minmax(280px, 1fr);
  gap: 24px;
  flex: 1;
  height: 100%;
}

.tv-gallery .gallery-card {
  border-radius: 24px;
  overflow: hidden;
  position: relative;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.45);
}

.tv-gallery .gallery-card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tv-gallery .gallery-card.placeholder {
  font-size: 24px;
  color: rgba(255, 255, 255, 0.7);
  text-align: center;
}

.tv-gallery .gallery-card--hero {
  background: #ffffff;
  color: #0b1d39;
  text-transform: uppercase;
  letter-spacing: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tv-gallery .hero-card__label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
  font-weight: 600;
}

.tv-gallery .hero-card__label strong {
  font-size: clamp(48px, 5vw, 72px);
}

.tv-gallery .hero-card__label span {
  font-size: clamp(18px, 2vw, 26px);
}

.counter-box {
  margin-top: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.3);
}

.counter-box h2 {
  margin: 0;
  font-size: 32px;
  letter-spacing: 1px;
}

.counter-box span {
  font-size: 24px;
}

.counter-box.single {
  justify-content: space-between;
  font-size: 28px;
}

.tv2-wrapper {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  align-items: stretch;
  flex: 1;
  min-height: 0;
}

.panel {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  height: 100%;
  box-sizing: border-box;
}

.panel h3 {
  margin-top: 0;
  font-size: 32px;
}

.qr-panel {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 24px;
  background: linear-gradient(140deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.05));
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.qr-copy {
  margin-bottom: 0;
}

.qr-title {
  margin: 0;
  font-size: 48px;
  font-weight: 700;
}

.qr-subtitle {
  margin: 0;
  font-size: 20px;
  opacity: 0.9;
}

.qr-wrapper {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
  justify-content: flex-start;
}

.qr-wrapper img {
  width: min(260px, 28vw);
  height: min(260px, 28vw);
  background: var(--white);
  padding: 16px;
  border-radius: 16px;
  border: 3px solid rgba(4, 26, 61, 0.4);
  object-fit: contain;
}

.ranking-panel {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.ranking-card {
  background: #ffffff;
  border-radius: 16px;
  padding: 16px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  color: #0f172a;
  box-shadow: 0 15px 35px rgba(15, 23, 42, 0.15);
}

.ranking-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.ranking-header h4 {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #0f172a;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-flex;
}

.dot-gold {
  background: #ffd166;
}

.dot-blue {
  background: #4c83ff;
}

.ranking-table th,
.ranking-table td {
  color: #0f172a;
}

.crown-cell {
  width: 60px;
}

.crown {
  display: inline-flex;
  width: 28px;
  height: 28px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 16px;
  font-weight: 600;
  color: #fff;
}

.crown.gold {
  background: linear-gradient(135deg, #f7b733, #fce38a);
  color: #7a4c00;
}

.crown.silver {
  background: linear-gradient(135deg, #d7d2cc, #f5f7fa);
  color: #4b5563;
}

.crown.bronze {
  background: linear-gradient(135deg, #b46e3c, #e0a070);
  color: #5c2b10;
}

.ranking-table {
  width: 100%;
  border-collapse: collapse;
}

.ranking-table th,
.ranking-table td {
  padding: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.ranking-table th {
  text-align: left;
  font-size: 20px;
}

.ranking-table td {
  font-size: 18px;
}

.page-wrapper {
  min-height: 100vh;
  padding: 32px 24px 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.admin-layout {
  display: flex;
  gap: 24px;
  width: min(1280px, 100%);
}

.admin-sidebar {
  width: 240px;
  background: #eff4ff;
  border-radius: 24px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: inset 0 0 0 1px #dfe7ff;
}

.sidebar-logo {
  width: 120px;
  margin-bottom: 12px;
}

.sidebar-link {
  border: none;
  border-radius: 16px;
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
  background: transparent;
  color: #0f172a;
  cursor: pointer;
  transition: background 0.2s ease;
}

.sidebar-link.active {
  background: #0f172a;
  color: #fff;
}

.logout-link {
  margin-top: auto;
  background: #ff1f4b;
  color: #fff;
}

.admin-content {
  flex: 1;
}

.admin-section.hidden {
  display: none;
}

.admin-header {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-bottom: 16px;
}

.admin-logo {
  width: 72px;
  height: auto;
}

.card {
  background: var(--white);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.08);
}

.identify-card {
  margin: 0 auto;
  text-align: center;
  border: 1px solid #dfe7ff;
  border-radius: 28px;
  padding: 40px 28px 32px;
}

.identify-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  text-align: left;
}

.identify-form label {
  font-size: 15px;
  font-weight: 600;
  color: #0a1f44;
}

.identify-form input {
  border-radius: 16px;
  background: #f5f7ff;
  border: 1px solid #cad4f3;
}

.hero-card {
  max-width: 420px;
  margin: 0 auto 32px;
  text-align: center;
  border: 1px solid #dfe7ff;
  border-radius: 28px;
  padding: 32px 24px 16px;
}

.hero-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

.hero-title {
  font-size: 22px;
  font-weight: 700;
  color: #0c265b;
  margin: 0 0 8px;
}

.hero-text {
  font-size: 15px;
  color: #5c6b8d;
  margin: 0 0 16px;
}

.hero-button {
  width: 100%;
  background: #032a63;
  border-radius: 24px;
  font-size: 16px;
  margin-bottom: 4px;
}

.hero-button.ghost {
  background: #ffffff;
  color: #032a63;
  border: 1px solid #9cb3da;
}

.hero-logo {
  max-width: 120px;
  margin: 0 auto 24px;
  display: block;
}

.hero-illustration {
  width: 100%;
  max-width: 320px;
  margin: 0 auto;
  display: block;
}

.contribution-card {
  max-width: 420px;
  margin: 0 auto 32px;
  border: 1px solid #dfe7ff;
  border-radius: 28px;
}

#quizCongratsCard {
  max-width: 420px;
  margin: 0 auto 32px;
  text-align: center;
  border: 1px solid #dfe7ff;
  border-radius: 28px;
}

.quiz-congrats-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 12px;
}

#memoryGameCard {
  margin: 0 auto 32px;
  border: 1px solid #dfe7ff;
  border-radius: 28px;
  padding: 24px;
  max-width: 520px;
  width: min(100%, 520px);
}

.memory-header {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-bottom: 16px;
}

.memory-header img {
  width: 64px;
}

.memory-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
}

.memory-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(56px, 1fr));
  grid-auto-rows: 1fr;
  gap: 10px;
  width: 100%;
  max-width: 440px;
  height: clamp(260px, 55vw, 360px);
  margin: 0 auto 16px;
}

.memory-card {
  position: relative;
  width: 100%;
  height: 100%;
  perspective: 1000px;
}

.memory-card-inner {
  position: absolute;
  inset: 0;
  transition: transform 0.4s ease;
  transform-style: preserve-3d;
  cursor: pointer;
}

.memory-card.flipped .memory-card-inner,
.memory-card.matched .memory-card-inner {
  transform: rotateY(180deg);
  cursor: default;
}

.memory-face {
  position: absolute;
  inset: 0;
  border-radius: 16px;
  backface-visibility: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #001f3f;
  border: 2px solid #0f2f57;
}

.memory-face.back img,
.memory-face.front img {
  width: 80%;
  height: auto;
}

.memory-face.front {
  transform: rotateY(180deg);
}

.memory-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5000;
}

.memory-modal.hidden {
  display: none;
}

.memory-modal-content {
  background: #fff;
  padding: 32px;
  border-radius: 24px;
  max-width: 480px;
  width: 90%;
  text-align: center;
}

.memory-modal-content h3 {
  margin-top: 0;
}

.contribution-card h2 {
  text-align: center;
  color: #0c265b;
  font-size: 20px;
}

.contribution-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.contribution-form label {
  font-size: 15px;
  font-weight: 600;
  color: #0a1f44;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.contribution-form select,
.contribution-form input,
.contribution-form textarea {
  border-radius: 16px;
  background: #f5f7ff;
  border: 1px solid #cad4f3;
}

.contribution-submit {
  margin-top: 8px;
}

.input-hint {
  font-size: 13px;
  font-weight: 400;
  color: #4b5a7a;
}

.card h2 {
  margin-top: 0;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

label {
  font-weight: 600;
  margin-bottom: 8px;
  display: block;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #cbd5f5;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 14px;
  font-family: inherit;
  background: #f8fbff;
}

textarea {
  min-height: 100px;
  resize: vertical;
}

button {
  border: none;
  border-radius: 12px;
  padding: 12px 24px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  background: var(--blue);
  color: var(--white);
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--blue);
  color: var(--blue);
}

.status {
  padding: 10px 16px;
  border-radius: 12px;
  margin-top: 12px;
  font-weight: 600;
}

.status.success {
  background: #e6fff5;
  color: #056344;
}

.status.error {
  background: #ffefef;
  color: #a31825;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
}

.dashboard-grid {
  display: flex;
  flex-direction: column;
  width: 100%;
  gap: 24px;
}

.control-form {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.control-form label {
  flex: 1;
  display: flex;
  flex-direction: column;
  font-weight: 600;
}

.control-form input {
  height: 100%;
}

.gallery-card {
  grid-column: span 2;
}

#adminArea {
  width: 100%;
  display: flex;
  justify-content: center;
}

.card.wide {
  grid-column: span 2;
}

@media (min-width: 1200px) {
  .dashboard-grid {
    grid-template-columns: repeat(3, minmax(320px, 1fr));
  }

  .card.wide {
    grid-column: span 3;
  }
}

.card-subtitle {
  margin: 0 0 16px;
  color: #5c6b8d;
  font-size: 14px;
}

.muted {
  color: #94a3b8;
  font-size: 14px;
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th,
.table td {
  padding: 12px 10px;
  border-bottom: 1px solid #e2e8f0;
  text-align: left;
}

.table th {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #64748b;
}

.contribution-photo {
  width: 72px;
  height: 72px;
  border-radius: 12px;
  object-fit: cover;
  border: 1px solid #d0daf5;
  display: block;
}

.question-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.question-builder {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  margin-bottom: 16px;
}

.question-builder-left,
.question-builder-right {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.question-builder textarea {
  min-height: 120px;
}

.question-preview {
  padding: 16px;
  border-radius: 12px;
  background: #f5f7ff;
  border: 1px solid #cad4f3;
  font-weight: 600;
}

.options-add {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.options-add input {
  flex: 1;
}

.option-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.option-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border: 1px solid #cad4f3;
  border-radius: 12px;
  background: #fff;
  gap: 12px;
}

.option-item label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  flex: 1;
}

.option-item-actions {
  display: flex;
  gap: 8px;
}

.question-item {
  border: 1px solid #d4dcff;
  border-radius: 12px;
  padding: 16px;
}

.daily-list .question-item {
  padding: 12px;
  font-size: 14px;
}

.table-wrapper {
  overflow-x: auto;
}

.quiz-shell {
  padding: 32px 36px;
  border-radius: 24px;
  box-shadow: 0 30px 50px rgba(38, 69, 140, 0.12);
  position: relative;
}

.quiz-shell.fullscreen {
  position: fixed;
  inset: 0;
  margin: 0;
  border-radius: 0;
  max-width: none;
  width: 100%;
  height: 100vh;
  background: #fdfdff;
  z-index: 2000;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 16px;
}

.quiz-shell.fullscreen .quiz-top {
  max-width: 820px;
  margin: 0 auto;
  width: 100%;
}

.quiz-shell.fullscreen #quizForm,
.quiz-shell.fullscreen .quiz-footnote,
.quiz-shell.fullscreen #quizStatus {
  max-width: 820px;
  margin: 0 auto;
  width: 100%;
}

.quiz-top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.quiz-mini {
  margin: 0;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #64748b;
}

.quiz-progress {
  min-width: 240px;
}

.quiz-progress-label {
  font-weight: 600;
  margin-bottom: 8px;
  color: #0f172a;
}

.quiz-progress-track {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}

.quiz-progress-fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, #5c2dd5, #ff2e63);
  transition: width 0.2s ease;
}

.quiz-question {
  margin-bottom: 16px;
}

.quiz-question-count {
  margin: 0 0 6px;
  font-size: 14px;
  font-weight: 600;
  color: #7c8db5;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.quiz-question strong {
  font-size: 20px;
  display: block;
  margin-bottom: 12px;
  color: #0f172a;
}

.quiz-option {
  display: block;
  margin-bottom: 12px;
}

.quiz-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.quiz-option span {
  display: block;
  padding: 16px 18px;
  border: 1px solid #dbe3ff;
  border-radius: 14px;
  background: #ffffff;
  font-size: 16px;
  font-weight: 500;
  color: #0f172a;
  transition: all 0.2s ease;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.05);
}

.quiz-option:hover span {
  border-color: #94a9ff;
  transform: translateY(-1px);
}

.quiz-option input:checked + span {
  border-color: #4f46e5;
  background: #f4f5ff;
  box-shadow: 0 10px 20px rgba(79, 70, 229, 0.15);
}

.quiz-option--correct {
  border-color: #22c55e !important;
  background: #ebfdf3 !important;
  color: #14532d !important;
}

.quiz-option--incorrect {
  border-color: #f87171 !important;
  background: #fef2f2 !important;
  color: #7f1d1d !important;
}

.quiz-choice {
  width: 100%;
  border: 1px solid #dbe3ff;
  border-radius: 14px;
  background: #ffffff;
  padding: 18px;
  font-size: 16px;
  font-weight: 500;
  color: #0f172a;
  text-align: left;
  cursor: pointer;
  margin-bottom: 12px;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.05);
  transition: all 0.2s ease;
}

.quiz-choice:hover {
  border-color: #94a9ff;
  transform: translateY(-1px);
}

.quiz-choice:active {
  transform: translateY(0);
  border-color: #4f46e5;
  box-shadow: 0 10px 20px rgba(79, 70, 229, 0.15);
}

.quiz-submit {
  margin-top: 12px;
  width: 100%;
  background: linear-gradient(90deg, #5c2dd5, #ff2e63);
}

.quiz-footnote {
  margin-top: 16px;
  font-size: 14px;
  color: #64748b;
}

.quiz-finish-message {
  font-size: 18px;
  font-weight: 500;
  text-align: center;
  padding: 40px 0;
  color: #0f172a;
}

.photo-row {
  display: flex;
  align-items: center;
  gap: 16px;
}

.thumb-box {
  width: 100px;
  height: 80px;
  overflow: hidden;
  border-radius: 10px;
  flex-shrink: 0;
  border: 1px solid #cbd5f5;
}

.photo-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.photo-info {
  flex: 1;
}

.photo-actions {
  display: flex;
  gap: 8px;
  flex-direction: column;
}

.upload-block {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #e2e8f0;
}

.upload-flex {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.upload-flex input[type='file'] {
  flex: 1;
}

.photo-status {
  margin-top: 12px;
}

.preview-block {
  margin-top: 16px;
}

.mini-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

.mini-gallery img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
}

.timer-block {
  margin-top: 16px;
}

.timer-flex {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.timer-flex input {
  width: 120px;
}

.hidden {
  display: none !important;
}

@media (max-width: 900px) {
  .tv2-wrapper {
    grid-template-columns: 1fr;
  }

  .tv-gallery {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(4, 160px);
  }

  .tv-title {
    font-size: 28px;
  }

  .page-wrapper {
    padding: 0;
    gap: 0;
  }

  .card {
    width: 100%;
    border-radius: 0;
    box-shadow: none;
    margin-bottom: 0;
  }

  #adminArea {
    justify-content: flex-start;
  }

  .admin-layout {
    flex-direction: column;
  }

  .admin-sidebar {
    width: 100%;
    flex-direction: row;
    overflow-x: auto;
  }

  .sidebar-link {
    flex: 1;
    text-align: center;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
    padding-bottom: 32px;
    width: 100%;
  }

  .identify-card {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 20px;
  }

  .hero-card,
  .contribution-card {
    padding: 32px 20px;
  }

  .card.wide {
    grid-column: span 1;
  }

  .quiz-shell.fullscreen {
    padding: 24px 16px;
  }
}
.horizontal-card {
  width: 100%;
}

.horizontal-card .control-form {
  width: 100%;
}
/* fallback grid (ensures same behavior when media queries override previous block) */
.memory-grid {
  grid-template-columns: repeat(6, minmax(56px, 1fr));
  gap: 10px;
}

.memory-card {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  perspective: 1000px;
}

@media (max-width: 600px) {
  #memoryGameCard {
    padding: 16px;
    width: calc(100% - 16px);
  }

  .memory-grid {
    grid-template-columns: repeat(4, minmax(56px, 1fr));
    gap: 8px;
    max-width: 100%;
    height: auto;
  }
}
/* Deixa html/body ocupando a tela toda */
html,
body {
  height: 100%;
}

/* body com layout da TV ocupando a tela toda */
body.tv-layout {
  margin: 0;
  min-height: 100vh;
  background: var(--blue);
  color: var(--white);
  display: flex;
  justify-content: center;
  align-items: stretch;
  padding: 0; /* se quiser sem borda ao redor */
}

/* Card ocupando a tela inteira */
.tv-card {
  width: 100%;
  height: 100vh;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 0;         /* se quiser sem cantos arredondados */
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(4px);
  display: flex;
  flex-direction: column;
}

/* AQUI vira flexbox em vez de grid */
.tv-gallery {
  display: flex;
  flex: 1;
  flex-wrap: wrap;
  gap: 20px;
  align-content: stretch;
}

/* Cada card preenchendo o espaço, 4 por linha em telas grandes */
.tv-gallery .gallery-card {
  flex: 1 1 calc(25% - 20px); /* 4 colunas */
  position: relative;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.45);
  aspect-ratio: 16 / 9; /* mantém proporção bonita */
}

/* Ajuste responsivo: 2 por linha em telas menores */
@media (max-width: 900px) {
  .tv-gallery .gallery-card {
    flex: 1 1 calc(50% - 16px);
  }
}

/* Estilos para gerenciamento de overhaul */
.btn-danger {
  background: var(--danger);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-danger:hover {
  background: #e63946;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
}

.btn-danger:active {
  transform: translateY(0);
}

.btn-success {
  background: var(--success);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-success:hover {
  background: #22b07d;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(41, 196, 143, 0.3);
}

.overhaul-controls {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: start;
  margin: 24px 0;
  padding: 24px;
  background: rgba(0, 188, 212, 0.05);
  border-radius: 12px;
  border: 1px solid rgba(0, 188, 212, 0.1);
}

.overhaul-info h3 {
  margin: 0 0 8px 0;
  font-size: 18px;
  color: var(--blue);
}

.overhaul-info p {
  margin: 0;
}

.overhaul-actions {
  text-align: right;
}

.overhaul-list {
  display: grid;
  gap: 16px;
  margin-top: 16px;
}

.overhaul-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  background: white;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  transition: all 0.2s ease;
}

.overhaul-item:hover {
  border-color: var(--accent);
  box-shadow: 0 2px 8px rgba(0, 188, 212, 0.1);
}

.overhaul-item-info h4 {
  margin: 0 0 4px 0;
  font-size: 16px;
  color: var(--blue);
}

.overhaul-item-info p {
  margin: 0;
  font-size: 14px;
  color: #64748b;
}

.overhaul-item-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  margin-left: 8px;
}

.overhaul-item-badge.active {
  background: rgba(41, 196, 143, 0.1);
  color: var(--success);
}

.overhaul-item-badge.archived {
  background: rgba(100, 116, 139, 0.1);
  color: #64748b;
}

.overhaul-item-actions {
  display: flex;
  gap: 8px;
}

.btn-sm {
  padding: 8px 16px;
  font-size: 14px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 600;
}

.btn-primary {
  background: var(--accent);
  color: white;
}

.btn-primary:hover {
  background: #00a3b8;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 188, 212, 0.3);
}

.btn-success.btn-sm {
  background: var(--success);
  color: white;
}

.btn-success.btn-sm:hover {
  background: #22b07d;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(41, 196, 143, 0.3);
}

@media (max-width: 768px) {
  .overhaul-controls {
    grid-template-columns: 1fr;
  }

  .overhaul-actions {
    text-align: left;
  }

  .overhaul-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .overhaul-item-actions {
    width: 100%;
  }

  .btn-sm {
    flex: 1;
  }
}

/* Galeria de fotos dos colaboradores */
.contributor-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.contributor-photo-card {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05);
}

.contributor-photo-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.12);
  border-color: var(--accent);
}

.contributor-photo-card img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  display: block;
}

.contributor-photo-info {
  padding: 16px;
}

.contributor-photo-info h4 {
  margin: 0 0 8px 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--blue);
  display: flex;
  align-items: center;
  gap: 8px;
}

.contributor-photo-info .risk-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}

.risk-badge.critico {
  background: rgba(255, 107, 107, 0.15);
  color: #dc2626;
}

.risk-badge.alto {
  background: rgba(251, 146, 60, 0.15);
  color: #ea580c;
}

.risk-badge.medio {
  background: rgba(251, 191, 36, 0.15);
  color: #d97706;
}

.risk-badge.baixo {
  background: rgba(34, 197, 94, 0.15);
  color: #16a34a;
}

.contributor-photo-info p {
  margin: 4px 0;
  font-size: 14px;
  color: #64748b;
}

.contributor-photo-info .photo-description {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #e2e8f0;
  font-size: 13px;
  color: #0f172a;
  line-height: 1.5;
}

.contributor-photo-info .photo-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
  font-size: 12px;
  color: #94a3b8;
}

@media (max-width: 768px) {
  .contributor-gallery {
    grid-template-columns: 1fr;
  }
}

/* Styles for contribution validation */
.contributions-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.contribution-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.contribution-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #f1f5f9;
}

.contribution-header strong {
  display: block;
  font-size: 16px;
  color: #0f172a;
}

.contribution-header .muted {
  font-size: 13px;
  margin: 4px 0 0 0;
}

.contribution-meta {
  display: flex;
  gap: 8px;
  align-items: center;
}

.badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.badge.pending {
  background: #fef08a;
  color: #854d0e;
}

.badge.approved {
  background: #dcfce7;
  color: #166534;
}

.badge.rejected {
  background: #fee2e2;
  color: #991b1b;
}

.contribution-body {
  margin-bottom: 16px;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.field {
  display: flex;
  flex-direction: column;
}

.field label {
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.field p {
  margin: 0;
  font-size: 14px;
  color: #0f172a;
  line-height: 1.5;
}

.field.full {
  grid-column: 1 / -1;
}

.critical-badge {
  grid-column: 2;
  background: #fecaca;
  color: #7f1d1d;
  padding: 8px 12px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 13px;
  text-align: center;
}

.contribution-thumb {
  max-width: 300px;
  max-height: 300px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}

.contribution-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  padding-top: 12px;
  border-top: 1px solid #f1f5f9;
}

.btn-sm {
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-sm.btn-success {
  background: #22c55e;
  color: white;
}

.btn-sm.btn-success:hover {
  background: #16a34a;
  transform: translateY(-1px);
}

.btn-sm.btn-danger {
  background: #ef4444;
  color: white;
}

.btn-sm.btn-danger:hover {
  background: #dc2626;
  transform: translateY(-1px);
}

@media (max-width: 768px) {
  .contribution-card {
    padding: 16px;
  }
  
  .field-row {
    grid-template-columns: 1fr;
  }
  
  .critical-badge {
    grid-column: 1;
  }
  
  .contribution-actions {
    flex-direction: column;
  }
}

/* Contribution history in portal */
.contribution-history {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 2px solid #f1f5f9;
}

.contribution-history h3 {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 16px 0;
  color: #0f172a;
}

.summary-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.summary-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: #f8fafc;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}

.summary-icon {
  font-size: 24px;
}

.summary-label {
  font-size: 12px;
  color: #64748b;
  text-transform: uppercase;
  margin: 0;
  font-weight: 600;
}

.summary-value {
  font-size: 20px;
  font-weight: 700;
  color: #0f172a;
  margin: 4px 0 0 0;
}

.contributions-history {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.history-item {
  padding: 12px 16px;
  border-left: 4px solid #e2e8f0;
  border-radius: 6px;
  background: #f8fafc;
  transition: all 0.2s ease;
}

.history-item.status-pendente {
  border-left-color: #fbbf24;
  background: #fffbeb;
}

.history-item.status-aprovada {
  border-left-color: #10b981;
  background: #ecfdf5;
}

.history-item.status-rejeitada {
  border-left-color: #ef4444;
  background: #fef2f2;
}

.history-status {
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.history-item.status-pendente .history-status {
  color: #92400e;
}

.history-item.status-aprovada .history-status {
  color: #065f46;
}

.history-item.status-rejeitada .history-status {
  color: #7f1d1d;
}

.history-tool {
  font-size: 14px;
  font-weight: 600;
  color: #0f172a;
  margin: 0 0 4px 0;
}

.history-description {
  font-size: 13px;
  color: #64748b;
  margin: 0 0 8px 0;
  line-height: 1.4;
}

.history-date {
  font-size: 12px;
  color: #94a3b8;
  margin: 0;
}

.history-validator,
.history-reason {
  font-size: 12px;
  margin: 4px 0 0 0;
}

.history-validator {
  color: #059669;
  font-weight: 500;
}

.history-reason {
  color: #dc2626;
  font-style: italic;
}

@media (max-width: 640px) {
  .summary-row {
    grid-template-columns: repeat(2, 1fr);
  }
}

