/* ============================================================
   admin.css — Painel Administrativo
   Barbearia Sr. Vieira
   ============================================================ */

/* ─── Login Screen ───────────────────────────────────────── */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(ellipse 70% 60% at 50% 0%, rgba(201,168,76,0.1) 0%, transparent 60%),
    var(--dark-bg);
  padding: 1.5rem;
}

.login-card {
  background: var(--dark-card);
  border: 1px solid var(--dark-border2);
  border-radius: var(--radius-xl);
  padding: 3rem 2.5rem;
  max-width: 420px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  text-align: center;
}

.login-logo {
  width: 70px; height: 70px;
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem;
  margin: 0 auto 1.5rem;
  box-shadow: 0 8px 30px rgba(201,168,76,0.3);
}

.login-title {
  margin-bottom: 0.4rem;
  color: var(--text-primary);
}

.login-subtitle {
  color: var(--text-muted);
  font-size: 0.88rem;
  margin-bottom: 2rem;
}

/* ─── Admin Layout ───────────────────────────────────────── */
.admin-layout {
  display: flex;
  min-height: 100vh;
}

/* ─── Sidebar ────────────────────────────────────────────── */
.sidebar {
  width: 260px;
  background: var(--dark-card);
  border-right: 1px solid var(--dark-border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 50;
  transition: transform 0.3s ease;
  overflow-y: auto;
}

.sidebar-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--dark-border);
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.sidebar-logo {
  width: 40px; height: 40px;
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.sidebar-brand { font-family: 'Playfair Display', serif; font-size: 0.95rem; color: var(--text-primary); font-weight: 700; }
.sidebar-sub { font-size: 0.72rem; color: var(--text-muted); }

.sidebar-nav {
  flex: 1;
  padding: 1rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.nav-section-title {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  padding: 0.5rem 0.75rem;
  margin-top: 0.5rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

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

.nav-item.active {
  background: rgba(201,168,76,0.12);
  color: var(--gold);
}

.nav-item .nav-icon { font-size: 1.1rem; width: 20px; text-align: center; flex-shrink: 0; }

.nav-badge {
  margin-left: auto;
  background: var(--gold);
  color: #0d0d0d;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: 100px;
  min-width: 20px;
  text-align: center;
}

.sidebar-footer {
  padding: 1rem 0.75rem;
  border-top: 1px solid var(--dark-border);
}

/* ─── Main Content ───────────────────────────────────────── */
.admin-main {
  flex: 1;
  margin-left: 260px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.admin-topbar {
  background: var(--dark-card);
  border-bottom: 1px solid var(--dark-border);
  padding: 1rem 1.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0; z-index: 40;
}

.topbar-title { font-family: 'Playfair Display', serif; font-size: 1.2rem; color: var(--text-primary); }
.topbar-subtitle { font-size: 0.78rem; color: var(--text-muted); }

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.notif-btn {
  position: relative;
  background: var(--dark-card2);
  border: 1px solid var(--dark-border2);
  color: var(--text-secondary);
  width: 40px; height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
  transition: var(--transition);
}

.notif-btn:hover { border-color: var(--gold); color: var(--gold); }

.notif-dot {
  position: absolute;
  top: 6px; right: 6px;
  width: 10px; height: 10px;
  background: var(--danger);
  border-radius: 50%;
  border: 2px solid var(--dark-card);
  display: none;
}

.notif-dot.show { display: block; }

.admin-content {
  flex: 1;
  padding: 1.75rem;
}

/* ─── Dashboard Cards ────────────────────────────────────── */
.dash-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.dash-card {
  background: var(--dark-card);
  border: 1px solid var(--dark-border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
}

.dash-card:hover { border-color: rgba(201,168,76,0.25); transform: translateY(-2px); }

.dash-card-icon {
  font-size: 1.8rem;
  margin-bottom: 0.75rem;
}

.dash-card-value {
  font-family: 'Playfair Display', serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
  margin-bottom: 0.25rem;
}

.dash-card-label {
  font-size: 0.82rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.dash-card-accent {
  position: absolute;
  bottom: -20px; right: -10px;
  font-size: 5rem;
  opacity: 0.04;
}

.dash-card.gold { border-color: rgba(201,168,76,0.2); }
.dash-card.gold .dash-card-value { color: var(--gold); }

/* ─── Appointments Table ─────────────────────────────────── */
.table-wrap {
  background: var(--dark-card);
  border: 1px solid var(--dark-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  overflow-x: auto;
}

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

.table-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  color: var(--text-primary);
}

.table-filters {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.filter-btn {
  background: var(--dark-card2);
  border: 1px solid var(--dark-border2);
  color: var(--text-secondary);
  padding: 0.35rem 0.85rem;
  border-radius: 100px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: var(--transition);
  font-family: 'Inter', sans-serif;
}

.filter-btn:hover, .filter-btn.active {
  border-color: var(--gold);
  color: var(--gold);
  background: rgba(201,168,76,0.08);
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead th {
  background: var(--dark-card2);
  padding: 0.85rem 1.25rem;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--dark-border);
}

tbody td {
  padding: 0.9rem 1.25rem;
  font-size: 0.88rem;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--dark-border);
  vertical-align: middle;
}

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

tbody tr:hover { background: rgba(255,255,255,0.02); }

.td-name { font-weight: 600; color: var(--text-primary); }
.td-phone { font-family: monospace; font-size: 0.85rem; }
.td-date { color: var(--gold); font-weight: 500; }

.action-btns { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.action-btn {
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--dark-border2);
  color: var(--text-secondary);
  min-width: 30px;
  width: auto;
  height: 30px;
  padding: 0 0.6rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 0.8rem;
  font-weight: 600;
  transition: var(--transition);
  white-space: nowrap;
  gap: 0.25rem;
}

.action-btn.success {
  border-color: rgba(46, 204, 113, 0.35);
  color: #2ecc71;
  background: rgba(46, 204, 113, 0.08);
}
.action-btn.danger {
  border-color: rgba(231, 76, 60, 0.35);
  color: #e74c3c;
  background: rgba(231, 76, 60, 0.08);
}
.action-btn.warning {
  border-color: rgba(201, 168, 76, 0.4);
  color: var(--gold);
  background: rgba(201, 168, 76, 0.08);
}
.action-btn.info {
  border-color: rgba(52, 152, 219, 0.35);
  color: #3498db;
  background: rgba(52, 152, 219, 0.08);
}

.action-btn:hover { background: rgba(255,255,255,0.08); border-color: var(--gold); color: var(--gold); }
.action-btn.danger:hover { background: rgba(231,76,60,0.15); border-color: #e74c3c; color: #ff6b6b; }
.action-btn.success:hover { background: rgba(46,204,113,0.15); border-color: #2ecc71; color: #2ecc71; }
.action-btn.warning:hover { background: rgba(201,168,76,0.15); border-color: var(--gold); color: #fff; }
.action-btn.info:hover { background: rgba(52,152,219,0.15); border-color: #3498db; color: #3498db; }

.empty-table {
  text-align: center;
  padding: 3rem;
  color: var(--text-muted);
}

.empty-table-icon { font-size: 3rem; margin-bottom: 0.75rem; opacity: 0.4; }

/* ─── Schedule Manager ───────────────────────────────────── */
.schedule-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

@media (max-width: 900px) { .schedule-wrap { grid-template-columns: 1fr; } }

.panel-card {
  background: var(--dark-card);
  border: 1px solid var(--dark-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

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

.panel-card-title {
  font-family: 'Playfair Display', serif;
  font-size: 1rem;
  color: var(--text-primary);
}

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

/* Admin Calendar (smaller) */
.admin-cal { max-width: 100%; }

.admin-cal .calendar-grid { gap: 4px; }

.blocked-dates-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 200px;
  overflow-y: auto;
}

.blocked-date-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(231,76,60,0.08);
  border: 1px solid rgba(231,76,60,0.2);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.85rem;
  font-size: 0.85rem;
}

.blocked-date-label { color: var(--danger); font-weight: 500; }

.slots-editor {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  max-height: 300px;
  overflow-y: auto;
}

.slot-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  cursor: pointer;
  transition: var(--transition);
  background: rgba(46,204,113,0.08);
  border: 1px solid rgba(46,204,113,0.2);
  color: var(--success);
  font-family: 'Inter', sans-serif;
  font-weight: 500;
}

.slot-toggle.blocked {
  background: rgba(231,76,60,0.08);
  border-color: rgba(231,76,60,0.2);
  color: var(--danger);
  text-decoration: line-through;
}

.slot-toggle:hover { opacity: 0.8; }

.add-slot-row {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
}

/* ─── Notifications Panel ────────────────────────────────── */
.notif-panel {
  position: fixed;
  top: 70px; right: 1.5rem;
  width: 360px;
  max-height: 70vh;
  background: var(--dark-card);
  border: 1px solid var(--dark-border2);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 100;
  display: none;
  overflow: hidden;
  animation: fadeInDown 0.25s ease;
}

.notif-panel.open { display: flex; flex-direction: column; }

.notif-panel-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--dark-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.notif-panel-title { font-weight: 600; font-size: 0.95rem; }

.notif-list {
  flex: 1;
  overflow-y: auto;
}

.notif-item {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--dark-border);
  cursor: pointer;
  transition: var(--transition);
}

.notif-item:hover { background: rgba(255,255,255,0.03); }
.notif-item.unread { background: rgba(201,168,76,0.05); }

.notif-item-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.2rem;
}

.notif-item-msg {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.notif-item-time {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
}

.notif-unread-dot {
  width: 8px; height: 8px;
  background: var(--gold);
  border-radius: 50%;
  flex-shrink: 0;
}

/* ─── Settings ───────────────────────────────────────────── */
.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

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

.settings-section {
  background: var(--dark-card);
  border: 1px solid var(--dark-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 1.5rem;
}

.settings-section-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--dark-border);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.settings-section-icon { font-size: 1.2rem; }
.settings-section-title { font-family: 'Playfair Display', serif; font-size: 1rem; color: var(--text-primary); }
.settings-section-body { padding: 1.5rem; }

/* Services editor */
.service-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  background: var(--dark-card2);
  border: 1px solid var(--dark-border);
  border-radius: var(--radius-sm);
  margin-bottom: 0.5rem;
  transition: var(--transition);
}

.service-row-icon { font-size: 1.4rem; width: 30px; text-align: center; }
.service-row-info { flex: 1; }
.service-row-name { font-size: 0.9rem; font-weight: 600; color: var(--text-primary); }
.service-row-meta { font-size: 0.78rem; color: var(--text-muted); }

.service-row-price {
  font-weight: 700;
  color: var(--gold);
  font-size: 0.95rem;
}

.toggle-switch {
  position: relative;
  width: 42px; height: 22px;
  flex-shrink: 0;
}

.toggle-switch input { display: none; }

.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--dark-border2);
  border-radius: 100px;
  cursor: pointer;
  transition: var(--transition);
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 16px; height: 16px;
  background: #fff;
  border-radius: 50%;
  top: 3px; left: 3px;
  transition: var(--transition);
}

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

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

/* ─── Responsive Admin ───────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .admin-main { margin-left: 0; }
  .admin-topbar { padding: 1rem; }
  .admin-content { padding: 1rem; }
  .dash-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Correção de legibilidade para o menu Dropdown (Select) */
select.form-control {
  background-color: #161616 !important;
  color: #ffffff !important;
}

select.form-control option {
  background-color: #161616 !important;
  color: #ffffff !important;
  padding: 0.5rem;
}

/* ─── Módulo Financeiro & Modal de Pagamentos ────────────── */
.payment-method-btn {
  transition: all 0.25s ease;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
  font-family: 'Inter', sans-serif;
}
.payment-method-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.35);
  filter: brightness(1.15);
}

.finance-progress-bar-wrapper {
  margin-bottom: 0.85rem;
  width: 100%;
}
.finance-progress-bar-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-bottom: 0.3rem;
}
.finance-progress-bar-outer {
  width: 100%;
  height: 8px;
  background: var(--dark-border2);
  border-radius: 10px;
  overflow: hidden;
}
.finance-progress-bar-inner {
  height: 100%;
  background: var(--gold);
  border-radius: 10px;
  transition: width 0.5s ease-out;
}

/* Badges de Lançamento */
.badge-finance-in {
  background: rgba(46, 204, 113, 0.12);
  color: #2ecc71;
  border: 1px solid rgba(46, 204, 113, 0.25);
  padding: 0.15rem 0.55rem;
  border-radius: 100px;
  font-size: 0.72rem;
  font-weight: 600;
}
.badge-finance-out {
  background: rgba(231, 76, 60, 0.12);
  color: #e74c3c;
  border: 1px solid rgba(231, 76, 60, 0.25);
  padding: 0.15rem 0.55rem;
  border-radius: 100px;
  font-size: 0.72rem;
  font-weight: 600;
}

/* Modal Estilos Administrativos */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(4px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 1 !important;
  visibility: visible !important;
  animation: fadeIn 0.22s ease;
}

.modal {
  background: var(--dark-card);
  border: 1.5px solid var(--dark-border2);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 480px;
  padding: 1.5rem;
  box-shadow: var(--shadow-lg);
  animation: fadeInUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@media (max-width: 576px) {
  .admin-topbar {
    padding: 0.75rem 1rem;
  }
  .topbar-subtitle {
    display: none;
  }
  .topbar-title {
    font-size: 1.1rem;
  }
  .dash-grid {
    grid-template-columns: 1fr;
  }
  .table-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem;
  }
  .table-filters {
    width: 100%;
  }
  .panel-card-header {
    padding: 1rem;
  }
  .panel-card-body {
    padding: 1rem;
  }
  .slots-editor {
    grid-template-columns: repeat(2, 1fr);
  }
  .hide-mobile {
    display: none;
  }
}
