/* ==========================================================
   PAINEL ADMINISTRATIVO E DE VENDEDORES - ESTILO MODERNO
   Igreja Presbiteriana Renovada Franca SP
========================================================== */

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

:root {
  --admin-bg: #070f20;
  --admin-sidebar: #0a1630;
  --admin-card: rgba(13, 27, 56, 0.85);
  --admin-border: rgba(255, 255, 255, 0.08);
  --primary-color: #0084ff;
  --flame-gold: #f59e0b;
  --text-main: #f8fafc;
  --text-dim: #94a3b8;
  --radius-panel: 14px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body.admin-body {
  font-family: 'Inter', sans-serif;
  background: var(--admin-bg);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Layout Principal com Sidebar */
.admin-layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.admin-sidebar {
  width: 260px;
  background: var(--admin-sidebar);
  border-right: 1px solid var(--admin-border);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

@media (max-width: 900px) {
  .admin-layout {
    flex-direction: column;
  }
  .admin-sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--admin-border);
    padding: 16px;
  }
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 20px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--admin-border);
}

.sidebar-logo {
  width: 44px;
  height: 44px;
  object-fit: contain;
}

.brand-text h2 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.1rem;
  color: white;
  line-height: 1.1;
}

.brand-text span {
  font-size: 0.72rem;
  color: var(--flame-gold);
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.admin-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: 10px;
  transition: all 0.2s ease;
}

.nav-link:hover, .nav-link.active {
  background: rgba(0, 132, 255, 0.15);
  color: #38bdf8;
}

.nav-link.active {
  background: linear-gradient(90deg, rgba(0, 132, 255, 0.25) 0%, rgba(0, 132, 255, 0.05) 100%);
  border-left: 3px solid var(--primary-color);
  color: white;
}

.sidebar-footer {
  padding-top: 16px;
  border-top: 1px solid var(--admin-border);
}

/* Área de Conteúdo */
.admin-main {
  flex: 1;
  padding: 30px 24px;
  overflow-y: auto;
}

@media (max-width: 600px) {
  .admin-main {
    padding: 16px;
  }
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 26px;
  flex-wrap: wrap;
  gap: 16px;
}

.page-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.8rem;
  color: white;
}

.header-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

/* Botões do Admin */
.btn-admin {
  background: var(--primary-color);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  transition: all 0.2s ease;
}

.btn-admin:hover {
  background: #006ee6;
  transform: translateY(-1px);
}

.btn-reveal-names {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #000000;
  font-weight: 800;
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.4);
}

.btn-reveal-names:hover {
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
}

.btn-danger {
  background: #ef4444;
}
.btn-danger:hover {
  background: #dc2626;
}

.btn-success {
  background: #10b981;
}
.btn-success:hover {
  background: #059669;
}

/* Grid de Métricas / KPIs */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.kpi-card {
  background: var(--admin-card);
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-panel);
  padding: 20px;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--primary-color);
}

.kpi-card.revenue::before { background: #10b981; }
.kpi-card.paid::before { background: #ef4444; }
.kpi-card.reserved::before { background: #f59e0b; }

.kpi-label {
  font-size: 0.78rem;
  color: var(--text-dim);
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

.kpi-value {
  font-family: 'Outfit', sans-serif;
  font-size: 1.8rem;
  font-weight: 800;
  color: white;
}

/* Cards Gerais */
.admin-card {
  background: var(--admin-card);
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-panel);
  padding: 24px;
  margin-bottom: 28px;
}

.card-header-clean {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

/* Cartela Visual no Admin */
.admin-cartela-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 10px;
}

.admin-num-box {
  background: rgba(6, 14, 30, 0.7);
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 8px 6px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 70px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
}

.admin-num-box:hover {
  border-color: var(--primary-color);
  transform: translateY(-2px);
}

.admin-num-box.disponivel {
  border-color: rgba(16, 185, 129, 0.3);
}

.admin-num-box.reservado {
  border-color: rgba(245, 158, 11, 0.6);
  background: rgba(245, 158, 11, 0.1);
}

.admin-num-box.pago {
  border-color: rgba(239, 68, 68, 0.5);
  background: rgba(239, 68, 68, 0.15);
}

.admin-num-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.25rem;
  font-weight: 800;
  color: white;
}

.admin-num-status {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  margin-top: 2px;
}

.admin-num-box.disponivel .admin-num-status { color: #10b981; }
.admin-num-box.reservado .admin-num-status { color: #fbbf24; }
.admin-num-box.pago .admin-num-status { color: #f87171; }

.admin-buyer-name {
  display: none;
  font-size: 0.65rem;
  color: #fbbf24;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 3px;
  font-weight: 600;
}

/* Quando REVELAR NOMES está ativo */
.revealed .admin-buyer-name {
  display: block;
}

/* Tabelas Administrativas */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

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

.admin-table th {
  background: rgba(0, 0, 0, 0.3);
  padding: 12px 16px;
  color: var(--text-dim);
  font-weight: 600;
  border-bottom: 1px solid var(--admin-border);
}

.admin-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--admin-border);
  color: var(--text-main);
}

.admin-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

/* Formulários do Admin */
.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

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

.admin-input, .admin-select, .admin-textarea {
  width: 100%;
  background: rgba(4, 9, 20, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  padding: 10px 14px;
  color: white;
  font-family: inherit;
  font-size: 0.95rem;
}

.admin-input:focus, .admin-select:focus, .admin-textarea:focus {
  outline: none;
  border-color: var(--primary-color);
}

/* Estilo do Login */
.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--admin-sidebar);
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-panel);
  padding: 36px 28px;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
}

.login-logo {
  width: 80px;
  height: 80px;
  object-fit: contain;
  margin-bottom: 16px;
}

/* ==========================================================
   MODAL (REUTILIZADO DO STYLE.CSS)
========================================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(4, 9, 20, 0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.modal-overlay.open {
  opacity: 1;
  visibility: visible;
}

.modal-card {
  background: #09142b;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-lg, 14px);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  transform: scale(0.92) translateY(20px);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-overlay.open .modal-card {
  transform: scale(1) translateY(0);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.modal-title {
  font-size: 1.3rem;
  color: white;
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-close-modal {
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: var(--text-dim);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  transition: background 0.2s ease;
}

.btn-close-modal:hover {
  background: rgba(255, 255, 255, 0.18);
  color: white;
}

.modal-body {
  padding: 24px;
}
