/* ==========================================================================
   DEISE IMÓVEIS - ADMIN BACKOFFICE STYLES
   Executive, Luxury Dark OLED Management Console
   Paleta Oficial: Preto #0A0A0A (Base), Branco #FFFFFF (Estrutura), Ciano #3FD6D6 (Ação)
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Admin Layout & Shell
   -------------------------------------------------------------------------- */
.admin-body {
  background-color: var(--brand-black, #0A0A0A);
  background-image: 
    radial-gradient(circle at 50% 0%, #161616 0%, transparent 65%),
    radial-gradient(circle at 100% 100%, rgba(63, 214, 214, 0.03) 0%, transparent 40%),
    linear-gradient(180deg, #0d0d0d 0%, #0a0a0a 100%);
  background-attachment: fixed;
  color: var(--text-secondary);
  font-family: var(--font-body);
  min-height: 100vh;
  margin: 0;
  display: flex;
  flex-direction: column;
}

/* --------------------------------------------------------------------------
   2. Auth Gate / Login Screen (Fallback Isolado)
   -------------------------------------------------------------------------- */
.login-screen {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  background: radial-gradient(circle at 50% 36%, #151515 0%, #0a0a0a 72%, #050505 100%);
  backdrop-filter: blur(28px);
  padding: 1.5rem;
}

.login-card-outer {
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-2xl);
  padding: 0.4rem;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.85), 0 0 40px rgba(63, 214, 214, 0.08);
  width: 100%;
  max-width: 440px;
}

.login-card-inner {
  background: #0f0f0f;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-xl);
  padding: 2.5rem 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.login-logo-seal {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(63, 214, 214, 0.15) 0%, rgba(10, 10, 10, 0.8) 75%);
  border: 1.5px solid rgba(63, 214, 214, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  box-shadow: 0 0 28px rgba(63, 214, 214, 0.25);
  margin-bottom: 1.25rem;
}

.login-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-pure-white);
  margin-bottom: 0.35rem;
}

.login-subtitle {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 1.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.login-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
  text-align: left;
}

.login-error {
  display: none;
  background: rgba(255, 51, 75, 0.12);
  border: 1px solid rgba(255, 51, 75, 0.35);
  color: #ff6b7d;
  padding: 0.65rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  text-align: center;
}

/* --------------------------------------------------------------------------
   3. Admin Navigation Bar
   -------------------------------------------------------------------------- */
.admin-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2.5rem;
  background: rgba(13, 13, 13, 0.88);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(20px);
  position: sticky;
  top: 0;
  z-index: 100;
}

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

.admin-brand-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(63, 214, 214, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  box-shadow: 0 0 16px rgba(63, 214, 214, 0.15);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.admin-brand-icon:hover {
  transform: scale(1.05);
  border-color: var(--brand-cyan, #3FD6D6);
}

.admin-brand-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-pure-white);
  letter-spacing: 0.04em;
}

.admin-brand-badge {
  font-size: 0.68rem;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.85);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 0.18rem 0.55rem;
  border-radius: var(--radius-pill);
  letter-spacing: 0.1em;
}

.admin-nav-actions {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.admin-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.55rem 1.15rem;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
}

.admin-btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
}

.admin-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(63, 214, 214, 0.35);
  color: var(--text-pure-white);
}

.admin-btn-primary {
  background: var(--brand-cyan, #3FD6D6);
  color: var(--brand-black, #0A0A0A);
  font-weight: 800;
  box-shadow: 0 0 20px rgba(63, 214, 214, 0.28);
}

.admin-btn-primary:hover {
  filter: brightness(1.08);
  box-shadow: 0 0 28px rgba(63, 214, 214, 0.45);
  transform: translateY(-1px);
}

.admin-btn-danger {
  background: rgba(255, 51, 75, 0.12);
  border-color: rgba(255, 51, 75, 0.35);
  color: #ff6b7d;
}

.admin-btn-danger:hover {
  background: rgba(255, 51, 75, 0.25);
  color: #fff;
}

/* --------------------------------------------------------------------------
   4. Admin Dashboard Container
   -------------------------------------------------------------------------- */
.admin-container {
  width: 100%;
  max-width: 1380px;
  margin: 0 auto;
  padding: 2rem 2.5rem 4rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* --------------------------------------------------------------------------
   5. Overview Metrics Grid
   -------------------------------------------------------------------------- */
.admin-metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
}

.admin-metric-card {
  background: #121212;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-xl);
  padding: 1.35rem 1.65rem;
  backdrop-filter: blur(16px);
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.admin-metric-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.6);
}

.admin-metric-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
}

.admin-metric-card.cyan::before { 
  background: var(--brand-cyan, #3FD6D6); 
  box-shadow: 0 0 12px rgba(63, 214, 214, 0.6); 
}
.admin-metric-card.cyan .admin-metric-num {
  color: var(--brand-cyan, #3FD6D6);
}

.admin-metric-card.gold::before { 
  background: #e0a92e; 
  box-shadow: 0 0 12px rgba(224, 169, 46, 0.4); 
}
.admin-metric-card.green::before { 
  background: var(--accent-emerald-green, #00ce67); 
  box-shadow: 0 0 12px rgba(0, 206, 103, 0.4); 
}
.admin-metric-card.blue::before { 
  background: var(--brand-cyan, #3FD6D6); 
  box-shadow: 0 0 12px rgba(63, 214, 214, 0.4); 
}

.admin-metric-eyebrow {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--text-dim);
  text-transform: uppercase;
}

.admin-metric-num {
  font-family: var(--font-display);
  font-size: 1.65rem;
  font-weight: 900;
  color: var(--text-pure-white);
  margin: 0.35rem 0 0.15rem;
  font-variant-numeric: tabular-nums;
}

.admin-metric-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   6. Control Center Dual-Row
   -------------------------------------------------------------------------- */
.admin-control-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.admin-card {
  background: #121212;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-xl);
  padding: 1.75rem;
  backdrop-filter: blur(16px);
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.5);
}

.admin-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.admin-card-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-pure-white);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* --------------------------------------------------------------------------
   7. Form Groups, Inputs & Selects
   -------------------------------------------------------------------------- */
.admin-form-group {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-bottom: 1.15rem;
}

.admin-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.admin-input, .admin-select, .form-input {
  background: #161616;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  font-family: var(--font-body);
  font-size: 0.92rem;
  color: var(--text-pure-white);
  transition: all var(--transition-fast);
  outline: none;
  width: 100%;
  box-sizing: border-box;
}

.admin-select {
  cursor: pointer;
}

.admin-select option {
  background: #161616;
  color: #fff;
}

.admin-input:focus, .admin-select:focus, .form-input:focus {
  border-color: var(--brand-cyan, #3FD6D6);
  background: #1a1a1a;
  box-shadow: 0 0 0 3px rgba(63, 214, 214, 0.18);
}

/* --------------------------------------------------------------------------
   8. Sellers Management Table
   -------------------------------------------------------------------------- */
.admin-table-card {
  width: 100%;
}

.admin-table-wrap {
  width: 100%;
  overflow-x: auto;
}

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

.admin-table th {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.admin-table td {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  vertical-align: middle;
}

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

.table-seller-cell {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.table-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.table-name {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-pure-white);
}

.table-role {
  font-size: 0.75rem;
  color: var(--text-dim);
}

.table-value {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--brand-cyan, #3FD6D6);
  font-variant-numeric: tabular-nums;
}

.table-goal {
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.table-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.table-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  padding: 0.35rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.table-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(63, 214, 214, 0.3);
  color: #fff;
}

.table-btn.delete:hover {
  background: rgba(255, 51, 75, 0.2);
  border-color: rgba(255, 51, 75, 0.5);
  color: #ff6b7d;
}

/* --------------------------------------------------------------------------
   9. Responsive Breakpoints
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
  .admin-metrics-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .admin-control-row {
    grid-template-columns: 1fr;
  }
}

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

  .admin-nav {
    padding: 1rem;
    flex-direction: column;
    gap: 1rem;
  }
}

/* --------------------------------------------------------------------------
   10. Modal Cards
   -------------------------------------------------------------------------- */
.modal-card {
  background: #121212;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-xl);
  padding: 1.5rem 1.75rem;
  width: 100%;
  max-width: 560px;
  margin: auto;
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.9), 0 0 35px rgba(63, 214, 214, 0.08);
}

/* --------------------------------------------------------------------------
   11. Admin Footer
   -------------------------------------------------------------------------- */
.admin-footer {
  margin-top: auto;
  padding: 1.5rem 2.5rem 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  background: #0d0d0d;
  backdrop-filter: blur(12px);
}

.admin-footer-inner {
  max-width: 1380px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

@media (max-width: 768px) {
  .admin-footer-inner {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
}

/* --------------------------------------------------------------------------
   12. Audit & Action Logs Styles
   -------------------------------------------------------------------------- */
.log-filter-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.25rem;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-lg);
}

.log-table-scroll {
  max-height: 480px;
  overflow-y: auto;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(0, 0, 0, 0.2);
}

.log-table-scroll::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.log-table-scroll::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.3);
}

.log-table-scroll::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
}

.log-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.25rem 0.65rem;
  border-radius: 100px;
  white-space: nowrap;
}

.log-badge.vendas {
  background: rgba(63, 214, 214, 0.12);
  color: #3fd6d6;
  border: 1px solid rgba(63, 214, 214, 0.35);
}

.log-badge.metas {
  background: rgba(224, 169, 46, 0.12);
  color: #f7b731;
  border: 1px solid rgba(224, 169, 46, 0.35);
}

.log-badge.corretores {
  background: rgba(70, 140, 255, 0.12);
  color: #5ea4ff;
  border: 1px solid rgba(70, 140, 255, 0.35);
}

.log-badge.ciclo {
  background: rgba(247, 152, 36, 0.15);
  color: #f79824;
  border: 1px solid rgba(247, 152, 36, 0.4);
}

.log-badge.sistema {
  background: rgba(0, 206, 103, 0.12);
  color: #00ce67;
  border: 1px solid rgba(0, 206, 103, 0.35);
}

.log-badge.navegacao {
  background: rgba(168, 85, 247, 0.12);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.35);
}

.log-badge.banco {
  background: rgba(59, 130, 246, 0.16);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.45);
}

.log-origin-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}

.log-empty-state {
  padding: 3rem 1.5rem;
  text-align: center;
  color: var(--text-dim);
  font-size: 0.88rem;
}
