/* ==========================================================================
   Booking Schedule – Dark Theme + Sticky Header
   ========================================================================== */

/* ----- Design Tokens (Dark Theme) – existing schedule variables ----- */
:root {
  --bg: #020617;
  --panel: #1e293b;
  --panel-dark: #0f172a;
  --text: #cbd5e1;
  --text-muted: #94a3b8;
  --text-subtle: #64748b;
  --border: #334155;
  --border-faint: #1e293b;

  --accent: #34d399;
  --accent-bg: #059669;
  --accent-light: #6ee7b7;
  --accent-soft: rgba(16, 185, 129, 0.1);
  --accent-border: rgba(16, 185, 129, 0.2);

  --danger: #dc2626;
  --danger-light: #f87171;
  --danger-soft: rgba(220, 38, 38, 0.1);
  --danger-border: rgba(220, 38, 38, 0.2);

  --warning: #f59e0b;
  --warning-light: #fcd34d;
  --warning-soft: rgba(245, 158, 11, 0.1);
  --warning-border: rgba(245, 158, 11, 0.2);

  --info: #3b82f6;
  --info-light: #93c5fd;
  --info-soft: rgba(59, 130, 246, 0.1);
  --info-border: rgba(59, 130, 246, 0.2);
}

/* ==========================================================================
   Navigation Bar – Light Theme (overrides only where necessary)
   ========================================================================== */
.cwbiznez-nav {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(8px);
  /* position: sticky; */
  top: 0;
  z-index: 50;
  border-bottom: 1px solid #f0f0f0;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}
* {
  font-family: "Noto Sans", sans-serif;
}
.cwbiznez-nav-container {
  max-width: 80rem;
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 4rem; /* 64px */
}

.cwbiznez-nav-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.cwbiznez-nav-logo-icon {
  width: 2rem;
  height: 2rem;
  color: #4f46e5;
}

.cwbiznez-nav-brand {
  font-size: 1.25rem;
  font-weight: 700;
  background: linear-gradient(90deg, #4f46e5, #7c3aed);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.cwbiznez-nav-desktop {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.cwbiznez-nav-link {
  color: #4b5563;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.2s;
}

.cwbiznez-nav-link:hover {
  color: #4f46e5;
}

.cwbiznez-nav-cta {
  background: #4f46e5;
  color: white;
  padding: 0.5rem 1.25rem;
  border-radius: 9999px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s;
  box-shadow: 0 2px 4px rgba(79, 70, 229, 0.2);
}

.cwbiznez-nav-cta:hover {
  background: #4338ca;
}

/* Mobile toggle button */
.cwbiznez-nav-mobile-toggle {
  display: none;
  background: none;
  border: none;
  padding: 0.5rem;
  color: #4b5563;
  cursor: pointer;
}

.cwbiznez-nav-mobile-icon {
  width: 1.5rem;
  height: 1.5rem;
}

/* Mobile menu */
.cwbiznez-nav-mobile {
  display: none;
  background: white;
  border-top: 1px solid #f0f0f0;
  padding: 0.5rem 1rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.cwbiznez-nav-mobile-link {
  display: block;
  padding: 0.5rem 0.75rem;
  color: #4b5563;
  font-weight: 500;
  text-decoration: none;
  border-radius: 0.5rem;
  transition: background 0.2s;
}

.cwbiznez-nav-mobile-link:hover {
  background: #f3f4f6;
}

.cwbiznez-nav-mobile-cta {
  display: block;
  background: #4f46e5;
  color: white;
  padding: 0.75rem;
  border-radius: 0.75rem;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  margin-top: 0.5rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Responsive: show mobile button, hide desktop links */
@media (max-width: 768px) {
  .cwbiznez-nav-desktop {
    display: none;
  }

  .cwbiznez-nav-mobile-toggle {
    display: block;
  }
}

/* ==========================================================================
   Schedule Styles (unchanged from original)
   ========================================================================== */
/* ... (all existing schedule CSS remains exactly the same) ... */
/* ==========================================================================
   Booking Schedule – Dark Theme + Sticky Header
   ========================================================================== */

/* ----- Design Tokens (Dark Theme) ----- */
:root {
  --bg: #020617;
  --panel: #1e293b;
  --panel-dark: #0f172a;
  --text: #cbd5e1;
  --text-muted: #94a3b8;
  --text-subtle: #64748b;
  --border: #334155;
  --border-faint: #1e293b;

  --accent: #34d399;
  --accent-bg: #059669;
  --accent-light: #6ee7b7;
  --accent-soft: rgba(16, 185, 129, 0.1);
  --accent-border: rgba(16, 185, 129, 0.2);

  --danger: #dc2626;
  --danger-light: #f87171;
  --danger-soft: rgba(220, 38, 38, 0.1);
  --danger-border: rgba(220, 38, 38, 0.2);

  --warning: #f59e0b;
  --warning-light: #fcd34d;
  --warning-soft: rgba(245, 158, 11, 0.1);
  --warning-border: rgba(245, 158, 11, 0.2);

  --info: #3b82f6;
  --info-light: #93c5fd;
  --info-soft: rgba(59, 130, 246, 0.1);
  --info-border: rgba(59, 130, 246, 0.2);
}

/* ----- Main Container ----- */
.cwbiznez-schedule {
  max-width: 80rem;
  margin: 0 auto;
  padding: 2rem 1rem;
  background: var(--bg);
  color: var(--text);
  font-family: "Noto Sans", sans-serif;
}

.cwbiznez-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 1.5rem;
}

/* ----- Wrapper (substitui .cwbiznez-table) ----- */
.cwbiznez-table-wrapper {
  border: 1px solid var(--border-faint);
  border-radius: 0.5rem;
  overflow: hidden; /* mantém cantos arredondados */
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  background: var(--panel-dark);
}

/* ----- Cabeçalho (sticky) ----- */
.cwbiznez-table-header {
  display: grid;
  grid-template-columns: 5rem repeat(7, minmax(0, 1fr));
  position: sticky;
  top: 0;
  z-index: 10;
  background-color: var(--panel);
  border-bottom: 1px solid var(--border);
}

/* As células do cabeçalho agora ficam diretamente dentro do grid sticky */
.cwbiznez-grid-header {
  display: contents; /* preserva a estrutura, mas as células são filhos do grid acima */
}

.cwbiznez-grid-time-header,
.cwbiznez-grid-day-header {
  padding: 0.75rem 0.25rem;
  text-align: center;
  font-weight: 600;
  color: var(--text);
  border-right: 1px solid var(--border);
}

.cwbiznez-grid-time-header:last-child,
.cwbiznez-grid-day-header:last-child {
  border-right: none;
}

/* ----- Corpo da tabela ----- */
.cwbiznez-table-body {
  display: grid;
  grid-template-columns: 5rem repeat(7, minmax(0, 1fr));
  background: var(--panel-dark);
}

/* Linhas do corpo */
.cwbiznez-grid-row {
  display: contents;
}

.cwbiznez-grid-time {
  padding: 0;
  text-align: center;
  font-size: 0.875rem;
  font-weight: 500;
  background-color: var(--panel);
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
  color: var(--text-muted);
}

/* Células de slot */
.cwbiznez-grid-slot {
  padding: 0.25rem;
  text-align: center;
  border-bottom: 1px solid var(--border-faint);
  border-right: 1px solid var(--border-faint);
  min-height: 1rem;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  flex-wrap: nowrap;
  align-content: center;
}

/* Remove borda direita da última coluna (opcional) */
.cwbiznez-grid-slot:nth-child(8n),
.cwbiznez-grid-time:nth-child(8n) {
  border-right: none;
}

/* ----- Disponível (label) ----- */
.cwbiznez-slot-label {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-height: 1rem;
  padding: 0;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 0.25rem;
  cursor: pointer;
  background: var(--accent-soft);
  color: var(--accent-light);
  border: 1px solid var(--accent-border);
  transition:
    background 0.2s,
    color 0.2s;
}

.cwbiznez-slot-label:hover {
  background: var(--accent);
  color: var(--bg);
}

/* Selecionado */
.cwbiznez-slot-label.cwbiznez-slot-selected {
  background: rgb(255 229 96 / 87%);
  color: var(--warning-light);
  border: 1px solid var(--warning-border);
}

.cwbiznez-slot-label input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  margin: 0;
  pointer-events: none;
}

/* ----- Ocupado (outros) ----- */
.cwbiznez-slot-occupied {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0.5rem 0.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 0.25rem;
  background: var(--danger-soft);
  color: var(--danger-light);
  border: 1px solid var(--danger-border);
  cursor: not-allowed;
}

/* ----- Próprio (amarelo) ----- */
.cwbiznez-slot-own {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 2.5rem;
  padding: 0.5rem 0.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 0.25rem;
  background: var(--warning-soft);
  color: var(--warning-light);
  border: 1px solid var(--warning-border);
  cursor: default;
}

/* ----- Nota do admin ----- */
.cwbiznez-slot-note {
  margin-top: 0.25rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  cursor: help;
  border-bottom: 1px dotted var(--border);
}

/* ----- Link "Liberar" ----- */
.cwbiznez-free-slot {
  display: inline-block;
  margin-top: 0.25rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--danger-light);
  background: var(--danger-soft);
  border: 1px solid var(--danger-border);
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  text-decoration: none;
  transition: background 0.2s;
}

.cwbiznez-free-slot:hover {
  background: var(--danger);
  color: var(--bg);
}

/* ----- Botão "Adicionar Nota" ----- */
.cwbiznez-add-note-btn {
  display: inline-block;
  margin-top: 0.25rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--info-light);
  background: var(--info-soft);
  border: 1px solid var(--info-border);
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  cursor: pointer;
  transition: background 0.2s;
}

.cwbiznez-add-note-btn:hover {
  background: var(--info);
  color: var(--bg);
}

/* ----- Formulário de nota inline ----- */
.cwbiznez-note-form {
  margin-top: 0.5rem;
  width: 100%;
  text-align: left;
}

.cwbiznez-note-form textarea {
  width: 100%;
  padding: 0.25rem;
  font-size: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 0.25rem;
  resize: vertical;
  box-sizing: border-box;
  background: var(--panel);
  color: var(--text);
}

.cwbiznez-note-form-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.25rem;
  justify-content: flex-end;
}

.cwbiznez-note-form-actions .cwbiznez-btn {
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
}

/* ----- Botões gerais ----- */
.cwbiznez-btn {
  display: inline-block;
  font-weight: 600;
  padding: 0.5rem 1rem;
  border-radius: 0.25rem;
  border: none;
  cursor: pointer;
  transition:
    background 0.2s,
    color 0.2s;
}

.cwbiznez-btn-green {
  background: var(--accent-bg);
  color: #ffffff;
}

.cwbiznez-btn-green:hover {
  background: var(--accent);
  color: var(--bg);
}

.cwbiznez-form-actions {
  margin-top: 15px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.cwbiznez-price-info {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* ----- Alertas ----- */
.cwbiznez-success {
  background: var(--accent-soft);
  color: var(--accent-light);
  border: 1px solid var(--accent-border);
  padding: 1rem;
  border-radius: 0.25rem;
  margin-bottom: 1rem;
}

.cwbiznez-error {
  background: var(--danger-soft);
  color: var(--danger-light);
  border: 1px solid var(--danger-border);
  padding: 1rem;
  border-radius: 0.25rem;
  margin-bottom: 1rem;
}

/* Wrapper sem overflow hidden */
.cwbiznez-table-wrapper {
  border: 1px solid var(--border-faint);
  border-radius: 0.5rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  background: var(--panel-dark);
  /* Removido: overflow: hidden; */
}

/* Cabeçalho sticky com cantos arredondados superiores */
.cwbiznez-table-header {
  display: grid;
  grid-template-columns: 5rem repeat(7, minmax(0, 1fr));
  /* remova position: sticky, top, z-index */
  background-color: var(--panel);
  border-bottom: 1px solid var(--border);
}

/* Corpo com cantos inferiores arredondados */
.cwbiznez-table-body {
  display: grid;
  grid-template-columns: 5rem repeat(7, minmax(0, 1fr));
  background: var(--panel-dark);
  border-radius: 0 0 0.5rem 0.5rem; /* arredonda apenas a base */
}

div#cwbiznez-booking-root {
  background: var(--bg);
}

/* Admin direct booking button */
.cwbiznez-slot-admin-book {
    display: block;
    width: 100%;
    padding: 8px 4px;
    background: #4F46E5;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8em;
    transition: background 0.2s;
}

.cwbiznez-slot-admin-book:hover {
    background: #4338CA;
}

/* Admin direct booking button (available slots) */
.cwbiznez-slot-admin-book {
    display: block;
    width: 100%;
    padding: 8px 4px;
    background: #4F46E5;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8em;
    transition: background 0.2s;
}

.cwbiznez-slot-admin-book:hover {
    background: #4338CA;
}

/* Emoji note button */
.cwbiznez-add-note-btn.cwbiznez-note-emoji-btn {
    padding: 0.2rem 0.4rem;
    line-height: 1;
    font-size: 1rem;
    background: var(--info-soft);
    border: 1px solid var(--info-border);
    color: var(--info-light);
    border-radius: 0.25rem;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.cwbiznez-add-note-btn.cwbiznez-note-emoji-btn:hover {
    background: var(--info);
    color: #fff;
}

/* Unbook button (admin) – style overrides for button element */
.cwbiznez-free-slot.cwbiznez-unbook-btn {
    cursor: pointer;
    border: 1px solid var(--danger-border);
    background: var(--danger-soft);
    color: var(--danger-light);
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    transition: background 0.2s, color 0.2s;
}

.cwbiznez-free-slot.cwbiznez-unbook-btn:hover {
    background: var(--danger);
    color: #fff;
}

/* Modal de Nota */
.cwbiznez-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    flex-direction: column;
}

.cwbiznez-modal-content {
    background: var(--panel-dark, #0f172a);
    border: 1px solid var(--border, #334155);
    border-radius: 0.5rem;
    padding: 1.5rem;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
}

.cwbiznez-modal-title {
    color: var(--text, #cbd5e1);
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.cwbiznez-modal-textarea {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--border, #334155);
    border-radius: 0.25rem;
    background: var(--panel, #1e293b);
    color: var(--text, #cbd5e1);
    resize: vertical;
    min-height: 100px;
}

.cwbiznez-modal-actions {
    margin-top: 1rem;
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

.cwbiznez-btn {
    display: inline-block;
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: 0.25rem;
    border: none;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.cwbiznez-btn-green {
    background: var(--accent-bg, #059669);
    color: #ffffff;
}

.cwbiznez-btn-green:hover {
    background: var(--accent, #34d399);
    color: #0f172a;
}

.cwbiznez-btn {
    background: #334155;
    color: #cbd5e1;
}

.cwbiznez-btn:hover {
    background: #475569;
}