﻿:root {
  /* Light Mode - Paleta ultra-suave e confortável */
  --surface: #f8f9fa;
  --surface-muted: #f5f6f7;
  --border: #e5e7eb;
  --text: #4b5563;
  --muted: #7c8491;
  --primary: #6366f1;
  --sidebar-surface: #f3f4f6;
  --sidebar-border: #e5e7eb;
  --sidebar-text: #4b5563;
  --sidebar-muted: #7c8491;
  --sidebar-hover: #eceff1;
  --sidebar-active: #e0e7ff;
  --sidebar-active-border: #818cf8;
  /* Bootstrap variables */
  --bs-heading-color: #374151;
  --bs-body-color: #374151;
  --bs-body-bg: #f8f9fa;
  --bs-primary: #4f46e5;
  --bs-secondary: #6b7280;
  --bs-success: #10b981;
  --bs-info: #06b6d4;
  --bs-warning: #f59e0b;
  --bs-danger: #ef4444;
  --bs-light: #f8fafc;
  --bs-dark: #1e293b;
  --bs-border-color: #e2e8f0;
  --bs-border-color-translucent: rgba(0, 0, 0, 0.175);

  /* calendario */

  /* Texto */
  --cal-text: var(--text);                 /* texto principal do calendário */
  --cal-muted: var(--muted);               /* textos discretos (ex.: número do dia) */

  /* Superfícies/linhas */
  --cal-surface: var(--surface);           /* fundo do container do calendário */
  --cal-surface-2: var(--surface-muted);   /* cabeçalho dos dias (Dom, Seg, ...) */
  --cal-grid-bg: var(--surface-muted);     /* fundo “atrás” da grid (as linhas) */
  --cal-line: var(--border);               /* divisórias/bordas das células */

  /* Cabeçalho do calendário (barra com mês e botões) */
  --cal-header: var(--sidebar-surface);

  /* Células */
  --cal-day-bg: #1d2c4e;            /* dia normal */
  --cal-day-hover: var(--surface-muted);   /* hover do dia */
  --cal-day-out-bg: var(--surface-muted);  /* dias de outro mês */
  --cal-day-out-text: var(--muted);        /* texto dos dias de outro mês */

  /* Destaque “Hoje” (escolha 1: fundo sólido) */
  --cal-today-bg: var(--sidebar-active);   /* sólido para .day.today */
  /* Destaque “Hoje” (opção 2: wash/overlay + borda) */
  --cal-today-wash: rgba(59, 130, 246, .12); /* overlay leve */
  --cal-today-border: var(--primary);        /* borda do “hoje” */

  /* Acentos gerais do calendário (se quiser aplicar em botões/títulos locais) */
  --cal-accent: var(--primary);
  --cal-accent-contrast: #ffffff;

  
}

html.dark {
  /* Dark Mode - Paleta consistente com bom contraste */
  --surface: #0f172a;
  --surface-muted: #1e293b;
  --border: #334155;
  --text: #f1f5f9;
  --muted: #94a3b8;
  --primary: #3b82f6;
  --sidebar-surface: #1e293b;
  --sidebar-border: #475569;
  --sidebar-text: #f1f5f9;
  --sidebar-muted: #cbd5e1;
  --sidebar-hover: #334155;
  --sidebar-active: #1e40af;
  --sidebar-active-border: #60a5fa;
  /* Bootstrap variables */
  --bs-heading-color: #f1f5f9;
  --bs-body-color: #f1f5f9;
  --bs-body-bg: #0f172a;
  --bs-primary: #3b82f6;
  --bs-secondary: #94a3b8;
  --bs-success: #10b981;
  --bs-info: #06b6d4;
  --bs-warning: #f59e0b;
  --bs-danger: #ef4444;
  --bs-light: #1e293b;
  --bs-dark: #f1f5f9;
  --bs-border-color: #334155;
  --bs-border-color-translucent: rgba(255, 255, 255, 0.125);

  /* calendario */

  /* Texto */
  --cal-text: var(--text);                 /* texto principal do calendário */
  --cal-muted: var(--muted);               /* textos discretos (ex.: número do dia) */

  /* Superfícies/linhas */
  --cal-surface: var(--surface);           /* fundo do container do calendário */
  --cal-surface-2: var(--surface-muted);   /* cabeçalho dos dias (Dom, Seg, ...) */
  --cal-grid-bg: var(--surface-muted);     /* fundo “atrás” da grid (as linhas) */
  --cal-line: var(--border);               /* divisórias/bordas das células */

  /* Cabeçalho do calendário (barra com mês e botões) */
  --cal-header: var(--sidebar-surface);

  /* Células */
  --cal-day-bg: #1d2c4e;            /* dia normal */
  --cal-day-hover: var(--surface-muted);   /* hover do dia */
  --cal-day-out-bg: var(--surface-muted);  /* dias de outro mês */
  --cal-day-out-text: var(--muted);        /* texto dos dias de outro mês */

  /* Destaque “Hoje” (escolha 1: fundo sólido) */
  --cal-today-bg: var(--sidebar-active);   /* sólido para .day.today */
  /* Destaque “Hoje” (opção 2: wash/overlay + borda) */
  --cal-today-wash: rgba(59, 130, 246, .12); /* overlay leve */
  --cal-today-border: var(--primary);        /* borda do “hoje” */

  /* Acentos gerais do calendário (se quiser aplicar em botões/títulos locais) */
  --cal-accent: var(--primary);
  --cal-accent-contrast: #ffffff;

  
}
body { background:#f7f7f9; }
.card { border-radius:12px; }

/* Botão do tema - cores fixas para máxima visibilidade */
.theme-toggle-btn {
  background-color: #f3f4f6 !important;
  border: 1px solid #e5e7eb !important;
  color: #4b5563 !important;
  padding: 0.25rem 0.5rem !important;
  border-radius: 0.375rem !important;
  font-size: 0.875rem !important;
  line-height: 1.25rem !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 2rem !important;
  height: 2rem !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
}

.theme-toggle-btn:hover {
  background-color: #eceff1 !important;
  border-color: #e5e7eb !important;
}

.theme-icon {
  color: #6366f1 !important;
  font-size: 0.875rem !important;
}

/* Classe customizada para ícones do tema - independente do Bootstrap */
.icon-theme-size {
  font-size: 0.875rem !important;
  width: 1rem !important;
  height: 1rem !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}

html.dark .theme-toggle-btn {
  background-color: #1e293b !important;
  border-color: #334155 !important;
  color: #f1f5f9 !important;
}

html.dark .theme-toggle-btn:hover {
  background-color: #334155 !important;
}

/* ===== CALENDÃRIO SIMPLES ===== */
.calendar-container {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.calendar-header h4 {
  color: var(--text);
  font-weight: 600;
}

.calendar-grid {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 8px;
}

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  font-weight: 600;
  color: var(--muted);
  font-size: 0.875rem;
  text-align: center;
  padding: 8px 0;
}

.calendar-weekdays div {
  padding: 8px 4px;
}

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

.calendar-day {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px;
  background: white;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  position: relative;
  min-height: 80px;
}

.calendar-day:hover {
  background: var(--surface-muted);
  border-color: var(--border);
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.calendar-day.other-month {
  background: var(--surface-muted);
  color: var(--muted);
}

.calendar-day.today {
  background: rgba(37, 99, 235, 0.15);
  border-color: var(--primary);
  font-weight: 600;
}

.calendar-day.has-events {
  border-left: 3px solid var(--primary);
}

.day-number {
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 4px;
  text-align: left;
}

.day-events {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
}

.event-item {
  font-size: 11px;
  padding: 2px 4px;
  border-radius: 3px;
  display: flex;
  align-items: center;
  gap: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: white;
}

.event-more {
  font-size: 10px;
  color: var(--muted);
  font-style: italic;
  text-align: center;
  margin-top: 2px;
}

/* Cores dos status das OS */
.status-aberta { background: #ffc107; }
.status-em_andamento { background: #fdcb6e; }
.status-aguardando { background: #ffc107; }
.status-concluida { background: #28a745; }
.status-entregue { background: #20c997; }
.status-cancelada { background: #dc3545; }

/* Cores dos compromissos */
.appointment { background: var(--primary); }

.calendar-header h4 {
  color: var(--text);
  font-weight: 600;
}

.calendar-grid {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 8px;
}

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  font-weight: 600;
  color: var(--muted);
  font-size: 0.875rem;
  text-align: center;
  padding: 8px 0;
}

.calendar-weekdays div {
  padding: 8px 4px;
}

.calendar-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  width: 100%;
  box-sizing: border-box;
}

/* Fallback para navegadores que nÃ£o suportam CSS Grid */
@supports not (display: grid) {
  .calendar-days {
    display: flex;
    flex-wrap: wrap;
  }
  .calendar-day {
    width: calc(100% / 7 - 8px);
    margin-right: 8px;
    margin-bottom: 8px;
  }
  .calendar-day:nth-child(7n) {
    margin-right: 0;
  }
}

.calendar-day {
  aspect-ratio: 1;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px;
  background: white;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  position: relative;
  min-height: 80px;
}

.calendar-day:hover {
  background: var(--surface-muted);
  border-color: var(--border);
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.calendar-day.other-month {
  background: var(--surface-muted);
  color: var(--muted);
}

.calendar-day.today {
  background: rgba(37, 99, 235, 0.15);
  border-color: var(--primary);
  font-weight: 600;
}

.calendar-day.has-events {
  border-left: 3px solid var(--primary);
}

.day-number {
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 4px;
  text-align: right;
  color: inherit;
}

.day-events {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
}

.event-item {
  font-size: 0.75rem;
  padding: 2px 4px;
  border-radius: 3px;
  display: flex;
  align-items: center;
  gap: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.event-item i {
  font-size: 0.7rem;
  flex-shrink: 0;
}

.event-text {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
}

.event-more {
  font-size: 0.7rem;
  color: var(--muted);
  font-style: italic;
  text-align: center;
  margin-top: 2px;
}

/* Cores dos status das OS */
.service-order.aberta { background: #fff3cd; color: #856404; }
.service-order.em_andamento { background: #ffeaa7; color: #d63031; }
.service-order.aguardando { background: #fff3cd; color: #856404; }
.service-order.concluida { background: #d4edda; color: #155724; }
.service-order.entregue { background: #c3e6cb; color: #0f5132; }
.service-order.cancelada { background: #f8d7da; color: #721c24; }

/* Cores dos status das OS */
.status-aberta { background: #fff3cd; color: #856404; border-left: 3px solid #ffc107; }
.status-em_andamento { background: #ffeaa7; color: #d63031; border-left: 3px solid #fdcb6e; }
.status-aguardando { background: #fff3cd; color: #856404; border-left: 3px solid #ffc107; }
.status-concluida { background: #d4edda; color: #155724; border-left: 3px solid #28a745; }
.status-entregue { background: #c3e6cb; color: #0f5132; border-left: 3px solid #20c997; }
.status-cancelada { background: #f8d7da; color: #721c24; border-left: 3px solid #dc3545; }

/* Cores dos compromissos */
.appointment.blue { background: #cce5ff; color: #004085; }
.appointment.green { background: #d4edda; color: #155724; }
.appointment.yellow { background: #fff3cd; color: #856404; }
.appointment.red { background: #f8d7da; color: #721c24; }
.appointment.purple { background: #e2e3e5; color: #383d41; }

/* ===== SELETORES DE ÃCONE E COR ===== */
.icon-selector, .color-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.icon-btn, .color-btn {
  border: 2px solid transparent;
  transition: all 0.2s ease;
}

.icon-btn.active, .color-btn.active {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(0,123,255,0.25);
}

.icon-btn:hover, .color-btn:hover {
  transform: scale(1.05);
}

.icon-btn i, .color-btn i {
  pointer-events: none;
}

/* Responsividade */
@media (max-width: 768px) {
  .calendar-day {
    min-height: 60px;
    padding: 2px;
  }

  .day-number {
    font-size: 0.8rem;
  }

  .event-item {
    font-size: 0.7rem;
    padding: 1px 2px;
  }
}


