/* ==========================================================================
   BEE FLIGHT COSMETICS — CENTRAL DE GESTÃO ADMINISTRATIVA (admin.css)
   Exclusivo para Régis e Luizinho
   Desenvolvido por Anjos Code (https://anjoscode.com.br)
   ========================================================================== */

:root {
  --bg-dark: #0a0d14;
  --bg-sidebar: #0f131c;
  --bg-card: #151a24;
  --bg-card-hover: #1c2331;
  --gold: #d4af37;
  --gold-light: #f3e5ab;
  --gold-dark: #996515;
  --gold-gradient: linear-gradient(135deg, #f7e7b4 0%, #d4af37 50%, #996515 100%);
  --text-main: #e6edf3;
  --text-muted: #8b949e;
  --text-light: #ffffff;
  --border-color: rgba(212, 175, 55, 0.22);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --success: #2ea043;
  --warning: #d29922;
  --danger: #f85149;
  --info: #58a6ff;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --font-serif: 'Playfair Display', Georgia, serif;
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-dark);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* ==========================================================================
   TELA DE LOGIN ADMINISTRATIVO
   ========================================================================== */
.admin-login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: radial-gradient(circle at 50% 20%, #1c2333 0%, #0a0d14 70%);
}

.login-card {
  width: 100%;
  max-width: 440px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 20px rgba(212, 175, 55, 0.12);
}

.login-header {
  text-align: center;
  margin-bottom: 28px;
}

.login-logo {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: 2px solid var(--gold);
  object-fit: cover;
  margin-bottom: 12px;
  box-shadow: 0 0 15px rgba(212, 175, 55, 0.4);
}

.login-title {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  color: var(--text-light);
  letter-spacing: 1px;
}

.login-sub {
  font-size: 0.82rem;
  color: var(--gold-light);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-weight: 700;
  margin-top: 2px;
}

.demo-warning-banner {
  background: rgba(212, 175, 55, 0.1);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 0.78rem;
  color: var(--gold-light);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-field label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-light);
}

.form-field input, .form-field select, .form-field textarea {
  background: #090c12;
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-family: var(--font-sans);
  transition: var(--transition);
}

.form-field input:focus, .form-field select:focus, .form-field textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.25);
  background: #10141d;
}

.btn-login {
  background: var(--gold-gradient);
  color: #0a0d14;
  border: none;
  padding: 13px;
  border-radius: var(--radius-sm);
  font-weight: 800;
  font-size: 0.95rem;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 6px;
}

.btn-login:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(212, 175, 55, 0.4);
}

.quick-accounts-box {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border-subtle);
}

.quick-accounts-title {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
  display: block;
  text-align: center;
}

.quick-account-btn {
  width: 100%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  color: var(--text-main);
  font-size: 0.82rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  transition: var(--transition);
}

.quick-account-btn:hover {
  background: rgba(212, 175, 55, 0.12);
  border-color: var(--gold);
  color: var(--gold-light);
}

/* ==========================================================================
   LAYOUT DO PAINEL ADMINISTRATIVO (SIDEBAR + MAIN)
   ========================================================================== */
.admin-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}

/* SIDEBAR */
.admin-sidebar {
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 100;
}

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

.sidebar-logo {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--gold);
  object-fit: cover;
}

.sidebar-brand-text h2 {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  color: var(--text-light);
  line-height: 1.1;
}

.sidebar-brand-text span {
  font-size: 0.68rem;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  font-weight: 700;
}

.sidebar-nav {
  padding: 20px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid transparent;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-light);
}

.nav-item.active {
  background: rgba(212, 175, 55, 0.12);
  color: var(--gold-light);
  border-color: var(--border-color);
}

.nav-item-icon {
  font-size: 1.15rem;
  width: 22px;
  text-align: center;
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--border-subtle);
  background: rgba(0, 0, 0, 0.2);
}

.user-badge-sidebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.user-info-side {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-avatar-side {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(212, 175, 55, 0.2);
  border: 1px solid var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.user-names h4 {
  font-size: 0.85rem;
  color: var(--text-light);
  line-height: 1.2;
}

.user-names span {
  font-size: 0.7rem;
  color: var(--gold);
}

.btn-logout {
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  width: 30px;
  height: 30px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.btn-logout:hover {
  color: var(--danger);
  border-color: var(--danger);
  background: rgba(248, 81, 73, 0.1);
}

/* ==========================================================================
   CONTEÚDO PRINCIPAL (MAIN)
   ========================================================================== */
.admin-main {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.admin-topbar {
  padding: 16px 32px;
  background: var(--bg-sidebar);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 90;
}

.topbar-page-title h1 {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  color: var(--text-light);
}

.topbar-page-title p {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-action-primary {
  background: var(--gold-gradient);
  color: #0a0d14;
  border: none;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition);
}

.btn-action-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(212, 175, 55, 0.35);
}

.btn-action-secondary {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.82rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition);
}

.btn-action-secondary:hover {
  background: rgba(255, 255, 255, 0.09);
  color: var(--text-light);
  border-color: var(--border-color);
}

/* ÁREA DE CONTEÚDO */
.admin-content-body {
  padding: 32px;
  flex: 1;
}

.view-section {
  display: none;
  animation: fadeIn 0.25s ease-in-out;
}

.view-section.active {
  display: block;
}

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

/* CARDS DE ESTATÍSTICA (METRICS GRID) */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-bottom: 28px;
}

.metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
}

.metric-card:hover {
  border-color: var(--border-color);
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
}

.metric-card.gold-border {
  border-color: var(--gold);
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.08) 0%, var(--bg-card) 100%);
}

.metric-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.metric-title {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.metric-icon {
  font-size: 1.3rem;
  opacity: 0.8;
}

.metric-value {
  font-size: 1.7rem;
  font-weight: 800;
  color: var(--text-light);
  font-family: var(--font-sans);
}

.metric-card.gold-border .metric-value {
  color: var(--gold-light);
}

.metric-footer {
  font-size: 0.74rem;
  color: var(--text-muted);
}

/* DISCLAIMER DE LUCRO LÍQUIDO */
.financial-disclaimer {
  background: rgba(212, 175, 55, 0.07);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  font-size: 0.8rem;
  color: var(--gold-light);
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* TABELAS PROFISSIONAIS */
.table-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 28px;
}

.table-header-bar {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.table-title-wrap h3 {
  font-size: 1.05rem;
  color: var(--text-light);
}

.table-filters {
  display: flex;
  align-items: center;
  gap: 10px;
}

.table-search-input {
  background: #090c12;
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  width: 220px;
}

.table-search-input:focus {
  outline: none;
  border-color: var(--gold);
}

.table-select {
  background: #090c12;
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
}

.data-table-wrap {
  overflow-x: auto;
}

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

.data-table th {
  background: rgba(0, 0, 0, 0.25);
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border-subtle);
}

.data-table td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-main);
  vertical-align: middle;
}

.data-table tbody tr:hover {
  background: var(--bg-card-hover);
}

/* BADGES DE STATUS */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 12px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.status-pill.pago, .status-pill.entregue, .status-pill.ativo {
  background: rgba(46, 160, 67, 0.15);
  color: #3fb950;
  border: 1px solid rgba(46, 160, 67, 0.35);
}

.status-pill.aguardando, .status-pill.pendente {
  background: rgba(210, 153, 34, 0.15);
  color: #d29922;
  border: 1px solid rgba(210, 153, 34, 0.35);
}

.status-pill.separacao, .status-pill.embalado {
  background: rgba(88, 166, 255, 0.15);
  color: #58a6ff;
  border: 1px solid rgba(88, 166, 255, 0.35);
}

.status-pill.enviado {
  background: rgba(212, 175, 55, 0.18);
  color: var(--gold-light);
  border: 1px solid var(--gold);
}

.status-pill.cancelado, .status-pill.inativo {
  background: rgba(248, 81, 73, 0.15);
  color: #f85149;
  border: 1px solid rgba(248, 81, 73, 0.35);
}

/* PRODUTOS - THUMBNAIL NA TABELA */
.prod-table-item {
  display: flex;
  align-items: center;
  gap: 12px;
}

.prod-table-thumb {
  width: 44px;
  height: 44px;
  border-radius: 6px;
  object-fit: contain;
  background: rgba(0, 0, 0, 0.3);
  padding: 3px;
  border: 1px solid var(--border-subtle);
}

.prod-table-info h4 {
  font-size: 0.88rem;
  color: var(--text-light);
}

.prod-table-info span {
  font-size: 0.74rem;
  color: var(--text-muted);
}

/* BOTÕES DE AÇÃO NA TABELA */
.btn-table-action {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.btn-table-action:hover {
  background: rgba(212, 175, 55, 0.15);
  border-color: var(--gold);
  color: var(--gold-light);
}

/* MODAL DE EDIÇÃO / DETALHES */
.admin-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(6px);
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

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

.admin-modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 680px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 32px;
  position: relative;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.9);
}

.admin-modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: var(--text-light);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.admin-modal-close:hover {
  background: var(--gold);
  color: #0a0d14;
}

.admin-modal-title {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  color: var(--text-light);
  margin-bottom: 6px;
}

.admin-modal-sub {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 22px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-subtle);
}

/* RODAPÉ DO PAINEL */
.admin-footer {
  padding: 20px 32px;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-sidebar);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.admin-footer a {
  color: var(--gold-light);
  text-decoration: none;
  font-weight: 700;
}

.admin-footer a:hover {
  text-decoration: underline;
}

/* RESPONSIVO */
@media (max-width: 1024px) {
  .admin-layout {
    grid-template-columns: 1fr;
  }
  .admin-sidebar {
    position: fixed;
    left: -280px;
    top: 0;
    width: 270px;
    height: 100vh;
    transition: var(--transition);
  }
  .admin-sidebar.open {
    left: 0;
  }
  .metrics-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .metrics-grid {
    grid-template-columns: 1fr;
  }
  .admin-content-body {
    padding: 16px;
  }
  .admin-topbar {
    padding: 12px 16px;
  }
}
