* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

body {
  display: flex;
  min-height: 100vh;
  background-color: #f8f9fa;
  color: #333;
}

/* Sidebar / Menu Lateral */
.sidebar {
  width: 250px;
  background-color: #1f1f1f;
  color: #ffffff;
  padding: 30px 20px;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.profile-container {
  text-align: center;
  margin-bottom: 40px;
}

.profile-avatar {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  border: 3px solid #ffc107;
  margin: 0 auto 12px;
  background-color: #333;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  color: #ffc107;
  overflow: hidden;
}

.profile-name {
  font-size: 18px;
  font-weight: 600;
  color: #ffc107;
}

.nav-menu {
  list-style: none;
}

.nav-item {
  margin-bottom: 15px;
  border-bottom: 1px solid #333;
  padding-bottom: 10px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 15px;
  color: #b0b0b0;
  text-decoration: none;
  font-size: 15px;
  transition: all 0.2s ease;
  padding: 8px 5px;
}

.nav-link:hover,
.nav-link.active {
  color: #ffffff;
}

.nav-link i {
  font-size: 16px;
  width: 20px;
}

.nav-financeiro {
  position: relative;
  padding-bottom: 0;
}

.nav-financeiro-toggle {
  width: 100%;
  border: 0;
  background: transparent;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
}

.nav-financeiro-chevron {
  margin-left: auto;
  font-size: 11px !important;
  transition: transform 0.2s ease;
}

.nav-financeiro.is-open .nav-financeiro-chevron {
  transform: rotate(180deg);
}

.nav-financeiro-submenu {
  display: none;
  list-style: none;
  padding: 0 0 8px 40px;
}

.nav-financeiro.is-open .nav-financeiro-submenu {
  display: block;
}

.nav-financeiro-submenu a {
  display: block;
  padding: 7px 5px;
  color: #b0b0b0;
  text-decoration: none;
  font-size: 13px;
}

.nav-financeiro-submenu a:hover,
.nav-financeiro-submenu a.active {
  color: #ffc107;
}

/* Main Content / Conteúdo Principal */
.main-content {
  flex: 1;
  padding: 40px;
  display: flex;
  gap: 30px;
  overflow-y: auto;
  align-items: flex-start;
}

.dashboard-left {
  flex: 1;
  min-width: 0;
}

.welcome-header h1 {
  font-size: 32px;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 5px;
}

.welcome-header p {
  color: #666;
  font-size: 15px;
  margin-bottom: 30px;
}

/* Cards de Métricas */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 35px;
}

.dashboard-financeiro-cards {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.card {
  border-radius: 20px;
  padding: 25px 20px;
  text-align: center;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 140px;
}

.dashboard-financeiro-cards .card {
  min-height: 124px;
  padding: 18px 12px;
  border-radius: 15px;
  text-align: left;
}

.dashboard-financeiro-cards .card-title {
  min-height: 30px;
  font-size: 16px;
}

.dashboard-financeiro-cards .card-value.dashboard-kpi-value {
  margin-top: 6px;
  overflow-wrap: anywhere;
  font-size: clamp(19px, 1.8vw, 26px);
  line-height: 1.2;
}

.dashboard-kpi-caption {
  margin-top: 5px;
  color: inherit;
  font-size: 13px;
  opacity: 0.72;
}

.dashboard-erro:not([hidden]) {
  margin: 8px 0 0;
  color: #a32626;
  font-size: 13px;
}

.card-dark {
  background: linear-gradient(145deg, #2a2a2a, #1a1a1a);
  color: #ffffff;
}

.card-yellow {
  background-color: #ffc107;
  color: #1a1a1a;
}

.card-title {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
}

.card-dark .card-title span {
  color: #888;
}

.card-value {
  font-size: 38px;
  font-weight: bold;
  margin-top: 10px;
}

/* Área do Gráfico */
.chart-section {
  background-color: #ffffff;
  border-radius: 20px;
  padding: 20px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  border: 1px solid #eaeaea;
}

.section-title h2 {
  font-size: 18px;
  font-weight: 700;
  color: #1a1a1a;
}

.section-title p {
  font-size: 12px;
  color: #777;
  margin-bottom: 15px;
}

.chart-container {
  position: relative;
  height: 260px;
  width: 100%;
}

.dashboard-graficos {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 1fr);
  align-items: start;
  gap: 16px;
}

.dashboard-graficos .chart-section {
  min-width: 0;
  padding: 18px;
  border-radius: 16px;
}

.dashboard-graficos .chart-container {
  height: 270px;
}

/* Painel Direito - Agendamentos de Hoje */
.dashboard-right {
  width: 270px;
  flex-shrink: 0;
}

.appointments-panel {
  background-color: #ffffff;
  border-radius: 25px;
  padding: 18px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
  display: flex;
  flex-direction: column;
  height: min(620px, calc(100vh - 80px));
  min-height: 320px;
  position: sticky;
  top: 40px;
}

.appointments-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 18px;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 14px;
  text-align: left;
}

.appointments-title small {
  display: inline-flex;
  min-width: 25px;
  height: 25px;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  border-radius: 20px;
  background: #fff2c2;
  color: #755800;
  font-size: 11px;
}

.appointments-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  flex: 1;
  padding-right: 5px;
}

.appointment-item {
  background-color: #f7eedd;
  border-radius: 12px;
  padding: 10px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  font-size: 12px;
  color: #2a2a2a;
}

.appointment-time {
  color: #555;
  font-weight: 500;
}

.btn-add {
  background-color: #ffc107;
  color: #1a1a1a;
  border: none;
  border-radius: 12px;
  padding: 10px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  margin-top: 15px;
  transition: background-color 0.2s ease;
  width: 100%;
}

.btn-add:hover {
  background-color: #e0a800;
}

/* Modal para Adicionar Agendamento */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-content {
  background-color: #fff;
  padding: 25px;
  border-radius: 15px;
  width: 320px;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.modal-content h3 {
  font-size: 18px;
  color: #1a1a1a;
}

.modal-content input,
.modal-content select {
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 8px;
  outline: none;
  font-size: 14px;
}

.servicos-multiplos {
  min-width: 0;
  border: 0;
  padding: 0;
}

.servicos-multiplos legend {
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 600;
}

.servicos-opcoes {
  display: grid;
  gap: 8px;
  max-height: 160px;
  overflow-y: auto;
  padding: 9px;
  border: 1px solid #ccc;
  border-radius: 6px;
}

.servico-opcao {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-size: 13px;
  line-height: 1.35;
  cursor: pointer;
}

.servico-opcao input[type="checkbox"] {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  margin: 0;
  padding: 0;
  accent-color: #ffc107;
}

.servico-opcao span {
  overflow-wrap: anywhere;
}

.modal-content .servicos-opcoes {
  max-height: 130px;
  background: #fff;
}

.modal-content .servico-opcao {
  color: #333;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.btn-cancel {
  background: #ccc;
  border: none;
  padding: 8px 15px;
  border-radius: 8px;
  cursor: pointer;
}

.btn-save {
  background: #ffc107;
  border: none;
  padding: 8px 15px;
  border-radius: 8px;
  font-weight: bold;
  cursor: pointer;
}

/* ==========================================================
   Pagina Agendamentos
========================================================== */

.conteudo-agendamento {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.agendamento-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  align-items: flex-start;
}

.calendario {
  flex: 2 1 460px;
  min-width: 320px;
  max-width: 100%;
  min-height: 530px;
  padding: 14px 19px 9px;
  background-color: #1c1714;
  border: 1px solid #332d29;
  border-radius: 12px;
  color: #f2f2f2;
  display: flex;
  flex-direction: column;
}

.calendario-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 16px;
}

.calendario-header h2 {
  color: #ffc107;
  font-size: 19px;
  font-weight: 700;
}

.calendario-header .contador {
  color: #999;
  font-size: 13px;
}

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

.calendario-grid .day-name {
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #ffc107;
  padding-bottom: 8px;
}

.day-cell {
  position: relative;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #ffc107;
  color: #1a1a1a;
  font-weight: 700;
  font-size: 14px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: filter 0.12s;
}
.day-cell.past {
  color: #b8b8b8;
  background: #f1f1f1;
  opacity: 0.7;
}

.day-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 50%;
  background-color: #1a1a1a;
  color: #ffc107;
  font-size: 10.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  box-shadow: 0 0 0 2px #f8f9fa;
}

.day-cell:hover {
  filter: brightness(1.08);
}

.day-cell.past:hover {
  filter: brightness(1.03);
}

.dia-anterior::after {
  content: "Visualização: novos agendamentos estão bloqueados";
  display: block;
  margin-top: 8px;
  color: #999;
  font-size: 12px;
}

.day-cell.empty {
  background: transparent;
  cursor: default;
}

.day-cell.selected {
  background-color: #4a3d10;
  color: #ffc107;
  box-shadow: inset 0 0 0 2px #ffc107;
}

.coluna-lateral {
  display: flex;
  flex-direction: column;
  gap: 20px;
  flex: 1 1 280px;
  min-width: 260px;
  max-width: 100%;
}

.seletor-agenda-barbeiro {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 16px;
  background: #1c1714;
  border: 1px solid #ffc107;
  border-radius: 10px;
}

.seletor-agenda-barbeiro label {
  color: #f2f2f2;
  font-size: 14px;
  font-weight: 600;
}

.seletor-agenda-barbeiro select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ffc107;
  border-radius: 6px;
  background: #241e19;
  color: #f2f2f2;
}

.seletor-agenda-barbeiro p {
  color: #b8ada5;
  font-size: 12px;
  line-height: 1.4;
}

.novo-agendamento {
  display: flex;
  flex-direction: column;
  width: auto;
  height: auto;
  padding: 20px;
  background-color: #1c1714;
  border: 1px solid #332d29;
  border-radius: 12px;
  color: #f2f2f2;
}

.novo-agendamento h3 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 2px;
}

.novo-agendamento .subtitulo {
  color: #999;
  font-size: 13px;
  margin-bottom: 16px;
}

.campo {
  margin-bottom: 14px;
}

.campo label {
  display: block;
  font-size: 12.5px;
  color: #d8d8d8;
  margin-bottom: 6px;
}

.campo.servicos-multiplos legend {
  color: #d8d8d8;
}

.campo.servicos-multiplos .servicos-opcoes {
  border-color: #ffc107;
  background: #1c1714;
}

.campo.servicos-multiplos .servico-opcao {
  display: flex;
  margin: 0;
  color: #f2f2f2;
}

.campo input,
.campo select {
  width: 100%;
  background-color: #1c1714;
  border: 1px solid #ffc107;
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 14px;
  color: #f2f2f2;
  outline: none;
}

.campo input:focus,
.campo select:focus {
  box-shadow: 0 0 0 2px #ffc107;
}

.campo-linha {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.btn-agendar {
  width: 100%;
  background-color: #ffc107;
  color: #1a1a1a;
  border: none;
  border-radius: 8px;
  padding: 12px;
  font-size: 14.5px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.btn-agendar:hover {
  background-color: #e0a800;
}

/* Pagina de servicos */
.servicos-page {
  width: 100%;
}

.servicos-panel {
  width: min(100%, 1050px);
  margin: 34px auto 0;
  padding: 30px 22px 40px;
  background: #fff;
  border: 1px solid #c8c8c8;
  border-radius: 34px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.22);
}

.servicos-toolbar {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 0 20px 38px;
}

.servicos-search {
  position: relative;
  flex: 1;
}

.servicos-search input {
  width: 100%;
  height: 32px;
  padding: 0 38px 0 14px;
  border: 1px solid #aaa;
  border-radius: 8px;
  outline: none;
  font-size: 12px;
}

.servicos-search input:focus {
  border-color: #ffc107;
  box-shadow: 0 0 0 2px rgba(255, 193, 7, 0.2);
}

.servicos-search i {
  position: absolute;
  top: 9px;
  right: 12px;
  color: #888;
}

.btn-servico-principal {
  height: 32px;
  padding: 0 16px;
  border: 0;
  border-radius: 8px;
  background: #1f1f1f;
  color: #fff;
  font-size: 12px;
  cursor: pointer;
}

.btn-servico-principal i {
  margin-right: 14px;
  color: #fff;
}

.btn-servico-principal:hover {
  background: #3a3a3a;
}

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

.servicos-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.servicos-table th {
  padding: 12px 20px;
  background: #ffc321;
  color: #111;
  text-align: left;
  font-size: 12px;
  font-weight: 700;
}

.servicos-table th:first-child {
  border-radius: 8px 0 0 8px;
}

.servicos-table th:last-child {
  border-radius: 0 8px 8px 0;
}

.servicos-table td {
  height: 52px;
  padding: 9px 20px;
  border-bottom: 1px solid #aaa;
  color: #171717;
}

.servico-nome-tabela {
  font-weight: 600;
}

.servico-acoes {
  width: 100px;
  white-space: nowrap;
  text-align: right;
}

.btn-icone-servico {
  padding: 5px 8px;
  border: 0;
  background: transparent;
  color: #111;
  cursor: pointer;
  font-size: 16px;
}

.btn-icone-servico:hover {
  color: #b07d00;
}

.btn-excluir-servico:hover {
  color: #c62828;
}

.btn-excluir-barbeiro:hover {
  color: #c62828;
}

.servicos-vazio {
  padding: 28px 10px 4px;
  color: #777;
  text-align: center;
  font-size: 13px;
}

.servico-modal-content {
  width: min(430px, calc(100vw - 32px));
}

.campo-servico {
  margin-bottom: 14px;
}

.campo-servico label {
  display: block;
  margin-bottom: 6px;
  color: #333;
  font-size: 13px;
}

.campo-servico input {
  width: 100%;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 7px;
  font-size: 14px;
}

.campo-servico-linha {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.servico-form-erro {
  min-height: 18px;
  color: #c62828;
  font-size: 13px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.agenda-do-dia {
  padding: 20px;
  background-color: #1c1714;
  border: 1px solid #332d29;
  border-radius: 12px;
  color: #f2f2f2;
}

.agenda-do-dia h3 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 14px;
}

.agenda-lista {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.agenda-vazia {
  text-align: center;
  color: #999;
  font-size: 13.5px;
  padding: 12px 0;
}

.agenda-item {
  background-color: #262019;
  border-radius: 8px;
  padding: 10px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13.5px;
}

.agenda-item .horario {
  color: #ffc107;
  font-weight: 700;
  margin-right: 8px;
}

.agenda-item-conteudo {
  min-width: 0;
}

.agenda-item-nome {
  display: inline-block;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: bottom;
}

.agenda-item-detalhes {
  color: #999;
  font-size: 12px;
  margin-top: 4px;
}

.agenda-item-acoes {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: 10px;
  flex-shrink: 0;
}

.status-select,
.btn-acao-agendamento {
  border: 1px solid #5a4a32;
  border-radius: 5px;
  padding: 6px 8px;
  font-size: 12px;
}

.status-select {
  background: #1c1714;
  color: #ffc107;
}

.btn-acao-agendamento {
  background: transparent;
  color: #f2f2f2;
  cursor: pointer;
}

.btn-acao-agendamento:hover {
  border-color: #ffc107;
  color: #ffc107;
}

.btn-excluir-agendamento:hover {
  border-color: #e57373;
  color: #e57373;
}

.modal-edicao-content {
  width: min(420px, calc(100vw - 32px));
}

.modal-edicao-content .campo input,
.modal-edicao-content .campo select {
  color: #333;
  background: #fff;
  border-color: #ccc;
}

/* ==========================================================
   Responsividade geral (sidebar + conteúdo)
========================================================== */

@media (max-width: 900px) {
  body {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    overflow-x: auto;
  }

  .profile-container {
    margin-bottom: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
  }

  .profile-avatar {
    width: 44px;
    height: 44px;
    font-size: 20px;
    margin: 0;
  }

  .profile-name {
    font-size: 14px;
  }

  .nav-menu {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
  }

  .nav-item {
    margin-bottom: 0;
    border-bottom: none;
    padding-bottom: 0;
  }

  .nav-financeiro-submenu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 20;
    min-width: 145px;
    padding: 8px;
    border: 1px solid #3a3a3a;
    border-radius: 8px;
    background: #1f1f1f;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
  }

  .nav-financeiro-submenu a {
    font-size: 13px;
  }

  .nav-link {
    padding: 8px;
    font-size: 0;
    gap: 0;
  }

  .nav-link i {
    font-size: 18px;
  }

  .main-content {
    padding: 24px 20px;
    flex-direction: column;
  }

  .dashboard-right {
    width: 100%;
  }

  .dashboard-financeiro-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-graficos {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .appointments-panel {
    height: auto;
    position: static;
    max-height: 380px;
  }

  .calendario {
    min-height: auto;
    padding: 14px;
  }

  .day-cell {
    font-size: 12px;
    border-radius: 6px;
  }
}

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

  .dashboard-graficos {
    grid-template-columns: 1fr;
  }

  .campo-linha {
    grid-template-columns: 1fr;
  }

  .calendario-grid {
    gap: 5px;
  }

  .calendario-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .welcome-header h1 {
    font-size: 24px;
  }

  .modal-content {
    width: 90%;
  }
}
