/* ============================================
   SALA COMPARTILHADA - ESTILOS PRINCIPAIS
   ============================================ */

/* --- Reset & Base --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --primary: #4f46e5;
  --primary-light: #6366f1;
  --primary-dark: #3730a3;
  --secondary: #0891b2;
  --success: #059669;
  --warning: #d97706;
  --danger: #dc2626;
  --bg: #f1f5f9;
  --bg-card: #ffffff;
  --bg-sidebar: #1e1b4b;
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --text-light: #94a3b8;
  --border: #e2e8f0;
  --border-focus: #4f46e5;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.10);
  --shadow-lg: 0 10px 40px rgba(0,0,0,0.15);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --transition: all 0.2s ease;
  --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

html {
  font-size: 15px;
  scroll-behavior: smooth;
  /* garante que o viewport mobile não faça zoom */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
}

/* --- App Layout --- */
#app {
  display: flex;
  min-height: 100vh;
}

/* --- Sidebar --- */
.sidebar {
  width: 260px;
  background: var(--bg-sidebar);
  color: white;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 100;
  transition: transform 0.3s ease;
  overflow-y: auto;
}

.sidebar-header {
  padding: 24px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 4px;
}

.sidebar-logo .logo-icon {
  width: 42px;
  height: 42px;
  background: var(--primary);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(79,70,229,0.4);
}

.sidebar-logo h1 {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.2;
  color: white;
}

.sidebar-logo p {
  font-size: 0.72rem;
  color: rgba(255,255,255,0.45);
  font-weight: 400;
  margin-top: 2px;
}

.sidebar-nav {
  padding: 16px 12px;
  flex: 1;
}

.nav-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.35);
  padding: 0 8px;
  margin: 16px 0 6px;
}

.nav-label:first-child {
  margin-top: 0;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  color: rgba(255,255,255,0.65);
  font-size: 0.9rem;
  font-weight: 500;
  user-select: none;
  position: relative;
  margin-bottom: 2px;
}

.nav-item:hover {
  background: rgba(255,255,255,0.08);
  color: white;
}

.nav-item.active {
  background: var(--primary);
  color: white;
  box-shadow: 0 4px 12px rgba(79,70,229,0.35);
}

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

.nav-badge {
  margin-left: auto;
  background: var(--danger);
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
  min-width: 20px;
  text-align: center;
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.current-time-widget {
  background: rgba(255,255,255,0.06);
  border-radius: var(--radius-sm);
  padding: 12px;
  text-align: center;
}

.current-time-widget .time-display {
  font-size: 1.5rem;
  font-weight: 700;
  color: white;
  letter-spacing: 0.05em;
}

.current-time-widget .date-display {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.5);
  margin-top: 2px;
}

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

/* --- Top Bar --- */
.topbar {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 0 28px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow-sm);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.topbar-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
}

.topbar-subtitle {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.3rem;
  color: var(--text-primary);
  padding: 6px;
  border-radius: var(--radius-sm);
}

.menu-toggle:hover {
  background: var(--bg);
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.87rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  white-space: nowrap;
  text-decoration: none;
  font-family: var(--font);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: 0 2px 8px rgba(79,70,229,0.3);
}
.btn-primary:hover:not(:disabled) {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(79,70,229,0.4);
}

.btn-secondary {
  background: var(--bg);
  color: var(--text-primary);
  border: 1px solid var(--border);
}
.btn-secondary:hover:not(:disabled) {
  background: #e2e8f0;
}

.btn-danger {
  background: #fef2f2;
  color: var(--danger);
  border: 1px solid #fecaca;
}
.btn-danger:hover:not(:disabled) {
  background: var(--danger);
  color: white;
}

.btn-success {
  background: #f0fdf4;
  color: var(--success);
  border: 1px solid #bbf7d0;
}
.btn-success:hover:not(:disabled) {
  background: var(--success);
  color: white;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
}

.btn-icon {
  padding: 8px;
  border-radius: var(--radius-sm);
}

/* --- Page Content --- */
.page-content {
  padding: 28px;
  flex: 1;
}

/* --- Views --- */
.view {
  display: none;
  animation: fadeIn 0.25s ease;
}

.view.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* --- Stats Cards --- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  transition: var(--transition);
}

.stat-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.stat-icon {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  flex-shrink: 0;
}

.stat-icon.blue { background: #eff6ff; }
.stat-icon.green { background: #f0fdf4; }
.stat-icon.yellow { background: #fffbeb; }
.stat-icon.red { background: #fef2f2; }
.stat-icon.purple { background: #f5f3ff; }

.stat-info .stat-number {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
}

.stat-info .stat-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 3px;
}

/* --- Section Header --- */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  flex-wrap: wrap;
  gap: 10px;
}

.section-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.section-subtitle {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-top: 1px;
}

/* --- Calendar --- */
.calendar-container {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  overflow: hidden;
}

.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  background: var(--primary);
  color: white;
}

.calendar-nav {
  display: flex;
  align-items: center;
  gap: 10px;
}

.calendar-nav-btn {
  background: rgba(255,255,255,0.15);
  border: none;
  color: white;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.calendar-nav-btn:hover {
  background: rgba(255,255,255,0.25);
}

.calendar-month-year {
  font-size: 1.05rem;
  font-weight: 700;
  min-width: 180px;
  text-align: center;
}

.calendar-view-toggle {
  display: flex;
  gap: 6px;
}

.view-toggle-btn {
  background: rgba(255,255,255,0.15);
  border: none;
  color: white;
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  transition: var(--transition);
}

.view-toggle-btn.active {
  background: rgba(255,255,255,0.9);
  color: var(--primary);
}

.view-toggle-btn:hover:not(.active) {
  background: rgba(255,255,255,0.22);
}

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
}

.weekday-header {
  padding: 10px 4px;
  text-align: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

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

.calendar-day {
  min-height: 90px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 6px;
  cursor: pointer;
  transition: background 0.15s;
  position: relative;
  overflow: hidden;
}

.calendar-day:nth-child(7n) {
  border-right: none;
}

.calendar-day:hover {
  background: #f8fafc;
}

.calendar-day.other-month {
  background: #fafafa;
}

.calendar-day.other-month .day-number {
  color: #cbd5e1;
}

.calendar-day.today {
  background: #eff6ff;
}

.calendar-day.today .day-number {
  background: var(--primary);
  color: white;
  border-radius: 50%;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.calendar-day.selected {
  background: #f5f3ff;
}

.day-number {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 3px;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.day-event-chip {
  font-size: 0.68rem;
  padding: 2px 6px;
  border-radius: 4px;
  color: white;
  font-weight: 600;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  cursor: pointer;
  transition: opacity 0.15s;
}

.day-event-chip:hover {
  opacity: 0.85;
}

.day-more {
  font-size: 0.68rem;
  color: var(--text-secondary);
  font-weight: 600;
  padding: 1px 4px;
}

/* --- Week View --- */
.week-view-container {
  overflow-x: auto;
}

.week-header {
  display: grid;
  border-bottom: 1px solid var(--border);
  background: #f8fafc;
}

.week-time-col {
  width: 60px;
  flex-shrink: 0;
}

.week-day-header {
  padding: 10px 8px;
  text-align: center;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  border-left: 1px solid var(--border);
}

.week-day-header.today {
  color: var(--primary);
}

.week-day-header .week-day-num {
  font-size: 1.4rem;
  font-weight: 800;
  display: block;
  line-height: 1;
}

.week-day-header.today .week-day-num {
  background: var(--primary);
  color: white;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 2px auto;
  font-size: 1rem;
}

.week-body {
  display: grid;
  overflow-y: auto;
  max-height: 520px;
}

.week-time-slot {
  display: grid;
  border-bottom: 1px solid #f1f5f9;
  min-height: 52px;
}

.week-time-label {
  font-size: 0.7rem;
  color: var(--text-light);
  padding: 4px 8px;
  text-align: right;
  border-right: 1px solid var(--border);
  flex-shrink: 0;
  width: 60px;
}

.week-cell {
  border-left: 1px solid var(--border);
  padding: 2px;
  position: relative;
  cursor: pointer;
  transition: background 0.1s;
}

.week-cell:hover {
  background: #f8fafc;
}

.week-event-block {
  border-radius: 4px;
  padding: 4px 6px;
  color: white;
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
  overflow: hidden;
  margin-bottom: 1px;
  transition: opacity 0.15s;
}

.week-event-block:hover {
  opacity: 0.85;
}

/* --- Day Panel --- */
.day-panel {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  overflow: hidden;
}

.day-panel-header {
  padding: 16px 20px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: white;
}

.day-panel-header h3 {
  font-size: 1rem;
  font-weight: 700;
}

.day-panel-header p {
  font-size: 0.8rem;
  opacity: 0.8;
  margin-top: 2px;
}

.day-panel-body {
  padding: 16px;
}

.day-slot-item {
  display: flex;
  gap: 12px;
  padding: 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid transparent;
  margin-bottom: 8px;
}

.day-slot-item:hover {
  background: #f8fafc;
  border-color: var(--border);
}

.day-slot-time {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-secondary);
  white-space: nowrap;
  padding-top: 2px;
  min-width: 80px;
}

.day-slot-color {
  width: 4px;
  border-radius: 4px;
  flex-shrink: 0;
}

.day-slot-info .slot-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
}

.day-slot-info .slot-person {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.empty-day {
  text-align: center;
  padding: 32px 16px;
  color: var(--text-secondary);
}

.empty-day .empty-icon {
  font-size: 2.5rem;
  margin-bottom: 10px;
}

/* --- Booking List --- */
.bookings-grid {
  display: grid;
  gap: 14px;
}

.booking-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.booking-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.booking-color-bar {
  width: 5px;
  height: 56px;
  border-radius: 6px;
  flex-shrink: 0;
}

.booking-info {
  flex: 1;
  min-width: 0;
}

.booking-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.booking-meta {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.booking-meta-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.booking-meta-item .meta-icon {
  font-size: 0.85rem;
}

.booking-actions {
  display: flex;
  gap: 7px;
  flex-shrink: 0;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.status-badge.confirmada {
  background: #f0fdf4;
  color: var(--success);
  border: 1px solid #bbf7d0;
}

.status-badge.pendente {
  background: #fffbeb;
  color: var(--warning);
  border: 1px solid #fde68a;
}

.status-badge.cancelada {
  background: #fef2f2;
  color: var(--danger);
  border: 1px solid #fecaca;
}

/* --- Filters Bar --- */
.filters-bar {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 14px 18px;
  border: 1px solid var(--border);
  margin-bottom: 18px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.search-input-wrap {
  position: relative;
  flex: 1;
  min-width: 200px;
}

.search-input-wrap .search-icon {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-light);
  font-size: 0.9rem;
}

.search-input-wrap input {
  width: 100%;
  padding: 8px 12px 8px 34px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.87rem;
  color: var(--text-primary);
  font-family: var(--font);
  transition: var(--transition);
  background: var(--bg);
}

.search-input-wrap input:focus {
  outline: none;
  border-color: var(--border-focus);
  background: white;
  box-shadow: 0 0 0 3px rgba(79,70,229,0.1);
}

.filter-select {
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.87rem;
  color: var(--text-primary);
  font-family: var(--font);
  background: var(--bg);
  cursor: pointer;
  transition: var(--transition);
}

.filter-select:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(79,70,229,0.1);
}

/* --- Modal --- */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(3px);
}

.modal-overlay.open {
  display: flex;
  animation: overlayIn 0.2s ease;
}

@keyframes overlayIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.modal {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.25s ease;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.94) translateY(10px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
  padding: 22px 24px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  background: var(--bg-card);
  z-index: 1;
}

.modal-header h2 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.modal-close {
  background: var(--bg);
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.modal-close:hover {
  background: #e2e8f0;
  color: var(--text-primary);
}

.modal-body {
  padding: 20px 24px;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* --- Form --- */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.form-group.full-width {
  grid-column: 1 / -1;
}

.form-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
}

.form-label .required {
  color: var(--danger);
  margin-left: 2px;
}

.form-input,
.form-select,
.form-textarea {
  padding: 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.87rem;
  color: var(--text-primary);
  font-family: var(--font);
  background: white;
  transition: var(--transition);
  width: 100%;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(79,70,229,0.1);
}

.form-textarea {
  resize: vertical;
  min-height: 80px;
}

.color-picker-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 4px;
}

.color-option {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  border: 3px solid transparent;
  transition: transform 0.15s;
}

.color-option:hover {
  transform: scale(1.15);
}

.color-option.selected {
  border-color: #1e293b;
  transform: scale(1.1);
}

/* --- Event Detail Modal --- */
.event-detail-color-bar {
  height: 6px;
  border-radius: 4px;
  margin-bottom: 18px;
}

.event-detail-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
  font-size: 0.9rem;
}

.event-detail-row .detail-icon {
  font-size: 1.05rem;
  margin-top: 1px;
  color: var(--text-secondary);
  width: 20px;
  flex-shrink: 0;
}

.event-detail-row .detail-label {
  font-weight: 600;
  color: var(--text-secondary);
  min-width: 90px;
  font-size: 0.82rem;
}

.event-detail-row .detail-value {
  color: var(--text-primary);
  font-weight: 500;
}

/* --- Toast --- */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: #1e293b;
  color: white;
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.87rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 10px;
  pointer-events: auto;
  animation: toastIn 0.3s ease;
  min-width: 240px;
  max-width: 340px;
}

.toast.success { border-left: 4px solid var(--success); }
.toast.error   { border-left: 4px solid var(--danger); }
.toast.info    { border-left: 4px solid var(--primary); }
.toast.warning { border-left: 4px solid var(--warning); }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(30px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes toastOut {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(30px); }
}

/* --- Empty State --- */
.empty-state {
  text-align: center;
  padding: 60px 20px;
}

.empty-state .empty-icon {
  font-size: 3.5rem;
  margin-bottom: 14px;
  opacity: 0.4;
}

.empty-state h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.empty-state p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

/* --- Loading --- */
.loading-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2.5px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.skeleton {
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
  background-size: 200% 100%;
  animation: shimmer 1.3s infinite;
  border-radius: 6px;
}

@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* --- Overlay for mobile sidebar --- */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 99;
}

/* --- Dashboard Grid --- */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 24px;
}

.dashboard-calendar-wrap {
  min-width: 0;
}

/* ─── Sidebar nav links ─── */
.sidebar-nav a.nav-item {
  text-decoration: none;
  color: rgba(255,255,255,0.65);
}
.sidebar-nav a.nav-item:hover {
  background: rgba(255,255,255,0.08);
  color: white;
}
.sidebar-nav a.nav-item.active {
  background: var(--primary);
  color: white;
  box-shadow: 0 4px 12px rgba(79,70,229,0.35);
}

/* ─── Calendar Page (index.html) Grid ─── */
.calendar-page-grid {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 22px;
  align-items: start;
}

.calendar-main-col {
  min-width: 0;
}

.calendar-side-col {
  min-width: 0;
}

/* Dias com altura maior na página principal */
.calendar-main-col .calendar-day {
  min-height: 110px;
}

@media (max-width: 1050px) {
  .calendar-page-grid {
    grid-template-columns: 1fr;
  }
  .calendar-side-col .day-panel {
    position: static !important;
  }
}

@media (max-width: 640px) {
  .calendar-main-col .calendar-day {
    min-height: 72px;
  }
}

/* --- Next Events List (Dashboard) --- */
.next-events-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.next-event-item {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: var(--transition);
}

.next-event-item:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.next-event-color {
  width: 4px;
  height: 40px;
  border-radius: 4px;
  flex-shrink: 0;
}

.next-event-info .next-event-title {
  font-size: 0.87rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.next-event-info .next-event-time {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.next-event-date {
  margin-left: auto;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-align: right;
  flex-shrink: 0;
}

/* --- Scrollbar --- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1200px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  html { font-size: 14px; }

  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-overlay.open {
    display: block;
  }

  .main-content {
    margin-left: 0;
  }

  .menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .topbar {
    padding: 0 14px;
    height: 56px;
  }

  .topbar-title { font-size: 1rem; }
  .topbar-subtitle { font-size: 0.72rem; }

  .page-content {
    padding: 12px;
  }

  .calendar-day {
    min-height: 70px;
  }

  /* Calendário: header compacto */
  .calendar-header {
    padding: 12px 14px;
    flex-wrap: wrap;
    gap: 8px;
  }

  .calendar-month-year {
    font-size: 0.95rem;
    min-width: 150px;
  }

  /* Stats grid 2 colunas em tablet */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .stat-card { padding: 14px; }
  .stat-info .stat-number { font-size: 1.5rem; }

  /* Modais ocupam mais tela */
  .modal-overlay { padding: 12px; }
  .modal { max-height: 95vh; }
  .modal-header { padding: 16px 18px 12px; }
  .modal-body { padding: 14px 18px; }
  .modal-footer { padding: 12px 18px; }
}

@media (max-width: 640px) {
  html { font-size: 13px; }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .stat-card { padding: 12px; gap: 10px; }
  .stat-icon { width: 40px; height: 40px; font-size: 1.1rem; }
  .stat-info .stat-number { font-size: 1.35rem; }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .form-group.full-width {
    grid-column: 1;
  }

  .booking-card {
    flex-wrap: wrap;
    padding: 14px;
    gap: 10px;
  }

  .booking-actions {
    width: 100%;
    justify-content: flex-end;
  }

  /* Calendário compacto */
  .calendar-day {
    min-height: 52px;
    padding: 3px 2px;
  }

  .day-number {
    font-size: 0.75rem;
    width: 22px;
    height: 22px;
  }

  .calendar-month-year {
    min-width: 130px;
    font-size: 0.88rem;
  }

  .calendar-nav-btn {
    width: 28px;
    height: 28px;
    font-size: 0.9rem;
  }

  .weekday-header { font-size: 0.68rem; padding: 7px 2px; }

  .day-event-chip { font-size: 0.6rem; padding: 1px 4px; }

  /* Painel do dia */
  .day-panel-header { padding: 12px 14px; }
  .day-panel-body { padding: 10px 12px; }
  .day-slot-item { padding: 8px 10px; gap: 8px; }

  /* Topbar mobile */
  .topbar-right .btn span:not(.loading-spinner) { display: none; }
  .topbar-right .btn::before { content: '➕'; }

  /* View toggles */
  .view-toggle-btn { padding: 5px 10px; font-size: 0.75rem; }

  /* Filtros em coluna */
  .filters-bar { flex-direction: column; align-items: stretch; padding: 12px; }
  .search-input-wrap { min-width: unset; }
  .filter-select { width: 100%; }

  /* Dashboard grid 1 coluna */
  .dashboard-grid { grid-template-columns: 1fr; gap: 14px; }
  .dashboard-calendar-wrap { order: 2; }
}

@media (max-width: 420px) {
  html { font-size: 12px; }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }

  .weekday-header {
    font-size: 0.62rem;
    padding: 6px 1px;
  }

  .calendar-day {
    min-height: 46px;
    padding: 2px 1px;
  }

  .day-number {
    font-size: 0.7rem;
    width: 20px;
    height: 20px;
  }

  .day-event-chip { display: none; }
  .day-more { font-size: 0.58rem; }

  /* Quando há evento, mostra só o pontinho colorido */
  .calendar-day.has-events::after {
    content: '';
    display: block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--primary);
    margin: 2px auto 0;
  }

  .topbar { height: 52px; }
  .topbar-title { font-size: 0.92rem; }
  .topbar-subtitle { display: none; }

  .btn { padding: 7px 12px; font-size: 0.8rem; }
  .btn-sm { padding: 5px 9px; font-size: 0.74rem; }

  .page-content { padding: 10px 8px; }

  .modal-overlay { padding: 8px; }
  .modal-header h2 { font-size: 0.95rem; }
  .form-label { font-size: 0.78rem; }
  .form-input, .form-select, .form-textarea { font-size: 0.82rem; padding: 8px 10px; }

  .booking-card { padding: 10px 12px; }
  .booking-title { font-size: 0.88rem; }
  .booking-meta-item { font-size: 0.72rem; }

  /* Sidebar mais fina */
  .sidebar { width: 240px; }
  .sidebar-logo h1 { font-size: 0.92rem; }
}
