/**
 * Design System Artisan Core - Barbertech / SaaS Barbearia Jonão
 * Especificado em docs/DESIGN.md & Visual Enhancements
 */

@import url('../lib/fontawesome/css/all.min.css');
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  /* Design Tokens de Cores */
  --surface: #f8fafc;
  --surface-dim: #e2e8f0;
  --surface-bright: #ffffff;
  --surface-container-lowest: #ffffff;
  --surface-container-low: #f1f5f9;
  --surface-container: #e2e8f0;

  --on-surface: #0f172a;
  --on-surface-variant: #64748b;
  --outline: #cbd5e1;
  --outline-variant: #e2e8f0;

  --primary: #0f172a;
  --primary-hover: #1e293b;
  --on-primary: #ffffff;
  --primary-container: #1e2638;
  --on-primary-container: #94a3b8;

  --secondary: #64748b;
  --on-secondary: #ffffff;
  --secondary-container: #1e2638;

  --accent-green: #10b981;
  --accent-amber: #f59e0b;
  --accent-red: #ef4444;

  /* Formas & Raio de Arredondamento */
  --radius-sm: 0.375rem;
  /* 6px */
  --radius-default: 0.5rem;
  /* 8px */
  --radius-md: 0.75rem;
  /* 12px */
  --radius-lg: 1rem;
  /* 16px */
  --radius-xl: 1.5rem;
  /* 24px */
  --radius-full: 9999px;

  /* Fontes Premium: Plus Jakarta Sans & JetBrains Mono */
  --font-family-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-family-mono: 'JetBrains Mono', monospace;
}

/* Reset & Estilos Base */
body {
  font-family: var(--font-family-sans);
  background-color: var(--surface);
  color: var(--on-surface);
  margin: 0;
  padding: 0;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Navbar Customizada High-End */
.navbar-custom {
  background: #0b0f17;
  border-bottom: 1px solid #1e2638;
  backdrop-filter: blur(12px);
}

.brand-logo-container {
  background: rgba(255, 255, 255, 0.95);
  padding: 4px 10px;
  border-radius: var(--radius-md);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  display: inline-flex;
  align-items: center;
  transition: transform 0.2s ease;
}

.brand-logo-container:hover {
  transform: scale(1.02);
}

.brand-title {
  color: #ffffff;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-size: 1.15rem;
}

.brand-subtitle {
  color: #94a3b8;
  font-weight: 500;
  font-size: 0.875rem;
  letter-spacing: -0.01em;
}

.badge-admin-master {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  backdrop-filter: blur(4px);
}

/* Tipografia */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-family-sans);
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.02em;
}

.font-mono {
  font-family: var(--font-family-mono);
}

/* Cards & Elevação */
.card-custom,
.card-metric {
  border-radius: var(--radius-lg);
  transition: all 0.2s ease;
}

.metric-icon-bg {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

/* Botões Customizados */
.btn-custom,
.btn-primary-custom {
  border-radius: var(--radius-default);
  font-weight: 600;
  transition: all 0.2s ease-in-out;
}

.btn-primary {
  background-color: var(--primary) !important;
  border-color: var(--primary) !important;
  color: #ffffff !important;
}

.btn-primary:hover {
  background-color: var(--primary-hover) !important;
  border-color: var(--primary-hover) !important;
  color: #ffffff !important;
}

/* Tabela Elegante */
.table-custom {
  border-collapse: separate;
  border-spacing: 0;
}

.table-custom th {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.85rem 1rem;
  white-space: nowrap;
}

.table-custom td {
  padding: 1rem;
  vertical-align: middle;
  transition: background-color 0.15s ease;
  white-space: nowrap;
  color: #ffffff;
}

.table-custom tbody tr:hover td {
  background-color: #182033;
}

.action-buttons-group {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* Badges e Status */
.badge-pill-custom {
  padding: 0.4em 0.8em;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  white-space: nowrap;
  display: inline-block;
}

.badge-pill-ativo {
  background-color: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-pill-trial {
  background-color: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-pill-suspenso {
  background-color: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Cards de Ação Rápida (Fundo Branco Gelo #F8FAFC em Temas Claros) */
.card-quick-action {
  background-color: #f8fafc !important;
  color: #0f172a !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: var(--radius-md);
  padding: 1.1rem;
  text-decoration: none !important;
  display: block;
  transition: all 0.2s ease-in-out;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.card-quick-action:hover {
  background-color: #ffffff !important;
  border-color: #0f172a !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}

.card-quick-action .quick-action-title {
  color: #0f172a !important;
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 0.25rem;
}

.card-quick-action .quick-action-desc {
  color: #475569 !important;
  font-size: 0.825rem;
  line-height: 1.35;
}

/* ==========================================================
 * Responsividade Global & Regras de Segurança contra Transbordamento
 * ========================================================== */
html, body {
  overflow-x: hidden;
  max-width: 100vw;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

canvas {
  max-width: 100% !important;
}

@media (max-width: 767.98px) {
  .action-buttons-group {
    justify-content: flex-start !important;
    width: 100%;
    margin-top: 0.5rem;
  }
  .action-buttons-group .btn {
    width: 100%;
    margin-left: 0 !important;
    margin-bottom: 0.5rem;
  }
  .card-custom,
  .card-metric {
    padding: 1rem !important;
  }
  .navbar-collapse {
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
  }
}

/* ==========================================================
 * Layout de Sidebar Lateral (Desktop e Responsivo)
 * ========================================================== */
@media (min-width: 992px) {
  .app-sidebar {
    width: 250px !important;
    min-width: 250px !important;
    height: 100vh !important;
    max-height: 100vh !important;
    position: fixed !important;
    top: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    z-index: 1030 !important;
    display: flex !important;
    flex-direction: column !important;
    overflow-x: hidden !important;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), min-width 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
  }
  
  /* Scrollbar fina que só é visível se a altura do menu exceder a tela */
  .app-sidebar::-webkit-scrollbar {
    width: 4px;
  }
  .app-sidebar::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.25);
    border-radius: 4px;
  }
  .app-sidebar::-webkit-scrollbar-track {
    background: transparent;
  }
  
  .app-main-content {
    flex: 1;
    min-width: 0;
    margin-left: 250px !important;
    max-width: calc(100vw - 250px) !important;
    overflow-x: hidden;
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1), max-width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }

  /* Estado Recolhido (Sidebar Collapsed - 72px) */
  body.sidebar-collapsed .app-sidebar {
    width: 72px !important;
    min-width: 72px !important;
  }

  body.sidebar-collapsed .app-main-content {
    margin-left: 72px !important;
    max-width: calc(100vw - 72px) !important;
  }

  body.sidebar-collapsed .sidebar-title,
  body.sidebar-collapsed .sidebar-text,
  body.sidebar-collapsed .sidebar-header small,
  body.sidebar-collapsed .sidebar-header-label,
  body.sidebar-collapsed .sidebar-footer .user-info {
    display: none !important;
  }

  body.sidebar-collapsed .logo-container {
    width: 44px !important;
    height: 44px !important;
    margin-bottom: 0.25rem !important;
    padding: 2px !important;
  }

  body.sidebar-collapsed .sidebar-header {
    padding: 0.75rem 0.25rem 0.5rem 0.25rem !important;
  }

  body.sidebar-collapsed .sidebar-nav {
    padding: 0.5rem 0.25rem !important;
  }

  body.sidebar-collapsed .sidebar-nav .nav-link {
    justify-content: center !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    text-align: center !important;
  }

  body.sidebar-collapsed .sidebar-nav .nav-link .sidebar-icon,
  body.sidebar-collapsed .sidebar-nav .nav-link .fs-5 {
    font-size: 1.25rem !important;
    margin: 0 auto !important;
  }

  body.sidebar-collapsed .sidebar-footer {
    padding: 0.75rem 0.25rem !important;
    text-align: center;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
  }

  body.sidebar-collapsed .sidebar-footer > .d-flex {
    justify-content: center !important;
    width: 100% !important;
    margin: 0 auto !important;
  }

  body.sidebar-collapsed .sidebar-footer-actions {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.5rem !important;
    width: 100% !important;
    margin: 0 auto !important;
  }

  body.sidebar-collapsed .sidebar-footer .btn,
  body.sidebar-collapsed .sidebar-footer .btn-sidebar-action {
    padding: 0 !important;
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    min-height: 32px !important;
    border-radius: 50% !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 auto !important;
    font-size: 0.85rem !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2) !important;
  }

  body.sidebar-collapsed .sidebar-footer .btn .fs-6,
  body.sidebar-collapsed .sidebar-footer .btn span {
    font-size: 0.85rem !important;
    line-height: 1 !important;
    margin: 0 !important;
  }

  body.sidebar-collapsed .sidebar-header .d-flex {
    justify-content: center !important;
    margin-bottom: 0.5rem !important;
  }
}

.border-white-10 {
  border-color: rgba(255, 255, 255, 0.12) !important;
}

.active-sidebar-pill {
  background-color: rgba(255, 255, 255, 0.22) !important;
  color: #ffffff !important;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25);
  font-weight: 700 !important;
}

.sidebar-item-hover {
  transition: all 0.2s ease-in-out;
}

.sidebar-item-hover:hover {
  background-color: rgba(255, 255, 255, 0.12) !important;
  color: #ffffff !important;
  transform: translateX(3px);
}

.sidebar-toggle-btn {
  background: rgba(255, 255, 255, 0.2) !important;
  color: #ffffff !important;
  border-radius: 50% !important;
  width: 24px !important;
  height: 24px !important;
  font-size: 0.65rem !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: background-color 0.2s ease, transform 0.2s ease !important;
  cursor: pointer;
}

.sidebar-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.35) !important;
  transform: scale(1.08);
}

/* Hero Banner Header - Agendamento Online Público */
.hero-agendamento-header {
  position: relative;
  width: 100%;
  min-height: 280px;
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin-bottom: 2rem;
}

.hero-agendamento-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(180deg, rgba(10, 16, 28, 0.45) 0%, rgba(10, 16, 28, 0.85) 75%, rgba(10, 16, 28, 0.98) 100%);
  z-index: 1;
}

.hero-agendamento-content {
  position: relative;
  z-index: 2;
  width: 100%;
  padding: 2.5rem 1rem 2rem 1rem;
  text-align: center;
}

.hero-logo-circle {
  width: 96px;
  height: 96px;
  object-fit: cover;
  border-radius: 50%;
  border: 3px solid #ffffff;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5), 0 0 0 3px rgba(212, 175, 55, 0.6);
  background-color: #0f172a;
}

.hero-barbearia-title {
  color: #ffffff !important;
  font-size: 1.85rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-top: 0.75rem;
  margin-bottom: 0.35rem;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.7);
}

.hero-barbearia-subtitle {
  color: rgba(255, 255, 255, 0.85) !important;
  font-size: 0.9rem;
  font-weight: 500;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}

@media (max-width: 575.98px) {
  .hero-agendamento-header {
    min-height: 240px;
  }
  .hero-agendamento-content {
    padding: 2rem 1rem 1.5rem 1rem;
  }
  .hero-logo-circle {
    width: 80px;
    height: 80px;
  }
  .hero-barbearia-title {
    font-size: 1.5rem;
  }
  .hero-barbearia-subtitle {
    font-size: 0.825rem;
  }
}

/* Utilitários Adicionais de Cores e Badges do Módulo Barbeiro */
.bg-purple-subtle {
  background-color: rgba(168, 85, 247, 0.15) !important;
}
.text-purple {
  color: #c084fc !important;
}
.border-purple-subtle {
  border-color: rgba(168, 85, 247, 0.3) !important;
}
.text-success-light {
  color: #4ade80 !important;
}
.extra-small {
  font-size: 0.725rem !important;
}
.dropdown-menu .dropdown-item:hover {
  background-color: rgba(255, 255, 255, 0.08) !important;
}

/* Visibilidade do Ícone de Calendário em Inputs do Tipo Date */
input[type="date"] {
  color-scheme: dark !important;
}

input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(1) brightness(2) !important;
  cursor: pointer !important;
  opacity: 1 !important;
}

/* Suporte a Temas Claros para Seletor de Data (Ícone Visível Escuro) */
body.theme-light-slate input[type="date"],
body.theme-artisan-default input[type="date"],
body.theme-amber-gold input[type="date"],
body.theme-sage-green input[type="date"],
body.theme-monochrome-light input[type="date"] {
  color-scheme: light !important;
  background-color: #ffffff !important;
  color: #0f172a !important;
  border: 1px solid #cbd5e1 !important;
}

body.theme-light-slate input[type="date"]::-webkit-calendar-picker-indicator,
body.theme-artisan-default input[type="date"]::-webkit-calendar-picker-indicator,
body.theme-amber-gold input[type="date"]::-webkit-calendar-picker-indicator,
body.theme-sage-green input[type="date"]::-webkit-calendar-picker-indicator,
body.theme-monochrome-light input[type="date"]::-webkit-calendar-picker-indicator {
  filter: none !important;
  cursor: pointer !important;
  opacity: 0.8 !important;
}

/* Bordas Divisórias Verticais entre Colunas da Tabela (Fidelidade ao Mockup) */
.table-bordered th,
.table-bordered td,
.table-bordered > :not(caption) > * > * {
  border-width: 1px !important;
  border-style: solid !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
}

/* ==========================================================================
   NOVA INTERFACE DA AGENDA DO BARBEIRO - CALENDÁRIO & MODOS DE VISUALIZAÇÃO
   ========================================================================== */

/* Barra de Alternância de Modos de Visualização (View Switcher) */
.view-switcher-bar {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(15, 23, 42, 0.6);
  padding: 4px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.btn-view-mode {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  font-size: 0.825rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  color: #94a3b8;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-view-mode:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

.btn-view-mode.active {
  color: #ffffff;
  background: #3b82f6;
  box-shadow: 0 2px 6px rgba(59, 130, 246, 0.35);
}

/* Calendário Mensal */
.calendar-month-wrapper {
  background: #111827;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}

.calendar-week-headers {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  margin-bottom: 8px;
}

.calendar-week-header {
  text-align: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 4px 0;
}

.calendar-days-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
}

.calendar-day-cell {
  background: #161f2e;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md);
  min-height: 86px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-decoration: none !important;
  color: inherit;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.calendar-day-cell:hover {
  transform: translateY(-2px);
  border-color: rgba(59, 130, 246, 0.5);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.calendar-day-cell.day-other-month {
  opacity: 0.35;
  background: rgba(15, 23, 42, 0.4);
}

.calendar-day-cell.day-selected {
  border: 2px solid #3b82f6 !important;
  background: #1e293b !important;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.calendar-day-cell.day-today {
  border-color: rgba(212, 175, 55, 0.8);
}

.calendar-day-cell.day-today .day-number {
  color: #fbbf24 !important;
  font-weight: 800;
}

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

.day-number {
  font-size: 0.875rem;
  font-weight: 700;
  color: #e2e8f0;
}

.day-status-dots {
  display: flex;
  align-items: center;
  gap: 4px;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
}

.status-dot-empty {
  background-color: #64748b;
}

.status-dot-light {
  background-color: #22c55e;
  box-shadow: 0 0 4px rgba(34, 197, 94, 0.5);
}

.status-dot-medium {
  background-color: #f59e0b;
  box-shadow: 0 0 4px rgba(245, 158, 11, 0.5);
}

.status-dot-full {
  background-color: #ef4444;
  box-shadow: 0 0 4px rgba(239, 68, 68, 0.5);
}

.status-dot-block {
  background-color: #38bdf8;
  box-shadow: 0 0 4px rgba(56, 189, 248, 0.5);
}

.day-content-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-top: 4px;
}

.day-count-badge {
  font-size: 0.725rem;
  font-weight: 600;
  color: #cbd5e1;
  font-family: var(--font-family-mono);
}

/* Cores de Fundo Suave dos Dias por Nível de Ocupação */
.calendar-day-cell.occ-light {
  background: rgba(34, 197, 94, 0.08);
  border-color: rgba(34, 197, 94, 0.2);
}

.calendar-day-cell.occ-medium {
  background: rgba(245, 158, 11, 0.08);
  border-color: rgba(245, 158, 11, 0.2);
}

.calendar-day-cell.occ-full {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.2);
}

/* Legenda do Calendário */
.calendar-legend-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  margin-top: 16px;
  font-size: 0.775rem;
  color: #94a3b8;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* ==========================================================================
   MODO LISTA ELEGANTE (Cards Horizontais por Horário)
   ========================================================================== */
.agenda-list-wrapper {
  position: relative;
  z-index: 10;
}

.agenda-hour-group {
  margin-bottom: 1.5rem;
  position: relative;
  z-index: 1;
}

.agenda-hour-group:focus-within,
.agenda-hour-group:has(.dropdown-menu.show),
.agenda-hour-group.has-dropdown-open {
  z-index: 1050 !important;
}

.agenda-hour-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: #94a3b8;
  font-family: var(--font-family-mono);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.agenda-hour-title::after {
  content: '';
  flex-grow: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
}

.agenda-list-card {
  background: #161f2e;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  transition: all 0.2s ease;
  position: relative;
  z-index: 1;
}

.agenda-list-card:hover {
  transform: translateX(3px);
  border-color: rgba(59, 130, 246, 0.4);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.agenda-list-card:focus-within,
.agenda-list-card:has(.dropdown-menu.show),
.agenda-list-card:has([aria-expanded="true"]),
.agenda-list-card.has-dropdown-open {
  z-index: 1060 !important;
  transform: none !important;
}

.agenda-list-card .dropdown {
  position: relative;
  z-index: 1070;
}

.agenda-list-card .dropdown-menu,
.agenda-dropdown-menu {
  z-index: 1080 !important;
  min-width: 220px;
  background: #1e293b !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  border-radius: 10px !important;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.6), 0 8px 10px -6px rgba(0, 0, 0, 0.5) !important;
  padding: 6px 0 !important;
}

.agenda-dropdown-menu .dropdown-item {
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.55rem 1rem;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.agenda-dropdown-menu .dropdown-item:hover,
.agenda-dropdown-menu .dropdown-item:focus {
  background-color: rgba(255, 255, 255, 0.08) !important;
}

.agenda-list-card.card-status-concluido {
  background: rgba(34, 197, 94, 0.09);
  border-color: rgba(34, 197, 94, 0.25);
}

.agenda-list-card.card-status-em_atendimento {
  background: rgba(245, 158, 11, 0.09);
  border-color: rgba(245, 158, 11, 0.25);
}

.agenda-list-card.card-status-agendado {
  background: rgba(59, 130, 246, 0.09);
  border-color: rgba(59, 130, 246, 0.25);
}

.agenda-list-card.card-status-cancelado {
  background: rgba(239, 68, 68, 0.09);
  border-color: rgba(239, 68, 68, 0.25);
  opacity: 0.7;
}

.agenda-time-pill {
  font-family: var(--font-family-mono);
  font-weight: 700;
  font-size: 0.85rem;
  color: #ffffff;
  min-width: 100px;
}

.agenda-client-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: #ffffff;
}

.agenda-service-info {
  font-size: 0.8rem;
  color: #94a3b8;
}

/* ==========================================================================
   MODO GRADE DETALHADA
   ========================================================================== */
.agenda-grid-card {
  background: #161f2e;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-lg);
  padding: 16px;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.2s ease;
}

.agenda-grid-card:hover {
  transform: translateY(-2px);
  border-color: rgba(59, 130, 246, 0.4);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
}

.agenda-grid-card.card-status-concluido {
  background: rgba(34, 197, 94, 0.07);
  border-color: rgba(34, 197, 94, 0.25);
}

/* ==========================================================================
   MODO SEMANA (VISÃO EM COLUNAS DOS 7 DIAS)
   ========================================================================== */
.week-view-wrapper {
  background: #111827;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
}

.week-columns-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(210px, 1fr));
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.week-column {
  background: #161f2e;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  min-height: 480px;
  transition: all 0.2s ease;
}

.week-column.day-today {
  border-color: rgba(212, 175, 55, 0.6);
  background: #182334;
}

.week-column.day-selected {
  border-color: #3b82f6 !important;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.25);
}

.week-column-header {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(15, 23, 42, 0.5);
  border-top-left-radius: var(--radius-md);
  border-top-right-radius: var(--radius-md);
}

.week-column-body {
  padding: 8px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 600px;
  overflow-y: auto;
}

.week-appointment-card {
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-left: 3px solid #3b82f6;
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  transition: all 0.2s ease;
}

.week-appointment-card:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.week-appointment-card.card-status-em_atendimento {
  border-left-color: #f59e0b;
}

.week-appointment-card.card-status-concluido {
  border-left-color: #10b981;
}

.week-appointment-card.card-status-cancelado {
  border-left-color: #ef4444;
  opacity: 0.6;
}

.week-block-card {
  background: rgba(239, 68, 68, 0.08);
  border: 1px dashed rgba(239, 68, 68, 0.3);
  border-radius: var(--radius-sm);
  padding: 6px 8px;
  font-size: 0.75rem;
  color: #fca5a5;
}

/* ==========================================================================
   RESPONSIVIDADE AVANÇADA PARA SMARTPHONES & DISPOSITIVOS MÓVEIS (MOBILE-FIRST)
   ========================================================================== */
@media (max-width: 768px) {
  /* Tipografia Geral em Telas Menores */
  h1, .h1 { font-size: 1.5rem !important; }
  h2, .h2 { font-size: 1.25rem !important; }
  h3, .h3 { font-size: 1.1rem !important; }
  h4, .h4 { font-size: 1rem !important; }

  /* Barra de Alternância de Visualizações (View Switcher) com Scroll Suave */
  .view-switcher-bar {
    width: 100%;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 3px;
    justify-content: flex-start;
  }
  .view-switcher-bar::-webkit-scrollbar {
    display: none;
  }
  .btn-view-mode {
    padding: 6px 10px;
    font-size: 0.75rem;
    flex-shrink: 0;
  }

  /* Filtros Rápidos por Status */
  #filtros-status-agenda,
  #filtros-status-atendimentos {
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    flex-wrap: nowrap !important;
    padding-bottom: 4px;
  }
  #filtros-status-agenda::-webkit-scrollbar,
  #filtros-status-atendimentos::-webkit-scrollbar {
    display: none;
  }
  #filtros-status-agenda .btn,
  #filtros-status-atendimentos .btn {
    flex-shrink: 0;
    font-size: 0.725rem;
    padding: 4px 10px;
  }

  /* Cards de KPIs (Métricas da Agenda e Dashboard) */
  .agenda-kpi-grid .col,
  .row-cols-1.row-cols-sm-2.row-cols-md-3.row-cols-xl-5 .col {
    width: 50% !important;
  }
  .agenda-kpi-grid .col:last-child,
  .row-cols-1.row-cols-sm-2.row-cols-md-3.row-cols-xl-5 .col:last-child {
    width: 100% !important;
  }

  .card-custom .font-mono.h3,
  .card-custom .font-mono.display-6,
  .card-custom .font-mono.h2 {
    font-size: 1.25rem !important;
  }

  /* Modo Lista: Card de Atendimento Sem Sobreposição */
  .agenda-list-card {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
    padding: 12px 14px !important;
  }

  .agenda-time-pill {
    min-width: unset !important;
    font-size: 0.8rem !important;
  }

  .agenda-client-name {
    font-size: 0.9rem !important;
    white-space: normal !important;
    word-break: break-word !important;
  }

  .agenda-service-info {
    font-size: 0.75rem !important;
    white-space: normal !important;
    word-break: break-word !important;
  }

  /* Modo Calendário Mensal */
  .calendar-month-wrapper {
    padding: 0.875rem !important;
  }
  .calendar-week-headers {
    gap: 2px !important;
    margin-bottom: 4px !important;
  }
  .calendar-week-header {
    font-size: 0.65rem !important;
    padding: 2px 0 !important;
  }
  .calendar-days-grid {
    gap: 3px !important;
  }
  .calendar-day-cell {
    min-height: 58px !important;
    padding: 4px 4px !important;
  }
  .day-number {
    font-size: 0.725rem !important;
  }
  .day-count-badge {
    font-size: 0.6rem !important;
    padding: 1px 3px !important;
  }
  .status-dot {
    width: 5px !important;
    height: 5px !important;
  }
  .calendar-legend-bar {
    font-size: 0.7rem !important;
    gap: 8px 12px !important;
  }

  /* Modo Semana: Colunas com Scroll Suave */
  .week-view-wrapper {
    padding: 0.875rem !important;
  }
  .week-columns-grid {
    grid-template-columns: repeat(7, minmax(180px, 1fr)) !important;
    gap: 8px !important;
  }
  .week-column {
    min-height: 380px !important;
  }
  .week-column-header {
    padding: 8px 10px !important;
  }
  .week-appointment-card {
    padding: 6px 8px !important;
  }

  /* Botões e Ações Rápidas no Topo */
  .agenda-top-actions {
    width: 100% !important;
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
  }
  .agenda-top-actions .btn {
    flex: 1 1 auto !important;
    font-size: 0.75rem !important;
    padding: 6px 8px !important;
    text-align: center !important;
    justify-content: center !important;
  }
}

@media (max-width: 576px) {
  /* Em telas muito estreitas (< 576px) */
  .container-fluid {
    padding-left: 10px !important;
    padding-right: 10px !important;
  }

  .agenda-kpi-grid .col,
  .row-cols-1.row-cols-sm-2.row-cols-md-3.row-cols-xl-5 .col {
    width: 50% !important;
    padding-left: 4px !important;
    padding-right: 4px !important;
  }
  .agenda-kpi-grid .col:last-child,
  .row-cols-1.row-cols-sm-2.row-cols-md-3.row-cols-xl-5 .col:last-child {
    width: 100% !important;
  }

  .card-custom.p-3 {
    padding: 10px !important;
  }

  /* Modal de Encaixe e Bloqueio adaptado ao toque */
  .modal-dialog {
    margin: 0.5rem !important;
  }
  .modal-content {
    border-radius: var(--radius-md) !important;
  }
}

/* ==========================================================================
   MODO DE PRIVACIDADE FINANCEIRA (OCULTAÇÃO DE VALORES & CONFIRMAÇÃO POR SENHA)
   ========================================================================== */
.btn-privacy-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: #1e293b;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #94a3b8;
  padding: 6px 12px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
}

.btn-privacy-toggle:hover {
  color: #ffffff;
  background: #253347;
  border-color: rgba(255, 255, 255, 0.25);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Estado Ativo: Valores Ocultos */
body.privacy-mode-active .btn-privacy-toggle {
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.5);
  color: #fbbf24;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.2);
}

body.privacy-mode-active .privacy-sensitive {
  filter: blur(8px) !important;
  user-select: none !important;
  -webkit-user-select: none !important;
  pointer-events: none !important;
  transition: filter 0.25s ease !important;
}

/* Modal de Confirmação de Senha de Privacidade */
#modalConfirmarSenhaPrivacidade .modal-content {
  background: #161f2e;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
}

#modalConfirmarSenhaPrivacidade .modal-header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

#modalConfirmarSenhaPrivacidade .modal-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}