/* ============================================
   ESTILOS COMPLETOS - Clínica de Estética Regina
   ============================================ */

/* --- CSS Variables --- */
:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --primary-light: #e0e7ff;
  --secondary: #64748b;
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #06b6d4;
  --dark: #0f172a;
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gray-900: #0f172a;
  --sidebar-width: 260px;
  --header-height: 64px;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.05);
  --transition: all 0.2s ease;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--gray-50);
  color: var(--gray-800);
  line-height: 1.6;
  min-height: 100vh;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }
img { max-width: 100%; }

/* --- Utilities --- */
.hidden { display: none !important; }
.text-center { text-align: center; }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.text-primary { color: var(--primary); }
.my-2 { margin-block: 0.5rem; }
.mt-2 { margin-top: 0.5rem; }
.mb-2 { margin-bottom: 0.5rem; }

/* --- Login Page --- */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 1rem;
}

.login-container {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 420px;
  padding: 2.5rem;
  animation: slideUp 0.4s ease;
}

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

.login-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.login-header .logo {
  width: 180px;
  height: 180px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  font-size: 3rem;
  overflow: hidden;
}
.login-header .logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 12px;
}

.login-header h1 {
  font-size: 1.5rem;
  color: var(--dark);
  margin-bottom: 0.25rem;
}

.login-header p {
  color: var(--gray-500);
  font-size: 0.9rem;
}

.login-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  background: var(--gray-100);
  padding: 0.25rem;
  border-radius: var(--radius-sm);
}

.login-tab {
  flex: 1;
  padding: 0.625rem;
  text-align: center;
  border: none;
  background: transparent;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gray-500);
  transition: var(--transition);
}

.login-tab.active {
  background: white;
  color: var(--primary);
  box-shadow: var(--shadow);
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--gray-700);
  margin-bottom: 0.375rem;
}

.input {
  width: 100%;
  padding: 0.625rem 0.875rem;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  color: var(--gray-800);
  background: white;
  transition: var(--transition);
  font-family: inherit;
}

.input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.input-color {
  width: 48px !important;
  height: 48px !important;
  padding: 4px !important;
  cursor: pointer;
}

.autocomplete-wrap { position: relative; }

.autocomplete-sugestoes {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 1100;
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: 0 0 8px 8px;
  box-shadow: var(--shadow-lg);
  max-height: 200px;
  overflow-y: auto;
  display: none;
}
.autocomplete-sugestoes.ativo { display: block; }
.autocomplete-sugestoes .item {
  padding: 0.6rem 0.875rem;
  cursor: pointer;
  font-size: 0.9rem;
  transition: background 0.1s;
}
.autocomplete-sugestoes .item:hover,
.autocomplete-sugestoes .item.selecionado { background: var(--primary-light); }

.servico-select-row {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
}
.servico-select-row select {
  flex: 1;
  min-width: 0;
}
.servico-select-row .btn {
  min-width: 42px;
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1;
}

.servicos-selecionados {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
  min-height: 0;
}

.servico-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #fff;
  line-height: 1.4;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.servico-tag .servico-tag-remove {
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  opacity: 0.7;
  transition: opacity 0.15s;
  background: none;
  border: none;
  color: inherit;
  padding: 0;
  margin: 0;
  margin-left: 0.15rem;
}

.servico-tag .servico-tag-remove:hover {
  opacity: 1;
}

.servicos-totais {
  margin-top: 0.75rem;
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  padding: 0.6rem 0.75rem;
  background: var(--gray-50);
  border-radius: 8px;
  font-size: 0.85rem;
}

textarea.input {
  resize: vertical;
  min-height: 60px;
  font-family: inherit;
}

select.input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2rem;
}

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

.form-checkbox {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.form-checkbox input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
}

.form-checkbox label {
  font-size: 0.875rem;
  color: var(--gray-600);
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
  white-space: nowrap;
}

.btn:active { transform: scale(0.98); }

.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); }

.btn-secondary { background: var(--gray-200); color: var(--gray-700); }
.btn-secondary:hover { background: var(--gray-300); }

.btn-success { background: var(--success); color: white; }
.btn-success:hover { background: #16a34a; }

.btn-warning { background: var(--warning); color: white; }
.btn-warning:hover { background: #d97706; }

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

.btn-info { background: var(--info); color: white; }
.btn-info:hover { background: #0891b2; }

.btn-sm { padding: 0.375rem 0.75rem; font-size: 0.8rem; }

.btn-full { width: 100%; }

.btn-link {
  background: none;
  border: none;
  color: var(--primary);
  cursor: pointer;
  font-size: 0.85rem;
  padding: 0;
  font-family: inherit;
}

.btn-link:hover { text-decoration: underline; }

.btn-icon {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.375rem;
  border-radius: 6px;
  font-size: 1.1rem;
  transition: var(--transition);
}

.btn-icon:hover { background: var(--gray-100); }

/* --- Dashboard Layout --- */
.dashboard {
  display: flex;
  min-height: 100vh;
}

/* --- Sidebar --- */
.sidebar {
  width: var(--sidebar-width);
  background: white;
  border-right: 1px solid var(--gray-200);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 100;
  transition: var(--transition);
}

.sidebar.collapsed {
  width: 72px;
}

.sidebar.collapsed .sidebar-brand span,
.sidebar.collapsed .nav-item span,
.sidebar.collapsed .nav-item .nav-badge {
  display: none;
}

.sidebar-brand {
  padding: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid var(--gray-200);
  min-height: var(--header-height);
}

.sidebar-brand .brand-icon {
  width: 96px;
  height: 96px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
  overflow: hidden;
}
.sidebar-brand .brand-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 10px;
}

.sidebar-nav {
  flex: 1;
  padding: 0.75rem;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0.875rem;
  border-radius: var(--radius-sm);
  color: var(--gray-600);
  cursor: pointer;
  transition: var(--transition);
  margin-bottom: 2px;
  white-space: nowrap;
  position: relative;
}

.nav-item:hover {
  background: var(--gray-100);
  color: var(--gray-800);
}

.nav-item.active {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 500;
}

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

.nav-badge {
  margin-left: auto;
  background: var(--danger);
  color: white;
  font-size: 0.7rem;
  padding: 0.125rem 0.5rem;
  border-radius: 10px;
  font-weight: 600;
}

.sidebar-footer {
  padding: 0.75rem;
  border-top: 1px solid var(--gray-200);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem;
  border-radius: var(--radius-sm);
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), #8b5cf6);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 0.85rem;
  font-weight: 600;
  flex-shrink: 0;
}

.user-details {
  overflow: hidden;
}

.user-details .user-name {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--gray-800);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-details .user-role {
  font-size: 0.75rem;
  color: var(--gray-400);
}

.btn-logout {
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.5rem;
  background: none;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.8rem;
  color: var(--gray-500);
  font-family: inherit;
  transition: var(--transition);
}

.btn-logout:hover {
  border-color: var(--danger);
  color: var(--danger);
  background: #fef2f2;
}

/* --- Main Content --- */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  transition: var(--transition);
}

.sidebar.collapsed + .main-content {
  margin-left: 72px;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 2rem 1rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.page-header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--dark);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.search-box {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.search-box .input {
  min-width: 260px;
}

.filtros {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.filtros .input {
  min-width: 180px;
}

/* --- Page Content --- */
#page-content {
  padding: 0 2rem 2rem;
}

/* --- Cards --- */
.card {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.card h3 {
  font-size: 1.1rem;
  margin-bottom: 1rem;
  color: var(--dark);
}

/* --- Resumo Grid --- */
.resumo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.resumo-card {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: var(--transition);
}

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

.resumo-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}

.resumo-info {
  display: flex;
  flex-direction: column;
}

.resumo-valor {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--dark);
  line-height: 1.2;
}

.resumo-label {
  font-size: 0.8rem;
  color: var(--gray-500);
}

/* --- Tables --- */
.table-container {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  overflow-x: auto;
}

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

thead {
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-200);
}

th {
  text-align: left;
  padding: 0.75rem 1rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

td {
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  color: var(--gray-700);
  border-bottom: 1px solid var(--gray-100);
}

tr:last-child td {
  border-bottom: none;
}

tr:hover td {
  background: var(--gray-50);
}

td .actions {
  display: flex;
  gap: 0.25rem;
}

/* --- Status Badge --- */
.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.625rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: capitalize;
}

.status-agendado { background: #e0e7ff; color: #4338ca; }
.status-confirmado { background: #dcfce7; color: #16a34a; }
.status-em_andamento { background: #fef3c7; color: #d97706; }
.status-concluido { background: #cffafe; color: #0891b2; }
.status-cancelado { background: #fef2f2; color: #dc2626; }
.status-faltou { background: #f3e8ff; color: #7c3aed; }
.status-ativo { background: #dcfce7; color: #16a34a; }
.status-inativo { background: #fef2f2; color: #dc2626; }

/* --- Color Dot --- */
.color-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 0.5rem;
  vertical-align: middle;
}

/* --- Modals --- */
.modal > form {
  padding: 1.5rem;
}

.modal > form .modal-footer {
  padding: 1rem 0 0;
  margin-top: 1rem;
  border-top: 1px solid var(--gray-200);
}

.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-overlay.ativo {
  display: flex;
}

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

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--gray-200);
}

.modal-header h2 {
  font-size: 1.15rem;
  color: var(--dark);
}

.btn-fechar-modal {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--gray-400);
  cursor: pointer;
  padding: 0.25rem;
  line-height: 1;
  transition: var(--transition);
}

.btn-fechar-modal:hover { color: var(--gray-600); }

.modal-body {
  padding: 1.5rem;
}

.modal-detalhe-valor {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--gray-200);
}

.acoes-status {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--gray-200);
}

/* --- Detalhes Grid --- */
.detalhes-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.detalhe-item {
  background: var(--gray-50);
  border-radius: 8px;
  padding: 0.75rem 1rem;
}

.detalhe-item.full-width { grid-column: 1 / -1; }

.detalhe-item label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 0.25rem;
}

.detalhe-item span {
  font-size: 0.95rem;
  color: var(--dark);
  font-weight: 500;
}

.detalhe-item label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--gray-400);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
}

.detalhe-item span {
  font-size: 0.95rem;
  color: var(--gray-800);
}

.acoes-status {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--gray-200);
}

/* --- Notificações --- */
#notificacoes {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.notificacao {
  padding: 0.875rem 1.25rem;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  font-size: 0.875rem;
  font-weight: 500;
  animation: notifIn 0.3s ease;
  pointer-events: all;
  max-width: 380px;
}

.notificacao-success { background: #dcfce7; color: #16a34a; border-left: 4px solid #16a34a; }
.notificacao-error { background: #fef2f2; color: #dc2626; border-left: 4px solid #dc2626; }
.notificacao-warning { background: #fef3c7; color: #d97706; border-left: 4px solid #d97706; }
.notificacao-info { background: #e0e7ff; color: #4338ca; border-left: 4px solid #6366f1; }

.notificacao-saindo {
  animation: notifOut 0.3s ease forwards;
}

@keyframes notifIn {
  from { opacity: 0; transform: translateX(100%); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes notifOut {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(100%); }
}

/* --- FullCalendar Overrides --- */
#calendar {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem;
}

.fc {
  font-family: inherit !important;
}

.fc .fc-toolbar-title {
  font-size: 1.15rem !important;
  font-weight: 600 !important;
  color: var(--dark);
}

.fc .fc-button-primary {
  background: var(--gray-100) !important;
  border: 1px solid var(--gray-200) !important;
  color: var(--gray-700) !important;
  font-weight: 500 !important;
  font-size: 0.8rem !important;
  padding: 0.375rem 0.75rem !important;
  text-transform: capitalize !important;
  box-shadow: none !important;
}

.fc .fc-button-primary:not(:disabled):hover {
  background: var(--gray-200) !important;
  border-color: var(--gray-300) !important;
}

.fc .fc-button-primary:not(:disabled).fc-button-active {
  background: var(--primary) !important;
  border-color: var(--primary) !important;
  color: white !important;
}

.fc .fc-daygrid-day-number,
.fc .fc-col-header-cell-cushion {
  color: var(--gray-700);
  text-decoration: none;
  padding: 0.375rem;
}

.fc .fc-day-today {
  background: var(--primary-light) !important;
}

.fc .fc-timegrid-slot {
  height: 2.5rem;
}

.fc .fc-event {
  border-radius: 6px !important;
  padding: 2px 6px !important;
  font-size: 0.8rem !important;
  border: none !important;
  cursor: pointer;
  transition: var(--transition);
}

.fc .fc-event:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.fc .fc-more-popover {
  border-radius: var(--radius-sm) !important;
  box-shadow: var(--shadow-lg) !important;
}

.fc .fc-more-popover .fc-popover-header {
  background: var(--gray-50) !important;
  padding: 0.5rem 0.75rem !important;
}

/* --- Relatorios Grid --- */
.relatorios-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

/* --- Page Placeholder --- */
.page-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  color: var(--gray-400);
}

/* --- Loading --- */
#calendar-loading {
  text-align: center;
  padding: 1rem;
  color: var(--gray-500);
}

/* --- Scrollbar --- */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--gray-300);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--gray-400);
}

/* --- File Input --- */
.input[type="file"] {
  padding: 0.5rem 0.875rem;
  cursor: pointer;
}

/* --- Mobile Sidebar Toggle --- */
.mobile-toggle {
  display: none;
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 99;
  width: 40px;
  height: 40px;
  border: none;
  background: white;
  border-radius: 10px;
  box-shadow: var(--shadow-md);
  font-size: 1.3rem;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.mobile-toggle:hover {
  background: var(--gray-100);
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 99;
}

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

.no-scroll {
  overflow: hidden;
}

/* --- Responsive --- */
@media (max-width: 1024px) {
  .relatorios-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 960px) {
  .fc .fc-toolbar {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .fc .fc-toolbar-title {
    font-size: 1rem !important;
  }

  .fc .fc-button {
    font-size: 0.75rem !important;
    padding: 0.3rem 0.5rem !important;
  }

  .fc .fc-toolbar-chunk {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
  }
}

@media (max-width: 768px) {
  .mobile-toggle {
    display: flex;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 100;
    transform: translateX(-100%);
    width: var(--sidebar-width);
    box-shadow: none;
    transition: transform 0.3s ease;
  }

  .sidebar.mobile-open {
    transform: translateX(0);
    box-shadow: var(--shadow-lg);
  }

  .sidebar.mobile-open .sidebar-brand span,
  .sidebar.mobile-open .nav-item span,
  .sidebar.mobile-open .user-details {
    display: inline;
  }

  .main-content {
    margin-left: 0 !important;
    padding-top: 60px;
  }

  .page-header {
    padding: 0.75rem 1rem 0.5rem;
    flex-direction: column;
    align-items: stretch;
  }

  .page-header h1 {
    font-size: 1.15rem;
  }

  .header-actions {
    flex-direction: column;
    width: 100%;
  }

  .search-box {
    width: 100%;
  }

  .search-box .input {
    flex: 1;
    min-width: 0;
  }

  .filtros {
    flex-direction: column;
    width: 100%;
  }

  .filtros .input {
    width: 100%;
    min-width: 0;
  }

  #page-content {
    padding: 0 1rem 1rem;
  }

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

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

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

  .resumo-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .resumo-valor {
    font-size: 1.2rem;
  }

  .resumo-icon {
    width: 40px;
    height: 40px;
    font-size: 1.1rem;
  }

  .login-container {
    padding: 1.5rem;
  }

  .modal {
    max-width: 100%;
    margin: 0.5rem;
    max-height: 85vh;
  }

  .modal-header {
    padding: 1rem 1.25rem;
  }

  .modal-body {
    padding: 1rem 1.25rem;
  }

  .modal-footer {
    padding: 0.75rem 1.25rem;
    flex-wrap: wrap;
  }

  .modal-footer .btn {
    flex: 1;
    min-width: 0;
  }

  .card {
    padding: 1rem;
  }

  table {
    font-size: 0.85rem;
  }

  th, td {
    padding: 0.5rem 0.625rem;
  }

  .btn {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
  }

  .btn-sm {
    padding: 0.3rem 0.6rem;
    font-size: 0.75rem;
  }

  .acoes-status {
    flex-direction: column;
  }

  .acoes-status .btn {
    width: 100%;
  }

  .fc .fc-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }

  .fc .fc-toolbar-chunk {
    justify-content: center;
  }

  .fc .fc-header-toolbar {
    margin-bottom: 0.75em !important;
  }

  .fc .fc-daygrid-day-number {
    font-size: 0.8rem;
    padding: 0.25rem;
  }

  .fc .fc-col-header-cell-cushion {
    font-size: 0.75rem;
  }

  .fc .fc-timegrid-slot {
    height: 2rem;
  }

  .fc .fc-timegrid-now-indicator {
    border-width: 2px;
  }

  #calendar {
    padding: 0.75rem;
  }

  .notificacao {
    max-width: calc(100vw - 2rem);
    font-size: 0.8rem;
    padding: 0.75rem 1rem;
  }

  .table-container {
    border-radius: var(--radius-sm);
  }

  .btn-link {
    font-size: 0.8rem;
  }
}

.paginacao {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 0;
}

.btn-pag {
  background: var(--bg);
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-sm);
  padding: 0.375rem 0.75rem;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  color: var(--text);
  transition: all 0.15s;
}

.btn-pag:hover:not(:disabled) {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.btn-pag:disabled {
  opacity: 0.4;
  cursor: default;
}

.pag-info {
  font-size: 0.85rem;
  color: var(--gray-500);
}

@media (max-width: 480px) {
  .resumo-grid {
    grid-template-columns: 1fr;
    gap: 0.625rem;
  }

  .resumo-card {
    padding: 1rem;
  }

  .resumo-valor {
    font-size: 1.1rem;
  }

  .login-container {
    padding: 1.25rem;
  }

  .login-header .logo {
    width: 52px;
    height: 52px;
    font-size: 1.5rem;
  }

  .login-header h1 {
    font-size: 1.2rem;
  }

  .sidebar {
    width: 85vw;
    max-width: 320px;
  }

  .sidebar.mobile-open {
    width: 85vw;
  }

  th, td {
    padding: 0.375rem 0.5rem;
    font-size: 0.8rem;
  }

  td .actions {
    flex-wrap: wrap;
  }

  td .actions .btn {
    font-size: 0.7rem;
    padding: 0.25rem 0.5rem;
  }

  .fc .fc-toolbar-title {
    font-size: 0.9rem !important;
  }

  .fc .fc-button {
    font-size: 0.7rem !important;
    padding: 0.25rem 0.4rem !important;
  }

  .page-header h1 {
    font-size: 1rem;
  }
}

@media (max-width: 360px) {
  .card {
    padding: 0.75rem;
  }

  .btn {
    font-size: 0.8rem;
    padding: 0.4rem 0.75rem;
  }

  th, td {
    padding: 0.3rem 0.4rem;
    font-size: 0.75rem;
  }
}
