/* ========== CSS CUSTOM PROPERTIES (THEME) ========== */
:root {
  --color-primary: #0f6c58;
  --color-secondary: #fcaf17;
  --color-dark: #041e18;
  --color-hover: #fcaf17;
  --color-primary-rgb: 15, 108, 88;
  --color-secondary-rgb: 30, 255, 140;
}

/* ========== RESET & BASE ========== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu,
    Cantarell, "Helvetica Neue", sans-serif;
  line-height: 1.6;
  color: #1a1a2e;
  background-color: #f0f2f5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: #0f6c58;
  text-decoration: none;
}

a:hover {
  color: #c4ff3f;
  text-decoration: underline;
}

img {
  max-width: 100%;
  height: auto;
}

/* ========== CONTAINER ========== */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* ========== HEADER ========== */
.header {
  background: linear-gradient(135deg, #041e18 0%, #0f6c58 100%);
  color: #fff;
  padding: 0.75rem 0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: #fff;
  text-decoration: none;
}

.logo:hover {
  text-decoration: none;
  opacity: 0.9;
}

.logo img,
.logo-img {
  display: block;
  height: 36px;
  width: auto;
  filter: brightness(0) invert(1);
}

.logo span {
  font-size: 0.8125rem;
  opacity: 0.9;
  font-weight: 500;
}

.nav {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.nav-user {
  font-size: 0.875rem;
  opacity: 0.9;
}

.nav-link {
  color: #fff;
  font-size: 0.875rem;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  transition: background 0.2s;
}

.nav-link:hover {
  background: rgba(196, 255, 63, 0.2);
  color: #c4ff3f;
  text-decoration: none;
}

.logout-form {
  display: inline;
}

/* ========== MAIN ========== */
.main {
  flex: 1;
  padding: 2rem 1rem;
}

/* ========== FOOTER ========== */
.footer {
  background: #041e18;
  color: rgba(255, 255, 255, 0.7);
  text-align: center;
  padding: 1rem 0;
  font-size: 0.8125rem;
  margin-top: auto;
}

/* ========== MESSAGES / ALERTS ========== */
.messages {
  margin-bottom: 1.5rem;
}

.alert {
  padding: 0.75rem 1rem;
  border-radius: 6px;
  margin-bottom: 0.5rem;
  font-size: 0.9375rem;
  border: 1px solid transparent;
}

.alert-success {
  background: #e8f5f1;
  color: #0f6c58;
  border-color: #0f6c58;
}

.alert-error {
  background: #f8d7da;
  color: #721c24;
  border-color: #f5c6cb;
}

.alert-warning {
  background: #fff3cd;
  color: #856404;
  border-color: #ffeeba;
}

.alert-info {
  background: #d1ecf1;
  color: #0c5460;
  border-color: #bee5eb;
}

/* ========== TYPOGRAPHY ========== */
h1,
h2,
h3 {
  color: #041e18;
  margin-bottom: 0.75rem;
}

h1 {
  font-size: 1.75rem;
}
h2 {
  font-size: 1.375rem;
}
h3 {
  font-size: 1.125rem;
}

.page-title {
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #0f6c58;
}

/* ========== BUTTONS ========== */
.btn {
  display: inline-block;
  padding: 0.5rem 1rem;
  font-size: 0.9375rem;
  font-weight: 600;
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s;
  text-decoration: none;
}

.btn:hover {
  text-decoration: none;
  filter: brightness(1.1);
}

.btn-primary {
  background: #0f6c58;
  color: #fff;
  border-color: #0f6c58;
}

.btn-primary:hover {
  background: #c4ff3f;
  color: #041e18;
  border-color: #c4ff3f;
}

.btn-secondary {
  background: #6c757d;
  color: #fff;
  border-color: #6c757d;
}

.btn-secondary:hover {
  background: #5a6268;
  color: #c4ff3f;
}

.btn-success {
  background: #1eff8c;
  color: #041e18;
  border-color: #1eff8c;
}

.btn-success:hover {
  background: #c4ff3f;
  color: #041e18;
  border-color: #c4ff3f;
}

.btn-danger {
  background: #dc3545;
  color: #fff;
  border-color: #dc3545;
}

.btn-warning {
  background: #c4ff3f;
  color: #041e18;
  border-color: #c4ff3f;
}

.btn-warning:hover {
  background: #a8e635;
  color: #041e18;
}

.btn-sm {
  padding: 0.25rem 0.5rem;
  font-size: 0.8125rem;
}

.btn-lg {
  padding: 0.75rem 1.5rem;
  font-size: 1.0625rem;
}

.btn-block {
  display: block;
  width: 100%;
}

/* ========== CARDS ========== */
.card {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.card-header {
  border-bottom: 2px solid #0f6c58;
  padding-bottom: 0.75rem;
  margin-bottom: 1rem;
  font-weight: 700;
  color: #041e18;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

/* ========== FORMS ========== */
.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  font-weight: 600;
  font-size: 0.875rem;
  color: #333;
  margin-bottom: 0.25rem;
}

.form-group .help-text {
  font-size: 0.75rem;
  color: #666;
  margin-top: 0.25rem;
}

.form-control {
  display: block;
  width: 100%;
  padding: 0.5rem 0.75rem;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: #495057;
  background: #fff;
  border: 1px solid #ced4da;
  border-radius: 6px;
  transition:
    border-color 0.15s ease-in-out,
    box-shadow 0.15s ease-in-out;
}

.form-control:focus {
  border-color: #0f6c58;
  outline: 0;
  box-shadow: 0 0 0 0.2rem rgba(15, 108, 88, 0.25);
}

textarea.form-control {
  min-height: 80px;
  resize: vertical;
}

select.form-control {
  appearance: auto;
}

.form-checkbox {
  width: 1.125rem;
  height: 1.125rem;
  margin-right: 0.5rem;
  cursor: pointer;
}

.form-checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.875rem;
  cursor: pointer;
}

.form-errors {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
  border-radius: 6px;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  font-size: 0.875rem;
}

.form-errors ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.field-error {
  color: #dc3545;
  font-size: 0.8125rem;
  margin-top: 0.25rem;
}

.has-error .form-control {
  border-color: #dc3545;
}

.has-error .form-control:focus {
  box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

/* Feedback visual de campo válido */
.has-success .form-control {
  border-color: #0f6c58;
  background-color: #f6fcf9;
}

.has-success .form-control:focus {
  box-shadow: 0 0 0 0.2rem rgba(15, 108, 88, 0.15);
}

.has-success label {
  color: #0f6c58;
}

/* Preview de upload (foto e currículo) */
.file-preview {
  margin-top: 0.5rem;
}

.file-preview-img {
  width: 72px;
  height: 96px;
  object-fit: cover;
  border-radius: 6px;
  border: 2px solid #0f6c58;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
  display: block;
}

.file-name {
  font-size: 0.8125rem;
  color: #0f6c58;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: #f6fcf9;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  border: 1px solid #0f6c58;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-row-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 768px) {
  .form-row,
  .form-row-3 {
    grid-template-columns: 1fr;
  }
}

/* ========== PROGRESS BAR ========== */
.progress-container {
  margin-bottom: 2rem;
}

.progress-bar-bg {
  background: #e2e8f0;
  border-radius: 99px;
  height: 0.5rem;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.progress-bar-fill {
  background: linear-gradient(90deg, #0f6c58, #1eff8c);
  height: 100%;
  border-radius: 99px;
  transition: width 0.3s ease;
}

.progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.8125rem;
  color: #666;
}

.progress-steps {
  display: flex;
  justify-content: space-between;
  margin-top: 0.5rem;
  position: relative;
}

.progress-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 0.75rem;
  color: #999;
  position: relative;
  z-index: 1;
}

.progress-step.active {
  color: #0f6c58;
  font-weight: 600;
}

.progress-step.completed {
  color: #0f6c58;
  font-weight: 600;
}

.progress-step .step-number {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  background: #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
  flex-shrink: 0;
}

.progress-step .step-label {
  text-align: center;
  line-height: 1.2;
}

.progress-step.active .step-number {
  background: #0f6c58;
  color: #fff;
}

.progress-step.completed .step-number {
  background: #0f6c58;
  color: #fff;
  font-size: 0.9rem;
}

/* ========== UPLOAD COMPONENT ========== */
.upload-wrapper {
  position: relative;
}

.upload-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1.25rem 1rem;
  border: 2px dashed #ccc;
  border-radius: 8px;
  background: #fafafa;
  cursor: pointer;
  transition:
    border-color 0.2s,
    background 0.2s;
  text-align: center;
}

.upload-area:hover {
  border-color: #0f6c58;
  background: #f0faf6;
}

.upload-area.dragover {
  border-color: #0f6c58;
  background: #e8f5f1;
}

.upload-area-icon {
  font-size: 1.5rem;
  color: #999;
}

.upload-area-text {
  font-size: 0.8125rem;
  color: #666;
}

.upload-area-text strong {
  color: #0f6c58;
}

.upload-area-hint {
  font-size: 0.75rem;
  color: #999;
}

.upload-input {
  display: none;
}

/* Progresso */
.upload-progress {
  display: none;
  margin-top: 0.5rem;
}

.upload-progress.active {
  display: block;
}

.upload-progress-bar-bg {
  background: #e2e8f0;
  border-radius: 99px;
  height: 8px;
  overflow: hidden;
  position: relative;
}

.upload-progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #0f6c58, #1eff8c);
  border-radius: 99px;
  width: 0%;
  transition: width 0.3s ease;
}

.upload-progress-text {
  font-size: 0.75rem;
  color: #666;
  margin-top: 0.25rem;
  text-align: right;
}

/* Preview */
.upload-preview {
  display: none;
  margin-top: 0.5rem;
  align-items: center;
  gap: 0.75rem;
}

.upload-preview.active {
  display: flex;
}

.upload-preview-img {
  width: 56px;
  height: 72px;
  object-fit: cover;
  border-radius: 6px;
  border: 2px solid #0f6c58;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.upload-preview-info {
  flex: 1;
  min-width: 0;
}

.upload-preview-name {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #0f6c58;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.upload-preview-size {
  font-size: 0.75rem;
  color: #999;
}

.upload-delete-btn {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 50%;
  background: #fee2e2;
  color: #dc2626;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    background 0.2s,
    transform 0.15s;
  flex-shrink: 0;
}

.upload-delete-btn:hover {
  background: #fecaca;
  transform: scale(1.1);
}

.upload-error {
  display: none;
  font-size: 0.8125rem;
  color: #dc2626;
  margin-top: 0.35rem;
}

.upload-error.active {
  display: block;
}

/* Estado com arquivo já enviado (esconder área de drop) */
.upload-wrapper.has-file .upload-area {
  display: none;
}

.upload-wrapper.has-file .upload-preview {
  display: flex;
}

/* ========== TABLE ========== */
.table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
}

.table th,
.table td {
  padding: 0.625rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid #e2e8f0;
  font-size: 0.875rem;
}

.table th {
  background: #f8f9fa;
  font-weight: 700;
  color: #333;
}

.table tr:hover {
  background: #f1f3f5;
}

/* ========== BADGE ========== */
.badge {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 99px;
  text-transform: uppercase;
}

.badge-rascunho {
  background: #fff3cd;
  color: #856404;
}

.badge-enviada {
  background: #1eff8c;
  color: #041e18;
}

.badge-pendente {
  background: #fff3cd;
  color: #856404;
}

.badge-aprovada {
  background: #1eff8c;
  color: #041e18;
}

.badge-rejeitada {
  background: #dc3545;
  color: #fff;
}

.badge-deferido {
  background: #1eff8c;
  color: #041e18;
}

.badge-indeferido {
  background: #dc3545;
  color: #fff;
}

/* ========== DOCUMENT PILLS (denúncia / impugnação) ========== */
.doc-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.doc-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  background: #f0faf6;
  border: 1px solid #d1e8e0;
  border-radius: 99px;
  font-size: 0.8125rem;
  color: #0f6c58;
  text-decoration: none;
  transition:
    background 0.2s,
    box-shadow 0.2s;
}

.doc-pill:hover {
  background: #e0f5ed;
  border-color: #0f6c58;
  box-shadow: 0 1px 4px rgba(15, 108, 88, 0.15);
  text-decoration: none;
  color: #0f6c58;
}

.doc-pill-icon {
  font-size: 1rem;
  line-height: 1;
}

.doc-pill-name {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}

.doc-pill .badge {
  font-size: 0.625rem;
  padding: 0.15rem 0.45rem;
  background: #e2e8f0;
  color: #475569;
}

/* ========== AUTH PAGES ========== */
.auth-container {
  max-width: 480px;
  margin: 3rem auto;
}

.auth-card {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  padding: 2rem;
}

.auth-card h2 {
  text-align: center;
  margin-bottom: 1.5rem;
}

.auth-links {
  text-align: center;
  margin-top: 1.25rem;
  font-size: 0.875rem;
}

/* ========== DASHBOARD ========== */
.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.chapa-card {
  border: 1px solid #e2e8f0;
  transition: box-shadow 0.2s;
}

.chapa-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.chapa-card h3 {
  margin-bottom: 0.5rem;
}

.chapa-meta {
  font-size: 0.8125rem;
  color: #666;
  margin-bottom: 0.5rem;
}

.chapa-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: #666;
}

.empty-state p {
  font-size: 1.125rem;
  margin-bottom: 1.5rem;
}

/* ========== STEP FORM ========== */
.step-container {
  max-width: 900px;
  margin: 0 auto;
}

.step-title {
  margin-bottom: 0.5rem;
}

.step-subtitle {
  color: #666;
  margin-bottom: 1.5rem;
  font-size: 0.9375rem;
}

.candidato-formset {
  background: #f8f9fa;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}

.candidato-formset h3 {
  color: #0f6c58;
  margin-bottom: 1rem;
  font-size: 1rem;
}

.form-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1.5rem;
  gap: 1rem;
  flex-wrap: wrap;
}

/* ========== PILLS / TABS ========== */
.pills-nav {
  display: flex;
  gap: 0.25rem;
  margin-bottom: 1.5rem;
  border-bottom: 2px solid #e2e8f0;
  padding-bottom: 0;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.6rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #666;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.pill:hover {
  color: #0f6c58;
  background: rgba(15, 108, 88, 0.05);
}

.pill-active {
  color: #0f6c58;
  border-bottom-color: #0f6c58;
}

.pill-check {
  font-size: 0.7rem;
  color: #1eff8c;
  font-weight: 700;
}

.pill-panel {
  display: none;
}

.pill-panel-active {
  display: block;
}

/* ========== REVIEW PAGE ========== */
.section-candidatos {
  margin-bottom: 2rem;
}

.candidato-card {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1rem;
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.candidato-foto {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
}

.candidato-info {
  flex: 1;
}

.candidato-info h4 {
  margin-bottom: 0.25rem;
}

.candidato-info .meta {
  font-size: 0.8125rem;
  color: #666;
}

.candidato-info .meta span {
  display: inline-block;
  margin-right: 1rem;
}

.review-actions {
  text-align: center;
  padding: 2rem 0;
}

/* ========== DETAIL PAGE ========== */
.detail-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.detail-info {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1.5rem;
}

.detail-info p {
  margin-bottom: 0.25rem;
  font-size: 0.9375rem;
}

/* ========== CONFIRM DELETE ========== */
.confirm-box {
  text-align: center;
  padding: 2rem;
}

.confirm-box p {
  font-size: 1.0625rem;
  margin-bottom: 1.5rem;
}

/* ===== Modal de Confirmação ===== */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.5);
  align-items: center;
  justify-content: center;
}
.modal-overlay.active {
  display: flex;
}
.modal-box {
  background: #fff;
  border-radius: 12px;
  padding: 2rem 2.5rem;
  max-width: 480px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  text-align: center;
}
.modal-box .confirm-message {
  font-size: 1.125rem;
  color: #1a1a2e;
  margin-bottom: 1.5rem;
  line-height: 1.6;
}
.modal-box .form-actions {
  justify-content: center;
  gap: 0.75rem;
}

/* ========== DEFINE REPRESENTANTE ========== */
.representante-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.representante-option {
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  padding: 1rem;
  cursor: pointer;
  transition: all 0.2s;
}

.representante-option:hover {
  border-color: #0f6c58;
  background: #e8f5f1;
}

.representante-option.selected {
  border-color: #0f6c58;
  background: #e8f5f1;
}

.representante-option input[type="radio"] {
  margin-right: 0.5rem;
}

/* ========== UTILITY ========== */
.text-center {
  text-align: center;
}
.text-right {
  text-align: right;
}
.mt-1 {
  margin-top: 1rem;
}
.mt-2 {
  margin-top: 2rem;
}
.mb-1 {
  margin-bottom: 1rem;
}
.mb-2 {
  margin-bottom: 2rem;
}
.d-flex {
  display: flex;
}
.gap-1 {
  gap: 1rem;
}
.flex-wrap {
  flex-wrap: wrap;
}
.align-center {
  align-items: center;
}
.justify-between {
  justify-content: space-between;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
  .header-container {
    flex-direction: column;
    align-items: flex-start;
  }

  .nav {
    width: 100%;
    justify-content: flex-start;
  }

  .card-grid {
    grid-template-columns: 1fr;
  }

  .candidato-card {
    flex-direction: column;
  }

  .candidato-foto {
    width: 60px;
    height: 60px;
  }

  .form-actions {
    flex-direction: column;
  }

  .pills-nav {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .form-actions .btn {
    width: 100%;
  }

  .dashboard-header {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 480px) {
  .auth-container {
    margin: 1.5rem auto;
  }

  .auth-card {
    padding: 1.25rem;
  }

  .nav {
    gap: 0.5rem;
  }

  .nav-user {
    width: 100%;
  }
}

/* ========== PRINT ========== */
@media print {
  .header,
  .footer,
  .nav,
  .btn,
  .form-actions {
    display: none;
  }
  .card {
    box-shadow: none;
    border: 1px solid #ddd;
  }
}

/* ========== TOGGLE CANDIDATOS ========== */
.toggle-candidatos-radio {
  display: none;
}

.candidatos-section {
  display: none;
  animation: fadeIn 0.3s ease;
}

.toggle-candidatos-radio:checked ~ .candidatos-section {
  display: block;
}

.toggle-candidatos-radio:checked ~ #tab_info_content {
  display: none;
}

.toggle-candidatos-radio:checked ~ .avatar-stack .avatar-stack-arrow {
  transform: rotate(180deg);
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.avatar-stack-btn {
  display: flex;
  align-items: center;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}

.avatar-stack-btn:hover {
  text-decoration: none;
}

.avatar-stack-arrow {
  margin-left: 0.5rem;
  font-size: 0.75rem;
  transition: transform 0.3s ease;
  color: #0f6c58;
}

.candidatos-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.candidatos-section-header h2 {
  margin-bottom: 0;
}

.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* ========== INFO CARDS MODERNOS ========== */
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.info-card {
  background: #f8f9fa;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 1rem;
}

.info-card .info-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: #999;
  font-weight: 600;
  letter-spacing: 0.5px;
  margin-bottom: 0.25rem;
}

.info-card .info-value {
  font-size: 1rem;
  font-weight: 600;
  color: #041e18;
}

.timeline {
  position: relative;
  padding-left: 2rem;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 0.8rem;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #e2e8f0;
}

.timeline-item {
  position: relative;
  padding-bottom: 1.5rem;
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: -1.5rem;
  top: 0.35rem;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid #0f6c58;
}

.timeline-item.active::before {
  background: #0f6c58;
}

.timeline-item .timeline-title {
  font-weight: 600;
  font-size: 0.9375rem;
  color: #041e18;
}

.timeline-item .timeline-date {
  font-size: 0.8125rem;
  color: #999;
}

.timeline-item .timeline-body {
  margin-top: 0.5rem;
  font-size: 0.9375rem;
}

.badge-ajuste_necessario {
  background: #ffc107;
  color: #041e18;
}

.badge-respondido {
  background: #17a2b8;
  color: #fff;
}

.badge-none {
  background: #6c757d;
  color: #fff;
}

.badge-aberta {
  background: #dc3545;
  color: #fff;
}

.badge-defesa_pendente {
  background: #ffc107;
  color: #041e18;
}

.badge-defesa_apresentada {
  background: #17a2b8;
  color: #fff;
}

.badge-recurso_conselho {
  background: #6610f2;
  color: #fff;
}

.badge-concluida {
  background: #28a745;
  color: #fff;
}

/* ========== ERROR PAGE ========== */
.error-page {
  text-align: center;
  padding: 4rem 1rem;
}

.error-page h1 {
  font-size: 3rem;
  color: #dc3545;
}

/* ========== UPLOAD DOCUMENTO (denúncia / impugnação) ========== */
.upload-documento-wrapper {
  position: relative;
}

.upload-documento-filelist {
  margin-top: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.upload-documento-file {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0.75rem;
  background: #f8f9fa;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  transition: border-color 0.2s;
}

.upload-documento-file-done {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.upload-documento-file-error {
  border-color: #fecaca;
  background: #fef2f2;
}

.upload-documento-file-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
}

.upload-documento-file-info {
  flex: 1;
  min-width: 0;
}

.upload-documento-file-name {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #1a1a2e;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.upload-documento-file-meta {
  font-size: 0.75rem;
  color: #999;
  margin-top: 0.125rem;
}

.upload-documento-file-progress {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.375rem;
}

.upload-documento-file-progress-bar {
  flex: 1;
  background: #e2e8f0;
  border-radius: 99px;
  height: 6px;
  overflow: hidden;
}

.upload-documento-file-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #0f6c58, #1eff8c);
  border-radius: 99px;
  width: 0%;
  transition: width 0.3s ease;
}

.upload-documento-file-progress-text {
  font-size: 0.6875rem;
  color: #666;
  min-width: 2.5rem;
  text-align: right;
}

.upload-documento-file-status {
  font-size: 0.75rem;
  color: #666;
  margin-top: 0.25rem;
}

.upload-documento-file-error .upload-documento-file-status {
  color: #dc2626;
}

.upload-documento-file-done .upload-documento-file-status {
  color: #16a34a;
}

.upload-documento-file-remove {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 50%;
  background: #fee2e2;
  color: #dc2626;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    background 0.2s,
    transform 0.15s;
  flex-shrink: 0;
}

.upload-documento-file-remove:hover {
  background: #fecaca;
  transform: scale(1.1);
}

/* ========== AVATAR STACK ========== */
.avatar-stack {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 1rem;
}

.avatar-stack-item {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid #fff;
  margin-right: -12px;
  object-fit: cover;
  background: #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #999;
  font-size: 1rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition:
    transform 0.2s,
    margin-right 0.2s;
  cursor: default;
  flex-shrink: 0;
}

.avatar-stack-item:hover {
  transform: translateY(-3px);
  margin-right: 2px;
}

.avatar-stack-item img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.avatar-stack-more {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid #fff;
  background: #0f6c58;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  flex-shrink: 0;
}

.avatar-stack-label {
  margin-left: 1rem;
  font-size: 0.875rem;
  color: #666;
}

.avatar-stack-label strong {
  color: #041e18;
}

/* ========== ACCORDION CANDIDATO ========== */
.candidate-list {
  padding: 0.5rem 0;
}

.candidate-accordion {
  border-bottom: 1px solid #e2e8f0;
}

.candidate-accordion:last-child {
  border-bottom: none;
}

.candidate-accordion summary {
  list-style: none;
  cursor: pointer;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  transition: background 0.15s ease;
}

.candidate-accordion summary::-webkit-details-marker {
  display: none;
}

.candidate-accordion summary:hover {
  background: #f8f9fa;
}

.candidate-accordion[open] summary {
  background: #f0fdf4;
  border-bottom: 1px solid #e2e8f0;
}

.candidate-summary-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
  min-width: 0;
}

.candidate-summary-photo {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 50%;
  border: 2px solid #0f6c58;
  flex-shrink: 0;
}

.candidate-summary-photo-placeholder {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #999;
  flex-shrink: 0;
}

.candidate-summary-name {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.candidate-summary-name strong {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.candidate-summary-tags {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.tag {
  font-size: 0.75rem;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-weight: 500;
  white-space: nowrap;
}

.tag-tipo {
  background: #e0f2fe;
  color: #0369a1;
}

.tag-cat {
  background: #fef3c7;
  color: #92400e;
}

.tag-cpf {
  background: #f3e8ff;
  color: #6b21a8;
  font-family: monospace;
}

.candidate-summary-arrow {
  flex-shrink: 0;
  color: #999;
  transition: transform 0.2s ease;
}

.candidate-accordion[open] .candidate-summary-arrow {
  transform: rotate(180deg);
}

.candidate-details {
  padding: 1rem;
  animation: fadeIn 0.2s ease;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
}

.detail-item {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.detail-item-full {
  grid-column: 1 / -1;
}

.detail-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  color: #999;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.detail-value {
  font-size: 0.9rem;
  color: #041e18;
}
