* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #667eea;
  --primary-dark: #5568d3;
  --secondary: #764ba2;
  --success: #48bb78;
  --danger: #f56565;
  --warning: #ed8936;
  --info: #4299e1;
  --light: #f7fafc;
  --dark: #2d3748;
  --gray: #718096;
  --border: #e2e8f0;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: #f7fafc;
  color: #2d3748;
  line-height: 1.6;
}

.dashboard {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: 260px;
  background: linear-gradient(180deg, var(--sidebar-bg) 0%, var(--sidebar-bg2) 100%);
  color: white;
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
  overflow-y: auto;
}

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

.sidebar-header h2 {
  font-size: 1.5em;
  font-weight: 700;
}

.sidebar-nav {
  flex: 1;
  padding: 20px 0;
}

.nav-item {
  display: flex;
  align-items: center;
  padding: 14px 20px;
  color: white;
  text-decoration: none;
  transition: all 0.3s;
  border-left: 3px solid transparent;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.1);
}

.nav-item.active {
  background: rgba(255, 255, 255, 0.15);
  border-left-color: white;
}

.nav-item .icon {
  margin-right: 12px;
  font-size: 1.2em;
}

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

.user-info {
  margin-bottom: 15px;
  font-size: 0.9em;
  opacity: 0.9;
}

.btn-logout {
  width: 100%;
  padding: 10px;
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.3s;
}

.btn-logout:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Main Content */
.main-content {
  flex: 1;
  margin-left: 260px;
  padding: 30px;
}

.header {
  margin-bottom: 30px;
}

.header h1 {
  font-size: 2em;
  color: #2d3748;
  margin-bottom: 10px;
}

/* Alert */
.alert {
  padding: 14px 18px;
  border-radius: 8px;
  margin-bottom: 20px;
  display: none;
}

.alert.show {
  display: block;
  animation: slideDown 0.3s;
}

.alert.success {
  background: #e6fffa;
  color: #047857;
  border: 1px solid #6ee7b7;
}

.alert.error {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fca5a5;
}

.alert.info {
  background: #eff6ff;
  color: #1e40af;
  border: 1px solid #93c5fd;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Content Sections */
.content-section {
  display: none;
}

.content-section.active {
  display: block;
  animation: fadeIn 0.3s;
}

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

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
  flex-wrap: wrap;
  gap: 15px;
}

.section-header h2 {
  font-size: 1.5em;
  color: #2d3748;
}

.filter-group {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.filter-group select {
  padding: 8px 12px;
  border: 2px solid #e2e8f0;
  border-radius: 6px;
  font-size: 0.95em;
  cursor: pointer;
}

/* Form Card */
.form-card {
  background: white;
  padding: 30px;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.form-card h2 {
  margin-bottom: 25px;
  color: #2d3748;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  color: #4a5568;
  font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 14px;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  font-size: 1em;
  transition: all 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
}

.form-group textarea {
  resize: vertical;
  font-family: inherit;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
}

.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 25px;
  justify-content: flex-end;
}

/* Buttons */
.btn {
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  font-size: 1em;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* Password visibility toggle */
.password-wrapper {
  position: relative;
  width: 100%;
}

.password-wrapper input {
  padding-right: 44px !important;
}

.toggle-password {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 16px;
  opacity: 0.8;
  padding: 6px;
  line-height: 1;
}

.toggle-password:hover {
  opacity: 1;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  color: white;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
  background: #e2e8f0;
  color: #4a5568;
}

.btn-secondary:hover {
  background: #cbd5e0;
}

.btn-success {
  background: var(--success);
  color: white;
}

.btn-danger {
  background: var(--danger);
  color: white;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.9em;
}

/* Bookings Grid */
.bookings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

.booking-card {
  background: white;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: all 0.3s;
  border-left: 4px solid var(--primary);
}

.booking-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.booking-card-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  margin-bottom: 15px;
}

.booking-card-title {
  font-size: 1.2em;
  font-weight: 600;
  color: #2d3748;
}

.booking-badge {
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.85em;
  font-weight: 500;
}

.badge-success {
  background: #d1fae5;
  color: #047857;
}

.badge-info {
  background: #dbeafe;
  color: #1e40af;
}

.booking-info {
  margin: 10px 0;
}

.info-row {
  display: flex;
  align-items: center;
  margin-bottom: 8px;
  color: #4a5568;
  font-size: 0.95em;
}

.info-row span:first-child {
  margin-right: 8px;
}

.booking-actions {
  display: flex;
  gap: 8px;
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid #e2e8f0;
}

/* Tables */
.table-container {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  color: white;
}

th {
  padding: 15px;
  text-align: left;
  font-weight: 600;
}

td {
  padding: 15px;
  border-bottom: 1px solid #e2e8f0;
}

tbody tr:hover {
  background: #f7fafc;
}

.table-actions {
  display: flex;
  gap: 8px;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
}

.modal.show {
  display: flex;
  animation: fadeIn 0.25s ease;
}

.modal-content {
  background: white;
  border-radius: 16px;
  width: 100%;
  max-width: 600px;
  max-height: 92vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  display: flex;
  flex-direction: column;
  animation: slideUp 0.25s ease;
}

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

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 24px;
  border-bottom: 1px solid #e2e8f0;
  position: sticky;
  top: 0;
  background: white;
  z-index: 1;
  border-radius: 16px 16px 0 0;
}

.modal-header h2 {
  font-size: 1.15rem;
  color: #1a1a2e;
  font-weight: 700;
  margin: 0;
}

.modal-close {
  background: #f3f4f6;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 1.1rem;
  color: #6b7280;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  flex-shrink: 0;
}

.modal-close:hover {
  background: #e5e7eb;
  color: #1a1a2e;
}

.modal-content form {
  padding: 20px 24px 24px;
}

/* Mobile: modal ocupa tela toda na base */
@media (max-width: 600px) {
  .modal {
    padding: 0;
    align-items: flex-end;
  }
  .modal-content {
    border-radius: 20px 20px 0 0;
    max-height: 95vh;
    max-width: 100%;
  }
  .modal-header {
    border-radius: 20px 20px 0 0;
  }
}

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

.empty-state-icon {
  font-size: 4em;
  margin-bottom: 15px;
  opacity: 0.5;
}

.empty-state h3 {
  font-size: 1.3em;
  margin-bottom: 10px;
}

/* Responsive */
@media (max-width: 768px) {
  .sidebar {
    width: 100%;
    position: relative;
    height: auto;
  }

  .main-content {
    margin-left: 0;
    padding: 20px;
  }

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

  .section-header {
    flex-direction: column;
    align-items: flex-start;
  }

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

  .table-container {
    overflow-x: auto;
  }

  table {
    min-width: 600px;
  }
}

/* Logs Table */
.log-action {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.85em;
  font-weight: 500;
}

.log-action.create {
  background: #d1fae5;
  color: #047857;
}

.log-action.update {
  background: #dbeafe;
  color: #1e40af;
}

.log-action.delete {
  background: #fee2e2;
  color: #b91c1c;
}

.log-action.cancel {
  background: #fef3c7;
  color: #92400e;
}

.log-action.login,
.log-action.logout,
.log-action.register {
  background: #e9d5ff;
  color: #6b21a8;
}


/* ========== TOGGLE CARDS/LISTA ========== */

.view-toggle {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

.toggle-btn {
  padding: 8px 16px;
  border: 1px solid #e2e8f0;
  background: white;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: #4a5568;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.toggle-btn:hover {
  background: #f7fafc;
  border-color: #cbd5e0;
}

.toggle-btn.active {
  background: #3182ce;
  color: white;
  border-color: #3182ce;
}

/* ========== VISUALIZAÇÃO EM LISTA ========== */

.list-view {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.list-view .booking-card {
  display: flex;
  flex-direction: row;
  align-items: center;
  padding: 16px;
}

.list-view .booking-card-header {
  flex: 0 0 200px;
  margin-bottom: 0;
}

.list-view .booking-info {
  flex: 1;
  display: flex;
  flex-direction: row;
  gap: 24px;
  margin: 0;
}

.list-view .info-row {
  margin: 0;
}

.list-view .booking-actions {
  flex: 0 0 auto;
  margin: 0;
}

/* ========== FILTER GROUP COM TOGGLE ========== */

.filter-group {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.filter-group select,
.filter-group .btn {
  margin: 0;
}

.filter-group .view-toggle {
  margin-left: auto;
}


/* ========== MODAL DE TIPO DE RESERVA ========== */

.booking-type-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.booking-type-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 16px;
  border: 2px solid #e2e8f0;
  background: white;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}

.booking-type-btn:hover {
  border-color: #3182ce;
  background: #f7fafc;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(49, 130, 206, 0.15);
}

.booking-type-icon {
  font-size: 48px;
  margin-bottom: 12px;
}

.booking-type-title {
  font-size: 18px;
  font-weight: 600;
  color: #2d3748;
  margin-bottom: 8px;
  display: block;
}

.booking-type-desc {
  font-size: 14px;
  color: #718096;
  display: block;
}

/* ========== VISUALIZAÇÃO EM LISTA (NOVO LAYOUT) ========== */

.list-view-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.list-view-item {
  display: grid;
  grid-template-columns: 150px 120px 140px 1fr 180px 200px auto;
  gap: 16px;
  align-items: center;
  padding: 12px 16px;
  background: white;
  border: 1px solid #e2e8f0;
  border-left: 4px solid var(--primary);
  border-radius: 6px;
  transition: all 0.2s;
  min-height: 48px;
}

.list-view-item:hover {
  border-color: #cbd5e0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.list-date {
  font-size: 14px;
  color: #2d3748;
}

.list-time {
  font-size: 14px;
  color: #2d3748;
}

.list-purpose {
  font-size: 14px;
  color: #4a5568;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.list-room {
  font-size: 14px;
  color: #4a5568;
}

.list-user {
  font-size: 14px;
  color: #4a5568;
}

.list-email {
  font-size: 13px;
  color: #718096;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.list-room-name {
  font-size: 14px;
  color: #2d3748;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Ícone de reserva recorrente */
.recurring-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: #667eea;
  cursor: help;
  animation: rotate-icon 2s linear infinite;
}

@keyframes rotate-icon {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.booking-card-title .recurring-icon {
  margin-left: 8px;
  font-size: 18px;
}

.list-capacity {
  font-size: 13px;
  color: #718096;
}

.list-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.list-actions .btn {
  margin: 0;
  padding: 6px 12px;
  font-size: 13px;
}

/* Responsividade para lista */
@media (max-width: 1200px) {
  .list-view-item {
    grid-template-columns: 130px 100px 120px 2fr 150px auto;
  }
  

  /* prioritize purpose over email */
  .list-email { display: none !important; }
}
.list-email {
    display: none;
  }
}

@media (max-width: 768px) {
  .list-view-item {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  
  .list-actions {
    justify-content: flex-start;
  }
}


/* ========== SELETOR DE USUÁRIO COM AUTOCOMPLETE (V2.1.6) ========== */

.user-autocomplete-list {
  display: none;
  position: absolute;
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  max-height: 300px;
  overflow-y: auto;
  width: 100%;
  z-index: 1000;
  margin-top: 4px;
}

.user-autocomplete-item {
  padding: 12px 16px;
  cursor: pointer;
  border-bottom: 1px solid #f7fafc;
  transition: background 0.2s;
}

.user-autocomplete-item:last-child {
  border-bottom: none;
}

.user-autocomplete-item:hover {
  background: #f7fafc;
}

.user-autocomplete-item strong {
  display: block;
  color: #2d3748;
  font-size: 14px;
  margin-bottom: 2px;
}

.user-autocomplete-item small {
  color: #718096;
  font-size: 12px;
}

.user-autocomplete-divider {
  height: 1px;
  background: #e2e8f0;
  margin: 4px 0;
}

.usage-badge {
  display: inline-block;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 10px;
  margin-left: 6px;
  font-weight: 600;
  vertical-align: middle;
}

.form-group {
  position: relative;
}


/* ========== V2.1.8: ZONA DE PERIGO ========== */
.config-section {
  background: white;
  padding: 24px;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  margin-bottom: 24px;
}

.config-section h3 {
  margin-top: 0;
  margin-bottom: 16px;
  color: #1e293b;
  font-size: 18px;
}

.danger-zone {
  border: 2px solid #dc2626;
  border-radius: 8px;
  padding: 20px;
  background: #fef2f2;
}

.danger-zone p {
  margin: 8px 0;
}

.warning-text {
  color: #dc2626;
  font-weight: 600;
  font-size: 14px;
  margin: 12px 0 !important;
}

.help-text {
  color: #64748b;
  font-size: 13px;
  margin-top: 12px !important;
}

.btn-danger {
  background: #dc2626;
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-danger:hover {
  background: #b91c1c;
}

.btn-danger:active {
  background: #991b1b;
}


/* ========== V2.1.8: VARIÁVEL DE COR DO TEMA ========== */
:root {
  --primary-color: #8b5cf6;
}

/* Aplicar cor primária em elementos principais */
.btn-primary {
  background: var(--primary-color) !important;
}

.nav-link.active {
  background: var(--primary-color) !important;
}

.badge-primary {
  background: var(--primary-color) !important;
}

/* Estilos do seletor de cor */
#theme-color-select {
  max-width: 300px;
}


:root {
  --sidebar-bg: #667eea;
  --sidebar-bg2: #764ba2;
}


/* Branding */
.brand-block{display:flex;align-items:center;gap:10px;}
.brand-logo{width:34px;height:34px;object-fit:contain;border-radius:6px;background:rgba(255,255,255,0.08);padding:4px;}
.brand-title{line-height:1.1;}
.brand-title .brand-top{display:block;font-weight:800;font-size:0.95em;}
.brand-title .brand-bottom{display:block;font-weight:700;font-size:0.95em;opacity:0.95;}


/* Compactar títulos */
.header h2#page-title{font-size:1.4em;font-weight:700;margin:0;}
.section-header h3{font-size:1.15em;margin:0;}
.form-card h3{font-size:1.2em;}
.form-card h4{font-size:1.05em;}


/* 🔄 Modal de escopo de recorrência (3 botões) */
.recurrence-scope-modal { display:none; position:fixed; inset:0; background: rgba(0,0,0,0.45); z-index: 9999; }
.recurrence-scope-modal .modal-content {
  background:#fff;
  width: min(520px, calc(100vw - 32px));
  margin: auto;
  border-radius: 16px;
  padding: 22px 22px 18px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
}
@media (max-width:600px) {
  .recurrence-scope-modal { align-items: flex-end !important; padding: 0 !important; }
  .recurrence-scope-modal .modal-content { border-radius: 20px 20px 0 0; width: 100%; }
}
.recurrence-scope-modal .modal-title { font-weight: 700; margin: 0 0 10px; font-size: 18px; }
.recurrence-scope-modal .modal-desc { color: #4a5568; margin: 0 0 14px; line-height: 1.35; }
.recurrence-scope-modal .modal-actions { display:flex; gap:10px; justify-content:flex-end; flex-wrap:wrap; }
.recurrence-scope-modal .btn-secondary { background:#e2e8f0; color:#2d3748; }

/* prioritize purpose over email */

/* === MODAL POLISH (v2.2.3-fix3) === */
/* Backdrop + centering already exist via .modal/.modal.show. This block improves spacing, alignment and animations. */
.modal-content {
  /* keep existing sizing, add breathing room */
  border-radius: 14px;
  overflow: hidden;
}

.modal-header {
  padding: 22px 28px;
}

.modal-header h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.2;
}

.modal-body {
  padding: 18px 28px 26px;
  text-align: center;
}

.modal-body p {
  margin: 8px 0;
  color: #4a5568;
  line-height: 1.45;
}

.modal-actions {
  margin-top: 18px;
  display: flex;
  gap: 12px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
}

/* Steps: smooth transitions */
.modal-step {
  display: none;
  opacity: 0;
  transform: translateY(6px);
}
.modal-step.active {
  display: block;
  opacity: 1;
  transform: translateY(0);
  animation: modalStepIn 180ms cubic-bezier(.2,.8,.2,1);
}
@keyframes modalStepIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Buttons: consistent sizing + feel */
.modal .btn {
  min-width: 118px;
  padding: 10px 16px;
  border-radius: 10px;
}

/* Primary already uses theme vars (--primary/--secondary). Add subtle hover */
.btn-primary:hover {
  filter: brightness(0.96);
}
.btn-primary:active {
  transform: translateY(1px);
}
/* === /MODAL POLISH (v2.2.3-fix3) === */



/* === MODAL BUTTON TWEAK (v2.2.3-fix6) === */
.modal-actions .btn {
  text-align: center;
  font-weight: 700;
}
/* === /MODAL BUTTON TWEAK (v2.2.3-fix6) === */


/* === USERS SORT (v2.2.3-fix8.2) === */
.sortable-th { user-select: none; }
.sort-icon { margin-left: 6px; font-size: 12px; opacity: .65; }
.sort-icon.active { opacity: 1; }
.sortable-th:hover .sort-icon { opacity: 1; }
/* === /USERS SORT (v2.2.3-fix8.2) === */


/* === MODAL BUTTONS GLOBAL (stable-fix8.2.3) === */
.modal .btn, .modal-actions .btn {
  font-weight: 700;
  text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.modal-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
}
/* === /MODAL BUTTONS GLOBAL (stable-fix8.2.3) === */


/* === NOTICE ATTENTION ICON (stable-fix8.3) === */
@keyframes noticeBlink { 0% { opacity: 1; transform: scale(1); } 50% { opacity: .35; transform: scale(1.08); } 100% { opacity: 1; transform: scale(1); } }
.notice-attn {
  margin-left: 8px;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 12px;
  background: #facc15; /* amarelinho */
  color: #111827;
  box-shadow: 0 0 0 2px rgba(250,204,21,0.25);
  animation: noticeBlink 1s infinite;
}
/* === /NOTICE ATTENTION ICON (stable-fix8.3) === */


/* === NOTICE INDICATOR (stable-fix8.3.1) === */
@keyframes noticePulse { 0% { transform: scale(1); } 50% { transform: scale(1.12); } 100% { transform: scale(1); } }
.notice-indicator {
  margin-left: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  line-height: 1;
  animation: noticePulse 1.1s infinite;
  filter: drop-shadow(0 0 6px rgba(250, 204, 21, 0.65));
}
/* === /NOTICE INDICATOR (stable-fix8.3.1) === */


/* === NOTICE INDICATOR (stable-fix8.3.2) === */
@keyframes noticeBlink2 { 0% { opacity: 1; } 50% { opacity: .35; } 100% { opacity: 1; } }
.notice-indicator{
  margin-left: 8px;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: #facc15;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 2px rgba(250,204,21,0.25);
  animation: noticeBlink2 1s infinite;
}
.notice-indicator::before{ content: '🔔'; font-size: 11px; line-height: 1; }
/* === /NOTICE INDICATOR (stable-fix8.3.2) === */


/* === NOTICE INDICATOR (stable-fix8.3.3) === */
@keyframes noticeBlink3 { 0% { opacity: 1; transform: scale(1);} 50% { opacity: .4; transform: scale(1.08);} 100% { opacity: 1; transform: scale(1);} }
.notice-indicator{
  margin-left: 8px;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: #facc15;
  color: #111827;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 2px rgba(250,204,21,0.25);
  animation: noticeBlink3 1s infinite;
}
.notice-indicator::before{ content:'🔔'; font-size: 11px; line-height: 1; }
/* === /NOTICE INDICATOR (stable-fix8.3.3) === */


.recurrence-impact-box{margin-top:16px;padding:14px 16px;border:1px solid #e5e7eb;border-radius:12px;background:#f8fafc;}
.recurrence-impact-box h4{margin:0 0 8px 0;font-size:15px;}
.recurrence-impact-dates{display:flex;flex-direction:column;gap:6px;margin-top:8px;max-height:180px;overflow-y:auto;}
.recurrence-impact-date-item{padding:8px 10px;border-radius:8px;background:#fff;border:1px solid #e5e7eb;font-size:13px;}
.recurrence-impact-more{margin-top:6px;font-size:12px;opacity:.8;}


/* === EDIT BOOKING MODAL RESPONSIVE (fix8.3.9.8) === */
#edit-booking-modal {
  align-items: center;
  justify-content: center;
  padding: 16px;
}

#edit-booking-modal .modal-content {
  width: min(920px, 96vw);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#edit-booking-modal .modal-header {
  flex: 0 0 auto;
}

#edit-booking-modal form {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  padding: 22px 28px 18px;
}

#edit-booking-modal .form-actions {
  flex: 0 0 auto;
  position: sticky;
  bottom: 0;
  background: #fff;
  padding-top: 12px;
  margin-top: 12px;
  z-index: 2;
}

#edit-booking-modal .recurrence-impact-dates {
  max-height: 160px;
  overflow-y: auto;
}

#edit-booking-modal form {
  overflow-y: auto;
}

@media (max-height: 760px) {
  #edit-booking-modal .modal-content {
    max-height: 96vh;
  }

  #edit-booking-modal form {
    padding: 18px 22px 14px;
  }

  #edit-booking-modal .recurrence-impact-dates {
    max-height: 120px;
  }
}
/* === /EDIT BOOKING MODAL RESPONSIVE (fix8.3.9.8) === */

/* FIX8.4.11 / V2.2.5 - Polimento visual da barra de filtros em Todas as Reservas */
#todas-reservas .filter-group {
  gap: 10px;
  align-items: center;
}

#todas-reservas #filter-company {
  min-width: 175px;
  max-width: 175px;
}

#todas-reservas #filter-user-search {
  min-width: 160px;
  max-width: 160px;
}

#todas-reservas #filter-user {
  min-width: 185px;
  max-width: 185px;
}

#todas-reservas .view-toggle {
  margin-left: auto;
  align-self: center;
}


/* FIX8.4.12 / V2.2.6 - Gestão de empresas */
.company-status{display:inline-flex;align-items:center;padding:4px 10px;border-radius:999px;font-size:.85rem;font-weight:700;}
.company-status.active{background:rgba(34,197,94,.12);color:#166534;}
.company-status.inactive{background:rgba(239,68,68,.12);color:#991b1b;}
#companies-list .btn-sm{padding:6px 10px;font-size:.9rem;}
#gerenciar-empresas .info-text{color:#475569;}

/* Transfer-delete modal responsivo */
#transfer-delete-modal .modal-content {
  max-width: 520px !important;
}
@media (max-width:600px) {
  #transfer-delete-modal.modal { padding: 0; align-items: flex-end; }
  #transfer-delete-modal .modal-content { border-radius: 20px 20px 0 0; max-width: 100% !important; }
}

/* Confirm modal genérico responsivo */
.confirm-modal .modal-content {
  max-width: 420px;
}
@media (max-width:600px) {
  .confirm-modal.modal { padding: 0; align-items: flex-end; }
  .confirm-modal .modal-content { border-radius: 20px 20px 0 0; max-width: 100%; }
}

/* Botões no modal em mobile: empilhar */
@media (max-width:480px) {
  .modal-content .form-actions,
  .modal-content [style*="display:flex"][style*="gap"],
  .modal-actions {
    flex-direction: column !important;
  }
  .modal-content .form-actions button,
  .modal-actions button {
    width: 100%;
  }
}

/* =============================================
   MODAIS RESPONSIVOS — Flux v3.2
   ============================================= */

/* Base modal */
.modal {
  padding: 12px !important;
}

.modal-content {
  width: 100% !important;
  max-width: 620px;
  max-height: 92vh;
  overflow-y: auto;
  margin: auto;
  display: flex;
  flex-direction: column;
  border-radius: 16px !important;
}

/* Header fixo no topo ao rolar */
.modal-header {
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 10;
  border-radius: 16px 16px 0 0;
  padding: 16px 20px !important;
  flex-shrink: 0;
}

.modal-header h2,
.modal-header h3 {
  font-size: 1rem !important;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: calc(100% - 40px);
}

/* Form dentro do modal */
.modal-content form {
  padding: 16px 20px 20px !important;
  overflow-y: auto;
}

.modal-body {
  padding: 16px 20px 20px;
  overflow-y: auto;
}

/* form-row vira coluna em telas pequenas */
.form-row {
  display: flex;
  gap: 12px;
}

/* form-actions: botões sempre visíveis na base */
.form-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid #e5e7eb;
  position: sticky;
  bottom: 0;
  background: #fff;
  z-index: 5;
  border-radius: 0 0 16px 16px;
}

.form-actions .btn {
  flex: 1;
  min-width: 100px;
  justify-content: center;
}

/* Recorrência scope modal */
.recurrence-scope-modal {
  align-items: center;
  justify-content: center;
  padding: 12px !important;
}

.recurrence-scope-modal .modal-content {
  max-width: 480px !important;
  border-radius: 16px !important;
  padding: 22px !important;
}

.modal-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.modal-actions .btn {
  flex: 1;
  min-width: 90px;
  justify-content: center;
  text-align: center;
}

/* Booking type modal */
.booking-type-options {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.booking-type-btn {
  flex: 1;
  min-width: 140px;
}

/* Transfer-delete modal */
#transfer-delete-modal .modal-content {
  max-width: 500px !important;
}

/* ── Telas até 1366px (17") ── */
@media (max-width: 1366px) {
  .modal-content {
    max-width: 560px;
    max-height: 88vh;
  }
  .modal-header h2,
  .modal-header h3 { font-size: 0.95rem !important; }
  .form-group label { font-size: 0.82rem; }
  input, select, textarea { font-size: 0.875rem; }
}

/* ── Telas até 1024px (tablets, laptops pequenos) ── */
@media (max-width: 1024px) {
  .modal { padding: 8px !important; }
  .modal-content { max-height: 90vh; }
  .form-row { flex-direction: column; gap: 8px; }
  .booking-type-options { flex-direction: column; }
  .booking-type-btn { min-width: auto; width: 100%; }
}

/* ── Telas até 768px (mobile/tablet) ── */
@media (max-width: 768px) {
  .modal {
    padding: 0 !important;
    align-items: flex-end !important;
  }
  .modal-content {
    border-radius: 20px 20px 0 0 !important;
    max-height: 95vh;
    max-width: 100% !important;
  }
  .modal-header {
    border-radius: 20px 20px 0 0 !important;
  }
  .recurrence-scope-modal {
    align-items: flex-end !important;
    padding: 0 !important;
  }
  .recurrence-scope-modal .modal-content {
    border-radius: 20px 20px 0 0 !important;
    max-width: 100% !important;
    width: 100% !important;
    padding: 20px !important;
  }
  .modal-actions .btn,
  .form-actions .btn {
    min-width: 0;
    font-size: 0.82rem;
    padding: 10px 12px;
  }
  #transfer-delete-modal .modal-content {
    max-width: 100% !important;
  }
}

/* ── Sidebar em telas pequenas ── */
@media (max-width: 1200px) {
  .sidebar {
    width: 200px !important;
    min-width: 180px !important;
  }
  .sidebar .nav-item {
    font-size: 0.82rem !important;
    padding: 10px 12px !important;
  }
  .main-content {
    margin-left: 200px !important;
  }
}

@media (max-width: 900px) {
  .sidebar {
    width: 60px !important;
    min-width: 60px !important;
    overflow: hidden;
  }
  .sidebar .nav-item span:not(.icon) {
    display: none !important;
  }
  .sidebar .logo-text,
  .sidebar .user-info,
  .sidebar .user-name,
  .sidebar .user-role {
    display: none !important;
  }
  .main-content {
    margin-left: 60px !important;
  }
  .sidebar .icon {
    font-size: 1.2rem !important;
    margin-right: 0 !important;
  }
}

/* ── Filtros de reservas responsivos ── */
@media (max-width: 1100px) {
  .filter-group {
    flex-wrap: wrap !important;
    gap: 6px !important;
  }
  .filter-group select,
  .filter-group input {
    min-width: 100px !important;
    font-size: 0.8rem !important;
  }
}

/* ── Tabelas responsivas ── */
@media (max-width: 900px) {
  .data-table {
    font-size: 0.78rem;
  }
  .data-table th,
  .data-table td {
    padding: 8px 10px !important;
  }
}

/* ── Cards de reserva responsivos ── */
@media (max-width: 768px) {
  .bookings-grid {
    grid-template-columns: 1fr !important;
  }
}

/* ── Configurações tabs em telas pequenas ── */
@media (max-width: 700px) {
  .config-tabs-header {
    gap: 2px !important;
  }
  .config-tab {
    padding: 8px 10px !important;
    font-size: 0.78rem !important;
  }
  .backup-info-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  .cal-provider-grid {
    grid-template-columns: 1fr !important;
  }
}


/* =============================================
   LOGS DE ATIVIDADES — Estilos melhorados
   ============================================= */

.log-action-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.76rem;
  font-weight: 600;
  white-space: nowrap;
}

.log-success  { background: #d1fae5; color: #065f46; }
.log-danger   { background: #fee2e2; color: #991b1b; }
.log-warning  { background: #fef3c7; color: #92400e; }
.log-info     { background: #dbeafe; color: #1e40af; }
.log-neutral  { background: #f3f4f6; color: #4b5563; }

/* Célula de detalhes com campos formatados */
.log-details-cell {
  font-size: 0.82rem;
  color: #374151;
  line-height: 1.8;
}

.log-detail-part {
  display: inline-block;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 4px;
  padding: 1px 6px;
  margin: 2px 3px 2px 0;
  font-size: 0.78rem;
}

.log-detail-part strong {
  color: #6b7280;
  font-weight: 600;
  margin-right: 3px;
}

.log-detail-plain {
  color: #4b5563;
}

.log-table td {
  vertical-align: top;
  padding: 10px 12px !important;
}

.log-table tbody tr:hover {
  background: #f8faff;
}

/* Responsivo logs */
@media (max-width: 768px) {
  .log-details-cell .log-detail-part {
    display: block;
    margin: 2px 0;
  }
}
