/**
 * ADMIN COMPONENTS - INFINITY CONSTRUTORA
 * OBSIDIAN VAULT v4.0 — All UI components
 */

/* ============================================================
   KPI CARDS
   ============================================================ */

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

@media (max-width: 767px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); gap: 0.875rem; }
}

@media (max-width: 480px) {
  .kpi-grid { grid-template-columns: 1fr; }
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: relative;
  overflow: hidden;
  transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease), transform 0.25s var(--ease);
  animation: cardReveal 0.5s var(--ease) backwards;
}

.kpi-card:nth-child(1) { animation-delay: 0.05s; }
.kpi-card:nth-child(2) { animation-delay: 0.10s; }
.kpi-card:nth-child(3) { animation-delay: 0.15s; }
.kpi-card:nth-child(4) { animation-delay: 0.20s; }
.kpi-card:nth-child(5) { animation-delay: 0.25s; }
.kpi-card:nth-child(6) { animation-delay: 0.30s; }

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

/* Top accent bar */
.kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 1.5rem;
  right: 1.5rem;
  height: 2px;
  background: linear-gradient(90deg, var(--gold), transparent);
  opacity: 0;
  transition: opacity 0.3s var(--ease);
  border-radius: 0 0 2px 2px;
}

/* Background glow */
.kpi-card::after {
  content: '';
  position: absolute;
  top: -60px;
  right: -60px;
  width: 160px;
  height: 160px;
  background: radial-gradient(circle, var(--gold-glow) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.4s var(--ease);
  pointer-events: none;
}

.kpi-card:hover {
  border-color: var(--border-gold);
  box-shadow: 0 0 0 1px var(--gold-dim), var(--shadow-md);
  transform: translateY(-3px);
}

.kpi-card:hover::before { opacity: 1; }
.kpi-card:hover::after  { opacity: 1; }

.kpi-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.kpi-card-title {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.kpi-card-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: var(--gold-dim);
  border: 1px solid var(--border-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold);
  font-size: 1rem;
  flex-shrink: 0;
  transition: transform 0.25s var(--ease-spring), background 0.25s;
}

.kpi-card:hover .kpi-card-icon {
  transform: scale(1.12);
  background: rgba(255, 171, 0, 0.18);
}

.kpi-card-value {
  font-size: 2.125rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  line-height: 1;
}

.kpi-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.kpi-card-change {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: 99px;
}

.kpi-card-change.positive {
  background: var(--status-success-dim);
  color: var(--status-success);
}

.kpi-card-change.negative {
  background: var(--status-danger-dim);
  color: var(--status-danger);
}

.kpi-card-change.neutral {
  background: rgba(139, 139, 153, 0.12);
  color: var(--text-muted);
}

.kpi-card-change i { font-size: 0.6875rem; }

.kpi-card-period {
  font-size: 0.6875rem;
  color: var(--text-muted);
}

/* ============================================================
   CHART CARDS
   ============================================================ */

.chart-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

@media (max-width: 767px) {
  .chart-grid { grid-template-columns: 1fr; }
}

.chart-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
}

.chart-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  gap: 1rem;
}

.chart-card-title {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.02em;
}

.chart-card-actions select {
  padding: 0.375rem 0.75rem;
  font-size: 0.75rem;
  font-family: 'Montserrat', sans-serif;
  font-weight: 500;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  color: var(--text-secondary);
  cursor: pointer;
  transition: border-color 0.2s;
  appearance: none;
}

.chart-card-actions select:hover,
.chart-card-actions select:focus {
  border-color: var(--border-gold);
  color: var(--text-primary);
  outline: none;
}

.chart-card-body {
  position: relative;
  height: 280px;
}

/* ============================================================
   DATA TABLES
   ============================================================ */

.admin-table-container {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.admin-table-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.admin-table-title {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.02em;
}

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

.admin-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 560px;
}

.admin-table thead tr {
  border-bottom: 1px solid var(--border);
}

.admin-table th {
  padding: 0.875rem 1.25rem;
  text-align: left;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: var(--bg-surface);
  white-space: nowrap;
}

.admin-table td {
  padding: 0.9375rem 1.25rem;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-soft);
  vertical-align: middle;
}

.admin-table td strong,
.admin-table td .row-title {
  color: var(--text-primary);
  font-weight: 600;
}

.admin-table tbody tr {
  transition: background 0.18s var(--ease);
  position: relative;
}

.admin-table tbody tr:last-child td {
  border-bottom: none;
}

.admin-table tbody tr:hover {
  background: var(--bg-elevated);
}

.admin-table tbody tr:hover td {
  color: var(--text-primary);
}

/* Status / table badges */
.table-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.625rem;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: 99px;
  white-space: nowrap;
}

.table-badge::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  flex-shrink: 0;
}

.badge-new, .badge-novo, .badge-agendado {
  background: var(--status-info-dim);
  color: var(--status-info);
}
.badge-new::before, .badge-novo::before, .badge-agendado::before { background: var(--status-info); }

.badge-contacted, .badge-contatado {
  background: var(--status-warning-dim);
  color: var(--status-warning);
}
.badge-contacted::before, .badge-contatado::before { background: var(--status-warning); }

.badge-qualified, .badge-qualificado {
  background: var(--gold-dim);
  color: var(--gold);
}
.badge-qualified::before, .badge-qualificado::before { background: var(--gold); }

.badge-converted, .badge-convertido, .badge-fechado, .badge-realizada {
  background: var(--status-success-dim);
  color: var(--status-success);
}
.badge-converted::before, .badge-convertido::before, .badge-fechado::before, .badge-realizada::before { background: var(--status-success); }

.badge-lost, .badge-perdido, .badge-cancelada {
  background: var(--status-danger-dim);
  color: var(--status-danger);
}
.badge-lost::before, .badge-perdido::before, .badge-cancelada::before { background: var(--status-danger); }

.badge-confirmed, .badge-confirmada {
  background: var(--status-success-dim);
  color: var(--status-success);
}
.badge-confirmed::before, .badge-confirmada::before { background: var(--status-success); }

.badge-pending, .badge-pendente, .badge-agendada, .badge-proposta {
  background: var(--status-warning-dim);
  color: var(--status-warning);
}
.badge-pending::before, .badge-pendente::before, .badge-agendada::before, .badge-proposta::before { background: var(--status-warning); }

/* Table action buttons */
.table-actions {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.table-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  background: none;
  border: 1px solid transparent;
  border-radius: var(--radius-xs);
  color: var(--text-muted);
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.18s var(--ease);
}

.table-action-btn:hover {
  border-color: var(--border-gold);
  color: var(--gold);
  background: var(--gold-dim);
}

.table-action-btn.danger:hover {
  border-color: rgba(239, 68, 68, 0.3);
  color: var(--status-danger);
  background: rgba(239, 68, 68, 0.1);
}

/* ============================================================
   BUTTONS
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  font-size: 0.8125rem;
  font-weight: 600;
  font-family: 'Montserrat', sans-serif;
  letter-spacing: 0.04em;
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.22s var(--ease);
  white-space: nowrap;
  position: relative;
  overflow: hidden;
  line-height: 1.4;
  user-select: none;
}

.btn i { font-size: 0.9375rem; flex-shrink: 0; }

/* Ripple */
.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.07);
  opacity: 0;
  transition: opacity 0.15s;
  border-radius: inherit;
}
.btn:active::after { opacity: 1; }

/* Primary */
.btn-primary {
  background: var(--gold);
  color: #000;
  border-color: var(--gold);
  font-weight: 700;
}
.btn-primary:hover {
  background: var(--gold-bright);
  border-color: var(--gold-bright);
  transform: translateY(-2px);
  box-shadow: var(--shadow-gold);
}
.btn-primary:active { transform: translateY(0); }

/* Outline gold */
.btn-outline {
  background: transparent;
  color: var(--gold);
  border-color: var(--border-gold);
}
.btn-outline:hover {
  background: var(--gold-dim);
  border-color: var(--gold);
  transform: translateY(-2px);
}
.btn-outline:active { transform: translateY(0); }

/* Ghost */
.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--border);
}
.btn-ghost:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border-color: var(--border);
  transform: translateY(-1px);
}

/* Danger */
.btn-danger {
  background: var(--status-danger);
  color: #fff;
  border-color: var(--status-danger);
  font-weight: 700;
}
.btn-danger:hover {
  background: #dc2626;
  border-color: #dc2626;
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(239, 68, 68, 0.3);
}

/* Success */
.btn-success {
  background: var(--status-success);
  color: #000;
  border-color: var(--status-success);
  font-weight: 700;
}
.btn-success:hover {
  background: #16a34a;
  border-color: #16a34a;
  transform: translateY(-2px);
}

/* Secondary */
.btn-secondary {
  background: var(--bg-elevated);
  color: var(--text-secondary);
  border-color: var(--border);
}
.btn-secondary:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  transform: translateY(-1px);
}

/* Sizes */
.btn-sm  { padding: 0.4rem 0.875rem; font-size: 0.75rem; }
.btn-lg  { padding: 0.875rem 1.75rem; font-size: 0.9375rem; }
.btn-xl  { padding: 1rem 2rem; font-size: 1rem; letter-spacing: 0.06em; }
.btn-icon { width: 38px; height: 38px; padding: 0; border-radius: var(--radius-sm); }

/* ============================================================
   FORM ELEMENTS
   ============================================================ */

.form-section {
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border-soft);
}
.form-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.form-section-title {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.form-section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--gold-border), transparent);
}

.form-row {
  display: grid;
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}
.form-row:last-child { margin-bottom: 0; }
.form-row-2 { grid-template-columns: repeat(2, 1fr); }
.form-row-3 { grid-template-columns: repeat(3, 1fr); }

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

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.form-label {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.form-control,
.form-input {
  width: 100%;
  padding: 0.6875rem 0.875rem;
  font-size: 0.875rem;
  font-family: 'Montserrat', sans-serif;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
  line-height: 1.5;
  appearance: none;
}

.form-control::placeholder,
.form-input::placeholder { color: var(--text-muted); }

.form-control:hover,
.form-input:hover { border-color: rgba(255, 171, 0, 0.2); }

.form-control:focus,
.form-input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-dim);
}

textarea.form-control,
textarea.form-input {
  resize: vertical;
  min-height: 100px;
  line-height: 1.6;
}

select.form-control {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='%238B8B99' d='M7.247 11.14L2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 12px;
  padding-right: 2.25rem;
  cursor: pointer;
}

input[type="file"].form-control {
  padding: 0.5rem 0.875rem;
  cursor: pointer;
}
input[type="file"].form-control::-webkit-file-upload-button {
  padding: 0.35rem 0.75rem;
  margin-right: 0.75rem;
  background: var(--gold);
  color: #000;
  border: none;
  font-weight: 700;
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  cursor: pointer;
  border-radius: 4px;
  font-family: 'Montserrat', sans-serif;
}

.form-help {
  font-size: 0.6875rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* ============================================================
   GENERIC CARDS
   ============================================================ */

.admin-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.admin-card-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.admin-card-title {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.02em;
}

.admin-card-body {
  padding: 1.5rem;
}

/* ============================================================
   FILTER CHIPS & TOOLBAR
   ============================================================ */

.filter-bar {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 1.25rem 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.filter-chips {
  display: flex;
  gap: 0.375rem;
  flex-wrap: wrap;
}

.filter-chip {
  padding: 0.4375rem 0.875rem;
  font-size: 0.75rem;
  font-weight: 600;
  font-family: 'Montserrat', sans-serif;
  letter-spacing: 0.03em;
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s var(--ease);
  border-radius: 99px;
  white-space: nowrap;
}

.filter-chip:hover {
  border-color: var(--border-gold);
  color: var(--gold);
  background: var(--gold-dim);
}

.filter-chip.active {
  background: var(--gold);
  border-color: var(--gold);
  color: #000;
  font-weight: 700;
}

.filter-search {
  flex: 1;
  min-width: 200px;
  position: relative;
}

.filter-search i {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.875rem;
  pointer-events: none;
}

.filter-search input {
  width: 100%;
  padding: 0.5625rem 0.875rem 0.5625rem 2.25rem;
  font-size: 0.8125rem;
  font-family: 'Montserrat', sans-serif;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 99px;
  color: var(--text-primary);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.filter-search input::placeholder { color: var(--text-muted); }
.filter-search input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-dim);
}

/* ============================================================
   MODAL
   ============================================================ */

.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  overflow-y: auto;
}

.modal-overlay.active { display: flex; animation: overlayReveal 0.25s ease; }

@keyframes overlayReveal {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.modal-container {
  background: var(--bg-card);
  border: 1px solid var(--border);
  width: 100%;
  max-width: 860px;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.7);
  border-radius: var(--radius-lg);
  overflow: hidden;
  animation: modalReveal 0.3s var(--ease-spring);
}

.modal-container.modal-sm { max-width: 480px; }
.modal-container.modal-lg { max-width: 1100px; }

@keyframes modalReveal {
  from { opacity: 0; transform: translateY(-24px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
  padding: 1.375rem 1.75rem;
  border-bottom: 1px solid var(--border-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-shrink: 0;
  background: var(--bg-surface);
  position: relative;
}

/* Gold accent line */
.modal-header::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 1.75rem;
  right: 1.75rem;
  height: 1px;
  background: linear-gradient(90deg, var(--gold), transparent);
  opacity: 0.4;
}

.modal-title {
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.01em;
}

.modal-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  font-size: 1.125rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s var(--ease);
  line-height: 1;
  flex-shrink: 0;
}

.modal-close:hover {
  background: var(--status-danger-dim);
  border-color: rgba(239, 68, 68, 0.3);
  color: var(--status-danger);
  transform: rotate(90deg);
}

.modal-body {
  padding: 1.75rem;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 1.25rem 1.75rem;
  border-top: 1px solid var(--border-soft);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  justify-content: flex-end;
  flex-shrink: 0;
  background: var(--bg-surface);
}

@media (max-width: 640px) {
  .modal-container { max-height: 96vh; border-radius: var(--radius); }
  .modal-header, .modal-body, .modal-footer { padding: 1.25rem; }
  .modal-footer { flex-direction: column-reverse; }
  .modal-footer .btn { width: 100%; justify-content: center; }
}

/* ============================================================
   PORTFOLIO GRID & CARDS
   ============================================================ */

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

@media (max-width: 640px) {
  .emp-grid { grid-template-columns: 1fr; }
}

.emp-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease), transform 0.25s var(--ease);
}

.emp-card:hover {
  border-color: var(--border-gold);
  box-shadow: var(--shadow-md);
  transform: translateY(-4px);
}

.emp-card-image {
  position: relative;
  height: 200px;
  overflow: hidden;
  background: var(--bg-elevated);
}

.emp-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease);
  filter: brightness(0.85);
}

.emp-card:hover .emp-card-image img {
  transform: scale(1.06);
  filter: brightness(1);
}

.emp-card-badge {
  position: absolute;
  top: 1rem;
  left: 0;
  padding: 0.3rem 0.75rem;
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #000;
  background: var(--gold);
  border-radius: 0 var(--radius-xs) var(--radius-xs) 0;
}

.emp-card-body { padding: 1.25rem; }

.emp-card-title {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.emp-card-subtitle {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.emp-card-meta {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-soft);
}

.emp-card-meta-item {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.emp-card-meta-item i { color: var(--gold); font-size: 0.8125rem; }

.emp-card-price {
  font-size: 1.0625rem;
  font-weight: 800;
  color: var(--gold);
  margin-bottom: 1rem;
  letter-spacing: -0.01em;
}

.emp-card-actions {
  display: flex;
  gap: 0.5rem;
}

.emp-card-actions .btn { flex: 1; justify-content: center; }

.emp-counter {
  font-size: 0.8125rem;
  color: var(--text-muted);
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border-soft);
  margin-bottom: 1.25rem;
}

.emp-counter span { color: var(--gold); font-weight: 700; }

/* ============================================================
   STATS CARDS (Blog, Visitas, Responsáveis)
   ============================================================ */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.75rem;
}

@media (max-width: 640px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
}

.stat-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all 0.22s var(--ease);
  animation: cardReveal 0.45s var(--ease) backwards;
}

.stat-card:hover {
  border-color: var(--border-gold);
  transform: translateY(-3px);
  box-shadow: var(--shadow-sm);
}

.stat-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  font-size: 1.25rem;
  flex-shrink: 0;
  transition: transform 0.25s var(--ease-spring);
}

.stat-card:hover .stat-icon { transform: scale(1.1); }

.stat-icon.gold   { background: var(--gold-dim); color: var(--gold); }
.stat-icon.green  { background: var(--status-success-dim); color: var(--status-success); }
.stat-icon.blue   { background: var(--status-info-dim); color: var(--status-info); }
.stat-icon.orange { background: var(--status-warning-dim); color: var(--status-warning); }
.stat-icon.red    { background: var(--status-danger-dim); color: var(--status-danger); }

.stat-info { display: flex; flex-direction: column; gap: 0.1rem; min-width: 0; }

.stat-value {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  line-height: 1;
}

.stat-label {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ============================================================
   EMPTY STATE
   ============================================================ */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  text-align: center;
  gap: 0.875rem;
}

.empty-state-icon {
  font-size: 2.5rem;
  color: var(--text-muted);
  opacity: 0.5;
}

.empty-state-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.empty-state-text {
  font-size: 0.8125rem;
  color: var(--text-muted);
  max-width: 320px;
  line-height: 1.6;
}

/* ============================================================
   LOADING
   ============================================================ */

.loading-spinner {
  display: inline-block;
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-overlay {
  position: absolute;
  inset: 0;
  background: rgba(11, 11, 14, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  border-radius: inherit;
}

/* ============================================================
   PROGRESS BAR
   ============================================================ */

.progress-bar {
  height: 4px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold), var(--gold-bright));
  border-radius: 99px;
  transition: width 0.5s var(--ease);
  position: relative;
  overflow: hidden;
}

.progress-bar-fill::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  animation: shimmerBar 2s linear infinite;
}

@keyframes shimmerBar {
  from { transform: translateX(-100%); }
  to   { transform: translateX(200%); }
}

/* ============================================================
   TOOLBAR (Visitas / Blog)
   ============================================================ */

.admin-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.toolbar-left, .toolbar-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* View switcher */
.view-switcher {
  display: flex;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 3px;
  gap: 2px;
}

.view-btn {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.375rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  font-family: 'Montserrat', sans-serif;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: all 0.2s var(--ease);
  white-space: nowrap;
}

.view-btn:hover { color: var(--text-primary); }

.view-btn.active {
  background: var(--bg-elevated);
  color: var(--gold);
  box-shadow: var(--shadow-sm);
}

/* Filter select */
.filter-select {
  padding: 0.5rem 0.875rem;
  font-size: 0.75rem;
  font-weight: 500;
  font-family: 'Montserrat', sans-serif;
  color: var(--text-secondary);
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: border-color 0.2s;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='%238B8B99' d='M7.247 11.14L2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.625rem center;
  background-size: 10px;
  padding-right: 1.875rem;
}
.filter-select:hover, .filter-select:focus {
  border-color: var(--border-gold);
  color: var(--text-primary);
  outline: none;
}

@media (max-width: 767px) {
  .admin-toolbar { flex-direction: column; align-items: stretch; }
  .toolbar-left, .toolbar-right { justify-content: flex-start; width: 100%; }
  .filter-select { flex: 1; }
}

/* ============================================================
   TOGGLE SWITCH
   ============================================================ */

.blog-toggle-label {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  cursor: pointer;
  user-select: none;
  padding: 0.5rem 0.875rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  transition: border-color 0.2s, background 0.2s;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
}

.blog-toggle-label:hover {
  border-color: var(--border-gold);
  background: var(--gold-dim);
  color: var(--text-primary);
}

.blog-toggle-switch {
  position: relative;
  flex-shrink: 0;
  width: 36px;
  height: 20px;
}

.blog-toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.blog-toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--border);
  border-radius: 99px;
  transition: background 0.25s var(--ease);
  cursor: pointer;
}

.blog-toggle-slider::before {
  content: '';
  position: absolute;
  left: 3px;
  top: 3px;
  width: 14px;
  height: 14px;
  background: var(--text-muted);
  border-radius: 50%;
  transition: transform 0.25s var(--ease), background 0.25s;
}

.blog-toggle-switch input:checked + .blog-toggle-slider {
  background: var(--status-success);
}
.blog-toggle-switch input:checked + .blog-toggle-slider::before {
  transform: translateX(16px);
  background: #fff;
}

/* ============================================================
   LEAD / VISIT DETAIL PANELS
   ============================================================ */

.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.detail-item {
  padding: 1rem 1.125rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--gold);
  transition: all 0.2s var(--ease);
}

.detail-item:hover {
  background: var(--bg-elevated);
  border-left-color: var(--gold-bright);
  transform: translateX(3px);
}

.detail-label {
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
}

.detail-value {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* ============================================================
   HISTORY TIMELINE
   ============================================================ */

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

.historico-timeline::before {
  content: '';
  position: absolute;
  left: 0.5rem;
  top: 0.5rem;
  bottom: 0.5rem;
  width: 1px;
  background: linear-gradient(to bottom, var(--gold), transparent);
}

.historico-item {
  position: relative;
  padding: 1rem 1.125rem;
  margin-bottom: 0.75rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  transition: all 0.2s var(--ease);
}

.historico-item::before {
  content: '';
  position: absolute;
  left: -1.625rem;
  top: 1.125rem;
  width: 8px;
  height: 8px;
  background: var(--gold);
  border: 2px solid var(--bg-base);
  border-radius: 50%;
  box-shadow: 0 0 0 2px var(--gold-border);
}

.historico-item:hover {
  border-color: var(--border-gold);
  transform: translateX(4px);
}

.historico-data {
  font-size: 0.6875rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.historico-tipo {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.historico-descricao {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ============================================================
   RESPONSÁVEL CARDS
   ============================================================ */

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

@media (max-width: 640px) {
  .responsavel-grid { grid-template-columns: 1fr; }
}

.responsavel-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: all 0.22s var(--ease);
  position: relative;
  overflow: hidden;
  animation: cardReveal 0.5s var(--ease) backwards;
}

.responsavel-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--gold), transparent);
  opacity: 0;
  transition: opacity 0.25s;
}

.responsavel-card:hover {
  border-color: var(--border-gold);
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}
.responsavel-card:hover::before { opacity: 1; }

.responsavel-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-bright) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #000;
  font-weight: 800;
  font-size: 1.125rem;
  margin-bottom: 1rem;
  flex-shrink: 0;
}

.responsavel-name {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.2rem;
}

.responsavel-role {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.875rem;
}

.responsavel-meta {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1.125rem;
}

.responsavel-meta-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.responsavel-meta-item i {
  width: 14px;
  color: var(--text-muted);
  font-size: 0.8125rem;
  flex-shrink: 0;
}

.responsavel-actions {
  display: flex;
  gap: 0.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-soft);
}

.responsavel-actions .btn { flex: 1; justify-content: center; }

/* ============================================================
   QUILL EDITOR (dark)
   ============================================================ */

.ql-toolbar.ql-snow {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

.ql-toolbar.ql-snow .ql-stroke { stroke: var(--text-secondary); }
.ql-toolbar.ql-snow .ql-fill  { fill:  var(--text-secondary); }
.ql-toolbar.ql-snow button:hover .ql-stroke,
.ql-toolbar.ql-snow .ql-picker-label:hover .ql-stroke { stroke: var(--gold); }
.ql-toolbar.ql-snow button:hover .ql-fill { fill: var(--gold); }

.ql-container.ql-snow {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  font-family: 'Montserrat', sans-serif;
  font-size: 0.9375rem;
  color: var(--text-primary);
}

.ql-editor {
  min-height: 280px;
  color: var(--text-primary);
}

.ql-editor::before { color: var(--text-muted); }

.ql-editor:focus { outline: none; }

/* ============================================================
   FULLCALENDAR (dark)
   ============================================================ */

.fc {
  font-family: 'Montserrat', sans-serif;
  color: var(--text-secondary);
}

.fc-toolbar-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-primary);
}

.fc-button-primary {
  background: var(--bg-elevated) !important;
  border: 1px solid var(--border) !important;
  color: var(--text-secondary) !important;
  font-weight: 600 !important;
  font-size: 0.75rem !important;
  text-transform: uppercase !important;
  letter-spacing: 0.05em !important;
  padding: 0.4rem 0.875rem !important;
  transition: all 0.2s !important;
  border-radius: var(--radius-xs) !important;
  font-family: 'Montserrat', sans-serif !important;
}

.fc-button-primary:hover {
  background: var(--gold-dim) !important;
  border-color: var(--border-gold) !important;
  color: var(--gold) !important;
}

.fc-button-primary:not(:disabled).fc-button-active,
.fc-button-primary:not(:disabled):active {
  background: var(--gold) !important;
  border-color: var(--gold) !important;
  color: #000 !important;
  font-weight: 700 !important;
}

.fc-col-header-cell, .fc-col-header-cell-cushion {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: var(--bg-surface);
}

.fc-daygrid-day-number {
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 0.8125rem;
}

.fc-daygrid-day.fc-day-today { background: var(--gold-dim) !important; }

.fc-daygrid-day.fc-day-today .fc-daygrid-day-number {
  background: var(--gold);
  color: #000;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  margin: 2px;
  font-weight: 700;
}

.fc-scrollgrid { border-color: var(--border) !important; }
.fc-scrollgrid td, .fc-scrollgrid th { border-color: var(--border) !important; }

.fc-event {
  border: none !important;
  font-weight: 600 !important;
  font-size: 0.6875rem !important;
  border-radius: var(--radius-xs) !important;
  padding: 0.2rem 0.4rem !important;
  cursor: pointer !important;
  transition: filter 0.2s !important;
}
.fc-event:hover { filter: brightness(1.15) !important; }

.fc-event.event-confirmada { background: var(--status-success) !important; color: #000 !important; }
.fc-event.event-pendente   { background: var(--status-warning) !important; color: #000 !important; }
.fc-event.event-concluida  { background: var(--status-info)    !important; color: #fff !important; }
.fc-event.event-cancelada  { background: var(--status-danger)  !important; color: #fff !important; }

/* ============================================================
   ORIGIN BADGE
   ============================================================ */

.origem-badge, .tipo-badge, .categoria-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.5rem;
  font-size: 0.6875rem;
  font-weight: 600;
  border-radius: 99px;
  letter-spacing: 0.04em;
  background: var(--bg-elevated);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  transition: all 0.18s var(--ease);
  white-space: nowrap;
}

.origem-badge:hover, .tipo-badge:hover, .categoria-badge:hover {
  border-color: var(--border-gold);
  color: var(--gold);
  background: var(--gold-dim);
}

.tipo-badge.tipo-presencial { background: var(--gold-dim); color: var(--gold); border-color: var(--border-gold); }
.tipo-badge.tipo-online { background: var(--status-info-dim); color: var(--status-info); border-color: rgba(59,130,246,0.3); }

/* ============================================================
   VIEWS COUNT / TAGS
   ============================================================ */

.views-count {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}
.views-count i { color: var(--status-info); }

.post-tags { display: flex; flex-wrap: wrap; gap: 0.375rem; }

.post-tag {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.5rem;
  font-size: 0.6875rem;
  font-weight: 500;
  background: var(--bg-elevated);
  color: var(--text-muted);
  border-radius: 99px;
  transition: all 0.18s;
}
.post-tag:hover { background: var(--gold-dim); color: var(--gold); }

/* ============================================================
   CHAR COUNTER
   ============================================================ */

.form-help.counter { display: flex; justify-content: space-between; }
.char-count { font-weight: 700; color: var(--gold); }
.char-count.exceeded { color: var(--status-danger); }

/* ============================================================
   UPLOAD PREVIEW
   ============================================================ */

.upload-preview-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.upload-preview-item {
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-input);
}

.upload-preview-item img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  display: block;
}

/* ============================================================
   CONTENT PREVIEW
   ============================================================ */

.content-preview {
  padding: 1rem;
  background: var(--bg-surface);
  border-left: 2px solid var(--gold);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin-top: 0.875rem;
  max-height: 200px;
  overflow-y: auto;
  color: var(--text-secondary);
  font-size: 0.875rem;
  line-height: 1.6;
}

/* Campo obrigatório que faltou (marcado pelo JS com aria-invalid) */
[aria-invalid="true"] { border-color: #e53935 !important; box-shadow: 0 0 0 3px rgba(229, 57, 53, .18) !important; }
