/* ==========================================================================
   Dashboard de Edição dos Noivos (Área Administrativa)
   Interface Moderna, Intuitiva e Segura
   ========================================================================== */

.admin-body {
  background-color: #f6f7f9;
  color: #1e293b;
  min-height: 100vh;
}

/* ==========================================================================
   Tela de Login Administrativo
   ========================================================================== */
.admin-login-screen {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at center, #241d1a 0%, #120e0c 100%);
  padding: 1.5rem;
}

.admin-login-card {
  background: #ffffff;
  border-radius: 20px;
  max-width: 440px;
  width: 100%;
  padding: 2.8rem 2.2rem;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.4);
  text-align: center;
  position: relative;
  animation: modalPop 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.login-brand-icon {
  width: 58px;
  height: 58px;
  margin: 0 auto 1.2rem;
  border-radius: 14px;
  background: var(--gold-gradient);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  font-weight: 700;
  box-shadow: var(--shadow-gold);
}

.login-title {
  font-family: var(--font-serif);
  font-size: 1.8rem;
  color: #0f172a;
  margin-bottom: 0.3rem;
}

.login-subtitle {
  font-size: 0.85rem;
  color: #64748b;
  margin-bottom: 2rem;
}

.login-form {
  text-align: left;
}

.btn-login {
  width: 100%;
  padding: 1rem;
  font-size: 1rem;
  margin-top: 1.2rem;
}

/* Header Administrativo */
.admin-header {
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
  position: sticky;
  top: 0;
  z-index: 500;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.admin-header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  max-width: 1280px;
  margin: 0 auto;
}

.admin-brand {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.brand-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: var(--gold-gradient);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(197, 168, 128, 0.4);
}

.brand-info h1 {
  font-size: 1.15rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.2;
}

.brand-info span {
  font-size: 0.8rem;
  color: #64748b;
}

.header-badges {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.db-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.8rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.db-status-badge .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  animation: blink 2s infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.btn-logout {
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-full);
  border: 1px solid #cbd5e1;
  color: #64748b;
  font-size: 0.8rem;
  font-weight: 600;
}

.btn-logout:hover {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #dc2626;
}

/* Abas de Navegação */
.admin-tabs-bar {
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
}

.admin-tabs-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  gap: 1.5rem;
  overflow-x: auto;
}

.admin-tab-btn {
  padding: 1rem 0.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: #64748b;
  border-bottom: 3px solid transparent;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
}

.admin-tab-btn:hover {
  color: #0f172a;
}

.admin-tab-btn.active {
  color: var(--gold-600);
  border-bottom-color: var(--gold-500);
}

/* Layout Principal */
.admin-main {
  max-width: 1280px;
  margin: 2rem auto 5rem;
  padding: 0 1.5rem;
}

.tab-panel {
  display: none;
}

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

/* Cards e Seções do Formulário de Edição */
.admin-card {
  background: #ffffff;
  border-radius: var(--radius-md);
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  padding: 1.8rem;
  margin-bottom: 1.8rem;
}

.admin-card-header {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.admin-card-header h2 {
  font-size: 1.2rem;
  font-weight: 700;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

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

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

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

.admin-input-group {
  margin-bottom: 1.2rem;
}

.admin-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: #334155;
  margin-bottom: 0.4rem;
}

.admin-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  border: 1.5px solid #cbd5e1;
  background: #ffffff;
  color: #0f172a;
  font-size: 0.95rem;
  transition: all var(--transition-fast);
}

.admin-input:focus {
  outline: none;
  border-color: var(--gold-500);
  box-shadow: 0 0 0 3px rgba(197, 168, 128, 0.25);
}

.admin-textarea {
  min-height: 90px;
  resize: vertical;
}

/* Switch Toggle */
.switch-control {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.2rem;
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
}

.switch-label-wrap {
  flex-grow: 1;
}

.switch-title {
  font-weight: 600;
  font-size: 0.95rem;
  color: #1e293b;
}

.switch-desc {
  font-size: 0.8rem;
  color: #64748b;
  margin-top: 0.2rem;
}

.switch-toggle {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 28px;
  flex-shrink: 0;
}

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

.switch-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: #cbd5e1;
  border-radius: 34px;
  transition: .3s;
}

.switch-slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  border-radius: 50%;
  transition: .3s;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.switch-toggle input:checked + .switch-slider {
  background-color: var(--success);
}

.switch-toggle input:checked + .switch-slider:before {
  transform: translateX(22px);
}

/* Editor de Cronograma do Dia */
.admin-timeline-list {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  margin-bottom: 1.2rem;
}

.admin-timeline-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1.2rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  gap: 1rem;
}

.timeline-item-info {
  flex-grow: 1;
}

.timeline-item-time {
  font-weight: 700;
  color: var(--gold-700);
  font-size: 0.9rem;
}

.timeline-item-title {
  font-weight: 600;
  color: #0f172a;
  font-size: 1rem;
}

.timeline-item-desc {
  font-size: 0.85rem;
  color: #64748b;
  margin-top: 0.2rem;
}

/* Dropzone e Upload de Imagens */
.upload-dropzone {
  border: 2px dashed #cbd5e1;
  border-radius: 12px;
  padding: 1.5rem;
  text-align: center;
  background: #f8fafc;
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
}

.upload-dropzone:hover, .upload-dropzone.dragover {
  border-color: var(--gold-500);
  background: var(--gold-50);
}

.upload-dropzone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.dropzone-icon {
  font-size: 2rem;
  color: #94a3b8;
  margin-bottom: 0.5rem;
}

.dropzone-text {
  font-size: 0.9rem;
  color: #475569;
  font-weight: 500;
}

.dropzone-hint {
  font-size: 0.75rem;
  color: #94a3b8;
  margin-top: 0.3rem;
}

.image-preview-box {
  margin-top: 1rem;
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #e2e8f0;
  max-height: 220px;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.image-preview-box img {
  width: 100%;
  height: 220px;
  object-fit: cover;
}

.image-path-badge {
  position: absolute;
  bottom: 8px;
  left: 8px;
  background: rgba(0, 0, 0, 0.75);
  color: #ffffff;
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-family: monospace;
}

/* Gestão de Presentes no Admin */
.admin-gifts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.admin-gift-card {
  background: #ffffff;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  display: flex;
  flex-direction: column;
}

.admin-gift-img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  background: #f1f5f9;
}

.admin-gift-info {
  padding: 1.2rem;
  flex-grow: 1;
}

.admin-gift-title {
  font-weight: 700;
  font-size: 1.1rem;
  color: #0f172a;
  margin-bottom: 0.3rem;
}

.admin-gift-price {
  font-weight: 700;
  color: #047857;
  font-size: 1.15rem;
  margin-bottom: 0.5rem;
}

.admin-gift-desc {
  font-size: 0.85rem;
  color: #64748b;
  line-height: 1.5;
  margin-bottom: 1rem;
}

.admin-gift-actions {
  display: flex;
  gap: 0.6rem;
  padding: 0.8rem 1.2rem;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
}

/* Modais Administrativos */
.admin-modal-dialog {
  border: none;
  background: transparent;
  padding: 1rem;
  margin: auto;
  max-width: 580px;
  width: 95%;
  outline: none;
}

.admin-modal-dialog::backdrop {
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(4px);
}

.admin-modal-content {
  background: #ffffff;
  border-radius: 16px;
  padding: 2rem;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

/* Barra Flutuante de Salvamento */
.admin-actions-bar {
  position: sticky;
  bottom: 1.5rem;
  z-index: 400;
  background: #ffffff;
  border-radius: var(--radius-full);
  padding: 0.8rem 1.5rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  border: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 800px;
  margin: 0 auto;
}

/* Métricas de Convidados (KPIs) */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.2rem;
  margin-bottom: 2rem;
}

.kpi-card {
  background: #ffffff;
  border-radius: var(--radius-md);
  border: 1px solid #e2e8f0;
  padding: 1.4rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  display: flex;
  align-items: center;
  gap: 1rem;
}

.kpi-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
}

.kpi-icon.blue { background: #eff6ff; color: #2563eb; }
.kpi-icon.green { background: #ecfdf5; color: #059669; }
.kpi-icon.gold { background: #fefce8; color: #ca8a04; }
.kpi-icon.red { background: #fef2f2; color: #dc2626; }

.kpi-value {
  font-size: 1.8rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1;
}

.kpi-title {
  font-size: 0.8rem;
  color: #64748b;
  margin-top: 0.3rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Tabela de Convidados */
.table-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.2rem;
}

.search-input-wrap {
  position: relative;
  flex-grow: 1;
  max-width: 400px;
}

.search-input-wrap input {
  padding-left: 2.4rem;
}

.search-icon {
  position: absolute;
  left: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
}

.table-responsive {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid #e2e8f0;
  background: #ffffff;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
}

.admin-table th {
  background: #f8fafc;
  padding: 0.9rem 1.2rem;
  font-weight: 600;
  color: #475569;
  border-bottom: 1px solid #e2e8f0;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
}

.admin-table td {
  padding: 1rem 1.2rem;
  border-bottom: 1px solid #f1f5f9;
  color: #1e293b;
}

.admin-table tr:hover td {
  background: #f8fafc;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-yes {
  background: #ecfdf5;
  color: #047857;
}

.badge-no {
  background: #fef2f2;
  color: #b91c1c;
}

.btn-delete {
  color: #ef4444;
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  font-size: 0.85rem;
}

.btn-delete:hover {
  background: #fee2e2;
}
